@gisatcz/ptr-be-core 0.0.1-dev.2 → 0.0.1-dev.3

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/index.cjs CHANGED
@@ -3,50 +3,6 @@
3
3
  var pino = require('pino');
4
4
  var pretty = require('pino-pretty');
5
5
 
6
- /**
7
- * What types of graph nodes we use in metadata model
8
- */
9
- exports.UsedNodeLabels = void 0;
10
- (function (UsedNodeLabels) {
11
- UsedNodeLabels["Application"] = "application";
12
- UsedNodeLabels["Datasource"] = "datasource";
13
- UsedNodeLabels["Place"] = "place";
14
- UsedNodeLabels["Period"] = "period";
15
- UsedNodeLabels["AreaTree"] = "areaTree";
16
- UsedNodeLabels["AreaTreeLevel"] = "areaTreeLevel";
17
- UsedNodeLabels["Layer"] = "layer";
18
- UsedNodeLabels["Style"] = "style";
19
- UsedNodeLabels["Feature"] = "feature";
20
- UsedNodeLabels["Attribute"] = "attribute"; // Attribute node for properties of entities, like "temperature", "population", etc.
21
- })(exports.UsedNodeLabels || (exports.UsedNodeLabels = {}));
22
- /**
23
- * What datasources we use in the system
24
- */
25
- exports.UsedDatasourceLabels = void 0;
26
- (function (UsedDatasourceLabels) {
27
- UsedDatasourceLabels["Attribute"] = "attribute";
28
- UsedDatasourceLabels["Geojson"] = "geojson";
29
- UsedDatasourceLabels["WMS"] = "wms";
30
- UsedDatasourceLabels["COG"] = "cloudOptimizedGeotiff";
31
- UsedDatasourceLabels["MVT"] = "mvt";
32
- UsedDatasourceLabels["XYZ"] = "xyz";
33
- UsedDatasourceLabels["CSV"] = "csv";
34
- UsedDatasourceLabels["GeoTIFF"] = "geotiff";
35
- UsedDatasourceLabels["Shapefile"] = "shapefile";
36
- UsedDatasourceLabels["PostGIS"] = "postgis";
37
- UsedDatasourceLabels["WMTS"] = "wmts";
38
- UsedDatasourceLabels["WFS"] = "wfs";
39
- UsedDatasourceLabels["GeoPackage"] = "geopackage"; // OGC GeoPackage format
40
- })(exports.UsedDatasourceLabels || (exports.UsedDatasourceLabels = {}));
41
- /**
42
- * What types of edges we use in metadata model
43
- */
44
- exports.UsedEdgeLabels = void 0;
45
- (function (UsedEdgeLabels) {
46
- UsedEdgeLabels["RelatedTo"] = "RELATED";
47
- UsedEdgeLabels["Has"] = "HAS";
48
- })(exports.UsedEdgeLabels || (exports.UsedEdgeLabels = {}));
49
-
50
6
  /**
51
7
  * Check if the value in included in enum posibilities.
52
8
  * @param value Value we need to check
@@ -192,6 +148,50 @@ class AppLogger {
192
148
  }
193
149
  }
194
150
 
151
+ /**
152
+ * What types of graph nodes we use in metadata model
153
+ */
154
+ exports.UsedNodeLabels = void 0;
155
+ (function (UsedNodeLabels) {
156
+ UsedNodeLabels["Application"] = "application";
157
+ UsedNodeLabels["Datasource"] = "datasource";
158
+ UsedNodeLabels["Place"] = "place";
159
+ UsedNodeLabels["Period"] = "period";
160
+ UsedNodeLabels["AreaTree"] = "areaTree";
161
+ UsedNodeLabels["AreaTreeLevel"] = "areaTreeLevel";
162
+ UsedNodeLabels["Layer"] = "layer";
163
+ UsedNodeLabels["Style"] = "style";
164
+ UsedNodeLabels["Feature"] = "feature";
165
+ UsedNodeLabels["Attribute"] = "attribute"; // Attribute node for properties of entities, like "temperature", "population", etc.
166
+ })(exports.UsedNodeLabels || (exports.UsedNodeLabels = {}));
167
+ /**
168
+ * What datasources we use in the system
169
+ */
170
+ exports.UsedDatasourceLabels = void 0;
171
+ (function (UsedDatasourceLabels) {
172
+ UsedDatasourceLabels["Attribute"] = "attribute";
173
+ UsedDatasourceLabels["Geojson"] = "geojson";
174
+ UsedDatasourceLabels["WMS"] = "wms";
175
+ UsedDatasourceLabels["COG"] = "cloudOptimizedGeotiff";
176
+ UsedDatasourceLabels["MVT"] = "mvt";
177
+ UsedDatasourceLabels["XYZ"] = "xyz";
178
+ UsedDatasourceLabels["CSV"] = "csv";
179
+ UsedDatasourceLabels["GeoTIFF"] = "geotiff";
180
+ UsedDatasourceLabels["Shapefile"] = "shapefile";
181
+ UsedDatasourceLabels["PostGIS"] = "postgis";
182
+ UsedDatasourceLabels["WMTS"] = "wmts";
183
+ UsedDatasourceLabels["WFS"] = "wfs";
184
+ UsedDatasourceLabels["GeoPackage"] = "geopackage"; // OGC GeoPackage format
185
+ })(exports.UsedDatasourceLabels || (exports.UsedDatasourceLabels = {}));
186
+ /**
187
+ * What types of edges we use in metadata model
188
+ */
189
+ exports.UsedEdgeLabels = void 0;
190
+ (function (UsedEdgeLabels) {
191
+ UsedEdgeLabels["RelatedTo"] = "RELATED";
192
+ UsedEdgeLabels["Has"] = "HAS";
193
+ })(exports.UsedEdgeLabels || (exports.UsedEdgeLabels = {}));
194
+
195
195
  exports.AppLogger = AppLogger;
