@escapenavigator/services 1.1.4 → 1.1.6

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.
Files changed (39) hide show
  1. package/dist/api/cities-api/get-cities-by-country.d.ts +7 -0
  2. package/dist/api/cities-api/get-cities-by-country.js +8 -0
  3. package/dist/api/cities-api/get-city-by-ip.d.ts +6 -0
  4. package/dist/api/cities-api/get-city-by-ip.js +8 -0
  5. package/dist/api/cities-api/get-city-by-slug.d.ts +6 -0
  6. package/dist/api/cities-api/get-city-by-slug.js +8 -0
  7. package/dist/api/cities-api/get-one.d.ts +6 -0
  8. package/dist/api/cities-api/get-one.js +8 -0
  9. package/dist/api/cities-api/get-popular-cities-near.d.ts +6 -0
  10. package/dist/api/cities-api/get-popular-cities-near.js +8 -0
  11. package/dist/api/cities-api/index.d.ts +18 -0
  12. package/dist/api/cities-api/index.js +19 -0
  13. package/dist/api/cities-api/query.d.ts +7 -0
  14. package/dist/api/cities-api/query.js +9 -0
  15. package/dist/api/cities-api/remove.d.ts +7 -0
  16. package/dist/api/cities-api/remove.js +8 -0
  17. package/dist/api/cities-api/update.d.ts +10 -0
  18. package/dist/api/cities-api/update.js +9 -0
  19. package/dist/api/locations-api/get-by-coordinates.d.ts +7 -0
  20. package/dist/api/locations-api/get-by-coordinates.js +8 -0
  21. package/dist/api/locations-api/index.d.ts +2 -0
  22. package/dist/api/locations-api/index.js +2 -0
  23. package/dist/api/profiles-api/get-by-slug.d.ts +7 -0
  24. package/dist/api/profiles-api/get-by-slug.js +8 -0
  25. package/dist/api/profiles-api/index.d.ts +2 -0
  26. package/dist/api/profiles-api/index.js +2 -0
  27. package/dist/api/questrooms-api/get-by-coordinates.d.ts +7 -0
  28. package/dist/api/questrooms-api/get-by-coordinates.js +8 -0
  29. package/dist/api/questrooms-api/get-by-location.d.ts +7 -0
  30. package/dist/api/questrooms-api/get-by-location.js +8 -0
  31. package/dist/api/questrooms-api/get-by-slug.d.ts +7 -0
  32. package/dist/api/questrooms-api/get-by-slug.js +8 -0
  33. package/dist/api/questrooms-api/get-by-title.d.ts +7 -0
  34. package/dist/api/questrooms-api/get-by-title.js +8 -0
  35. package/dist/api/questrooms-api/index.d.ts +6 -0
  36. package/dist/api/questrooms-api/index.js +6 -0
  37. package/dist/utils/serialize-record.d.ts +1 -2
  38. package/dist/utils/serialize-record.js +2 -0
  39. package/package.json +3 -3
