@pushwoosh/rpc-v2-http-api-data 0.2.449 → 0.2.451
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/data.js +76 -0
- package/media_files.d.ts +45 -1
- package/package.json +1 -1
package/data.js
CHANGED
|
@@ -24602,6 +24602,18 @@ export const data = {
|
|
|
24602
24602
|
"response": "pushwoosh.rpc_v2.media_files.GetMediaFilesUsageResponse",
|
|
24603
24603
|
"method": "get",
|
|
24604
24604
|
"path": "/api/media/files/usage"
|
|
24605
|
+
},
|
|
24606
|
+
"GetSettings": {
|
|
24607
|
+
"request": "pushwoosh.rpc_v2.media_files.GetMediaSettingsRequest",
|
|
24608
|
+
"response": "pushwoosh.rpc_v2.media_files.GetMediaSettingsResponse",
|
|
24609
|
+
"method": "get",
|
|
24610
|
+
"path": "/api/media/settings"
|
|
24611
|
+
},
|
|
24612
|
+
"UpdateSettings": {
|
|
24613
|
+
"request": "pushwoosh.rpc_v2.media_files.UpdateMediaSettingsRequest",
|
|
24614
|
+
"response": "pushwoosh.rpc_v2.media_files.UpdateMediaSettingsResponse",
|
|
24615
|
+
"method": "put",
|
|
24616
|
+
"path": "/api/media/settings"
|
|
24605
24617
|
}
|
|
24606
24618
|
}
|
|
24607
24619
|
},
|
|
@@ -24643,6 +24655,9 @@ export const data = {
|
|
|
24643
24655
|
},
|
|
24644
24656
|
"height": {
|
|
24645
24657
|
"type": "number"
|
|
24658
|
+
},
|
|
24659
|
+
"focalPoint": {
|
|
24660
|
+
"type": "pushwoosh.rpc_v2.media_files.FocalPoint"
|
|
24646
24661
|
}
|
|
24647
24662
|
},
|
|
24648
24663
|
"oneofs": {
|
|
@@ -24654,6 +24669,17 @@ export const data = {
|
|
|
24654
24669
|
}
|
|
24655
24670
|
}
|
|
24656
24671
|
},
|
|
24672
|
+
"pushwoosh.rpc_v2.media_files.FocalPoint": {
|
|
24673
|
+
"type": "I",
|
|
24674
|
+
"fields": {
|
|
24675
|
+
"x": {
|
|
24676
|
+
"type": "number"
|
|
24677
|
+
},
|
|
24678
|
+
"y": {
|
|
24679
|
+
"type": "number"
|
|
24680
|
+
}
|
|
24681
|
+
}
|
|
24682
|
+
},
|
|
24657
24683
|
"pushwoosh.rpc_v2.media_files.CreateVariantResponse": {
|
|
24658
24684
|
"type": "I",
|
|
24659
24685
|
"fields": {
|
|
@@ -24849,6 +24875,9 @@ export const data = {
|
|
|
24849
24875
|
"versionsCount": {
|
|
24850
24876
|
"type": "number"
|
|
24851
24877
|
},
|
|
24878
|
+
"originalFileSize": {
|
|
24879
|
+
"type": "number"
|
|
24880
|
+
},
|
|
24852
24881
|
"imageMeta": {
|
|
24853
24882
|
"type": "pushwoosh.rpc_v2.media_files.MediaFile.ImageMeta"
|
|
24854
24883
|
}
|
|
@@ -24861,6 +24890,53 @@ export const data = {
|
|
|
24861
24890
|
}
|
|
24862
24891
|
}
|
|
24863
24892
|
},
|
|
24893
|
+
"pushwoosh.rpc_v2.media_files.MediaSettings": {
|
|
24894
|
+
"type": "I",
|
|
24895
|
+
"fields": {
|
|
24896
|
+
"compressPng": {
|
|
24897
|
+
"type": "boolean"
|
|
24898
|
+
}
|
|
24899
|
+
}
|
|
24900
|
+
},
|
|
24901
|
+
"pushwoosh.rpc_v2.media_files.GetMediaSettingsRequest": {
|
|
24902
|
+
"type": "I",
|
|
24903
|
+
"fields": {
|
|
24904
|
+
"application": {
|
|
24905
|
+
"type": "string"
|
|
24906
|
+
}
|
|
24907
|
+
}
|
|
24908
|
+
},
|
|
24909
|
+
"pushwoosh.rpc_v2.media_files.GetMediaSettingsResponse": {
|
|
24910
|
+
"type": "I",
|
|
24911
|
+
"fields": {
|
|
24912
|
+
"settings": {
|
|
24913
|
+
"type": "pushwoosh.rpc_v2.media_files.MediaSettings"
|
|
24914
|
+
},
|
|
24915
|
+
"canModify": {
|
|
24916
|
+
"type": "boolean"
|
|
24917
|
+
}
|
|
24918
|
+
}
|
|
24919
|
+
},
|
|
24920
|
+
"pushwoosh.rpc_v2.media_files.UpdateMediaSettingsRequest": {
|
|
24921
|
+
"type": "I",
|
|
24922
|
+
"fields": {
|
|
24923
|
+
"application": {
|
|
24924
|
+
"type": "string"
|
|
24925
|
+
},
|
|
24926
|
+
"compressPng": {
|
|
24927
|
+
"type": "boolean",
|
|
24928
|
+
"optional": true
|
|
24929
|
+
}
|
|
24930
|
+
}
|
|
24931
|
+
},
|
|
24932
|
+
"pushwoosh.rpc_v2.media_files.UpdateMediaSettingsResponse": {
|
|
24933
|
+
"type": "I",
|
|
24934
|
+
"fields": {
|
|
24935
|
+
"settings": {
|
|
24936
|
+
"type": "pushwoosh.rpc_v2.media_files.MediaSettings"
|
|
24937
|
+
}
|
|
24938
|
+
}
|
|
24939
|
+
},
|
|
24864
24940
|
"pushwoosh.rpc_v2.messages.MessagesService": {
|
|
24865
24941
|
"type": "S",
|
|
24866
24942
|
"key": "messages",
|
package/media_files.d.ts
CHANGED
|
@@ -3,15 +3,21 @@ export type MediaFilesService_List = RpcMethod<ListMediaFilesRequest, ListMediaF
|
|
|
3
3
|
export type MediaFilesService_CreateVariant = RpcMethod<CreateVariantRequest, CreateVariantResponse>;
|
|
4
4
|
export type MediaFilesService_Delete = RpcMethod<DeleteMediaFileRequest, DeleteMediaFileResponse>;
|
|
5
5
|
export type MediaFilesService_GetUsage = RpcMethod<GetMediaFilesUsageRequest, GetMediaFilesUsageResponse>;
|
|
6
|
+
export type MediaFilesService_GetSettings = RpcMethod<GetMediaSettingsRequest, GetMediaSettingsResponse>;
|
|
7
|
+
export type MediaFilesService_UpdateSettings = RpcMethod<UpdateMediaSettingsRequest, UpdateMediaSettingsResponse>;
|
|
6
8
|
export interface MediaFilesService {
|
|
7
9
|
/** Lists an application's media image files newest-first, with paging and an optional filename substring search. Returns only originals by default, and of an edited image only its newest version (versions_count tells how many exist); pass parent_uuid to list the cropped variants of an original, or version_root_uuid to list every version of one image. */
|
|
8
10
|
List: MediaFilesService_List;
|
|
9
|
-
/** Creates a cropped variant of an existing original image (by uuid) for the given aspect ratio, storing it in S3 as a child of the original. Idempotent per original and
|
|
11
|
+
/** Creates a cropped variant of an existing original image (by uuid) for the given aspect ratio, storing it in S3 as a child of the original; focal_point moves the crop window off center. Idempotent per original, ratio, output size and window position: calling again with the same ones returns the existing variant instead of duplicating it. */
|
|
10
12
|
CreateVariant: MediaFilesService_CreateVariant;
|
|
11
13
|
/** Deletes a media file by uuid, removing its database record and S3 objects; deleting an original cascades to all of its cropped variants, while deleting a variant removes only that variant. Deleting the newest version of an edited image lists the previous version again. Not reversible. */
|
|
12
14
|
Delete: MediaFilesService_Delete;
|
|
13
15
|
/** Returns an application's media storage footprint: count of original files, total file count including cropped variants, and total bytes stored in S3 (originals, variants and thumbnails). Use to check or report media quota usage for an application code. */
|
|
14
16
|
GetUsage: MediaFilesService_GetUsage;
|
|
17
|
+
/** Returns an application's media storage settings, e.g. whether PNG images are compressed on upload, and whether the caller may change them. */
|
|
18
|
+
GetSettings: MediaFilesService_GetSettings;
|
|
19
|
+
/** Changes an application's media storage settings. Only the fields present in the request change, the rest keep their value. Applies to images uploaded afterwards; files already stored are not touched. */
|
|
20
|
+
UpdateSettings: MediaFilesService_UpdateSettings;
|
|
15
21
|
}
|
|
16
22
|
/** AspectRatio enumerates the supported aspect ratios for image variants. */
|
|
17
23
|
export type AspectRatio = 'ASPECT_RATIO_UNSPECIFIED' | 'ASPECT_RATIO_1_1' | 'ASPECT_RATIO_4_3' | 'ASPECT_RATIO_3_2' | 'ASPECT_RATIO_4_5' | 'ASPECT_RATIO_5_4' | 'ASPECT_RATIO_16_9' | 'ASPECT_RATIO_16_10' | 'ASPECT_RATIO_21_9' | 'ASPECT_RATIO_9_16'
|
|
@@ -39,8 +45,21 @@ export type CreateVariantRequest = {
|
|
|
39
45
|
* is encoded as JPEG (i.e. the original is a JPEG); ignored otherwise.
|
|
40
46
|
*/
|
|
41
47
|
quality?: number;
|
|
48
|
+
/**
|
|
49
|
+
* focal_point is the center of the crop window on the original; the window is shifted
|
|
50
|
+
* back inside the image near an edge. Unset means the center (0.5, 0.5).
|
|
51
|
+
*/
|
|
52
|
+
focalPoint?: FocalPoint;
|
|
42
53
|
size: CreateVariantRequest_size;
|
|
43
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* FocalPoint is a point on an image as a fraction of its width (x) and height (y), each 0..1
|
|
57
|
+
* from the top-left corner.
|
|
58
|
+
*/
|
|
59
|
+
export type FocalPoint = {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
};
|
|
44
63
|
export type CreateVariantResponse = {
|
|
45
64
|
file: MediaFile;
|
|
46
65
|
};
|
|
@@ -161,5 +180,30 @@ export type MediaFile = {
|
|
|
161
180
|
versionRootUuid: string;
|
|
162
181
|
/** versions_count is how many versions of this image exist, this one included. */
|
|
163
182
|
versionsCount: number;
|
|
183
|
+
/** original_file_size is the size before PNG compression; set only in an upload response when compression shrank the file. */
|
|
184
|
+
originalFileSize: number;
|
|
164
185
|
meta: MediaFile_meta;
|
|
165
186
|
};
|
|
187
|
+
/** MediaSettings are per-application media storage settings. The zero value of every field is the default. */
|
|
188
|
+
export type MediaSettings = {
|
|
189
|
+
/** compress_png quantizes PNG images on upload (lossy palette compression, transparency kept). */
|
|
190
|
+
compressPng: boolean;
|
|
191
|
+
};
|
|
192
|
+
export type GetMediaSettingsRequest = {
|
|
193
|
+
/** Application code (format XXXXX-XXXXX) whose media settings to read. */
|
|
194
|
+
application?: string;
|
|
195
|
+
};
|
|
196
|
+
export type GetMediaSettingsResponse = {
|
|
197
|
+
settings: MediaSettings;
|
|
198
|
+
/** can_modify tells whether the caller may change the settings. */
|
|
199
|
+
canModify: boolean;
|
|
200
|
+
};
|
|
201
|
+
export type UpdateMediaSettingsRequest = {
|
|
202
|
+
/** Application code (format XXXXX-XXXXX) whose media settings to change. */
|
|
203
|
+
application?: string;
|
|
204
|
+
/** Unset leaves the stored value as is. */
|
|
205
|
+
compressPng?: boolean;
|
|
206
|
+
};
|
|
207
|
+
export type UpdateMediaSettingsResponse = {
|
|
208
|
+
settings: MediaSettings;
|
|
209
|
+
};
|