196
196
  exports.AuthorizationError = AuthorizationError;
197
197
  exports.InvalidRequestError = InvalidRequestError;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/panther/enums.panther.ts","../../src/coding/code.formating.ts","../../src/api/errors.api.ts","../../src/logging/logger.ts"],"sourcesContent":["/**\n * What types of graph nodes we use in metadata model\n */\nexport enum UsedNodeLabels {\n Application = \"application\", // Application node (the root of the FE app)\n Datasource = \"datasource\", // Datasource node for data including GIS information\n Place = \"place\", // Place node for geographical information\n Period = \"period\", // Period node for time information\n AreaTree = \"areaTree\", // Area tree node for administrative division\n AreaTreeLevel = \"areaTreeLevel\", // Area tree level node for administrative division\n Layer = \"layer\", // Layer node for map layer (layer have a style and a datasource)\n Style = \"style\", // Style node for map layer or a feature\n Feature = \"feature\", // Feature node for map layer,\n Attribute = \"attribute\" // Attribute node for properties of entities, like \"temperature\", \"population\", etc.\n}\n\n/**\n * What datasources we use in the system\n */\nexport enum UsedDatasourceLabels {\n Attribute = \"attribute\", // Column(s) with attribute values\n Geojson = \"geojson\", // Geojson for web map\n WMS = \"wms\", // WMS online source\n COG = \"cloudOptimizedGeotiff\", // COG online source\n MVT = \"mvt\", // MVT (Mapbox Vector Tiles) source\n XYZ = \"xyz\", // XYZ tile source\n CSV = \"csv\", // CSV data source\n GeoTIFF = \"geotiff\", // GeoTIFF raster data\n Shapefile = \"shapefile\", // ESRI Shapefile format\n PostGIS = \"postgis\", // PostGIS database source\n WMTS = \"wmts\", // Web Map Tile Service\n WFS = \"wfs\", // Web Feature Service\n GeoPackage = \"geopackage\" // OGC GeoPackage format\n}\n\n/**\n * What types of edges we use in metadata model\n */\nexport enum UsedEdgeLabels {\n RelatedTo = \"RELATED\", // Generic edge for any relation\n Has = \"HAS\", // Edge for ownership relation\n}\n","/**\n * Check if the value in included in enum posibilities.\n * @param value Value we need to check\n * @param enumEntity Enum type we check againts the value\n * @returns Is the value in this enum?\n */\nexport const isInEnum = (value: any, enumEntity: any) => {\n const allEnumValues = Object.values(enumEntity) as string[]\n return allEnumValues.includes(value)\n }\n\n/**\n * Sort array of string elements\n * @param rawArray Raw unsorted array of elements\n * @returns Sorted string array\n */\nexport const sortStringArray = (rawArray: string[]) => rawArray.sort()\n\n/**\n * Remove all duplicity string items from an array\n * @param arr Original array with duplicities\n * @returns Array of original values\n */\nexport const removeDuplicitiesFromArray = (arr: any[]) => [...new Set(arr)]\n\n\n/**\n * Check if the string value is not ` \"\" `\n * @param value Value to check\n * @returns Boolean result about the truth\n */\nexport const notEmptyString = (value: string) => value !== \"\"\n\n\n/**\n * Return enum values as array of string\n * @param enumType Type of the enum from code\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumValuesToString = (enumType: any, separator = \", \") => Object.values(enumType).join(separator)\n\n/**\n * Return enum values as array of string\n * @param enumTypes Combination of enum types\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumCombineValuesToString = (enumTypes: any[], separator = \", \") => enumTypes.map(enumType => enumValuesToString(enumType, separator)).join(separator)\n\n/**\n * Return all enum values as array\n * @param enumType What array we want to work with\n * @returns Array of enum values\n */\nexport const enumValuesToArray = (enumType: any) => Object.values(enumType) as string[]\n\n/**\n * Return random number (integer) between two values\n * @param min \n * @param max \n * @returns \n */\nexport const randomNumberBetween = (min: number, max: number) => {\n const minAr = Math.ceil(min)\n const maxAr = Math.floor(max)\n return Math.floor(Math.random()*(maxAr - minAr + 1) + min)\n}\n\n/**\n * Recursively flattens a nested object. The keys of the resulting object\n * will be the paths to the original values in the nested object, joined by dots.\n *\n * @param obj - The object to flatten.\n * @param prefix - The prefix to use for the keys in the flattened object. Defaults to an empty string.\n * @returns A new object with flattened keys.\n *\n * @example\n * ```typescript\n * const nestedObj = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: 2\n * };\n * const flatObj = flattenObject(nestedObj);\n * console.log(flatObj);\n * // Output: { 'a.b.c': 1, 'a.b.d': 2 }\n * ```\n */\nexport const flattenObject = (obj: any, prefix = ''): Record<string, any> => {\n return Object.keys(obj).reduce((acc: Record<string, any>, key: string) => {\n const propName = prefix ? `${prefix}.${key}` : key\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n Object.assign(acc, flattenObject(obj[key], propName))\n } else {\n acc[propName] = obj[key]\n }\n return acc\n }, {})\n}","/**\n * Extract message from exception error (try-catch)\n * @param error error from catch block as any\n * @returns \n */\n export const messageFromError = (error: any) => error[\"message\"] as string\n\n/**\n * We miss a API parameter needed to process action\n */\nexport class InvalidRequestError extends Error{\n constructor(message: string){\n super(`Invalid Request: ${message}`)\n }\n}\n\n/**\n * Where client has general authorization issue\n */\nexport class AuthorizationError extends Error{\n constructor(){\n super(`Authorization has failed.`)\n }\n}","// logger.ts\nimport pino, { Logger } from 'pino'\nimport pretty from 'pino-pretty'\n\n/**\n * @typedef {Object} AppLogOptions\n * @property {string} label - The label for the log entry.\n * @property {string|number|boolean} [key] - Any extra fields.\n */\nexport type AppLogOptions = {\n label: string\n [key: string]: string|number|boolean\n}\n\nconst DEFAULT_LOG_OPTIONS: AppLogOptions = {\n label: 'App'\n}\n\n// create the pretty‐printing stream once\nconst prettyStream = pretty({\n colorize: true,\n levelFirst: true,\n translateTime: 'yyyy-mm-dd HH:MM:ss'\n})\n\n// create your logger once and for all\nconst baseLogger: Logger = pino({}, prettyStream)\n\nexport class AppLogger {\n static info(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.info({ ...options, message })\n }\n\n static warn(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.warn({ ...options, message })\n }\n\n static error(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.error({ ...options, message })\n }\n\n static appStart(\n host: string,\n port: number,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n AppLogger.info(`Application started on ${host}:${port}`, options)\n }\n}"],"names":["UsedNodeLabels","UsedDatasourceLabels","UsedEdgeLabels"],"mappings":";;;;;AAAA;;AAEG;AACSA;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,cAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,cAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;IACnB,cAAA,CAAA,WAAA,CAAA,GAAA,WAAuB,CAAA;AAC3B,CAAC,EAXWA,sBAAc,KAAdA,sBAAc,GAAA,EAAA,CAAA,CAAA;AAa1B;;AAEG;AACSC;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC5B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,oBAAA,CAAA,SAAA,C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AO,EAAE,OAAO,EAAE,CAAC;IAC1C;AAEA,IAAA,OAAO,KAAK,CACV,OAAe,EACf,UAAyB,mBAAmB,EAAA;QAE5C,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;IAC3C;IAEA,OAAO,QAAQ,CACb,IAAY,EACZ,IAAY,EACZ,UAAyB,mBAAmB,EAAA;QAE5C,SAAS,CAAC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,EAAE,OAAO,CAAC;IACnE;AACD;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/coding/code.formating.ts","../../src/api/errors.api.ts","../../src/logging/logger.ts","../../src/panther/enums.panther.ts"],"sourcesContent":["/**\n * Check if the value in included in enum posibilities.\n * @param value Value we need to check\n * @param enumEntity Enum type we check againts the value\n * @returns Is the value in this enum?\n */\nexport const isInEnum = (value: any, enumEntity: any) => {\n const allEnumValues = Object.values(enumEntity) as string[]\n return allEnumValues.includes(value)\n }\n\n/**\n * Sort array of string elements\n * @param rawArray Raw unsorted array of elements\n * @returns Sorted string array\n */\nexport const sortStringArray = (rawArray: string[]) => rawArray.sort()\n\n/**\n * Remove all duplicity string items from an array\n * @param arr Original array with duplicities\n * @returns Array of original values\n */\nexport const removeDuplicitiesFromArray = (arr: any[]) => [...new Set(arr)]\n\n\n/**\n * Check if the string value is not ` \"\" `\n * @param value Value to check\n * @returns Boolean result about the truth\n */\nexport const notEmptyString = (value: string) => value !== \"\"\n\n\n/**\n * Return enum values as array of string\n * @param enumType Type of the enum from code\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumValuesToString = (enumType: any, separator = \", \") => Object.values(enumType).join(separator)\n\n/**\n * Return enum values as array of string\n * @param enumTypes Combination of enum types\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumCombineValuesToString = (enumTypes: any[], separator = \", \") => enumTypes.map(enumType => enumValuesToString(enumType, separator)).join(separator)\n\n/**\n * Return all enum values as array\n * @param enumType What array we want to work with\n * @returns Array of enum values\n */\nexport const enumValuesToArray = (enumType: any) => Object.values(enumType) as string[]\n\n/**\n * Return random number (integer) between two values\n * @param min \n * @param max \n * @returns \n */\nexport const randomNumberBetween = (min: number, max: number) => {\n const minAr = Math.ceil(min)\n const maxAr = Math.floor(max)\n return Math.floor(Math.random()*(maxAr - minAr + 1) + min)\n}\n\n/**\n * Recursively flattens a nested object. The keys of the resulting object\n * will be the paths to the original values in the nested object, joined by dots.\n *\n * @param obj - The object to flatten.\n * @param prefix - The prefix to use for the keys in the flattened object. Defaults to an empty string.\n * @returns A new object with flattened keys.\n *\n * @example\n * ```typescript\n * const nestedObj = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: 2\n * };\n * const flatObj = flattenObject(nestedObj);\n * console.log(flatObj);\n * // Output: { 'a.b.c': 1, 'a.b.d': 2 }\n * ```\n */\nexport const flattenObject = (obj: any, prefix = ''): Record<string, any> => {\n return Object.keys(obj).reduce((acc: Record<string, any>, key: string) => {\n const propName = prefix ? `${prefix}.${key}` : key\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n Object.assign(acc, flattenObject(obj[key], propName))\n } else {\n acc[propName] = obj[key]\n }\n return acc\n }, {})\n}","/**\n * Extract message from exception error (try-catch)\n * @param error error from catch block as any\n * @returns \n */\n export const messageFromError = (error: any) => error[\"message\"] as string\n\n/**\n * We miss a API parameter needed to process action\n */\nexport class InvalidRequestError extends Error{\n constructor(message: string){\n super(`Invalid Request: ${message}`)\n }\n}\n\n/**\n * Where client has general authorization issue\n */\nexport class AuthorizationError extends Error{\n constructor(){\n super(`Authorization has failed.`)\n }\n}","// logger.ts\nimport pino, { Logger } from 'pino'\nimport pretty from 'pino-pretty'\n\n/**\n * @typedef {Object} AppLogOptions\n * @property {string} label - The label for the log entry.\n * @property {string|number|boolean} [key] - Any extra fields.\n */\nexport type AppLogOptions = {\n label: string\n [key: string]: string|number|boolean\n}\n\nconst DEFAULT_LOG_OPTIONS: AppLogOptions = {\n label: 'App'\n}\n\n// create the pretty‐printing stream once\nconst prettyStream = pretty({\n colorize: true,\n levelFirst: true,\n translateTime: 'yyyy-mm-dd HH:MM:ss'\n})\n\n// create your logger once and for all\nconst baseLogger: Logger = pino({}, prettyStream)\n\nexport class AppLogger {\n static info(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.info({ ...options, message })\n }\n\n static warn(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.warn({ ...options, message })\n }\n\n static error(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.error({ ...options, message })\n }\n\n static appStart(\n host: string,\n port: number,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n AppLogger.info(`Application started on ${host}:${port}`, options)\n }\n}","/**\n * What types of graph nodes we use in metadata model\n */\nexport enum UsedNodeLabels {\n Application = \"application\", // Application node (the root of the FE app)\n Datasource = \"datasource\", // Datasource node for data including GIS information\n Place = \"place\", // Place node for geographical information\n Period = \"period\", // Period node for time information\n AreaTree = \"areaTree\", // Area tree node for administrative division\n AreaTreeLevel = \"areaTreeLevel\", // Area tree level node for administrative division\n Layer = \"layer\", // Layer node for map layer (layer have a style and a datasource)\n Style = \"style\", // Style node for map layer or a feature\n Feature = \"feature\", // Feature node for map layer,\n Attribute = \"attribute\" // Attribute node for properties of entities, like \"temperature\", \"population\", etc.\n}\n\n/**\n * What datasources we use in the system\n */\nexport enum UsedDatasourceLabels {\n Attribute = \"attribute\", // Column(s) with attribute values\n Geojson = \"geojson\", // Geojson for web map\n WMS = \"wms\", // WMS online source\n COG = \"cloudOptimizedGeotiff\", // COG online source\n MVT = \"mvt\", // MVT (Mapbox Vector Tiles) source\n XYZ = \"xyz\", // XYZ tile source\n CSV = \"csv\", // CSV data source\n GeoTIFF = \"geotiff\", // GeoTIFF raster data\n Shapefile = \"shapefile\", // ESRI Shapefile format\n PostGIS = \"postgis\", // PostGIS database source\n WMTS = \"wmts\", // Web Map Tile Service\n WFS = \"wfs\", // Web Feature Service\n GeoPackage = \"geopackage\" // OGC GeoPackage format\n}\n\n/**\n * What types of edges we use in metadata model\n */\nexport enum UsedEdgeLabels {\n RelatedTo = \"RELATED\", // Generic edge for any relation\n Has = \"HAS\", // Edge for ownership relation\n}\n"],"names":["UsedNodeLabels","UsedDatasourceLabels","UsedEdgeLabels"],"mappings":";;;;;AAAA;;;;;AAKG;MACU,QAAQ,GAAG,CAAC,KAAU,EAAE,UAAe,KAAI;IACpD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAa;AAC3D,IAAA,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;AACtC;AAEF;;;;AAIG;AACI,MAAM,eAAe,GAAG,CAAC,QAAkB,KAAK,QAAQ,CAAC,IAAI;AAEpE;;;;AAIG;AACI,MAAM,0BAA0B,GAAG,CAAC,GAAU,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;AAG1E;;;;AAIG;AACI,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,KAAK,KAAK;AAG3D;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,QAAa,EAAE,SAAS,GAAG,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS;AAE7G;;;;;AAKG;AACI,MAAM,yBAAyB,GAAG,CAAC,SAAgB,EAAE,SAAS,GAAG,IAAI,KAAK,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;AAElK;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,QAAa,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ;AAE1E;;;;;AAKG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,CAAA,CAAA;AAgBhC;;AAEG;AACSC;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,WAAA,CAAA,GAAA,SAAqB;AACrB,IAAA,cAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACf,CAAC,EAHWA,sBAAc,KAAdA,sBAAc,GAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels } from "./src/panther/enums.panther";
