podverse-helpers 5.1.24-alpha.0 → 5.1.27-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 (63) hide show
  1. package/dist/dtos/account/accountDataExport.d.ts +119 -0
  2. package/dist/dtos/account/accountDataExport.d.ts.map +1 -0
  3. package/dist/dtos/account/accountDataExport.js +2 -0
  4. package/dist/dtos/account/accountMembershipStatus.d.ts +1 -0
  5. package/dist/dtos/account/accountMembershipStatus.d.ts.map +1 -1
  6. package/dist/dtos/index.d.ts +1 -0
  7. package/dist/dtos/index.d.ts.map +1 -1
  8. package/dist/dtos/index.js +1 -0
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -0
  12. package/dist/lib/accountMembership.d.ts +15 -0
  13. package/dist/lib/accountMembership.d.ts.map +1 -1
  14. package/dist/lib/accountMembership.js +20 -0
  15. package/dist/lib/accountSignupMode.d.ts +2 -0
  16. package/dist/lib/accountSignupMode.d.ts.map +1 -0
  17. package/dist/lib/accountSignupMode.js +2 -0
  18. package/dist/lib/constants/index.d.ts +2 -0
  19. package/dist/lib/constants/index.d.ts.map +1 -0
  20. package/dist/lib/constants/index.js +17 -0
  21. package/dist/lib/constants/locales.d.ts +10 -0
  22. package/dist/lib/constants/locales.d.ts.map +1 -0
  23. package/dist/lib/constants/locales.js +12 -0
  24. package/dist/lib/i18n/timeFormatter.d.ts.map +1 -1
  25. package/dist/lib/i18n/timeFormatter.js +2 -2
  26. package/dist/lib/requests/_request.d.ts.map +1 -1
  27. package/dist/lib/requests/_request.js +7 -4
  28. package/dist/lib/requests/api/_request.d.ts +50 -1
  29. package/dist/lib/requests/api/_request.d.ts.map +1 -1
  30. package/dist/lib/requests/api/_request.js +107 -3
  31. package/dist/lib/requests/api/account/account.d.ts +26 -1
  32. package/dist/lib/requests/api/account/account.d.ts.map +1 -1
  33. package/dist/lib/requests/api/account/account.js +147 -3
  34. package/dist/lib/requests/api/account/follow/account.d.ts +8 -0
  35. package/dist/lib/requests/api/account/follow/account.d.ts.map +1 -1
  36. package/dist/lib/requests/api/account/follow/account.js +39 -0
  37. package/dist/lib/requests/api/membership/membership.d.ts +16 -0
  38. package/dist/lib/requests/api/membership/membership.d.ts.map +1 -0
  39. package/dist/lib/requests/api/membership/membership.js +20 -0
  40. package/dist/lib/requests/api/profile/profile.d.ts +16 -0
  41. package/dist/lib/requests/api/profile/profile.d.ts.map +1 -0
  42. package/dist/lib/requests/api/profile/profile.js +117 -0
  43. package/dist/lib/requests/api/queryParams.d.ts +14 -0
  44. package/dist/lib/requests/api/queryParams.d.ts.map +1 -1
  45. package/dist/lib/sharableStatus.d.ts +1 -0
  46. package/dist/lib/sharableStatus.d.ts.map +1 -1
  47. package/dist/lib/sharableStatus.js +11 -0
  48. package/dist/lib/time.d.ts +16 -0
  49. package/dist/lib/time.d.ts.map +1 -1
  50. package/dist/lib/time.js +41 -0
  51. package/dist/lib/validation/configValidation.d.ts +121 -0
  52. package/dist/lib/validation/configValidation.d.ts.map +1 -0
  53. package/dist/lib/validation/configValidation.js +204 -0
  54. package/dist/lib/validation/index.d.ts +2 -0
  55. package/dist/lib/validation/index.d.ts.map +1 -1
  56. package/dist/lib/validation/index.js +2 -0
  57. package/dist/lib/validation/startupValidation.d.ts +116 -0
  58. package/dist/lib/validation/startupValidation.d.ts.map +1 -0
  59. package/dist/lib/validation/startupValidation.js +497 -0
  60. package/dist/lib/validation/url.d.ts +36 -0
  61. package/dist/lib/validation/url.d.ts.map +1 -1
  62. package/dist/lib/validation/url.js +113 -0
  63. package/package.json +1 -1
