tuturuuu 0.1.4 → 0.1.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/README.md +28 -0
- package/package.json +7 -7
- package/dist/errors.d.ts +0 -90
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -174
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -56
- package/dist/index.js.map +0 -1
- package/dist/storage.d.ts +0 -372
- package/dist/storage.d.ts.map +0 -1
- package/dist/storage.js +0 -806
- package/dist/storage.js.map +0 -1
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -22
- package/dist/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ const doc = await client.documents.create({
|
|
|
42
42
|
- ✅ **Direct Uploads** - Generate signed URLs for client-side uploads without proxying
|
|
43
43
|
- ✅ **Document Management** - Create, read, update, delete workspace documents
|
|
44
44
|
- ✅ **Signed URLs** - Generate temporary shareable links for files
|
|
45
|
+
- ✅ **Image Resizing** - Request Supabase-powered image transforms on share/download
|
|
45
46
|
- ✅ **Storage Analytics** - Track usage, file counts, and limits
|
|
46
47
|
- ✅ **Type-Safe** - Full TypeScript support with type inference
|
|
47
48
|
- ✅ **Error Handling** - Comprehensive error classes for all scenarios
|
|
@@ -96,6 +97,19 @@ const result = await client.storage.upload(file, {
|
|
|
96
97
|
const blob = await client.storage.download('documents/report.pdf');
|
|
97
98
|
```
|
|
98
99
|
|
|
100
|
+
Resize an image during download:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
const blob = await client.storage.download('images/photo.png', {
|
|
104
|
+
transform: {
|
|
105
|
+
width: 320,
|
|
106
|
+
height: 180,
|
|
107
|
+
resize: 'cover',
|
|
108
|
+
quality: 80
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
99
113
|
#### Delete Files
|
|
100
114
|
|
|
101
115
|
```typescript
|
|
@@ -145,6 +159,20 @@ const { data } = await client.storage.share('documents/report.pdf', {
|
|
|
145
159
|
console.log(data.signedUrl);
|
|
146
160
|
```
|
|
147
161
|
|
|
162
|
+
Resize an image before sharing it:
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
const { data } = await client.storage.share('images/photo.png', {
|
|
166
|
+
expiresIn: 3600,
|
|
167
|
+
transform: {
|
|
168
|
+
width: 320,
|
|
169
|
+
height: 180,
|
|
170
|
+
resize: 'contain',
|
|
171
|
+
quality: 85
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
148
176
|
#### Get Analytics
|
|
149
177
|
|
|
150
178
|
```typescript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tuturuuu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Official TypeScript/JavaScript SDK for the Tuturuuu platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Tuturuuu",
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@tuturuuu/types": "0.2.3",
|
|
56
|
-
"zod": "^4.
|
|
56
|
+
"zod": "^4.3.6"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@tuturuuu/typescript-config": "
|
|
60
|
-
"@types/node": "^
|
|
61
|
-
"typescript": "^
|
|
62
|
-
"vitest": "^4.
|
|
59
|
+
"@tuturuuu/typescript-config": "workspace:*",
|
|
60
|
+
"@types/node": "^25.5.0",
|
|
61
|
+
"typescript": "^6.0.2",
|
|
62
|
+
"vitest": "^4.1.2"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=18.0.0"
|
|
66
66
|
},
|
|
67
|
-
"packageManager": "bun@1.3.
|
|
67
|
+
"packageManager": "bun@1.3.11"
|
|
68
68
|
}
|
package/dist/errors.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error classes for the Tuturuuu SDK
|
|
3
|
-
*/
|
|
4
|
-
import type { ApiErrorResponse } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Base error class for all SDK errors
|
|
7
|
-
*/
|
|
8
|
-
export declare class TuturuuuError extends Error {
|
|
9
|
-
readonly code?: string;
|
|
10
|
-
readonly statusCode?: number;
|
|
11
|
-
constructor(message: string, code?: string, statusCode?: number);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Authentication error (401)
|
|
15
|
-
*/
|
|
16
|
-
export declare class AuthenticationError extends TuturuuuError {
|
|
17
|
-
constructor(message: string, code?: string);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Authorization error (403)
|
|
21
|
-
*/
|
|
22
|
-
export declare class AuthorizationError extends TuturuuuError {
|
|
23
|
-
constructor(message: string, code?: string);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Not found error (404)
|
|
27
|
-
*/
|
|
28
|
-
export declare class NotFoundError extends TuturuuuError {
|
|
29
|
-
constructor(message: string, code?: string);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Bad request error (400)
|
|
33
|
-
*/
|
|
34
|
-
export declare class BadRequestError extends TuturuuuError {
|
|
35
|
-
constructor(message: string, code?: string);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Conflict error (409)
|
|
39
|
-
*/
|
|
40
|
-
export declare class ConflictError extends TuturuuuError {
|
|
41
|
-
constructor(message: string, code?: string);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Rate limit error (429)
|
|
45
|
-
*/
|
|
46
|
-
export declare class RateLimitError extends TuturuuuError {
|
|
47
|
-
/** Number of seconds to wait before retrying (from Retry-After header) */
|
|
48
|
-
readonly retryAfter?: number;
|
|
49
|
-
/** Unix timestamp when the rate limit resets (from X-RateLimit-Reset header) */
|
|
50
|
-
readonly resetTime?: number;
|
|
51
|
-
constructor(message: string, options?: {
|
|
52
|
-
code?: string;
|
|
53
|
-
retryAfter?: number;
|
|
54
|
-
resetTime?: number;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Internal server error (500)
|
|
59
|
-
*/
|
|
60
|
-
export declare class InternalServerError extends TuturuuuError {
|
|
61
|
-
constructor(message: string, code?: string);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Network error
|
|
65
|
-
*/
|
|
66
|
-
export declare class NetworkError extends TuturuuuError {
|
|
67
|
-
constructor(message: string);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Validation error
|
|
71
|
-
*/
|
|
72
|
-
export declare class ValidationError extends TuturuuuError {
|
|
73
|
-
constructor(message: string);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Options for creating a rate limit error from response headers
|
|
77
|
-
*/
|
|
78
|
-
export interface RateLimitHeaders {
|
|
79
|
-
retryAfter?: string | null;
|
|
80
|
-
resetTime?: string | null;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Helper function to create appropriate error from API response
|
|
84
|
-
*/
|
|
85
|
-
export declare function createErrorFromResponse(response: ApiErrorResponse, statusCode: number, rateLimitHeaders?: RateLimitHeaders): TuturuuuError;
|
|
86
|
-
/**
|
|
87
|
-
* Type guard to check if an object is an ApiErrorResponse
|
|
88
|
-
*/
|
|
89
|
-
export declare function isApiErrorResponse(obj: unknown): obj is ApiErrorResponse;
|
|
90
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MA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qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,aAAa;gBACpC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,MAAM,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,aAAa,CA4Bf;AAWD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,gBAAgB,CASxE"}
|
package/dist/errors.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Error classes for the Tuturuuu SDK
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ValidationError = exports.NetworkError = exports.InternalServerError = exports.RateLimitError = exports.ConflictError = exports.BadRequestError = exports.NotFoundError = exports.AuthorizationError = exports.AuthenticationError = exports.TuturuuuError = void 0;
|
|
7
|
-
exports.createErrorFromResponse = createErrorFromResponse;
|
|
8
|
-
exports.isApiErrorResponse = isApiErrorResponse;
|
|
9
|
-
/**
|
|
10
|
-
* Base error class for all SDK errors
|
|
11
|
-
*/
|
|
12
|
-
class TuturuuuError extends Error {
|
|
13
|
-
code;
|
|
14
|
-
statusCode;
|
|
15
|
-
constructor(message, code, statusCode) {
|
|
16
|
-
super(message);
|
|
17
|
-
this.name = 'TuturuuuError';
|
|
18
|
-
this.code = code;
|
|
19
|
-
this.statusCode = statusCode;
|
|
20
|
-
// Maintains proper stack trace for where our error was thrown
|
|
21
|
-
if (Error.captureStackTrace) {
|
|
22
|
-
Error.captureStackTrace(this, this.constructor);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.TuturuuuError = TuturuuuError;
|
|
27
|
-
/**
|
|
28
|
-
* Authentication error (401)
|
|
29
|
-
*/
|
|
30
|
-
class AuthenticationError extends TuturuuuError {
|
|
31
|
-
constructor(message, code) {
|
|
32
|
-
super(message, code, 401);
|
|
33
|
-
this.name = 'AuthenticationError';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.AuthenticationError = AuthenticationError;
|
|
37
|
-
/**
|
|
38
|
-
* Authorization error (403)
|
|
39
|
-
*/
|
|
40
|
-
class AuthorizationError extends TuturuuuError {
|
|
41
|
-
constructor(message, code) {
|
|
42
|
-
super(message, code, 403);
|
|
43
|
-
this.name = 'AuthorizationError';
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.AuthorizationError = AuthorizationError;
|
|
47
|
-
/**
|
|
48
|
-
* Not found error (404)
|
|
49
|
-
*/
|
|
50
|
-
class NotFoundError extends TuturuuuError {
|
|
51
|
-
constructor(message, code) {
|
|
52
|
-
super(message, code, 404);
|
|
53
|
-
this.name = 'NotFoundError';
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.NotFoundError = NotFoundError;
|
|
57
|
-
/**
|
|
58
|
-
* Bad request error (400)
|
|
59
|
-
*/
|
|
60
|
-
class BadRequestError extends TuturuuuError {
|
|
61
|
-
constructor(message, code) {
|
|
62
|
-
super(message, code, 400);
|
|
63
|
-
this.name = 'BadRequestError';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.BadRequestError = BadRequestError;
|
|
67
|
-
/**
|
|
68
|
-
* Conflict error (409)
|
|
69
|
-
*/
|
|
70
|
-
class ConflictError extends TuturuuuError {
|
|
71
|
-
constructor(message, code) {
|
|
72
|
-
super(message, code, 409);
|
|
73
|
-
this.name = 'ConflictError';
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.ConflictError = ConflictError;
|
|
77
|
-
/**
|
|
78
|
-
* Rate limit error (429)
|
|
79
|
-
*/
|
|
80
|
-
class RateLimitError extends TuturuuuError {
|
|
81
|
-
/** Number of seconds to wait before retrying (from Retry-After header) */
|
|
82
|
-
retryAfter;
|
|
83
|
-
/** Unix timestamp when the rate limit resets (from X-RateLimit-Reset header) */
|
|
84
|
-
resetTime;
|
|
85
|
-
constructor(message, options) {
|
|
86
|
-
super(message, options?.code, 429);
|
|
87
|
-
this.name = 'RateLimitError';
|
|
88
|
-
this.retryAfter = options?.retryAfter;
|
|
89
|
-
this.resetTime = options?.resetTime;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.RateLimitError = RateLimitError;
|
|
93
|
-
/**
|
|
94
|
-
* Internal server error (500)
|
|
95
|
-
*/
|
|
96
|
-
class InternalServerError extends TuturuuuError {
|
|
97
|
-
constructor(message, code) {
|
|
98
|
-
super(message, code, 500);
|
|
99
|
-
this.name = 'InternalServerError';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.InternalServerError = InternalServerError;
|
|
103
|
-
/**
|
|
104
|
-
* Network error
|
|
105
|
-
*/
|
|
106
|
-
class NetworkError extends TuturuuuError {
|
|
107
|
-
constructor(message) {
|
|
108
|
-
super(message, 'NETWORK_ERROR');
|
|
109
|
-
this.name = 'NetworkError';
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
exports.NetworkError = NetworkError;
|
|
113
|
-
/**
|
|
114
|
-
* Validation error
|
|
115
|
-
*/
|
|
116
|
-
class ValidationError extends TuturuuuError {
|
|
117
|
-
constructor(message) {
|
|
118
|
-
super(message, 'VALIDATION_ERROR', 400);
|
|
119
|
-
this.name = 'ValidationError';
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.ValidationError = ValidationError;
|
|
123
|
-
/**
|
|
124
|
-
* Helper function to create appropriate error from API response
|
|
125
|
-
*/
|
|
126
|
-
function createErrorFromResponse(response, statusCode, rateLimitHeaders) {
|
|
127
|
-
const { message, code } = response;
|
|
128
|
-
switch (statusCode) {
|
|
129
|
-
case 400:
|
|
130
|
-
return new BadRequestError(message, code);
|
|
131
|
-
case 401:
|
|
132
|
-
return new AuthenticationError(message, code);
|
|
133
|
-
case 403:
|
|
134
|
-
return new AuthorizationError(message, code);
|
|
135
|
-
case 404:
|
|
136
|
-
return new NotFoundError(message, code);
|
|
137
|
-
case 409:
|
|
138
|
-
return new ConflictError(message, code);
|
|
139
|
-
case 429:
|
|
140
|
-
return new RateLimitError(message, {
|
|
141
|
-
code,
|
|
142
|
-
retryAfter: parseIntSafe(rateLimitHeaders?.retryAfter),
|
|
143
|
-
resetTime: parseIntSafe(rateLimitHeaders?.resetTime),
|
|
144
|
-
});
|
|
145
|
-
case 500:
|
|
146
|
-
case 502:
|
|
147
|
-
case 503:
|
|
148
|
-
case 504:
|
|
149
|
-
return new InternalServerError(message, code);
|
|
150
|
-
default:
|
|
151
|
-
return new TuturuuuError(message, code, statusCode);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Safely parse a string to integer, returning undefined for invalid values
|
|
156
|
-
*/
|
|
157
|
-
function parseIntSafe(value) {
|
|
158
|
-
if (!value)
|
|
159
|
-
return undefined;
|
|
160
|
-
const parsed = parseInt(value, 10);
|
|
161
|
-
return isNaN(parsed) || parsed < 0 ? undefined : parsed;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Type guard to check if an object is an ApiErrorResponse
|
|
165
|
-
*/
|
|
166
|
-
function isApiErrorResponse(obj) {
|
|
167
|
-
return (typeof obj === 'object' &&
|
|
168
|
-
obj !== null &&
|
|
169
|
-
'error' in obj &&
|
|
170
|
-
'message' in obj &&
|
|
171
|
-
typeof obj.error === 'string' &&
|
|
172
|
-
typeof obj.message === 'string');
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
DELETED
|
@@ -1 +0,0 @@
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,OAAO,SAAS,CAAC;IAC7B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,GAAY;IAC7C,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,OAAO,IAAI,GAAG;QACd,SAAS,IAAI,GAAG;QAChB,OAAQ,GAAW,CAAC,KAAK,KAAK,QAAQ;QACtC,OAAQ,GAAW,CAAC,OAAO,KAAK,QAAQ,CACzC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tuturuuu SDK
|
|
3
|
-
*
|
|
4
|
-
* Official TypeScript/JavaScript SDK for interacting with the Tuturuuu platform.
|
|
5
|
-
* Provides access to storage (files/folders) and documents via API keys.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export { AuthenticationError, AuthorizationError, BadRequestError, ConflictError, createErrorFromResponse, InternalServerError, isApiErrorResponse, NetworkError, NotFoundError, RateLimitError, TuturuuuError, ValidationError, } from './errors';
|
|
10
|
-
export type { RetryConfig, TuturuuuClientConfig } from './storage';
|
|
11
|
-
/**
|
|
12
|
-
* Default Tuturuuu client instance with auto-configured credentials
|
|
13
|
-
*
|
|
14
|
-
* Automatically loads from environment variables:
|
|
15
|
-
* - TUTURUUU_API_KEY (required)
|
|
16
|
-
* - TUTURUUU_BASE_URL (optional, defaults to https://tuturuuu.com/api/v1)
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* import { tuturuuu } from 'tuturuuu';
|
|
21
|
-
*
|
|
22
|
-
* const analytics = await tuturuuu.storage.getAnalytics();
|
|
23
|
-
* const files = await tuturuuu.storage.list({ path: 'documents' });
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export { DocumentsClient, StorageClient, tuturuuu, TuturuuuClient, } from './storage';
|
|
27
|
-
export type { AnalyticsResponse, ApiErrorResponse, BatchShareResponse, CreateDocumentData, CreateFolderResponse, CreateSignedUploadUrlOptions, DeleteDocumentResponse, DeleteResponse, Document, DocumentResponse, GetDocumentResponse, ListDocumentsOptions, ListDocumentsResponse, ListStorageOptions, ListStorageResponse, Pagination, ShareOptions, ShareResponse, SignedUploadUrlResponse, SignedUrlData, StorageAnalytics, StorageObject, UpdateDocumentData, UploadOptions, UploadResponse, } from './types';
|
|
28
|
-
export { createDocumentDataSchema, createSignedUploadUrlOptionsSchema, listDocumentsOptionsSchema, listStorageOptionsSchema, shareOptionsSchema, updateDocumentDataSchema, uploadOptionsSchema, } from './types';
|
|
29
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEnE;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,eAAe,EACf,aAAa,EACb,QAAQ,EACR,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,EACtB,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,wBAAwB,EACxB,kCAAkC,EAClC,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Tuturuuu SDK
|
|
4
|
-
*
|
|
5
|
-
* Official TypeScript/JavaScript SDK for interacting with the Tuturuuu platform.
|
|
6
|
-
* Provides access to storage (files/folders) and documents via API keys.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.uploadOptionsSchema = exports.updateDocumentDataSchema = exports.shareOptionsSchema = exports.listStorageOptionsSchema = exports.listDocumentsOptionsSchema = exports.createSignedUploadUrlOptionsSchema = exports.createDocumentDataSchema = exports.TuturuuuClient = exports.tuturuuu = exports.StorageClient = exports.DocumentsClient = exports.ValidationError = exports.TuturuuuError = exports.RateLimitError = exports.NotFoundError = exports.NetworkError = exports.isApiErrorResponse = exports.InternalServerError = exports.createErrorFromResponse = exports.ConflictError = exports.BadRequestError = exports.AuthorizationError = exports.AuthenticationError = void 0;
|
|
12
|
-
// Errors
|
|
13
|
-
var errors_1 = require("./errors");
|
|
14
|
-
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return errors_1.AuthenticationError; } });
|
|
15
|
-
Object.defineProperty(exports, "AuthorizationError", { enumerable: true, get: function () { return errors_1.AuthorizationError; } });
|
|
16
|
-
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return errors_1.BadRequestError; } });
|
|
17
|
-
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return errors_1.ConflictError; } });
|
|
18
|
-
Object.defineProperty(exports, "createErrorFromResponse", { enumerable: true, get: function () { return errors_1.createErrorFromResponse; } });
|
|
19
|
-
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return errors_1.InternalServerError; } });
|
|
20
|
-
Object.defineProperty(exports, "isApiErrorResponse", { enumerable: true, get: function () { return errors_1.isApiErrorResponse; } });
|
|
21
|
-
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return errors_1.NetworkError; } });
|
|
22
|
-
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return errors_1.NotFoundError; } });
|
|
23
|
-
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return errors_1.RateLimitError; } });
|
|
24
|
-
Object.defineProperty(exports, "TuturuuuError", { enumerable: true, get: function () { return errors_1.TuturuuuError; } });
|
|
25
|
-
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
26
|
-
// Main client
|
|
27
|
-
/**
|
|
28
|
-
* Default Tuturuuu client instance with auto-configured credentials
|
|
29
|
-
*
|
|
30
|
-
* Automatically loads from environment variables:
|
|
31
|
-
* - TUTURUUU_API_KEY (required)
|
|
32
|
-
* - TUTURUUU_BASE_URL (optional, defaults to https://tuturuuu.com/api/v1)
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* import { tuturuuu } from 'tuturuuu';
|
|
37
|
-
*
|
|
38
|
-
* const analytics = await tuturuuu.storage.getAnalytics();
|
|
39
|
-
* const files = await tuturuuu.storage.list({ path: 'documents' });
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
var storage_1 = require("./storage");
|
|
43
|
-
Object.defineProperty(exports, "DocumentsClient", { enumerable: true, get: function () { return storage_1.DocumentsClient; } });
|
|
44
|
-
Object.defineProperty(exports, "StorageClient", { enumerable: true, get: function () { return storage_1.StorageClient; } });
|
|
45
|
-
Object.defineProperty(exports, "tuturuuu", { enumerable: true, get: function () { return storage_1.tuturuuu; } });
|
|
46
|
-
Object.defineProperty(exports, "TuturuuuClient", { enumerable: true, get: function () { return storage_1.TuturuuuClient; } });
|
|
47
|
-
// Zod schemas (for external validation if needed)
|
|
48
|
-
var types_1 = require("./types");
|
|
49
|
-
Object.defineProperty(exports, "createDocumentDataSchema", { enumerable: true, get: function () { return types_1.createDocumentDataSchema; } });
|
|
50
|
-
Object.defineProperty(exports, "createSignedUploadUrlOptionsSchema", { enumerable: true, get: function () { return types_1.createSignedUploadUrlOptionsSchema; } });
|
|
51
|
-
Object.defineProperty(exports, "listDocumentsOptionsSchema", { enumerable: true, get: function () { return types_1.listDocumentsOptionsSchema; } });
|
|
52
|
-
Object.defineProperty(exports, "listStorageOptionsSchema", { enumerable: true, get: function () { return types_1.listStorageOptionsSchema; } });
|
|
53
|
-
Object.defineProperty(exports, "shareOptionsSchema", { enumerable: true, get: function () { return types_1.shareOptionsSchema; } });
|
|
54
|
-
Object.defineProperty(exports, "updateDocumentDataSchema", { enumerable: true, get: function () { return types_1.updateDocumentDataSchema; } });
|
|
55
|
-
Object.defineProperty(exports, "uploadOptionsSchema", { enumerable: true, get: function () { return types_1.uploadOptionsSchema; } });
|
|
56
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,SAAS;AACT,mCAakB;AAZhB,6GAAA,mBAAmB,OAAA;AACnB,4GAAA,kBAAkB,OAAA;AAClB,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AACb,iHAAA,uBAAuB,OAAA;AACvB,6GAAA,mBAAmB,OAAA;AACnB,4GAAA,kBAAkB,OAAA;AAClB,sGAAA,YAAY,OAAA;AACZ,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AACd,uGAAA,aAAa,OAAA;AACb,yGAAA,eAAe,OAAA;AAGjB,cAAc;AACd;;;;;;;;;;;;;;GAcG;AACH,qCAKmB;AAJjB,0GAAA,eAAe,OAAA;AACf,wGAAA,aAAa,OAAA;AACb,mGAAA,QAAQ,OAAA;AACR,yGAAA,cAAc,OAAA;AA8BhB,kDAAkD;AAClD,iCAQiB;AAPf,iHAAA,wBAAwB,OAAA;AACxB,2HAAA,kCAAkC,OAAA;AAClC,mHAAA,0BAA0B,OAAA;AAC1B,iHAAA,wBAAwB,OAAA;AACxB,2GAAA,kBAAkB,OAAA;AAClB,iHAAA,wBAAwB,OAAA;AACxB,4GAAA,mBAAmB,OAAA"}
|