2
1
  export { enumCombineValuesToString, enumValuesToArray, enumValuesToString, flattenObject, isInEnum, notEmptyString, randomNumberBetween, removeDuplicitiesFromArray, sortStringArray } from "./src/coding/code.formating";
3
- export type { Nullable, Nullish, Unsure, UsurePromise } from "./src/coding/code.types";
2
+ export { type Nullable, type Nullish, type Unsure, type UsurePromise } from "./src/coding/code.types";
4
3
  export { messageFromError, InvalidRequestError, AuthorizationError } from "./src/api/errors.api";
5
- export type { ApiEndpointResponse } from "./src/api/models.api";
6
- export type { AppLogOptions } from "./src/logging/logger";
4
+ export { type ApiEndpointResponse } from "./src/api/models.api";
5
+ export { type AppLogOptions } from "./src/logging/logger";
7
6
  export { AppLogger } from "./src/logging/logger";
8
- export { UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels };
9
- export type { GraphEdge, GraphRelation } from "./src/panther/models.edges";
10
- export type { HasBands, HasColor, HasConfiguration, HasGeometry, HasInterval, HasLevels, HasSpecificName, HasUrl, HasUnits } from "./src/panther/models.nodes.properties";
11
- export type { Place, Period, AreaTreeLevel, Datasource, ApplicationNode, Attribute, FullPantherEntity } from "./src/panther/models.nodes";
7
+ export { UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels } from "./src/panther/enums.panther";
8
+ export { type GraphEdge, type GraphRelation } from "./src/panther/models.edges";
9
+ export { type HasBands, type HasColor, type HasConfiguration, type HasGeometry, type HasInterval, type HasLevels, type HasSpecificName, type HasUrl, type HasUnits } from "./src/panther/models.nodes.properties";
10
+ export { type Place, type Period, type AreaTreeLevel, type Datasource, type ApplicationNode, type Attribute, type FullPantherEntity, type MapStyle, type PantherEntity } from "./src/panther/models.nodes";
package/dist/index.mjs CHANGED
@@ -1,50 +1,6 @@
1
1
  import pino from 'pino';
