@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,2 @@
1
+ export default function toFloatMs(elapsed: [number, number]): number;
2
+ //# sourceMappingURL=toFloatMs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toFloatMs.d.ts","sourceRoot":"","sources":["../../src/internal/toFloatMs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,UAE1D"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function toFloatMs(elapsed) {
4
+ return elapsed[0] * 1e3 + elapsed[1] / 1e6;
5
+ }
6
+ exports.default = toFloatMs;
7
+ //# sourceMappingURL=toFloatMs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toFloatMs.js","sourceRoot":"","sources":["../../src/internal/toFloatMs.ts"],"names":[],"mappings":";;AAAA,SAAwB,SAAS,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC7C,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,9 @@
1
+ import type Pacer from "../pacers/Pacer";
2
+ import type { Middleware } from "../RestOptions";
3
+ import type RestRequest from "../RestRequest";
4
+ /**
5
+ * Rest Client middleware that adds some delay between requests using one of
6
+ * Pacer implementations.
7
+ */
8
+ export default function paceRequests(pacer: Pacer | ((req: RestRequest) => Promise<Pacer | null>) | null): Middleware;
9
+ //# sourceMappingURL=paceRequests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paceRequests.d.ts","sourceRoot":"","sources":["../../src/middlewares/paceRequests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAI9C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,GAClE,UAAU,CA6BZ"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const MIN_LOG_DELAY_MS = 10;
4
+ /**
5
+ * Rest Client middleware that adds some delay between requests using one of
6
+ * Pacer implementations.
7
+ */
8
+ function paceRequests(pacer) {
9
+ return async (req, next) => {
10
+ if (typeof pacer === "function") {
11
+ pacer = await pacer(req);
12
+ }
13
+ if (pacer) {
14
+ const { delayMs, reason } = await pacer.touch();
15
+ if (delayMs > 0) {
16
+ await req.options.heartbeater.delay(delayMs);
17
+ }
18
+ if (delayMs > MIN_LOG_DELAY_MS) {
19
+ req.options.logger({
20
+ attempt: 0,
21
+ req,
22
+ res: "backoff_delay",
23
+ exception: null,
24
+ timestamp: Date.now(),
25
+ elapsed: delayMs,
26
+ isFinalAttempt: true,
27
+ privateDataInResponse: false,
28
+ comment: reason,
29
+ });
30
+ }
31
+ }
32
+ return next(req);
33
+ };
34
+ }
35
+ exports.default = paceRequests;
36
+ //# sourceMappingURL=paceRequests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paceRequests.js","sourceRoot":"","sources":["../../src/middlewares/paceRequests.ts"],"names":[],"mappings":";;AAIA,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B;;;GAGG;AACH,SAAwB,YAAY,CAClC,KAAmE;IAEnE,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC/B,KAAK,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;SAC1B;QAED,IAAI,KAAK,EAAE;YACT,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;YAChD,IAAI,OAAO,GAAG,CAAC,EAAE;gBACf,MAAM,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aAC9C;YAED,IAAI,OAAO,GAAG,gBAAgB,EAAE;gBAC9B,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;oBACjB,OAAO,EAAE,CAAC;oBACV,GAAG;oBACH,GAAG,EAAE,eAAe;oBACpB,SAAS,EAAE,IAAI;oBACf,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,OAAO,EAAE,OAAO;oBAChB,cAAc,EAAE,IAAI;oBACpB,qBAAqB,EAAE,KAAK;oBAC5B,OAAO,EAAE,MAAM;iBAChB,CAAC,CAAC;aACJ;SACF;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC;AA/BD,+BA+BC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A result of some Pacer work.
3
+ */
4
+ export interface PacerDelay {
5
+ delayMs: number;
6
+ reason: string;
7
+ }
8
+ /**
9
+ * Pacer is a class which allows to pace requests on some resource identified by
10
+ * the instance of this class.
11
+ */
12
+ export default interface Pacer {
13
+ /** Human readable name of the pacer, used when composing multiple pacers. */
14
+ readonly name: string;
15
+ /**
16
+ * Signals that we're about to send a request. Returns the delay we need to
17
+ * wait for before actually sending.
18
+ */
19
+ touch(): Promise<PacerDelay>;
20
+ }
21
+ //# sourceMappingURL=Pacer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pacer.d.ts","sourceRoot":"","sources":["../../src/pacers/Pacer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,KAAK;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Pacer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pacer.js","sourceRoot":"","sources":["../../src/pacers/Pacer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type Pacer from "./Pacer";
2
+ /**
3
+ * A Pacer which runs all sub-pacers and chooses the largest delay.
4
+ */
5
+ export default class PacerComposite implements Pacer {
6
+ private _pacers;
7
+ readonly name = "";
8
+ constructor(_pacers: Pacer[]);
9
+ touch(): Promise<{
10
+ reason: string;
11
+ delayMs: number;
12
+ }>;
13
+ }
14
+ //# sourceMappingURL=PacerComposite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacerComposite.d.ts","sourceRoot":"","sources":["../../src/pacers/PacerComposite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,KAAK;IAGtC,OAAO,CAAC,OAAO;IAF3B,QAAQ,CAAC,IAAI,MAAM;gBAEC,OAAO,EAAE,KAAK,EAAE;IAE9B,KAAK;;;;CAiBZ"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const maxBy_1 = __importDefault(require("lodash/maxBy"));
7
+ /**
8
+ * A Pacer which runs all sub-pacers and chooses the largest delay.
9
+ */
10
+ class PacerComposite {
11
+ constructor(_pacers) {
12
+ this._pacers = _pacers;
13
+ this.name = "";
14
+ }
15
+ async touch() {
16
+ const delays = await Promise["all"](this._pacers.map(async (pacer) => ({
17
+ pacer,
18
+ delay: await pacer.touch(),
19
+ })));
20
+ const pair = (0, maxBy_1.default)(delays, ({ delay }) => delay.delayMs);
21
+ return pair
22
+ ? {
23
+ ...pair.delay,
24
+ reason: pair.pacer.name
25
+ ? `${pair.pacer.constructor.name} ${pair.pacer.name}\n${pair.delay.reason}`
26
+ : pair.delay.reason,
27
+ }
28
+ : { delayMs: 0, reason: "no pacers" };
29
+ }
30
+ }
31
+ exports.default = PacerComposite;
32
+ //# sourceMappingURL=PacerComposite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacerComposite.js","sourceRoot":"","sources":["../../src/pacers/PacerComposite.ts"],"names":[],"mappings":";;;;;AAAA,yDAAiC;AAGjC;;GAEG;AACH,MAAqB,cAAc;IAGjC,YAAoB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;QAF3B,SAAI,GAAG,EAAE,CAAC;IAEoB,CAAC;IAExC,KAAK,CAAC,KAAK;QACT,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,CACjC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACjC,KAAK;YACL,KAAK,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE;SAC3B,CAAC,CAAC,CACJ,CAAC;QACF,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,IAAI;YACT,CAAC,CAAC;gBACE,GAAG,IAAI,CAAC,KAAK;gBACb,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;oBACrB,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBAC3E,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;aACtB;YACH,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC1C,CAAC;CACF;AAtBD,iCAsBC"}
@@ -0,0 +1,53 @@
1
+ import type { PacerDelay } from "./Pacer";
2
+ import type Pacer from "./Pacer";
3
+ export interface PacerQPSBackend {
4
+ /** Resource key which this backend is operating on. */
5
+ readonly key: string;
6
+ /**
7
+ * Maintains the array of numbers somewhere in memory (time-value pairs),
8
+ * inserts a new time-value pair to the end of this list, and removes all the
9
+ * entries which are earlier than `minTime`. Returns the size of the resulting
10
+ * array and some central tendency statistics about its values.
11
+ */
12
+ push(props: {
13
+ time: number;
14
+ minTime: number;
15
+ value: number;
16
+ minCountForCentralTendency: number;
17
+ }): Promise<{
18
+ count: number;
19
+ sum: number;
20
+ avg: number;
21
+ median: number;
22
+ }>;
23
+ }
24
+ export interface PacerQPSOptions {
25
+ /** The maximum QPS allowed within the rolling window. */
26
+ qps: number;
27
+ /** The length of the rolling windows in milliseconds. */
28
+ windowSec?: number;
29
+ /** Decrease the delay if the number of requests in the window has dropped
30
+ * below `decreaseThreshold` portion of the limit. */
31
+ decreaseThreshold?: number;
32
+ }
33
+ /**
34
+ * Implements a very simple heuristic:
35
+ * - increase the delay if we're above the QPS within the rolling window;
36
+ * - decrease the delay if we're below the desired QPS.
37
+ *
38
+ * Each worker keeps (and grows/shrinks) its delay individually; this way, we
39
+ * don't need to elect, who's the "source of truth" for the delay.
40
+ *
41
+ * Backend is a concrete (and minimal) implementation of the storage logic for
42
+ * the pacing algorithm.
43
+ */
44
+ export default class PacerQPS implements Pacer {
45
+ private _options;
46
+ private _backend;
47
+ private _isFirstTouch;
48
+ private _delay;
49
+ constructor(_options: PacerQPSOptions, _backend: PacerQPSBackend);
50
+ get name(): string;
51
+ touch(): Promise<PacerDelay>;
52
+ }
53
+ //# sourceMappingURL=PacerQPS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacerQPS.d.ts","sourceRoot":"","sources":["../../src/pacers/PacerQPS.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AA4BjC,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,0BAA0B,EAAE,MAAM,CAAC;KACpC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1E;AAED,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;yDACqD;IACrD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,KAAK;IAK1C,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ;IALlB,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,MAAM,CAAK;gBAGT,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,eAAe;IAGnC,IAAI,IAAI,WAEP;IAEK,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC;CAgEnC"}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const random_1 = __importDefault(require("lodash/random"));
7
+ /** Start decreasing the delay (and thus speeding up requests) only when we have
8
+ * less requests in the moving window than allowed by the desired QPS multiplied
9
+ * by this factor. I.e. we don't speed up immediately when we're slow; we wait
10
+ * until we're SLIGHTLY below the limits. */
11
+ const DEFAULT_DECREASE_THRESHOLD = 0.75;
12
+ /** Default moving window length. */
13
+ const DEFAULT_WINDOW_SEC = 30;
14
+ /** Below how many samples do we stop relying on samples to recalculate the
15
+ * current fleet's average delay and instead keep using the previously
16
+ * calculated (and saved) value for the delay. E.g. it doesn't make much sense
17
+ * to rely on an average of 3-4 samples to calculate the average delay, it makes
18
+ * sense to wait for more samples to come. */
19
+ const MIN_COUNT_FOR_CENTRAL_TENDENCY = 10;
20
+ /** The value here is multiplied by the fleet average to get the delay
21
+ * increment/decrement step. It basically determines, in how many increments
22
+ * would a "cold started" worker reach the current fleet's average delay. Or, in
23
+ * how many steps would it reach delay=0 situation from the current fleet's
24
+ * average if needed. */
25
+ const DELAY_AVG_TO_STEP_FACTOR = 0.02;
26
+ /** Delay increments are jittered by +/- this proportion. */
27
+ const DELAY_STEP_JITTER = 0.1;
28
+ /**
29
+ * Implements a very simple heuristic:
30
+ * - increase the delay if we're above the QPS within the rolling window;
31
+ * - decrease the delay if we're below the desired QPS.
32
+ *
33
+ * Each worker keeps (and grows/shrinks) its delay individually; this way, we
34
+ * don't need to elect, who's the "source of truth" for the delay.
35
+ *
36
+ * Backend is a concrete (and minimal) implementation of the storage logic for
37
+ * the pacing algorithm.
38
+ */
39
+ class PacerQPS {
40
+ constructor(_options, _backend) {
41
+ this._options = _options;
42
+ this._backend = _backend;
43
+ this._isFirstTouch = true;
44
+ this._delay = 0;
45
+ }
46
+ get name() {
47
+ return this._backend.key;
48
+ }
49
+ async touch() {
50
+ var _a, _b;
51
+ const windowSec = (_a = this._options.windowSec) !== null && _a !== void 0 ? _a : DEFAULT_WINDOW_SEC;
52
+ const limit = Math.round(windowSec * this._options.qps);
53
+ const decreaseThreshold = (_b = this._options.decreaseThreshold) !== null && _b !== void 0 ? _b : DEFAULT_DECREASE_THRESHOLD;
54
+ const time = Date.now();
55
+ const delayPushed = this._delay;
56
+ const { count, sum, avg, median } = await this._backend.push({
57
+ time,
58
+ minTime: time - windowSec * 1000,
59
+ value: this._delay,
60
+ minCountForCentralTendency: MIN_COUNT_FOR_CENTRAL_TENDENCY,
61
+ });
62
+ const sumDivCount = count ? sum / count : 0;
63
+ // "Cold start": start with the fleet average delay.
64
+ if (this._isFirstTouch && this._delay === 0) {
65
+ this._delay = Math.round(avg);
66
+ this._isFirstTouch = false;
67
+ }
68
+ // If we imagine there is only 1 worker in the fleet, what would be its
69
+ // delay increment/decrement step. We use this number in a fallback
70
+ // situation, when we don't know much about the entire fleet average delay
71
+ // yet, or when this delay is too small to count on.
72
+ const singleWorkerDelayStepMs = Math.round(((windowSec * 1000) / limit) * DELAY_AVG_TO_STEP_FACTOR);
73
+ // Considering that there are multiple workers running, and that the current
74
+ // average fleet's delay is representative, what would be a delay increment
75
+ // to reach from delay=0 to that fleet's average delay.
76
+ const multiWorkerDelayStepMs = Math.round(avg *
77
+ DELAY_AVG_TO_STEP_FACTOR *
78
+ (0, random_1.default)(1 - DELAY_STEP_JITTER, 1 + DELAY_STEP_JITTER, true));
79
+ // If average fleet delay is not representative yet, we fallback to a
80
+ // single-worker delay increment.
81
+ const delayStepMs = multiWorkerDelayStepMs || singleWorkerDelayStepMs || 1;
82
+ if (count > limit) {
83
+ // Increase the delay if the limit is reached. There is no "max delay":
84
+ // imagine we have 10 QPS limit and 10000 users; it's obvious that in this
85
+ // case, the delay between requests per a single user will be gigantic.
86
+ this._delay += delayStepMs;
87
+ }
88
+ else if (count < limit * decreaseThreshold) {
89
+ // Decrease the delay if we're significantly under the limit.
90
+ this._delay = Math.max(0, this._delay - delayStepMs);
91
+ }
92
+ return {
93
+ delayMs: this._delay,
94
+ reason: [
95
+ `count=${count} per ${windowSec}s (limit=${limit})`,
96
+ `delay=${this._delay} step=${delayStepMs} delayPushed=${delayPushed}`,
97
+ `median=${Math.round(median)}`,
98
+ `sum/count=${Math.round(sumDivCount)}`,
99
+ `avg=${Math.round(avg)}`,
100
+ ].join("\n"),
101
+ };
102
+ }
103
+ }
104
+ exports.default = PacerQPS;
105
+ //# sourceMappingURL=PacerQPS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacerQPS.js","sourceRoot":"","sources":["../../src/pacers/PacerQPS.ts"],"names":[],"mappings":";;;;;AAAA,2DAAmC;AAInC;;;4CAG4C;AAC5C,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAExC,oCAAoC;AACpC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;;6CAI6C;AAC7C,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C;;;;yBAIyB;AACzB,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,4DAA4D;AAC5D,MAAM,iBAAiB,GAAG,GAAG,CAAC;AA8B9B;;;;;;;;;;GAUG;AACH,MAAqB,QAAQ;IAI3B,YACU,QAAyB,EACzB,QAAyB;QADzB,aAAQ,GAAR,QAAQ,CAAiB;QACzB,aAAQ,GAAR,QAAQ,CAAiB;QAL3B,kBAAa,GAAG,IAAI,CAAC;QACrB,WAAM,GAAG,CAAC,CAAC;IAKhB,CAAC;IAEJ,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,KAAK;;QACT,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,QAAQ,CAAC,SAAS,mCAAI,kBAAkB,CAAC;QAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,iBAAiB,GACrB,MAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,mCAAI,0BAA0B,CAAC;QAEhE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3D,IAAI;YACJ,OAAO,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI;YAChC,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,0BAA0B,EAAE,8BAA8B;SAC3D,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5C,oDAAoD;QACpD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;SAC5B;QAED,uEAAuE;QACvE,mEAAmE;QACnE,0EAA0E;QAC1E,oDAAoD;QACpD,MAAM,uBAAuB,GAAG,IAAI,CAAC,KAAK,CACxC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,wBAAwB,CACxD,CAAC;QAEF,4EAA4E;QAC5E,2EAA2E;QAC3E,uDAAuD;QACvD,MAAM,sBAAsB,GAAG,IAAI,CAAC,KAAK,CACvC,GAAG;YACD,wBAAwB;YACxB,IAAA,gBAAM,EAAC,CAAC,GAAG,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,EAAE,IAAI,CAAC,CAC7D,CAAC;QAEF,qEAAqE;QACrE,iCAAiC;QACjC,MAAM,WAAW,GAAG,sBAAsB,IAAI,uBAAuB,IAAI,CAAC,CAAC;QAE3E,IAAI,KAAK,GAAG,KAAK,EAAE;YACjB,uEAAuE;YACvE,0EAA0E;YAC1E,uEAAuE;YACvE,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC;SAC5B;aAAM,IAAI,KAAK,GAAG,KAAK,GAAG,iBAAiB,EAAE;YAC5C,6DAA6D;YAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC;SACtD;QAED,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,MAAM,EAAE;gBACN,SAAS,KAAK,QAAQ,SAAS,YAAY,KAAK,GAAG;gBACnD,SAAS,IAAI,CAAC,MAAM,SAAS,WAAW,gBAAgB,WAAW,EAAE;gBACrE,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBAC9B,aAAa,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;gBACtC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;aACzB,CAAC,IAAI,CAAC,IAAI,CAAC;SACb,CAAC;IACJ,CAAC;CACF;AA7ED,2BA6EC"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../node_modules/@types/lodash/isundefined.d.ts","../node_modules/@types/lodash/omitby.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/form-data/index.d.ts","../node_modules/@types/node-fetch/externals.d.ts","../node_modules/@types/node-fetch/index.d.ts","../node_modules/oauth-1.0a/oauth-1.0a.d.ts","../node_modules/fast-typescript-memoize/dist/memoize.d.ts","../node_modules/fast-typescript-memoize/dist/memoize0.d.ts","../node_modules/fast-typescript-memoize/dist/memoize2.d.ts","../node_modules/fast-typescript-memoize/dist/memoizeexpireunused.d.ts","../node_modules/fast-typescript-memoize/dist/index.d.ts","../node_modules/ipaddr.js/lib/ipaddr.js.d.ts","../node_modules/@types/lodash/random.d.ts","../node_modules/@types/lodash/sortby.d.ts","../node_modules/@types/lodash/truncate.d.ts","../src/internal/inspectpossiblejson.ts","../src/internal/prependnewlineifmultiline.ts","../src/errors/resterror.ts","../src/errors/restresponseerror.ts","../src/errors/restcontentsizeoverlimiterror.ts","../src/errors/resttimeouterror.ts","../src/errors/restratelimiterror.ts","../src/errors/restretriableerror.ts","../node_modules/delay/index.d.ts","../src/restoptions.ts","../src/internal/calcretrydelay.ts","../node_modules/event-target-shim/index.d.ts","../node_modules/abort-controller/dist/abort-controller.d.ts","../src/internal/restfetchreader.ts","../src/internal/throwiferrorresponse.ts","../src/internal/tofloatms.ts","../src/reststream.ts","../src/restrequest.ts","../src/restresponse.ts","../src/errors/resttokeninvaliderror.ts","../src/internal/restrangeuploader.ts","../src/internal/substituteparams.ts","../src/restclient.ts","../src/helpers/depaginate.ts","../src/pacers/pacer.ts","../src/middlewares/pacerequests.ts","../node_modules/@types/lodash/maxby.d.ts","../src/pacers/pacercomposite.ts","../src/pacers/pacerqps.ts","../src/index.ts","../src/__tests__/restclient.test.ts","../src/__tests__/helpers.ts","../src/__tests__/restfetchreader.test.ts","../src/__tests__/restrequest.test.ts","../src/__tests__/reststream.test.ts","../node_modules/superstruct/lib/error.d.ts","../node_modules/superstruct/lib/utils.d.ts","../node_modules/superstruct/lib/struct.d.ts","../node_modules/superstruct/lib/structs/coercions.d.ts","../node_modules/superstruct/lib/structs/refinements.d.ts","../node_modules/superstruct/lib/structs/types.d.ts","../node_modules/superstruct/lib/structs/utilities.d.ts","../node_modules/superstruct/lib/index.d.ts","../src/__tests__/example.ts","../node_modules/@jest/expect-utils/build/index.d.ts","../node_modules/chalk/index.d.ts","../node_modules/@sinclair/typebox/typebox.d.ts","../node_modules/@jest/schemas/build/index.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/jest-diff/build/index.d.ts","../node_modules/jest-matcher-utils/build/index.d.ts","../node_modules/expect/build/index.d.ts","../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"32ab25b7b28b24a138d879ca371b18c8fdfdd564ad5107e1333c5aa5d5fea494","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","30abc554c7ad13063a02ddd06757929b34357aea1f6fcf4ca39114cb0fc19384","e721209755f152edfd69e10bfdf5462d0a00b90991e2d5c5a9ab9c54fe4ee9fb","19d6c0afaefd2e51db3cc2ec611b33a43bd6d21545e854eb0913243e8d958991","09df3b4f1c937f02e7fee2836d4c4d7a63e66db70fd4d4e97126f4542cc21d9d","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","adda9e3915c6bf15e360356a41d950881a51dbe44f9a6088155836b040820663","b4855526ac5a822d6e0005e4b62ee49c599bf89897e4109135283d660e60291c","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","80ad053918e96087d9da8d092ff9f90520c9fc199c8bfd9340266dd8f38f364e","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","d70119390aece1794bf4988f10ea750d13455f5286977d35027d43dd2e9841cf",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"5a856afb15f9dc9983faa391dde989826995a33983c1cccb173e9606688e9709","affectsGlobalScope":true},"546ab07e19116d935ad982e76a223275b53bff7771dab94f433b7ab04652936e","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"aefb5a4a209f756b580eb53ea771cca8aad411603926f307a5e5b8ec6b16dcf6","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","f5a8b7ec4b798c88679194a8ebc25dcb6f5368e6e5811fcda9fe12b0d445b8db","b86e1a45b29437f3a99bad4147cb9fe2357617e8008c0484568e5bb5138d6e13","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","42c431e7965b641106b5e25ab3283aa4865ca7bb9909610a2abfa6226e4348be","0b7e732af0a9599be28c091d6bd1cb22c856ec0d415d4749c087c3881ca07a56","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true},"3b4c85eea12187de9929a76792b98406e8778ce575caca8c574f06da82622c54","f788131a39c81e0c9b9e463645dd7132b5bc1beb609b0e31e5c1ceaea378b4df","0c236069ce7bded4f6774946e928e4b3601894d294054af47a553f7abcafe2c1","21894466693f64957b9bd4c80fa3ec7fdfd4efa9d1861e070aca23f10220c9b2","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","ad8848c289c0b633452e58179f46edccd14b5a0fe90ebce411f79ff040b803e0",{"version":"5d4ef3f46c7f9d62f7c964f9f9ccdd293be99fb3dcc66c983f2aea7430e3c7c6","affectsGlobalScope":true},"91f8b5abcdff8f9ecb9656b9852878718416fb7700b2c4fad8331e5b97c080bb","59d8f064f86a4a2be03b33c0efcc9e7a268ad27b22f82dce16899f3364f70ba8","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"f49fb15c4aa06b65b0dce4db4584bfd8a9f74644baef1511b404dc95be34af00","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"7aaeb5e62f90e1b2be0fc4844df78cdb1be15c22b427bc6c39d57308785b8f10","3ba30205a029ebc0c91d7b1ab4da73f6277d730ca1fc6692d5a9144c6772c76b","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true},{"version":"cbf046714f3a3ba2544957e1973ac94aa819fa8aa668846fa8de47eb1c41b0b2","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eae74e3d50820f37c72c0679fed959cd1e63c98f6a146a55b8c4361582fa6a52","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"aed89e3c18f4c659ee8153a76560dffda23e2d801e1e60d7a67abd84bc555f8d","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","2f940651c2f30e6b29f8743fae3f40b7b1c03615184f837132b56ea75edad08b","5749c327c3f789f658072f8340786966c8b05ea124a56c1d8d60e04649495a4d",{"version":"c9d62b2a51b2ff166314d8be84f6881a7fcbccd37612442cf1c70d27d5352f50","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"d3f4c342fb62f348f25f54b473b0ab7371828cbf637134194fa9cdf04856f87b","736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50","4340936f4e937c452ae783514e7c7bbb7fc06d0c97993ff4865370d0962bb9cf","68dafdb73f93dd78765618f819334fe40341433b8625790b52d55a74eb6346ab","a7755c2d99539fb62de0630fb339af59614846f4551daccf6cb26586a114e8ba","e1494cd01a096ea81cefcca6ea414cf8fd5adb0256a191f144415f42fa680168","9a447781b2903cea6a609350a58e619a321f821d180764774b58e52175951ba9","0b6980dcb7fae3ceb27025fdcc468c1cbd09d4fd03a08981c7e88564b73f2957","970e6b0a03594d110daef991ad14af8ab05d06b5024bb6163b5bcb738dcc056d","a8215f0406480bad09063082600971c2e9300fabccf23e0a442a5c0994a47df8","662a75272462317059315f3028452dc8044f752ad0b6b61c084a7ae3eeb0f775","9b0e0e8756131143065a76f2e5bbf2a15b1f53e6e40f5aa464c7b1b60dda5ea7","5b164f09f2872a321760a406908ad71e06b7c07f58c9eb7f096f888e99c2bb70","166c1b5eb2abf5af8b31a6862dc9d2d9378ab4f685a8bf5f8720321c7af47e31",{"version":"edc0c953087585eb170a378368f574b424a2c0d4aee2b7dc45e7aea60c5b9e3a","signature":"bee15aab92ae1b487cf6b238296eb94ec752cbeeaf145247445700e66830614d"},{"version":"81f8382e31552d2c02a9041a50c4c27d8dd74d780af163e070b4e9aea002996d","signature":"00684d2074a1750d94e06203b47eb9242a14de64b1034723ef1ce6193b5cfab0"},{"version":"e42f05aaaf819782b88bdcc035c6567e438fa0eda3721cd068dfc8c7867d6001","signature":"79f0607791603b8ff7aeab74b28a0d92efff2113a765ebae6b7a8c8bb147de9c"},{"version":"9a70998f91605cc8097956a986350a9382be6dd7103b13bf42a58c902d12804d","signature":"b8e1ba10a549ec229c24f9acf2e8d3b9fa21ec1367288a95699c8e86141eed36"},{"version":"d1a31931f5325e4677df99351b003b6b17379e4c58d48dbdd7d7744f03b0206b","signature":"793a60ea3c354db31343e97558518da2ec7fc4a13b8221c7b89af721d187c99d"},{"version":"21b549392e3ebd4d3ce8916dd8178f8bee552d29272d879501a1752aab78d52f","signature":"13b1bc24a7eb0be356ab8438c027d3de71070a3e4711e89a085a4e2df298f3f4"},{"version":"c3a9b5b6556215e36c565e8200efc3f1c604dd1daa2aac1e0cb2e2c5e2fe1c89","signature":"443b6359f9afd62ecc3e8b6da61ccab7f03fdee964290579c46799035b790be2"},{"version":"9760b35340158970b28cd5e67b3bed70dd7307689e070a321d07d3582a3528fe","signature":"38575deb7de6ef9aa917a9ffce464abe8f016fda7ac1f12c2fd732d1d75d3c32"},"4c7fb1f4c57f3cd9d571c5e4cae33503530273a45579fa0babaf36b64a776eaa",{"version":"90270873b13869d5e15f1c7cbe0d3619a2b5c97787e8e587523ac0eb05bb1078","signature":"9b9c6e831967fcf20141cca4c47b2ab8e3cdfa79dc9655fed3cf0d250a10fa76"},{"version":"263e8e4ab09d51a95d3ef5e7405dcdf12e7194f930047d8a87249415ac9d9e23","signature":"4afc49f6b96526e9a227f368e6f6c5d8516e1070b41a0eccdfc4b88d1c4f238b"},"2859adaa4f2db3d4f0fc37ad86f056045341496b58fba0dbc16a222f9d5d55b1","655ed305e8f4cb95d3f578040301a4e4d6ace112b1bd8824cd32bda66c3677d1",{"version":"131fdb339ef97eec933ec2814ea538f6c254d87827ed91090c74f24c9e2aa818","signature":"a75d179de15facbb156db196984e78e3b861cd554b3bfbe2caa58922af5b9818"},{"version":"5db9b435c31ef2e5d9621f7eadc828b01fd77c3f1db3fc3764b75c5fb21535a0","signature":"7a958bacfc7d732c5175a95ac83de8b830c294d217049785cab5b31c7f3e3c7d"},{"version":"e856168dacb8bb30602e16996a48b6715f5a4c0d471444819edb9c10a497c880","signature":"06f7bfcecf395dbd0299581527d8059f7349ff766d6bba077ef703568d6ec3f6"},{"version":"cd009709bbcbd579710f23bc4e46bc4a2a01398000a208ecd8a5fb715d8f2373","signature":"830cb19921f82fe95ec492ef35e19c5f2e59677df27bea63db4285855d843730"},{"version":"1e44319e3a785c48dbbd7721bf8d49a4f84401848ad52e6d5f1360ec51fe41a6","signature":"bbd9637a5db5992b898b1f416b9c9fd2f8bcfc5a539aac4ada4748dc644cd627"},{"version":"e142af24c9aefb9ec78b7fbae6b587c66fe4b2b8439f00a1d5fc7b3451553af9","signature":"b78e5688f1522616808cac00f67337e347760668e3dc9a83c92712256a0b93f5"},{"version":"942551e18cfe4fcf55bf513a93786e000893982f05ea3c950f556e798470383b","signature":"ae89fa501adcaf84a0d60005fb02f80fb42999753aee7cfa3b73873fc064b2a4"},{"version":"02de79a347c8a2961f753f25b90337b6577a44c8591f3355ac37de8dcb36c264","signature":"6ddfcb36a707c859f0433e2743bc0d6a1e2ee9170ca73a10c4998da134bf2fae"},{"version":"5fb66008714991b3d5cd57e5e0488290b2ddaae3bb4d6b32edce391bf30b3ffc","signature":"259491890e69f9387030cec57bdf0443671665d9b5534469f314a2c70755650c"},{"version":"43227bb01adad4145d725f8302a9c9968428b367389fdd83b875dd9783ef9254","signature":"fa36ac5bc0ad67c9022b4f9deefacf53d58d56039ec188ef4793320ade8804b1"},{"version":"1fd6446477ee3f8605090be9917fa7e0ea6b0eccfc492551829f0c98f6bd3036","signature":"ba3bfeac7dda681d9121e9795f03338753f0f7c05f1d6073a3e07fb907df2a1f"},{"version":"0e205aa301ac78c895857e5bc3cd5629aefe8cbfe6e67f2d308873a3073f45e9","signature":"6c157708e807bd4340d35f0166b5674a388287e42298d52fc04e1f93aca88b87"},{"version":"23fb173b9b1a2c3724a084bf31a80a0b8f381bb6f8b77a314f182aeaefb1c784","signature":"ca5c9ab387db8a7c7610a3cdf1c97cd8f783314bdf41da5a1a0bcfcd0592964e"},"f3dabfe0bf31eea68ec8eb79c7fab7c0c3381174a2f4dd8d06c32e1c5848713f",{"version":"4721bf410b3e877e413c062d7c12debd3fd47078bcb70f2e14d4ef3c045be32f","signature":"e9c66caa80feedaf023f7a8c4664d8cbfe2e8c0d9823dd7f82e17f1794840893"},{"version":"6054013573b292eaae77e1bbace7a4feb79e97f7180cd5ef939dbbfe7f1fb1f6","signature":"f9bb6b2fbe173253c51dbdf9d3c5b30a8fa5f8ec48bdb7d44ff59587061431b0"},{"version":"910ac657cd62b3555534faa394f010eb149222242d054523aae386e0db52b8fd","signature":"fa7640bdc7b3245f8795a5e013e82baeba4647c79b0041b3abd6a4565687639c"},{"version":"88cd2257c63efd31066812365b63e4983b661db1f3b97ee9bd1a44f6de80b8a1","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"324f2ffa2c544ed2f16dcbb6da3e9bbc5eb718528850e280e27e433501d6668e","signature":"15d7207d848cdf86d3de50de3c4b27f30f1dc406cab7ffb87adba2a7f528b85f"},{"version":"e1ca65f56ed78aacce200b9915f11e62edbe5eda9de9477915b540acb59e7c59","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"67c2039f21402fdc8d14fcb32162f9c255b3028d8cfca0785cdafaf3ad2ea23d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"14f9e6f1b4d238c2e81dba9beb6595d3b74ace7ee0e9d8151b8bf684b35ca6e8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"60608809747e51f16c3ad8384609743e9d1745de1ed8e9054174574ea79b952b","8855e0d556c6249f67b3cb9426c5ca1796929a48c2ce01fd050f95f1b69adbc5","aed0c3074556d1eb02516da20784fbb4fa125376c8e258c6c845cf0fddbd2918","c6eff85f66b05eba0a5af516cfa2e7ce0c6d2a2cc71bc4c543915c823cea9ce8","434272013d17121b677ec280c2309b16442cd47060af926d1deba5a00fa26856","5eca2dfcfa34ac7477c33d5ef1e153ec64c3eb08785c20e8557626a5e4c8f452","0c7192e40da80243d167d93fd23c11d2efba22dc27fda3602d99889ed02ade86","0706139fea91b191554d605cc00192d295832707c54782c14b2e770f84786576",{"version":"80a83b97d29fcbfae6a8e48596ff412c698579b9b4c044ebbe84013ae163b1ad","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec",{"version":"c8950367d1812758e9e354c695c60c3e6311bf2cd98b9f9eb469a19df8a9a486","affectsGlobalScope":true}],"root":[[159,166],168,169,[172,184],[186,193],202],"options":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noEmitOnError":true,"noErrorTruncation":true,"noImplicitOverride":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":true,"outDir":"./","removeComments":false,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"fileIdsList":[[138],[138,205],[138,207,210],[45,47,48,49,50,51,52,53,54,55,56,57,138],[45,46,48,49,50,51,52,53,54,55,56,57,138],[46,47,48,49,50,51,52,53,54,55,56,57,138],[45,46,47,49,50,51,52,53,54,55,56,57,138],[45,46,47,48,50,51,52,53,54,55,56,57,138],[45,46,47,48,49,51,52,53,54,55,56,57,138],[45,46,47,48,49,50,52,53,54,55,56,57,138],[45,46,47,48,49,50,51,53,54,55,56,57,138],[45,46,47,48,49,50,51,52,54,55,56,57,138],[45,46,47,48,49,50,51,52,53,55,56,57,138],[45,46,47,48,49,50,51,52,53,54,56,57,138],[45,46,47,48,49,50,51,52,53,54,55,57,138],[45,46,47,48,49,50,51,52,53,54,55,56,138],[57,138],[111,137,138,145,146,147],[60,138],[95,138],[96,101,129,138],[97,108,109,116,126,137,138],[97,98,108,116,138],[99,138],[100,101,109,117,138],[101,126,134,138],[102,104,108,116,138],[103,138],[104,105,138],[108,138],[106,108,138],[95,108,138],[108,109,110,126,137,138],[108,109,110,123,126,129,138],[93,138,142],[104,108,111,116,126,137,138],[108,109,111,112,116,126,134,137,138],[111,113,126,134,137,138],[60,61,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144],[108,114,138],[115,137,138,142],[104,108,116,126,138],[117,138],[118,138],[95,119,138],[120,136,138,142],[121,138],[122,138],[108,123,124,138],[123,125,138,140],[96,108,126,127,128,129,138],[96,126,128,138],[126,127,138],[129,138],[130,138],[95,126,138],[108,132,133,138],[132,133,138],[101,116,126,134,138],[135,138],[116,136,138],[96,111,122,137,138],[101,138],[126,138,139],[115,138,140],[138,141],[96,101,108,110,119,126,137,138,140,142],[126,138,143],[138,170],[138,203,209],[138,150,151,152,153],[111,126,138,145],[138,207],[138,204,208],[138,206],[138,194,196,197,198,199,200],[138,194,195],[138,196],[138,195,196],[138,194,196],[70,74,137,138],[70,126,137,138],[65,138],[67,70,134,137,138],[116,134,138],[138,145],[65,138,145],[67,70,116,137,138],[62,63,66,69,96,108,126,137,138],[62,68,138],[66,70,96,129,137,138,145],[96,138,145],[86,96,138,145],[64,65,138,145],[70,138],[64,65,66,67,68,69,70,71,72,74,75,76,77,78,79,80,81,82,83,84,85,87,88,89,90,91,92,138],[70,77,78,138],[68,70,78,79,138],[69,138],[62,65,70,138],[70,74,78,79,138],[74,138],[68,70,73,137,138],[62,67,68,70,74,77,138],[96,126,138],[65,70,86,96,138,142,145],[138,188,201],[111,126,138,148,167,172,188],[138,180,188],[138,167,190],[138,148,169,173,177,188],[126,138,190],[138,162],[138,162,177],[138,159,160,161,177],[138,148,161,162,163,164,165,166,168,175,176,177,178,181,182,183,184,186,187],[138,163,165,166,168,177,178],[138,157,158],[138,148,154,171],[138,181],[138,162,165,166,168,177,178],[138,168,176,183],[138,183,185],[138,156,183],[58,59,101,138,148,149,168,176,177,178,179,180],[111,113,138,154,167,176,177],[104,138,148,154,155,156,159,161,163,164,168,169,172,173,174,175,177],[138,148,154,176],[138,154,177],[111,126,172,188],[162],[162,177],[161,177],[148,161,162,163,164,165,166,168,175,176,177,178,181,182,183,184,186,187],[168,177],[148],[181],[168,176,183],[183],[168,176,177],[111,113,176,177],[148,168,175,177],[148,176],[177]],"referencedMap":[[203,1],[206,2],[205,1],[211,3],[46,4],[47,5],[45,6],[48,7],[49,8],[50,9],[51,10],[52,11],[53,12],[54,13],[55,14],[56,15],[57,16],[58,17],[185,17],[59,17],[156,17],[157,17],[158,17],[147,1],[148,18],[60,19],[61,19],[95,20],[96,21],[97,22],[98,23],[99,24],[100,25],[101,26],[102,27],[103,28],[104,29],[105,29],[107,30],[106,31],[108,32],[109,33],[110,34],[94,35],[144,1],[111,36],[112,37],[113,38],[145,39],[114,40],[115,41],[116,42],[117,43],[118,44],[119,45],[120,46],[121,47],[122,48],[123,49],[124,49],[125,50],[126,51],[128,52],[127,53],[129,54],[130,55],[131,56],[132,57],[133,58],[134,59],[135,60],[136,61],[137,62],[138,63],[139,64],[140,65],[141,66],[142,67],[143,68],[171,69],[204,1],[167,1],[170,1],[210,70],[154,71],[150,1],[151,1],[152,1],[153,1],[146,72],[155,1],[208,73],[209,74],[149,1],[207,75],[194,1],[201,76],[196,77],[197,78],[198,78],[199,79],[200,79],[195,80],[43,1],[44,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[4,1],[18,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[77,81],[84,82],[76,81],[91,83],[68,84],[67,85],[90,86],[85,87],[88,88],[70,89],[69,90],[65,91],[64,92],[87,93],[66,94],[71,95],[72,1],[75,95],[62,1],[93,96],[92,95],[79,97],[80,98],[82,99],[78,100],[81,101],[86,86],[73,102],[74,103],[83,104],[63,105],[89,106],[202,107],[190,108],[189,109],[191,110],[192,111],[193,112],[163,113],[161,1],[165,114],[162,115],[166,114],[164,113],[178,114],[182,1],[188,116],[169,117],[159,118],[160,1],[172,119],[179,120],[180,1],[173,121],[174,1],[184,122],[183,1],[186,123],[187,124],[181,125],[168,126],[176,127],[177,128],[175,129]],"exportedModulesMap":[[203,1],[206,2],[205,1],[211,3],[46,4],[47,5],[45,6],[48,7],[49,8],[50,9],[51,10],[52,11],[53,12],[54,13],[55,14],[56,15],[57,16],[58,17],[185,17],[59,17],[156,17],[157,17],[158,17],[147,1],[148,18],[60,19],[61,19],[95,20],[96,21],[97,22],[98,23],[99,24],[100,25],[101,26],[102,27],[103,28],[104,29],[105,29],[107,30],[106,31],[108,32],[109,33],[110,34],[94,35],[144,1],[111,36],[112,37],[113,38],[145,39],[114,40],[115,41],[116,42],[117,43],[118,44],[119,45],[120,46],[121,47],[122,48],[123,49],[124,49],[125,50],[126,51],[128,52],[127,53],[129,54],[130,55],[131,56],[132,57],[133,58],[134,59],[135,60],[136,61],[137,62],[138,63],[139,64],[140,65],[141,66],[142,67],[143,68],[171,69],[204,1],[167,1],[170,1],[210,70],[154,71],[150,1],[151,1],[152,1],[153,1],[146,72],[155,1],[208,73],[209,74],[149,1],[207,75],[194,1],[201,76],[196,77],[197,78],[198,78],[199,79],[200,79],[195,80],[43,1],[44,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[4,1],[18,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[77,81],[84,82],[76,81],[91,83],[68,84],[67,85],[90,86],[85,87],[88,88],[70,89],[69,90],[65,91],[64,92],[87,93],[66,94],[71,95],[72,1],[75,95],[62,1],[93,96],[92,95],[79,97],[80,98],[82,99],[78,100],[81,101],[86,86],[73,102],[74,103],[83,104],[63,105],[89,106],[190,130],[163,131],[165,132],[162,133],[166,132],[164,131],[178,132],[188,134],[169,135],[172,136],[179,137],[173,135],[184,138],[186,139],[187,139],[181,140],[168,141],[176,142],[177,143],[175,144]],"semanticDiagnosticsPerFile":[203,206,205,211,46,47,45,48,49,50,51,52,53,54,55,56,57,58,185,59,156,157,158,147,148,60,61,95,96,97,98,99,100,101,102,103,104,105,107,106,108,109,110,94,144,111,112,113,145,114,115,116,117,118,119,120,121,122,123,124,125,126,128,127,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,171,204,167,170,210,154,150,151,152,153,146,155,208,209,149,207,194,201,196,197,198,199,200,195,43,44,9,8,2,10,11,12,13,14,15,16,17,3,4,18,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,77,84,76,91,68,67,90,85,88,70,69,65,64,87,66,71,72,75,62,93,92,79,80,82,78,81,86,73,74,83,63,89,202,190,189,191,192,193,163,161,165,162,166,164,178,182,188,169,159,160,172,179,180,173,174,184,183,186,187,181,168,176,177,175]},"version":"5.2.2"}
package/docs/.nojekyll ADDED
@@ -0,0 +1 @@
1
+ TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
package/docs/README.md ADDED
@@ -0,0 +1,123 @@
1
+ @clickup/rest-client / [Exports](modules.md)
2
+
3
+ # RestClient: a syntax sugar tool around Node fetch() API, tailored to work with typescript-is or superstruct validators
4
+
5
+ See also [Full API documentation](https://github.com/clickup/rest-client/blob/master/docs/modules.md).
6
+
7
+ ## Examples
8
+
9
+ In the example below we use
10
+ [superstruct](https://www.npmjs.com/package/superstruct) library to build a
11
+ strongly typed response validator. Validator is just a function passed to
12
+ `json()` method: it must throw if the argument passed doesn't match what it
13
+ expects the value to be.
14
+
15
+ ```ts
16
+ import { array, number, object, string } from "superstruct";
17
+ import RestClient from "rest-client";
18
+
19
+ // Initialized once. See RestOptions for lots of other options.
20
+ const client = new RestClient()
21
+ .withOptions({
22
+ timeoutMs: 1000,
23
+ logger: (_event) => {
24
+ /* myLogger.log(event); */
25
+ },
26
+ })
27
+ .withBase("https://reqres.in");
28
+
29
+ async function main() {
30
+ // Send individual request using superstruct as a validation backend.
31
+ const res = await client
32
+ .get("/api/users", { page: 2 })
33
+ .setDebug()
34
+ .json(
35
+ object({
36
+ total: number(),
37
+ data: array(
38
+ object({
39
+ id: number(),
40
+ email: string(),
41
+ })
42
+ ),
43
+ })
44
+ );
45
+ console.log("Masked and validated response: ", res);
46
+ // Notice that `res` is strongly typed! You won't make a typo.
47
+ console.log("Here is a TS strongly-typed field:", res.data[0].email);
48
+ }
49
+
50
+ main().catch((e) => console.error(e));
51
+ ```
52
+
53
+ The above script prints the following:
54
+
55
+ ```
56
+ +++ GET https://reqres.in/api/users?page=2
57
+ +++ Accept: application/json
58
+ === HTTP 200 (took 105 ms)
59
+ === { data:
60
+ === [ { id: 7,
61
+ === email: 'michael.lawson@reqres.in',
62
+ === first_name: 'Michael',
63
+ === last_name: 'Lawson',
64
+ === avatar: 'https://reqres.in/img/faces/7-image.jpg' },
65
+ === { id: 8,
66
+ === email: 'lindsay.ferguson@reqres.in',
67
+ === first_name: 'Lindsay',
68
+ === last_name: 'Ferguson',
69
+ === avatar: 'https://reqres.in/img/faces/8-image.jpg' },
70
+ === { id: 9,
71
+ === email: 'tobias.funke@reqres.in',
72
+ === first_name: 'Tobias',
73
+ === last_name: 'Funke',
74
+ === avatar: 'https://reqres.in/img/faces/9-image.jpg' },
75
+ === { id: 10,
76
+ === email: 'byron.fields@reqres.in',
77
+ === first_name: 'Byron',
78
+ === last_name: 'Fields',
79
+ === avatar: 'https://reqres.in/img/faces/10-image.jpg' },
80
+ === { id: 11,
81
+ === email: 'george.edwards@reqres.in',
82
+ === first_name: 'George',
83
+ === last_name: 'Edwards',
84
+ === avatar: 'https://reqres.in/img/faces/11-image.jpg' },
85
+ === { id: 12,
86
+ === email: 'rachel.howell@reqres.in',
87
+ === first_name: 'Rachel',
88
+ === last_name: 'Howell',
89
+ === avatar: 'https://reqres.in/img/faces/12-image.jpg' } ],
90
+ === page: 2,
91
+ === per_page: 6,
92
+ === support:
93
+ === { url: 'https://reqres.in/#support-heading',
94
+ === text: 'To keep ReqRes free, contributions!' },
95
+ === total: 12,
96
+ === total_pages: 2 }
97
+
98
+ Masked and validated response: {
99
+ total: 12,
100
+ data: [
101
+ { id: 7, email: 'michael.lawson@reqres.in' },
102
+ { id: 8, email: 'lindsay.ferguson@reqres.in' },
103
+ { id: 9, email: 'tobias.funke@reqres.in' },
104
+ { id: 10, email: 'byron.fields@reqres.in' },
105
+ { id: 11, email: 'george.edwards@reqres.in' },
106
+ { id: 12, email: 'rachel.howell@reqres.in' }
107
+ ]
108
+ }
109
+ Here is a TS strongly-typed field: michael.lawson@reqres.in
110
+ ```
111
+
112
+ If the API response doesn't match the expected shape (e.g. we expect "other_field" to be presented too), superstruct will throw a descriptive message:
113
+
114
+ ```
115
+ StructError: At path: data.0.other_field -- Expected a number, but received: undefined
116
+ ```
117
+
118
+ ## Validation Backends
119
+
120
+ You can use one of the following libraries to type-enforce the response:
121
+ - [typescript-is](https://www.npmjs.com/package/typescript-is)
122
+ - [superstruct](https://www.npmjs.com/package/superstruct)
123
+ - any other solution which can validate TS object shape against a JSON
@@ -0,0 +1,62 @@
1
+ [@clickup/rest-client](../README.md) / [Exports](../modules.md) / PacerComposite
2
+
3
+ # Class: PacerComposite
4
+
5
+ A Pacer which runs all sub-pacers and chooses the largest delay.
6
+
7
+ ## Implements
8
+
9
+ - [`Pacer`](../interfaces/Pacer.md)
10
+
11
+ ## Constructors
12
+
13
+ ### constructor
14
+
15
+ • **new PacerComposite**(`_pacers`)
16
+
17
+ #### Parameters
18
+
19
+ | Name | Type |
20
+ | :------ | :------ |
21
+ | `_pacers` | [`Pacer`](../interfaces/Pacer.md)[] |
22
+
23
+ #### Defined in
24
+
25
+ [src/pacers/PacerComposite.ts:10](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerComposite.ts#L10)
26
+
27
+ ## Properties
28
+
29
+ ### name
30
+
31
+ • `Readonly` **name**: ``""``
32
+
33
+ Human readable name of the pacer, used when composing multiple pacers.
34
+
35
+ #### Implementation of
36
+
37
+ [Pacer](../interfaces/Pacer.md).[name](../interfaces/Pacer.md#name)
38
+
39
+ #### Defined in
40
+
41
+ [src/pacers/PacerComposite.ts:8](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerComposite.ts#L8)
42
+
43
+ ## Methods
44
+
45
+ ### touch
46
+
47
+ ▸ **touch**(): `Promise`<{ `delayMs`: `number` ; `reason`: `string` }\>
48
+
49
+ Signals that we're about to send a request. Returns the delay we need to
50
+ wait for before actually sending.
51
+
52
+ #### Returns
53
+
54
+ `Promise`<{ `delayMs`: `number` ; `reason`: `string` }\>
55
+
56
+ #### Implementation of
57
+
58
+ [Pacer](../interfaces/Pacer.md).[touch](../interfaces/Pacer.md#touch)
59
+
60
+ #### Defined in
61
+
62
+ [src/pacers/PacerComposite.ts:12](https://github.com/clickup/rest-client/blob/master/src/pacers/PacerComposite.ts#L12)