@selfcommunity/api-services 0.4.55 → 0.5.0-alpha.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.
Files changed (36) hide show
  1. package/lib/cjs/constants/Endpoints.js +146 -0
  2. package/lib/cjs/index.d.ts +4 -2
  3. package/lib/cjs/index.js +8 -1
  4. package/lib/cjs/services/event/index.d.ts +316 -0
  5. package/lib/cjs/services/event/index.js +467 -0
  6. package/lib/cjs/services/onboarding/index.d.ts +80 -0
  7. package/lib/cjs/services/onboarding/index.js +102 -0
  8. package/lib/cjs/services/preference/index.d.ts +8 -0
  9. package/lib/cjs/services/preference/index.js +13 -0
  10. package/lib/cjs/services/suggestion/index.d.ts +9 -1
  11. package/lib/cjs/services/suggestion/index.js +13 -0
  12. package/lib/cjs/types/event.d.ts +108 -0
  13. package/lib/cjs/types/event.js +2 -0
  14. package/lib/cjs/types/index.d.ts +3 -1
  15. package/lib/cjs/types/index.js +3 -1
  16. package/lib/cjs/types/onBoarding.d.ts +30 -0
  17. package/lib/cjs/types/onBoarding.js +18 -0
  18. package/lib/esm/constants/Endpoints.js +146 -0
  19. package/lib/esm/index.d.ts +4 -2
  20. package/lib/esm/index.js +4 -2
  21. package/lib/esm/services/event/index.d.ts +316 -0
  22. package/lib/esm/services/event/index.js +462 -0
  23. package/lib/esm/services/onboarding/index.d.ts +80 -0
  24. package/lib/esm/services/onboarding/index.js +97 -0
  25. package/lib/esm/services/preference/index.d.ts +8 -0
  26. package/lib/esm/services/preference/index.js +13 -0
  27. package/lib/esm/services/suggestion/index.d.ts +9 -1
  28. package/lib/esm/services/suggestion/index.js +13 -0
  29. package/lib/esm/types/event.d.ts +108 -0
  30. package/lib/esm/types/event.js +1 -0
  31. package/lib/esm/types/index.d.ts +3 -1
  32. package/lib/esm/types/index.js +2 -1
  33. package/lib/esm/types/onBoarding.d.ts +30 -0
  34. package/lib/esm/types/onBoarding.js +15 -0
  35. package/lib/umd/api-services.js +1 -1
  36. package/package.json +4 -4
@@ -1,11 +1,12 @@
1
1
  import { BaseGetParams, SCPaginatedResponse } from '../../types';
2
- import { SCCategoryType, SCFeedObjectType, SCIncubatorType, SCSuggestionType, SCUserType } from '@selfcommunity/types';
2
+ import { SCCategoryType, SCEventType, SCFeedObjectType, SCIncubatorType, SCSuggestionType, SCUserType } from '@selfcommunity/types';
3
3
  import { AxiosRequestConfig } from 'axios';
