@orangefox-recovery/foxclient 5.4.0 → 6.0.4

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 (212) hide show
  1. package/.openapi-generator/FILES +20 -22
  2. package/README.md +29 -37
  3. package/dist/apis/DeviceApi.d.ts +89 -107
  4. package/dist/apis/DeviceApi.js +60 -71
  5. package/dist/apis/PasteApi.d.ts +33 -39
  6. package/dist/apis/PasteApi.js +23 -27
  7. package/dist/apis/ReleaseApi.d.ts +145 -143
  8. package/dist/apis/ReleaseApi.js +108 -95
  9. package/dist/apis/ReportApi.d.ts +64 -0
  10. package/dist/apis/ReportApi.js +89 -0
  11. package/dist/apis/StatsApi.d.ts +19 -19
  12. package/dist/apis/StatsApi.js +14 -14
  13. package/dist/apis/index.d.ts +1 -0
  14. package/dist/apis/index.js +1 -0
  15. package/dist/esm/apis/DeviceApi.d.ts +89 -107
  16. package/dist/esm/apis/DeviceApi.js +61 -72
  17. package/dist/esm/apis/PasteApi.d.ts +33 -39
  18. package/dist/esm/apis/PasteApi.js +24 -28
  19. package/dist/esm/apis/ReleaseApi.d.ts +145 -143
  20. package/dist/esm/apis/ReleaseApi.js +109 -96
  21. package/dist/esm/apis/ReportApi.d.ts +64 -0
  22. package/dist/esm/apis/ReportApi.js +85 -0
  23. package/dist/esm/apis/StatsApi.d.ts +19 -19
  24. package/dist/esm/apis/StatsApi.js +15 -15
  25. package/dist/esm/apis/index.d.ts +1 -0
  26. package/dist/esm/apis/index.js +1 -0
  27. package/dist/esm/models/DeviceResponse.d.ts +33 -29
  28. package/dist/esm/models/DeviceResponse.js +34 -26
  29. package/dist/esm/models/ErrorResponse.d.ts +32 -0
  30. package/dist/esm/models/ErrorResponse.js +43 -0
  31. package/dist/esm/models/GlobalStatsResponse.d.ts +52 -0
  32. package/dist/esm/models/{GlobalStatsAggregationModel.js → GlobalStatsResponse.js} +14 -14
  33. package/dist/esm/models/ListResponseReleaseResponse.d.ts +8 -8
  34. package/dist/esm/models/ListResponseReleaseResponse.js +8 -7
  35. package/dist/esm/models/ListResponseReleaseResponseDataInner.d.ts +155 -0
  36. package/dist/esm/models/ListResponseReleaseResponseDataInner.js +114 -0
  37. package/dist/esm/models/ListResponseShortDeviceResponse.d.ts +8 -8
  38. package/dist/esm/models/ListResponseShortDeviceResponse.js +8 -7
  39. package/dist/esm/models/ListResponseShortDeviceResponseDataInner.d.ts +98 -0
  40. package/dist/esm/models/ListResponseShortDeviceResponseDataInner.js +85 -0
  41. package/dist/esm/models/ListResponseString.d.ts +38 -0
  42. package/dist/esm/models/ListResponseString.js +47 -0
  43. package/dist/esm/models/MaintainerShortResponse.d.ts +50 -0
  44. package/dist/esm/models/MaintainerShortResponse.js +55 -0
  45. package/dist/esm/models/NewReportRequest.d.ts +58 -0
  46. package/dist/esm/models/NewReportRequest.js +55 -0
  47. package/dist/esm/models/PasteInput.d.ts +3 -3
  48. package/dist/esm/models/PasteInput.js +2 -2
  49. package/dist/esm/models/PasteResponse.d.ts +50 -0
  50. package/dist/esm/models/PasteResponse.js +53 -0
  51. package/dist/esm/models/RecoveryImgResponse.d.ts +6 -6
  52. package/dist/esm/models/RecoveryImgResponse.js +6 -6
  53. package/dist/esm/models/ReleaseGroupsResponse.d.ts +2 -2
  54. package/dist/esm/models/ReleaseGroupsResponse.js +2 -2
  55. package/dist/esm/models/ReleaseResponse.d.ts +46 -42
  56. package/dist/esm/models/ReleaseResponse.js +45 -44
  57. package/dist/esm/models/ShortDeviceResponse.d.ts +29 -25
  58. package/dist/esm/models/ShortDeviceResponse.js +26 -18
  59. package/dist/esm/models/ShortReleaseResponse.d.ts +31 -27
  60. package/dist/esm/models/ShortReleaseResponse.js +35 -32
  61. package/dist/esm/models/TokenResponse.d.ts +38 -0
  62. package/dist/esm/models/TokenResponse.js +47 -0
  63. package/dist/esm/models/index.d.ts +9 -11
  64. package/dist/esm/models/index.js +9 -11
  65. package/dist/esm/runtime.d.ts +2 -2
  66. package/dist/esm/runtime.js +2 -2
  67. package/dist/models/DeviceResponse.d.ts +33 -29
  68. package/dist/models/DeviceResponse.js +34 -26
  69. package/dist/models/ErrorResponse.d.ts +32 -0
  70. package/dist/models/ErrorResponse.js +50 -0
  71. package/dist/models/GlobalStatsResponse.d.ts +52 -0
  72. package/dist/models/GlobalStatsResponse.js +62 -0
  73. package/dist/models/ListResponseReleaseResponse.d.ts +8 -8
  74. package/dist/models/ListResponseReleaseResponse.js +8 -7
  75. package/dist/models/ListResponseReleaseResponseDataInner.d.ts +155 -0
  76. package/dist/models/ListResponseReleaseResponseDataInner.js +121 -0
  77. package/dist/models/ListResponseShortDeviceResponse.d.ts +8 -8
  78. package/dist/models/ListResponseShortDeviceResponse.js +8 -7
  79. package/dist/models/ListResponseShortDeviceResponseDataInner.d.ts +98 -0
  80. package/dist/models/ListResponseShortDeviceResponseDataInner.js +92 -0
  81. package/dist/models/ListResponseString.d.ts +38 -0
  82. package/dist/models/ListResponseString.js +54 -0
  83. package/dist/models/MaintainerShortResponse.d.ts +50 -0
  84. package/dist/models/MaintainerShortResponse.js +62 -0
  85. package/dist/models/NewReportRequest.d.ts +58 -0
  86. package/dist/models/NewReportRequest.js +62 -0
  87. package/dist/models/PasteInput.d.ts +3 -3
  88. package/dist/models/PasteInput.js +2 -2
  89. package/dist/models/PasteResponse.d.ts +50 -0
  90. package/dist/models/PasteResponse.js +60 -0
  91. package/dist/models/RecoveryImgResponse.d.ts +6 -6
  92. package/dist/models/RecoveryImgResponse.js +6 -6
  93. package/dist/models/ReleaseGroupsResponse.d.ts +2 -2
  94. package/dist/models/ReleaseGroupsResponse.js +2 -2
  95. package/dist/models/ReleaseResponse.d.ts +46 -42
  96. package/dist/models/ReleaseResponse.js +45 -44
  97. package/dist/models/ShortDeviceResponse.d.ts +29 -25
  98. package/dist/models/ShortDeviceResponse.js +26 -18
  99. package/dist/models/ShortReleaseResponse.d.ts +31 -27
  100. package/dist/models/ShortReleaseResponse.js +35 -32
  101. package/dist/models/TokenResponse.d.ts +38 -0
  102. package/dist/models/TokenResponse.js +54 -0
  103. package/dist/models/index.d.ts +9 -11
  104. package/dist/models/index.js +9 -11
  105. package/dist/runtime.d.ts +2 -2
  106. package/dist/runtime.js +2 -2
  107. package/docs/DeviceApi.md +83 -90
  108. package/docs/DeviceResponse.md +19 -17
  109. package/docs/{LocationInner.md → ErrorResponse.md} +6 -4
  110. package/docs/{GlobalStatsAggregationModel.md → GlobalStatsResponse.md} +6 -6
  111. package/docs/ListResponseReleaseResponse.md +2 -2
  112. package/docs/ListResponseReleaseResponseDataInner.md +74 -0
  113. package/docs/ListResponseShortDeviceResponse.md +2 -2
  114. package/docs/ListResponseShortDeviceResponseDataInner.md +56 -0
  115. package/docs/{ListResponseStr.md → ListResponseString.md} +6 -6
  116. package/docs/{MaintainerShortModel.md → MaintainerShortResponse.md} +9 -7
  117. package/docs/{HTTPValidationError.md → NewReportRequest.md} +14 -6
  118. package/docs/PasteApi.md +25 -29
  119. package/docs/{PasteOutput.md → PasteResponse.md} +7 -7
  120. package/docs/RecoveryImgResponse.md +2 -2
  121. package/docs/ReleaseApi.md +176 -118
  122. package/docs/ReleaseResponse.md +28 -26
  123. package/docs/ReportApi.md +84 -0
  124. package/docs/ShortDeviceResponse.md +14 -12
  125. package/docs/ShortReleaseResponse.md +22 -20
  126. package/docs/StatsApi.md +10 -10
  127. package/docs/{ReleasesSort.md → TokenResponse.md} +8 -4
  128. package/package.json +3 -12
  129. package/src/apis/DeviceApi.ts +130 -148
  130. package/src/apis/PasteApi.ts +47 -53
  131. package/src/apis/ReleaseApi.ts +237 -228
  132. package/src/apis/ReportApi.ts +139 -0
  133. package/src/apis/StatsApi.ts +28 -25
  134. package/src/apis/index.ts +1 -0
  135. package/src/models/DeviceResponse.ts +65 -55
  136. package/src/models/ErrorResponse.ts +66 -0
  137. package/src/models/GlobalStatsResponse.ts +93 -0
  138. package/src/models/ListResponseReleaseResponse.ts +17 -16
  139. package/src/models/ListResponseReleaseResponseDataInner.ts +249 -0
  140. package/src/models/ListResponseShortDeviceResponse.ts +17 -16
  141. package/src/models/ListResponseShortDeviceResponseDataInner.ts +164 -0
  142. package/src/models/ListResponseString.ts +75 -0
  143. package/src/models/MaintainerShortResponse.ts +93 -0
  144. package/src/models/NewReportRequest.ts +100 -0
  145. package/src/models/PasteInput.ts +3 -3
  146. package/src/models/PasteResponse.ts +92 -0
  147. package/src/models/RecoveryImgResponse.ts +9 -9
  148. package/src/models/ReleaseGroupsResponse.ts +2 -2
  149. package/src/models/ReleaseResponse.ts +85 -86
  150. package/src/models/ShortDeviceResponse.ts +50 -40
  151. package/src/models/ShortReleaseResponse.ts +62 -64
  152. package/src/models/TokenResponse.ts +75 -0
  153. package/src/models/index.ts +9 -11
  154. package/src/runtime.ts +2 -2
  155. package/dist/esm/models/GlobalStatsAggregationModel.d.ts +0 -52
  156. package/dist/esm/models/HTTPValidationError.d.ts +0 -33
  157. package/dist/esm/models/HTTPValidationError.js +0 -42
  158. package/dist/esm/models/ListResponseShortReleaseResponse.d.ts +0 -39
  159. package/dist/esm/models/ListResponseShortReleaseResponse.js +0 -47
  160. package/dist/esm/models/ListResponseStr.d.ts +0 -38
  161. package/dist/esm/models/ListResponseStr.js +0 -46
  162. package/dist/esm/models/LocationInner.d.ts +0 -26
  163. package/dist/esm/models/LocationInner.js +0 -31
  164. package/dist/esm/models/MaintainerShortModel.d.ts +0 -44
  165. package/dist/esm/models/MaintainerShortModel.js +0 -51
  166. package/dist/esm/models/PasteOutput.d.ts +0 -50
  167. package/dist/esm/models/PasteOutput.js +0 -53
  168. package/dist/esm/models/ReleaseType.d.ts +0 -26
  169. package/dist/esm/models/ReleaseType.js +0 -44
  170. package/dist/esm/models/ReleasesSort.d.ts +0 -25
  171. package/dist/esm/models/ReleasesSort.js +0 -43
  172. package/dist/esm/models/ResponseGetReleases.d.ts +0 -41
  173. package/dist/esm/models/ResponseGetReleases.js +0 -46
  174. package/dist/esm/models/ValidationError.d.ts +0 -57
  175. package/dist/esm/models/ValidationError.js +0 -56
  176. package/dist/models/GlobalStatsAggregationModel.d.ts +0 -52
  177. package/dist/models/GlobalStatsAggregationModel.js +0 -62
  178. package/dist/models/HTTPValidationError.d.ts +0 -33
  179. package/dist/models/HTTPValidationError.js +0 -49
  180. package/dist/models/ListResponseShortReleaseResponse.d.ts +0 -39
  181. package/dist/models/ListResponseShortReleaseResponse.js +0 -54
  182. package/dist/models/ListResponseStr.d.ts +0 -38
  183. package/dist/models/ListResponseStr.js +0 -53
  184. package/dist/models/LocationInner.d.ts +0 -26
  185. package/dist/models/LocationInner.js +0 -38
  186. package/dist/models/MaintainerShortModel.d.ts +0 -44
  187. package/dist/models/MaintainerShortModel.js +0 -58
  188. package/dist/models/PasteOutput.d.ts +0 -50
  189. package/dist/models/PasteOutput.js +0 -60
  190. package/dist/models/ReleaseType.d.ts +0 -26
  191. package/dist/models/ReleaseType.js +0 -52
  192. package/dist/models/ReleasesSort.d.ts +0 -25
  193. package/dist/models/ReleasesSort.js +0 -51
  194. package/dist/models/ResponseGetReleases.d.ts +0 -41
  195. package/dist/models/ResponseGetReleases.js +0 -53
  196. package/dist/models/ValidationError.d.ts +0 -57
  197. package/dist/models/ValidationError.js +0 -63
  198. package/docs/ListResponseShortReleaseResponse.md +0 -36
  199. package/docs/ReleaseType.md +0 -32
  200. package/docs/ResponseGetReleases.md +0 -36
  201. package/docs/ValidationError.md +0 -42
  202. package/src/models/GlobalStatsAggregationModel.ts +0 -93
  203. package/src/models/HTTPValidationError.ts +0 -73
  204. package/src/models/ListResponseShortReleaseResponse.ts +0 -82
  205. package/src/models/ListResponseStr.ts +0 -74
  206. package/src/models/LocationInner.ts +0 -46
  207. package/src/models/MaintainerShortModel.ts +0 -84
  208. package/src/models/PasteOutput.ts +0 -92
  209. package/src/models/ReleaseType.ts +0 -54
  210. package/src/models/ReleasesSort.ts +0 -53
  211. package/src/models/ResponseGetReleases.ts +0 -96
  212. package/src/models/ValidationError.ts +0 -108
