@@ -23,72 +23,6 @@ import {
2323 sanitizeInput ,
2424} from "./common/utils.mjs" ;
2525
26- /**
27- * @typedef {Object } RequestConfig
28- * @property {string } endpoint
29- * @property {string } [method]
30- * @property {Record<string, unknown> } [params]
31- * @property {unknown } [data]
32- */
33-
34- /**
35- * @typedef {Object } ReviewsOptions
36- * @property {string } [endpoint]
37- * @property {string } [businessUnitId]
38- * @property {number|null } [stars]
39- * @property {string } [sortBy]
40- * @property {number } [limit]
41- * @property {number } [offset]
42- * @property {boolean } [includeReportedReviews]
43- * @property {string[] } [tags]
44- * @property {string|null } [language]
45- */
46-
47- /**
48- * @typedef {Object } PublicReviewsOptions
49- * @property {string } businessUnitId
50- * @property {number|null } [stars]
51- * @property {string } [sortBy]
52- * @property {number } [limit]
53- * @property {number } [offset]
54- * @property {string[] } [tags]
55- * @property {string|null } [language]
56- */
57-
58- /**
59- * @typedef {Object } ServiceReviewsOptions
60- * @property {string } [businessUnitId]
61- * @property {number|null } [stars]
62- * @property {string } [sortBy]
63- * @property {number } [limit]
64- * @property {number } [offset]
65- * @property {boolean } [includeReportedReviews]
66- * @property {string[] } [tags]
67- * @property {string|null } [language]
68- */
69-
70- /**
71- * @typedef {Object } ConversationsOptions
72- * @property {number } [limit]
73- * @property {number } [offset]
74- * @property {string } [sortBy]
75- * @property {string|null } [businessUnitId]
76- */
77-
78- /**
79- * @typedef {Object } WebhookOptions
80- * @property {string } url
81- * @property {string[] } events
82- * @property {string|null } [businessUnitId]
83- */
84-
85- /**
86- * @typedef {Object } WebhookData
87- * @property {string } url
88- * @property {string[] } events
89- * @property {string } [businessUnitId]
90- */
91-
9226export default defineApp ( {
9327 type : "app" ,
9428 app : "trustpilot" ,
@@ -219,7 +153,10 @@ export default defineApp({
219153 return await this . _makeRequest ( config ) ;
220154 } catch ( error ) {
221155 if ( retries > 0 && error . response ?. status === HTTP_STATUS . TOO_MANY_REQUESTS ) {
222- const delay = Math . min ( RETRY_CONFIG . INITIAL_DELAY * ( RETRY_CONFIG . MAX_RETRIES - retries + 1 ) , RETRY_CONFIG . MAX_DELAY ) ;
156+ const delay = Math . min (
157+ RETRY_CONFIG . INITIAL_DELAY * ( RETRY_CONFIG . MAX_RETRIES - retries + 1 ) ,
158+ RETRY_CONFIG . MAX_DELAY ,
159+ ) ;
223160 await sleep ( delay ) ;
224161 return this . _makeRequestWithRetry ( config , retries - 1 ) ;
225162 }
0 commit comments