4
4
  export interface SuggestionApiClientInterface {
5
5
  getCategorySuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCategoryType>>;
6
6
  getIncubatorSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCIncubatorType>>;
7
7
  getPollSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
8
8
  getUserSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
9
+ getEventSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
9
10
  getSearchSuggestion(search: string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCSuggestionType>>;
10
11
  }
11
12
  /**
@@ -36,6 +37,12 @@ export declare class SuggestionApiClient {
36
37
  * @param config
37
38
  */
38
39
  static getUserSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
40
+ /**
41
+ * This endpoint retrieves a list of events suggested to the current user.
42
+ * @param params
43
+ * @param config
44
+ */
45
+ static getEventSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
39
46
  /**
40
47
  * This endpoint retrieves a list of users suggested to the current user.
41
48
  * @param search
@@ -77,5 +84,6 @@ export default class SuggestionService {
77
84
  static getIncubatorSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCIncubatorType>>;
78
85
  static getPollSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedObjectType>>;
79
86
  static getUserSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
87
+ static getEventSuggestion(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEventType>>;
80
88
  static getSearchSuggestion(search: string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCSuggestionType>>;
81
89
  }
@@ -38,6 +38,14 @@ export class SuggestionApiClient {
38
38
  static getUserSuggestion(params, config) {
39
39
  return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserSuggestion.url({}), method: Endpoints.UserSuggestion.method, params }));
40
40
  }
41
+ /**
42
+ * This endpoint retrieves a list of events suggested to the current user.
43
+ * @param params
44
+ * @param config
45
+ */
46
+ static getEventSuggestion(params, config) {
47
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.EventSuggestion.url({}), method: Endpoints.EventSuggestion.method, params }));
48
+ }
41
49
  /**
42
50
  * This endpoint retrieves a list of users suggested to the current user.
43
51
  * @param search
@@ -98,6 +106,11 @@ export default class SuggestionService {
98
106
  return SuggestionApiClient.getUserSuggestion(params, config);
99
107
  });
100
108
  }
109
+ static getEventSuggestion(params, config) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ return SuggestionApiClient.getEventSuggestion(params, config);
112
+ });
113
+ }
101
114
  static getSearchSuggestion(search, params, config) {
102
115
  return __awaiter(this, void 0, void 0, function* () {
103
116
  return SuggestionApiClient.getSearchSuggestion(search, params, config);
@@ -0,0 +1,108 @@
1
+ /**
2
+ * EventCreateParams interface
3
+ */
4
+ import { SCEventDateFilterType, SCEventPrivacyType, SCEventRecurrenceType, SCEventSubscriptionStatusType } from '@selfcommunity/types';
5
+ import { BaseGetParams, BaseSearchParams } from './baseParams';
6
+ import { SCEventLocationType } from '@selfcommunity/types/src/types/event';
7
+ export interface EventCreateParams {
8
+ /**
9
+ * A unique name for the group
10
+ */
11
+ name: string;
12
+ /**
13
+ * The group privacy
14
+ */
15
+ privacy: SCEventPrivacyType;
16
+ /**
17
+ * The group visibility. It is required when privacy = private.
18
+ */
19
+ visible?: boolean;
20
+ /**
21
+ * The group description
22
+ */
23
+ description?: string;
24
+ /**
25
+ * The event starting date and time
26
+ */
27
+ start_date: string;
28
+ /**
29
+ * The group ending date and time
30
+ */
31
+ end_date?: string;
32
+ /**
33
+ * The users to invite to the group
34
+ */
35
+ invite_users?: number[];
36
+ /**
37
+ * The event image
38
+ */
39
+ image_original?: File;
40
+ /**
41
+ * The event location
42
+ */
43
+ location: SCEventLocationType;
44
+ /**
45
+ * The event exact point
46
+ */
47
+ geolocation: string;
48
+ /**
49
+ * The event latitude
50
+ */
51
+ geolocation_lat: number;
52
+ /**
53
+ * The event longitude
54
+ */
55
+ geolocation_lng: number;
56
+ /**
57
+ * The event recurrency
58
+ */
59
+ recurring?: SCEventRecurrenceType;
60
+ }
61
+ /**
62
+ * EventFeedParams interface.
63
+ */
64
+ export interface EventFeedParams extends BaseGetParams {
65
+ /**
66
+ * Which field to use when ordering the results.
67
+ */
68
+ ordering?: string;
69
+ }
70
+ /**
71
+ * EventRelatedParams interface.
72
+ */
73
+ export interface EventRelatedParams extends BaseGetParams {
74
+ /**
75
+ * Filter results by created_by user id.
76
+ */
77
+ created_by?: number;
78
+ }
79
+ /**
80
+ * EventUserParams interface.
81
+ */
82
+ export interface EventUserParams extends BaseGetParams {
83
+ /**
84
+ * Filter results by subscription_status
85
+ */
86
+ subscription_status?: SCEventSubscriptionStatusType;
87
+ /**
88
+ * Filtered past events
89
+ */
90
+ past?: boolean | number;
91
+ }
92
+ /**
93
+ * EventFeedParams interface.
94
+ */
95
+ export interface EventSearchParams extends BaseSearchParams {
96
+ /**
97
+ * The events filtered by a specific time frame
98
+ */
99
+ date_filter?: SCEventDateFilterType;
100
+ /**
101
+ * The events created or followed by the users followed
102
+ */
103
+ follows?: boolean | number;
104
+ /**
105
+ * Filtered past events
106
+ */
107
+ past?: boolean | number;
108
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -24,4 +24,6 @@ import { ScoreParams } from './score';
24
24
  import { InsightCommonParams, InsightEmbedParams, InsightUserParams, InsightContributionParams } from './insight';
25
25
  import { ReactionParams } from './reaction';
26
26
  import { GroupCreateParams, GroupFeedParams } from './group';
27
- export { AccountCreateParams, AccountVerifyParams, AccountRecoverParams, AccountResetParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserGetParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadCompleteParams, ChunkUploadParams, ThreadParams, ThreadDeleteParams, MessageCreateParams, MessageMediaUploadParams, MessageThumbnailUploadParams, MessageChunkUploadDoneParams, MessageMediaChunksParams, CategoryParams, CustomAdvParams, CustomPageParams, CustomPageSearchParams, EmbedUpdateParams, EmbedSearchParams, BaseGetParams, BaseSearchParams, FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams };
27
+ import { EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams } from './event';
28
+ import { StartStepParams, OnBoardingStep } from './onBoarding';
29
+ export { AccountCreateParams, AccountVerifyParams, AccountRecoverParams, AccountResetParams, AccountSearchParams, SCPaginatedResponse, WebhookParamType, WebhookEventsType, SSOSignUpParams, CommentListParams, CommentCreateParams, IncubatorCreateParams, IncubatorSearchParams, LoyaltyPrizeParams, LoyaltyGetPrizeParams, ModerationParams, ModerateContributionParams, FlaggedContributionParams, CustomNotificationParams, UserGetParams, UserAutocompleteParams, UserScoreParams, UserSearchParams, TagParams, TagGetParams, MediaCreateParams, MediaTypes, ChunkUploadCompleteParams, ChunkUploadParams, ThreadParams, ThreadDeleteParams, MessageCreateParams, MessageMediaUploadParams, MessageThumbnailUploadParams, MessageChunkUploadDoneParams, MessageMediaChunksParams, CategoryParams, CustomAdvParams, CustomPageParams, CustomPageSearchParams, EmbedUpdateParams, EmbedSearchParams, BaseGetParams, BaseSearchParams, FeedObjGetParams, FeedObjCreateParams, FeedObjectPollVotesSearch, FeedParams, LegalPageFilterParams, FeatureParams, ScoreParams, InsightContributionParams, InsightUserParams, InsightEmbedParams, InsightCommonParams, ReactionParams, GroupCreateParams, GroupFeedParams, EventCreateParams, EventFeedParams, EventRelatedParams, EventSearchParams, StartStepParams, OnBoardingStep };
@@ -1,2 +1,3 @@
1
1
  import { MediaTypes } from './media';
2
- export { MediaTypes };
2
+ import { OnBoardingStep } from './onBoarding';
3
+ export { MediaTypes, OnBoardingStep };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * StartStepParams interface
3
+ */
4
+ export interface StartStepParams {
5
+ /**
6
+ * The number of the post to generate.
7
+ * @default 10
8
+ */
9
+ num_posts?: number;
10
+ /**
11
+ * The number of the post images to generate
12
+ * @default 1
13
+ */
14
+ num_images?: number;
15
+ /**
16
+ * only for stage
17
+ */
18
+ force?: number;
19
+ }
20
+ /**
21
+ * OnBoardingStepType enum
22
+ */
23
+ export declare enum OnBoardingStep {
24
+ CONTENTS = 1,
25
+ CATEGORIES = 2,
26
+ APPEARANCE = 3,
27
+ PROFILE = 4,
28
+ INVITE = 5,
29
+ APP = 6
30
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * StartStepParams interface
3
+ */
4
+ /**
5
+ * OnBoardingStepType enum
6
+ */
7
+ export var OnBoardingStep;
8
+ (function (OnBoardingStep) {
9
+ OnBoardingStep[OnBoardingStep["CONTENTS"] = 1] = "CONTENTS";
10
+ OnBoardingStep[OnBoardingStep["CATEGORIES"] = 2] = "CATEGORIES";
11
+ OnBoardingStep[OnBoardingStep["APPEARANCE"] = 3] = "APPEARANCE";
12
+ OnBoardingStep[OnBoardingStep["PROFILE"] = 4] = "PROFILE";
13
+ OnBoardingStep[OnBoardingStep["INVITE"] = 5] = "INVITE";
14
+ OnBoardingStep[OnBoardingStep["APP"] = 6] = "APP";
15
+ })(OnBoardingStep || (OnBoardingStep = {}));