pinata 2.2.2 → 2.4.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.
- package/dist/chunk-7UIMBFJ5.mjs +423 -0
- package/dist/chunk-7UIMBFJ5.mjs.map +1 -0
- package/dist/chunk-P556VRQU.js +433 -0
- package/dist/chunk-P556VRQU.js.map +1 -0
- package/dist/index-CQFQEo3K.d.mts +228 -0
- package/dist/index-CQFQEo3K.d.ts +228 -0
- package/dist/index.d.mts +6 -209
- package/dist/index.d.ts +6 -209
- package/dist/index.js +377 -547
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -197
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +32 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +3 -0
- package/dist/react/index.mjs.map +1 -0
- package/package.json +16 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { D as DeleteResponse, V as VectorizeFileResponse, F as FileListQuery, a as FileListResponse, S as SwapCidOptions, b as SwapCidResponse, c as SwapHistoryOptions, U as UpdateFileOptions, d as FileListItem, e as VectorizeQuery, f as VectorizeQueryResponse, G as GetCIDResponse, P as PinQueueQuery, g as PinQueueResponse, O as OptimizeImageOptions, A as AccessLinkOptions, h as UploadOptions, i as UploadResponse, j as SignedUploadUrlOptions, J as JsonBody, k as UploadCIDOptions, l as PinByCIDResponse, m as PinQueueItem } from './index-CQFQEo3K.js';
|
|
2
|
+
export { s as AuthenticationError, q as ContainsCIDResponse, C as ContentType, n as FileObject, N as NetworkError, r as PinataError, o as PinataMetadata, R as ReactUploadOptions, x as UploadResult, y as UseUploadReturn, t as ValidationError, p as VectorQueryMatch, u as containsCID, v as convert, v as convertToDesiredGateway, w as useUpload } from './index-CQFQEo3K.js';
|
|
3
|
+
|
|
1
4
|
type PinataConfig = {
|
|
2
5
|
pinataJwt?: string;
|
|
3
6
|
pinataGateway?: string;
|
|
@@ -53,141 +56,6 @@ type UserPinnedDataResponse = {
|
|
|
53
56
|
pin_size_with_replications_total: number;
|
|
54
57
|
};
|
|
55
58
|
|
|
56
|
-
type FileObject = {
|
|
57
|
-
name: string;
|
|
58
|
-
size: number;
|
|
59
|
-
type: string;
|
|
60
|
-
lastModified: number;
|
|
61
|
-
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
62
|
-
};
|
|
63
|
-
type JsonBody = Record<string, unknown>;
|
|
64
|
-
type PinataMetadata = {
|
|
65
|
-
name?: string;
|
|
66
|
-
keyvalues?: Record<string, string>;
|
|
67
|
-
};
|
|
68
|
-
type UpdateFileOptions = {
|
|
69
|
-
id: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
keyvalues?: Record<string, string>;
|
|
72
|
-
};
|
|
73
|
-
type DeleteResponse = {
|
|
74
|
-
id: string;
|
|
75
|
-
status: string;
|
|
76
|
-
};
|
|
77
|
-
type FileListItem = {
|
|
78
|
-
id: string;
|
|
79
|
-
name: string | null;
|
|
80
|
-
cid: "pending" | string;
|
|
81
|
-
size: number;
|
|
82
|
-
number_of_files: number;
|
|
83
|
-
mime_type: string;
|
|
84
|
-
keyvalues: Record<string, string>;
|
|
85
|
-
group_id: string | null;
|
|
86
|
-
created_at: string;
|
|
87
|
-
};
|
|
88
|
-
type FileListResponse = {
|
|
89
|
-
files: FileListItem[];
|
|
90
|
-
next_page_token: string;
|
|
91
|
-
};
|
|
92
|
-
type FileListQuery = {
|
|
93
|
-
name?: string;
|
|
94
|
-
group?: string;
|
|
95
|
-
noGroup?: boolean;
|
|
96
|
-
mimeType?: string;
|
|
97
|
-
cid?: string;
|
|
98
|
-
cidPending?: boolean;
|
|
99
|
-
metadata?: Record<string, string>;
|
|
100
|
-
order?: "ASC" | "DESC";
|
|
101
|
-
limit?: number;
|
|
102
|
-
pageToken?: string;
|
|
103
|
-
};
|
|
104
|
-
type PinQueueQuery = {
|
|
105
|
-
sort?: "ASC" | "DSC";
|
|
106
|
-
status?: "prechecking" | "retrieving" | "expired" | "backfilled" | "over_free_limit" | "over_max_size" | "invalid_object" | "bad_host_node";
|
|
107
|
-
cid?: string;
|
|
108
|
-
limit?: number;
|
|
109
|
-
pageToken?: string;
|
|
110
|
-
};
|
|
111
|
-
type PinQueueItem = {
|
|
112
|
-
id: string;
|
|
113
|
-
cid?: string;
|
|
114
|
-
ipfs_pin_hash?: string;
|
|
115
|
-
date_queued: string;
|
|
116
|
-
name: string;
|
|
117
|
-
status: string;
|
|
118
|
-
keyvalues: any;
|
|
119
|
-
host_nodes: string[];
|
|
120
|
-
pin_policy: {
|
|
121
|
-
regions: {
|
|
122
|
-
id: string;
|
|
123
|
-
desiredReplicationCount: number;
|
|
124
|
-
}[];
|
|
125
|
-
version: number;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
type PinQueueResponse = {
|
|
129
|
-
jobs: PinQueueItem[];
|
|
130
|
-
next_page_token: string;
|
|
131
|
-
};
|
|
132
|
-
type SwapCidOptions = {
|
|
133
|
-
cid: string;
|
|
134
|
-
swapCid: string;
|
|
135
|
-
};
|
|
136
|
-
type SwapHistoryOptions = {
|
|
137
|
-
cid: string;
|
|
138
|
-
domain: string;
|
|
139
|
-
};
|
|
140
|
-
type SwapCidResponse = {
|
|
141
|
-
mapped_cid: string;
|
|
142
|
-
created_at: string;
|
|
143
|
-
};
|
|
144
|
-
type VectorizeFileResponse = {
|
|
145
|
-
status: boolean;
|
|
146
|
-
};
|
|
147
|
-
type VectorizeQuery = {
|
|
148
|
-
groupId: string;
|
|
149
|
-
query: string;
|
|
150
|
-
returnFile?: boolean;
|
|
151
|
-
};
|
|
152
|
-
type VectorQueryMatch = {
|
|
153
|
-
file_id: string;
|
|
154
|
-
cid: string;
|
|
155
|
-
score: number;
|
|
156
|
-
};
|
|
157
|
-
type VectorizeQueryResponse = {
|
|
158
|
-
count: number;
|
|
159
|
-
matches: VectorQueryMatch[];
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
type ContentType = "application/json" | "application/xml" | "text/plain" | "text/html" | "text/css" | "text/javascript" | "application/javascript" | "image/jpeg" | "image/png" | "image/gif" | "image/svg+xml" | "audio/mpeg" | "audio/ogg" | "video/mp4" | "application/pdf" | "application/octet-stream" | string | null;
|
|
163
|
-
type GetCIDResponse = {
|
|
164
|
-
data?: JSON | string | Blob | null;
|
|
165
|
-
contentType: ContentType;
|
|
166
|
-
};
|
|
167
|
-
type OptimizeImageOptions = {
|
|
168
|
-
width?: number;
|
|
169
|
-
height?: number;
|
|
170
|
-
dpr?: number;
|
|
171
|
-
fit?: "scaleDown" | "contain" | "cover" | "crop" | "pad";
|
|
172
|
-
gravity?: "auto" | "side" | string;
|
|
173
|
-
quality?: number;
|
|
174
|
-
format?: "auto" | "webp";
|
|
175
|
-
animation?: boolean;
|
|
176
|
-
sharpen?: number;
|
|
177
|
-
onError?: boolean;
|
|
178
|
-
metadata?: "keep" | "copyright" | "none";
|
|
179
|
-
};
|
|
180
|
-
type AccessLinkOptions = {
|
|
181
|
-
cid: string;
|
|
182
|
-
date?: number;
|
|
183
|
-
expires: number;
|
|
184
|
-
gateway?: string;
|
|
185
|
-
};
|
|
186
|
-
type ContainsCIDResponse = {
|
|
187
|
-
containsCid: boolean;
|
|
188
|
-
cid: string | null;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
59
|
type GroupOptions = {
|
|
192
60
|
name: string;
|
|
193
61
|
isPublic?: boolean;
|
|
@@ -307,56 +175,6 @@ type SignatureResponse = {
|
|
|
307
175
|
signature: string;
|
|
308
176
|
};
|
|
309
177
|
|
|
310
|
-
type UploadResponse = {
|
|
311
|
-
id: string;
|
|
312
|
-
name: string;
|
|
313
|
-
cid: string;
|
|
314
|
-
size: number;
|
|
315
|
-
created_at: string;
|
|
316
|
-
number_of_files: number;
|
|
317
|
-
mime_type: string;
|
|
318
|
-
group_id: string | null;
|
|
319
|
-
keyvalues: {
|
|
320
|
-
[key: string]: string;
|
|
321
|
-
};
|
|
322
|
-
vectorized: boolean;
|
|
323
|
-
network: string;
|
|
324
|
-
};
|
|
325
|
-
type UploadOptions = {
|
|
326
|
-
metadata?: PinataMetadata;
|
|
327
|
-
keys?: string;
|
|
328
|
-
groupId?: string;
|
|
329
|
-
vectorize?: boolean;
|
|
330
|
-
url?: string;
|
|
331
|
-
peerAddresses?: string[];
|
|
332
|
-
};
|
|
333
|
-
type SignedUploadUrlOptions = {
|
|
334
|
-
date?: number;
|
|
335
|
-
expires: number;
|
|
336
|
-
groupId?: string;
|
|
337
|
-
name?: string;
|
|
338
|
-
keyvalues?: Record<string, string>;
|
|
339
|
-
vectorize?: boolean;
|
|
340
|
-
maxFileSize?: number;
|
|
341
|
-
mimeTypes?: string[];
|
|
342
|
-
};
|
|
343
|
-
type UploadCIDOptions = {
|
|
344
|
-
metadata?: PinataMetadata;
|
|
345
|
-
peerAddresses?: string[];
|
|
346
|
-
keys?: string;
|
|
347
|
-
groupId?: string;
|
|
348
|
-
};
|
|
349
|
-
type PinByCIDResponse = {
|
|
350
|
-
id: string;
|
|
351
|
-
cid: string;
|
|
352
|
-
date_queued: string;
|
|
353
|
-
name: string;
|
|
354
|
-
status: string;
|
|
355
|
-
keyvalues: Record<string, any> | null;
|
|
356
|
-
host_nodes: string[] | null;
|
|
357
|
-
group_id: string | null;
|
|
358
|
-
};
|
|
359
|
-
|
|
360
178
|
declare const analyticsDateInterval: (config: PinataConfig | undefined, options?: TimeIntervalAnalyticsQuery) => Promise<TimeIntervalAnalyticsResponse>;
|
|
361
179
|
|
|
362
180
|
declare const analyticsTopUsage: (config: PinataConfig | undefined, options?: TopAnalyticsQuery) => Promise<TopAnalyticsResponse>;
|
|
@@ -703,6 +521,7 @@ declare class UploadBuilder<T> {
|
|
|
703
521
|
private groupId;
|
|
704
522
|
private vector;
|
|
705
523
|
private uploadUrl;
|
|
524
|
+
private isStreamable;
|
|
706
525
|
private peerAddresses;
|
|
707
526
|
constructor(config: PinataConfig | undefined, uploadFunction: (config: PinataConfig | undefined, ...args: any[]) => Promise<T>, ...args: any[]);
|
|
708
527
|
name(name: string): UploadBuilder<T>;
|
|
@@ -711,6 +530,7 @@ declare class UploadBuilder<T> {
|
|
|
711
530
|
vectorize(): UploadBuilder<T>;
|
|
712
531
|
url(url: string): UploadBuilder<T>;
|
|
713
532
|
group(groupId: string): UploadBuilder<T>;
|
|
533
|
+
streamable(): UploadBuilder<T>;
|
|
714
534
|
peerAddress(peerAddresses: string[]): UploadBuilder<T>;
|
|
715
535
|
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
716
536
|
}
|
|
@@ -778,31 +598,8 @@ declare class PinataSDK {
|
|
|
778
598
|
testAuthentication(): Promise<string>;
|
|
779
599
|
}
|
|
780
600
|
|
|
781
|
-
interface ErrorDetails {
|
|
782
|
-
error?: string;
|
|
783
|
-
code?: string;
|
|
784
|
-
metadata?: Record<string, any>;
|
|
785
|
-
}
|
|
786
|
-
declare class PinataError extends Error {
|
|
787
|
-
statusCode?: number | undefined;
|
|
788
|
-
details?: ErrorDetails | undefined;
|
|
789
|
-
constructor(message: string, statusCode?: number | undefined, details?: ErrorDetails | undefined);
|
|
790
|
-
}
|
|
791
|
-
declare class NetworkError extends PinataError {
|
|
792
|
-
constructor(message: string, statusCode?: number, details?: ErrorDetails);
|
|
793
|
-
}
|
|
794
|
-
declare class AuthenticationError extends PinataError {
|
|
795
|
-
constructor(message: string, statusCode?: number, details?: ErrorDetails);
|
|
796
|
-
}
|
|
797
|
-
declare class ValidationError extends PinataError {
|
|
798
|
-
constructor(message: string, details?: ErrorDetails);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
declare function containsCID(input: string): Promise<ContainsCIDResponse>;
|
|
802
|
-
declare function convertToDesiredGateway(sourceUrl: string, desiredGatewayPrefix: string | undefined): Promise<string>;
|
|
803
|
-
|
|
804
601
|
declare function getFileIdFromUrl(url: string): string;
|
|
805
602
|
|
|
806
603
|
declare const formatConfig: (config: PinataConfig | undefined) => PinataConfig | undefined;
|
|
807
604
|
|
|
808
|
-
export {
|
|
605
|
+
export { AccessLinkOptions, type AnalyticsQuery, type DataEndponts, DeleteResponse, type Endpoints, FileListItem, FileListQuery, FileListResponse, GetCIDResponse, type GetGroupOptions, type GroupCIDOptions, type GroupListResponse, type GroupOptions, type GroupQueryOptions, type GroupResponseItem, JsonBody, type KeyListItem, type KeyListQuery, type KeyListResponse, type KeyOptions, type KeyPermissions, type KeyResponse, OptimizeImageOptions, PinByCIDResponse, PinQueueItem, PinQueueQuery, PinQueueResponse, type PinataConfig, PinataSDK, type PinningEndpoints, type ResourcePermission, type RevokeKeyResponse, type SignatureOptions, type SignatureResponse, SignedUploadUrlOptions, SwapCidOptions, SwapCidResponse, SwapHistoryOptions, type TimeIntervalAnalyticsQuery, type TimeIntervalAnalyticsResponse, type TimePeriodItem, type TopAnalyticsItem, type TopAnalyticsQuery, type TopAnalyticsResponse, UpdateFileOptions, type UpdateGroupFilesResponse, type UpdateGroupOptions, UploadCIDOptions, UploadOptions, UploadResponse, type UserPinnedDataResponse, VectorizeFileResponse, VectorizeQuery, VectorizeQueryResponse, addToGroup, analyticsDateInterval, analyticsTopUsage, convertIPFSUrl, createAccessLink, createGroup, createKey, createSignedUploadURL, deleteFile, deleteFileVectors, deleteGroup, deletePinRequest, deleteSwap, formatConfig, getCid, getFileIdFromUrl, getGroup, listFiles, listGroups, listKeys, pinnedFileCount, queue, removeFromGroup, revokeKeys, swapCid, swapHistory, testAuthentication, totalStorageUsage, updateFile, updateGroup, uploadBase64, uploadCid, uploadFile, uploadFileArray, uploadJson, uploadUrl, vectorizeFile, vectorizeQuery };
|