2
2
  import pretty from 'pino-pretty';
3
3
 
4
- /**
5
- * What types of graph nodes we use in metadata model
6
- */
7
- var UsedNodeLabels;
8
- (function (UsedNodeLabels) {
9
- UsedNodeLabels["Application"] = "application";
10
- UsedNodeLabels["Datasource"] = "datasource";
11
- UsedNodeLabels["Place"] = "place";
12
- UsedNodeLabels["Period"] = "period";
13
- UsedNodeLabels["AreaTree"] = "areaTree";
14
- UsedNodeLabels["AreaTreeLevel"] = "areaTreeLevel";
15
- UsedNodeLabels["Layer"] = "layer";
16
- UsedNodeLabels["Style"] = "style";
17
- UsedNodeLabels["Feature"] = "feature";
18
- UsedNodeLabels["Attribute"] = "attribute"; // Attribute node for properties of entities, like "temperature", "population", etc.
19
- })(UsedNodeLabels || (UsedNodeLabels = {}));
20
- /**
21
- * What datasources we use in the system
22
- */
23
- var UsedDatasourceLabels;
24
- (function (UsedDatasourceLabels) {
25
- UsedDatasourceLabels["Attribute"] = "attribute";
26
- UsedDatasourceLabels["Geojson"] = "geojson";
27
- UsedDatasourceLabels["WMS"] = "wms";
28
- UsedDatasourceLabels["COG"] = "cloudOptimizedGeotiff";
29
- UsedDatasourceLabels["MVT"] = "mvt";
30
- UsedDatasourceLabels["XYZ"] = "xyz";
31
- UsedDatasourceLabels["CSV"] = "csv";
32
- UsedDatasourceLabels["GeoTIFF"] = "geotiff";
33
- UsedDatasourceLabels["Shapefile"] = "shapefile";
34
- UsedDatasourceLabels["PostGIS"] = "postgis";
35
- UsedDatasourceLabels["WMTS"] = "wmts";
36
- UsedDatasourceLabels["WFS"] = "wfs";
37
- UsedDatasourceLabels["GeoPackage"] = "geopackage"; // OGC GeoPackage format
38
- })(UsedDatasourceLabels || (UsedDatasourceLabels = {}));
39
- /**
40
- * What types of edges we use in metadata model
41
- */
42
- var UsedEdgeLabels;
43
- (function (UsedEdgeLabels) {
44
- UsedEdgeLabels["RelatedTo"] = "RELATED";
45
- UsedEdgeLabels["Has"] = "HAS";
46
- })(UsedEdgeLabels || (UsedEdgeLabels = {}));
47
-
48
4
  /**
49
5
  * Check if the value in included in enum posibilities.
50
6
  * @param value Value we need to check
@@ -190,5 +146,49 @@ class AppLogger {
190
146
  }
191
147
  }
192
148
 
149
+ /**
150
+ * What types of graph nodes we use in metadata model
151
+ */
152
+ var UsedNodeLabels;
153
+ (function (UsedNodeLabels) {
154
+ UsedNodeLabels["Application"] = "application";
155
+ UsedNodeLabels["Datasource"] = "datasource";
156
+ UsedNodeLabels["Place"] = "place";
157
+ UsedNodeLabels["Period"] = "period";
158
+ UsedNodeLabels["AreaTree"] = "areaTree";
159
+ UsedNodeLabels["AreaTreeLevel"] = "areaTreeLevel";
160
+ UsedNodeLabels["Layer"] = "layer";
161
+ UsedNodeLabels["Style"] = "style";
162
+ UsedNodeLabels["Feature"] = "feature";
163
+ UsedNodeLabels["Attribute"] = "attribute"; // Attribute node for properties of entities, like "temperature", "population", etc.
164
+ })(UsedNodeLabels || (UsedNodeLabels = {}));
165
+ /**
166
+ * What datasources we use in the system
167
+ */
168
+ var UsedDatasourceLabels;
169
+ (function (UsedDatasourceLabels) {
170
+ UsedDatasourceLabels["Attribute"] = "attribute";
171
+ UsedDatasourceLabels["Geojson"] = "geojson";
172
+ UsedDatasourceLabels["WMS"] = "wms";
173
+ UsedDatasourceLabels["COG"] = "cloudOptimizedGeotiff";
174
+ UsedDatasourceLabels["MVT"] = "mvt";
175
+ UsedDatasourceLabels["XYZ"] = "xyz";
176
+ UsedDatasourceLabels["CSV"] = "csv";
177
+ UsedDatasourceLabels["GeoTIFF"] = "geotiff";
178
+ UsedDatasourceLabels["Shapefile"] = "shapefile";
179
+ UsedDatasourceLabels["PostGIS"] = "postgis";
180
+ UsedDatasourceLabels["WMTS"] = "wmts";
181
+ UsedDatasourceLabels["WFS"] = "wfs";
182
+ UsedDatasourceLabels["GeoPackage"] = "geopackage"; // OGC GeoPackage format
183
+ })(UsedDatasourceLabels || (UsedDatasourceLabels = {}));
184
+ /**
185
+ * What types of edges we use in metadata model
186
+ */
187
+ var UsedEdgeLabels;
188
+ (function (UsedEdgeLabels) {
189
+ UsedEdgeLabels["RelatedTo"] = "RELATED";
190
+ UsedEdgeLabels["Has"] = "HAS";
191
+ })(UsedEdgeLabels || (UsedEdgeLabels = {}));
192
+
193
193
  export { AppLogger, AuthorizationError, InvalidRequestError, UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels, enumCombineValuesToString, enumValuesToArray, enumValuesToString, flattenObject, isInEnum, messageFromError, notEmptyString, randomNumberBetween, removeDuplicitiesFromArray, sortStringArray };
