@escapenavigator/services 2.0.8 → 2.0.9

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.
@@ -0,0 +1,71 @@
1
+ import { BindCityQuestDto } from '@escapenavigator/types/dist/city-quest/bind-city-quest.dto';
2
+ import { CityQuestAssetRO, CityQuestRO } from '@escapenavigator/types/dist/city-quest/city-quest.ro';
3
+ import { ImportCityQuestDto } from '@escapenavigator/types/dist/city-quest/import-city-quest.dto';
4
+ import { UpdateCityQuestDto } from '@escapenavigator/types/dist/city-quest/update-city-quest.dto';
5
+ import { UpsertCityQuestAssetDto } from '@escapenavigator/types/dist/city-quest/upsert-city-quest-asset.dto';
6
+ import { ApiMethodDeclaration } from '..';
7
+ export type CityQuestAnalyticsRO = {
8
+ sessionsTotal: number;
9
+ sessionsFinished: number;
10
+ completionRate: number;
11
+ medianDurationSec: number;
12
+ avgScore: number;
13
+ issues: Array<{
14
+ id: number;
15
+ stopId: string;
16
+ text: string;
17
+ createdAt: string;
18
+ }>;
19
+ overrides: Array<{
20
+ id: number;
21
+ stopId: string;
22
+ fallbackForced: boolean;
23
+ reason: string | null;
24
+ }>;
25
+ };
26
+ export declare const cityQuestsApiDeclaration: {
27
+ query: ApiMethodDeclaration<undefined, CityQuestRO[]>;
28
+ getOne: ApiMethodDeclaration<number, CityQuestRO>;
29
+ getContent: ApiMethodDeclaration<number, {
30
+ content: Record<string, unknown> | null;
31
+ }>;
32
+ getVersions: ApiMethodDeclaration<number, {
33
+ id: number;
34
+ version: number;
35
+ createdAt: string;
36
+ }[]>;
37
+ importGame: ApiMethodDeclaration<{
38
+ data: ImportCityQuestDto;
39
+ }, CityQuestRO>;
40
+ update: ApiMethodDeclaration<{
41
+ id: number;
42
+ data: UpdateCityQuestDto;
43
+ }, CityQuestRO>;
44
+ publish: ApiMethodDeclaration<number, CityQuestRO>;
45
+ listAssets: ApiMethodDeclaration<number, CityQuestAssetRO[]>;
46
+ upsertAsset: ApiMethodDeclaration<{
47
+ id: number;
48
+ data: UpsertCityQuestAssetDto;
49
+ }, CityQuestAssetRO>;
50
+ deleteAsset: ApiMethodDeclaration<{
51
+ id: number;
52
+ assetId: number;
53
+ }, {
54
+ success: boolean;
55
+ }>;
56
+ bind: ApiMethodDeclaration<{
57
+ id: number;
58
+ data: BindCityQuestDto;
59
+ }, {
60
+ id: number;
61
+ questroomId: number;
62
+ profileId: number;
63
+ }>;
64
+ unbind: ApiMethodDeclaration<{
65
+ id: number;
66
+ bindingId: number;
67
+ }, {
68
+ success: boolean;
69
+ }>;
70
+ analytics: ApiMethodDeclaration<number, CityQuestAnalyticsRO>;
71
+ };
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cityQuestsApiDeclaration = void 0;
4
+ /** Админский API управления городскими квестами (контент/ассеты/биндинги). */
5
+ var query = function () { return ({
6
+ url: '/admin/city-quests',
7
+ method: 'GET',
8
+ }); };
9
+ var getOne = function (id) { return ({
10
+ url: "/admin/city-quests/".concat(id),
11
+ method: 'GET',
12
+ }); };
13
+ var getContent = function (id) { return ({
14
+ url: "/admin/city-quests/".concat(id, "/content"),
15
+ method: 'GET',
16
+ }); };
17
+ var getVersions = function (id) { return ({
18
+ url: "/admin/city-quests/".concat(id, "/versions"),
19
+ method: 'GET',
20
+ }); };
21
+ var importGame = function (_a) {
22
+ var data = _a.data;
23
+ return ({
24
+ url: '/admin/city-quests/import',
25
+ method: 'POST',
26
+ data: data,
27
+ });
28
+ };
29
+ var update = function (_a) {
30
+ var id = _a.id, data = _a.data;
31
+ return ({
32
+ url: "/admin/city-quests/".concat(id),
33
+ method: 'PATCH',
34
+ data: data,
35
+ });
36
+ };
37
+ var publish = function (id) { return ({
38
+ url: "/admin/city-quests/".concat(id, "/publish"),
39
+ method: 'POST',
40
+ }); };
41
+ var listAssets = function (id) { return ({
42
+ url: "/admin/city-quests/".concat(id, "/assets"),
43
+ method: 'GET',
44
+ }); };
45
+ var upsertAsset = function (_a) {
46
+ var id = _a.id, data = _a.data;
47
+ return ({
48
+ url: "/admin/city-quests/".concat(id, "/assets"),
49
+ method: 'POST',
50
+ data: data,
51
+ });
52
+ };
53
+ var deleteAsset = function (_a) {
54
+ var id = _a.id, assetId = _a.assetId;
55
+ return ({
56
+ url: "/admin/city-quests/".concat(id, "/assets/").concat(assetId),
57
+ method: 'DELETE',
58
+ });
59
+ };
60
+ var bind = function (_a) {
61
+ var id = _a.id, data = _a.data;
62
+ return ({
63
+ url: "/admin/city-quests/".concat(id, "/bindings"),
64
+ method: 'POST',
65
+ data: data,
66
+ });
67
+ };
68
+ var unbind = function (_a) {
69
+ var id = _a.id, bindingId = _a.bindingId;
70
+ return ({
71
+ url: "/admin/city-quests/".concat(id, "/bindings/").concat(bindingId),
72
+ method: 'DELETE',
73
+ });
74
+ };
75
+ var analytics = function (id) { return ({
76
+ url: "/admin/city-quests/".concat(id, "/analytics"),
77
+ method: 'GET',
78
+ }); };
79
+ exports.cityQuestsApiDeclaration = {
80
+ query: query,
81
+ getOne: getOne,
82
+ getContent: getContent,
83
+ getVersions: getVersions,
84
+ importGame: importGame,
85
+ update: update,
86
+ publish: publish,
87
+ listAssets: listAssets,
88
+ upsertAsset: upsertAsset,
89
+ deleteAsset: deleteAsset,
90
+ bind: bind,
91
+ unbind: unbind,
92
+ analytics: analytics,
93
+ };
@@ -0,0 +1,46 @@
1
+ import { PlayAnswerDto } from '@escapenavigator/types/dist/openapi/city-quest/play-answer.dto';
2
+ import { PlayFinaleChoiceDto } from '@escapenavigator/types/dist/openapi/city-quest/play-finale-choice.dto';
3
+ import { PlayHintDto } from '@escapenavigator/types/dist/openapi/city-quest/play-hint.dto';
4
+ import { PlayIssueDto } from '@escapenavigator/types/dist/openapi/city-quest/play-issue.dto';
5
+ import { PlayStartSessionDto } from '@escapenavigator/types/dist/openapi/city-quest/play-start-session.dto';
6
+ import { PlayAccessInfoRO, PlayAnswerResultRO, PlayStateRO } from '@escapenavigator/types/dist/openapi/city-quest/play-state.ro';
7
+ import { ApiMethodDeclaration } from '..';
8
+ export declare const cityQuestPlayApiDeclaration: {
9
+ getAccessInfo: ApiMethodDeclaration<string, PlayAccessInfoRO>;
10
+ startSession: ApiMethodDeclaration<{
11
+ data: PlayStartSessionDto;
12
+ }, PlayStateRO>;
13
+ getState: ApiMethodDeclaration<string, PlayStateRO>;
14
+ arrival: ApiMethodDeclaration<string, PlayStateRO>;
15
+ answer: ApiMethodDeclaration<{
16
+ token: string;
17
+ data: PlayAnswerDto;
18
+ }, PlayAnswerResultRO>;
19
+ hint: ApiMethodDeclaration<{
20
+ token: string;
21
+ data: PlayHintDto;
22
+ }, {
23
+ text: string;
24
+ state: PlayStateRO;
25
+ }>;
26
+ skip: ApiMethodDeclaration<string, PlayAnswerResultRO>;
27
+ routeEventAnswer: ApiMethodDeclaration<{
28
+ token: string;
29
+ data: PlayAnswerDto;
30
+ }, PlayAnswerResultRO>;
31
+ routeEventDismiss: ApiMethodDeclaration<string, PlayStateRO>;
32
+ finaleAssembly: ApiMethodDeclaration<{
33
+ token: string;
34
+ data: PlayAnswerDto;
35
+ }, PlayAnswerResultRO>;
36
+ finaleChoice: ApiMethodDeclaration<{
37
+ token: string;
38
+ data: PlayFinaleChoiceDto;
39
+ }, PlayStateRO>;
40
+ pause: ApiMethodDeclaration<string, PlayStateRO>;
41
+ resume: ApiMethodDeclaration<string, PlayStateRO>;
42
+ reportIssue: ApiMethodDeclaration<{
43
+ token: string;
44
+ data: PlayIssueDto;
45
+ }, PlayStateRO>;
46
+ };
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cityQuestPlayApiDeclaration = void 0;
4
+ /**
5
+ * Публичный API игрока городского квеста (без авторизации — токен
6
+ * доступа/сессии в URL является «паролем»).
7
+ */
8
+ var getAccessInfo = function (token) { return ({
9
+ url: "/openapi/city-quest/access/".concat(token),
10
+ method: 'GET',
11
+ }); };
12
+ var startSession = function (_a) {
13
+ var data = _a.data;
14
+ return ({
15
+ url: '/openapi/city-quest/sessions',
16
+ method: 'POST',
17
+ data: data,
18
+ });
19
+ };
20
+ var getState = function (token) { return ({
21
+ url: "/openapi/city-quest/sessions/".concat(token),
22
+ method: 'GET',
23
+ }); };
24
+ var arrival = function (token) { return ({
25
+ url: "/openapi/city-quest/sessions/".concat(token, "/arrival"),
26
+ method: 'POST',
27
+ }); };
28
+ var answer = function (_a) {
29
+ var token = _a.token, data = _a.data;
30
+ return ({
31
+ url: "/openapi/city-quest/sessions/".concat(token, "/answer"),
32
+ method: 'POST',
33
+ data: data,
34
+ });
35
+ };
36
+ var hint = function (_a) {
37
+ var token = _a.token, data = _a.data;
38
+ return ({
39
+ url: "/openapi/city-quest/sessions/".concat(token, "/hint"),
40
+ method: 'POST',
41
+ data: data,
42
+ });
43
+ };
44
+ var skip = function (token) { return ({
45
+ url: "/openapi/city-quest/sessions/".concat(token, "/skip"),
46
+ method: 'POST',
47
+ }); };
48
+ var routeEventAnswer = function (_a) {
49
+ var token = _a.token, data = _a.data;
50
+ return ({
51
+ url: "/openapi/city-quest/sessions/".concat(token, "/route-event/answer"),
52
+ method: 'POST',
53
+ data: data,
54
+ });
55
+ };
56
+ var routeEventDismiss = function (token) { return ({
57
+ url: "/openapi/city-quest/sessions/".concat(token, "/route-event/dismiss"),
58
+ method: 'POST',
59
+ }); };
60
+ var finaleAssembly = function (_a) {
61
+ var token = _a.token, data = _a.data;
62
+ return ({
63
+ url: "/openapi/city-quest/sessions/".concat(token, "/finale/assembly"),
64
+ method: 'POST',
65
+ data: data,
66
+ });
67
+ };
68
+ var finaleChoice = function (_a) {
69
+ var token = _a.token, data = _a.data;
70
+ return ({
71
+ url: "/openapi/city-quest/sessions/".concat(token, "/finale/choice"),
72
+ method: 'POST',
73
+ data: data,
74
+ });
75
+ };
76
+ var pause = function (token) { return ({
77
+ url: "/openapi/city-quest/sessions/".concat(token, "/pause"),
78
+ method: 'PATCH',
79
+ }); };
80
+ var resume = function (token) { return ({
81
+ url: "/openapi/city-quest/sessions/".concat(token, "/resume"),
82
+ method: 'PATCH',
83
+ }); };
84
+ var reportIssue = function (_a) {
85
+ var token = _a.token, data = _a.data;
86
+ return ({
87
+ url: "/openapi/city-quest/sessions/".concat(token, "/issue"),
88
+ method: 'POST',
89
+ data: data,
90
+ });
91
+ };
92
+ exports.cityQuestPlayApiDeclaration = {
93
+ getAccessInfo: getAccessInfo,
94
+ startSession: startSession,
95
+ getState: getState,
96
+ arrival: arrival,
97
+ answer: answer,
98
+ hint: hint,
99
+ skip: skip,
100
+ routeEventAnswer: routeEventAnswer,
101
+ routeEventDismiss: routeEventDismiss,
102
+ finaleAssembly: finaleAssembly,
103
+ finaleChoice: finaleChoice,
104
+ pause: pause,
105
+ resume: resume,
106
+ reportIssue: reportIssue,
107
+ };
@@ -17,6 +17,8 @@ import { certificatesaleDiscountsApiDeclaration } from './certificatesales-disco
17
17
  import { certificateUploadsApiDeclaration } from './certificateuploads-api';
