@clickup/rest-client 2.10.292

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 (137) hide show
  1. package/.eslintrc.base.js +412 -0
  2. package/.eslintrc.js +5 -0
  3. package/LICENSE +22 -0
  4. package/README.md +121 -0
  5. package/dist/RestClient.d.ts +154 -0
  6. package/dist/RestClient.d.ts.map +1 -0
  7. package/dist/RestClient.js +361 -0
  8. package/dist/RestClient.js.map +1 -0
  9. package/dist/RestOptions.d.ts +143 -0
  10. package/dist/RestOptions.d.ts.map +1 -0
  11. package/dist/RestOptions.js +63 -0
  12. package/dist/RestOptions.js.map +1 -0
  13. package/dist/RestRequest.d.ts +81 -0
  14. package/dist/RestRequest.d.ts.map +1 -0
  15. package/dist/RestRequest.js +367 -0
  16. package/dist/RestRequest.js.map +1 -0
  17. package/dist/RestResponse.d.ts +37 -0
  18. package/dist/RestResponse.d.ts.map +1 -0
  19. package/dist/RestResponse.js +56 -0
  20. package/dist/RestResponse.js.map +1 -0
  21. package/dist/RestStream.d.ts +29 -0
  22. package/dist/RestStream.d.ts.map +1 -0
  23. package/dist/RestStream.js +85 -0
  24. package/dist/RestStream.js.map +1 -0
  25. package/dist/errors/RestContentSizeOverLimitError.d.ts +4 -0
  26. package/dist/errors/RestContentSizeOverLimitError.d.ts.map +1 -0
  27. package/dist/errors/RestContentSizeOverLimitError.js +10 -0
  28. package/dist/errors/RestContentSizeOverLimitError.js.map +1 -0
  29. package/dist/errors/RestError.d.ts +4 -0
  30. package/dist/errors/RestError.d.ts.map +1 -0
  31. package/dist/errors/RestError.js +10 -0
  32. package/dist/errors/RestError.js.map +1 -0
  33. package/dist/errors/RestRateLimitError.d.ts +7 -0
  34. package/dist/errors/RestRateLimitError.d.ts.map +1 -0
  35. package/dist/errors/RestRateLimitError.js +14 -0
  36. package/dist/errors/RestRateLimitError.js.map +1 -0
  37. package/dist/errors/RestResponseError.d.ts +13 -0
  38. package/dist/errors/RestResponseError.d.ts.map +1 -0
  39. package/dist/errors/RestResponseError.js +32 -0
  40. package/dist/errors/RestResponseError.js.map +1 -0
  41. package/dist/errors/RestRetriableError.d.ts +7 -0
  42. package/dist/errors/RestRetriableError.d.ts.map +1 -0
  43. package/dist/errors/RestRetriableError.js +14 -0
  44. package/dist/errors/RestRetriableError.js.map +1 -0
  45. package/dist/errors/RestTimeoutError.d.ts +4 -0
  46. package/dist/errors/RestTimeoutError.d.ts.map +1 -0
  47. package/dist/errors/RestTimeoutError.js +10 -0
  48. package/dist/errors/RestTimeoutError.js.map +1 -0
  49. package/dist/errors/RestTokenInvalidError.d.ts +7 -0
  50. package/dist/errors/RestTokenInvalidError.d.ts.map +1 -0
  51. package/dist/errors/RestTokenInvalidError.js +14 -0
  52. package/dist/errors/RestTokenInvalidError.js.map +1 -0
  53. package/dist/helpers/depaginate.d.ts +10 -0
  54. package/dist/helpers/depaginate.d.ts.map +1 -0
  55. package/dist/helpers/depaginate.js +32 -0
  56. package/dist/helpers/depaginate.js.map +1 -0
  57. package/dist/index.d.ts +20 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +42 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/internal/RestFetchReader.d.ts +72 -0
  62. package/dist/internal/RestFetchReader.d.ts.map +1 -0
  63. package/dist/internal/RestFetchReader.js +192 -0
  64. package/dist/internal/RestFetchReader.js.map +1 -0
  65. package/dist/internal/RestRangeUploader.d.ts +24 -0
  66. package/dist/internal/RestRangeUploader.d.ts.map +1 -0
  67. package/dist/internal/RestRangeUploader.js +54 -0
  68. package/dist/internal/RestRangeUploader.js.map +1 -0
  69. package/dist/internal/calcRetryDelay.d.ts +8 -0
  70. package/dist/internal/calcRetryDelay.d.ts.map +1 -0
  71. package/dist/internal/calcRetryDelay.js +44 -0
  72. package/dist/internal/calcRetryDelay.js.map +1 -0
  73. package/dist/internal/inspectPossibleJSON.d.ts +6 -0
  74. package/dist/internal/inspectPossibleJSON.d.ts.map +1 -0
  75. package/dist/internal/inspectPossibleJSON.js +53 -0
  76. package/dist/internal/inspectPossibleJSON.js.map +1 -0
  77. package/dist/internal/prependNewlineIfMultiline.d.ts +2 -0
  78. package/dist/internal/prependNewlineIfMultiline.d.ts.map +1 -0
  79. package/dist/internal/prependNewlineIfMultiline.js +7 -0
  80. package/dist/internal/prependNewlineIfMultiline.js.map +1 -0
  81. package/dist/internal/substituteParams.d.ts +7 -0
  82. package/dist/internal/substituteParams.d.ts.map +1 -0
  83. package/dist/internal/substituteParams.js +24 -0
  84. package/dist/internal/substituteParams.js.map +1 -0
  85. package/dist/internal/throwIfErrorResponse.d.ts +11 -0
  86. package/dist/internal/throwIfErrorResponse.d.ts.map +1 -0
  87. package/dist/internal/throwIfErrorResponse.js +60 -0
  88. package/dist/internal/throwIfErrorResponse.js.map +1 -0
  89. package/dist/internal/toFloatMs.d.ts +2 -0
  90. package/dist/internal/toFloatMs.d.ts.map +1 -0
  91. package/dist/internal/toFloatMs.js +7 -0
  92. package/dist/internal/toFloatMs.js.map +1 -0
  93. package/dist/middlewares/paceRequests.d.ts +9 -0
  94. package/dist/middlewares/paceRequests.d.ts.map +1 -0
  95. package/dist/middlewares/paceRequests.js +36 -0
  96. package/dist/middlewares/paceRequests.js.map +1 -0
  97. package/dist/pacers/Pacer.d.ts +21 -0
  98. package/dist/pacers/Pacer.d.ts.map +1 -0
  99. package/dist/pacers/Pacer.js +3 -0
  100. package/dist/pacers/Pacer.js.map +1 -0
  101. package/dist/pacers/PacerComposite.d.ts +14 -0
  102. package/dist/pacers/PacerComposite.d.ts.map +1 -0
  103. package/dist/pacers/PacerComposite.js +32 -0
  104. package/dist/pacers/PacerComposite.js.map +1 -0
  105. package/dist/pacers/PacerQPS.d.ts +53 -0
  106. package/dist/pacers/PacerQPS.d.ts.map +1 -0
  107. package/dist/pacers/PacerQPS.js +105 -0
  108. package/dist/pacers/PacerQPS.js.map +1 -0
  109. package/dist/tsconfig.tsbuildinfo +1 -0
  110. package/docs/.nojekyll +1 -0
  111. package/docs/README.md +123 -0
  112. package/docs/classes/PacerComposite.md +62 -0
  113. package/docs/classes/PacerQPS.md +75 -0
  114. package/docs/classes/RestClient.md +424 -0
  115. package/docs/classes/RestContentSizeOverLimitError.md +128 -0
  116. package/docs/classes/RestError.md +31 -0
  117. package/docs/classes/RestRateLimitError.md +139 -0
  118. package/docs/classes/RestRequest.md +257 -0
  119. package/docs/classes/RestResponse.md +110 -0
  120. package/docs/classes/RestResponseError.md +110 -0
  121. package/docs/classes/RestRetriableError.md +139 -0
  122. package/docs/classes/RestStream.md +92 -0
  123. package/docs/classes/RestTimeoutError.md +128 -0
  124. package/docs/classes/RestTokenInvalidError.md +138 -0
  125. package/docs/interfaces/Middleware.md +27 -0
  126. package/docs/interfaces/Pacer.md +40 -0
  127. package/docs/interfaces/PacerDelay.md +25 -0
  128. package/docs/interfaces/PacerQPSBackend.md +44 -0
  129. package/docs/interfaces/PacerQPSOptions.md +40 -0
  130. package/docs/interfaces/RestLogEvent.md +95 -0
  131. package/docs/interfaces/RestOptions.md +351 -0
  132. package/docs/interfaces/TokenGetter.md +34 -0
  133. package/docs/modules.md +87 -0
  134. package/jest.config.js +8 -0
  135. package/package.json +42 -0
  136. package/tsconfig.json +39 -0
  137. package/typedoc.json +17 -0