@@ -13,6 +13,7 @@ exports.ApiRequestService = void 0;
13
13
  const _request_1 = require("../_request");
14
14
  const account_1 = require("./account/account");
15
15
  const channel_1 = require("./account/follow/channel");
16
+ const account_2 = require("./account/follow/account");
16
17
  const playlist_1 = require("./account/follow/playlist");
17
18
  const auth_1 = require("./auth/auth");
18
19
  const category_1 = require("./category/category");
@@ -35,6 +36,7 @@ const itemChapter_1 = require("./itemChapter/itemChapter");
35
36
  const playlistResourceItemSoundbite_1 = require("./playlist/playlistResource/playlistResourceItemSoundbite");
36
37
  const playlistResource_1 = require("./playlist/playlistResource/playlistResource");
37
38
  const liveItem_1 = require("./liveItem/liveItem");
39
+ const membership_1 = require("./membership/membership");
38
40
  const podcastIndex_1 = require("./externalServices/podcastIndex");
39
41
  const mq_1 = require("./mq/mq");
40
42
  const feed_1 = require("./feed/feed");
@@ -45,6 +47,7 @@ const fcm_1 = require("./account/fcm/fcm");
45
47
  const webpush_1 = require("./account/webpush/webpush");
46
48
  const unifiedpush_1 = require("./account/unifiedpush/unifiedpush");
47
49
  const publisherFeed_1 = require("./publisherFeed/publisherFeed");