18
18
  import { checklistApiDeclaration } from './checklist-api';
19
19
  import { citiesApiDeclaration } from './cities-api';
20
+ import { cityQuestsApiDeclaration } from './city-quest-api';
21
+ import { cityQuestPlayApiDeclaration } from './city-quest-play-api';
20
22
  import { clientsApiDeclaration } from './clients-api';
21
23
  import { coalitionApiDeclaration } from './coalition-api';
22
24
  import { cronParserApiDeclaration } from './cron-parser-api';
@@ -91,6 +93,8 @@ export type InitApiDeclaration = {
91
93
  questroomRiddleApi: Api<typeof questroomRiddleApiDeclaration>;
92
94
  questroomDeviceApi: Api<typeof questroomDeviceApiDeclaration>;
93
95
  gameSessionApi: Api<typeof gameSessionApiDeclaration>;
96
+ cityQuestsApi: Api<typeof cityQuestsApiDeclaration>;
97
+ cityQuestPlayApi: Api<typeof cityQuestPlayApiDeclaration>;
94
98
  checklistApi: Api<typeof checklistApiDeclaration>;
95
99
  mailchimpApi: Api<typeof mailchimpApiDeclaration>;
96
100
  playersApi: Api<typeof playersApiDeclaration>;
@@ -20,6 +20,8 @@ var certificatesales_discounts_api_1 = require("./certificatesales-discounts-api
20
20
  var certificateuploads_api_1 = require("./certificateuploads-api");
21
21
  var checklist_api_1 = require("./checklist-api");
22
22
  var cities_api_1 = require("./cities-api");
23
+ var city_quest_api_1 = require("./city-quest-api");
24
+ var city_quest_play_api_1 = require("./city-quest-play-api");
23
25
  var clients_api_1 = require("./clients-api");
24
26
  var coalition_api_1 = require("./coalition-api");
25
27
  var cron_parser_api_1 = require("./cron-parser-api");
@@ -96,6 +98,8 @@ var initClientApi = function (url, clientOptions) { return ({
96
98
  questroomRiddleApi: (0, _1.initApi)(questroom_riddle_api_1.questroomRiddleApiDeclaration, url, clientOptions),
97
99
  questroomDeviceApi: (0, _1.initApi)(questroom_device_api_1.questroomDeviceApiDeclaration, url, clientOptions),
98
100
  gameSessionApi: (0, _1.initApi)(game_session_api_1.gameSessionApiDeclaration, url, clientOptions),
101
+ cityQuestsApi: (0, _1.initApi)(city_quest_api_1.cityQuestsApiDeclaration, url, clientOptions),
102
+ cityQuestPlayApi: (0, _1.initApi)(city_quest_play_api_1.cityQuestPlayApiDeclaration, url, clientOptions),
99
103
  checklistApi: (0, _1.initApi)(checklist_api_1.checklistApiDeclaration, url, clientOptions),
100
104
  playersApi: (0, _1.initApi)(players_api_1.playersApiDeclaration, url, clientOptions),
101
105
  mailchimpApi: (0, _1.initApi)(mailchimp_api_1.mailchimpApiDeclaration, url, clientOptions),
@@ -16,6 +16,7 @@ import { getOne } from './get-one';
16
16
  import { getOneForAdmin } from './get-one-for-admin';
17
17
  import { paginate } from './paginate';
18
18
  import { parseReviews } from './parse-reviews';
19
+ import { promote } from './promote';
19
20
  import { query } from './query';
20
21
  import { recover } from './recover';
21
22
  import { remove } from './remove';
@@ -48,6 +49,7 @@ type ApiDeclaration = {
48
49
  paginate: typeof paginate;
49
50
  remove: typeof remove;
50
51
  verify: typeof verify;
52
+ promote: typeof promote;
51
53
  update: typeof update;
52
54
  query: typeof query;
53
55
  getOne: typeof getOne;
@@ -19,6 +19,7 @@ var get_one_1 = require("./get-one");
19
19
  var get_one_for_admin_1 = require("./get-one-for-admin");
20
20
  var paginate_1 = require("./paginate");
21
21
  var parse_reviews_1 = require("./parse-reviews");
22
+ var promote_1 = require("./promote");
22
23
  var query_1 = require("./query");
23
24
  var recover_1 = require("./recover");
24
25
  var remove_1 = require("./remove");
@@ -45,6 +46,7 @@ exports.questroomsApiDeclaration = {
45
46
  updateSortPosition: update_sort_position_1.updateSortPosition,
46
47
  generateTeaser: generate_teaser_1.generateTeaser,
47
48
  verify: verify_1.verify,
49
+ promote: promote_1.promote,
48
50
  updateResource: update_resource_1.updateResource,
49
51
  bindBookeo: bind_bookeo_1.bindBookeo,
50
52
  closeMany: close_many_1.closeMany,
@@ -0,0 +1,10 @@
1
+ import { QuestroomRO } from '@escapenavigator/types/dist/questroom/questroom.ro';
2
+ import { ApiMethodDeclaration } from '..';
3
+ type ParamsData = {
4
+ id: number;
5
+ promoted: boolean;
6
+ };
7
+ type ResponseData = QuestroomRO;
8
+ /** Приоритетное размещение в агрегаторе. Только для супер-админа (totalAccess). */
9
+ export declare const promote: ApiMethodDeclaration<ParamsData, ResponseData>;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.promote = void 0;
4
+ /** Приоритетное размещение в агрегаторе. Только для супер-админа (totalAccess). */
5
+ var promote = function (_a) {
6
+ var id = _a.id, promoted = _a.promoted;
7
+ return ({
8
+ url: "/questrooms/promote/".concat(id),
9
+ method: 'PATCH',
10
+ params: { promoted: promoted },
11
+ });
12
+ };
13
+ exports.promote = promote;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/services",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,10 +12,10 @@
12
12
  "scripts": {
13
13
  "build": "rm -rf dist && tsc --project tsconfig.json"
14
14
  },
15
- "gitHead": "f88105efecc1893d1eb103e8b2069161b0e6dd0a",
15
+ "gitHead": "eb29688633048e8011bc07e280dcaa84a2c61244",
16
16
  "dependencies": {
17
- "@escapenavigator/types": "^2.0.8",
18
- "@escapenavigator/utils": "^2.0.8",
17
+ "@escapenavigator/types": "^2.0.9",
18
+ "@escapenavigator/utils": "^2.0.9",
19
19
  "axios": "^0.21.4",
20
20
  "class-transformer": "^0.5.1",
21
21
  "class-validator": "^0.13.2",