@@ -0,0 +1,7 @@
1
+ import { CountriesEnum } from '@escapenavigator/types/dist/shared/enum/countries.enum';
2
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
3
+ import { ApiMethodDeclaration } from '..';
4
+ declare type ParamsData = CountriesEnum;
5
+ declare type ResponseData = CityResponseObject[];
6
+ export declare const getCitiesByCountry: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCitiesByCountry = void 0;
4
+ const getCitiesByCountry = (country) => ({
5
+ url: '/cities/country/' + country,
6
+ method: 'GET'
7
+ });
8
+ exports.getCitiesByCountry = getCitiesByCountry;
@@ -0,0 +1,6 @@
1
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ declare type ParamsData = string;
4
+ declare type ResponseData = CityResponseObject;
5
+ export declare const getCityByIp: ApiMethodDeclaration<ParamsData, ResponseData>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCityByIp = void 0;
4
+ const getCityByIp = (ip) => ({
5
+ url: '/cities/current/' + ip,
6
+ method: 'GET'
7
+ });
8
+ exports.getCityByIp = getCityByIp;
@@ -0,0 +1,6 @@
1
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ declare type ParamsData = string;
4
+ declare type ResponseData = CityResponseObject;
5
+ export declare const getCityBySlug: ApiMethodDeclaration<ParamsData, ResponseData>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCityBySlug = void 0;
4
+ const getCityBySlug = (slug) => ({
5
+ url: '/cities/slug/' + slug,
6
+ method: 'GET'
7
+ });
8
+ exports.getCityBySlug = getCityBySlug;
@@ -0,0 +1,6 @@
1
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ declare type ParamsData = number;
4
+ declare type ResponseData = CityResponseObject;
5
+ export declare const getOne: ApiMethodDeclaration<ParamsData, ResponseData>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOne = void 0;
4
+ const getOne = (id) => ({
5
+ url: `/cities/${id}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getOne = getOne;
@@ -0,0 +1,6 @@
1
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ declare type ParamsData = string;
4
+ declare type ResponseData = CityResponseObject[];
5
+ export declare const getPopularCitiesNear: ApiMethodDeclaration<ParamsData, ResponseData>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPopularCitiesNear = void 0;
4
+ const getPopularCitiesNear = (slug) => ({
5
+ url: '/cities/near/' + slug,
6
+ method: 'GET'
7
+ });
8
+ exports.getPopularCitiesNear = getPopularCitiesNear;
@@ -0,0 +1,18 @@
1
+ import { getCitiesByCountry } from './get-cities-by-country';
2
+ import { getCityBySlug } from './get-city-by-slug';
3
+ import { getCityByIp } from './get-city-by-ip';
4
+ import { getPopularCitiesNear } from './get-popular-cities-near';
5
+ import { getOne } from './get-one';
6
+ import { update } from './update';
7
+ import { remove } from './remove';
8
+ declare type ApiDeclaration = {
9
+ getCitiesByCountry: typeof getCitiesByCountry;
10
+ getCityBySlug: typeof getCityBySlug;
11
+ getCityByIp: typeof getCityByIp;
12
+ getPopularCitiesNear: typeof getPopularCitiesNear;
13
+ getOne: typeof getOne;
14
+ update: typeof update;
15
+ remove: typeof remove;
16
+ };
17
+ export declare const citiesApiDeclaration: ApiDeclaration;
18
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.citiesApiDeclaration = void 0;
4
+ const get_cities_by_country_1 = require("./get-cities-by-country");
5
+ const get_city_by_slug_1 = require("./get-city-by-slug");
6
+ const get_city_by_ip_1 = require("./get-city-by-ip");
7
+ const get_popular_cities_near_1 = require("./get-popular-cities-near");
8
+ const get_one_1 = require("./get-one");
9
+ const update_1 = require("./update");
10
+ const remove_1 = require("./remove");
11
+ exports.citiesApiDeclaration = {
12
+ getCitiesByCountry: get_cities_by_country_1.getCitiesByCountry,
13
+ getCityBySlug: get_city_by_slug_1.getCityBySlug,
14
+ getCityByIp: get_city_by_ip_1.getCityByIp,
15
+ getPopularCitiesNear: get_popular_cities_near_1.getPopularCitiesNear,
16
+ getOne: get_one_1.getOne,
17
+ update: update_1.update,
18
+ remove: remove_1.remove,
19
+ };
@@ -0,0 +1,7 @@
1
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
2
+ import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
3
+ import { ApiMethodDeclaration } from '..';
4
+ declare type ParamsData = QueryDto;
5
+ declare type ResponseData = CityResponseObject[];
6
+ export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.query = void 0;
4
+ const query = (params) => ({
5
+ url: '/cities',
6
+ method: 'GET',
7
+ params
8
+ });
9
+ exports.query = query;
@@ -0,0 +1,7 @@
1
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** ID city */
4
+ declare type ParamsData = number;
5
+ declare type ResponseData = CityResponseObject;
6
+ export declare const remove: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.remove = void 0;
4
+ const remove = (id) => ({
5
+ url: `/cities/${id}`,
6
+ method: 'DELETE',
7
+ });
8
+ exports.remove = remove;
@@ -0,0 +1,10 @@
1
+ import { UpdateCityDto } from '@escapenavigator/types/dist/city/update-city.dto';
2
+ import { CityResponseObject } from '@escapenavigator/types/dist/city/city.ro';
3
+ import { ApiMethodDeclaration } from '..';
4
+ declare type ParamsData = {
5
+ id: number;
6
+ data: UpdateCityDto;
7
+ };
8
+ declare type ResponseData = CityResponseObject;
9
+ export declare const update: ApiMethodDeclaration<ParamsData, ResponseData>;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const update = ({ id, data }) => ({
5
+ url: `/cities/${id}`,
6
+ method: 'PATCH',
7
+ data,
8
+ });
9
+ exports.update = update;
@@ -0,0 +1,7 @@
1
+ import { GetNearestLocationDto } from '@escapenavigator/types/dist/location/get-nearest-location.dto';
2
+ import { NearestLocationResponseObject } from '@escapenavigator/types/dist/location/nearest-location.ro';
3
+ import { ApiMethodDeclaration } from '..';
4
+ declare type ParamsData = GetNearestLocationDto;
5
+ declare type ResponseData = NearestLocationResponseObject[];
6
+ export declare const getByCoordinates: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getByCoordinates = void 0;
4
+ const getByCoordinates = (id) => ({
5
+ url: `/locations/near/${id}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getByCoordinates = getByCoordinates;
@@ -4,6 +4,7 @@ import { query } from './query';
4
4
  import { recover } from './recover';
5
5
  import { remove } from './remove';
6
6
  import { update } from './update';
7
+ import { getByCoordinates } from './get-by-coordinates';
7
8
  declare type ApiDeclaration = {
8
9
  create: typeof create;
9
10
  remove: typeof remove;
@@ -11,6 +12,7 @@ declare type ApiDeclaration = {
11
12
  getOne: typeof getOne;
12
13
  recover: typeof recover;
13
14
  query: typeof query;
15
+ getByCoordinates: typeof getByCoordinates;
14
16
  };
15
17
  export declare const locationsApiDeclaration: ApiDeclaration;
16
18
  export {};
@@ -7,6 +7,7 @@ const query_1 = require("./query");
7
7
  const recover_1 = require("./recover");
8
8
  const remove_1 = require("./remove");
9
9
  const update_1 = require("./update");
10
+ const get_by_coordinates_1 = require("./get-by-coordinates");
10
11
  exports.locationsApiDeclaration = {
11
12
  create: create_1.create,
12
13
  remove: remove_1.remove,
@@ -14,4 +15,5 @@ exports.locationsApiDeclaration = {
14
15
  query: query_1.query,
15
16
  recover: recover_1.recover,
16
17
  getOne: get_one_1.getOne,
18
+ getByCoordinates: get_by_coordinates_1.getByCoordinates,
17
19
  };
@@ -0,0 +1,7 @@
1
+ import { AgregatorProfileResponseObject } from '@escapenavigator/types/dist/profile/agregator-profile.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** slug */
4
+ declare type ParamsData = string;
5
+ declare type ResponseData = AgregatorProfileResponseObject;
6
+ export declare const getBySlug: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBySlug = void 0;
4
+ const getBySlug = (slug) => ({
5
+ url: `/profiles/slug/${slug}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getBySlug = getBySlug;
@@ -4,6 +4,7 @@ import { getOne } from './get-one';
4
4
  import { query } from './query';
5
5
  import { remove } from './remove';
6
6
  import { update } from './update';
7
+ import { getBySlug } from './get-by-slug';
7
8
  declare type ApiDeclaration = {
8
9
  create: typeof create;
9
10
  remove: typeof remove;
@@ -11,6 +12,7 @@ declare type ApiDeclaration = {
11
12
  query: typeof query;
12
13
  getOne: typeof getOne;
13
14
  current: typeof current;
15
+ getBySlug: typeof getBySlug;
14
16
  };
15
17
  export declare const profilesApiDeclaration: ApiDeclaration;
16
18
  export {};
@@ -7,6 +7,7 @@ const get_one_1 = require("./get-one");
7
7
  const query_1 = require("./query");
8
8
  const remove_1 = require("./remove");
9
9
  const update_1 = require("./update");
10
+ const get_by_slug_1 = require("./get-by-slug");
10
11
  exports.profilesApiDeclaration = {
11
12
  create: create_1.create,
12
13
  remove: remove_1.remove,
@@ -14,4 +15,5 @@ exports.profilesApiDeclaration = {
14
15
  query: query_1.query,
15
16
  getOne: get_one_1.getOne,
16
17
  current: current_1.current,
18
+ getBySlug: get_by_slug_1.getBySlug
17
19
  };
@@ -0,0 +1,7 @@
1
+ import { AgregatorQuestroomResponseObject } from '@escapenavigator/types/dist/questroom/agregator-questroom.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** coordinates */
4
+ declare type ParamsData = string;
5
+ declare type ResponseData = AgregatorQuestroomResponseObject[];
6
+ export declare const getByCoordinates: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getByCoordinates = void 0;
4
+ const getByCoordinates = (coordinates) => ({
5
+ url: `/questrooms/near/${coordinates}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getByCoordinates = getByCoordinates;
@@ -0,0 +1,7 @@
1
+ import { AgregatorQuestroomResponseObject } from '@escapenavigator/types/dist/questroom/agregator-questroom.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** ID локации */
4
+ declare type ParamsData = number;
5
+ declare type ResponseData = AgregatorQuestroomResponseObject[];
6
+ export declare const getByLocation: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getByLocation = void 0;
4
+ const getByLocation = (id) => ({
5
+ url: `/questrooms/location/${id}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getByLocation = getByLocation;
@@ -0,0 +1,7 @@
1
+ import { AgregatorQuestroomResponseObject } from '@escapenavigator/types/dist/questroom/agregator-questroom.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** slug */
4
+ declare type ParamsData = string;
5
+ declare type ResponseData = AgregatorQuestroomResponseObject;
6
+ export declare const getBySlug: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBySlug = void 0;
4
+ const getBySlug = (slug) => ({
5
+ url: `/questrooms/slug/${slug}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getBySlug = getBySlug;
@@ -0,0 +1,7 @@
1
+ import { AgregatorQuestroomResponseObject } from '@escapenavigator/types/dist/questroom/agregator-questroom.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ /** Название */
4
+ declare type ParamsData = string;
5
+ declare type ResponseData = AgregatorQuestroomResponseObject[];
6
+ export declare const getByTitle: ApiMethodDeclaration<ParamsData, ResponseData>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getByTitle = void 0;
4
+ const getByTitle = (title) => ({
5
+ url: `/questrooms/title/${title}`,
6
+ method: 'GET',
7
+ });
8
+ exports.getByTitle = getByTitle;
@@ -4,6 +4,9 @@ import { query } from './query';
4
4
  import { recover } from './recover';
5
5
  import { remove } from './remove';
6
6
  import { update } from './update';
7
+ import { getByLocation } from './get-by-location';
8
+ import { getByCoordinates } from './get-by-coordinates';
9
+ import { getBySlug } from './get-by-slug';
7
10
  declare type ApiDeclaration = {
8
11
  create: typeof create;
9
12
  remove: typeof remove;
@@ -11,6 +14,9 @@ declare type ApiDeclaration = {
11
14
  query: typeof query;
12
15
  getOne: typeof getOne;
13
16
  recover: typeof recover;
17
+ getByLocation: typeof getByLocation;
18
+ getByCoordinates: typeof getByCoordinates;
19
+ getBySlug: typeof getBySlug;
14
20
  };
15
21
  export declare const questroomsApiDeclaration: ApiDeclaration;
16
22
  export {};
@@ -7,6 +7,9 @@ const query_1 = require("./query");
7
7
  const recover_1 = require("./recover");
8
8
  const remove_1 = require("./remove");
9
9
  const update_1 = require("./update");
10
+ const get_by_location_1 = require("./get-by-location");
11
+ const get_by_coordinates_1 = require("./get-by-coordinates");
12
+ const get_by_slug_1 = require("./get-by-slug");
10
13
  exports.questroomsApiDeclaration = {
11
14
  create: create_1.create,
12
15
  remove: remove_1.remove,
@@ -14,4 +17,7 @@ exports.questroomsApiDeclaration = {
14
17
  query: query_1.query,
15
18
  getOne: get_one_1.getOne,
16
19
  recover: recover_1.recover,
20
+ getByLocation: get_by_location_1.getByLocation,
21
+ getByCoordinates: get_by_coordinates_1.getByCoordinates,
22
+ getBySlug: get_by_slug_1.getBySlug
17
23
  };
@@ -1,2 +1 @@
1
- import { ClassConstructor } from 'class-transformer';
2
- export declare const serializeRecord: <T extends ClassConstructor<unknown>>(Dto: T, data: any) => T;
1
+ export declare const serializeRecord: <T, D>(Dto: T, data: D) => T;
@@ -2,5 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.serializeRecord = void 0;
4
4
  const class_transformer_1 = require("class-transformer");
5
+ // export const serializeRecord = <T extends ClassConstructor<unknown>>(Dto: T, data): T =>
6
+ // plainToClass(Dto, data, { strategy: 'excludeAll' }) as unknown as T;
5
7
  const serializeRecord = (Dto, data) => (0, class_transformer_1.plainToClass)(Dto, data, { strategy: 'excludeAll' });
6
8
  exports.serializeRecord = serializeRecord;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/services",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,9 +12,9 @@
12
12
  "scripts": {
13
13
  "build": "rm -rf dist && tsc --project tsconfig.build.json"
14
14
  },
15
- "gitHead": "366360dd168e5a46b7e1040652706d03e48a2afb",
15
+ "gitHead": "453c247b2035970fa2afc78b00b811d462062100",
16
16
  "dependencies": {
17
- "@escapenavigator/types": "^1.1.4",
17
+ "@escapenavigator/types": "^1.1.6",
18
18
  "axios": "^0.21.4",
19
19
  "class-transformer": "^0.5.1",
20
20
  "class-validator": "^0.13.1",