pinata 2.4.8 → 2.4.9
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.
- package/LICENSE +0 -0
- package/README.md +1 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +21 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +68 -68
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -274,7 +274,7 @@ declare class AnalyticsFilter {
|
|
|
274
274
|
limit(limit: number): this;
|
|
275
275
|
sort(order: "asc" | "desc"): this;
|
|
276
276
|
days(numberOfDays: number): this;
|
|
277
|
-
then(onfulfilled?: ((value: TopAnalyticsResponse) => any) | null): Promise<any>;
|
|
277
|
+
then(onfulfilled?: ((value: TopAnalyticsResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
declare class AnalyticsBandwidth extends AnalyticsFilter {
|
|
@@ -301,7 +301,7 @@ declare class AnalyticsBuilder<T extends AnalyticsQuery, R> {
|
|
|
301
301
|
limit(limit: number): this;
|
|
302
302
|
sort(order: "asc" | "desc"): this;
|
|
303
303
|
protected getAnalytics(): Promise<R>;
|
|
304
|
-
then(onfulfilled?: ((value: R) => any) | null): Promise<any>;
|
|
304
|
+
then(onfulfilled?: ((value: R) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
declare class AnalyticsRequests extends AnalyticsFilter {
|
|
@@ -328,7 +328,7 @@ declare class FilterGroups {
|
|
|
328
328
|
limit(limit: number): FilterGroups;
|
|
329
329
|
isPublic(isPublic: boolean): FilterGroups;
|
|
330
330
|
pageToken(pageToken: string): FilterGroups;
|
|
331
|
-
then(onfulfilled?: ((value: GroupListResponse) => any) | null): Promise<GroupListResponse>;
|
|
331
|
+
then(onfulfilled?: ((value: GroupListResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<GroupListResponse>;
|
|
332
332
|
private fetchPage;
|
|
333
333
|
[Symbol.asyncIterator](): AsyncGenerator<GroupResponseItem, void, unknown>;
|
|
334
334
|
all(): Promise<GroupResponseItem[]>;
|
|
@@ -386,7 +386,7 @@ declare class FilterKeys {
|
|
|
386
386
|
limitedUse(limitedUse: boolean): FilterKeys;
|
|
387
387
|
exhausted(exhausted: boolean): FilterKeys;
|
|
388
388
|
name(name: string): FilterKeys;
|
|
389
|
-
then(onfulfilled?: ((value: KeyListItem[]) => any) | null): Promise<any>;
|
|
389
|
+
then(onfulfilled?: ((value: KeyListItem[]) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
390
390
|
[Symbol.asyncIterator](): AsyncGenerator<KeyListItem, void, unknown>;
|
|
391
391
|
all(): Promise<KeyListItem[]>;
|
|
392
392
|
}
|
|
@@ -405,7 +405,7 @@ declare class OptimizeImageCreateAccessLink {
|
|
|
405
405
|
private imgOpts;
|
|
406
406
|
constructor(config: PinataConfig | undefined, urlOpts: AccessLinkOptions);
|
|
407
407
|
optimizeImage(options: OptimizeImageOptions): OptimizeImageCreateAccessLink;
|
|
408
|
-
then(onfulfilled?: ((value: string) => any) | null): Promise<any>;
|
|
408
|
+
then(onfulfilled?: ((value: string) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
declare class OptimizeImageGetCid {
|
|
@@ -415,7 +415,7 @@ declare class OptimizeImageGetCid {
|
|
|
415
415
|
private options;
|
|
416
416
|
constructor(config: PinataConfig | undefined, cid: string, gatewayType?: "ipfs" | "files");
|
|
417
417
|
optimizeImage(options: OptimizeImageOptions): OptimizeImageGetCid;
|
|
418
|
-
then(onfulfilled?: ((value: GetCIDResponse) => any) | null): Promise<any>;
|
|
418
|
+
then(onfulfilled?: ((value: GetCIDResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
declare class PrivateGateways {
|
|
@@ -448,7 +448,7 @@ declare class FilterFiles {
|
|
|
448
448
|
keyvalues(keyvalues: Record<string, string>): FilterFiles;
|
|
449
449
|
noGroup(noGroup: boolean): FilterFiles;
|
|
450
450
|
pageToken(pageToken: string): FilterFiles;
|
|
451
|
-
then(onfulfilled?: ((value: FileListResponse) => any) | null): Promise<any>;
|
|
451
|
+
then(onfulfilled?: ((value: FileListResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
452
452
|
private fetchPage;
|
|
453
453
|
[Symbol.asyncIterator](): AsyncGenerator<FileListItem, void, unknown>;
|
|
454
454
|
all(): Promise<FileListItem[]>;
|
|
@@ -469,7 +469,7 @@ declare class FilterQueue {
|
|
|
469
469
|
pageToken(pageToken: string): FilterQueue;
|
|
470
470
|
private fetchPage;
|
|
471
471
|
sort(sort: "ASC" | "DSC"): FilterQueue;
|
|
472
|
-
then(onfulfilled?: ((value: PinQueueResponse) => any) | null): Promise<any>;
|
|
472
|
+
then(onfulfilled?: ((value: PinQueueResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
473
473
|
private rateLimit;
|
|
474
474
|
[Symbol.asyncIterator](): AsyncGenerator<PinQueueItem, void, unknown>;
|
|
475
475
|
all(): Promise<PinQueueItem[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -274,7 +274,7 @@ declare class AnalyticsFilter {
|
|
|
274
274
|
limit(limit: number): this;
|
|
275
275
|
sort(order: "asc" | "desc"): this;
|
|
276
276
|
days(numberOfDays: number): this;
|
|
277
|
-
then(onfulfilled?: ((value: TopAnalyticsResponse) => any) | null): Promise<any>;
|
|
277
|
+
then(onfulfilled?: ((value: TopAnalyticsResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
declare class AnalyticsBandwidth extends AnalyticsFilter {
|
|
@@ -301,7 +301,7 @@ declare class AnalyticsBuilder<T extends AnalyticsQuery, R> {
|
|
|
301
301
|
limit(limit: number): this;
|
|
302
302
|
sort(order: "asc" | "desc"): this;
|
|
303
303
|
protected getAnalytics(): Promise<R>;
|
|
304
|
-
then(onfulfilled?: ((value: R) => any) | null): Promise<any>;
|
|
304
|
+
then(onfulfilled?: ((value: R) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
declare class AnalyticsRequests extends AnalyticsFilter {
|
|
@@ -328,7 +328,7 @@ declare class FilterGroups {
|
|
|
328
328
|
limit(limit: number): FilterGroups;
|
|
329
329
|
isPublic(isPublic: boolean): FilterGroups;
|
|
330
330
|
pageToken(pageToken: string): FilterGroups;
|
|
331
|
-
then(onfulfilled?: ((value: GroupListResponse) => any) | null): Promise<GroupListResponse>;
|
|
331
|
+
then(onfulfilled?: ((value: GroupListResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<GroupListResponse>;
|
|
332
332
|
private fetchPage;
|
|
333
333
|
[Symbol.asyncIterator](): AsyncGenerator<GroupResponseItem, void, unknown>;
|
|
334
334
|
all(): Promise<GroupResponseItem[]>;
|
|
@@ -386,7 +386,7 @@ declare class FilterKeys {
|
|
|
386
386
|
limitedUse(limitedUse: boolean): FilterKeys;
|
|
387
387
|
exhausted(exhausted: boolean): FilterKeys;
|
|
388
388
|
name(name: string): FilterKeys;
|
|
389
|
-
then(onfulfilled?: ((value: KeyListItem[]) => any) | null): Promise<any>;
|
|
389
|
+
then(onfulfilled?: ((value: KeyListItem[]) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
390
390
|
[Symbol.asyncIterator](): AsyncGenerator<KeyListItem, void, unknown>;
|
|
391
391
|
all(): Promise<KeyListItem[]>;
|
|
392
392
|
}
|
|
@@ -405,7 +405,7 @@ declare class OptimizeImageCreateAccessLink {
|
|
|
405
405
|
private imgOpts;
|
|
406
406
|
constructor(config: PinataConfig | undefined, urlOpts: AccessLinkOptions);
|
|
407
407
|
optimizeImage(options: OptimizeImageOptions): OptimizeImageCreateAccessLink;
|
|
408
|
-
then(onfulfilled?: ((value: string) => any) | null): Promise<any>;
|
|
408
|
+
then(onfulfilled?: ((value: string) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
declare class OptimizeImageGetCid {
|
|
@@ -415,7 +415,7 @@ declare class OptimizeImageGetCid {
|
|
|
415
415
|
private options;
|
|
416
416
|
constructor(config: PinataConfig | undefined, cid: string, gatewayType?: "ipfs" | "files");
|
|
417
417
|
optimizeImage(options: OptimizeImageOptions): OptimizeImageGetCid;
|
|
418
|
-
then(onfulfilled?: ((value: GetCIDResponse) => any) | null): Promise<any>;
|
|
418
|
+
then(onfulfilled?: ((value: GetCIDResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
declare class PrivateGateways {
|
|
@@ -448,7 +448,7 @@ declare class FilterFiles {
|
|
|
448
448
|
keyvalues(keyvalues: Record<string, string>): FilterFiles;
|
|
449
449
|
noGroup(noGroup: boolean): FilterFiles;
|
|
450
450
|
pageToken(pageToken: string): FilterFiles;
|
|
451
|
-
then(onfulfilled?: ((value: FileListResponse) => any) | null): Promise<any>;
|
|
451
|
+
then(onfulfilled?: ((value: FileListResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
452
452
|
private fetchPage;
|
|
453
453
|
[Symbol.asyncIterator](): AsyncGenerator<FileListItem, void, unknown>;
|
|
454
454
|
all(): Promise<FileListItem[]>;
|
|
@@ -469,7 +469,7 @@ declare class FilterQueue {
|
|
|
469
469
|
pageToken(pageToken: string): FilterQueue;
|
|
470
470
|
private fetchPage;
|
|
471
471
|
sort(sort: "ASC" | "DSC"): FilterQueue;
|
|
472
|
-
then(onfulfilled?: ((value: PinQueueResponse) => any) | null): Promise<any>;
|
|
472
|
+
then(onfulfilled?: ((value: PinQueueResponse) => any) | null, onrejected?: ((reason: any) => any) | null): Promise<any>;
|
|
473
473
|
private rateLimit;
|
|
474
474
|
[Symbol.asyncIterator](): AsyncGenerator<PinQueueItem, void, unknown>;
|
|
475
475
|
all(): Promise<PinQueueItem[]>;
|
package/dist/index.js
CHANGED
|
@@ -3419,8 +3419,11 @@ var AnalyticsFilter = class {
|
|
|
3419
3419
|
this.query.end_date = end;
|
|
3420
3420
|
return this;
|
|
3421
3421
|
}
|
|
3422
|
-
then(onfulfilled) {
|
|
3423
|
-
return analyticsTopUsage(this.config, this.query).then(
|
|
3422
|
+
then(onfulfilled, onrejected) {
|
|
3423
|
+
return analyticsTopUsage(this.config, this.query).then(
|
|
3424
|
+
onfulfilled,
|
|
3425
|
+
onrejected
|
|
3426
|
+
);
|
|
3424
3427
|
}
|
|
3425
3428
|
};
|
|
3426
3429
|
|
|
@@ -3502,8 +3505,8 @@ var AnalyticsBuilder = class {
|
|
|
3502
3505
|
async getAnalytics() {
|
|
3503
3506
|
throw new Error("getAnalytics method must be implemented in derived class");
|
|
3504
3507
|
}
|
|
3505
|
-
then(onfulfilled) {
|
|
3506
|
-
return this.getAnalytics().then(onfulfilled);
|
|
3508
|
+
then(onfulfilled, onrejected) {
|
|
3509
|
+
return this.getAnalytics().then(onfulfilled, onrejected);
|
|
3507
3510
|
}
|
|
3508
3511
|
};
|
|
3509
3512
|
|
|
@@ -3572,11 +3575,11 @@ var FilterGroups = class {
|
|
|
3572
3575
|
this.query.pageToken = pageToken;
|
|
3573
3576
|
return this;
|
|
3574
3577
|
}
|
|
3575
|
-
then(onfulfilled) {
|
|
3578
|
+
then(onfulfilled, onrejected) {
|
|
3576
3579
|
return this.fetchPage().then((response) => {
|
|
3577
3580
|
this.nextPageToken = response.next_page_token;
|
|
3578
3581
|
return response;
|
|
3579
|
-
}).then(onfulfilled);
|
|
3582
|
+
}).then(onfulfilled, onrejected);
|
|
3580
3583
|
}
|
|
3581
3584
|
async fetchPage() {
|
|
3582
3585
|
if (this.nextPageToken) {
|
|
@@ -3743,8 +3746,8 @@ var FilterKeys = class {
|
|
|
3743
3746
|
this.query.name = name;
|
|
3744
3747
|
return this;
|
|
3745
3748
|
}
|
|
3746
|
-
then(onfulfilled) {
|
|
3747
|
-
return listKeys(this.config, this.query).then(onfulfilled);
|
|
3749
|
+
then(onfulfilled, onrejected) {
|
|
3750
|
+
return listKeys(this.config, this.query).then(onfulfilled, onrejected);
|
|
3748
3751
|
}
|
|
3749
3752
|
// private async rateLimit(): Promise<void> {
|
|
3750
3753
|
// this.requestCount++;
|
|
@@ -3807,9 +3810,10 @@ var OptimizeImageCreateAccessLink = class {
|
|
|
3807
3810
|
this.imgOpts = { ...this.imgOpts, ...options };
|
|
3808
3811
|
return this;
|
|
3809
3812
|
}
|
|
3810
|
-
then(onfulfilled) {
|
|
3813
|
+
then(onfulfilled, onrejected) {
|
|
3811
3814
|
return createAccessLink(this.config, this.urlOpts, this.imgOpts).then(
|
|
3812
|
-
onfulfilled
|
|
3815
|
+
onfulfilled,
|
|
3816
|
+
onrejected
|
|
3813
3817
|
);
|
|
3814
3818
|
}
|
|
3815
3819
|
};
|
|
@@ -3826,9 +3830,10 @@ var OptimizeImageGetCid = class {
|
|
|
3826
3830
|
this.options = { ...this.options, ...options };
|
|
3827
3831
|
return this;
|
|
3828
3832
|
}
|
|
3829
|
-
then(onfulfilled) {
|
|
3833
|
+
then(onfulfilled, onrejected) {
|
|
3830
3834
|
return getCid(this.config, this.cid, this.gatewayType, this.options).then(
|
|
3831
|
-
onfulfilled
|
|
3835
|
+
onfulfilled,
|
|
3836
|
+
onrejected
|
|
3832
3837
|
);
|
|
3833
3838
|
}
|
|
3834
3839
|
};
|
|
@@ -3978,8 +3983,8 @@ var FilterFiles = class {
|
|
|
3978
3983
|
this.query.pageToken = pageToken;
|
|
3979
3984
|
return this;
|
|
3980
3985
|
}
|
|
3981
|
-
then(onfulfilled) {
|
|
3982
|
-
return this.fetchPage().then(onfulfilled);
|
|
3986
|
+
then(onfulfilled, onrejected) {
|
|
3987
|
+
return this.fetchPage().then(onfulfilled, onrejected);
|
|
3983
3988
|
}
|
|
3984
3989
|
async fetchPage() {
|
|
3985
3990
|
if (this.currentPageToken) {
|
|
@@ -4062,8 +4067,8 @@ var FilterQueue = class {
|
|
|
4062
4067
|
this.query.sort = sort;
|
|
4063
4068
|
return this;
|
|
4064
4069
|
}
|
|
4065
|
-
then(onfulfilled) {
|
|
4066
|
-
return queue(this.config, this.query).then(onfulfilled);
|
|
4070
|
+
then(onfulfilled, onrejected) {
|
|
4071
|
+
return queue(this.config, this.query).then(onfulfilled, onrejected);
|
|
4067
4072
|
}
|
|
4068
4073
|
// rate limit, hopefully temporary?
|
|
4069
4074
|
async rateLimit() {
|