@@ -0,0 +1,139 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Fox API
5
+ * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
6
+ *
7
+ * The version of the OpenAPI document: 6.0.4
8
+ * Contact: admin@orangefox.tech
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ErrorResponse,
19
+ NewReportRequest,
20
+ } from '../models/index';
21
+ import {
22
+ ErrorResponseFromJSON,
23
+ ErrorResponseToJSON,
24
+ NewReportRequestFromJSON,
25
+ NewReportRequestToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface NewReportOperationRequest {
29
+ releaseId: string;
30
+ newReportRequest: NewReportRequest;
31
+ }
32
+
33
+ /**
34
+ * ReportApi - interface
35
+ *
36
+ * @export
37
+ * @interface ReportApiInterface
38
+ */
39
+ export interface ReportApiInterface {
40
+ /**
41
+ * Creates request options for newReport without sending the request
42
+ * @param {string} releaseId Release ID
43
+ * @param {NewReportRequest} newReportRequest
44
+ * @throws {RequiredError}
45
+ * @memberof ReportApiInterface
46
+ */
47
+ newReportRequestOpts(requestParameters: NewReportOperationRequest): Promise<runtime.RequestOpts>;
48
+
49
+ /**
50
+ *
51
+ * @summary POST /report/{release_id} - Submit a bug report.
52
+ * @param {string} releaseId Release ID
53
+ * @param {NewReportRequest} newReportRequest
54
+ * @param {*} [options] Override http request option.
55
+ * @throws {RequiredError}
56
+ * @memberof ReportApiInterface
57
+ */
58
+ newReportRaw(requestParameters: NewReportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
59
+
60
+ /**
61
+ * POST /report/{release_id} - Submit a bug report.
62
+ */
63
+ newReport(requestParameters: NewReportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
64
+
65
+ }
66
+
67
+ /**
68
+ *
69
+ */
70
+ export class ReportApi extends runtime.BaseAPI implements ReportApiInterface {
71
+
72
+ /**
73
+ * Creates request options for newReport without sending the request
74
+ */
75
+ async newReportRequestOpts(requestParameters: NewReportOperationRequest): Promise<runtime.RequestOpts> {
76
+ if (requestParameters['releaseId'] == null) {
77
+ throw new runtime.RequiredError(
78
+ 'releaseId',
79
+ 'Required parameter "releaseId" was null or undefined when calling newReport().'
80
+ );
81
+ }
82
+
83
+ if (requestParameters['newReportRequest'] == null) {
84
+ throw new runtime.RequiredError(
85
+ 'newReportRequest',
86
+ 'Required parameter "newReportRequest" was null or undefined when calling newReport().'
87
+ );
88
+ }
89
+
90
+ const queryParameters: any = {};
91
+
92
+ const headerParameters: runtime.HTTPHeaders = {};
93
+
94
+ headerParameters['Content-Type'] = 'application/json';
95
+
96
+ if (this.configuration && this.configuration.accessToken) {
97
+ const token = this.configuration.accessToken;
98
+ const tokenString = await token("bearer_auth", []);
99
+
100
+ if (tokenString) {
101
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
102
+ }
103
+ }
104
+
105
+ let urlPath = `/report/{release_id}`;
106
+ urlPath = urlPath.replace(`{${"release_id"}}`, encodeURIComponent(String(requestParameters['releaseId'])));
107
+
108
+ return {
109
+ path: urlPath,
110
+ method: 'POST',
111
+ headers: headerParameters,
112
+ query: queryParameters,
113
+ body: NewReportRequestToJSON(requestParameters['newReportRequest']),
114
+ };
115
+ }
116
+
117
+ /**
118
+ * POST /report/{release_id} - Submit a bug report.
119
+ */
120
+ async newReportRaw(requestParameters: NewReportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
121
+ const requestOptions = await this.newReportRequestOpts(requestParameters);
122
+ const response = await this.request(requestOptions, initOverrides);
123
+
124
+ if (this.isJsonMime(response.headers.get('content-type'))) {
125
+ return new runtime.JSONApiResponse<string>(response);
126
+ } else {
127
+ return new runtime.TextApiResponse(response) as any;
128
+ }
129
+ }
130
+
131
+ /**
132
+ * POST /report/{release_id} - Submit a bug report.
133
+ */
134
+ async newReport(requestParameters: NewReportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
135
+ const response = await this.newReportRaw(requestParameters, initOverrides);
136
+ return await response.value();
137
+ }
138
+
139
+ }
@@ -2,9 +2,9 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  * Fox API
5
- * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
5
+ * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
6
6
  *
7
- * The version of the OpenAPI document: 5.4.0
7
+ * The version of the OpenAPI document: 6.0.4
8
8
  * Contact: admin@orangefox.tech
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -15,11 +15,14 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
- GlobalStatsAggregationModel,
18
+ ErrorResponse,
19
+ GlobalStatsResponse,
19
20
  } from '../models/index';
20
21
  import {
21
- GlobalStatsAggregationModelFromJSON,
22
- GlobalStatsAggregationModelToJSON,
22
+ ErrorResponseFromJSON,
23
+ ErrorResponseToJSON,
24
+ GlobalStatsResponseFromJSON,
25
+ GlobalStatsResponseToJSON,
23
26
  } from '../models/index';
24
27
 
25
28
  /**
@@ -30,26 +33,26 @@ import {
30
33
  */
31
34
  export interface StatsApiInterface {
32
35
  /**
33
- * Creates request options for getPublicStats without sending the request
36
+ * Creates request options for getGlobalStats without sending the request
34
37
  * @throws {RequiredError}
35
38
  * @memberof StatsApiInterface
36
39
  */
37
- getPublicStatsRequestOpts(): Promise<runtime.RequestOpts>;
40
+ getGlobalStatsRequestOpts(): Promise<runtime.RequestOpts>;
38
41
 
39
42
  /**
40
- * Returns the global OrangeFox downloads statistics. This request causes an increased load to the database, as it needs to aggregate all the release stats data, therefore, it is limited to a small number of requests per minute for public usage.
41
- * @summary Public Stats
43
+ * Uses a MongoDB aggregation pipeline to compute total download count, unique devices count, unique releases count, and per-day breakdown.
44
+ * @summary GET /stats/ - Get global download statistics.
42
45
  * @param {*} [options] Override http request option.
43
46
  * @throws {RequiredError}
44
47
  * @memberof StatsApiInterface
45
48
  */
46
- getPublicStatsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GlobalStatsAggregationModel>>;
49
+ getGlobalStatsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GlobalStatsResponse>>;
47
50
 
48
51
  /**
49
- * Returns the global OrangeFox downloads statistics. This request causes an increased load to the database, as it needs to aggregate all the release stats data, therefore, it is limited to a small number of requests per minute for public usage.
50
- * Public Stats
52
+ * Uses a MongoDB aggregation pipeline to compute total download count, unique devices count, unique releases count, and per-day breakdown.
53
+ * GET /stats/ - Get global download statistics.
51
54
  */
52
- getPublicStats(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GlobalStatsAggregationModel>;
55
+ getGlobalStats(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GlobalStatsResponse>;
53
56
 
54
57
  }
55
58
 
@@ -59,15 +62,15 @@ export interface StatsApiInterface {
59
62
  export class StatsApi extends runtime.BaseAPI implements StatsApiInterface {
60
63
 
61
64
  /**
62
- * Creates request options for getPublicStats without sending the request
65
+ * Creates request options for getGlobalStats without sending the request
63
66
  */
64
- async getPublicStatsRequestOpts(): Promise<runtime.RequestOpts> {
67
+ async getGlobalStatsRequestOpts(): Promise<runtime.RequestOpts> {
65
68
  const queryParameters: any = {};
66
69
 
67
70
  const headerParameters: runtime.HTTPHeaders = {};
68
71
 
69
72
 
70
- let urlPath = `/stats/`;
73
+ let urlPath = `/stats`;
71
74
 
72
75
  return {
73
76
  path: urlPath,
@@ -78,22 +81,22 @@ export class StatsApi extends runtime.BaseAPI implements StatsApiInterface {
78
81
  }
79
82
 
80
83
  /**
81
- * Returns the global OrangeFox downloads statistics. This request causes an increased load to the database, as it needs to aggregate all the release stats data, therefore, it is limited to a small number of requests per minute for public usage.
82
- * Public Stats
84
+ * Uses a MongoDB aggregation pipeline to compute total download count, unique devices count, unique releases count, and per-day breakdown.
85
+ * GET /stats/ - Get global download statistics.
83
86
  */
84
- async getPublicStatsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GlobalStatsAggregationModel>> {
85
- const requestOptions = await this.getPublicStatsRequestOpts();
87
+ async getGlobalStatsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GlobalStatsResponse>> {
88
+ const requestOptions = await this.getGlobalStatsRequestOpts();
86
89
  const response = await this.request(requestOptions, initOverrides);
87
90
 
88
- return new runtime.JSONApiResponse(response, (jsonValue) => GlobalStatsAggregationModelFromJSON(jsonValue));
91
+ return new runtime.JSONApiResponse(response, (jsonValue) => GlobalStatsResponseFromJSON(jsonValue));
89
92
  }
90
93
 
91
94
  /**
92
- * Returns the global OrangeFox downloads statistics. This request causes an increased load to the database, as it needs to aggregate all the release stats data, therefore, it is limited to a small number of requests per minute for public usage.
93
- * Public Stats
95
+ * Uses a MongoDB aggregation pipeline to compute total download count, unique devices count, unique releases count, and per-day breakdown.
96
+ * GET /stats/ - Get global download statistics.
94
97
  */
95
- async getPublicStats(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GlobalStatsAggregationModel> {
96
- const response = await this.getPublicStatsRaw(initOverrides);
98
+ async getGlobalStats(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GlobalStatsResponse> {
99
+ const response = await this.getGlobalStatsRaw(initOverrides);
97
100
  return await response.value();
98
101
  }
99
102
 
package/src/apis/index.ts CHANGED
@@ -3,4 +3,5 @@
3
3
  export * from './DeviceApi';
4
4
  export * from './PasteApi';
5
5
  export * from './ReleaseApi';
6
+ export * from './ReportApi';
6
7
  export * from './StatsApi';
@@ -2,9 +2,9 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  * Fox API
5
- * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
5
+ * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
6
6
  *
7
- * The version of the OpenAPI document: 5.4.0
7
+ * The version of the OpenAPI document: 6.0.4
8
8
  * Contact: admin@orangefox.tech
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { MaintainerShortModel } from './MaintainerShortModel';
16
+ import type { MaintainerShortResponse } from './MaintainerShortResponse';
17
17
  import {
18
- MaintainerShortModelFromJSON,
19
- MaintainerShortModelFromJSONTyped,
20
- MaintainerShortModelToJSON,
21
- MaintainerShortModelToJSONTyped,
22
- } from './MaintainerShortModel';
18
+ MaintainerShortResponseFromJSON,
19
+ MaintainerShortResponseFromJSONTyped,
20
+ MaintainerShortResponseToJSON,
21
+ MaintainerShortResponseToJSONTyped,
22
+ } from './MaintainerShortResponse';
23
23
 
24
24
  /**
25
25
  *
@@ -28,73 +28,77 @@ import {
28
28
  */
29
29
  export interface DeviceResponse {
30
30
  /**
31
- * Device codename, legacy
31
+ *
32
32
  * @type {string}
33
33
  * @memberof DeviceResponse
34
- * @deprecated
35
34
  */
36
- codename: string;
35
+ legacyId: string;
37
36
  /**
38
- * Model name of device, does not include the OEM part, legacy
37
+ *
39
38
  * @type {string}
40
39
  * @memberof DeviceResponse
41
- * @deprecated
42
40
  */
43
- modelName: string;
41
+ codename: string;
44
42
  /**
45
43
  *
46
- * @type {string}
44
+ * @type {Array<string>}
47
45
  * @memberof DeviceResponse
48
46
  */
49
- oemName: string;
47
+ codenames: Array<string>;
50
48
  /**
51
49
  *
52
50
  * @type {string}
53
51
  * @memberof DeviceResponse
54
52
  */
55
- id: string;
53
+ featuredText?: string;
56
54
  /**
57
55
  *
58
- * @type {Array<string>}
56
+ * @type {string}
59
57
  * @memberof DeviceResponse
60
58
  */
61
- codenames: Array<string>;
59
+ fullName: string;
62
60
  /**
63
61
  *
64
- * @type {Array<string>}
62
+ * @type {string}
65
63
  * @memberof DeviceResponse
66
64
  */
67
- modelNames: Array<string>;
65
+ id: string;
68
66
  /**
69
67
  *
70
68
  * @type {boolean}
71
69
  * @memberof DeviceResponse
72
70
  */
73
- supported: boolean;
71
+ isFeatured: boolean;
74
72
  /**
75
73
  *
76
- * @type {boolean}
74
+ * @type {string}
77
75
  * @memberof DeviceResponse
78
76
  */
79
- isFeatured?: boolean;
77
+ modelName: string;
78
+ /**
79
+ *
80
+ * @type {Array<string>}
81
+ * @memberof DeviceResponse
82
+ */
83
+ modelNames: Array<string>;
80
84
  /**
81
85
  *
82
86
  * @type {string}
83
87
  * @memberof DeviceResponse
84
88
  */
85
- featuredText?: string | null;
89
+ oemName: string;
86
90
  /**
87
91
  *
88
- * @type {MaintainerShortModel}
92
+ * @type {boolean}
89
93
  * @memberof DeviceResponse
90
94
  */
91
- maintainer: MaintainerShortModel;
95
+ supported: boolean;
92
96
  /**
93
97
  *
94
98
  * @type {string}
95
99
  * @memberof DeviceResponse
96
100
  */
97
- notes?: string | null;
101
+ url: string;
98
102
  /**
99
103
  *
100
104
  * @type {string}
@@ -102,33 +106,35 @@ export interface DeviceResponse {
102
106
  */
103
107
  deviceTree?: string | null;
104
108
  /**
105
- * Full name of device / devices, legacy
106
- * @type {string}
109
+ *
110
+ * @type {MaintainerShortResponse}
107
111
  * @memberof DeviceResponse
108
112
  */
109
- readonly fullName: string;
113
+ maintainer: MaintainerShortResponse;
110
114
  /**
111
- * URL of the device on the official website
115
+ *
112
116
  * @type {string}
113
117
  * @memberof DeviceResponse
114
118
  */
115
- readonly url: string;
119
+ notes?: string | null;
116
120
  }
117
121
 
118
122
  /**
119
123
  * Check if a given object implements the DeviceResponse interface.
120
124
  */
121
125
  export function instanceOfDeviceResponse(value: object): value is DeviceResponse {
126
+ if (!('legacyId' in value) || value['legacyId'] === undefined) return false;
122
127
  if (!('codename' in value) || value['codename'] === undefined) return false;
123
- if (!('modelName' in value) || value['modelName'] === undefined) return false;
124
- if (!('oemName' in value) || value['oemName'] === undefined) return false;
125
- if (!('id' in value) || value['id'] === undefined) return false;
126
128
  if (!('codenames' in value) || value['codenames'] === undefined) return false;
129
+ if (!('fullName' in value) || value['fullName'] === undefined) return false;
130
+ if (!('id' in value) || value['id'] === undefined) return false;
131
+ if (!('isFeatured' in value) || value['isFeatured'] === undefined) return false;
132
+ if (!('modelName' in value) || value['modelName'] === undefined) return false;
127
133
  if (!('modelNames' in value) || value['modelNames'] === undefined) return false;
134
+ if (!('oemName' in value) || value['oemName'] === undefined) return false;
128
135
  if (!('supported' in value) || value['supported'] === undefined) return false;
129
- if (!('maintainer' in value) || value['maintainer'] === undefined) return false;
130
- if (!('fullName' in value) || value['fullName'] === undefined) return false;
131
136
  if (!('url' in value) || value['url'] === undefined) return false;
137
+ if (!('maintainer' in value) || value['maintainer'] === undefined) return false;
132
138
  return true;
133
139
  }
134
140
 
@@ -142,20 +148,21 @@ export function DeviceResponseFromJSONTyped(json: any, ignoreDiscriminator: bool
142
148
  }
143
149
  return {
144
150
 
151
+ 'legacyId': json['_id'],
145
152
  'codename': json['codename'],
146
- 'modelName': json['model_name'],
147
- 'oemName': json['oem_name'],
148
- 'id': json['id'],
149
153
  'codenames': json['codenames'],
150
- 'modelNames': json['model_names'],
151
- 'supported': json['supported'],
152
- 'isFeatured': json['is_featured'] == null ? undefined : json['is_featured'],
153
154
  'featuredText': json['featured_text'] == null ? undefined : json['featured_text'],
154
- 'maintainer': MaintainerShortModelFromJSON(json['maintainer']),
155
- 'notes': json['notes'] == null ? undefined : json['notes'],
156
- 'deviceTree': json['device_tree'] == null ? undefined : json['device_tree'],
157
155
  'fullName': json['full_name'],
156
+ 'id': json['id'],
157
+ 'isFeatured': json['is_featured'],
158
+ 'modelName': json['model_name'],
159
+ 'modelNames': json['model_names'],
160
+ 'oemName': json['oem_name'],
161
+ 'supported': json['supported'],
158
162
  'url': json['url'],
163
+ 'deviceTree': json['device_tree'] == null ? undefined : json['device_tree'],
164
+ 'maintainer': MaintainerShortResponseFromJSON(json['maintainer']),
165
+ 'notes': json['notes'] == null ? undefined : json['notes'],
159
166
  };
160
167
  }
161
168
 
@@ -163,25 +170,28 @@ export function DeviceResponseToJSON(json: any): DeviceResponse {
163
170
  return DeviceResponseToJSONTyped(json, false);
164
171
  }
165
172
 
166
- export function DeviceResponseToJSONTyped(value?: Omit<DeviceResponse, 'fullName'|'url'> | null, ignoreDiscriminator: boolean = false): any {
173
+ export function DeviceResponseToJSONTyped(value?: DeviceResponse | null, ignoreDiscriminator: boolean = false): any {
167
174
  if (value == null) {
168
175
  return value;
169
176
  }
170
177
 
171
178
  return {
172
179
 
180
+ '_id': value['legacyId'],
173
181
  'codename': value['codename'],
174
- 'model_name': value['modelName'],
175
- 'oem_name': value['oemName'],
176
- 'id': value['id'],
177
182
  'codenames': value['codenames'],
183
+ 'featured_text': value['featuredText'],
184
+ 'full_name': value['fullName'],
185
+ 'id': value['id'],
186
+ 'is_featured': value['isFeatured'],
187
+ 'model_name': value['modelName'],
178
188
  'model_names': value['modelNames'],
189
+ 'oem_name': value['oemName'],
179
190
  'supported': value['supported'],
180
- 'is_featured': value['isFeatured'],
181
- 'featured_text': value['featuredText'],
182
- 'maintainer': MaintainerShortModelToJSON(value['maintainer']),
183
- 'notes': value['notes'],
191
+ 'url': value['url'],
184
192
  'device_tree': value['deviceTree'],
193
+ 'maintainer': MaintainerShortResponseToJSON(value['maintainer']),
194
+ 'notes': value['notes'],
185
195
  };
186
196
  }
187
197
 
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Fox API
5
+ * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
6
+ *
7
+ * The version of the OpenAPI document: 6.0.4
8
+ * Contact: admin@orangefox.tech
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ErrorResponse
20
+ */
21
+ export interface ErrorResponse {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ErrorResponse
26
+ */
27
+ detail: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ErrorResponse interface.
32
+ */
33
+ export function instanceOfErrorResponse(value: object): value is ErrorResponse {
34
+ if (!('detail' in value) || value['detail'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ErrorResponseFromJSON(json: any): ErrorResponse {
39
+ return ErrorResponseFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorResponse {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'detail': json['detail'],
49
+ };
50
+ }
51
+
52
+ export function ErrorResponseToJSON(json: any): ErrorResponse {
53
+ return ErrorResponseToJSONTyped(json, false);
54
+ }
55
+
56
+ export function ErrorResponseToJSONTyped(value?: ErrorResponse | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'detail': value['detail'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,93 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Fox API
5
+ * Warning: Please add a custom user agent header to your requests. This would help us fighting against DDoS attacks in future, while keeping your application\'s access to the API. In future, this may be a mandatory requirement. To reduce the system load, the API endpoints are rate limited. The default limit is 30 requests per minute. Contact admin@orangefox.tech if you need a higher limit. The requests may be logged for analytics and development purposes.
6
+ *
7
+ * The version of the OpenAPI document: 6.0.4
8
+ * Contact: admin@orangefox.tech
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface GlobalStatsResponse
20
+ */
21
+ export interface GlobalStatsResponse {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof GlobalStatsResponse
26
+ */
27
+ count: number;
28
+ /**
29
+ *
30
+ * @type {{ [key: string]: number; }}
31
+ * @memberof GlobalStatsResponse
32
+ */
33
+ days: { [key: string]: number; };
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof GlobalStatsResponse
38
+ */
39
+ deviceCount: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof GlobalStatsResponse
44
+ */
45
+ releaseCount: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the GlobalStatsResponse interface.
50
+ */
51
+ export function instanceOfGlobalStatsResponse(value: object): value is GlobalStatsResponse {
52
+ if (!('count' in value) || value['count'] === undefined) return false;
53
+ if (!('days' in value) || value['days'] === undefined) return false;
54
+ if (!('deviceCount' in value) || value['deviceCount'] === undefined) return false;
55
+ if (!('releaseCount' in value) || value['releaseCount'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function GlobalStatsResponseFromJSON(json: any): GlobalStatsResponse {
60
+ return GlobalStatsResponseFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function GlobalStatsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GlobalStatsResponse {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'count': json['count'],
70
+ 'days': json['days'],
71
+ 'deviceCount': json['deviceCount'],
72
+ 'releaseCount': json['releaseCount'],
73
+ };
74
+ }
75
+
76
+ export function GlobalStatsResponseToJSON(json: any): GlobalStatsResponse {
77
+ return GlobalStatsResponseToJSONTyped(json, false);
78
+ }
79
+
80
+ export function GlobalStatsResponseToJSONTyped(value?: GlobalStatsResponse | null, ignoreDiscriminator: boolean = false): any {
81
+ if (value == null) {
82
+ return value;
83
+ }
84
+
85
+ return {
86
+
87
+ 'count': value['count'],
88
+ 'days': value['days'],
89
+ 'deviceCount': value['deviceCount'],
90
+ 'releaseCount': value['releaseCount'],
91
+ };
92
+ }
93
+