Storage Service - rettersoft/rbs-docs GitHub Wiki
Rbs Storage Service
Actions
- rbs.storage.request.SAVE_IMAGE
- rbs.storage.request.SAVE_IMAGE_WITH_CUSTOM_ID
- rbs.storage.request.SAVE_IMAGE_FROM_URL
- rbs.storage.request.SAVE_FILE
- rbs.storage.request.DELETE_IMAGE
- rbs.storage.request.DELETE_FILE
- rbs.storage.request.PERSIST_IMAGE
- rbs.storage.request.PERSIST_FILE
- rbs.storage.get.GET_IMAGE
- rbs.storage.get.GET_FILE
- rbs.storage.request.PUT_IMAGE
rbs.storage.request.DELETE_IMAGE
Delete specific image.
Input: DeleteImageInputModel
DeleteImageInputModel {
imageId: string; // required
}
rbs.storage.request.DELETE_FILE
Delete specific file.
Input: DeleteFileInputModel
DeleteFileInputModel {
fileId: string; // required
}
rbs.storage.request.PERSIST_IMAGE
Remove expire from a specific image.
Input: PersistImage
PersistImage {
imageId: string // required
}
rbs.storage.request.PERSIST_FILE
Remove expire from a specific file.
Input: PersistFile
PersistFile {
fileId: string // required
}
rbs.storage.request.SAVE_IMAGE
Put an image.
Input: SaveImageConfig
SaveImageConfig {
data: string, // base64 encoded string IsNotEmpty
ttlInSeconds?: number // Min(0) Max(2592000) IsOptional set to '0' for persist
}
rbs.storage.request.SAVE_IMAGE_WITH_CUSTOM_ID
Put an image with custom id.
Input: SaveImageConfigWithCustomId
SaveImageConfigWithCustomId {
id: string // regex: ^([A-Za-z0-9_-])+$ MaxLength: 128 MinLen: 1
data: string, // base64 encoded string IsNotEmpty
ttlInSeconds?: number // Min(0) Max(2592000) IsOptional set to '0' for persist
}
rbs.storage.request.SAVE_IMAGE_FROM_URL
Downloads an image from internet and saves it. Returns its id.
Input: SaveImageFromUrlConfig
SaveImageFromUrlConfig {
url: string, // url of the image to save
headers: Map<string, string>, // headers to add to the request
ttlInSeconds?: number // Min(0) Max(2592000) IsOptional set to '0' for persist
}
rbs.storage.get.GET_IMAGE
Get a specific image with the cache.
Input: GetImageInputModel
GetImageInputModel {
imageId: string; // required
height?: number; // optional
width?: number; // optional
quality?: number; // 0-100
contentType?: string; // optional, Content-Type Standart
compressionLevel?: number; // 0-9 optional
extract?: boolean; // optional
dispose?: boolean; // optional for close downloadable
fit?: GetImageFitEnum;
}
GetImageFitEnum {
contain = 'contain',
cover = 'cover',
fill = 'fill',
inside = 'inside',
outside = 'outside',
}
rbs.storage.request.SAVE_FILE
Put a file.
Input: FileConfig
FileConfig {
data: string, // base64 encoded string IsNotEmpty
contentType: string // sample: application/pdf IsNotEmpty
contentEncoding?: FileContentEncoding // IsOptional
ttlInSeconds?: number // Min(0) Max(2592000) IsOptional set to '0' for persist
}
FileContentEncoding {
gzip = 'gzip',
compress = 'compress',
deflate = 'deflate',
br = 'br'
}
rbs.storage.get.GET_FILE
Get a specific image with the cache.
Input: GetFileInputModel
GetFileInputModel {
fileId: string; // required
extract?: boolean; // optional
}
rbs.storage.request.PUT_IMAGE
Put an image type of jpeg, jpg, png with base64 enconding. Action payload is ImageConfig model. Your asset access link will be set to https://{rettermobilecdndomain}/{projectId}/{alias}/{resizeConfig.guid}
Input: ImageConfig
ImageConfig {
data: string, // base64 encoded string IsNotEmpty
contentType: string // sample: image/png IsNotEmpty
alias: string // MinLength(1) MaxLength(128) IsNotEmpty
resizeConfigs: ResizeConfigItem[]
}
ResizeConfigItem {
guid: string // MinLength(1) MaxLength(128) IsNotEmpty
width: number // Min(1) Max(6144) IsNotEmpty
height: number // Min(1) Max(6144) IsNotEmpty
quality: number // Min(1) Max(100) IsNotEmpty
}
Output: {
assets: string[]
}