@@ -0,0 +1,139 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / RestRetriableError
2
+
3
+ # Class: RestRetriableError
4
+
5
+ ## Hierarchy
6
+
7
+ - [`RestResponseError`](RestResponseError.md)
8
+
9
+ ↳ **`RestRetriableError`**
10
+
11
+ ## Constructors
12
+
13
+ ### constructor
14
+
15
+ • **new RestRetriableError**(`message`, `delayMs`, `res`)
16
+
17
+ #### Parameters
18
+
19
+ | Name | Type |
20
+ | :------ | :------ |
21
+ | `message` | `string` |
22
+ | `delayMs` | `number` |
23
+ | `res` | [`RestResponse`](RestResponse.md) |
24
+
25
+ #### Overrides
26
+
27
+ [RestResponseError](RestResponseError.md).[constructor](RestResponseError.md#constructor)
28
+
29
+ #### Defined in
30
+
31
+ [src/errors/RestRetriableError.ts:5](https://github.com/clickup/rest-client/blob/master/src/errors/RestRetriableError.ts#L5)
32
+
33
+ ## Properties
34
+
35
+ ### res
36
+
37
+ • `Readonly` **res**: [`RestResponse`](RestResponse.md)
38
+
39
+ #### Inherited from
40
+
41
+ [RestResponseError](RestResponseError.md).[res](RestResponseError.md#res)
42
+
43
+ #### Defined in
44
+
45
+ [src/errors/RestResponseError.ts:10](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L10)
46
+
47
+ ___
48
+
49
+ ### method
50
+
51
+ • `Readonly` **method**: `string`
52
+
53
+ #### Inherited from
54
+
55
+ [RestResponseError](RestResponseError.md).[method](RestResponseError.md#method)
56
+
57
+ #### Defined in
58
+
59
+ [src/errors/RestResponseError.ts:12](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L12)
60
+
61
+ ___
62
+
63
+ ### host
64
+
65
+ • `Readonly` **host**: `string`
66
+
67
+ #### Inherited from
68
+
69
+ [RestResponseError](RestResponseError.md).[host](RestResponseError.md#host)
70
+
71
+ #### Defined in
72
+
73
+ [src/errors/RestResponseError.ts:13](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L13)
74
+
75
+ ___
76
+
77
+ ### pathname
78
+
79
+ • `Readonly` **pathname**: `string`
80
+
81
+ #### Inherited from
82
+
83
+ [RestResponseError](RestResponseError.md).[pathname](RestResponseError.md#pathname)
84
+
85
+ #### Defined in
86
+
87
+ [src/errors/RestResponseError.ts:14](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L14)
88
+
89
+ ___
90
+
91
+ ### requestArgs
92
+
93
+ • `Readonly` **requestArgs**: `string`
94
+
95
+ #### Inherited from
96
+
97
+ [RestResponseError](RestResponseError.md).[requestArgs](RestResponseError.md#requestargs)
98
+
99
+ #### Defined in
100
+
101
+ [src/errors/RestResponseError.ts:15](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L15)
102
+
103
+ ___
104
+
105
+ ### requestBody
106
+
107
+ • `Readonly` **requestBody**: `string`
108
+
109
+ #### Inherited from
110
+
111
+ [RestResponseError](RestResponseError.md).[requestBody](RestResponseError.md#requestbody)
112
+
113
+ #### Defined in
114
+
115
+ [src/errors/RestResponseError.ts:16](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L16)
116
+
117
+ ___
118
+
119
+ ### responseHeaders
120
+
121
+ • `Readonly` **responseHeaders**: `string`
122
+
123
+ #### Inherited from
124
+
125
+ [RestResponseError](RestResponseError.md).[responseHeaders](RestResponseError.md#responseheaders)
126
+
127
+ #### Defined in
128
+
129
+ [src/errors/RestResponseError.ts:17](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L17)
130
+
131
+ ___
132
+
133
+ ### delayMs
134
+
135
+ • **delayMs**: `number`
136
+
137
+ #### Defined in
138
+
139
+ [src/errors/RestRetriableError.ts:5](https://github.com/clickup/rest-client/blob/master/src/errors/RestRetriableError.ts#L5)
@@ -0,0 +1,92 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / RestStream
2
+
3
+ # Class: RestStream
4
+
5
+ Once created, RestStream must be iterated in full, otherwise the connection
6
+ will remain dangling. Also, this class is where we hide the details of the
7
+ actual stream reading using AsyncGenerator bridge abstraction.
8
+
9
+ ## Constructors
10
+
11
+ ### constructor
12
+
13
+ • **new RestStream**(`res`, `readerIterable`)
14
+
15
+ #### Parameters
16
+
17
+ | Name | Type |
18
+ | :------ | :------ |
19
+ | `res` | [`RestResponse`](RestResponse.md) |
20
+ | `readerIterable` | `Object` |
21
+ | `readerIterable.[asyncIterator]` | () => `AsyncGenerator`<`string`, `void`, `unknown`\> |
22
+
23
+ #### Defined in
24
+
25
+ [src/RestStream.ts:12](https://github.com/clickup/rest-client/blob/master/src/RestStream.ts#L12)
26
+
27
+ ## Properties
28
+
29
+ ### res
30
+
31
+ • `Readonly` **res**: [`RestResponse`](RestResponse.md)
32
+
33
+ #### Defined in
34
+
35
+ [src/RestStream.ts:13](https://github.com/clickup/rest-client/blob/master/src/RestStream.ts#L13)
36
+
37
+ ## Methods
38
+
39
+ ### consumeReturningPrefix
40
+
41
+ ▸ **consumeReturningPrefix**(`maxChars`): `Promise`<`string`\>
42
+
43
+ Reads the prefix of the stream. Closes the connection after the read is
44
+ done in all cases, so safe to be used to e.g. receive a trimmed response.
45
+
46
+ #### Parameters
47
+
48
+ | Name | Type |
49
+ | :------ | :------ |
50
+ | `maxChars` | `number` |
51
+
52
+ #### Returns
53
+
54
+ `Promise`<`string`\>
55
+
56
+ #### Defined in
57
+
58
+ [src/RestStream.ts:25](https://github.com/clickup/rest-client/blob/master/src/RestStream.ts#L25)
59
+
60
+ ___
61
+
62
+ ### close
63
+
64
+ ▸ **close**(): `Promise`<`void`\>
65
+
66
+ Closes the connection.
67
+
68
+ #### Returns
69
+
70
+ `Promise`<`void`\>
71
+
72
+ #### Defined in
73
+
74
+ [src/RestStream.ts:44](https://github.com/clickup/rest-client/blob/master/src/RestStream.ts#L44)
75
+
76
+ ___
77
+
78
+ ### [asyncIterator]
79
+
80
+ ▸ **[asyncIterator]**(): `AsyncGenerator`<`string`, `void`, `unknown`\>
81
+
82
+ Allows to iterate over the entire stream of data. You must consume the
83
+ entire iterable or at least call this.close(), otherwise the connection may
84
+ remain open.
85
+
86
+ #### Returns
87
+
88
+ `AsyncGenerator`<`string`, `void`, `unknown`\>
89
+
90
+ #### Defined in
91
+
92
+ [src/RestStream.ts:66](https://github.com/clickup/rest-client/blob/master/src/RestStream.ts#L66)
@@ -0,0 +1,128 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / RestTimeoutError
2
+
3
+ # Class: RestTimeoutError
4
+
5
+ ## Hierarchy
6
+
7
+ - [`RestResponseError`](RestResponseError.md)
8
+
9
+ ↳ **`RestTimeoutError`**
10
+
11
+ ## Constructors
12
+
13
+ ### constructor
14
+
15
+ • **new RestTimeoutError**(`message`, `res`)
16
+
17
+ #### Parameters
18
+
19
+ | Name | Type |
20
+ | :------ | :------ |
21
+ | `message` | `string` |
22
+ | `res` | [`RestResponse`](RestResponse.md) |
23
+
24
+ #### Inherited from
25
+
26
+ [RestResponseError](RestResponseError.md).[constructor](RestResponseError.md#constructor)
27
+
28
+ #### Defined in
29
+
30
+ [src/errors/RestResponseError.ts:19](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L19)
31
+
32
+ ## Properties
33
+
34
+ ### res
35
+
36
+ • `Readonly` **res**: [`RestResponse`](RestResponse.md)
37
+
38
+ #### Inherited from
39
+
40
+ [RestResponseError](RestResponseError.md).[res](RestResponseError.md#res)
41
+
42
+ #### Defined in
43
+
44
+ [src/errors/RestResponseError.ts:10](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L10)
45
+
46
+ ___
47
+
48
+ ### method
49
+
50
+ • `Readonly` **method**: `string`
51
+
52
+ #### Inherited from
53
+
54
+ [RestResponseError](RestResponseError.md).[method](RestResponseError.md#method)
55
+
56
+ #### Defined in
57
+
58
+ [src/errors/RestResponseError.ts:12](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L12)
59
+
60
+ ___
61
+
62
+ ### host
63
+
64
+ • `Readonly` **host**: `string`
65
+
66
+ #### Inherited from
67
+
68
+ [RestResponseError](RestResponseError.md).[host](RestResponseError.md#host)
69
+
70
+ #### Defined in
71
+
72
+ [src/errors/RestResponseError.ts:13](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L13)
73
+
74
+ ___
75
+
76
+ ### pathname
77
+
78
+ • `Readonly` **pathname**: `string`
79
+
80
+ #### Inherited from
81
+
82
+ [RestResponseError](RestResponseError.md).[pathname](RestResponseError.md#pathname)
83
+
84
+ #### Defined in
85
+
86
+ [src/errors/RestResponseError.ts:14](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L14)
87
+
88
+ ___
89
+
90
+ ### requestArgs
91
+
92
+ • `Readonly` **requestArgs**: `string`
93
+
94
+ #### Inherited from
95
+
96
+ [RestResponseError](RestResponseError.md).[requestArgs](RestResponseError.md#requestargs)
97
+
98
+ #### Defined in
99
+
100
+ [src/errors/RestResponseError.ts:15](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L15)
101
+
102
+ ___
103
+
104
+ ### requestBody
105
+
106
+ • `Readonly` **requestBody**: `string`
107
+
108
+ #### Inherited from
109
+
110
+ [RestResponseError](RestResponseError.md).[requestBody](RestResponseError.md#requestbody)
111
+
112
+ #### Defined in
113
+
114
+ [src/errors/RestResponseError.ts:16](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L16)
115
+
116
+ ___
117
+
118
+ ### responseHeaders
119
+
120
+ • `Readonly` **responseHeaders**: `string`
121
+
122
+ #### Inherited from
123
+
124
+ [RestResponseError](RestResponseError.md).[responseHeaders](RestResponseError.md#responseheaders)
125
+
126
+ #### Defined in
127
+
128
+ [src/errors/RestResponseError.ts:17](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L17)
@@ -0,0 +1,138 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / RestTokenInvalidError
2
+
3
+ # Class: RestTokenInvalidError
4
+
5
+ ## Hierarchy
6
+
7
+ - [`RestResponseError`](RestResponseError.md)
8
+
9
+ ↳ **`RestTokenInvalidError`**
10
+
11
+ ## Constructors
12
+
13
+ ### constructor
14
+
15
+ • **new RestTokenInvalidError**(`humanReason`, `res`)
16
+
17
+ #### Parameters
18
+
19
+ | Name | Type |
20
+ | :------ | :------ |
21
+ | `humanReason` | `string` |
22
+ | `res` | [`RestResponse`](RestResponse.md) |
23
+
24
+ #### Overrides
25
+
26
+ [RestResponseError](RestResponseError.md).[constructor](RestResponseError.md#constructor)
27
+
28
+ #### Defined in
29
+
30
+ [src/errors/RestTokenInvalidError.ts:5](https://github.com/clickup/rest-client/blob/master/src/errors/RestTokenInvalidError.ts#L5)
31
+
32
+ ## Properties
33
+
34
+ ### res
35
+
36
+ • `Readonly` **res**: [`RestResponse`](RestResponse.md)
37
+
38
+ #### Inherited from
39
+
40
+ [RestResponseError](RestResponseError.md).[res](RestResponseError.md#res)
41
+
42
+ #### Defined in
43
+
44
+ [src/errors/RestResponseError.ts:10](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L10)
45
+
46
+ ___
47
+
48
+ ### method
49
+
50
+ • `Readonly` **method**: `string`
51
+
52
+ #### Inherited from
53
+
54
+ [RestResponseError](RestResponseError.md).[method](RestResponseError.md#method)
55
+
56
+ #### Defined in
57
+
58
+ [src/errors/RestResponseError.ts:12](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L12)
59
+
60
+ ___
61
+
62
+ ### host
63
+
64
+ • `Readonly` **host**: `string`
65
+
66
+ #### Inherited from
67
+
68
+ [RestResponseError](RestResponseError.md).[host](RestResponseError.md#host)
69
+
70
+ #### Defined in
71
+
72
+ [src/errors/RestResponseError.ts:13](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L13)
73
+
74
+ ___
75
+
76
+ ### pathname
77
+
78
+ • `Readonly` **pathname**: `string`
79
+
80
+ #### Inherited from
81
+
82
+ [RestResponseError](RestResponseError.md).[pathname](RestResponseError.md#pathname)
83
+
84
+ #### Defined in
85
+
86
+ [src/errors/RestResponseError.ts:14](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L14)
87
+
88
+ ___
89
+
90
+ ### requestArgs
91
+
92
+ • `Readonly` **requestArgs**: `string`
93
+
94
+ #### Inherited from
95
+
96
+ [RestResponseError](RestResponseError.md).[requestArgs](RestResponseError.md#requestargs)
97
+
98
+ #### Defined in
99
+
100
+ [src/errors/RestResponseError.ts:15](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L15)
101
+
102
+ ___
103
+
104
+ ### requestBody
105
+
106
+ • `Readonly` **requestBody**: `string`
107
+
108
+ #### Inherited from
109
+
110
+ [RestResponseError](RestResponseError.md).[requestBody](RestResponseError.md#requestbody)
111
+
112
+ #### Defined in
113
+
114
+ [src/errors/RestResponseError.ts:16](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L16)
115
+
116
+ ___
117
+
118
+ ### responseHeaders
119
+
120
+ • `Readonly` **responseHeaders**: `string`
121
+
122
+ #### Inherited from
123
+
124
+ [RestResponseError](RestResponseError.md).[responseHeaders](RestResponseError.md#responseheaders)
125
+
126
+ #### Defined in
127
+
128
+ [src/errors/RestResponseError.ts:17](https://github.com/clickup/rest-client/blob/master/src/errors/RestResponseError.ts#L17)
129
+
130
+ ___
131
+
132
+ ### humanReason
133
+
134
+ • `Readonly` **humanReason**: `string`
135
+
136
+ #### Defined in
137
+
138
+ [src/errors/RestTokenInvalidError.ts:5](https://github.com/clickup/rest-client/blob/master/src/errors/RestTokenInvalidError.ts#L5)
@@ -0,0 +1,27 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / Middleware
2
+
3
+ # Interface: Middleware
4
+
5
+ Middlewares allow to modify RestRequest and RestResponse objects during the
6
+ request processing.
7
+
8
+ ## Callable
9
+
10
+ ### Middleware
11
+
12
+ ▸ **Middleware**(`req`, `next`): `Promise`<[`RestResponse`](../classes/RestResponse.md)\>
13
+
14
+ #### Parameters
15
+
16
+ | Name | Type |
17
+ | :------ | :------ |
18
+ | `req` | [`RestRequest`](../classes/RestRequest.md)<`any`\> |
19
+ | `next` | (`req`: [`RestRequest`](../classes/RestRequest.md)<`any`\>) => `Promise`<[`RestResponse`](../classes/RestResponse.md)\> |
20
+
21
+ #### Returns
22
+
23
+ `Promise`<[`RestResponse`](../classes/RestResponse.md)\>
24
+
25
+ #### Defined in
26
+
27
+ [src/RestOptions.ts:28](https://github.com/clickup/rest-client/blob/master/src/RestOptions.ts#L28)
@@ -0,0 +1,40 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / Pacer
2
+
3
+ # Interface: Pacer
4
+
5
+ Pacer is a class which allows to pace requests on some resource identified by
6
+ the instance of this class.
7
+
8
+ ## Implemented by
9
+
10
+ - [`PacerComposite`](../classes/PacerComposite.md)
11
+ - [`PacerQPS`](../classes/PacerQPS.md)
12
+
13
+ ## Properties
14
+
15
+ ### name
16
+
17
+ • `Readonly` **name**: `string`
18
+
19
+ Human readable name of the pacer, used when composing multiple pacers.
20
+
21
+ #### Defined in
22
+
23
+ [src/pacers/Pacer.ts:15](https://github.com/clickup/rest-client/blob/master/src/pacers/Pacer.ts#L15)
24
+
25
+ ## Methods
26
+
27
+ ### touch
28
+
29
+ ▸ **touch**(): `Promise`<[`PacerDelay`](PacerDelay.md)\>
30
+
31
+ Signals that we're about to send a request. Returns the delay we need to
32
+ wait for before actually sending.
33
+
34
+ #### Returns
35
+
36
+ `Promise`<[`PacerDelay`](PacerDelay.md)\>
37
+
38
+ #### Defined in
39
+
40
+ [src/pacers/Pacer.ts:21](https://github.com/clickup/rest-client/blob/master/src/pacers/Pacer.ts#L21)
@@ -0,0 +1,25 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / PacerDelay
2
+
3
+ # Interface: PacerDelay
4
+
5
+ A result of some Pacer work.
6
+
7
+ ## Properties
8
+
9
+ ### delayMs
10
+
11
+ • **delayMs**: `number`
12
+
13
+ #### Defined in
14
+
15
+ [src/pacers/Pacer.ts:5](https://github.com/clickup/rest-client/blob/master/src/pacers/Pacer.ts#L5)
16
+
17
+ ___
18
+
19
+ ### reason
20
+
21
+ • **reason**: `string`
22
+
23
+ #### Defined in
24
+
25
+ [src/pacers/Pacer.ts:6](https://github.com/clickup/rest-client/blob/master/src/pacers/Pacer.ts#L6)
@@ -0,0 +1,44 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / PacerQPSBackend
2
+
3
+ # Interface: PacerQPSBackend
4
+
5
+ ## Properties
6
+
7
+ ### key
8
+
9
+ • `Readonly` **key**: `string`
10
+
11
+ Resource key which this backend is operating on.
12
+
13
+ #### Defined in
14
+
15
+ [src/pacers/PacerQPS.ts:33](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerQPS.ts#L33)
16
+
17
+ ## Methods
18
+
19
+ ### push
20
+
21
+ ▸ **push**(`props`): `Promise`<{ `count`: `number` ; `sum`: `number` ; `avg`: `number` ; `median`: `number` }\>
22
+
23
+ Maintains the array of numbers somewhere in memory (time-value pairs),
24
+ inserts a new time-value pair to the end of this list, and removes all the
25
+ entries which are earlier than `minTime`. Returns the size of the resulting
26
+ array and some central tendency statistics about its values.
27
+
28
+ #### Parameters
29
+
30
+ | Name | Type |
31
+ | :------ | :------ |
32
+ | `props` | `Object` |
33
+ | `props.time` | `number` |
34
+ | `props.minTime` | `number` |
35
+ | `props.value` | `number` |
36
+ | `props.minCountForCentralTendency` | `number` |
37
+
38
+ #### Returns
39
+
40
+ `Promise`<{ `count`: `number` ; `sum`: `number` ; `avg`: `number` ; `median`: `number` }\>
41
+
42
+ #### Defined in
43
+
44
+ [src/pacers/PacerQPS.ts:41](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerQPS.ts#L41)
@@ -0,0 +1,40 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / PacerQPSOptions
2
+
3
+ # Interface: PacerQPSOptions
4
+
5
+ ## Properties
6
+
7
+ ### qps
8
+
9
+ • **qps**: `number`
10
+
11
+ The maximum QPS allowed within the rolling window.
12
+
13
+ #### Defined in
14
+
15
+ [src/pacers/PacerQPS.ts:51](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerQPS.ts#L51)
16
+
17
+ ___
18
+
19
+ ### windowSec
20
+
21
+ • `Optional` **windowSec**: `number`
22
+
23
+ The length of the rolling windows in milliseconds.
24
+
25
+ #### Defined in
26
+
27
+ [src/pacers/PacerQPS.ts:53](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerQPS.ts#L53)
28
+
29
+ ___
30
+
31
+ ### decreaseThreshold
32
+
33
+ • `Optional` **decreaseThreshold**: `number`
34
+
35
+ Decrease the delay if the number of requests in the window has dropped
36
+ below `decreaseThreshold` portion of the limit.
37
+
38
+ #### Defined in
39
+
40
+ [src/pacers/PacerQPS.ts:56](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerQPS.ts#L56)