@fjell/client-api 4.4.13 → 4.4.15
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/AItemAPI.d.ts +4 -4
- package/dist/CItemAPI.d.ts +5 -5
- package/dist/ClientApi.d.ts +1 -1
- package/dist/ClientApiOptions.d.ts +3 -3
- package/dist/Instance.d.ts +3 -3
- package/dist/InstanceFactory.d.ts +3 -3
- package/dist/PItemAPI.d.ts +4 -4
- package/dist/Utilities.d.ts +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +544 -5
- package/dist/index.js.map +7 -1
- package/dist/logger.d.ts +1 -1
- package/dist/ops/action.d.ts +4 -4
- package/dist/ops/all.d.ts +4 -4
- package/dist/ops/allAction.d.ts +4 -4
- package/dist/ops/allFacet.d.ts +4 -4
- package/dist/ops/create.d.ts +4 -4
- package/dist/ops/facet.d.ts +4 -4
- package/dist/ops/find.d.ts +4 -4
- package/dist/ops/findOne.d.ts +4 -4
- package/dist/ops/get.d.ts +4 -4
- package/dist/ops/index.d.ts +5 -5
- package/dist/ops/one.d.ts +4 -4
- package/dist/ops/remove.d.ts +4 -4
- package/dist/ops/update.d.ts +4 -4
- package/package.json +11 -14
- package/vitest.config.ts +25 -0
- package/dist/AItemAPI.js +0 -52
- package/dist/AItemAPI.js.map +0 -1
- package/dist/CItemAPI.js +0 -30
- package/dist/CItemAPI.js.map +0 -1
- package/dist/Instance.js +0 -19
- package/dist/Instance.js.map +0 -1
- package/dist/InstanceFactory.js +0 -19
- package/dist/InstanceFactory.js.map +0 -1
- package/dist/PItemAPI.js +0 -44
- package/dist/PItemAPI.js.map +0 -1
- package/dist/Registry.js +0 -31
- package/dist/Registry.js.map +0 -1
- package/dist/Utilities.js +0 -153
- package/dist/Utilities.js.map +0 -1
- package/dist/index.cjs +0 -586
- package/dist/index.cjs.map +0 -1
- package/dist/logger.js +0 -6
- package/dist/logger.js.map +0 -1
- package/dist/ops/action.js +0 -21
- package/dist/ops/action.js.map +0 -1
- package/dist/ops/all.js +0 -25
- package/dist/ops/all.js.map +0 -1
- package/dist/ops/allAction.js +0 -24
- package/dist/ops/allAction.js.map +0 -1
- package/dist/ops/allFacet.js +0 -24
- package/dist/ops/allFacet.js.map +0 -1
- package/dist/ops/create.js +0 -23
- package/dist/ops/create.js.map +0 -1
- package/dist/ops/facet.js +0 -34
- package/dist/ops/facet.js.map +0 -1
- package/dist/ops/find.js +0 -26
- package/dist/ops/find.js.map +0 -1
- package/dist/ops/findOne.js +0 -27
- package/dist/ops/findOne.js.map +0 -1
- package/dist/ops/get.js +0 -19
- package/dist/ops/get.js.map +0 -1
- package/dist/ops/index.js +0 -32
- package/dist/ops/index.js.map +0 -1
- package/dist/ops/one.js +0 -30
- package/dist/ops/one.js.map +0 -1
- package/dist/ops/remove.js +0 -19
- package/dist/ops/remove.js.map +0 -1
- package/dist/ops/update.js +0 -20
- package/dist/ops/update.js.map +0 -1
- package/docs/docs.config.ts +0 -77
- package/docs/index.html +0 -18
- package/docs/package.json +0 -34
- package/docs/public/README.md +0 -165
- package/docs/public/api-reference.md +0 -408
- package/docs/public/examples-README.md +0 -387
- package/docs/public/fjell-icon.svg +0 -1
- package/docs/public/package.json +0 -5
- package/docs/src/index.css +0 -34
- package/docs/src/main.tsx +0 -12
- package/docs/src/test/setup.ts +0 -1
- package/docs/src/types.d.ts +0 -44
- package/docs/tsconfig.node.json +0 -13
- package/docs/vitest.config.ts +0 -14
- package/examples/README.md +0 -387
- package/examples/enterprise-example.ts +0 -852
- package/examples/multi-level-keys.ts +0 -467
- package/examples/simple-example.ts +0 -346
package/dist/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ops/all.ts", "../src/logger.ts", "../src/ops/action.ts", "../src/ops/allAction.ts", "../src/ops/one.ts", "../src/ops/create.ts", "../src/ops/update.ts", "../src/ops/get.ts", "../src/ops/remove.ts", "../src/ops/find.ts", "../src/ops/findOne.ts", "../src/ops/facet.ts", "../src/ops/allFacet.ts", "../src/ops/index.ts", "../src/Utilities.ts", "../src/AItemAPI.ts", "../src/CItemAPI.ts", "../src/PItemAPI.ts", "../src/Instance.ts", "../src/InstanceFactory.ts", "../src/Registry.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n Item,\n ItemQuery,\n LocKeyArray,\n queryToParams,\n} from \"@fjell/core\";\nimport { HttpApi, QueryParams } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'all');\n\nexport const getAllOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const all = async (\n query: ItemQuery = {} as ItemQuery,\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V[]> => {\n utilities.verifyLocations(locations);\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n const params: QueryParams = queryToParams(query);\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.allAuthenticated, params });\n\n logger.default('all', { query, locations, requestOptions });\n\n return utilities.validatePK(await utilities.processArray(\n api.httpGet<V[]>(\n utilities.getPath(loc),\n requestOptions,\n ))) as V[];\n }\n\n return all;\n}\n\n", "import Logging from '@fjell/logging';\n\nconst LibLogger = Logging.getLogger('@fjell/client-api');\n\nexport default LibLogger;\n", "import {\n ComKey,\n Item,\n PriKey,\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'action');\n\nexport const getActionOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const action = async (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n action: string,\n body: any = {},\n ): Promise<V> => {\n const requestOptions = Object.assign({}, apiOptions.postOptions, { isAuthenticated: apiOptions.writeAuthenticated });\n logger.default('action', { ik, action, body, requestOptions });\n\n return utilities.validatePK(\n await utilities.processOne(\n api.httpPost<V>(\n `${utilities.getPath(ik)}/${action}`,\n body,\n requestOptions,\n )\n )) as V;\n\n };\n\n return action;\n}\n", "import {\n Item,\n LocKeyArray\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'allAction');\n\nexport const getAllActionOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const allAction = async (\n action: string,\n body: any = {},\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V[]> => {\n const requestOptions = Object.assign({}, apiOptions.postOptions, { isAuthenticated: apiOptions.writeAuthenticated });\n logger.default('allAction', { action, body, locations, requestOptions });\n utilities.verifyLocations(locations);\n\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n // TODO: This should respond to either a single object, or multiple objects in an array.\n return utilities.validatePK(\n await utilities.processArray(\n api.httpPost<V[]>(\n utilities.getPath(loc),\n body,\n requestOptions,\n )\n )) as V[];\n };\n\n return allAction;\n}\n", "import {\n Item,\n ItemQuery,\n LocKeyArray,\n QueryParams,\n queryToParams\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'one');\n\nexport const getOneOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ): (\n query: ItemQuery,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V | null> => {\n\n const one = async (\n query: ItemQuery = {} as ItemQuery,\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V | null> => {\n utilities.verifyLocations(locations);\n\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n const params: QueryParams = queryToParams(query);\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.readAuthenticated, params });\n logger.default('one', { query, locations, requestOptions });\n\n let item: V | null = null;\n\n const items = utilities.validatePK(await utilities.processArray(\n api.httpGet<V[]>(\n utilities.getPath(loc),\n requestOptions,\n ))) as V[];\n\n if (items.length > 0) {\n item = items[0];\n }\n\n return item as V;\n }\n\n return one;\n}\n", "import {\n Item,\n LocKeyArray\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'create');\n\nexport const getCreateOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const create = async (\n item: Partial<Item<S, L1, L2, L3, L4, L5>>,\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V> => {\n const requestOptions = Object.assign({}, apiOptions.postOptions, { isAuthenticated: apiOptions.writeAuthenticated });\n logger.default('create', { item, locations, requestOptions });\n utilities.verifyLocations(locations);\n\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n const created: V =\n utilities.validatePK(await utilities.processOne(api.httpPost<V>(\n utilities.getPath(loc),\n item,\n requestOptions,\n ))) as V;\n return created;\n };\n\n return create;\n}\n", "import {\n ComKey,\n Item,\n PriKey\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'update');\n\nexport const getUpdateOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const update = async (\n ik: PriKey<S> | ComKey<S, L1, L2, L3, L4, L5>,\n item: Partial<Item<S, L1, L2, L3, L4, L5>>,\n ): Promise<V> => {\n const requestOptions = Object.assign({}, apiOptions.putOptions, { isAuthenticated: apiOptions.writeAuthenticated });\n logger.default('update', { ik, item, requestOptions });\n\n return utilities.validatePK(await utilities.processOne(\n api.httpPut<V>(\n utilities.getPath(ik),\n item,\n requestOptions,\n ))) as V;\n }\n\n return update;\n}\n", "import {\n ComKey,\n Item,\n PriKey,\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'get');\n\nexport const getGetOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const get = async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n ): Promise<V | null> => {\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.readAuthenticated });\n logger.default('get', { ik, requestOptions });\n\n return utilities.validatePK(await utilities.processOne(\n api.httpGet<V>(\n utilities.getPath(ik),\n requestOptions,\n ))) as V;\n }\n\n return get;\n}\n", "import {\n ComKey,\n Item,\n PriKey,\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'remove');\n\nexport const getRemoveOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const remove = async (\n ik: PriKey<S> | ComKey<S, L1, L2, L3, L4, L5>,\n ): Promise<boolean> => {\n const requestOptions = Object.assign({}, apiOptions.deleteOptions, { isAuthenticated: apiOptions.writeAuthenticated });\n logger.default('remove', { ik, requestOptions });\n\n return api.httpDelete<boolean>(utilities.getPath(ik), requestOptions);\n }\n\n return remove;\n}\n", "import {\n Item,\n LocKeyArray,\n QueryParams\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { finderToParams } from \"@/AItemAPI\";\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'find');\n\nexport const getFindOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const find = async (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>> = {},\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V[]> => {\n utilities.verifyLocations(locations);\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n const mergedParams: QueryParams = finderToParams(finder, finderParams);\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.allAuthenticated, params: mergedParams });\n logger.default('find', { finder, finderParams, locations, requestOptions });\n\n return utilities.validatePK(await utilities.processArray(\n api.httpGet<V[]>(\n utilities.getPath(loc),\n requestOptions,\n ))) as V[];\n }\n\n return find;\n}\n", "import {\n Item,\n LocKeyArray,\n QueryParams\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { finderToParams } from \"@/AItemAPI\";\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'find');\n\nexport const getFindOneOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const findOne = async (\n finder: string,\n finderParams: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>> = {},\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V> => {\n utilities.verifyLocations(locations);\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n const params: QueryParams = finderToParams(finder, finderParams);\n params.one = true;\n\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.allAuthenticated, params });\n logger.default('findOne', { finder, finderParams, locations, requestOptions });\n\n return (utilities.validatePK(await utilities.processArray(\n api.httpGet<V[]>(\n utilities.getPath(loc),\n requestOptions,\n ))) as V[])[0];\n }\n\n return findOne;\n}\n", "import {\n ComKey,\n Item,\n PriKey,\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'facet');\n\nexport const getFacetOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n /**\n * Executes a facet operation on an item.\n *\n * A facet is a piece of information that is related to an item - it represents\n * a specific aspect or characteristic of the item. Unlike actions which may\n * return items or perform operations, facets are informational queries that\n * return data about a particular facet of an item.\n *\n * @param ik - The item key (composite or primary key) identifying the item\n * @param facet - The name of the facet to query\n * @param body - Optional request body for the facet operation\n * @param options - Optional HTTP request options\n * @returns Promise resolving to the facet data\n */\n const facet = async (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n facet: string,\n params: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>> = {},\n ): Promise<any> => {\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.writeAuthenticated, params });\n logger.default('facet', { ik, facet, requestOptions });\n\n return api.httpGet<any>(\n `${utilities.getPath(ik)}/${facet}`,\n requestOptions,\n );\n\n };\n\n return facet;\n}\n", "import {\n Item,\n LocKeyArray\n} from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\n\nimport { ClientApiOptions } from \"@/ClientApiOptions\";\nimport LibLogger from \"@/logger\";\nimport { Utilities } from \"@/Utilities\";\n\nconst logger = LibLogger.get('client-api', 'ops', 'allFacet');\n\nexport const getAllFacetOperation = <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>\n\n ) => {\n\n const allFacet = async (\n facet: string,\n params: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>> = {},\n locations: LocKeyArray<L1, L2, L3, L4, L5> | [] = []\n ): Promise<V[]> => {\n const requestOptions = Object.assign({}, apiOptions.getOptions, { isAuthenticated: apiOptions.writeAuthenticated, params });\n logger.default('allFacet', { facet, locations, requestOptions });\n utilities.verifyLocations(locations);\n\n const loc: LocKeyArray<L1, L2, L3, L4, L5> | [] = locations;\n\n // TODO: This should respond to either a single object, or multiple objects in an array.\n return api.httpGet<V[]>(\n utilities.getPath(loc),\n requestOptions,\n )\n };\n\n return allFacet;\n}\n", "/* eslint-disable indent */\nimport { Item } from \"@fjell/core\"\nimport { getAllOperation } from \"./all\"\nimport { getActionOperation } from \"./action\"\nimport { Utilities } from \"@/Utilities\"\nimport { HttpApi } from \"@fjell/http-api\"\nimport { getAllActionOperation } from \"./allAction\"\nimport { getOneOperation } from \"./one\"\nimport { getCreateOperation } from \"./create\"\nimport { getUpdateOperation } from \"./update\"\nimport { getGetOperation } from \"./get\"\nimport { getRemoveOperation } from \"./remove\"\nimport { getFindOperation } from \"./find\"\nimport { ClientApiOptions } from \"@/ClientApiOptions\"\nimport { ClientApi } from \"@/ClientApi\"\nimport { getFindOneOperation } from \"./findOne\"\nimport { getFacetOperation } from \"./facet\"\nimport { getAllFacetOperation } from \"./allFacet\"\n\nexport const getOperations =\n <\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 api: HttpApi,\n apiOptions: ClientApiOptions,\n utilities: Utilities<V, S, L1, L2, L3, L4, L5>,\n\n ): ClientApi<V, S, L1, L2, L3, L4, L5> => {\n return {\n action: getActionOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n all: getAllOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n allAction: getAllActionOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n allFacet: getAllFacetOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n create: getCreateOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n facet: getFacetOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n findOne: getFindOneOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n find: getFindOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n get: getGetOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n one: getOneOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n remove: getRemoveOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n update: getUpdateOperation<V, S, L1, L2, L3, L4, L5>(\n api,\n apiOptions,\n utilities,\n ),\n }\n }", "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", "/* 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 getOptions: {},\n postOptions: {},\n putOptions: {},\n deleteOptions: {},\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 allFacet: operations.allFacet,\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}", "\nimport {\n ComKey,\n Item,\n ItemQuery,\n LocKeyArray,\n PriKey,\n} from \"@fjell/core\";\nimport {\n HttpApi\n} from \"@fjell/http-api\";\nimport { createAItemAPI, PathNamesArray } from \"./AItemAPI\";\n\nimport LibLogger from \"@/logger\";\nimport { ClientApi } from \"./ClientApi\";\nimport { ClientApiOptions } from \"./ClientApiOptions\";\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 ) => Promise<V>;\n all: (\n query: ItemQuery,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n allAction: (\n action: string,\n body?: any,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n allFacet: (\n facet: string,\n params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<any>;\n get: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n ) => Promise<V | null>;\n create: (\n item: Partial<Item<S, L1, L2, L3, L4, L5>>,\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 ) => Promise<boolean>;\n update: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n item: Partial<Item<S, L1, L2, L3, L4, L5>>,\n ) => Promise<V>;\n facet: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n facet: string,\n params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n ) => Promise<any>;\n find: (\n finder: string,\n finderParams?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\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 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 allFacet: aItemAPI.allFacet,\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", "import { ComKey, Item, ItemQuery, PriKey } from \"@fjell/core\";\nimport { HttpApi } from \"@fjell/http-api\";\nimport { createAItemAPI } from \"./AItemAPI\";\nimport { ClientApi } from \"./ClientApi\";\n\nimport LibLogger from \"@/logger\";\nimport { ClientApiOptions } from \"./ClientApiOptions\";\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 ) => Promise<V>;\n\n all: (\n query: ItemQuery,\n ) => Promise<V[]>;\n\n allAction: (\n action: string,\n body?: any,\n ) => Promise<V[]>;\n\n allFacet: (\n facet: string,\n params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n ) => Promise<any>;\n\n one: (\n query: ItemQuery,\n ) => Promise<V | null>;\n\n get: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n ) => Promise<V | null>;\n\n create: (\n item: Partial<Item<S>>,\n ) => Promise<V>;\n\n remove: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n ) => Promise<boolean>;\n\n update: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n item: Partial<Item<S>>,\n ) => Promise<V>;\n\n facet: (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n facet: string,\n params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n ) => Promise<any>;\n\n find: (\n finder: string,\n finderParams?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n ) => Promise<V[]>;\n\n findOne: (\n finder: string,\n finderParams?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\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 ): Promise<V> =>\n await aItemAPI.action(ik, action, body) as V;\n\n const all =\n async (\n query: ItemQuery = {} as ItemQuery,\n ): Promise<V[]> =>\n await aItemAPI.all(query, []) as V[];\n\n const allAction =\n async (\n action: string,\n body: any = {},\n ): Promise<V[]> =>\n await aItemAPI.allAction(action, body, []) as V[];\n\n const allFacet =\n async (\n facet: string,\n params: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>> = {},\n ): Promise<any> =>\n await aItemAPI.allFacet(facet, params) as any;\n\n const one =\n async (\n query: ItemQuery = {} as ItemQuery,\n ): Promise<V | null> =>\n await aItemAPI.one(query, []) as V | null;\n\n const get =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n ): Promise<V | null> =>\n await aItemAPI.get(ik) as V | null;\n\n const create =\n async (\n item: Partial<Item<S>>,\n ): Promise<V> =>\n await aItemAPI.create(item, []) as V;\n\n const remove =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n ): Promise<boolean> =>\n await aItemAPI.remove(ik) as boolean;\n\n const update =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n item: Partial<Item<S>>,\n ): Promise<V> =>\n await aItemAPI.update(ik, item) as V;\n\n const facet =\n async (\n ik: PriKey<S> | ComKey<S, never, never, never, never, never>,\n facet: string,\n params: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>> = {},\n ): Promise<any> =>\n await aItemAPI.facet(ik, facet, params) 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 ): Promise<V[]> =>\n await aItemAPI.find(finder, finderParams) 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 ): Promise<V> =>\n await aItemAPI.findOne(finder, finderParams) as V;\n\n return {\n ...aItemAPI,\n action,\n all,\n allAction,\n allFacet,\n one,\n get,\n create,\n remove,\n update,\n facet,\n find,\n findOne,\n };\n\n};\n", "\nimport LibLogger from \"@/logger\";\nimport { Item } from \"@fjell/core\";\nimport { Instance as BaseInstance, Coordinate, createInstance as createBaseInstance, Registry } from \"@fjell/registry\";\nimport { ClientApi } from \"./ClientApi\";\n\nconst logger = LibLogger.get(\"Instance\");\n\n/**\n * The Client API Instance interface represents a client API model instance that extends the base Instance\n * from @fjell/registry and adds client API operations for interacting with remote data.\n *\n * The interface extends the base Instance (which provides coordinate and registry) with:\n * - clientApi: Provides methods for interacting with remote data through HTTP APIs (get, create, update, etc.)\n *\n * @template V - The type of the data model item, extending Item\n * @template S - The string literal type representing the model's key type\n * @template L1-L5 - Optional string literal types for location hierarchy levels\n */\nexport interface Instance<\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> extends BaseInstance<S, L1, L2, L3, L4, L5> {\n /** The client API object that provides methods for interacting with remote data */\n clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>;\n}\n\nexport const createInstance = <\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 registry: Registry,\n coordinate: Coordinate<S, L1, L2, L3, L4, L5>,\n clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>,\n ): Instance<V, S, L1, L2, L3, L4, L5> => {\n logger.debug(\"createInstance\", { coordinate, clientApi, registry });\n const baseInstance = createBaseInstance(registry, coordinate);\n return { ...baseInstance, clientApi };\n}\n", "import { Item } from \"@fjell/core\";\nimport { ClientApi } from \"./ClientApi\";\nimport { InstanceFactory as BaseInstanceFactory, Registry, RegistryHub } from \"@fjell/registry\";\nimport { createInstance, Instance } from \"./Instance\";\nimport { Coordinate } from \"@fjell/registry\";\nimport LibLogger from \"@/logger\";\n\nconst logger = LibLogger.get(\"InstanceFactory\");\n\nexport type InstanceFactory<\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 clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>\n) => BaseInstanceFactory<S, L1, L2, L3, L4, L5>;\n\n/**\n * Factory function for creating client-api instances\n */\nexport const createInstanceFactory = <\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 clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>\n ): BaseInstanceFactory<S, L1, L2, L3, L4, L5> => {\n return (coordinate: Coordinate<S, L1, L2, L3, L4, L5>, context: { registry: Registry, registryHub?: RegistryHub }) => {\n logger.debug(\"Creating client-api instance\", { coordinate, registry: context.registry, clientApi });\n\n return createInstance(context.registry, coordinate, clientApi) as Instance<V, S, L1, L2, L3, L4, L5>;\n };\n};\n", "import LibLogger from '@/logger';\nimport {\n Registry as BaseRegistry,\n createRegistry as createBaseRegistry,\n RegistryFactory,\n RegistryHub\n} from '@fjell/registry';\n\nconst logger = LibLogger.get(\"Registry\");\n\n/**\n * Extended Registry interface for client-api-specific functionality\n */\nexport interface Registry extends BaseRegistry {\n type: 'client-api';\n}\n\n/**\n * Factory function for creating client-api registries\n */\nexport const createRegistryFactory = (): RegistryFactory => {\n return (type: string, registryHub?: RegistryHub): BaseRegistry => {\n if (type !== 'client-api') {\n throw new Error(`Client API registry factory can only create 'client-api' type registries, got: ${type}`);\n }\n\n logger.debug(\"Creating client-api registry\", { type, registryHub });\n\n const baseRegistry = createBaseRegistry(type, registryHub);\n\n // Cast to Registry for type safety\n return baseRegistry as Registry;\n };\n};\n\n/**\n * Creates a new client-api registry instance\n */\nexport const createRegistry = (registryHub?: RegistryHub): Registry => {\n const baseRegistry = createBaseRegistry('client-api', registryHub);\n\n return {\n ...baseRegistry,\n } as Registry;\n};\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EAIE;AAAA,OACK;;;ACLP,OAAO,aAAa;AAEpB,IAAM,YAAY,QAAQ,UAAU,mBAAmB;AAEvD,IAAO,iBAAQ;;;ADQf,IAAM,SAAS,eAAU,IAAI,cAAc,OAAO,KAAK;AAEhD,IAAM,kBAAkB,CAQ3B,KACA,YACA,cAEG;AAEL,QAAM,MAAM,OACV,QAAmB,CAAC,GACpB,YAAkD,CAAC,MAClC;AACjB,cAAU,gBAAgB,SAAS;AACnC,UAAM,MAA4C;AAElD,UAAM,SAAsB,cAAc,KAAK;AAC/C,UAAM,iBAAiB,OAAO,OAAO,CAAC,GAAG,WAAW,YAAY,EAAE,iBAAiB,WAAW,kBAAkB,OAAO,CAAC;AAExH,WAAO,QAAQ,OAAO,EAAE,OAAO,WAAW,eAAe,CAAC;AAE1D,WAAO,UAAU,WAAW,MAAM,UAAU;AAAA,MAC1C,IAAI;AAAA,QACF,UAAU,QAAQ,GAAG;AAAA,QACrB;AAAA,MACF;AAAA,IAAC,CAAC;AAAA,EACN;AAEA,SAAO;AACT;;;AErCA,IAAMA,UAAS,eAAU,IAAI,cAAc,OAAO,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AA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEF;;;ACjLA,SAA+C,kBAAkB,0BAAoC;AAGrG,IAAMC,WAAS,eAAU,IAAI,UAAU;AA0BhC,IAAM,iBAAiB,CAS1B,UACA,YACA,cACuC;AACzC,EAAAA,SAAO,MAAM,kBAAkB,EAAE,YAAY,WAAW,SAAS,CAAC;AAClE,QAAM,eAAe,mBAAmB,UAAU,UAAU;AAC5D,SAAO,EAAE,GAAG,cAAc,UAAU;AACtC;;;ACzCA,IAAMC,WAAS,eAAU,IAAI,iBAAiB;AAiBvC,IAAM,wBAAwB,CASjC,cAC+C;AACjD,SAAO,CAAC,YAA+C,YAA+D;AACpH,IAAAA,SAAO,MAAM,gCAAgC,EAAE,YAAY,UAAU,QAAQ,UAAU,UAAU,CAAC;AAElG,WAAO,eAAe,QAAQ,UAAU,YAAY,SAAS;AAAA,EAC/D;AACF;;;ACvCA;AAAA,EAEE,kBAAkB;AAAA,OAGb;AAEP,IAAMC,WAAS,eAAU,IAAI,UAAU;AAYhC,IAAM,wBAAwB,MAAuB;AAC1D,SAAO,CAAC,MAAc,gBAA4C;AAChE,QAAI,SAAS,cAAc;AACzB,YAAM,IAAI,MAAM,kFAAkF,IAAI,EAAE;AAAA,IAC1G;AAEA,IAAAA,SAAO,MAAM,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAElE,UAAM,eAAe,mBAAmB,MAAM,WAAW;AAGzD,WAAO;AAAA,EACT;AACF;AAKO,IAAM,iBAAiB,CAAC,gBAAwC;AACrE,QAAM,eAAe,mBAAmB,cAAc,WAAW;AAEjE,SAAO;AAAA,IACL,GAAG;AAAA,EACL;AACF;",
|
|
6
|
+
"names": ["logger", "action", "logger", "queryToParams", "logger", "queryToParams", "logger", "logger", "logger", "logger", "logger", "logger", "logger", "facet", "logger", "logger", "PriKey", "LocKey", "logger", "logger", "logger", "logger", "action", "facet", "logger", "logger", "logger"]
|
|
7
|
+
}
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const LibLogger: import(
|
|
1
|
+
declare const LibLogger: import("@fjell/logging").Logger;
|
|
2
2
|
export default LibLogger;
|
package/dist/ops/action.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComKey, Item, PriKey } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { ComKey, Item, PriKey } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getActionOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, action: string, body?: any) => Promise<V>;
|
package/dist/ops/all.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, ItemQuery, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, ItemQuery, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getAllOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (query?: ItemQuery, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
package/dist/ops/allAction.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getAllActionOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (action: string, body?: any, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
package/dist/ops/allFacet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getAllFacetOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (facet: string, params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
package/dist/ops/create.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getCreateOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (item: Partial<Item<S, L1, L2, L3, L4, L5>>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V>;
|
package/dist/ops/facet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComKey, Item, PriKey } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { ComKey, Item, PriKey } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getFacetOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, facet: string, params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>) => Promise<any>;
|
package/dist/ops/find.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getFindOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (finder: string, finderParams?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V[]>;
|
package/dist/ops/findOne.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getFindOneOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (finder: string, finderParams?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V>;
|
package/dist/ops/get.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComKey, Item, PriKey } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { ComKey, Item, PriKey } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getGetOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (ik: PriKey<S> | ComKey<S, never, never, never, never, never>) => Promise<V | null>;
|
package/dist/ops/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Item } from
|
|
2
|
-
import { Utilities } from
|
|
3
|
-
import { HttpApi } from
|
|
4
|
-
import { ClientApiOptions } from
|
|
5
|
-
import { ClientApi } from
|
|
1
|
+
import { Item } from "@fjell/core";
|
|
2
|
+
import { Utilities } from "@/Utilities";
|
|
3
|
+
import { HttpApi } from "@fjell/http-api";
|
|
4
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
5
|
+
import { ClientApi } from "@/ClientApi";
|
|
6
6
|
export declare const getOperations: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => ClientApi<V, S, L1, L2, L3, L4, L5>;
|
package/dist/ops/one.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Item, ItemQuery, LocKeyArray } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { Item, ItemQuery, LocKeyArray } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getOneOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (query: ItemQuery, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<V | null>;
|
package/dist/ops/remove.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComKey, Item, PriKey } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { ComKey, Item, PriKey } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getRemoveOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (ik: PriKey<S> | ComKey<S, L1, L2, L3, L4, L5>) => Promise<boolean>;
|
package/dist/ops/update.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComKey, Item, PriKey } from
|
|
2
|
-
import { HttpApi } from
|
|
3
|
-
import { ClientApiOptions } from
|
|
4
|
-
import { Utilities } from
|
|
1
|
+
import { ComKey, Item, PriKey } from "@fjell/core";
|
|
2
|
+
import { HttpApi } from "@fjell/http-api";
|
|
3
|
+
import { ClientApiOptions } from "@/ClientApiOptions";
|
|
4
|
+
import { Utilities } from "@/Utilities";
|
|
5
5
|
export declare const getUpdateOperation: <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>(api: HttpApi, apiOptions: ClientApiOptions, utilities: Utilities<V, S, L1, L2, L3, L4, L5>) => (ik: PriKey<S> | ComKey<S, L1, L2, L3, L4, L5>, item: Partial<Item<S, L1, L2, L3, L4, L5>>) => Promise<V>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjell/client-api",
|
|
3
3
|
"description": "Client API for Fjell",
|
|
4
|
-
"version": "4.4.
|
|
4
|
+
"version": "4.4.15",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
7
7
|
"api",
|
|
@@ -17,17 +17,16 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fjell/core": "^4.4.
|
|
21
|
-
"@fjell/http-api": "^4.4.
|
|
22
|
-
"@fjell/logging": "^4.4.
|
|
23
|
-
"@fjell/registry": "^4.4.
|
|
20
|
+
"@fjell/core": "^4.4.25",
|
|
21
|
+
"@fjell/http-api": "^4.4.23",
|
|
22
|
+
"@fjell/logging": "^4.4.30",
|
|
23
|
+
"@fjell/registry": "^4.4.20",
|
|
24
24
|
"deepmerge": "^4.3.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/eslintrc": "^3.3.1",
|
|
28
|
-
"@eslint/js": "^9.
|
|
29
|
-
"@fjell/eslint-config": "^1.
|
|
30
|
-
"@swc/core": "^1.13.2",
|
|
28
|
+
"@eslint/js": "^9.32.0",
|
|
29
|
+
"@fjell/eslint-config": "^1.1.3",
|
|
31
30
|
"@tsconfig/recommended": "^1.0.10",
|
|
32
31
|
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
33
32
|
"@typescript-eslint/parser": "^8.38.0",
|
|
@@ -35,12 +34,10 @@
|
|
|
35
34
|
"@vitest/coverage-v8": "^3.2.4",
|
|
36
35
|
"@vitest/ui": "^3.2.4",
|
|
37
36
|
"concurrently": "^9.2.0",
|
|
38
|
-
"
|
|
37
|
+
"esbuild": "^0.25.8",
|
|
38
|
+
"eslint": "^9.32.0",
|
|
39
39
|
"rimraf": "^6.0.1",
|
|
40
40
|
"typescript": "^5.8.3",
|
|
41
|
-
"vite": "^7.0.5",
|
|
42
|
-
"vite-plugin-dts": "^4.5.4",
|
|
43
|
-
"vite-plugin-node": "^7.0.0",
|
|
44
41
|
"vitest": "^3.2.4"
|
|
45
42
|
},
|
|
46
43
|
"repository": {
|
|
@@ -48,8 +45,8 @@
|
|
|
48
45
|
"url": "git+https://github.com/getfjell/client-api.git"
|
|
49
46
|
},
|
|
50
47
|
"scripts": {
|
|
51
|
-
"dev": "concurrently \"tsc --noEmit --watch\" \"
|
|
52
|
-
"build": "pnpm run lint && tsc --noEmit &&
|
|
48
|
+
"dev": "concurrently \"tsc --noEmit --watch\" \"node build.js --watch\"",
|
|
49
|
+
"build": "pnpm run lint && tsc --noEmit && node build.js",
|
|
53
50
|
"lint": "eslint . --ext .ts --fix",
|
|
54
51
|
"clean": "rimraf dist",
|
|
55
52
|
"test": "vitest run --coverage",
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
globals: true,
|
|
7
|
+
environment: 'node',
|
|
8
|
+
include: ['tests/**/*.{test,spec}.ts'],
|
|
9
|
+
coverage: {
|
|
10
|
+
provider: 'v8',
|
|
11
|
+
reporter: ['text', 'json', 'html'],
|
|
12
|
+
include: ['src/**/*.ts'],
|
|
13
|
+
exclude: [
|
|
14
|
+
'node_modules/',
|
|
15
|
+
'tests/',
|
|
16
|
+
'src/index.ts',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
resolve: {
|
|
21
|
+
alias: {
|
|
22
|
+
'@': path.resolve(__dirname, './src'),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
package/dist/AItemAPI.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { getOperations } from './ops/index.js';
|
|
2
|
-
import { createUtilities } from './Utilities.js';
|
|
3
|
-
import LibLogger from './logger.js';
|
|
4
|
-
|
|
5
|
-
const logger = LibLogger.get('AItemAPI');
|
|
6
|
-
const finderToParams = (finder, finderParams)=>{
|
|
7
|
-
return {
|
|
8
|
-
finder,
|
|
9
|
-
finderParams: JSON.stringify(finderParams)
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
const createAItemAPI = (api, pkType, pathNames, options)=>{
|
|
13
|
-
logger.default('createAItemAPI', {
|
|
14
|
-
pkType,
|
|
15
|
-
pathNames,
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
let mergedOptions;
|
|
19
|
-
const defaultOptions = {
|
|
20
|
-
readAuthenticated: true,
|
|
21
|
-
allAuthenticated: true,
|
|
22
|
-
writeAuthenticated: true,
|
|
23
|
-
getOptions: {},
|
|
24
|
-
postOptions: {},
|
|
25
|
-
putOptions: {},
|
|
26
|
-
deleteOptions: {}
|
|
27
|
-
};
|
|
28
|
-
if (options) {
|
|
29
|
-
mergedOptions = Object.assign({}, defaultOptions, options);
|
|
30
|
-
} else {
|
|
31
|
-
mergedOptions = defaultOptions;
|
|
32
|
-
}
|
|
33
|
-
const utilities = createUtilities(pkType, pathNames);
|
|
34
|
-
const operations = getOperations(api, mergedOptions, utilities);
|
|
35
|
-
return {
|
|
36
|
-
action: operations.action,
|
|
37
|
-
all: operations.all,
|
|
38
|
-
allAction: operations.allAction,
|
|
39
|
-
allFacet: operations.allFacet,
|
|
40
|
-
create: operations.create,
|
|
41
|
-
facet: operations.facet,
|
|
42
|
-
find: operations.find,
|
|
43
|
-
findOne: operations.findOne,
|
|
44
|
-
get: operations.get,
|
|
45
|
-
one: operations.one,
|
|
46
|
-
remove: operations.remove,
|
|
47
|
-
update: operations.update
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export { createAItemAPI, finderToParams };
|
|
52
|
-
//# sourceMappingURL=AItemAPI.js.map
|
package/dist/AItemAPI.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 getOptions: {},\n postOptions: {},\n putOptions: {},\n deleteOptions: {},\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 allFacet: operations.allFacet,\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","getOptions","postOptions","putOptions","deleteOptions","Object","assign","utilities","createUtilities","operations","getOperations","action","all","allAction","allFacet","create","facet","find","findOne","one","remove","update"],"mappings":";;;;AAWA,MAAMA,MAAAA,GAASC,SAAAA,CAAUC,GAAG,CAAC,UAAA,CAAA;AAqBtB,MAAMC,cAAAA,GAAiB,CAC5BC,MAAAA,EACAC,YAAAA,GAAAA;IAEA,OAAO;AACLD,QAAAA,MAAAA;QACAC,YAAAA,EAAcC,IAAAA,CAAKC,SAAS,CAACF,YAAAA;AAC/B,KAAA;AACF;AAEO,MAAMG,cAAAA,GAAiB,CAS5BC,GAAAA,EACAC,QACAC,SAAAA,EACAC,OAAAA,GAAAA;IAGAZ,MAAAA,CAAOa,OAAO,CAAC,gBAAA,EAAkB;AAAEH,QAAAA,MAAAA;AAAQC,QAAAA,SAAAA;AAAWC,QAAAA;AAAQ,KAAA,CAAA;IAE9D,IAAIE,aAAAA;AAEJ,IAAA,MAAMC,cAAAA,GAAmC;QACvCC,iBAAAA,EAAmB,IAAA;QACnBC,gBAAAA,EAAkB,IAAA;QAClBC,kBAAAA,EAAoB,IAAA;AACpBC,QAAAA,UAAAA,EAAY,EAAC;AACbC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA,UAAAA,EAAY,EAAC;AACbC,QAAAA,aAAAA,EAAe;AACjB,KAAA;AAEA,IAAA,IAAIV,OAAAA,EAAS;AACXE,QAAAA,aAAAA,GAAgBS,MAAAA,CAAOC,MAAM,CAAC,IAAIT,cAAAA,EAAgBH,OAAAA,CAAAA;IACpD,CAAA,MAAO;QACLE,aAAAA,GAAgBC,cAAAA;AAClB,IAAA;IAEA,MAAMU,SAAAA,GAAYC,gBAA0ChB,MAAAA,EAAQC,SAAAA,CAAAA;IACpE,MAAMgB,UAAAA,GAAaC,aAAAA,CAAwCnB,GAAAA,EAAKK,aAAAA,EAAeW,SAAAA,CAAAA;IAE/E,OAAO;AACLI,QAAAA,MAAAA,EAAQF,WAAWE,MAAM;AACzBC,QAAAA,GAAAA,EAAKH,WAAWG,GAAG;AACnBC,QAAAA,SAAAA,EAAWJ,WAAWI,SAAS;AAC/BC,QAAAA,QAAAA,EAAUL,WAAWK,QAAQ;AAC7BC,QAAAA,MAAAA,EAAQN,WAAWM,MAAM;AACzBC,QAAAA,KAAAA,EAAOP,WAAWO,KAAK;AACvBC,QAAAA,IAAAA,EAAMR,WAAWQ,IAAI;AACrBC,QAAAA,OAAAA,EAAST,WAAWS,OAAO;AAC3BlC,QAAAA,GAAAA,EAAKyB,WAAWzB,GAAG;AACnBmC,QAAAA,GAAAA,EAAKV,WAAWU,GAAG;AACnBC,QAAAA,MAAAA,EAAQX,WAAWW,MAAM;AACzBC,QAAAA,MAAAA,EAAQZ,WAAWY;AACrB,KAAA;AACF;;;;"}
|
package/dist/CItemAPI.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createAItemAPI } from './AItemAPI.js';
|
|
2
|
-
import LibLogger from './logger.js';
|
|
3
|
-
|
|
4
|
-
const logger = LibLogger.get('CItemAPI');
|
|
5
|
-
const createCItemApi = (api, type, pathNames, options)=>{
|
|
6
|
-
logger.default('createCItemApi', {
|
|
7
|
-
api,
|
|
8
|
-
type,
|
|
9
|
-
pathNames,
|
|
10
|
-
options
|
|
11
|
-
});
|
|
12
|
-
const aItemAPI = createAItemAPI(api, type, pathNames, options);
|
|
13
|
-
return {
|
|
14
|
-
action: aItemAPI.action,
|
|
15
|
-
all: aItemAPI.all,
|
|
16
|
-
allAction: aItemAPI.allAction,
|
|
17
|
-
allFacet: aItemAPI.allFacet,
|
|
18
|
-
one: aItemAPI.one,
|
|
19
|
-
get: aItemAPI.get,
|
|
20
|
-
create: aItemAPI.create,
|
|
21
|
-
remove: aItemAPI.remove,
|
|
22
|
-
update: aItemAPI.update,
|
|
23
|
-
facet: aItemAPI.facet,
|
|
24
|
-
find: aItemAPI.find,
|
|
25
|
-
findOne: aItemAPI.findOne
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export { createCItemApi };
|
|
30
|
-
//# sourceMappingURL=CItemAPI.js.map
|
package/dist/CItemAPI.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CItemAPI.js","sources":["../src/CItemAPI.ts"],"sourcesContent":["\nimport {\n ComKey,\n Item,\n ItemQuery,\n LocKeyArray,\n PriKey,\n} from \"@fjell/core\";\nimport {\n HttpApi\n} from \"@fjell/http-api\";\nimport { createAItemAPI, PathNamesArray } from \"./AItemAPI\";\n\nimport LibLogger from \"@/logger\";\nimport { ClientApi } from \"./ClientApi\";\nimport { ClientApiOptions } from \"./ClientApiOptions\";\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 ) => Promise<V>;\n all: (\n query: ItemQuery,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n allAction: (\n action: string,\n body?: any,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<V[]>;\n allFacet: (\n facet: string,\n params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n locations?: LocKeyArray<L1, L2, L3, L4, L5> | []\n ) => Promise<any>;\n get: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n ) => Promise<V | null>;\n create: (\n item: Partial<Item<S, L1, L2, L3, L4, L5>>,\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 ) => Promise<boolean>;\n update: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n item: Partial<Item<S, L1, L2, L3, L4, L5>>,\n ) => Promise<V>;\n facet: (\n ik: ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>,\n facet: string,\n params?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\n ) => Promise<any>;\n find: (\n finder: string,\n finderParams?: Record<string, string | number | boolean | Date | Array<string | number | boolean | Date>>,\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 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 allFacet: aItemAPI.allFacet,\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","allFacet","one","create","remove","update","facet","find","findOne"],"mappings":";;;AAiBA,MAAMA,MAAAA,GAASC,SAAAA,CAAUC,GAAG,CAAC,UAAA,CAAA;AA6DtB,MAAMC,cAAAA,GAAiB,CAQ5BC,GAAAA,EAAcC,MAASC,SAAAA,EAA+CC,OAAAA,GAAAA;IAEtEP,MAAAA,CAAOQ,OAAO,CAAC,gBAAA,EAAkB;AAAEJ,QAAAA,GAAAA;AAAKC,QAAAA,IAAAA;AAAMC,QAAAA,SAAAA;AAAWC,QAAAA;AAAQ,KAAA,CAAA;AAEjE,IAAA,MAAME,QAAAA,GAAWC,cAAAA,CAAeN,GAAAA,EAAKC,IAAAA,EAAMC,SAAAA,EAAWC,OAAAA,CAAAA;IAEtD,OAAO;AACLI,QAAAA,MAAAA,EAAQF,SAASE,MAAM;AACvBC,QAAAA,GAAAA,EAAKH,SAASG,GAAG;AACjBC,QAAAA,SAAAA,EAAWJ,SAASI,SAAS;AAC7BC,QAAAA,QAAAA,EAAUL,SAASK,QAAQ;AAC3BC,QAAAA,GAAAA,EAAKN,SAASM,GAAG;AACjBb,QAAAA,GAAAA,EAAKO,SAASP,GAAG;AACjBc,QAAAA,MAAAA,EAAQP,SAASO,MAAM;AACvBC,QAAAA,MAAAA,EAAQR,SAASQ,MAAM;AACvBC,QAAAA,MAAAA,EAAQT,SAASS,MAAM;AACvBC,QAAAA,KAAAA,EAAOV,SAASU,KAAK;AACrBC,QAAAA,IAAAA,EAAMX,SAASW,IAAI;AACnBC,QAAAA,OAAAA,EAASZ,SAASY;AACpB,KAAA;AACF;;;;"}
|
package/dist/Instance.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import LibLogger from './logger.js';
|
|
2
|
-
import { createInstance as createInstance$1 } from '@fjell/registry';
|
|
3
|
-
|
|
4
|
-
const logger = LibLogger.get("Instance");
|
|
5
|
-
const createInstance = (registry, coordinate, clientApi)=>{
|
|
6
|
-
logger.debug("createInstance", {
|
|
7
|
-
coordinate,
|
|
8
|
-
clientApi,
|
|
9
|
-
registry
|
|
10
|
-
});
|
|
11
|
-
const baseInstance = createInstance$1(registry, coordinate);
|
|
12
|
-
return {
|
|
13
|
-
...baseInstance,
|
|
14
|
-
clientApi
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { createInstance };
|
|
19
|
-
//# sourceMappingURL=Instance.js.map
|
package/dist/Instance.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Instance.js","sources":["../src/Instance.ts"],"sourcesContent":["\nimport LibLogger from \"@/logger\";\nimport { Item } from \"@fjell/core\";\nimport { Instance as BaseInstance, Coordinate, createInstance as createBaseInstance, Registry } from \"@fjell/registry\";\nimport { ClientApi } from \"./ClientApi\";\n\nconst logger = LibLogger.get(\"Instance\");\n\n/**\n * The Client API Instance interface represents a client API model instance that extends the base Instance\n * from @fjell/registry and adds client API operations for interacting with remote data.\n *\n * The interface extends the base Instance (which provides coordinate and registry) with:\n * - clientApi: Provides methods for interacting with remote data through HTTP APIs (get, create, update, etc.)\n *\n * @template V - The type of the data model item, extending Item\n * @template S - The string literal type representing the model's key type\n * @template L1-L5 - Optional string literal types for location hierarchy levels\n */\nexport interface Instance<\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> extends BaseInstance<S, L1, L2, L3, L4, L5> {\n /** The client API object that provides methods for interacting with remote data */\n clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>;\n}\n\nexport const createInstance = <\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 registry: Registry,\n coordinate: Coordinate<S, L1, L2, L3, L4, L5>,\n clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>,\n ): Instance<V, S, L1, L2, L3, L4, L5> => {\n logger.debug(\"createInstance\", { coordinate, clientApi, registry });\n const baseInstance = createBaseInstance(registry, coordinate);\n return { ...baseInstance, clientApi };\n}\n"],"names":["logger","LibLogger","get","createInstance","registry","coordinate","clientApi","debug","baseInstance","createBaseInstance"],"mappings":";;;AAMA,MAAMA,MAAAA,GAASC,SAAAA,CAAUC,GAAG,CAAC,UAAA,CAAA;AA0BtB,MAAMC,cAAAA,GAAiB,CAS1BC,QAAAA,EACAC,UAAAA,EACAC,SAAAA,GAAAA;IAEFN,MAAAA,CAAOO,KAAK,CAAC,gBAAA,EAAkB;AAAEF,QAAAA,UAAAA;AAAYC,QAAAA,SAAAA;AAAWF,QAAAA;AAAS,KAAA,CAAA;IACjE,MAAMI,YAAAA,GAAeC,iBAAmBL,QAAAA,EAAUC,UAAAA,CAAAA;IAClD,OAAO;AAAE,QAAA,GAAGG,YAAY;AAAEF,QAAAA;AAAU,KAAA;AACtC;;;;"}
|
package/dist/InstanceFactory.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createInstance } from './Instance.js';
|
|
2
|
-
import LibLogger from './logger.js';
|
|
3
|
-
|
|
4
|
-
const logger = LibLogger.get("InstanceFactory");
|
|
5
|
-
/**
|
|
6
|
-
* Factory function for creating client-api instances
|
|
7
|
-
*/ const createInstanceFactory = (clientApi)=>{
|
|
8
|
-
return (coordinate, context)=>{
|
|
9
|
-
logger.debug("Creating client-api instance", {
|
|
10
|
-
coordinate,
|
|
11
|
-
registry: context.registry,
|
|
12
|
-
clientApi
|
|
13
|
-
});
|
|
14
|
-
return createInstance(context.registry, coordinate, clientApi);
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { createInstanceFactory };
|
|
19
|
-
//# sourceMappingURL=InstanceFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceFactory.js","sources":["../src/InstanceFactory.ts"],"sourcesContent":["import { Item } from \"@fjell/core\";\nimport { ClientApi } from \"./ClientApi\";\nimport { InstanceFactory as BaseInstanceFactory, Registry, RegistryHub } from \"@fjell/registry\";\nimport { createInstance, Instance } from \"./Instance\";\nimport { Coordinate } from \"@fjell/registry\";\nimport LibLogger from \"@/logger\";\n\nconst logger = LibLogger.get(\"InstanceFactory\");\n\nexport type InstanceFactory<\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 clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>\n) => BaseInstanceFactory<S, L1, L2, L3, L4, L5>;\n\n/**\n * Factory function for creating client-api instances\n */\nexport const createInstanceFactory = <\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 clientApi: ClientApi<V, S, L1, L2, L3, L4, L5>\n ): BaseInstanceFactory<S, L1, L2, L3, L4, L5> => {\n return (coordinate: Coordinate<S, L1, L2, L3, L4, L5>, context: { registry: Registry, registryHub?: RegistryHub }) => {\n logger.debug(\"Creating client-api instance\", { coordinate, registry: context.registry, clientApi });\n\n return createInstance(context.registry, coordinate, clientApi) as Instance<V, S, L1, L2, L3, L4, L5>;\n };\n};\n"],"names":["logger","LibLogger","get","createInstanceFactory","clientApi","coordinate","context","debug","registry","createInstance"],"mappings":";;;AAOA,MAAMA,MAAAA,GAASC,SAAAA,CAAUC,GAAG,CAAC,iBAAA,CAAA;AAc7B;;IAGO,MAAMC,qBAAAA,GAAwB,CASjCC,SAAAA,GAAAA;AAEF,IAAA,OAAO,CAACC,UAAAA,EAA+CC,OAAAA,GAAAA;QACrDN,MAAAA,CAAOO,KAAK,CAAC,8BAAA,EAAgC;AAAEF,YAAAA,UAAAA;AAAYG,YAAAA,QAAAA,EAAUF,QAAQE,QAAQ;AAAEJ,YAAAA;AAAU,SAAA,CAAA;AAEjG,QAAA,OAAOK,cAAAA,CAAeH,OAAAA,CAAQE,QAAQ,EAAEH,UAAAA,EAAYD,SAAAA,CAAAA;AACtD,IAAA,CAAA;AACF;;;;"}
|
package/dist/PItemAPI.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createAItemAPI } from './AItemAPI.js';
|
|
2
|
-
import LibLogger from './logger.js';
|
|
3
|
-
|
|
4
|
-
const logger = LibLogger.get('PItemAPI');
|
|
5
|
-
const createPItemApi = (api, type, pathName, options)=>{
|
|
6
|
-
logger.default('createPItemApi', {
|
|
7
|
-
type,
|
|
8
|
-
pathName,
|
|
9
|
-
options
|
|
10
|
-
});
|
|
11
|
-
const aItemAPI = createAItemAPI(api, type, [
|
|
12
|
-
pathName
|
|
13
|
-
], options);
|
|
14
|
-
const action = async (ik, action, body = {})=>await aItemAPI.action(ik, action, body);
|
|
15
|
-
const all = async (query = {})=>await aItemAPI.all(query, []);
|
|
16
|
-
const allAction = async (action, body = {})=>await aItemAPI.allAction(action, body, []);
|
|
17
|
-
const allFacet = async (facet, params = {})=>await aItemAPI.allFacet(facet, params);
|
|
18
|
-
const one = async (query = {})=>await aItemAPI.one(query, []);
|
|
19
|
-
const get = async (ik)=>await aItemAPI.get(ik);
|
|
20
|
-
const create = async (item)=>await aItemAPI.create(item, []);
|
|
21
|
-
const remove = async (ik)=>await aItemAPI.remove(ik);
|
|
22
|
-
const update = async (ik, item)=>await aItemAPI.update(ik, item);
|
|
23
|
-
const facet = async (ik, facet, params = {})=>await aItemAPI.facet(ik, facet, params);
|
|
24
|
-
const find = async (finder, finderParams = {})=>await aItemAPI.find(finder, finderParams);
|
|
25
|
-
const findOne = async (finder, finderParams = {})=>await aItemAPI.findOne(finder, finderParams);
|
|
26
|
-
return {
|
|
27
|
-
...aItemAPI,
|
|
28
|
-
action,
|
|
29
|
-
all,
|
|
30
|
-
allAction,
|
|
31
|
-
allFacet,
|
|
32
|
-
one,
|
|
33
|
-
get,
|
|
34
|
-
create,
|
|
35
|
-
remove,
|
|
36
|
-
update,
|
|
37
|
-
facet,
|
|
38
|
-
find,
|
|
39
|
-
findOne
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { createPItemApi };
|
|
44
|
-
//# sourceMappingURL=PItemAPI.js.map
|