tuturuuu 0.1.7 → 0.2.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/README.md +119 -0
- package/dist/epm.d.ts +72 -0
- package/dist/epm.d.ts.map +1 -0
- package/dist/epm.js +418 -0
- package/dist/epm.js.map +1 -0
- package/dist/external-projects.d.ts +6 -0
- package/dist/external-projects.d.ts.map +1 -0
- package/dist/external-projects.js +9 -0
- package/dist/external-projects.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/storage.d.ts +4 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +16 -0
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +70 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/package.json +21 -5
- package/src/epm.ts +711 -0
- package/src/external-projects.ts +11 -0
- package/src/index.ts +48 -0
- package/src/storage.ts +16 -0
- package/src/types.ts +110 -1
package/src/index.ts
CHANGED
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
export type { EpmClientConfig } from './epm';
|
|
11
|
+
export {
|
|
12
|
+
buildEpmNavigationItems,
|
|
13
|
+
EpmClient,
|
|
14
|
+
getEpmCollectionNavigationConfig,
|
|
15
|
+
getEpmCollectionNavigationTitle,
|
|
16
|
+
isYoolaExternalProjectLoadingData,
|
|
17
|
+
} from './epm';
|
|
10
18
|
// Errors
|
|
11
19
|
export {
|
|
12
20
|
AuthenticationError,
|
|
@@ -22,6 +30,8 @@ export {
|
|
|
22
30
|
TuturuuuError,
|
|
23
31
|
ValidationError,
|
|
24
32
|
} from './errors';
|
|
33
|
+
export type { ExternalProjectsClientConfig } from './external-projects';
|
|
34
|
+
export { ExternalProjectsClient } from './external-projects';
|
|
25
35
|
export type { RetryConfig, TuturuuuClientConfig } from './storage';
|
|
26
36
|
// Main client
|
|
27
37
|
/**
|
|
@@ -58,6 +68,38 @@ export type {
|
|
|
58
68
|
Document,
|
|
59
69
|
DocumentResponse,
|
|
60
70
|
DownloadOptions,
|
|
71
|
+
EpmAssetMetadata,
|
|
72
|
+
EpmAssetPayload,
|
|
73
|
+
EpmAssetUpdatePayload,
|
|
74
|
+
EpmAssetUploadOptions,
|
|
75
|
+
EpmBlockPayload,
|
|
76
|
+
EpmBlockUpdatePayload,
|
|
77
|
+
EpmCollectionConfig,
|
|
78
|
+
EpmCollectionNavigationConfig,
|
|
79
|
+
EpmCollectionPayload,
|
|
80
|
+
EpmCollectionUpdatePayload,
|
|
81
|
+
EpmEntryListOptions,
|
|
82
|
+
EpmEntryPayload,
|
|
83
|
+
EpmEntryUpdatePayload,
|
|
84
|
+
EpmPublishEventKind,
|
|
85
|
+
ExternalProjectAdapterKind,
|
|
86
|
+
ExternalProjectAttentionItem,
|
|
87
|
+
ExternalProjectBulkUpdateAction,
|
|
88
|
+
ExternalProjectBulkUpdatePayload,
|
|
89
|
+
ExternalProjectCollection,
|
|
90
|
+
ExternalProjectDeliveryAsset,
|
|
91
|
+
ExternalProjectDeliveryCollection,
|
|
92
|
+
ExternalProjectDeliveryEntry,
|
|
93
|
+
ExternalProjectDeliveryOptions,
|
|
94
|
+
ExternalProjectDeliveryPayload,
|
|
95
|
+
ExternalProjectEntry,
|
|
96
|
+
ExternalProjectEntryStatus,
|
|
97
|
+
ExternalProjectLoadingData,
|
|
98
|
+
ExternalProjectStudioData,
|
|
99
|
+
ExternalProjectSummary,
|
|
100
|
+
ExternalProjectSummaryCollection,
|
|
101
|
+
ExternalProjectSummaryCounts,
|
|
102
|
+
ExternalProjectSummaryQueues,
|
|
61
103
|
GetDocumentResponse,
|
|
62
104
|
ImageResizeMode,
|
|
63
105
|
ImageTransformOptions,
|
|
@@ -75,12 +117,18 @@ export type {
|
|
|
75
117
|
UpdateDocumentData,
|
|
76
118
|
UploadOptions,
|
|
77
119
|
UploadResponse,
|
|
120
|
+
WorkspaceExternalProjectBinding,
|
|
121
|
+
YoolaExternalProjectArtworkLoadingItem,
|
|
122
|
+
YoolaExternalProjectLoadingData,
|
|
123
|
+
YoolaExternalProjectLoreCapsuleLoadingItem,
|
|
124
|
+
YoolaExternalProjectSectionLoadingItem,
|
|
78
125
|
} from './types';
|
|
79
126
|
// Zod schemas (for external validation if needed)
|
|
80
127
|
export {
|
|
81
128
|
createDocumentDataSchema,
|
|
82
129
|
createSignedUploadUrlOptionsSchema,
|
|
83
130
|
downloadOptionsSchema,
|
|
131
|
+
externalProjectDeliveryOptionsSchema,
|
|
84
132
|
imageTransformOptionsSchema,
|
|
85
133
|
listDocumentsOptionsSchema,
|
|
86
134
|
listStorageOptionsSchema,
|
package/src/storage.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import packageJson from '../package.json';
|
|
29
|
+
import { EpmClient } from './epm';
|
|
29
30
|
import {
|
|
30
31
|
createErrorFromResponse,
|
|
31
32
|
isApiErrorResponse,
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
RateLimitError,
|
|
34
35
|
ValidationError,
|
|
35
36
|
} from './errors';
|
|
37
|
+
import { ExternalProjectsClient } from './external-projects';
|
|
36
38
|
import type {
|
|
37
39
|
AnalyticsResponse,
|
|
38
40
|
BatchShareResponse,
|
|
@@ -795,6 +797,8 @@ export class TuturuuuClient {
|
|
|
795
797
|
|
|
796
798
|
public readonly storage: StorageClient;
|
|
797
799
|
public readonly documents: DocumentsClient;
|
|
800
|
+
public readonly epm: EpmClient;
|
|
801
|
+
public readonly externalProjects: ExternalProjectsClient;
|
|
798
802
|
|
|
799
803
|
/**
|
|
800
804
|
* Creates a new Tuturuuu client instance
|
|
@@ -851,6 +855,18 @@ export class TuturuuuClient {
|
|
|
851
855
|
// Initialize sub-clients
|
|
852
856
|
this.storage = new StorageClient(this);
|
|
853
857
|
this.documents = new DocumentsClient(this);
|
|
858
|
+
this.epm = new EpmClient({
|
|
859
|
+
apiKey: this.apiKey,
|
|
860
|
+
baseUrl: this.baseUrl,
|
|
861
|
+
fetch: this.fetch,
|
|
862
|
+
timeout: this.timeout,
|
|
863
|
+
});
|
|
864
|
+
this.externalProjects = new ExternalProjectsClient({
|
|
865
|
+
apiKey: this.apiKey,
|
|
866
|
+
baseUrl: this.baseUrl,
|
|
867
|
+
fetch: this.fetch,
|
|
868
|
+
timeout: this.timeout,
|
|
869
|
+
});
|
|
854
870
|
}
|
|
855
871
|
|
|
856
872
|
/**
|
package/src/types.ts
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* Type definitions for the Tuturuuu SDK
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
ShareOptions as BaseShareOptions,
|
|
7
|
+
ExternalProjectEntryStatus,
|
|
8
|
+
Json,
|
|
9
|
+
} from '@tuturuuu/types';
|
|
6
10
|
import {
|
|
7
11
|
shareOptionsSchema as baseShareOptionsSchema,
|
|
8
12
|
createDocumentDataSchema,
|
|
@@ -25,6 +29,23 @@ export type {
|
|
|
25
29
|
DeleteResponse,
|
|
26
30
|
Document,
|
|
27
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,
|
|
28
49
|
GetDocumentResponse,
|
|
29
50
|
ListDocumentsOptions,
|
|
30
51
|
ListDocumentsResponse,
|
|
@@ -41,6 +62,11 @@ export type {
|
|
|
41
62
|
UpdateDocumentData,
|
|
42
63
|
UploadOptions,
|
|
43
64
|
UploadResponse,
|
|
65
|
+
WorkspaceExternalProjectBinding,
|
|
66
|
+
YoolaExternalProjectArtworkLoadingItem,
|
|
67
|
+
YoolaExternalProjectLoadingData,
|
|
68
|
+
YoolaExternalProjectLoreCapsuleLoadingItem,
|
|
69
|
+
YoolaExternalProjectSectionLoadingItem,
|
|
44
70
|
} from '@tuturuuu/types';
|
|
45
71
|
|
|
46
72
|
export type ImageResizeMode = 'cover' | 'contain' | 'fill';
|
|
@@ -61,6 +87,81 @@ export interface DownloadOptions {
|
|
|
61
87
|
transform?: ImageTransformOptions;
|
|
62
88
|
}
|
|
63
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
|
+
|
|
64
165
|
export {
|
|
65
166
|
createDocumentDataSchema,
|
|
66
167
|
createSignedUploadUrlOptionsSchema,
|
|
@@ -91,3 +192,11 @@ export const downloadOptionsSchema = z
|
|
|
91
192
|
transform: imageTransformOptionsSchema,
|
|
92
193
|
})
|
|
93
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
|
+
>;
|