Skip to content

Commit 6d721ab

Browse files
Add examples to IURlConfig interfaces and hide private interfaces (#346)
- Hide private interfaces that aren't needed yet (they'll be needed for node) - Add examples to existing members
1 parent fde9cb4 commit 6d721ab

File tree

8 files changed

+78
-4
lines changed

8 files changed

+78
-4
lines changed

src/config/interfaces/Config/IAccountConfig.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @private
3+
*/
14
interface IAccountConfig {
25
provisioningApiKey?: string;
36
provisioningApiSecret?: string;

src/config/interfaces/Config/IApiConfig.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @private
3+
*/
14
interface IApiConfig {
25
apiProxy?: string;
36
connectionTimeout?: number;

src/config/interfaces/Config/IAuthTokenConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Defines the configuration for delivering token-based authenticated media assets.</br>
66
* <b>Learn more:</b> {@link https://cloudinary.com/documentation/control_access_to_media#delivering_token_based_authenticated_media_assets|Delivering token based authenticated media assets}
77
*
8+
* @private
9+
*
810
* @prop {string} token_name
911
* @prop {string} duration
1012
* @prop {string} start_time

src/config/interfaces/Config/ICloudConfig.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ import IAuthTokenConfig from "./IAuthTokenConfig";
88
* @prop {string} [apiKey]
99
* @prop {string} [apiSecret]
1010
* @prop {IAuthTokenConfig} [authToken]
11+
* @example
12+
* * import Cloudinary from '@cloudinary/base';
13+
* // The Cloudinary Instance accepts a CloudConfig under the `cloud` key
14+
* const cld = new Cloudinary({
15+
* // the cloudConfig
16+
* cloud: {
17+
* cloudName: 'demo'
18+
* },
19+
* // the urlConfig
20+
* url: {
21+
* // ... urlConfig is optional.
22+
* }
23+
* });
1124
*/
1225
interface ICloudConfig {
1326
cloudName?: string;

src/config/interfaces/Config/ICloudinaryAssetConfigurations.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@ import ICloudConfig from "./ICloudConfig";
44
/**
55
* @name ICloudinaryAssetConfigurations
66
* @summary config
7-
* @description
8-
* Defines the configuration needed to create URLs for cloudinary assets
7+
* @description Defines the configuration needed to create URLs for cloudinary assets
98
*
109
* @prop {ICloudConfig} cloud
1110
* @prop {IURLConfig} url
11+
* @example
12+
* * import Cloudinary from '@cloudinary/base';
13+
* // The Cloudinary Instance accepts an ICloudinaryAssetConfigurations as an argument
14+
* // ICloudinaryAssetConfigurations is built from two parts, the `cloud` and the `url` keys.
15+
* const cld = new Cloudinary({
16+
* // the cloudConfig
17+
* cloud: {
18+
* cloudName: 'demo'
19+
* },
20+
* // the urlConfig
21+
* url: {
22+
* cname: 'www.example.com',
23+
* forceVersion: true
24+
* }
25+
* });
1226
*/
1327
interface ICloudinaryAssetConfigurations {
1428
cloud?: ICloudConfig

src/config/interfaces/Config/ICloudinaryConfigurations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import IApiConfig from "./IApiConfig";
66
* @name ICloudinaryAssetConfigurations
77
* @summary config
88
* @description Defines the configuration needed for the Cloudinary Base SDK</br>
9+
* @private
910
*
1011
* @prop {IApiConfig} [api]
1112
* @prop {ITagConfig} [tag]

src/config/interfaces/Config/ITagConfig.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @description - Not currently in use
3+
* @private
4+
*/
15
interface ITagConfig {
26
hiDpi?: boolean;
37
clientHints?: boolean;

src/config/interfaces/Config/IURLConfig.ts

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* @name ICloudinaryAssetConfigurations
33
* @summary config
44
* @description Defines the configuration needed for URL-related options when creating Cloudinary URL
5+
* <b>Learn more:</b> {@link https://cloudinary.com/documentation/cloudinary_sdks#configuration_parameters|URL Parameters}
56
* @prop {string} [cname]
6-
* @prop {boolean} [secureDistribution]
7+
* @prop {string} [secureDistribution]
78
* @prop {boolean} [privateCdn]
89
* @prop {boolean} [signUrl]
910
* @prop {boolean} [longUrlSignature]
@@ -12,6 +13,20 @@
1213
* @prop {boolean} [secure]
1314
* @prop {boolean} [forceVersion]
1415
* @prop {boolean} [analytics]
16+
* @example
17+
* import Cloudinary from '@cloudinary/base';
18+
* // The Cloudinary Instance accepts a URLConfig under the `url` key
19+
* const cld = new Cloudinary({
20+
* // the cloudConfig
21+
* cloud: {
22+
* cloudName: 'demo'
23+
* },
24+
* // the urlConfig
25+
* url: {
26+
* cname: 'www.example.com',
27+
* forceVersion: true
28+
* }
29+
* });
1530
*/
1631
interface IURLConfig {
1732
/**
@@ -32,7 +47,7 @@ interface IURLConfig {
3247
*
3348
* https://{cname|secureDistribution}/image/upload
3449
* instead of
35-
* * https://{cname|secureDistribution}/{cloudName}image/upload
50+
* https://{cname|secureDistribution}/{cloudName}image/upload
3651
*
3752
* When privateCdn is provided without cname or secure distribution,
3853
* it moves the cloudName from the URL to the domain:
@@ -54,10 +69,29 @@ interface IURLConfig {
5469
*/
5570
analytics?: boolean;
5671

72+
/**
73+
* Whether or not to sign the URL
74+
*/
5775
signUrl?: boolean;
76+
77+
/**
78+
* Whether or not to use a long signature
79+
*/
5880
longUrlSignature?: boolean;
81+
82+
/**
83+
* Whether or not to shorten the URL
84+
*/
5985
shorten?: boolean;
86+
87+
/**
88+
* Whether or not to use the root path
89+
*/
6090
useRootPath?: boolean;
91+
92+
/**
93+
* Whether or not to force a version
94+
*/
6195
forceVersion?: boolean;
6296
}
6397

0 commit comments

Comments
 (0)