musicbrainz-api 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.idea/$CACHE_FILE$ +6 -0
  2. package/.idea/$PRODUCT_WORKSPACE_FILE$ +19 -0
  3. package/.idea/checkstyle-idea.xml +16 -0
  4. package/.idea/codeStyles/Project.xml +38 -0
  5. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  6. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  7. package/.idea/misc.xml +6 -0
  8. package/.idea/modules.xml +8 -0
  9. package/.idea/shelf/Uncommitted_changes_before_Update_at_6-1-2022_11_38_[Default_Changelist]/shelved.patch +58 -0
  10. package/.idea/shelf/Uncommitted_changes_before_Update_at_6-1-2022_11_38__Default_Changelist_.xml +4 -0
  11. package/.idea/shelf/Uncommitted_changes_before_rebase_[Default_Changelist]/shelved.patch +738 -0
  12. package/.idea/shelf/Uncommitted_changes_before_rebase_[Default_Changelist]1/shelved.patch +0 -0
  13. package/.idea/shelf/Uncommitted_changes_before_rebase__Default_Changelist_.xml +4 -0
  14. package/.idea/vcs.xml +6 -0
  15. package/.idea/workspace.xml +700 -0
  16. package/README.md +284 -285
  17. package/etc/config.js +32 -0
  18. package/lib/digest-auth.d.ts +21 -21
  19. package/lib/digest-auth.js +87 -86
  20. package/lib/musicbrainz-api.d.ts +157 -139
  21. package/lib/musicbrainz-api.js +387 -369
  22. package/lib/musicbrainz.types.d.ts +253 -257
  23. package/lib/musicbrainz.types.js +16 -15
  24. package/lib/rate-limiter.d.ts +8 -8
  25. package/lib/rate-limiter.js +31 -30
  26. package/lib/xml/xml-isrc-list.d.ts +17 -17
  27. package/lib/xml/xml-isrc-list.js +22 -21
  28. package/lib/xml/xml-isrc.d.ts +10 -10
  29. package/lib/xml/xml-isrc.js +17 -16
  30. package/lib/xml/xml-metadata.d.ts +6 -6
  31. package/lib/xml/xml-metadata.js +29 -28
  32. package/lib/xml/xml-recording.d.ts +24 -24
  33. package/lib/xml/xml-recording.js +20 -19
  34. package/package.json +98 -81
  35. package/yarn-error.log +3608 -0
  36. package/.travis.yml +0 -24
  37. package/lib/xml/xml-isrc-list.js.map +0 -1
  38. package/lib/xml/xml-isrc.js.map +0 -1
  39. package/lib/xml/xml-metadata.js.map +0 -1
  40. package/lib/xml/xml-recording.js.map +0 -1
  41. package/tsconfig.json +0 -9
  42. package/tslint.json +0 -26
