tuturuuu 0.2.0 → 0.2.2

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/src/types.ts DELETED
@@ -1,202 +0,0 @@
1
- /**
2
- * Type definitions for the Tuturuuu SDK
3
- */
4
-
5
- import type {
6
- ShareOptions as BaseShareOptions,
7
- ExternalProjectEntryStatus,
8
- Json,
9
- } from '@tuturuuu/types';
10
- import {
11
- shareOptionsSchema as baseShareOptionsSchema,
12
- createDocumentDataSchema,
13
- createSignedUploadUrlOptionsSchema,
14
- listDocumentsOptionsSchema,
15
- listStorageOptionsSchema,
16
- updateDocumentDataSchema,
17
- uploadOptionsSchema,
18
- } from '@tuturuuu/types';
19
- import { z } from 'zod';
20
-
21
- export type {
22
- AnalyticsResponse,
23
- ApiErrorResponse,
24
- BatchShareResponse,
25
- CreateDocumentData,
26
- CreateFolderResponse,
27
- CreateSignedUploadUrlOptions,
28
- DeleteDocumentResponse,
29
- DeleteResponse,
30
- Document,
31
- DocumentResponse,
32
- ExternalProjectAdapterKind,
33
- ExternalProjectAttentionItem,
34
- ExternalProjectBulkUpdateAction,
35
- ExternalProjectBulkUpdatePayload,
36
- ExternalProjectCollection,
37
- ExternalProjectDeliveryAsset,
38
- ExternalProjectDeliveryCollection,
39
- ExternalProjectDeliveryEntry,
40
- ExternalProjectDeliveryPayload,
41
- ExternalProjectEntry,
42
- ExternalProjectEntryStatus,
43
- ExternalProjectLoadingData,
44
- ExternalProjectStudioData,
45
- ExternalProjectSummary,
46
- ExternalProjectSummaryCollection,
47
- ExternalProjectSummaryCounts,
48
- ExternalProjectSummaryQueues,
49
- GetDocumentResponse,
50
- ListDocumentsOptions,
51
- ListDocumentsResponse,
52
- ListStorageOptions,
53
- ListStorageResponse,
54
- Pagination,
55
- PathData,
56
- PathResponse,
57
- ShareResponse,
58
- SignedUploadUrlResponse,
59
- SignedUrlData,
60
- StorageAnalytics,
61
- StorageObject,
62
- UpdateDocumentData,
63
- UploadOptions,
64
- UploadResponse,
65
- WorkspaceExternalProjectBinding,
66
- YoolaExternalProjectArtworkLoadingItem,
67
- YoolaExternalProjectLoadingData,
68
- YoolaExternalProjectLoreCapsuleLoadingItem,
69
- YoolaExternalProjectSectionLoadingItem,
70
- } from '@tuturuuu/types';
71
-
72
- export type ImageResizeMode = 'cover' | 'contain' | 'fill';
73
-
74
- export interface ImageTransformOptions {
75
- width?: number;
76
- height?: number;
77
- resize?: ImageResizeMode;
78
- quality?: number;
79
- format?: 'origin';
80
- }
81
-
82
- export interface ShareOptions extends BaseShareOptions {
83
- transform?: ImageTransformOptions;
84
- }
85
-
86
- export interface DownloadOptions {
87
- transform?: ImageTransformOptions;
88
- }
89
-
90
- export interface EpmCollectionPayload {
91
- collection_type: string;
92
- config: EpmCollectionConfig;
93
- description?: string | null;
94
- slug: string;
95
- title: string;
96
- }
97
-
98
- export interface EpmCollectionNavigationConfig {
99
- href?: string | null;
100
- title?: string | null;
101
- visible?: boolean | null;
102
- [key: string]: Json | undefined;
103
- }
104
-
105
- export interface EpmCollectionConfig {
106
- navigation?: EpmCollectionNavigationConfig | null;
107
- [key: string]: Json | undefined;
108
- }
109
-
110
- export interface EpmEntryPayload {
111
- collection_id: string;
112
- metadata: Json;
113
- profile_data: Json;
114
- scheduled_for?: string | null;
115
- slug: string;
116
- status: ExternalProjectEntryStatus;
117
- subtitle?: string | null;
118
- summary?: string | null;
119
- title: string;
120
- }
121
-
122
- export interface EpmBlockPayload {
123
- block_type: string;
124
- content: Json;
125
- entry_id: string;
126
- sort_order?: number;
127
- title?: string | null;
128
- }
129
-
130
- export interface EpmAssetPayload {
131
- alt_text?: string | null;
132
- asset_type: string;
133
- block_id?: string | null;
134
- entry_id?: string | null;
135
- metadata: EpmAssetMetadata;
136
- sort_order?: number;
137
- source_url?: string | null;
138
- storage_path?: string | null;
139
- }
140
-
141
- export interface EpmAssetMetadata {
142
- caption?: string | null;
143
- [key: string]: Json | undefined;
144
- }
145
-
146
- export interface EpmEntryListOptions {
147
- collectionId?: string;
148
- }
149
-
150
- export interface EpmAssetUploadOptions {
151
- collectionType: string;
152
- entrySlug: string;
153
- upsert?: boolean;
154
- }
155
-
156
- export type EpmPublishEventKind = 'publish' | 'preview' | 'unpublish';
157
-
158
- export type EpmEntryUpdatePayload = Partial<EpmEntryPayload>;
159
- export type EpmCollectionUpdatePayload = Partial<EpmCollectionPayload> & {
160
- is_enabled?: boolean;
161
- };
162
- export type EpmBlockUpdatePayload = Partial<EpmBlockPayload>;
163
- export type EpmAssetUpdatePayload = Partial<EpmAssetPayload>;
164
-
165
- export {
166
- createDocumentDataSchema,
167
- createSignedUploadUrlOptionsSchema,
168
- listDocumentsOptionsSchema,
169
- listStorageOptionsSchema,
170
- updateDocumentDataSchema,
171
- uploadOptionsSchema,
172
- };
173
-
174
- export const imageTransformOptionsSchema = z
175
- .object({
176
- width: z.number().int().min(1).max(2500).finite().optional(),
177
- height: z.number().int().min(1).max(2500).finite().optional(),
178
- resize: z.enum(['cover', 'contain', 'fill']).optional(),
179
- quality: z.number().int().min(20).max(100).finite().optional(),
180
- format: z.literal('origin').optional(),
181
- })
182
- .refine((data) => data.width !== undefined || data.height !== undefined, {
183
- message: 'transform must include width or height',
184
- });
185
-
186
- export const shareOptionsSchema = baseShareOptionsSchema.extend({
187
- transform: imageTransformOptionsSchema.optional(),
188
- });
189
-
190
- export const downloadOptionsSchema = z
191
- .object({
192
- transform: imageTransformOptionsSchema,
193
- })
194
- .partial();
195
-
196
- export const externalProjectDeliveryOptionsSchema = z.object({
197
- preview: z.boolean().optional(),
198
- });
199
-
200
- export type ExternalProjectDeliveryOptions = z.infer<
201
- typeof externalProjectDeliveryOptionsSchema
202
- >;