50
+ const profile_1 = require("./profile/profile");
48
51
  class ApiRequestService {
49
52
  constructor(params) {
50
53
  const { protocol, host, port, prefix, version, jwt } = params;
@@ -54,6 +57,9 @@ class ApiRequestService {
54
57
  }
55
58
  apiRequest(_a) {
56
59
  return __awaiter(this, arguments, void 0, function* ({ path, method = 'GET', data, config = {}, abort, userAgent }) {
60
+ var _b, _c, _d, _e, _f, _g;
61
+ // Store responseType for error handling
62
+ const responseType = config === null || config === void 0 ? void 0 : config.responseType;
57
63
  try {
58
64
  const mergedConfig = Object.assign(Object.assign(Object.assign({}, config), (userAgent ? { userAgent } : {})), (this.jwt ?
59
65
  {
@@ -66,14 +72,66 @@ class ApiRequestService {
66
72
  return response.data;
67
73
  }
68
74
  catch (error) {
69
- console.error("API request error:", error);
75
+ // Extract useful debugging information from the error
76
+ const errorInfo = {};
77
+ // Type guard for error with response property (AxiosError)
78
+ const isAxiosError = (err) => {
79
+ return typeof err === 'object' && err !== null;
80
+ };
81
+ if (isAxiosError(error)) {
82
+ if (error.response) {
83
+ // Axios response error
84
+ errorInfo.status = error.response.status;
85
+ errorInfo.url = ((_b = error.config) === null || _b === void 0 ? void 0 : _b.url) || `${this.apiBase}${path}`;
86
+ errorInfo.method = (_d = (_c = error.config) === null || _c === void 0 ? void 0 : _c.method) === null || _d === void 0 ? void 0 : _d.toUpperCase();
87
+ // If responseType is 'blob' and we have an error response, convert blob to JSON
88
+ if (responseType === 'blob' && error.response.data instanceof Blob) {
89
+ try {
90
+ const blobText = yield error.response.data.text();
91
+ const parsedData = JSON.parse(blobText);
92
+ // Replace the blob with parsed JSON in the error object
93
+ error.response.data = parsedData;
94
+ errorInfo.responseData = parsedData;
95
+ }
96
+ catch (_h) {
97
+ // If parsing fails, keep the blob but log the error
98
+ errorInfo.responseData = error.response.data;
99
+ }
100
+ }
101
+ else {
102
+ errorInfo.responseData = error.response.data;
103
+ }
104
+ const responseData = error.response.data;
105
+ errorInfo.message = (responseData === null || responseData === void 0 ? void 0 : responseData.message) || error.message || 'Request failed';
106
+ }
107
+ else if (error.request) {
108
+ // Request was made but no response received
109
+ errorInfo.message = error.message || 'No response received from server';
110
+ errorInfo.url = ((_e = error.config) === null || _e === void 0 ? void 0 : _e.url) || `${this.apiBase}${path}`;
111
+ errorInfo.method = (_g = (_f = error.config) === null || _f === void 0 ? void 0 : _f.method) === null || _g === void 0 ? void 0 : _g.toUpperCase();
112
+ }
113
+ else {
114
+ // Error setting up the request
115
+ errorInfo.message = error.message || 'Error setting up request';
116
+ }
117
+ }
118
+ else if (error instanceof Error) {
119
+ errorInfo.message = error.message;
120
+ }
121
+ else {
122
+ errorInfo.message = 'Unknown error occurred';
123
+ }
124
+ console.error("API request error:", Object.assign(Object.assign({}, errorInfo), { path: `${method} ${path}` }));
70
125
  throw error;
71
126
  }
72
127
  });
73
128
  }
74
129
  /* ACCOUNT */
75
- reqAccountGetManyPublic() {
76
- return (0, account_1.reqAccountGetManyPublic)(this);
130
+ reqAccountGetMany(params) {
131
+ return (0, account_1.reqAccountGetMany)(this, params);
132
+ }
133
+ reqAccountGetByIdText(params) {
134
+ return (0, account_1.reqAccountGetByIdText)(this, params);
77
135
  }
78
136
  reqAccountCreate(params) {
79
137
  return (0, account_1.reqAccountCreate)(this, params);
@@ -96,6 +154,15 @@ class ApiRequestService {
96
154
  reqAccountChangeEmailAddress(params) {
97
155
  return (0, account_1.reqAccountChangeEmailAddress)(this, params);
98
156
  }
157
+ reqAccountUpdate(params) {
158
+ return (0, account_1.reqAccountUpdate)(this, params);
159
+ }
160
+ reqAccountDelete() {
161
+ return (0, account_1.reqAccountDelete)(this);
162
+ }
163
+ reqAccountDownloadData() {
164
+ return (0, account_1.reqAccountDownloadData)(this);
165
+ }
99
166
  /* ACCOUNT > FCM DEVICE */
100
167
  reqAccountFCMDeviceCreate(params) {
101
168
  return (0, fcm_1.reqAccountFCMDeviceCreate)(this, params);
@@ -142,6 +209,13 @@ class ApiRequestService {
142
209
  reqAccountUnfollowChannel(params) {
143
210
  return (0, channel_1.reqAccountUnfollowChannel)(this, params);
144
211
  }
212
+ /* ACCOUNT > FOLLOW > ACCOUNT */
213
+ reqAccountFollowAccount(params) {
214
+ return (0, account_2.reqAccountFollowAccount)(this, params);
215
+ }
216
+ reqAccountUnfollowAccount(params) {
217
+ return (0, account_2.reqAccountUnfollowAccount)(this, params);
218
+ }
145
219
  /* ACCOUNT > FOLLOW > PLAYLIST */
146
220
  reqAccountFollowPlaylist(params) {
147
221
  return (0, playlist_1.reqAccountFollowPlaylist)(this, params);
@@ -284,6 +358,10 @@ class ApiRequestService {
284
358
  reqLiveItemGetManyByChannel(channelIdOrIdText) {
285
359
  return (0, liveItem_1.reqLiveItemGetManyByChannel)(this, channelIdOrIdText);
286
360
  }
361
+ /* MEMBERSHIP */
362
+ reqMembershipGetPricing() {
363
+ return (0, membership_1.reqMembershipGetPricing)(this);
364
+ }
287
365
  /* MQ */
288
366
  reqMQRSSAddOnDemand(params) {
289
367
  return (0, mq_1.reqMQRSSAddOnDemand)(this, params);
@@ -466,5 +544,31 @@ class ApiRequestService {
466
544
  reqQueueResourceItemSoundbiteDelete(queue_id_text, item_soundbite_id_text) {
467
545
  return (0, queueResourceItemSoundbite_1.reqQueueResourceItemSoundbiteDelete)(this, queue_id_text, item_soundbite_id_text);
468
546
  }
547
+ /* PROFILE CONTENT */
548
+ reqProfilePodcastsAZ(params) {
549
+ return (0, profile_1.reqProfilePodcastsAZ)(this, params);
550
+ }
551
+ reqProfileAlbumsAZ(params) {
552
+ return (0, profile_1.reqProfileAlbumsAZ)(this, params);
553
+ }
554
+ reqProfilePlaylistsAZ(params) {
555
+ return (0, profile_1.reqProfilePlaylistsAZ)(this, params);
556
+ }
557
+ reqProfileClipsRecent(params) {
558
+ return (0, profile_1.reqProfileClipsRecent)(this, params);
559
+ }
560
+ /* MY PROFILE CONTENT */
561
+ reqMyProfilePodcastsAZ(params) {
562
+ return (0, profile_1.reqMyProfilePodcastsAZ)(this, params);
563
+ }
564
+ reqMyProfileAlbumsAZ(params) {
565
+ return (0, profile_1.reqMyProfileAlbumsAZ)(this, params);
566
+ }
567
+ reqMyProfilePlaylistsAZ(params) {
568
+ return (0, profile_1.reqMyProfilePlaylistsAZ)(this, params);
569
+ }
570
+ reqMyProfileClipsRecent(params) {
571
+ return (0, profile_1.reqMyProfileClipsRecent)(this, params);
572
+ }
469
573
  }
470
574
  exports.ApiRequestService = ApiRequestService;
@@ -1,7 +1,13 @@
1
1
  import { ApiRequestService } from '../_request';
2
2
  import { ApiListResponse } from '../_response';
3
3
  import { DTOAccount } from '../../../../dtos/account/account';
4
- export declare function reqAccountGetManyPublic(api: ApiRequestService): Promise<ApiListResponse<DTOAccount>>;
4
+ import { QueryParamsAccountGlobalTop, QueryParamsAccountSubscribedTop, QueryParamsSubscribedType, QueryParamsSubscribedFullSort, QueryParamsStatsRange, QueryParamsPage } from '../queryParams';
5
+ export declare function reqAccountGetManyPublicRecent(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOAccount>>;
6
+ export declare function reqAccountGetManySubscribedAZ(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOAccount>>;
7
+ export declare function reqAccountGetManySubscribedRecent(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOAccount>>;
8
+ export declare function reqAccountGetByIdText(api: ApiRequestService, params: {
9
+ id_text: string;
10
+ }): Promise<DTOAccount>;
5
11
  export declare function reqAccountCreate(api: ApiRequestService, params: {
6
12
  email: string;
7
13
  password: string;
@@ -40,4 +46,23 @@ export declare function reqAccountChangeEmailAddress(api: ApiRequestService, par
40
46
  }): Promise<{
41
47
  message: string;
42
48
  }>;
49
+ export declare function reqAccountUpdate(api: ApiRequestService, params: {
50
+ display_name: string | null;
51
+ bio: string | null;
52
+ sharable_status: number;
53
+ locale: string;
54
+ }): Promise<DTOAccount>;
55
+ export declare function reqAccountDelete(api: ApiRequestService): Promise<{
56
+ message: string;
57
+ }>;
58
+ export declare function reqAccountDownloadData(api: ApiRequestService): Promise<Blob>;
59
+ export declare function reqAccountGetManyPublicTop(api: ApiRequestService, params: QueryParamsAccountGlobalTop): Promise<ApiListResponse<DTOAccount>>;
60
+ export declare function reqAccountGetManySubscribedTop(api: ApiRequestService, params: QueryParamsAccountSubscribedTop): Promise<ApiListResponse<DTOAccount>>;
61
+ export type QueryParamsGetManyProfiles = {
62
+ type: QueryParamsSubscribedType | null;
63
+ sort: QueryParamsSubscribedFullSort | null;
64
+ range: QueryParamsStatsRange | null;
65
+ page: number;
66
+ };
67
+ export declare function reqAccountGetMany(api: ApiRequestService, params: QueryParamsGetManyProfiles): Promise<ApiListResponse<DTOAccount>>;
43
68
  //# sourceMappingURL=account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/lib/requests/api/account/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,eAAe,CAAC,UAAU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AAO,CAAC,UAAU,CAAC,CAOrB;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAM9B;AAED,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAQtC;AAED,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAStC;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACvC,IAAI,EAAE,6BAA6B,GAAG,IAAI,CAAC;IAC3C,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAWF,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAiDtC"}
@@ -9,7 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.reqAccountGetManyPublic = reqAccountGetManyPublic;
12
+ exports.reqAccountGetManyPublicRecent = reqAccountGetManyPublicRecent;
13
+ exports.reqAccountGetManySubscribedAZ = reqAccountGetManySubscribedAZ;
14
+ exports.reqAccountGetManySubscribedRecent = reqAccountGetManySubscribedRecent;
15
+ exports.reqAccountGetByIdText = reqAccountGetByIdText;
13
16
  exports.reqAccountCreate = reqAccountCreate;
14
17
  exports.reqAccountSendVerificationEmail = reqAccountSendVerificationEmail;
15
18
  exports.reqAccountVerifyEmail = reqAccountVerifyEmail;
@@ -17,10 +20,49 @@ exports.reqAccountSendResetPasswordEmail = reqAccountSendResetPasswordEmail;
17
20
  exports.reqAccountResetPassword = reqAccountResetPassword;
18
21
  exports.reqAccountSendChangeEmailAddressEmail = reqAccountSendChangeEmailAddressEmail;
19
22
  exports.reqAccountChangeEmailAddress = reqAccountChangeEmailAddress;
20
- function reqAccountGetManyPublic(api) {
23
+ exports.reqAccountUpdate = reqAccountUpdate;
24
+ exports.reqAccountDelete = reqAccountDelete;
25
+ exports.reqAccountDownloadData = reqAccountDownloadData;
26
+ exports.reqAccountGetManyPublicTop = reqAccountGetManyPublicTop;
27
+ exports.reqAccountGetManySubscribedTop = reqAccountGetManySubscribedTop;
28
+ exports.reqAccountGetMany = reqAccountGetMany;
29
+ function reqAccountGetManyPublicRecent(api, params) {
21
30
  return __awaiter(this, void 0, void 0, function* () {
22
31
  return api.apiRequest({
23
- path: '/account',
32
+ path: '/account/recent',
33
+ method: 'GET',
34
+ config: { params }
35
+ });
36
+ });
37
+ }
38
+ function reqAccountGetManySubscribedAZ(api, params) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ return api.apiRequest({
41
+ path: '/account/subscribed/az',
42
+ method: 'GET',
43
+ config: {
44
+ params,
45
+ withCredentials: true
46
+ }
47
+ });
48
+ });
49
+ }
50
+ function reqAccountGetManySubscribedRecent(api, params) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ return api.apiRequest({
53
+ path: '/account/subscribed/recent',
54
+ method: 'GET',
55
+ config: {
56
+ params,
57
+ withCredentials: true
58
+ }
59
+ });
60
+ });
61
+ }
62
+ function reqAccountGetByIdText(api, params) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ return api.apiRequest({
65
+ path: `/account/${params.id_text}`,
24
66
  method: 'GET'
25
67
  });
26
68
  });
@@ -89,3 +131,105 @@ function reqAccountChangeEmailAddress(api, params) {
89
131
  });
90
132
  });
91
133
  }
134
+ function reqAccountUpdate(api, params) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ return api.apiRequest({
137
+ path: '/account',
138
+ method: 'PUT',
139
+ data: params,
140
+ config: { withCredentials: true }
141
+ });
142
+ });
143
+ }
144
+ function reqAccountDelete(api) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ return api.apiRequest({
147
+ path: '/account/delete',
148
+ method: 'DELETE',
149
+ config: { withCredentials: true }
150
+ });
151
+ });
152
+ }
153
+ function reqAccountDownloadData(api) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const result = yield api.apiRequest({
156
+ path: '/account/download-data',
157
+ method: 'GET',
158
+ config: {
159
+ withCredentials: true,
160
+ responseType: 'blob'
161
+ }
162
+ });
163
+ return result;
164
+ });
165
+ }
166
+ function reqAccountGetManyPublicTop(api, params) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ return api.apiRequest({
169
+ path: '/account/top',
170
+ method: 'GET',
171
+ config: {
172
+ params
173
+ }
174
+ });
175
+ });
176
+ }
177
+ function reqAccountGetManySubscribedTop(api, params) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ return api.apiRequest({
180
+ path: '/account/subscribed/top',
181
+ method: 'GET',
182
+ config: {
183
+ params,
184
+ withCredentials: true
185
+ }
186
+ });
187
+ });
188
+ }
189
+ const emptyApiListResponse = {
190
+ data: [],
191
+ meta: {
192
+ page: 1,
193
+ count: 0,
194
+ limit: 50
195
+ }
196
+ };
197
+ function reqAccountGetMany(api, params) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ const { type, sort, range, page } = params;
200
+ if (type === "global") {
201
+ if (sort === "top" && range) {
202
+ return reqAccountGetManyPublicTop(api, {
203
+ page,
204
+ range
205
+ });
206
+ }
207
+ else {
208
+ // Recent or default
209
+ return reqAccountGetManyPublicRecent(api, {
210
+ page
211
+ });
212
+ }
213
+ }
214
+ else if (type === "subscribed") {
215
+ if (sort === "top" && range) {
216
+ return reqAccountGetManySubscribedTop(api, {
217
+ page,
218
+ range
219
+ });
220
+ }
221
+ else if (sort === "a_z") {
222
+ return reqAccountGetManySubscribedAZ(api, {
223
+ page
224
+ });
225
+ }
226
+ else {
227
+ // Recent or default
228
+ return reqAccountGetManySubscribedRecent(api, {
229
+ page
230
+ });
231
+ }
232
+ }
233
+ return Promise.resolve(emptyApiListResponse);
234
+ });
235
+ }
@@ -1 +1,9 @@
1
+ import { ApiRequestService } from '../../_request';
2
+ import { DTOAccount } from '../../../../../dtos/account/account';
3
+ type ReqAccountFollowParams = {
4
+ following_account_id_text: string;
5
+ };
6
+ export declare function reqAccountFollowAccount(api: ApiRequestService, params: ReqAccountFollowParams): Promise<DTOAccount>;
7
+ export declare function reqAccountUnfollowAccount(api: ApiRequestService, params: ReqAccountFollowParams): Promise<DTOAccount>;
8
+ export {};
1
9
  //# sourceMappingURL=account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/requests/api/account/follow/account.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/requests/api/account/follow/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAGjE,KAAK,sBAAsB,GAAG;IAC5B,yBAAyB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAWrB;AAED,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAWrB"}
