@chili-publish/studio-connectors 1.25.1 → 1.27.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/index.d.ts +265 -4
- package/dist/index.js +15 -0
- package/package.json +7 -4
- package/dist/Connector.Shared.d.ts +0 -137
- package/dist/DataConnector.d.ts +0 -42
- package/dist/FontConnector.d.ts +0 -35
- package/dist/MediaConnector.d.ts +0 -39
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,265 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
var ConnectorHttpError: ConnectorHttpErrorConstructor;
|
|
3
|
+
var StudioFormData: StudioFormDataConstructor;
|
|
4
|
+
var FilePointer: FilePointerConstructor;
|
|
5
|
+
}
|
|
6
|
+
export interface ChiliBody {
|
|
7
|
+
arrayBuffer: ArrayBufferPointer;
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ChiliRequestInit {
|
|
11
|
+
/**
|
|
12
|
+
* A StudioFetchBody object or null to set request's body.
|
|
13
|
+
*/
|
|
14
|
+
body?: StudioFetchBody | null;
|
|
15
|
+
/**
|
|
16
|
+
* A Headers object, an object literal, or an array of two-item arrays to set request's headers.
|
|
17
|
+
*/
|
|
18
|
+
headers?: Dictionary;
|
|
19
|
+
/**
|
|
20
|
+
* A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
|
|
21
|
+
*/
|
|
22
|
+
integrity?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A string to set request's method.
|
|
25
|
+
*/
|
|
26
|
+
method?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
|
|
29
|
+
*/
|
|
30
|
+
redirect?: "error" | "follow" | "manual";
|
|
31
|
+
/**
|
|
32
|
+
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
|
|
33
|
+
*/
|
|
34
|
+
referrer?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ChiliResponse extends ChiliBody {
|
|
37
|
+
readonly headers: Dictionary;
|
|
38
|
+
readonly ok: boolean;
|
|
39
|
+
readonly redirected: boolean;
|
|
40
|
+
readonly status: number;
|
|
41
|
+
readonly statusText: string;
|
|
42
|
+
readonly type: "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
|
|
43
|
+
readonly url: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ConnectorConfigValue<Type, ContextType> {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly displayName: string;
|
|
48
|
+
readonly type: Type;
|
|
49
|
+
readonly context?: ContextType[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Interface for the constructor of ConnectorHttpError.
|
|
53
|
+
*/
|
|
54
|
+
export interface ConnectorHttpErrorConstructor {
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new ConnectorHttpError instance.
|
|
57
|
+
*
|
|
58
|
+
* @param status - The HTTP status code associated with the error.
|
|
59
|
+
* @param message - Optional error message.
|
|
60
|
+
* @returns A new instance of ConnectorHttpError.
|
|
61
|
+
*/
|
|
62
|
+
new (status: number, message?: string): ConnectorHttpError$1;
|
|
63
|
+
/**
|
|
64
|
+
* The prototype of ConnectorHttpError.
|
|
65
|
+
*/
|
|
66
|
+
readonly prototype: ConnectorHttpError$1;
|
|
67
|
+
}
|
|
68
|
+
export interface ConnectorRuntimeContext {
|
|
69
|
+
options: Dictionary;
|
|
70
|
+
fetch(url: string, init: ChiliRequestInit): Promise<ChiliResponse>;
|
|
71
|
+
logError(msg: string): void;
|
|
72
|
+
platform: ChiliPlatform;
|
|
73
|
+
sdkVersion: string;
|
|
74
|
+
}
|
|
75
|
+
export interface DataConnector {
|
|
76
|
+
getPage(config: PageConfig, context: Dictionary): Promise<DataPage>;
|
|
77
|
+
getModel(context: Dictionary): Promise<DataModel>;
|
|
78
|
+
getConfigurationOptions(): ConnectorConfigOptions$1 | null;
|
|
79
|
+
getCapabilities(): DataConnectorCapabilities;
|
|
80
|
+
}
|
|
81
|
+
export interface DataFilter {
|
|
82
|
+
property: string;
|
|
83
|
+
value: string;
|
|
84
|
+
type: "contains" | "exact";
|
|
85
|
+
}
|
|
86
|
+
export interface DataSorting {
|
|
87
|
+
property: string;
|
|
88
|
+
direction: "asc" | "desc";
|
|
89
|
+
}
|
|
90
|
+
export interface Dictionary {
|
|
91
|
+
[Key: string]: string | boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface FilePointerConstructor {
|
|
94
|
+
new (id: string, url: string, name: string): FilePointer$1;
|
|
95
|
+
/**
|
|
96
|
+
* The prototype of FilePointer.
|
|
97
|
+
*/
|
|
98
|
+
readonly prototype: FilePointer$1;
|
|
99
|
+
}
|
|
100
|
+
export interface FontFamily {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
fontStylesCount: number;
|
|
104
|
+
extensions: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface FontStyle {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
familyId: string;
|
|
110
|
+
familyName: string;
|
|
111
|
+
}
|
|
112
|
+
export interface GrafxFontConnector {
|
|
113
|
+
detail(connectorId: string, fontFamilyId: string, context: Dictionary): Promise<FontStyle[]>;
|
|
114
|
+
query(connectorId: string, queryOptions: QueryOptions, context: Dictionary): Promise<FontFamilyPage>;
|
|
115
|
+
download(styleId: string, context: Dictionary): Promise<ArrayBufferPointer>;
|
|
116
|
+
preview(familyId: string, previewFormat: FontPreviewFormat, context: Dictionary): Promise<ArrayBufferPointer>;
|
|
117
|
+
getConfigurationOptions(): ConnectorConfigOptions$1 | null;
|
|
118
|
+
getCapabilities(): FontConnectorCapabilities;
|
|
119
|
+
}
|
|
120
|
+
export interface Media<MediaType> {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
relativePath: string;
|
|
124
|
+
metaData: Dictionary;
|
|
125
|
+
extension?: string;
|
|
126
|
+
type: MediaType;
|
|
127
|
+
}
|
|
128
|
+
export interface MediaConnector {
|
|
129
|
+
detail(id: string, context: Dictionary): Promise<MediaDetail$1>;
|
|
130
|
+
query(options: QueryOptions, context: Dictionary): Promise<MediaPage>;
|
|
131
|
+
download(id: string, previewType: DownloadType, intent: DownloadIntent, context: Dictionary): Promise<ArrayBufferPointer>;
|
|
132
|
+
getConfigurationOptions(): ConnectorConfigOptions$1 | null;
|
|
133
|
+
getCapabilities(): MediaConnectorCapabilities;
|
|
134
|
+
}
|
|
135
|
+
export interface MediaConnectorUpload {
|
|
136
|
+
upload(filePointers: FilePointer$1[], context: Dictionary): Promise<Media$2[]>;
|
|
137
|
+
}
|
|
138
|
+
export interface PageConfig {
|
|
139
|
+
filters?: DataFilter[] | null;
|
|
140
|
+
sorting?: DataSorting[] | null;
|
|
141
|
+
continuationToken?: string | null;
|
|
142
|
+
limit: number;
|
|
143
|
+
}
|
|
144
|
+
export interface StudioFormDataConstructor {
|
|
145
|
+
new (): StudioFormData$1;
|
|
146
|
+
/**
|
|
147
|
+
* The prototype of StudioFormData.
|
|
148
|
+
*/
|
|
149
|
+
readonly prototype: StudioFormData$1;
|
|
150
|
+
}
|
|
151
|
+
export type ArrayBufferPointer = {
|
|
152
|
+
id: string;
|
|
153
|
+
bytes: number;
|
|
154
|
+
};
|
|
155
|
+
export type ChiliPlatform = "web" | "server";
|
|
156
|
+
export type ConnectorConfigContextType = "query" | "upload";
|
|
157
|
+
export type ConnectorConfigOptions<Type, ContextType> = ConnectorConfigValue<Type, ContextType>[];
|
|
158
|
+
export type ConnectorConfigValueType = "text" | "boolean";
|
|
159
|
+
export type DataConnectorCapabilities = {
|
|
160
|
+
filtering: boolean;
|
|
161
|
+
sorting: boolean;
|
|
162
|
+
model: boolean;
|
|
163
|
+
};
|
|
164
|
+
export type DataConnectorRuntimeContext = ConnectorRuntimeContext;
|
|
165
|
+
export type DataItem = {
|
|
166
|
+
[key: string]: string | number | boolean | Date | null;
|
|
167
|
+
};
|
|
168
|
+
export type DataModel = {
|
|
169
|
+
properties: DataModelProperty[];
|
|
170
|
+
};
|
|
171
|
+
export type DataModelProperty = {
|
|
172
|
+
name: string;
|
|
173
|
+
type: string;
|
|
174
|
+
};
|
|
175
|
+
export type DataPage = Pick<QueryPage<DataItem>, "data"> & {
|
|
176
|
+
continuationToken?: string | null;
|
|
177
|
+
};
|
|
178
|
+
export type DownloadIntent = "web" | "print" | "animation";
|
|
179
|
+
export type DownloadType = "thumbnail" | "mediumres" | "highres" | "fullres" | "original";
|
|
180
|
+
export type FileType = 0;
|
|
181
|
+
export type FolderType = 1;
|
|
182
|
+
export type FontConnectorCapabilities = {
|
|
183
|
+
query: boolean;
|
|
184
|
+
detail: boolean;
|
|
185
|
+
preview: boolean;
|
|
186
|
+
filtering: boolean;
|
|
187
|
+
};
|
|
188
|
+
export type FontFamilyPage = QueryPage<FontFamily>;
|
|
189
|
+
export type FontPreviewFormat = "square" | "line";
|
|
190
|
+
export type MediaConnectorCapabilities = {
|
|
191
|
+
query: boolean;
|
|
192
|
+
detail: boolean;
|
|
193
|
+
filtering: boolean;
|
|
194
|
+
metadata?: boolean;
|
|
195
|
+
upload?: boolean;
|
|
196
|
+
};
|
|
197
|
+
export type MediaDetail<MediaType> = Media<MediaType> & {
|
|
198
|
+
width?: number;
|
|
199
|
+
height?: number;
|
|
200
|
+
};
|
|
201
|
+
export type MediaPage = QueryPage<Media$2>;
|
|
202
|
+
export type MediaType = FileType | FolderType;
|
|
203
|
+
export type QueryOptions = {
|
|
204
|
+
filter?: string[] | null;
|
|
205
|
+
collection?: string | null;
|
|
206
|
+
pageToken?: string | null;
|
|
207
|
+
pageSize?: number;
|
|
208
|
+
sortBy?: string | null;
|
|
209
|
+
sortOrder?: string | null;
|
|
210
|
+
};
|
|
211
|
+
export type QueryPage<T> = {
|
|
212
|
+
pageSize: number;
|
|
213
|
+
links: {
|
|
214
|
+
nextPage: string;
|
|
215
|
+
};
|
|
216
|
+
data: T[];
|
|
217
|
+
};
|
|
218
|
+
export type StudioFetchBody = string | FilePointer$1 | StudioFormData$1;
|
|
219
|
+
export type StudioFormDataValue = string | FilePointer$1;
|
|
220
|
+
interface ConnectorHttpError$1 extends Error {
|
|
221
|
+
/**
|
|
222
|
+
* The HTTP status code associated with the error.
|
|
223
|
+
*/
|
|
224
|
+
readonly status: number;
|
|
225
|
+
}
|
|
226
|
+
interface FilePointer$1 {
|
|
227
|
+
id: string;
|
|
228
|
+
url: string;
|
|
229
|
+
name: string;
|
|
230
|
+
}
|
|
231
|
+
interface StudioFormData$1 {
|
|
232
|
+
append(name: string, value: StudioFormDataValue, filename?: string): void;
|
|
233
|
+
set(name: string, value: StudioFormDataValue, filename?: string): void;
|
|
234
|
+
delete(name: string): void;
|
|
235
|
+
forEach(callback: (value: StudioFormDataValue, name: string) => void): void;
|
|
236
|
+
get(name: string): StudioFormDataValue | null;
|
|
237
|
+
getAll(name: string): StudioFormDataValue[];
|
|
238
|
+
has(name: string): boolean;
|
|
239
|
+
}
|
|
240
|
+
type ConnectorConfigOptions$1 = ConnectorConfigOptions<ConnectorConfigValueType, ConnectorConfigContextType>;
|
|
241
|
+
type ConnectorConfigValue$1 = ConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;
|
|
242
|
+
type Media$2 = Media<MediaType>;
|
|
243
|
+
type MediaDetail$1 = MediaDetail<MediaType>;
|
|
244
|
+
|
|
245
|
+
declare namespace Media$1 {
|
|
246
|
+
export { DownloadIntent, DownloadType, FilePointer$1 as FilePointer, FileType, FolderType, Media$2 as Media, MediaConnector, MediaConnectorCapabilities, MediaConnectorUpload, MediaDetail$1 as MediaDetail, MediaPage, MediaType };
|
|
247
|
+
}
|
|
248
|
+
declare namespace Connector {
|
|
249
|
+
export { ArrayBufferPointer, ChiliBody, ChiliPlatform, ChiliRequestInit, ChiliResponse, ConnectorConfigContextType, ConnectorConfigOptions$1 as ConnectorConfigOptions, ConnectorConfigValue$1 as ConnectorConfigValue, ConnectorConfigValueType, ConnectorHttpError$1 as ConnectorHttpError, ConnectorRuntimeContext, Dictionary, FilePointer$1 as FilePointer, QueryOptions, StudioFetchBody, StudioFormData$1 as StudioFormData, StudioFormDataValue };
|
|
250
|
+
}
|
|
251
|
+
declare namespace Data {
|
|
252
|
+
export { DataConnector, DataConnectorCapabilities, DataConnectorRuntimeContext, DataItem, DataModel, DataModelProperty, DataPage, PageConfig };
|
|
253
|
+
}
|
|
254
|
+
declare namespace Font {
|
|
255
|
+
export { FontConnectorCapabilities, FontFamily, FontFamilyPage, FontPreviewFormat, FontStyle, GrafxFontConnector };
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export {
|
|
259
|
+
Connector,
|
|
260
|
+
Data,
|
|
261
|
+
Font,
|
|
262
|
+
Media$1 as Media,
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2
|
+
__proto__: null
|
|
3
|
+
}, Symbol.toStringTag, { value: "Module" })), o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4
|
+
__proto__: null
|
|
5
|
+
}, Symbol.toStringTag, { value: "Module" })), t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null
|
|
7
|
+
}, Symbol.toStringTag, { value: "Module" })), n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
__proto__: null
|
|
9
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10
|
+
export {
|
|
11
|
+
e as Connector,
|
|
12
|
+
o as Data,
|
|
13
|
+
t as Font,
|
|
14
|
+
n as Media
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chili-publish/studio-connectors",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"files": [
|
|
6
7
|
"dist"
|
|
7
8
|
],
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"devDependencies": {
|
|
10
11
|
"prettier": "^3.0.3",
|
|
11
|
-
"typescript": "^5.2.2"
|
|
12
|
+
"typescript": "^5.2.2",
|
|
13
|
+
"vite": "^6.3.5",
|
|
14
|
+
"@types/node": "^22.15.18",
|
|
15
|
+
"dts-bundle-generator": "^9.0.0"
|
|
12
16
|
},
|
|
13
17
|
"scripts": {
|
|
14
|
-
"build": "
|
|
15
|
-
"build:uat": "tsc",
|
|
18
|
+
"build": "vite build",
|
|
16
19
|
"prepare-upload": "yarn build && yarn pack && mkdir ./upload/connectors/ -p && cp *.tgz ./upload/connectors/"
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
export interface Dictionary {
|
|
2
|
-
[Key: string]: string | boolean;
|
|
3
|
-
}
|
|
4
|
-
export type ChiliPlatform = 'web' | 'server';
|
|
5
|
-
export interface ConnectorRuntimeContext {
|
|
6
|
-
options: Dictionary;
|
|
7
|
-
fetch(url: string, init: ChiliRequestInit): Promise<ChiliResponse>;
|
|
8
|
-
logError(msg: string): void;
|
|
9
|
-
platform: ChiliPlatform;
|
|
10
|
-
sdkVersion: string;
|
|
11
|
-
}
|
|
12
|
-
export interface FilePointer {
|
|
13
|
-
id: string;
|
|
14
|
-
url: string;
|
|
15
|
-
name: string;
|
|
16
|
-
}
|
|
17
|
-
export type QueryOptions = {
|
|
18
|
-
sortOrder: string | null;
|
|
19
|
-
collection: string | null;
|
|
20
|
-
filter: string[] | null;
|
|
21
|
-
pageToken: string | null;
|
|
22
|
-
pageSize: number;
|
|
23
|
-
sortBy: string | null;
|
|
24
|
-
};
|
|
25
|
-
export type StudioFormDataValue = string | FilePointer;
|
|
26
|
-
export interface StudioFormData {
|
|
27
|
-
append(name: string, value: StudioFormDataValue, filename?: string): void;
|
|
28
|
-
set(name: string, value: StudioFormDataValue, filename?: string): void;
|
|
29
|
-
delete(name: string): void;
|
|
30
|
-
forEach(callback: (value: StudioFormDataValue, name: string) => void): void;
|
|
31
|
-
get(name: string): StudioFormDataValue | null;
|
|
32
|
-
getAll(name: string): StudioFormDataValue[];
|
|
33
|
-
has(name: string): boolean;
|
|
34
|
-
}
|
|
35
|
-
export type StudioFetchBody = string | FilePointer | StudioFormData;
|
|
36
|
-
export interface ChiliRequestInit {
|
|
37
|
-
/**
|
|
38
|
-
* A StudioFetchBody object or null to set request's body.
|
|
39
|
-
*/
|
|
40
|
-
body?: StudioFetchBody | null;
|
|
41
|
-
/**
|
|
42
|
-
* A Headers object, an object literal, or an array of two-item arrays to set request's headers.
|
|
43
|
-
*/
|
|
44
|
-
headers?: Dictionary;
|
|
45
|
-
/**
|
|
46
|
-
* A cryptographic hash of the resource to be fetched by request. Sets request's integrity.
|
|
47
|
-
*/
|
|
48
|
-
integrity?: string;
|
|
49
|
-
/**
|
|
50
|
-
* A string to set request's method.
|
|
51
|
-
*/
|
|
52
|
-
method?: string;
|
|
53
|
-
/**
|
|
54
|
-
* A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.
|
|
55
|
-
*/
|
|
56
|
-
redirect?: 'error' | 'follow' | 'manual';
|
|
57
|
-
/**
|
|
58
|
-
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
|
|
59
|
-
*/
|
|
60
|
-
referrer?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface ChiliBody {
|
|
63
|
-
arrayBuffer: ArrayBufferPointer;
|
|
64
|
-
text: string;
|
|
65
|
-
}
|
|
66
|
-
export type ArrayBufferPointer = {
|
|
67
|
-
id: string;
|
|
68
|
-
bytes: number;
|
|
69
|
-
};
|
|
70
|
-
export interface ChiliResponse extends ChiliBody {
|
|
71
|
-
readonly headers: Dictionary;
|
|
72
|
-
readonly ok: boolean;
|
|
73
|
-
readonly redirected: boolean;
|
|
74
|
-
readonly status: number;
|
|
75
|
-
readonly statusText: string;
|
|
76
|
-
readonly type: 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect';
|
|
77
|
-
readonly url: string;
|
|
78
|
-
}
|
|
79
|
-
export type ConnectorConfigValueType = 'text' | 'boolean';
|
|
80
|
-
export type ConnectorConfigContextType = 'query' | 'upload';
|
|
81
|
-
export interface ConnectorConfigValue {
|
|
82
|
-
readonly name: string;
|
|
83
|
-
readonly displayName: string;
|
|
84
|
-
readonly type: ConnectorConfigValueType;
|
|
85
|
-
readonly context?: ConnectorConfigContextType[];
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* A custom HTTP error for connectors.
|
|
89
|
-
*
|
|
90
|
-
* This should be thrown when any of the connector methods
|
|
91
|
-
* failed due to a non OK HTTP status code.
|
|
92
|
-
*
|
|
93
|
-
* The framework will be able to handle this error in a better way
|
|
94
|
-
* versus throwing a generic `Error`.
|
|
95
|
-
*/
|
|
96
|
-
export interface ConnectorHttpError extends Error {
|
|
97
|
-
/**
|
|
98
|
-
* The HTTP status code associated with the error.
|
|
99
|
-
*/
|
|
100
|
-
readonly status: number;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Interface for the constructor of ConnectorHttpError.
|
|
104
|
-
*/
|
|
105
|
-
export interface ConnectorHttpErrorConstructor {
|
|
106
|
-
/**
|
|
107
|
-
* Creates a new ConnectorHttpError instance.
|
|
108
|
-
*
|
|
109
|
-
* @param status - The HTTP status code associated with the error.
|
|
110
|
-
* @param message - Optional error message.
|
|
111
|
-
* @returns A new instance of ConnectorHttpError.
|
|
112
|
-
*/
|
|
113
|
-
new (status: number, message?: string): ConnectorHttpError;
|
|
114
|
-
/**
|
|
115
|
-
* The prototype of ConnectorHttpError.
|
|
116
|
-
*/
|
|
117
|
-
readonly prototype: ConnectorHttpError;
|
|
118
|
-
}
|
|
119
|
-
export interface StudioFormDataConstructor {
|
|
120
|
-
new (): StudioFormData;
|
|
121
|
-
/**
|
|
122
|
-
* The prototype of StudioFormData.
|
|
123
|
-
*/
|
|
124
|
-
readonly prototype: StudioFormData;
|
|
125
|
-
}
|
|
126
|
-
export interface FilePointerConstructor {
|
|
127
|
-
new (id: string, url: string, name: string): FilePointer;
|
|
128
|
-
/**
|
|
129
|
-
* The prototype of FilePointer.
|
|
130
|
-
*/
|
|
131
|
-
readonly prototype: FilePointer;
|
|
132
|
-
}
|
|
133
|
-
declare global {
|
|
134
|
-
var ConnectorHttpError: ConnectorHttpErrorConstructor;
|
|
135
|
-
var StudioFormData: StudioFormDataConstructor;
|
|
136
|
-
var FilePointer: FilePointerConstructor;
|
|
137
|
-
}
|
package/dist/DataConnector.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ConnectorConfigValue, ConnectorRuntimeContext, Dictionary } from './Connector.Shared';
|
|
2
|
-
export interface DataConnector {
|
|
3
|
-
getPage(config: PageConfig, context: Dictionary): Promise<DataPage>;
|
|
4
|
-
getModel(context: Dictionary): Promise<DataModel>;
|
|
5
|
-
getConfigurationOptions(): ConnectorConfigValue[] | null;
|
|
6
|
-
getCapabilities(): DataConnectorCapabilities;
|
|
7
|
-
}
|
|
8
|
-
export type DataConnectorRuntimeContext = ConnectorRuntimeContext;
|
|
9
|
-
export type DataConnectorCapabilities = {
|
|
10
|
-
filtering: boolean;
|
|
11
|
-
sorting: boolean;
|
|
12
|
-
model: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare class DataModel {
|
|
15
|
-
properties: DataModelProperty[];
|
|
16
|
-
}
|
|
17
|
-
export declare class DataModelProperty {
|
|
18
|
-
name: string;
|
|
19
|
-
type: 'number' | 'boolean' | 'singleLine' | 'multiLine' | 'date';
|
|
20
|
-
}
|
|
21
|
-
export type DataItem = {
|
|
22
|
-
[key: string]: string | number | boolean | Date | null;
|
|
23
|
-
};
|
|
24
|
-
export interface DataPage {
|
|
25
|
-
data: DataItem[];
|
|
26
|
-
continuationToken?: string | null;
|
|
27
|
-
}
|
|
28
|
-
export interface PageConfig {
|
|
29
|
-
filters?: DataFilter[] | null;
|
|
30
|
-
sorting?: DataSorting[] | null;
|
|
31
|
-
continuationToken?: string | null;
|
|
32
|
-
limit: number;
|
|
33
|
-
}
|
|
34
|
-
export interface DataSorting {
|
|
35
|
-
property: string;
|
|
36
|
-
direction: 'asc' | 'desc';
|
|
37
|
-
}
|
|
38
|
-
export interface DataFilter {
|
|
39
|
-
property: string;
|
|
40
|
-
value: string;
|
|
41
|
-
type: 'contains' | 'exact';
|
|
42
|
-
}
|
package/dist/FontConnector.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ArrayBufferPointer, ConnectorConfigValue, Dictionary, QueryOptions } from './Connector.Shared';
|
|
2
|
-
export interface GrafxFontConnector {
|
|
3
|
-
detail(connectorId: string, fontFamilyId: string, context: Dictionary): Promise<FontStyle[]>;
|
|
4
|
-
query(connectorId: string, queryOptions: QueryOptions, context: Dictionary): Promise<FontFamilyPage>;
|
|
5
|
-
download(styleId: string, context: Dictionary): Promise<ArrayBufferPointer>;
|
|
6
|
-
preview(familyId: string, previewFormat: FontPreviewFormat, context: Dictionary): Promise<ArrayBufferPointer>;
|
|
7
|
-
getConfigurationOptions(): ConnectorConfigValue[] | null;
|
|
8
|
-
getCapabilities(): FontConnectorCapabilities;
|
|
9
|
-
}
|
|
10
|
-
export type FontPreviewFormat = 'square' | 'line';
|
|
11
|
-
export interface FontFamilyPage {
|
|
12
|
-
pageSize: number;
|
|
13
|
-
data: FontFamily[];
|
|
14
|
-
links: {
|
|
15
|
-
nextPage: string;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface FontFamily {
|
|
19
|
-
id: string;
|
|
20
|
-
name: string;
|
|
21
|
-
fontStylesCount: number;
|
|
22
|
-
extensions: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface FontStyle {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
familyId: string;
|
|
28
|
-
familyName: string;
|
|
29
|
-
}
|
|
30
|
-
export type FontConnectorCapabilities = {
|
|
31
|
-
query: boolean;
|
|
32
|
-
detail: boolean;
|
|
33
|
-
preview: boolean;
|
|
34
|
-
filtering: boolean;
|
|
35
|
-
};
|
package/dist/MediaConnector.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ArrayBufferPointer, ConnectorConfigValue, Dictionary, QueryOptions, FilePointer } from './Connector.Shared';
|
|
2
|
-
export interface MediaConnector {
|
|
3
|
-
detail(id: string, context: Dictionary): Promise<MediaDetail>;
|
|
4
|
-
query(options: QueryOptions, context: Dictionary): Promise<MediaPage>;
|
|
5
|
-
download(id: string, previewType: DownloadType, intent: DownloadIntent, context: Dictionary): Promise<ArrayBufferPointer>;
|
|
6
|
-
getConfigurationOptions(): ConnectorConfigValue[] | null;
|
|
7
|
-
getCapabilities(): MediaConnectorCapabilities;
|
|
8
|
-
}
|
|
9
|
-
export interface MediaConnectorUpload {
|
|
10
|
-
upload(filePointers: FilePointer[], context: Dictionary): Promise<Media[]>;
|
|
11
|
-
}
|
|
12
|
-
export type DownloadIntent = 'web' | 'print' | 'animation';
|
|
13
|
-
export type DownloadType = 'thumbnail' | 'mediumres' | 'highres' | 'fullres' | 'original';
|
|
14
|
-
export interface MediaPage {
|
|
15
|
-
pageSize: number;
|
|
16
|
-
data: Media[];
|
|
17
|
-
links: {
|
|
18
|
-
nextPage: string;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface Media {
|
|
22
|
-
id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
relativePath: string;
|
|
25
|
-
type: number;
|
|
26
|
-
metaData: Dictionary;
|
|
27
|
-
extension?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface MediaDetail extends Media {
|
|
30
|
-
width?: number;
|
|
31
|
-
height?: number;
|
|
32
|
-
}
|
|
33
|
-
export type MediaConnectorCapabilities = {
|
|
34
|
-
query: boolean;
|
|
35
|
-
detail: boolean;
|
|
36
|
-
filtering: boolean;
|
|
37
|
-
metadata?: boolean;
|
|
38
|
-
upload?: boolean;
|
|
39
|
-
};
|