@chili-publish/studio-connectors 1.24.0 → 1.25.1
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.
|
@@ -9,6 +9,11 @@ export interface ConnectorRuntimeContext {
|
|
|
9
9
|
platform: ChiliPlatform;
|
|
10
10
|
sdkVersion: string;
|
|
11
11
|
}
|
|
12
|
+
export interface FilePointer {
|
|
13
|
+
id: string;
|
|
14
|
+
url: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
12
17
|
export type QueryOptions = {
|
|
13
18
|
sortOrder: string | null;
|
|
14
19
|
collection: string | null;
|
|
@@ -17,11 +22,22 @@ export type QueryOptions = {
|
|
|
17
22
|
pageSize: number;
|
|
18
23
|
sortBy: string | null;
|
|
19
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;
|
|
20
36
|
export interface ChiliRequestInit {
|
|
21
37
|
/**
|
|
22
|
-
* A
|
|
38
|
+
* A StudioFetchBody object or null to set request's body.
|
|
23
39
|
*/
|
|
24
|
-
body?:
|
|
40
|
+
body?: StudioFetchBody | null;
|
|
25
41
|
/**
|
|
26
42
|
* A Headers object, an object literal, or an array of two-item arrays to set request's headers.
|
|
27
43
|
*/
|
|
@@ -61,10 +77,12 @@ export interface ChiliResponse extends ChiliBody {
|
|
|
61
77
|
readonly url: string;
|
|
62
78
|
}
|
|
63
79
|
export type ConnectorConfigValueType = 'text' | 'boolean';
|
|
80
|
+
export type ConnectorConfigContextType = 'query' | 'upload';
|
|
64
81
|
export interface ConnectorConfigValue {
|
|
65
82
|
readonly name: string;
|
|
66
83
|
readonly displayName: string;
|
|
67
84
|
readonly type: ConnectorConfigValueType;
|
|
85
|
+
readonly context?: ConnectorConfigContextType[];
|
|
68
86
|
}
|
|
69
87
|
/**
|
|
70
88
|
* A custom HTTP error for connectors.
|
|
@@ -98,6 +116,22 @@ export interface ConnectorHttpErrorConstructor {
|
|
|
98
116
|
*/
|
|
99
117
|
readonly prototype: ConnectorHttpError;
|
|
100
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
|
+
}
|
|
101
133
|
declare global {
|
|
102
134
|
var ConnectorHttpError: ConnectorHttpErrorConstructor;
|
|
135
|
+
var StudioFormData: StudioFormDataConstructor;
|
|
136
|
+
var FilePointer: FilePointerConstructor;
|
|
103
137
|
}
|
package/dist/MediaConnector.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayBufferPointer, ConnectorConfigValue, Dictionary, QueryOptions } from './Connector.Shared';
|
|
1
|
+
import { ArrayBufferPointer, ConnectorConfigValue, Dictionary, QueryOptions, FilePointer } from './Connector.Shared';
|
|
2
2
|
export interface MediaConnector {
|
|
3
3
|
detail(id: string, context: Dictionary): Promise<MediaDetail>;
|
|
4
4
|
query(options: QueryOptions, context: Dictionary): Promise<MediaPage>;
|
|
@@ -6,6 +6,9 @@ export interface MediaConnector {
|
|
|
6
6
|
getConfigurationOptions(): ConnectorConfigValue[] | null;
|
|
7
7
|
getCapabilities(): MediaConnectorCapabilities;
|
|
8
8
|
}
|
|
9
|
+
export interface MediaConnectorUpload {
|
|
10
|
+
upload(filePointers: FilePointer[], context: Dictionary): Promise<Media[]>;
|
|
11
|
+
}
|
|
9
12
|
export type DownloadIntent = 'web' | 'print' | 'animation';
|
|
10
13
|
export type DownloadType = 'thumbnail' | 'mediumres' | 'highres' | 'fullres' | 'original';
|
|
11
14
|
export interface MediaPage {
|
|
@@ -32,4 +35,5 @@ export type MediaConnectorCapabilities = {
|
|
|
32
35
|
detail: boolean;
|
|
33
36
|
filtering: boolean;
|
|
34
37
|
metadata?: boolean;
|
|
38
|
+
upload?: boolean;
|
|
35
39
|
};
|