@tripian/core 0.11.130 → 2.0.0

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.
@@ -1,51 +1,51 @@
1
- interface ApiConst {
2
- METHOD: string;
3
- PATH: string;
4
- DATA_KEY: string;
5
- CALL_BACK?: {
6
- METHOD: string;
7
- PATH: string;
8
- DATA_KEY?: string;
9
- };
10
- }
11
- interface ApiConstModel {
12
- CITIES: ApiConst;
13
- CITY: ApiConst;
14
- POI_CATEGORIES: ApiConst;
15
- POIS: ApiConst;
16
- POI: ApiConst;
17
- QUESTIONS: ApiConst;
18
- REGISTER: ApiConst;
19
- LOGIN: ApiConst;
20
- REFRESH_TOKEN: ApiConst;
21
- USER: ApiConst;
22
- USER_UPDATE: ApiConst;
23
- FAVORITES: ApiConst;
24
- FAVORITE_ADD: ApiConst;
25
- FAVORITE_DELETE: ApiConst;
26
- COMPANIONS: ApiConst;
27
- COMPANION_ADD: ApiConst;
28
- COMPANION_UPDATE: ApiConst;
29
- COMPANION_DELETE: ApiConst;
30
- TRIPS: ApiConst;
31
- TRIP_WITH_HASH: ApiConst;
32
- TRIP: ApiConst;
33
- TRIP_ADD: ApiConst;
34
- TRIP_UPDATE: ApiConst;
35
- TRIP_DELETE: ApiConst;
36
- PLAN: ApiConst;
37
- PLAN_UPDATE: ApiConst;
38
- STEP_ADD: ApiConst;
39
- STEP_UPDATE: ApiConst;
40
- STEP_DELETE: ApiConst;
41
- RESERVATIONS: ApiConst;
42
- RESERVATION_ADD: ApiConst;
43
- RESERVATION_UPDATE: ApiConst;
44
- RESERVATION_DELETE: ApiConst;
45
- REACTIONS: ApiConst;
46
- REACTION_ADD: ApiConst;
47
- REACTION_UPDATE: ApiConst;
48
- REACTION_DELETE: ApiConst;
49
- TOP_TEN: ApiConst;
50
- }
51
- export { ApiConst, ApiConstModel };
1
+ interface ApiConst {
2
+ METHOD: string;
3
+ PATH: string;
4
+ DATA_KEY: string;
5
+ CALL_BACK?: {
6
+ METHOD: string;
7
+ PATH: string;
8
+ DATA_KEY?: string;
9
+ };
10
+ }
11
+ interface ApiConstModel {
12
+ CITIES: ApiConst;
13
+ CITY: ApiConst;
14
+ POI_CATEGORIES: ApiConst;
15
+ POIS: ApiConst;
16
+ POI: ApiConst;
17
+ QUESTIONS: ApiConst;
18
+ REGISTER: ApiConst;
19
+ LOGIN: ApiConst;
20
+ REFRESH_TOKEN: ApiConst;
21
+ USER: ApiConst;
22
+ USER_UPDATE: ApiConst;
23
+ FAVORITES: ApiConst;
24
+ FAVORITE_ADD: ApiConst;
25
+ FAVORITE_DELETE: ApiConst;
26
+ COMPANIONS: ApiConst;
27
+ COMPANION_ADD: ApiConst;
28
+ COMPANION_UPDATE: ApiConst;
29
+ COMPANION_DELETE: ApiConst;
30
+ TRIPS: ApiConst;
31
+ TRIP_WITH_HASH: ApiConst;
32
+ TRIP: ApiConst;
33
+ TRIP_ADD: ApiConst;
34
+ TRIP_UPDATE: ApiConst;
35
+ TRIP_DELETE: ApiConst;
36
+ PLAN: ApiConst;
37
+ PLAN_UPDATE: ApiConst;
38
+ STEP_ADD: ApiConst;
39
+ STEP_UPDATE: ApiConst;
40
+ STEP_DELETE: ApiConst;
41
+ RESERVATIONS: ApiConst;
42
+ RESERVATION_ADD: ApiConst;
43
+ RESERVATION_UPDATE: ApiConst;
44
+ RESERVATION_DELETE: ApiConst;
45
+ REACTIONS: ApiConst;
46
+ REACTION_ADD: ApiConst;
47
+ REACTION_UPDATE: ApiConst;
48
+ REACTION_DELETE: ApiConst;
49
+ TOP_TEN: ApiConst;
50
+ }
51
+ export { ApiConst, ApiConstModel };
package/data/data.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { DataModel } from './dataModel';
2
- /**
3
- * data
4
- */
5
- declare const data: DataModel;
6
- export default data;
1
+ import { DataModel } from './dataModel';
2
+ /**
3
+ * data
4
+ */
5
+ declare const data: DataModel;
6
+ export default data;
@@ -1,2 +1,2 @@
1
- declare const dataClear: () => void;
2
- export default dataClear;
1
+ declare const dataClear: () => void;
2
+ export default dataClear;
@@ -1,43 +1,43 @@
1
- import Model from '@tripian/model';
2
- export interface DataModel {
3
- initialised: boolean;
4
- hasError: boolean;
5
- errors: any[];
6
- logs: any[];
7
- cities?: Model.City[];
8
- poiCategories?: Model.PoiCategory[];
9
- pois: Model.Poi[];
10
- questions: Model.Question[];
11
- questionsTrip: Model.Question[];
12
- questionsProfile: Model.Question[];
13
- questionsCompanion: Model.Question[];
14
- recommendations?: Model.Recommendation[];
15
- register?: Model.User;
16
- token?: Model.Token;
17
- user?: Model.User;
18
- favorites: {
19
- cityId: number;
20
- favoritePois: Model.Favorite[];
21
- }[];
22
- companions?: Model.Companion[];
23
- reservations: {
24
- cityId: number;
25
- userReservations: Model.UserReservation[];
26
- }[];
27
- userReactions: {
28
- tripHash: string;
29
- userReactions: Model.UserReaction[];
30
- }[];
31
- tripRefs?: Model.TripReference[];
32
- trips: Model.Trip[];
33
- trip?: Model.Trip;
34
- topTens: {
35
- cityId: number;
36
- topTen: Model.TopTen[];
37
- }[];
38
- poisAll: {
39
- cityId: number;
40
- categoryGroup: Model.POI_CATEGORY_GROUP;
41
- pois: Model.DataPayload<Model.Poi[]>;
42
- }[];
43
- }
1
+ import Model from '@tripian/model';
2
+ export interface DataModel {
3
+ initialised: boolean;
4
+ hasError: boolean;
5
+ errors: any[];
6
+ logs: any[];
7
+ cities?: Model.City[];
8
+ poiCategories?: Model.PoiCategory[];
9
+ pois: Model.Poi[];
10
+ questions: Model.Question[];
11
+ questionsTrip: Model.Question[];
12
+ questionsProfile: Model.Question[];
13
+ questionsCompanion: Model.Question[];
14
+ recommendations?: Model.Recommendation[];
15
+ register?: Model.User;
16
+ token?: Model.Token;
17
+ user?: Model.User;
18
+ favorites: {
19
+ cityId: number;
20
+ favoritePois: Model.Favorite[];
21
+ }[];
22
+ companions?: Model.Companion[];
23
+ reservations: {
24
+ cityId: number;
25
+ userReservations: Model.UserReservation[];
26
+ }[];
27
+ userReactions: {
28
+ tripHash: string;
29
+ userReactions: Model.UserReaction[];
30
+ }[];
31
+ tripRefs?: Model.TripReference[];
32
+ trips: Model.Trip[];
33
+ trip?: Model.Trip;
34
+ topTens: {
35
+ cityId: number;
36
+ topTen: Model.TopTen[];
37
+ }[];
38
+ poisAll: {
39
+ cityId: number;
40
+ categoryGroup: Model.POI_CATEGORY_GROUP;
41
+ pois: Model.DataPayload<Model.Poi[]>;
42
+ }[];
43
+ }
package/easy/easy.d.ts CHANGED
@@ -1,35 +1,35 @@
1
- import MainModel from '@tripian/model';
2
- declare const easy: {
3
- /**
4
- * Replace stringQuery, param.key with param.value.
5
- * @param {string} stringQuery
6
- * @param {object} param { key, value }
7
- * @returns {string} stringQuery.replace(`{${param.key}}`, param.value)
8
- */
9
- setParameter: (stringQuery: string, param: {
10
- key: string;
11
- value: string;
12
- }) => string;
13
- /**
14
- * Replace stringQuery, '{id}' with id
15
- * @param {string} stringQuery
16
- * @param {number} id
17
- * @returns {string} stringQuery.replace('{id}', id);
18
- */
19
- setParameterId: (stringQuery: string, id: number) => string;
20
- /**
21
- * Replace stringQuery, all param.key with all param.value foreach params parameter
22
- * @param {string} stringQuery
23
- * @param {object} params [{ key, value }, { key, value } ...]
24
- * @returns {string} stringQuery.replace(`{${param.key}}`, param.value)
25
- */
26
- setParameters: (stringQuery: string, params: {
27
- key: string;
28
- value: string;
29
- }[]) => string;
30
- parseAccessToken: (accessToken: string) => MainModel.TokenPayload | undefined;
31
- parseToken: (token: MainModel.Token) => MainModel.TokenPayload | undefined;
32
- accessTokenExpSecond: (tokenPayload: MainModel.TokenPayload) => number;
33
- refreshTokenExpSecond: (tokenPayload: MainModel.TokenPayload) => number;
34
- };
35
- export default easy;
1
+ import MainModel from '@tripian/model';
2
+ declare const easy: {
3
+ /**
4
+ * Replace stringQuery, param.key with param.value.
5
+ * @param {string} stringQuery
6
+ * @param {object} param { key, value }
7
+ * @returns {string} stringQuery.replace(`{${param.key}}`, param.value)
8
+ */
9
+ setParameter: (stringQuery: string, param: {
10
+ key: string;
11
+ value: string;
12
+ }) => string;
13
+ /**
14
+ * Replace stringQuery, '{id}' with id
15
+ * @param {string} stringQuery
16
+ * @param {number} id
17
+ * @returns {string} stringQuery.replace('{id}', id);
18
+ */
19
+ setParameterId: (stringQuery: string, id: number) => string;
20
+ /**
21
+ * Replace stringQuery, all param.key with all param.value foreach params parameter
22
+ * @param {string} stringQuery
23
+ * @param {object} params [{ key, value }, { key, value } ...]
24
+ * @returns {string} stringQuery.replace(`{${param.key}}`, param.value)
25
+ */
26
+ setParameters: (stringQuery: string, params: {
27
+ key: string;
28
+ value: string;
29
+ }[]) => string;
30
+ parseAccessToken: (accessToken: string) => MainModel.TokenPayload | undefined;
31
+ parseToken: (token: MainModel.Token) => MainModel.TokenPayload | undefined;
32
+ accessTokenExpSecond: (tokenPayload: MainModel.TokenPayload) => number;
33
+ refreshTokenExpSecond: (tokenPayload: MainModel.TokenPayload) => number;
34
+ };
35
+ export default easy;
@@ -1,87 +1,87 @@
1
- import Model from '@tripian/model';
2
- declare class Cached {
3
- /**
4
- ******************************************************************************
5
- *
6
- * Cities
7
- *
8
- */
9
- static cities: () => Model.City[] | undefined;
10
- static city: (cityId: number) => Model.City | undefined;
11
- /**
12
- ******************************************************************************
13
- *
14
- * POIS Categories
15
- *
16
- */
17
- static poiCategories: () => Model.PoiCategory[] | undefined;
18
- /**
19
- ******************************************************************************
20
- *
21
- * POI
22
- *
23
- */
24
- static poi: (poiId: number) => Model.Poi | undefined;
25
- static pois: (poiIds: number[]) => Model.Poi[] | undefined;
26
- static poisAll: (cityId: number, category: string) => Model.DataPayload<Model.Poi[]> | undefined;
27
- /**
28
- ******************************************************************************
29
- *
30
- * User
31
- *
32
- */
33
- static user: () => Model.User | undefined;
34
- /**
35
- ******************************************************************************
36
- *
37
- * Favorites
38
- *
39
- */
40
- static favorites: (cityId?: number | undefined) => Model.Favorite[] | undefined;
41
- /**
42
- ******************************************************************************
43
- *
44
- * Companions
45
- *
46
- */
47
- static companions: () => Model.Companion[] | undefined;
48
- /**
49
- ******************************************************************************
50
- *
51
- * Reservations
52
- *
53
- */
54
- static reservations: (cityId?: number | undefined) => Model.UserReservation[] | undefined;
55
- /**
56
- ******************************************************************************
57
- *
58
- * User-Reactions
59
- *
60
- */
61
- static userReactions: (tripHash?: string | undefined) => Model.UserReaction[] | undefined;
62
- /**
63
- ******************************************************************************
64
- *
65
- * Questions
66
- *
67
- */
68
- static questions: (category: string) => Model.Question[] | undefined;
69
- /**
70
- ******************************************************************************
71
- *
72
- * TripRefs
73
- *
74
- */
75
- static tripRefs: () => Model.TripReference[] | undefined;
76
- static tripRef: (tripHash: string) => Model.TripReference | undefined;
77
- /**
78
- ******************************************************************************
79
- *
80
- * Trip
81
- *
82
- */
83
- static trip: (tripHash: string, minDayIndex: number) => Model.Trip | undefined;
84
- static plan: (planId: number) => Model.Plan | undefined;
85
- static topTen: (cityId: number) => Model.TopTen[] | undefined;
86
- }
87
- export default Cached;
1
+ import Model from '@tripian/model';
2
+ declare class Cached {
3
+ /**
4
+ ******************************************************************************
5
+ *
6
+ * Cities
7
+ *
8
+ */
9
+ static cities: () => Model.City[] | undefined;
10
+ static city: (cityId: number) => Model.City | undefined;
11
+ /**
12
+ ******************************************************************************
13
+ *
14
+ * POIS Categories
15
+ *
16
+ */
17
+ static poiCategories: () => Model.PoiCategory[] | undefined;
18
+ /**
19
+ ******************************************************************************
20
+ *
21
+ * POI
22
+ *
23
+ */
24
+ static poi: (poiId: number) => Model.Poi | undefined;
25
+ static pois: (poiIds: number[]) => Model.Poi[] | undefined;
26
+ static poisAll: (cityId: number, category: string) => Model.DataPayload<Model.Poi[]> | undefined;
27
+ /**
28
+ ******************************************************************************
29
+ *
30
+ * User
31
+ *
32
+ */
33
+ static user: () => Model.User | undefined;
34
+ /**
35
+ ******************************************************************************
36
+ *
37
+ * Favorites
38
+ *
39
+ */
40
+ static favorites: (cityId?: number | undefined) => Model.Favorite[] | undefined;
41
+ /**
42
+ ******************************************************************************
43
+ *
44
+ * Companions
45
+ *
46
+ */
47
+ static companions: () => Model.Companion[] | undefined;
48
+ /**
49
+ ******************************************************************************
50
+ *
51
+ * Reservations
52
+ *
53
+ */
54
+ static reservations: (cityId?: number | undefined) => Model.UserReservation[] | undefined;
55
+ /**
56
+ ******************************************************************************
57
+ *
58
+ * User-Reactions
59
+ *
60
+ */
61
+ static userReactions: (tripHash?: string | undefined) => Model.UserReaction[] | undefined;
62
+ /**
63
+ ******************************************************************************
64
+ *
65
+ * Questions
66
+ *
67
+ */
68
+ static questions: (category: string) => Model.Question[] | undefined;
69
+ /**
70
+ ******************************************************************************
71
+ *
72
+ * TripRefs
73
+ *
74
+ */
75
+ static tripRefs: () => Model.TripReference[] | undefined;
76
+ static tripRef: (tripHash: string) => Model.TripReference | undefined;
77
+ /**
78
+ ******************************************************************************
79
+ *
80
+ * Trip
81
+ *
82
+ */
83
+ static trip: (tripHash: string, minDayIndex: number) => Model.Trip | undefined;
84
+ static plan: (planId: number) => Model.Plan | undefined;
85
+ static topTen: (cityId: number) => Model.TopTen[] | undefined;
86
+ }
87
+ export default Cached;
@@ -1,9 +1,9 @@
1
- import Model from '@tripian/model';
2
- /**
3
- *
4
- * @param responseData
5
- * @param dataKey
6
- * @param params important note: use params?. params can be undefined!
7
- */
8
- declare const cache: <T>(responseData: T, dataKey: string, params?: any, pagination?: Model.Pagination | undefined) => void;
9
- export default cache;
1
+ import Model from '@tripian/model';
2
+ /**
3
+ *
4
+ * @param responseData
5
+ * @param dataKey
6
+ * @param params important note: use params?. params can be undefined!
7
+ */
8
+ declare const cache: <T>(responseData: T, dataKey: string, params?: any, pagination?: Model.Pagination | undefined) => void;
9
+ export default cache;
@@ -1,2 +1,2 @@
1
- declare const allQuestionsData: () => void;
2
- export { allQuestionsData };
1
+ declare const allQuestionsData: () => void;
2
+ export { allQuestionsData };
@@ -1,79 +1,79 @@
1
- import Model from '@tripian/model';
2
- /**
3
- *
4
- * Cities
5
- *
6
- */
7
- export declare const cityCached: (cities: Model.City[], id: number) => Model.City | undefined;
8
- export declare const citiesConcat: (cities: Model.City[], newCities: Model.City[]) => Model.City[] | undefined;
9
- /**
10
- *
11
- * POI
12
- *
13
- */
14
- export declare const poiCached: (pois: Model.Poi[], id: number) => Model.Poi | undefined;
15
- export declare const poisConcat: (pois: Model.Poi[], newPois: Model.Poi[]) => Model.Poi[];
16
- /**
17
- ******************************************************************************
18
- *
19
- * Questions
20
- *
21
- */
22
- export declare const questionCached: (questions: Model.Question[], id: number) => Model.Question | undefined;
23
- export declare const questionsConcat: (questions: Model.Question[], newQuestions: Model.Question[]) => Model.Question[];
24
- /**
25
- *
26
- * Trip Refs
27
- *
28
- */
29
- export declare const tripRefCached: (tripRefs: Model.TripReference[], id: number) => Model.TripReference | undefined;
30
- export declare const tripRefsConcatOne: (tripRefs: Model.TripReference[], newTripRef: Model.TripReference) => Model.TripReference[] | undefined;
31
- /**
32
- *
33
- * Trips
34
- *
35
- */
36
- export declare const tripCached: (trips: Model.Trip[], id: number) => Model.Trip | undefined;
37
- export declare const tripsConcatOne: (trips: Model.Trip[], newTrip: Model.Trip) => Model.Trip[];
38
- /**
39
- *
40
- * Plan
41
- *
42
- */
43
- export declare const planUpdated: (updatedPlan: Model.Plan, trip?: Model.Trip | undefined) => Model.Trip | undefined;
44
- /**
45
- *
46
- * Step
47
- *
48
- */
49
- export declare const stepAdded: (planId: number, addedStep: Model.Step, trip?: Model.Trip | undefined) => Model.Trip | undefined;
50
- export declare const stepUpdated: (updatedStep: Model.Step, trip?: Model.Trip | undefined) => Model.Trip | undefined;
51
- export declare const stepDeleted: (deletedStepId: number, trip?: Model.Trip | undefined) => Model.Trip | undefined;
52
- /**
53
- *
54
- * Companions
55
- *
56
- */
57
- export declare const favoriteCached: (favorites: Model.Favorite[], id: number) => Model.Favorite | undefined;
58
- export declare const favoriteConcatOne: (favorites: Model.Favorite[], newFavorite: Model.Favorite) => Model.Favorite[];
59
- /**
60
- *
61
- * Companions
62
- *
63
- */
64
- export declare const companionCached: (companions: Model.Companion[], id: number) => Model.Companion | undefined;
65
- export declare const companionConcatOne: (companions: Model.Companion[], newCompanion: Model.Companion) => Model.Companion[] | undefined;
66
- /**
67
- *
68
- * Reservations
69
- *
70
- */
71
- export declare const reservationCached: (reservations: Model.UserReservation[], id: number) => Model.UserReservation | undefined;
72
- export declare const reservationConcatOne: (reservations: Model.UserReservation[], newReservation: Model.UserReservation) => Model.UserReservation[];
73
- /**
74
- *
75
- * Reactions
76
- *
77
- */
78
- export declare const reactionCached: (reactions: Model.UserReaction[], id: number) => Model.UserReaction | undefined;
79
- export declare const reactionConcatOne: (reactions: Model.UserReaction[], newReaction: Model.UserReaction) => Model.UserReaction[];
1
+ import Model from '@tripian/model';
2
+ /**
3
+ *
4
+ * Cities
5
+ *
6
+ */
7
+ export declare const cityCached: (cities: Model.City[], id: number) => Model.City | undefined;
8
+ export declare const citiesConcat: (cities: Model.City[], newCities: Model.City[]) => Model.City[] | undefined;
9
+ /**
10
+ *
11
+ * POI
12
+ *
13
+ */
14
+ export declare const poiCached: (pois: Model.Poi[], id: number) => Model.Poi | undefined;
15
+ export declare const poisConcat: (pois: Model.Poi[], newPois: Model.Poi[]) => Model.Poi[];
16
+ /**
17
+ ******************************************************************************
18
+ *
19
+ * Questions
20
+ *
21
+ */
22
+ export declare const questionCached: (questions: Model.Question[], id: number) => Model.Question | undefined;
23
+ export declare const questionsConcat: (questions: Model.Question[], newQuestions: Model.Question[]) => Model.Question[];
24
+ /**
25
+ *
26
+ * Trip Refs
27
+ *
28
+ */
29
+ export declare const tripRefCached: (tripRefs: Model.TripReference[], id: number) => Model.TripReference | undefined;
30
+ export declare const tripRefsConcatOne: (tripRefs: Model.TripReference[], newTripRef: Model.TripReference) => Model.TripReference[] | undefined;
31
+ /**
32
+ *
33
+ * Trips
34
+ *
35
+ */
36
+ export declare const tripCached: (trips: Model.Trip[], id: number) => Model.Trip | undefined;
37
+ export declare const tripsConcatOne: (trips: Model.Trip[], newTrip: Model.Trip) => Model.Trip[];
38
+ /**
39
+ *
40
+ * Plan
41
+ *
42
+ */
43
+ export declare const planUpdated: (updatedPlan: Model.Plan, trip?: Model.Trip | undefined) => Model.Trip | undefined;
44
+ /**
45
+ *
46
+ * Step
47
+ *
48
+ */
49
+ export declare const stepAdded: (planId: number, addedStep: Model.Step, trip?: Model.Trip | undefined) => Model.Trip | undefined;
50
+ export declare const stepUpdated: (updatedStep: Model.Step, trip?: Model.Trip | undefined) => Model.Trip | undefined;
51
+ export declare const stepDeleted: (deletedStepId: number, trip?: Model.Trip | undefined) => Model.Trip | undefined;
52
+ /**
53
+ *
54
+ * Companions
55
+ *
56
+ */
57
+ export declare const favoriteCached: (favorites: Model.Favorite[], id: number) => Model.Favorite | undefined;
58
+ export declare const favoriteConcatOne: (favorites: Model.Favorite[], newFavorite: Model.Favorite) => Model.Favorite[];
59
+ /**
60
+ *
61
+ * Companions
62
+ *
63
+ */
64
+ export declare const companionCached: (companions: Model.Companion[], id: number) => Model.Companion | undefined;
65
+ export declare const companionConcatOne: (companions: Model.Companion[], newCompanion: Model.Companion) => Model.Companion[] | undefined;
66
+ /**
67
+ *
68
+ * Reservations
69
+ *
70
+ */
71
+ export declare const reservationCached: (reservations: Model.UserReservation[], id: number) => Model.UserReservation | undefined;
72
+ export declare const reservationConcatOne: (reservations: Model.UserReservation[], newReservation: Model.UserReservation) => Model.UserReservation[];
73
+ /**
74
+ *
75
+ * Reactions
76
+ *
77
+ */
78
+ export declare const reactionCached: (reactions: Model.UserReaction[], id: number) => Model.UserReaction | undefined;
79
+ export declare const reactionConcatOne: (reactions: Model.UserReaction[], newReaction: Model.UserReaction) => Model.UserReaction[];