194
194
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/panther/enums.panther.ts","../../src/coding/code.formating.ts","../../src/api/errors.api.ts","../../src/logging/logger.ts"],"sourcesContent":["/**\n * What types of graph nodes we use in metadata model\n */\nexport enum UsedNodeLabels {\n Application = \"application\", // Application node (the root of the FE app)\n Datasource = \"datasource\", // Datasource node for data including GIS information\n Place = \"place\", // Place node for geographical information\n Period = \"period\", // Period node for time information\n AreaTree = \"areaTree\", // Area tree node for administrative division\n AreaTreeLevel = \"areaTreeLevel\", // Area tree level node for administrative division\n Layer = \"layer\", // Layer node for map layer (layer have a style and a datasource)\n Style = \"style\", // Style node for map layer or a feature\n Feature = \"feature\", // Feature node for map layer,\n Attribute = \"attribute\" // Attribute node for properties of entities, like \"temperature\", \"population\", etc.\n}\n\n/**\n * What datasources we use in the system\n */\nexport enum UsedDatasourceLabels {\n Attribute = \"attribute\", // Column(s) with attribute values\n Geojson = \"geojson\", // Geojson for web map\n WMS = \"wms\", // WMS online source\n COG = \"cloudOptimizedGeotiff\", // COG online source\n MVT = \"mvt\", // MVT (Mapbox Vector Tiles) source\n XYZ = \"xyz\", // XYZ tile source\n CSV = \"csv\", // CSV data source\n GeoTIFF = \"geotiff\", // GeoTIFF raster data\n Shapefile = \"shapefile\", // ESRI Shapefile format\n PostGIS = \"postgis\", // PostGIS database source\n WMTS = \"wmts\", // Web Map Tile Service\n WFS = \"wfs\", // Web Feature Service\n GeoPackage = \"geopackage\" // OGC GeoPackage format\n}\n\n/**\n * What types of edges we use in metadata model\n */\nexport enum UsedEdgeLabels {\n RelatedTo = \"RELATED\", // Generic edge for any relation\n Has = \"HAS\", // Edge for ownership relation\n}\n","/**\n * Check if the value in included in enum posibilities.\n * @param value Value we need to check\n * @param enumEntity Enum type we check againts the value\n * @returns Is the value in this enum?\n */\nexport const isInEnum = (value: any, enumEntity: any) => {\n const allEnumValues = Object.values(enumEntity) as string[]\n return allEnumValues.includes(value)\n }\n\n/**\n * Sort array of string elements\n * @param rawArray Raw unsorted array of elements\n * @returns Sorted string array\n */\nexport const sortStringArray = (rawArray: string[]) => rawArray.sort()\n\n/**\n * Remove all duplicity string items from an array\n * @param arr Original array with duplicities\n * @returns Array of original values\n */\nexport const removeDuplicitiesFromArray = (arr: any[]) => [...new Set(arr)]\n\n\n/**\n * Check if the string value is not ` \"\" `\n * @param value Value to check\n * @returns Boolean result about the truth\n */\nexport const notEmptyString = (value: string) => value !== \"\"\n\n\n/**\n * Return enum values as array of string\n * @param enumType Type of the enum from code\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumValuesToString = (enumType: any, separator = \", \") => Object.values(enumType).join(separator)\n\n/**\n * Return enum values as array of string\n * @param enumTypes Combination of enum types\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumCombineValuesToString = (enumTypes: any[], separator = \", \") => enumTypes.map(enumType => enumValuesToString(enumType, separator)).join(separator)\n\n/**\n * Return all enum values as array\n * @param enumType What array we want to work with\n * @returns Array of enum values\n */\nexport const enumValuesToArray = (enumType: any) => Object.values(enumType) as string[]\n\n/**\n * Return random number (integer) between two values\n * @param min \n * @param max \n * @returns \n */\nexport const randomNumberBetween = (min: number, max: number) => {\n const minAr = Math.ceil(min)\n const maxAr = Math.floor(max)\n return Math.floor(Math.random()*(maxAr - minAr + 1) + min)\n}\n\n/**\n * Recursively flattens a nested object. The keys of the resulting object\n * will be the paths to the original values in the nested object, joined by dots.\n *\n * @param obj - The object to flatten.\n * @param prefix - The prefix to use for the keys in the flattened object. Defaults to an empty string.\n * @returns A new object with flattened keys.\n *\n * @example\n * ```typescript\n * const nestedObj = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: 2\n * };\n * const flatObj = flattenObject(nestedObj);\n * console.log(flatObj);\n * // Output: { 'a.b.c': 1, 'a.b.d': 2 }\n * ```\n */\nexport const flattenObject = (obj: any, prefix = ''): Record<string, any> => {\n return Object.keys(obj).reduce((acc: Record<string, any>, key: string) => {\n const propName = prefix ? `${prefix}.${key}` : key\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n Object.assign(acc, flattenObject(obj[key], propName))\n } else {\n acc[propName] = obj[key]\n }\n return acc\n }, {})\n}","/**\n * Extract message from exception error (try-catch)\n * @param error error from catch block as any\n * @returns \n */\n export const messageFromError = (error: any) => error[\"message\"] as string\n\n/**\n * We miss a API parameter needed to process action\n */\nexport class InvalidRequestError extends Error{\n constructor(message: string){\n super(`Invalid Request: ${message}`)\n }\n}\n\n/**\n * Where client has general authorization issue\n */\nexport class AuthorizationError extends Error{\n constructor(){\n super(`Authorization has failed.`)\n }\n}","// logger.ts\nimport pino, { Logger } from 'pino'\nimport pretty from 'pino-pretty'\n\n/**\n * @typedef {Object} AppLogOptions\n * @property {string} label - The label for the log entry.\n * @property {string|number|boolean} [key] - Any extra fields.\n */\nexport type AppLogOptions = {\n label: string\n [key: string]: string|number|boolean\n}\n\nconst DEFAULT_LOG_OPTIONS: AppLogOptions = {\n label: 'App'\n}\n\n// create the pretty‐printing stream once\nconst prettyStream = pretty({\n colorize: true,\n levelFirst: true,\n translateTime: 'yyyy-mm-dd HH:MM:ss'\n})\n\n// create your logger once and for all\nconst baseLogger: Logger = pino({}, prettyStream)\n\nexport class AppLogger {\n static info(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.info({ ...options, message })\n }\n\n static warn(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.warn({ ...options, message })\n }\n\n static error(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.error({ ...options, message })\n }\n\n static appStart(\n host: string,\n port: number,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n AppLogger.info(`Application started on ${host}:${port}`, options)\n }\n}"],"names":[],"mappings":";;;AAAA;;AAEG;IACS;AAAZ,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,cAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,cAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;IACnB,cAAA,CAAA,WAAA,CAAA,GAAA,WAAuB,CAAA;AAC3B,CAAC,EAXW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;AAa1B;;AAEG;IACS;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC5B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,oBAAA,CAAA,SAAA,CAAA,GA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EAAE,CAAC;IAC1C;AAEA,IAAA,OAAO,KAAK,CACV,OAAe,EACf,UAAyB,mBAAmB,EAAA;QAE5C,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC;IAC3C;IAEA,OAAO,QAAQ,CACb,IAAY,EACZ,IAAY,EACZ,UAAyB,mBAAmB,EAAA;QAE5C,SAAS,CAAC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,EAAE,OAAO,CAAC;IACnE;AACD;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/coding/code.formating.ts","../../src/api/errors.api.ts","../../src/logging/logger.ts","../../src/panther/enums.panther.ts"],"sourcesContent":["/**\n * Check if the value in included in enum posibilities.\n * @param value Value we need to check\n * @param enumEntity Enum type we check againts the value\n * @returns Is the value in this enum?\n */\nexport const isInEnum = (value: any, enumEntity: any) => {\n const allEnumValues = Object.values(enumEntity) as string[]\n return allEnumValues.includes(value)\n }\n\n/**\n * Sort array of string elements\n * @param rawArray Raw unsorted array of elements\n * @returns Sorted string array\n */\nexport const sortStringArray = (rawArray: string[]) => rawArray.sort()\n\n/**\n * Remove all duplicity string items from an array\n * @param arr Original array with duplicities\n * @returns Array of original values\n */\nexport const removeDuplicitiesFromArray = (arr: any[]) => [...new Set(arr)]\n\n\n/**\n * Check if the string value is not ` \"\" `\n * @param value Value to check\n * @returns Boolean result about the truth\n */\nexport const notEmptyString = (value: string) => value !== \"\"\n\n\n/**\n * Return enum values as array of string\n * @param enumType Type of the enum from code\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumValuesToString = (enumType: any, separator = \", \") => Object.values(enumType).join(separator)\n\n/**\n * Return enum values as array of string\n * @param enumTypes Combination of enum types\n * @param separator Optional - separator character\n * @returns Array of enum possible values\n */\nexport const enumCombineValuesToString = (enumTypes: any[], separator = \", \") => enumTypes.map(enumType => enumValuesToString(enumType, separator)).join(separator)\n\n/**\n * Return all enum values as array\n * @param enumType What array we want to work with\n * @returns Array of enum values\n */\nexport const enumValuesToArray = (enumType: any) => Object.values(enumType) as string[]\n\n/**\n * Return random number (integer) between two values\n * @param min \n * @param max \n * @returns \n */\nexport const randomNumberBetween = (min: number, max: number) => {\n const minAr = Math.ceil(min)\n const maxAr = Math.floor(max)\n return Math.floor(Math.random()*(maxAr - minAr + 1) + min)\n}\n\n/**\n * Recursively flattens a nested object. The keys of the resulting object\n * will be the paths to the original values in the nested object, joined by dots.\n *\n * @param obj - The object to flatten.\n * @param prefix - The prefix to use for the keys in the flattened object. Defaults to an empty string.\n * @returns A new object with flattened keys.\n *\n * @example\n * ```typescript\n * const nestedObj = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: 2\n * };\n * const flatObj = flattenObject(nestedObj);\n * console.log(flatObj);\n * // Output: { 'a.b.c': 1, 'a.b.d': 2 }\n * ```\n */\nexport const flattenObject = (obj: any, prefix = ''): Record<string, any> => {\n return Object.keys(obj).reduce((acc: Record<string, any>, key: string) => {\n const propName = prefix ? `${prefix}.${key}` : key\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n Object.assign(acc, flattenObject(obj[key], propName))\n } else {\n acc[propName] = obj[key]\n }\n return acc\n }, {})\n}","/**\n * Extract message from exception error (try-catch)\n * @param error error from catch block as any\n * @returns \n */\n export const messageFromError = (error: any) => error[\"message\"] as string\n\n/**\n * We miss a API parameter needed to process action\n */\nexport class InvalidRequestError extends Error{\n constructor(message: string){\n super(`Invalid Request: ${message}`)\n }\n}\n\n/**\n * Where client has general authorization issue\n */\nexport class AuthorizationError extends Error{\n constructor(){\n super(`Authorization has failed.`)\n }\n}","// logger.ts\nimport pino, { Logger } from 'pino'\nimport pretty from 'pino-pretty'\n\n/**\n * @typedef {Object} AppLogOptions\n * @property {string} label - The label for the log entry.\n * @property {string|number|boolean} [key] - Any extra fields.\n */\nexport type AppLogOptions = {\n label: string\n [key: string]: string|number|boolean\n}\n\nconst DEFAULT_LOG_OPTIONS: AppLogOptions = {\n label: 'App'\n}\n\n// create the pretty‐printing stream once\nconst prettyStream = pretty({\n colorize: true,\n levelFirst: true,\n translateTime: 'yyyy-mm-dd HH:MM:ss'\n})\n\n// create your logger once and for all\nconst baseLogger: Logger = pino({}, prettyStream)\n\nexport class AppLogger {\n static info(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.info({ ...options, message })\n }\n\n static warn(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.warn({ ...options, message })\n }\n\n static error(\n message: string,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n baseLogger.error({ ...options, message })\n }\n\n static appStart(\n host: string,\n port: number,\n options: AppLogOptions = DEFAULT_LOG_OPTIONS,\n ) {\n AppLogger.info(`Application started on ${host}:${port}`, options)\n }\n}","/**\n * What types of graph nodes we use in metadata model\n */\nexport enum UsedNodeLabels {\n Application = \"application\", // Application node (the root of the FE app)\n Datasource = \"datasource\", // Datasource node for data including GIS information\n Place = \"place\", // Place node for geographical information\n Period = \"period\", // Period node for time information\n AreaTree = \"areaTree\", // Area tree node for administrative division\n AreaTreeLevel = \"areaTreeLevel\", // Area tree level node for administrative division\n Layer = \"layer\", // Layer node for map layer (layer have a style and a datasource)\n Style = \"style\", // Style node for map layer or a feature\n Feature = \"feature\", // Feature node for map layer,\n Attribute = \"attribute\" // Attribute node for properties of entities, like \"temperature\", \"population\", etc.\n}\n\n/**\n * What datasources we use in the system\n */\nexport enum UsedDatasourceLabels {\n Attribute = \"attribute\", // Column(s) with attribute values\n Geojson = \"geojson\", // Geojson for web map\n WMS = \"wms\", // WMS online source\n COG = \"cloudOptimizedGeotiff\", // COG online source\n MVT = \"mvt\", // MVT (Mapbox Vector Tiles) source\n XYZ = \"xyz\", // XYZ tile source\n CSV = \"csv\", // CSV data source\n GeoTIFF = \"geotiff\", // GeoTIFF raster data\n Shapefile = \"shapefile\", // ESRI Shapefile format\n PostGIS = \"postgis\", // PostGIS database source\n WMTS = \"wmts\", // Web Map Tile Service\n WFS = \"wfs\", // Web Feature Service\n GeoPackage = \"geopackage\" // OGC GeoPackage format\n}\n\n/**\n * What types of edges we use in metadata model\n */\nexport enum UsedEdgeLabels {\n RelatedTo = \"RELATED\", // Generic edge for any relation\n Has = \"HAS\", // Edge for ownership relation\n}\n"],"names":[],"mappings":";;;AAAA;;;;;AAKG;MACU,QAAQ,GAAG,CAAC,KAAU,EAAE,UAAe,KAAI;IACpD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAa;AAC3D,IAAA,OAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;AACtC;AAEF;;;;AAIG;AACI,MAAM,eAAe,GAAG,CAAC,QAAkB,KAAK,QAAQ,CAAC,IAAI;AAEpE;;;;AAIG;AACI,MAAM,0BAA0B,GAAG,CAAC,GAAU,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;AAG1E;;;;AAIG;AACI,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,KAAK,KAAK;AAG3D;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,QAAa,EAAE,SAAS,GAAG,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS;AAE7G;;;;;AAKG;AACI,MAAM,yBAAyB,GAAG,CAAC,SAAgB,EAAE,SAAS,GAAG,IAAI,KAAK,SAAS,CAAC,GAAG,CAAC,QAAQ,IAAI,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;AAElK;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,QAAa,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ;AAE1E;;;;;AAKG;MACU,mBAAmB,GAAG,CAAC,GAAW,EAAE,GAAW,KAAI;IAC9D,MAAM,KAAK,GA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,CAAA,WAAA,CAAA,GAAA,SAAqB;AACrB,IAAA,cAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "@gisatcz/ptr-be-core",
3
- "version": "0.0.1-dev.2",
3
+ "version": "0.0.1-dev.3",
4
4
  "description": "Shared core library for PTR BE services",
