2
2
getUrlPrefix ,
3
3
getUrlVersion ,
4
4
handleAssetType ,
5
- handleStorageType
5
+ handleDeliveryType
6
6
} from "../internal/url/cloudinaryURL" ;
7
7
import { Transformation } from "../transformation/Transformation" ;
8
8
import ICloudConfig from "../config/interfaces/Config/ICloudConfig" ;
@@ -13,7 +13,7 @@ import {getSDKAnalyticsSignature} from "../sdkAnalytics/getSDKAnalyticsSignature
13
13
import { ITrackedPropertiesThroughAnalytics } from "../sdkAnalytics/interfaces/ITrackedPropertiesThroughAnalytics" ;
14
14
15
15
/**
16
- * This const contains all the valid combination of asset/storage for URL shortening purposes
16
+ * This const contains all the valid combination of asset/delivery for URL shortening purposes
17
17
* It's exported because it's used in a test, but it's not really shared enough to belong in a separate file
18
18
*/
19
19
export const SEO_TYPES : Record < string , string > = {
@@ -66,7 +66,7 @@ class CloudinaryFile {
66
66
private extension : string ;
67
67
private signature : string ;
68
68
private suffix : string ;
69
- private storageType : string ; // type upload/private
69
+ private deliveryType : string ; // type upload/private
70
70
71
71
constructor ( publicID : string , cloudConfig : ICloudConfig = { } , urlConfig ?: IURLConfig ) {
72
72
this . setPublicID ( publicID ) ;
@@ -114,7 +114,7 @@ class CloudinaryFile {
114
114
* @return {this }
115
115
*/
116
116
setDeliveryType ( newType : DELIVERY_TYPE | string ) : this {
117
- this . storageType = newType ;
117
+ this . deliveryType = newType ;
118
118
return this ;
119
119
}
120
120
@@ -195,18 +195,18 @@ class CloudinaryFile {
195
195
196
196
197
197
/**
198
- * @description return an SEO friendly name for a combination of asset/storage , some examples:
198
+ * @description return an SEO friendly name for a combination of asset/delivery , some examples:
199
199
* * image/upload -> images
200
200
* * video/upload -> videos
201
- * If no match is found, return `{asset}/{storage }`
201
+ * If no match is found, return `{asset}/{delivery }`
202
202
*/
203
203
getResourceType ( ) : string {
204
204
const assetType = handleAssetType ( this . assetType ) ;
205
- const storageType = handleStorageType ( this . storageType ) ;
205
+ const deliveryType = handleDeliveryType ( this . deliveryType ) ;
206
206
207
207
const hasSuffix = ! ! this . suffix ;
208
- const regularSEOType = `${ assetType } /${ storageType } ` ;
209
- const shortSEOType = SEO_TYPES [ `${ assetType } /${ storageType } ` ] ;
208
+ const regularSEOType = `${ assetType } /${ deliveryType } ` ;
209
+ const shortSEOType = SEO_TYPES [ `${ assetType } /${ deliveryType } ` ] ;
210
210
const useRootPath = this . urlConfig . useRootPath ;
211
211
const shorten = this . urlConfig . shorten ;
212
212
@@ -215,7 +215,7 @@ class CloudinaryFile {
215
215
if ( regularSEOType === 'image/upload' ) {
216
216
return '' ; // For image/upload we're done, just return nothing
217
217
} else {
218
- throw new Error ( `useRootPath can only be used with assetType: 'image' and storageType : 'upload'. Provided: ${ regularSEOType } instead` ) ;
218
+ throw new Error ( `useRootPath can only be used with assetType: 'image' and deliveryType : 'upload'. Provided: ${ regularSEOType } instead` ) ;
219
219
}
220
220
}
221
221
@@ -232,7 +232,7 @@ class CloudinaryFile {
232
232
}
233
233
}
234
234
235
- // If all else fails, return the regular image/upload combination (asset/storage )
235
+ // If all else fails, return the regular image/upload combination (asset/delivery )
236
236
return regularSEOType ;
237
237
}
238
238
@@ -270,7 +270,7 @@ class CloudinaryFile {
270
270
// we can't use serializeCloudinaryCharacters because that does both things (, and /)
271
271
. replace ( / , / g, '%2C' ) ;
272
272
273
- // Resource type is a mixture of assetType, storageType and various URL Configurations
273
+ // Resource type is a mixture of assetType, deliveryType and various URL Configurations
274
274
// Note how `suffix` changes both image/upload (resourceType) and also is appended at the end
275
275
const url = [ prefix , this . getResourceType ( ) , this . getSignature ( ) , transformationString , version , publicID , this . suffix ]
276
276
. filter ( ( a ) => a )
0 commit comments