@@ -1,257 +1,253 @@
1
- import DateTimeFormat = Intl.DateTimeFormat;
2
- export interface IPeriod {
3
- 'begin': string;
4
- 'ended': boolean;
5
- 'end': string;
6
- }
7
- export interface IArea {
8
- id: string;
9
- 'iso-3166-1-codes': string;
10
- name: string;
11
- 'sort-name': string;
12
- disambiguation: string;
13
- }
14
- export interface IAlias {
15
- name: string;
16
- 'sort-name': string;
17
- ended: boolean;
18
- 'type-id': string;
19
- type: string;
20
- locale: string;
21
- primary: string;
22
- begin: string;
23
- end: string;
24
- }
25
- export interface IMatch {
26
- score: number;
27
- }
28
- export interface IArtist {
29
- id: string;
30
- name: string;
31
- disambiguation: string;
32
- 'sort-name': string;
33
- 'type-id'?: string;
34
- 'gender-id'?: any;
35
- 'life-span'?: IPeriod;
36
- country?: string;
37
- ipis?: any[];
38
- isnis?: string[];
39
- aliases?: IAlias[];
40
- gender?: null;
41
- type?: string;
42
- area?: IArea;
43
- begin_area?: IArea;
44
- end_area?: IArea;
45
- relations?: IRelation[];
46
- /**
47
- * Only defined if 'releases' are includes
48
- */
49
- releases?: IRelease[];
50
- }
51
- export interface IArtistCredit {
52
- artist: IArtist;
53
- joinphrase: string;
54
- name: string;
55
- }
56
- export declare type ReleaseQuality = 'normal';
57
- export interface IRelease {
58
- id: string;
59
- title: string;
60
- 'text-representation': {
61
- 'language': 'eng';
62
- 'script': 'Latn';
63
- };
64
- disambiguation: string;
65
- asin: string;
66
- 'status-id': string;
67
- packaging?: string;
68
- status: string;
69
- 'packaging-id'?: string;
70
- 'release-events'?: IReleaseEvent;
71
- date: string;
72
- media: IMedium[];
73
- 'cover-art-archive': ICoverArtArchive;
74
- country: string;
75
- quality: ReleaseQuality;
76
- barcode: string;
77
- relations?: IRelation[];
78
- 'artist-credit'?: IArtistCredit[];
79
- 'release-group'?: IReleaseGroup;
80
- }
81
- export interface IArea {
82
- id: string;
83
- name: string;
84
- disambiguation: string;
85
- 'iso-3166-1-codes': string;
86
- 'sort-name': string;
87
- }
88
- export interface IReleaseEvent {
89
- area?: IArea;
90
- }
91
- export declare type MediaFormatType = 'Digital Media';
92
- export interface IRecording {
93
- id: string;
94
- video: boolean;
95
- length: number;
96
- title: string;
97
- disambiguation: string;
98
- isrcs?: string[];
99
- releases?: IRelease;
100
- relations?: IRelation[];
101
- 'artist-credit'?: IArtistCredit[];
102
- aliases?: IAlias[];
103
- }
104
- export interface ITrack {
105
- id: string;
106
- position: number;
107
- recording: IRecording;
108
- number: number;
109
- length: number;
110
- title: string;
111
- }
112
- export interface IMedium {
113
- title: string;
114
- format: MediaFormatType;
115
- 'format-id': string;
116
- 'tracks': ITrack[];
117
- 'track-count': number;
118
- 'track-offset': number;
119
- 'position': number;
120
- }
121
- export interface ICoverArtArchive {
122
- count: number;
123
- front: boolean;
124
- darkened: boolean;
125
- artwork: true;
126
- back: boolean;
127
- }
128
- export interface IReleaseGroup {
129
- id: string;
130
- count: number;
131
- title: string;
132
- 'primary-type': string;
133
- 'sort-name': string;
134
- 'artist-credit': Array<{
135
- artist: IArtist;
136
- }>;
137
- releases?: IRelease[];
138
- }
139
- export interface IArtistMatch extends IArtist, IMatch {
140
- }
141
- export interface IReleaseGroupMatch extends IReleaseGroup, IMatch {
142
- }
143
- export interface IReleaseMatch extends IRelease, IMatch {
144
- }
145
- export interface IAreaMatch extends IArea, IMatch {
146
- }
147
- export interface ISearchResult {
148
- created: DateTimeFormat;
149
- count: number;
150
- offset: number;
151
- }
152
- export interface IArtistList extends ISearchResult {
153
- artists: IArtistMatch[];
154
- }
155
- export interface IAreaList extends ISearchResult {
156
- areas: IAreaMatch[];
157
- }
158
- export interface IReleaseList extends ISearchResult {
159
- releases: IReleaseMatch[];
160
- }
161
- export interface IReleaseGroupList extends ISearchResult {
162
- 'release-groups': IReleaseGroupMatch[];
163
- }
164
- export interface IUrlList extends ISearchResult {
165
- urls: IUrlMatch[];
166
- }
167
- export declare type RelationDirection = 'backward' | 'forward';
168
- export interface IRelation {
169
- 'attribute-ids': {};
170
- direction: RelationDirection;
171
- 'target-credit': string;
172
- end: null | object;
173
- 'source-credit': string;
174
- ended: boolean;
175
- 'attribute-values': object;
176
- attributes?: any[];
177
- type: string;
178
- begin?: null | object;
179
- 'target-type'?: 'url';
180
- 'type-id': string;
181
- url?: IURL;
182
- release?: IRelease;
183
- }
184
- export interface IURL {
185
- id: string;
186
- resource: string;
187
- }
188
- export interface IRelationList {
189
- relations: IRelation[];
190
- }
191
- export interface IWork {
192
- id: string;
193
- title: string;
194
- }
195
- export interface ILabel {
196
- id: string;
197
- name: string;
198
- }
199
- export interface IUrl {
200
- id: '1a150a68-13b2-4bab-a96b-4966924cbc7f';
201
- resource: 'https://open.spotify.com/album/13bRrqlPDErhpXDUxYQCUU';
202
- 'relation-list': IRelationList[];
203
- }
204
- export interface IUrlMatch extends IMatch, IUrl {
205
- }
206
- export interface IUrlSearchResult extends ISearchResult {
207
- urls?: IUrlMatch[];
208
- }
209
- export interface IIsrcSearchResult {
210
- 'isrc': 'GBCVZ0802435';
211
- 'recordings': IRecording[];
212
- }
213
- export interface IExernalIds {
214
- [type: string]: string;
215
- }
216
- export interface IReleaseSearchResult extends ISearchResult {
217
- releases: IRelease[];
218
- }
219
- /**
220
- * https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2#Subqueries
221
- */
222
- export declare type EntityType = 'area' | 'artist' | 'collection' | 'event' | 'instrument' | 'label' | 'place' | 'recording' | 'release' | 'release-group' | 'series' | 'work' | 'url';
223
- export declare type Relationships = 'area-rels' | 'artist-rels' | 'event-rels' | 'instrument-rels' | 'label-rels' | 'place-rels' | 'recording-rels' | 'release-rels' | 'release-group-rels' | 'series-rels' | 'url-rels' | 'work-rels';
224
- export declare enum LinkType {
225
- license = 302,
226
- production = 256,
227
- samples_IMDb_entry = 258,
228
- get_the_music = 257,
229
- purchase_for_download = 254,
230
- download_for_free = 255,
231
- stream_for_free = 268,
232
- crowdfunding_page = 905,
233
- other_databases = 306,
234
- Allmusic = 285
235
- }
236
- /**
237
- * https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Artist
238
- */
239
- export interface IPagination {
240
- /**
241
- * Return search results starting at a given offset. Used for paging through more than one page of results.
242
- */
243
- offset?: number;
244
- /**
245
- * An integer value defining how many entries should be returned. Only values between 1 and 100 (both inclusive) are allowed. If not given, this defaults to 25.
246
- */
247
- limit?: number;
248
- }
249
- /**
250
- * https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Artist
251
- */
252
- export interface ISearchQuery extends IPagination {
253
- /**
254
- * Lucene search query, this is mandatory
255
- */
256
- query: string;
257
- }
1
+ import DateTimeFormat = Intl.DateTimeFormat;
2
+ export interface IPeriod {
3
+ 'begin': string;
4
+ 'ended': boolean;
5
+ 'end': string;
6
+ }
7
+ export interface IArea {
8
+ id: string;
9
+ 'iso-3166-1-codes': string[];
10
+ name: string;
11
+ 'sort-name': string;
12
+ disambiguation: string;
13
+ }
14
+ export interface IAlias {
15
+ name: string;
16
+ 'sort-name': string;
17
+ ended: boolean;
18
+ 'type-id': string;
19
+ type: string;
20
+ locale: string;
21
+ primary: string;
22
+ begin: string;
23
+ end: string;
24
+ }
25
+ export interface IMatch {
26
+ score: number;
27
+ }
28
+ export interface IArtist {
29
+ id: string;
30
+ name: string;
31
+ disambiguation: string;
32
+ 'sort-name': string;
33
+ 'type-id'?: string;
34
+ 'gender-id'?: any;
35
+ 'life-span'?: IPeriod;
36
+ country?: string;
37
+ ipis?: any[];
38
+ isnis?: string[];
39
+ aliases?: IAlias[];
40
+ gender?: null;
41
+ type?: string;
42
+ area?: IArea;
43
+ begin_area?: IArea;
44
+ end_area?: IArea;
45
+ relations?: IRelation[];
46
+ /**
47
+ * Only defined if 'releases' are includes
48
+ */
49
+ releases?: IRelease[];
50
+ 'release-groups'?: IReleaseGroup[];
51
+ }
52
+ export interface IArtistCredit {
53
+ artist: IArtist;
54
+ joinphrase: string;
55
+ name: string;
56
+ }
57
+ export declare type ReleaseQuality = 'normal';
58
+ export interface IRelease {
59
+ id: string;
60
+ title: string;
61
+ 'text-representation': {
62
+ 'language': string;
63
+ 'script': string;
64
+ };
65
+ disambiguation: string;
66
+ asin: string;
67
+ 'status-id': string;
68
+ packaging?: string;
69
+ status: string;
70
+ 'packaging-id'?: string;
71
+ 'release-events'?: IReleaseEvent[];
72
+ date: string;
73
+ media: IMedium[];
74
+ 'cover-art-archive': ICoverArtArchive;
75
+ country: string;
76
+ quality: string;
77
+ barcode: string;
78
+ relations?: IRelation[];
79
+ 'artist-credit'?: IArtistCredit[];
80
+ 'release-group'?: IReleaseGroup;
81
+ }
82
+ export interface IReleaseEvent {
83
+ area?: IArea;
84
+ date?: string;
85
+ }
86
+ export declare type MediaFormatType = 'Digital Media';
87
+ export interface IRecording {
88
+ id: string;
89
+ video: boolean;
90
+ length: number;
91
+ title: string;
92
+ disambiguation: string;
93
+ isrcs?: string[];
94
+ releases?: IRelease;
95
+ relations?: IRelation[];
96
+ 'artist-credit'?: IArtistCredit[];
97
+ aliases?: IAlias[];
98
+ }
99
+ export interface ITrack {
100
+ id: string;
101
+ position: number;
102
+ recording: IRecording;
103
+ number: string;
104
+ length: number;
105
+ title: string;
106
+ 'artist-credit'?: IArtistCredit[];
107
+ }
108
+ export interface IMedium {
109
+ title: string;
110
+ format?: string;
111
+ 'format-id': string;
112
+ 'tracks': ITrack[];
113
+ 'track-count': number;
114
+ 'track-offset': number;
115
+ 'position': number;
116
+ }
117
+ export interface ICoverArtArchive {
118
+ count: number;
119
+ front: boolean;
120
+ darkened: boolean;
121
+ artwork: boolean;
122
+ back: boolean;
123
+ }
124
+ export interface IReleaseGroup {
125
+ id: string;
126
+ count: number;
127
+ title: string;
128
+ 'primary-type': string;
129
+ 'sort-name': string;
130
+ 'artist-credit': [{
131
+ artist: IArtist;
132
+ }];
133
+ releases?: IRelease[];
134
+ }
135
+ export interface IArtistMatch extends IArtist, IMatch {
136
+ }
137
+ export interface IReleaseGroupMatch extends IReleaseGroup, IMatch {
138
+ }
139
+ export interface IReleaseMatch extends IRelease, IMatch {
140
+ }
141
+ export interface IAreaMatch extends IArea, IMatch {
142
+ }
143
+ export interface ISearchResult {
144
+ created: DateTimeFormat;
145
+ count: number;
146
+ offset: number;
147
+ }
148
+ export interface IArtistList extends ISearchResult {
149
+ artists: IArtistMatch[];
150
+ }
151
+ export interface IAreaList extends ISearchResult {
152
+ areas: IAreaMatch[];
153
+ }
154
+ export interface IReleaseList extends ISearchResult {
155
+ releases: IReleaseMatch[];
156
+ }
157
+ export interface IReleaseGroupList extends ISearchResult {
158
+ 'release-groups': IReleaseGroupMatch[];
159
+ }
160
+ export interface IUrlList extends ISearchResult {
161
+ urls: IUrlMatch[];
162
+ }
163
+ export declare type RelationDirection = 'backward' | 'forward';
164
+ export interface IRelation {
165
+ 'attribute-ids': {};
166
+ direction: RelationDirection;
167
+ 'target-credit': string;
168
+ end: null | object;
169
+ 'source-credit': string;
170
+ ended: boolean;
171
+ 'attribute-values': object;
172
+ attributes?: any[];
173
+ type: string;
174
+ begin?: null | object;
175
+ 'target-type'?: 'url';
176
+ 'type-id': string;
177
+ url?: IURL;
178
+ release?: IRelease;
179
+ }
180
+ export interface IURL {
181
+ id: string;
182
+ resource: string;
183
+ }
184
+ export interface IRelationList {
185
+ relations: IRelation[];
186
+ }
187
+ export interface IWork {
188
+ id: string;
189
+ title: string;
190
+ }
191
+ export interface ILabel {
192
+ id: string;
193
+ name: string;
194
+ }
195
+ export interface IUrl {
196
+ id: string;
197
+ resource: string;
198
+ 'relation-list': IRelationList[];
199
+ }
200
+ export interface IUrlMatch extends IMatch, IUrl {
201
+ }
202
+ export interface IUrlSearchResult extends ISearchResult {
203
+ urls?: IUrlMatch[];
204
+ }
205
+ export interface IIsrcSearchResult {
206
+ 'isrc': string;
207
+ 'recordings': IRecording[];
208
+ }
209
+ export interface IExernalIds {
210
+ [type: string]: string;
211
+ }
212
+ export interface IReleaseSearchResult extends ISearchResult {
213
+ releases: IRelease[];
214
+ }
215
+ /**
216
+ * https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2#Subqueries
217
+ */
218
+ export declare type EntityType = 'area' | 'artist' | 'collection' | 'event' | 'instrument' | 'label' | 'place' | 'recording' | 'release' | 'release-group' | 'series' | 'work' | 'url';
219
+ export declare type Relationships = 'area-rels' | 'artist-rels' | 'event-rels' | 'instrument-rels' | 'label-rels' | 'place-rels' | 'recording-rels' | 'release-rels' | 'release-group-rels' | 'series-rels' | 'url-rels' | 'work-rels';
220
+ export declare enum LinkType {
221
+ license = 302,
222
+ production = 256,
223
+ samples_IMDb_entry = 258,
224
+ get_the_music = 257,
225
+ purchase_for_download = 254,
226
+ download_for_free = 255,
227
+ stream_for_free = 268,
228
+ crowdfunding_page = 905,
229
+ other_databases = 306,
230
+ Allmusic = 285
231
+ }
232
+ /**
233
+ * https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Artist
234
+ */
235
+ export interface IPagination {
236
+ /**
237
+ * Return search results starting at a given offset. Used for paging through more than one page of results.
238
+ */
239
+ offset?: number;
240
+ /**
241
+ * An integer value defining how many entries should be returned. Only values between 1 and 100 (both inclusive) are allowed. If not given, this defaults to 25.
242
+ */
243
+ limit?: number;
244
+ }
245
+ /**
246
+ * https://wiki.musicbrainz.org/Development/XML_Web_Service/Version_2/Search#Artist
247
+ */
248
+ export interface ISearchQuery extends IPagination {
249
+ /**
250
+ * Lucene search query, this is mandatory
251
+ */
252
+ query: string;
253
+ }
@@ -1,16 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var LinkType;
4
- (function (LinkType) {
5
- LinkType[LinkType["license"] = 302] = "license";
6
- LinkType[LinkType["production"] = 256] = "production";
7
- LinkType[LinkType["samples_IMDb_entry"] = 258] = "samples_IMDb_entry";
8
- LinkType[LinkType["get_the_music"] = 257] = "get_the_music";
9
- LinkType[LinkType["purchase_for_download"] = 254] = "purchase_for_download";
10
- LinkType[LinkType["download_for_free"] = 255] = "download_for_free";
11
- LinkType[LinkType["stream_for_free"] = 268] = "stream_for_free";
12
- LinkType[LinkType["crowdfunding_page"] = 905] = "crowdfunding_page";
13
- LinkType[LinkType["other_databases"] = 306] = "other_databases";
14
- LinkType[LinkType["Allmusic"] = 285] = "Allmusic";
15
- })(LinkType = exports.LinkType || (exports.LinkType = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkType = void 0;
4
+ var LinkType;
5
+ (function (LinkType) {
6
+ LinkType[LinkType["license"] = 302] = "license";
7
+ LinkType[LinkType["production"] = 256] = "production";
8
+ LinkType[LinkType["samples_IMDb_entry"] = 258] = "samples_IMDb_entry";
9
+ LinkType[LinkType["get_the_music"] = 257] = "get_the_music";
10
+ LinkType[LinkType["purchase_for_download"] = 254] = "purchase_for_download";
11
+ LinkType[LinkType["download_for_free"] = 255] = "download_for_free";
12
+ LinkType[LinkType["stream_for_free"] = 268] = "stream_for_free";
13
+ LinkType[LinkType["crowdfunding_page"] = 905] = "crowdfunding_page";
14
+ LinkType[LinkType["other_databases"] = 306] = "other_databases";
15
+ LinkType[LinkType["Allmusic"] = 285] = "Allmusic";
16
+ })(LinkType = exports.LinkType || (exports.LinkType = {}));
16
17
  //# sourceMappingURL=musicbrainz.types.js.map
@@ -1,8 +1,8 @@
1
- export declare class RateLimiter {
2
- private maxCalls;
3
- static sleep(ms: any): Promise<void>;
4
- queue: number[];
5
- private readonly period;
6
- constructor(period: number, maxCalls: number);
7
- limit(): Promise<void>;
8
- }
1
+ export declare class RateLimiter {
2
+ private maxCalls;
3
+ static sleep(ms: any): Promise<void>;
4
+ queue: number[];
5
+ private readonly period;
6
+ constructor(period: number, maxCalls: number);
7
+ limit(): Promise<void>;
8
+ }
@@ -1,31 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const Debug = require("debug");
4
- const debug = Debug('musicbrainz-api:rate-limiter');
5
- class RateLimiter {
6
- constructor(period, maxCalls) {
7
- this.maxCalls = maxCalls;
8
- this.queue = [];
9
- this.period = 1000 * period;
10
- }
11
- static sleep(ms) {
12
- return new Promise(resolve => setTimeout(resolve, ms));
13
- }
14
- async limit() {
15
- let now = new Date().getTime();
16
- const t0 = now - (this.period);
17
- while (this.queue.length > 0 && this.queue[0] < t0) {
18
- this.queue.shift();
19
- }
20
- if (this.queue.length >= this.maxCalls) {
21
- const delay = this.queue[0] + this.period - now;
22
- debug(`Client side rate limiter activated: cool down for ${delay / 1000} s...`);
23
- return RateLimiter.sleep(delay);
24
- }
25
- now = new Date().getTime();
26
- this.queue.push(now);
27
- // const ratePerSec = 1000 * this.queue.length / (now - this.queue[0]);
28
- }
29
- }
30
- exports.RateLimiter = RateLimiter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RateLimiter = void 0;
4
+ const Debug = require("debug");
5
+ const debug = Debug('musicbrainz-api:rate-limiter');
6
+ class RateLimiter {
7
+ constructor(period, maxCalls) {
8
+ this.maxCalls = maxCalls;
9
+ this.queue = [];
10
+ this.period = 1000 * period;
11
+ }
12
+ static sleep(ms) {
13
+ return new Promise(resolve => setTimeout(resolve, ms));
14
+ }
15
+ async limit() {
16
+ let now = new Date().getTime();
17
+ const t0 = now - (this.period);
18
+ while (this.queue.length > 0 && this.queue[0] < t0) {
19
+ this.queue.shift();
20
+ }
21
+ if (this.queue.length >= this.maxCalls) {
22
+ const delay = this.queue[0] + this.period - now;
23
+ debug(`Client side rate limiter activated: cool down for ${delay / 1000} s...`);
24
+ return RateLimiter.sleep(delay);
25
+ }
26
+ now = new Date().getTime();
27
+ this.queue.push(now);
28
+ // const ratePerSec = 1000 * this.queue.length / (now - this.queue[0]);
29
+ }
30
+ }
31
+ exports.RateLimiter = RateLimiter;
31
32
  //# sourceMappingURL=rate-limiter.js.map