5
5
  "type": "module",
6
- "main": "dist/index.cjs",
7
- "module": "dist/index.mjs",
8
- "types": "dist/index.d.ts",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
9
  "files": [
10
- "dist"
10
+ "dist/"
11
11
  ],
12
12
  "exports": {
13
13
  ".": {
14
+ "types": "./dist/index.d.ts",
14
15
  "import": "./dist/index.mjs",
15
16
  "require": "./dist/index.cjs",
16
- "types": "./dist/index.d.ts"
17
+ "default": "./dist/index.mjs"
17
18
  }
18
19
  },
19
20
  "scripts": {
20
- "build:clean": "rm -rf dist .rollup.cache tsconfig.tsbuildinfo",
21
- "build:barrels": "barrelsby -c barrelsby.json",
22
21
  "yalc:publish": "yalc publish",
23
22
  "yalc:publish:push": "yalc publish --push",
24
- "build:tsc": "tsc --build tsconfig.prod.json",
25
- "dev": "rollup --config --watch",
26
- "build": "rollup --config",
27
- "test": "vitest --config vitest.config.ts"
23
+ "build:clean": "rm -rf dist .rollup.cache tsconfig.tsbuildinfo",
24
+ "dev": "npm run build:clean && rollup --config --watch",
25
+ "build": "npm run build:clean && rollup --config",
26
+ "test": "vitest --config vitest.config.ts",
27
+ "pack:check": "npm pack --dry-run"
28
28
  },
29
29
  "author": "",
30
30
  "license": "ISC",