@@ -1 +1,40 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.reqAccountFollowAccount = reqAccountFollowAccount;
13
+ exports.reqAccountUnfollowAccount = reqAccountUnfollowAccount;
14
+ const auth_1 = require("../../auth/auth");
15
+ function reqAccountFollowAccount(api, params) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ yield api.apiRequest({
18
+ path: '/account/follow/account',
19
+ method: 'POST',
20
+ data: {
21
+ following_account_id_text: params.following_account_id_text
22
+ },
23
+ config: { withCredentials: true }
24
+ });
25
+ return (0, auth_1.reqAuthMe)(api);
26
+ });
27
+ }
28
+ function reqAccountUnfollowAccount(api, params) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ yield api.apiRequest({
31
+ path: '/account/unfollow/account',
32
+ method: 'POST',
33
+ data: {
34
+ following_account_id_text: params.following_account_id_text
35
+ },
36
+ config: { withCredentials: true }
37
+ });
38
+ return (0, auth_1.reqAuthMe)(api);
39
+ });
40
+ }
@@ -0,0 +1,16 @@
1
+ import { ApiRequestService } from '../_request';
2
+ type MembershipPricingData = {
3
+ costMonthly: number;
4
+ costAnnually: number;
5
+ freeTrialDurationSeconds: number;
6
+ freeTrialDurationDays: number;
7
+ annuallySavingsPercent: number;
8
+ monthlyEquivalentAnnually: number;
9
+ };
10
+ export declare function reqMembershipGetPricing(api: ApiRequestService): Promise<{
11
+ data: MembershipPricingData;
12
+ } | {
13
+ message: string;
14
+ }>;
15
+ export {};
16
+ //# sourceMappingURL=membership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../../../../src/lib/requests/api/membership/membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yBAAyB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB;UACpC,qBAAqB;;aAAgB,MAAM;GAI1E"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.reqMembershipGetPricing = reqMembershipGetPricing;
13
+ function reqMembershipGetPricing(api) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ return api.apiRequest({
16
+ path: '/membership/pricing',
17
+ method: 'GET'
18
+ });
19
+ });
20
+ }
@@ -0,0 +1,16 @@
1
+ import { DTOChannel, DTOClip, DTOPlaylist } from '../../../../dtos';
2
+ import { ApiRequestService } from '../_request';
3
+ import { ApiListResponse } from '../_response';
4
+ import { QueryParamsPage } from '../queryParams';
5
+ export type QueryParamsProfileContent = QueryParamsPage & {
6
+ account_id_text: string;
7
+ };
8
+ export declare function reqProfilePodcastsAZ(api: ApiRequestService, params: QueryParamsProfileContent): Promise<ApiListResponse<DTOChannel>>;
9
+ export declare function reqProfileAlbumsAZ(api: ApiRequestService, params: QueryParamsProfileContent): Promise<ApiListResponse<DTOChannel>>;
10
+ export declare function reqProfilePlaylistsAZ(api: ApiRequestService, params: QueryParamsProfileContent): Promise<ApiListResponse<DTOPlaylist>>;
11
+ export declare function reqProfileClipsRecent(api: ApiRequestService, params: QueryParamsProfileContent): Promise<ApiListResponse<DTOClip>>;
12
+ export declare function reqMyProfilePodcastsAZ(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOChannel>>;
13
+ export declare function reqMyProfileAlbumsAZ(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOChannel>>;
14
+ export declare function reqMyProfilePlaylistsAZ(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOPlaylist>>;
15
+ export declare function reqMyProfileClipsRecent(api: ApiRequestService, params: QueryParamsPage): Promise<ApiListResponse<DTOClip>>;
16
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/requests/api/profile/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,MAAM,yBAAyB,GAAG,eAAe,GAAG;IACxD,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAIF,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAStC;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAStC;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CASvC;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CASnC;AAID,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAStC;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAStC;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CASvC;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CASnC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.reqProfilePodcastsAZ = reqProfilePodcastsAZ;
13
+ exports.reqProfileAlbumsAZ = reqProfileAlbumsAZ;
14
+ exports.reqProfilePlaylistsAZ = reqProfilePlaylistsAZ;
15
+ exports.reqProfileClipsRecent = reqProfileClipsRecent;
16
+ exports.reqMyProfilePodcastsAZ = reqMyProfilePodcastsAZ;
17
+ exports.reqMyProfileAlbumsAZ = reqMyProfileAlbumsAZ;
18
+ exports.reqMyProfilePlaylistsAZ = reqMyProfilePlaylistsAZ;
19
+ exports.reqMyProfileClipsRecent = reqMyProfileClipsRecent;
20
+ // Public profile routes
21
+ function reqProfilePodcastsAZ(api, params) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const { account_id_text, page } = params;
24
+ return api.apiRequest({
25
+ path: `/profile/${account_id_text}/podcasts/az`,
26
+ method: 'GET',
27
+ config: {
28
+ params: { page }
29
+ }
30
+ });
31
+ });
32
+ }
33
+ function reqProfileAlbumsAZ(api, params) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const { account_id_text, page } = params;
36
+ return api.apiRequest({
37
+ path: `/profile/${account_id_text}/albums/az`,
38
+ method: 'GET',
39
+ config: {
40
+ params: { page }
41
+ }
42
+ });
43
+ });
44
+ }
45
+ function reqProfilePlaylistsAZ(api, params) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ const { account_id_text, page } = params;
48
+ return api.apiRequest({
49
+ path: `/profile/${account_id_text}/playlists/az`,
50
+ method: 'GET',
51
+ config: {
52
+ params: { page }
53
+ }
54
+ });
55
+ });
56
+ }
57
+ function reqProfileClipsRecent(api, params) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ const { account_id_text, page } = params;
60
+ return api.apiRequest({
61
+ path: `/profile/${account_id_text}/clips/recent`,
62
+ method: 'GET',
63
+ config: {
64
+ params: { page }
65
+ }
66
+ });
67
+ });
68
+ }
69
+ // My profile routes (authenticated)
70
+ function reqMyProfilePodcastsAZ(api, params) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ return api.apiRequest({
73
+ path: '/my-profile/podcasts/az',
74
+ method: 'GET',
75
+ config: {
76
+ params,
77
+ withCredentials: true
78
+ }
79
+ });
80
+ });
81
+ }
82
+ function reqMyProfileAlbumsAZ(api, params) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ return api.apiRequest({
85
+ path: '/my-profile/albums/az',
86
+ method: 'GET',
87
+ config: {
88
+ params,
89
+ withCredentials: true
90
+ }
91
+ });
92
+ });
93
+ }
94
+ function reqMyProfilePlaylistsAZ(api, params) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ return api.apiRequest({
97
+ path: '/my-profile/playlists/az',
98
+ method: 'GET',
99
+ config: {
100
+ params,
101
+ withCredentials: true
102
+ }
103
+ });
104
+ });
105
+ }
106
+ function reqMyProfileClipsRecent(api, params) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return api.apiRequest({
109
+ path: '/my-profile/clips/recent',
110
+ method: 'GET',
111
+ config: {
112
+ params,
113
+ withCredentials: true
114
+ }
115
+ });
116
+ });
117
+ }
@@ -5,6 +5,20 @@ export declare const getValidQueryParam: <T extends string>(validParams: readonl
5
5
  export interface QueryParamsPage {
6
6
  page: number;
7
7
  }
8
+ export type QueryParamsAccountPublic = {
9
+ page: number;
10
+ };
11
+ export type QueryParamsAccountSubscribed = {
12
+ page: number;
13
+ };
14
+ export type QueryParamsAccountGlobalTop = {
15
+ page: number;
16
+ range: QueryParamsStatsRange;
17
+ };
18
+ export type QueryParamsAccountSubscribedTop = {
19
+ page: number;
20
+ range: QueryParamsStatsRange;
21
+ };
8
22
  export interface QueryParamsShuffle {
9
23
  page: number;
10
24
  shuffleHash: string;