@gala-chain/launchpad-sdk 3.12.3 → 3.12.5
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/CHANGELOG.md +27 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/files.d.ts +12 -55
- package/dist/schemas/files.d.ts.map +1 -1
- package/dist/utils/multipart.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/schemas/files.d.ts
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
* File Upload Zod Schemas
|
|
3
3
|
*
|
|
4
4
|
* Validation schemas for file uploads (images, documents).
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* IMPORTANT: Browser File class doesn't exist in Node.js, so we use lazy factory functions
|
|
8
|
-
* that only construct schemas at runtime after environment detection.
|
|
5
|
+
* Replaces manual FILE_UPLOAD_CONSTRAINTS with type-safe Zod schemas.
|
|
9
6
|
*/
|
|
10
7
|
import { z } from 'zod';
|
|
11
8
|
/**
|
|
@@ -13,26 +10,12 @@ import { z } from 'zod';
|
|
|
13
10
|
*/
|
|
14
11
|
export declare const IMAGE_EXTENSIONS: readonly [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"];
|
|
15
12
|
/**
|
|
16
|
-
*
|
|
17
|
-
* For server-side file uploads
|
|
18
|
-
*/
|
|
19
|
-
export declare const bufferFileSchema: z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
20
|
-
/**
|
|
21
|
-
* Browser File object validation (lazy)
|
|
22
|
-
* For client-side file uploads
|
|
23
|
-
*/
|
|
24
|
-
export declare function getBrowserFileSchema(): z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodType<File, z.ZodTypeDef, File>, File, File>, File, File>, File, File> | null;
|
|
25
|
-
/**
|
|
26
|
-
* Flexible file schema - accepts File (browser) or Buffer (Node.js) (lazy)
|
|
27
|
-
*/
|
|
28
|
-
export declare function getFlexibleFileSchema(): z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> | z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodType<File, z.ZodTypeDef, File>, File, File>, File, File>, File, File>, z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
|
|
29
|
-
/**
|
|
30
|
-
* File upload validation schema (lazy)
|
|
13
|
+
* File upload validation schema
|
|
31
14
|
* Validates file size, type, and filename
|
|
32
15
|
*/
|
|
33
|
-
export declare
|
|
16
|
+
export declare const fileUploadSchema: z.ZodObject<{
|
|
34
17
|
/** File object (browser File or Node.js Buffer) */
|
|
35
|
-
file: z.
|
|
18
|
+
file: z.ZodUnion<[z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
|
|
36
19
|
/** Filename with extension */
|
|
37
20
|
name: z.ZodString;
|
|
38
21
|
/** File size in bytes */
|
|
@@ -51,45 +34,19 @@ export declare function getFileUploadSchema(): z.ZodObject<{
|
|
|
51
34
|
size: number;
|
|
52
35
|
}>;
|
|
53
36
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
37
|
+
* Browser File object validation
|
|
38
|
+
* For client-side file uploads
|
|
56
39
|
*/
|
|
57
|
-
export declare const browserFileSchema:
|
|
58
|
-
safeParse: (data: unknown) => z.SafeParseSuccess<File> | z.SafeParseError<File> | {
|
|
59
|
-
success: boolean;
|
|
60
|
-
error: Error;
|
|
61
|
-
};
|
|
62
|
-
parse: (data: unknown) => File;
|
|
63
|
-
};
|
|
40
|
+
export declare const browserFileSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodType<File, z.ZodTypeDef, File>, File, File>, File, File>, File, File>;
|
|
64
41
|
/**
|
|
65
|
-
*
|
|
42
|
+
* Node.js Buffer validation
|
|
43
|
+
* For server-side file uploads
|
|
66
44
|
*/
|
|
67
|
-
export declare const
|
|
68
|
-
safeParse: (data: unknown) => z.SafeParseSuccess<File | Buffer<ArrayBufferLike>> | z.SafeParseError<File | Buffer<ArrayBufferLike>>;
|
|
69
|
-
parse: (data: unknown) => File | Buffer<ArrayBufferLike>;
|
|
70
|
-
};
|
|
45
|
+
export declare const bufferFileSchema: z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
71
46
|
/**
|
|
72
|
-
*
|
|
47
|
+
* Flexible file schema - accepts both File and Buffer
|
|
73
48
|
*/
|
|
74
|
-
export declare const
|
|
75
|
-
safeParse: (data: unknown) => z.SafeParseReturnType<{
|
|
76
|
-
type: "image/png" | "image/jpg" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml";
|
|
77
|
-
name: string;
|
|
78
|
-
file: File | Buffer<ArrayBufferLike>;
|
|
79
|
-
size: number;
|
|
80
|
-
}, {
|
|
81
|
-
type: "image/png" | "image/jpg" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml";
|
|
82
|
-
name: string;
|
|
83
|
-
file: File | Buffer<ArrayBufferLike>;
|
|
84
|
-
size: number;
|
|
85
|
-
}>;
|
|
86
|
-
parse: (data: unknown) => {
|
|
87
|
-
type: "image/png" | "image/jpg" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml";
|
|
88
|
-
name: string;
|
|
89
|
-
file: File | Buffer<ArrayBufferLike>;
|
|
90
|
-
size: number;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
49
|
+
export declare const flexibleFileSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodType<File, z.ZodTypeDef, File>, File, File>, File, File>, File, File>, z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
|
|
93
50
|
/**
|
|
94
51
|
* Image extension schema
|
|
95
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/schemas/files.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/schemas/files.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,gBAAgB,6DAA8D,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B,mDAAmD;;IAKnD,8BAA8B;;IAE9B,yBAAyB;;IAEzB,gCAAgC;;;;;;;;;;;;EAEhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mHAmB7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,2IAG5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,4QAG7B,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,oBAAoB,+DAA6D,CAAC;AAE/F;;GAEG;AACH,eAAO,MAAM,mBAAmB,2CAM/B,CAAC;AAMF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../src/utils/multipart.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAGnC,QAAQ,CAAC,EAAE,MAAM;IACjB,QAAQ,CAAC,EAAE,MAAM;gBAFxB,OAAO,EAAE,MAAM,EACR,QAAQ,CAAC,EAAE,MAAM,YAAA,EACjB,QAAQ,CAAC,EAAE,MAAM,YAAA;CAK3B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../src/utils/multipart.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAGnC,QAAQ,CAAC,EAAE,MAAM;IACjB,QAAQ,CAAC,EAAE,MAAM;gBAFxB,OAAO,EAAE,MAAM,EACR,QAAQ,CAAC,EAAE,MAAM,YAAA,EACjB,QAAQ,CAAC,EAAE,MAAM,YAAA;CAK3B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAiGN;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CASzD;AA0BD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACzB,QAAQ,CAiBV;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CA0CnD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAwB9C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAM3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gala-chain/launchpad-sdk",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.5",
|
|
4
4
|
"description": "TypeScript SDK for Gala Launchpad Backend API - Production-ready DeFi token launchpad integration with wallet-based authentication, GalaChain trading, and comprehensive user operations. 100% tested (22/22 endpoints working).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -123,12 +123,12 @@
|
|
|
123
123
|
"registry": "https://registry.npmjs.org/"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
|
-
"ethers": "^6.15.0",
|
|
127
126
|
"@gala-chain/api": "^2.4.3",
|
|
128
127
|
"@gala-chain/connect": "^2.4.3",
|
|
129
|
-
"socket.io-client": "^4.8.1",
|
|
130
128
|
"axios": "^1.12.2",
|
|
131
129
|
"bignumber.js": "^9.1.2",
|
|
130
|
+
"ethers": "^6.15.0",
|
|
131
|
+
"socket.io-client": "^4.8.1",
|
|
132
132
|
"zod": "^3.25.76"
|
|
133
133
|
},
|
|
134
134
|
"browserslist": [
|
|
@@ -147,7 +147,8 @@
|
|
|
147
147
|
"dotenv": "^17.2.3",
|
|
148
148
|
"ethers": "^6.15.0",
|
|
149
149
|
"socket.io-client": "^4.8.1",
|
|
150
|
-
"uuid": "^
|
|
150
|
+
"uuid": "^9.0.1",
|
|
151
|
+
"web-file-polyfill": "^1.0.4",
|
|
151
152
|
"zod": "^3.25.76",
|
|
152
153
|
"zod-to-json-schema": "^3.24.6"
|
|
153
154
|
},
|