@escapenavigator/services 1.4.12 → 1.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/agregator-api/find-all-posts.d.ts +6 -0
- package/dist/api/agregator-api/find-all-posts.js +8 -0
- package/dist/api/agregator-api/find-popular-posts.d.ts +6 -0
- package/dist/api/agregator-api/find-popular-posts.js +8 -0
- package/dist/api/agregator-api/find-post-by-slug.d.ts +7 -0
- package/dist/api/agregator-api/find-post-by-slug.js +9 -0
- package/dist/api/agregator-api/find-questroom-by-slug.d.ts +7 -0
- package/dist/api/agregator-api/find-questroom-by-slug.js +9 -0
- package/dist/api/agregator-api/find-questrooms-by-organization-id.js +2 -2
- package/dist/api/agregator-api/index.d.ts +8 -0
- package/dist/api/agregator-api/index.js +8 -0
- package/dist/api/articles-api/create.d.ts +9 -0
- package/dist/api/articles-api/create.js +12 -0
- package/dist/api/articles-api/get-one.d.ts +7 -0
- package/dist/api/articles-api/get-one.js +8 -0
- package/dist/api/articles-api/index.d.ts +14 -0
- package/dist/api/articles-api/index.js +15 -0
- package/dist/api/articles-api/query.d.ts +8 -0
- package/dist/api/articles-api/query.js +9 -0
- package/dist/api/articles-api/remove.d.ts +7 -0
- package/dist/api/articles-api/remove.js +8 -0
- package/dist/api/articles-api/update.d.ts +10 -0
- package/dist/api/articles-api/update.js +12 -0
- package/dist/api/init-client-api.d.ts +2 -0
- package/dist/api/init-client-api.js +2 -0
- package/dist/utils/convert-to-options.d.ts +1 -1
- package/dist/utils/convert-to-options.js +2 -2
- package/package.json +3 -3
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AgregatorPostCardRO } from '@escapenavigator/types/dist/agregator/agregator-post-card.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
declare type ParamsData = undefined;
|
|
4
|
+
declare type ResponseData = AgregatorPostCardRO[];
|
|
5
|
+
export declare const findAllPosts: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AgregatorPostCardRO } from '@escapenavigator/types/dist/agregator/agregator-post-card.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
declare type ParamsData = undefined;
|
|
4
|
+
declare type ResponseData = AgregatorPostCardRO[];
|
|
5
|
+
export declare const findPopularPosts: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findPopularPosts = void 0;
|
|
4
|
+
var findPopularPosts = function () { return ({
|
|
5
|
+
url: '/agregator/popular-posts',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
}); };
|
|
8
|
+
exports.findPopularPosts = findPopularPosts;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AgregatorPostBySlugDTO } from '@escapenavigator/types/dist/agregator/dto/agregator-post-by-slug.dto';
|
|
2
|
+
import { AgregatorPostCardRO } from '@escapenavigator/types/dist/agregator/agregator-post-card.ro';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = AgregatorPostBySlugDTO;
|
|
5
|
+
declare type ResponseData = AgregatorPostCardRO[];
|
|
6
|
+
export declare const findPostBySlug: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findPostBySlug = void 0;
|
|
4
|
+
var findPostBySlug = function (params) { return ({
|
|
5
|
+
url: '/agregator/posts/slug/',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
params: params
|
|
8
|
+
}); };
|
|
9
|
+
exports.findPostBySlug = findPostBySlug;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AgregatorQuestroomRO } from '@escapenavigator/types/dist/agregator/agregator-questroom.ro';
|
|
2
|
+
import { AgregatorQuestroomBySlugDTO } from '@escapenavigator/types/dist/agregator/dto/agregator-questroom-by-slug.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = AgregatorQuestroomBySlugDTO;
|
|
5
|
+
declare type ResponseData = AgregatorQuestroomRO;
|
|
6
|
+
export declare const findQuestroomBySlug: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findQuestroomBySlug = void 0;
|
|
4
|
+
var findQuestroomBySlug = function (params) { return ({
|
|
5
|
+
url: '/agregator/questroom/slug/',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
params: params
|
|
8
|
+
}); };
|
|
9
|
+
exports.findQuestroomBySlug = findQuestroomBySlug;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findQuestroomsByOrganizationId = void 0;
|
|
4
|
-
var findQuestroomsByOrganizationId = function (
|
|
5
|
-
url: '/agregator/questrooms/organization/' +
|
|
4
|
+
var findQuestroomsByOrganizationId = function (organizationSlug) { return ({
|
|
5
|
+
url: '/agregator/questrooms/organization/' + organizationSlug,
|
|
6
6
|
method: 'GET'
|
|
7
7
|
}); };
|
|
8
8
|
exports.findQuestroomsByOrganizationId = findQuestroomsByOrganizationId;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { findPostBySlug } from './find-post-by-slug';
|
|
2
|
+
import { findPopularPosts } from './find-popular-posts';
|
|
3
|
+
import { findAllPosts } from './find-all-posts';
|
|
1
4
|
import { findCitiesByCountry } from './find-cities-by-country';
|
|
2
5
|
import { findCityBySlug } from './find-city-by-slug';
|
|
3
6
|
import { findCurrentCity } from './find-current-city';
|
|
@@ -9,8 +12,10 @@ import { findQuestroomsByOrganizationId } from './find-questrooms-by-organizatio
|
|
|
9
12
|
import { findQuestroomsByTags } from './find-questrooms-by-tags';
|
|
10
13
|
import { findQuestroomsByTitle } from './find-questrooms-by-title';
|
|
11
14
|
import { findSimilaQuestroomsNear } from './find-similar-questrooms-near';
|
|
15
|
+
import { findQuestroomBySlug } from './find-questroom-by-slug';
|
|
12
16
|
declare type ApiDeclaration = {
|
|
13
17
|
findCitiesByCountry: typeof findCitiesByCountry;
|
|
18
|
+
findQuestroomBySlug: typeof findQuestroomBySlug;
|
|
14
19
|
findCityBySlug: typeof findCityBySlug;
|
|
15
20
|
findCurrentCity: typeof findCurrentCity;
|
|
16
21
|
findLocationsByCoordinates: typeof findLocationsByCoordinates;
|
|
@@ -21,6 +26,9 @@ declare type ApiDeclaration = {
|
|
|
21
26
|
findQuestroomsByTags: typeof findQuestroomsByTags;
|
|
22
27
|
findQuestroomsByTitle: typeof findQuestroomsByTitle;
|
|
23
28
|
findSimilaQuestroomsNear: typeof findSimilaQuestroomsNear;
|
|
29
|
+
findAllPosts: typeof findAllPosts;
|
|
30
|
+
findPopularPosts: typeof findPopularPosts;
|
|
31
|
+
findPostBySlug: typeof findPostBySlug;
|
|
24
32
|
};
|
|
25
33
|
export declare const agregatorApiDeclaration: ApiDeclaration;
|
|
26
34
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.agregatorApiDeclaration = void 0;
|
|
4
|
+
var find_post_by_slug_1 = require("./find-post-by-slug");
|
|
5
|
+
var find_popular_posts_1 = require("./find-popular-posts");
|
|
6
|
+
var find_all_posts_1 = require("./find-all-posts");
|
|
4
7
|
var find_cities_by_country_1 = require("./find-cities-by-country");
|
|
5
8
|
var find_city_by_slug_1 = require("./find-city-by-slug");
|
|
6
9
|
var find_current_city_1 = require("./find-current-city");
|
|
@@ -12,8 +15,10 @@ var find_questrooms_by_organization_id_1 = require("./find-questrooms-by-organiz
|
|
|
12
15
|
var find_questrooms_by_tags_1 = require("./find-questrooms-by-tags");
|
|
13
16
|
var find_questrooms_by_title_1 = require("./find-questrooms-by-title");
|
|
14
17
|
var find_similar_questrooms_near_1 = require("./find-similar-questrooms-near");
|
|
18
|
+
var find_questroom_by_slug_1 = require("./find-questroom-by-slug");
|
|
15
19
|
exports.agregatorApiDeclaration = {
|
|
16
20
|
findCitiesByCountry: find_cities_by_country_1.findCitiesByCountry,
|
|
21
|
+
findQuestroomBySlug: find_questroom_by_slug_1.findQuestroomBySlug,
|
|
17
22
|
findCityBySlug: find_city_by_slug_1.findCityBySlug,
|
|
18
23
|
findCurrentCity: find_current_city_1.findCurrentCity,
|
|
19
24
|
findLocationsByCoordinates: find_locations_by_coordinates_1.findLocationsByCoordinates,
|
|
@@ -24,4 +29,7 @@ exports.agregatorApiDeclaration = {
|
|
|
24
29
|
findQuestroomsByTags: find_questrooms_by_tags_1.findQuestroomsByTags,
|
|
25
30
|
findQuestroomsByTitle: find_questrooms_by_title_1.findQuestroomsByTitle,
|
|
26
31
|
findSimilaQuestroomsNear: find_similar_questrooms_near_1.findSimilaQuestroomsNear,
|
|
32
|
+
findAllPosts: find_all_posts_1.findAllPosts,
|
|
33
|
+
findPopularPosts: find_popular_posts_1.findPopularPosts,
|
|
34
|
+
findPostBySlug: find_post_by_slug_1.findPostBySlug,
|
|
27
35
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ArticleResponseObject } from '@escapenavigator/types/dist/article/article.ro';
|
|
2
|
+
import { CreateArticleDto } from '@escapenavigator/types/dist/article/create-article.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = {
|
|
5
|
+
data: CreateArticleDto;
|
|
6
|
+
};
|
|
7
|
+
declare type ResponseData = ArticleResponseObject;
|
|
8
|
+
export declare const create: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = void 0;
|
|
4
|
+
var create = function (_a) {
|
|
5
|
+
var data = _a.data;
|
|
6
|
+
return ({
|
|
7
|
+
url: '/articles',
|
|
8
|
+
method: 'POST',
|
|
9
|
+
data: data,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.create = create;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ArticleResponseObject } from '@escapenavigator/types/dist/article/article.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
/** ID статьи */
|
|
4
|
+
declare type ParamsData = number;
|
|
5
|
+
declare type ResponseData = ArticleResponseObject;
|
|
6
|
+
export declare const getOne: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { create } from './create';
|
|
2
|
+
import { getOne } from './get-one';
|
|
3
|
+
import { query } from './query';
|
|
4
|
+
import { remove } from './remove';
|
|
5
|
+
import { update } from './update';
|
|
6
|
+
declare type ApiDeclaration = {
|
|
7
|
+
create: typeof create;
|
|
8
|
+
remove: typeof remove;
|
|
9
|
+
update: typeof update;
|
|
10
|
+
query: typeof query;
|
|
11
|
+
getOne: typeof getOne;
|
|
12
|
+
};
|
|
13
|
+
export declare const articlesApiDeclaration: ApiDeclaration;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.articlesApiDeclaration = void 0;
|
|
4
|
+
var create_1 = require("./create");
|
|
5
|
+
var get_one_1 = require("./get-one");
|
|
6
|
+
var query_1 = require("./query");
|
|
7
|
+
var remove_1 = require("./remove");
|
|
8
|
+
var update_1 = require("./update");
|
|
9
|
+
exports.articlesApiDeclaration = {
|
|
10
|
+
create: create_1.create,
|
|
11
|
+
remove: remove_1.remove,
|
|
12
|
+
update: update_1.update,
|
|
13
|
+
query: query_1.query,
|
|
14
|
+
getOne: get_one_1.getOne,
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ArticleResponseObject } from '@escapenavigator/types/dist/article/article.ro';
|
|
2
|
+
import { QueryDto } from '@escapenavigator/types/dist/shared/query.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
/** SearchText - поиск по названию статьи */
|
|
5
|
+
declare type ParamsData = QueryDto;
|
|
6
|
+
declare type ResponseData = ArticleResponseObject[];
|
|
7
|
+
export declare const query: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ArticleResponseObject } from '@escapenavigator/types/dist/article/article.ro';
|
|
2
|
+
import { ApiMethodDeclaration } from '..';
|
|
3
|
+
/** ID поста */
|
|
4
|
+
declare type ParamsData = number;
|
|
5
|
+
declare type ResponseData = ArticleResponseObject;
|
|
6
|
+
export declare const remove: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ArticleResponseObject } from '@escapenavigator/types/dist/article/article.ro';
|
|
2
|
+
import { UpdateArticleDto } from '@escapenavigator/types/dist/article/update-article.dto';
|
|
3
|
+
import { ApiMethodDeclaration } from '..';
|
|
4
|
+
declare type ParamsData = {
|
|
5
|
+
id: number;
|
|
6
|
+
data: UpdateArticleDto;
|
|
7
|
+
};
|
|
8
|
+
declare type ResponseData = ArticleResponseObject;
|
|
9
|
+
export declare const update: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update = void 0;
|
|
4
|
+
var update = function (_a) {
|
|
5
|
+
var id = _a.id, data = _a.data;
|
|
6
|
+
return ({
|
|
7
|
+
url: "/articles/".concat(id),
|
|
8
|
+
method: 'PATCH',
|
|
9
|
+
data: data,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.update = update;
|
|
@@ -31,6 +31,7 @@ import { widgetsOpenApiDeclaration } from './widgets-openapi';
|
|
|
31
31
|
import { citiesApiDeclaration } from './cities-api';
|
|
32
32
|
import { agregatorApiDeclaration } from './agregator-api';
|
|
33
33
|
import { Api } from '.';
|
|
34
|
+
import { articlesApiDeclaration } from './articles-api';
|
|
34
35
|
export declare type InitApiDeclaration = {
|
|
35
36
|
cities: Api<typeof citiesApiDeclaration>;
|
|
36
37
|
agregator: Api<typeof agregatorApiDeclaration>;
|
|
@@ -64,5 +65,6 @@ export declare type InitApiDeclaration = {
|
|
|
64
65
|
certificatesales: Api<typeof certificateSalesApiDeclaration>;
|
|
65
66
|
support: Api<typeof supportApiDeclaration>;
|
|
66
67
|
registrationRequests: Api<typeof registrationRequestsApiDeclaration>;
|
|
68
|
+
articles: Api<typeof articlesApiDeclaration>;
|
|
67
69
|
};
|
|
68
70
|
export declare const initClientApi: (url: string) => InitApiDeclaration;
|
|
@@ -34,6 +34,7 @@ var widgets_openapi_1 = require("./widgets-openapi");
|
|
|
34
34
|
var cities_api_1 = require("./cities-api");
|
|
35
35
|
var agregator_api_1 = require("./agregator-api");
|
|
36
36
|
var _1 = require(".");
|
|
37
|
+
var articles_api_1 = require("./articles-api");
|
|
37
38
|
var initClientApi = function (url) {
|
|
38
39
|
return {
|
|
39
40
|
cities: (0, _1.initApi)(cities_api_1.citiesApiDeclaration, url),
|
|
@@ -68,6 +69,7 @@ var initClientApi = function (url) {
|
|
|
68
69
|
certificatesales: (0, _1.initApi)(certificatesales_api_1.certificateSalesApiDeclaration, url),
|
|
69
70
|
support: (0, _1.initApi)(support_1.supportApiDeclaration, url),
|
|
70
71
|
registrationRequests: (0, _1.initApi)(registration_requests_api_1.registrationRequestsApiDeclaration, url),
|
|
72
|
+
articles: (0, _1.initApi)(articles_api_1.articlesApiDeclaration, url),
|
|
71
73
|
};
|
|
72
74
|
};
|
|
73
75
|
exports.initClientApi = initClientApi;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToOptions = void 0;
|
|
4
|
-
var convertToOptions = function (data
|
|
4
|
+
var convertToOptions = function (data) { return data.map(function (item) { return ({
|
|
5
5
|
key: item.id,
|
|
6
|
-
content:
|
|
6
|
+
content: item.title || item.surname ? "".concat(item.name, " ").concat(item.surname) : item.name,
|
|
7
7
|
}); }); };
|
|
8
8
|
exports.convertToOptions = convertToOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/services",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.16",
|
|
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.json"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "51739bc10f224d63b4440d62c6e5e1e48aa77ede",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@escapenavigator/types": "^1.4.
|
|
17
|
+
"@escapenavigator/types": "^1.4.16",
|
|
18
18
|
"axios": "^0.21.4",
|
|
19
19
|
"class-transformer": "^0.5.1",
|
|
20
20
|
"class-validator": "^0.13.1",
|