Skip to content

Commit 6c22d64

Browse files
authored
Merge pull request #19 from mayashavin/dev
Improvements
2 parents 867b4bd + 5e6e528 commit 6c22d64

File tree

32 files changed

+306
-176
lines changed

32 files changed

+306
-176
lines changed

packages/types/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
## 0.1.2 (2021-02-03)
7+
8+
9+
### Bug Fixes
10+
11+
* add colorify and artistic filters ([c2409ab](https://github.com/mayashavin/cloudinary-api/commit/c2409abd302388307813b1bfe79843d1c081fa1c))
12+
* add more types for server api ([9548f34](https://github.com/mayashavin/cloudinary-api/commit/9548f34a7a4a662e8bdd991dc1d61b864c3f2d03))
13+
* fix type import ([4cf6928](https://github.com/mayashavin/cloudinary-api/commit/4cf69286c05b1e7f061e74426ab70aff2ad3e1ce))
14+
* wrong effect type for video ([0141413](https://github.com/mayashavin/cloudinary-api/commit/01414131f650bd946873e2b0f1d16c71feeffacd))
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { ResourceType } from '../cloud/ResourceType'
2+
import { StorageType } from '../cloud/StorageType'
3+
import { AccessControlType, AccessMode } from '../options/api'
4+
5+
export interface Asset {
6+
publicId: string,
7+
assetId: string,
8+
format: string,
9+
secureUrl: string,
10+
type: StorageType,
11+
version: number,
12+
height: number,
13+
width: number,
14+
eager?: Object[],
15+
placeholder?: boolean,
16+
tags?: string[],
17+
originalFilename: string,
18+
overwritten?: boolean,
19+
resourceType: ResourceType;
20+
signature: string;
21+
createdAt: string;
22+
pages?: number;
23+
bytes: number;
24+
etag?: string;
25+
url: string;
26+
accessMode: AccessMode;
27+
moderation?: Array<string>;
28+
accessControl: AccessControlType;
29+
context?: Object;
30+
metadata?: Object;
31+
}
32+

packages/types/lib/cloud/CloudConfig.d.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@ import { ResourceType } from "./ResourceType";
22
import { StorageType } from "./StorageType";
33

44
export interface CloudConfig {
5-
apiKey?: string,
6-
apiSecret?: string,
7-
cloudName?: string,
8-
cname?: string,
9-
privateCdn?: boolean,
10-
resourceType?: ResourceType,
11-
secure?: boolean,
12-
secureDistribution?: string,
13-
storageType?: StorageType,
14-
shorten?: string,
15-
urlSuffix?: string,
16-
useRootPath?: boolean,
17-
cdnSubdomain?: boolean,
18-
version?: string | number,
19-
signature?: string,
20-
forceVersion?: boolean
5+
apiKey?: string;
6+
apiSecret?: string;
7+
cloudName?: string;
8+
cname?: string;
9+
privateCdn?: boolean;
10+
resourceType?: ResourceType;
11+
secure?: boolean;
12+
secureDistribution?: string;
13+
storageType?: StorageType;
14+
shorten?: string;
15+
urlSuffix?: string;
16+
useRootPath?: boolean;
17+
cdnSubdomain?: boolean;
18+
version?: string | number;
19+
signature?: string;
20+
forceVersion?: boolean;
21+
authToken?: Object;
2122
}

packages/types/lib/index.d.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export { CldOptions } from './options/CldOptions'
2-
export { TransformerOption, TransformerBaseOptions, TransformerVideoOption } from './options/TransformerOption'
3-
export { CloudConfig } from './cloud/CloudConfig'
4-
export { ResourceType } from './cloud/ResourceType'
5-
export { StorageType } from './cloud/StorageType'
6-
export {
1+
export type { CldOptions } from './options/CldOptions'
2+
export type { TransformerOption, TransformerBaseOptions, TransformerVideoOption } from './options/TransformerOption'
3+
export type { CloudConfig } from './cloud/CloudConfig'
4+
export type { ResourceType } from './cloud/ResourceType'
5+
export type { StorageType } from './cloud/StorageType'
6+
export type {
77
Effect,
88
VEffect,
99
Variable,
@@ -28,10 +28,27 @@ export {
2828
FPS,
2929
Transformation,
3030
FPSType,
31-
CompassGravity
31+
CompassGravity,
32+
TextStyle
3233
} from './transformation'
3334

34-
export {
35+
export type { Asset } from './asset/Asset'
36+
37+
export type {
38+
ResponseError,
39+
RenameOptions,
40+
ResourceOptions,
41+
ResponsiveBreakpointOption,
42+
UploadOptions,
43+
AccessControl,
44+
AccessControlType,
45+
AccessMode,
46+
AssetOptions,
47+
SingleDeleteOptions,
48+
ManupulationOptions
49+
} from './options/api'
50+
51+
export type {
3552
SocialCard, SocialImage, SocialText, TextArea
3653
} from './options/TextOptions'
3754

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import { ResourceType } from "../cloud/ResourceType";
2+
import { StorageType } from "../cloud/StorageType";
3+
4+
export type ResponseError = {
5+
message: string;
6+
http_code: number
7+
}
8+
9+
export type ResourceOptions = {
10+
resourceType?: ResourceType;
11+
type?: StorageType;
12+
}
13+
14+
export type SingleDeleteOptions = ResourceOptions & {
15+
invalidate?: boolean;
16+
}
17+
18+
export type RenameOptions = ResourceOptions & {
19+
toType: StorageType;
20+
overwrite: boolean;
21+
}
22+
23+
export type AccessMode = 'public' | 'authenticated';
24+
25+
export type AccessControlType = 'token' | 'anonymous'
26+
27+
export type AccessControl = {
28+
type: AccessControlType;
29+
start?: string;
30+
end?: string;
31+
}
32+
33+
export type ResponsiveBreakpointOption = {
34+
createDerived: boolean;
35+
format?: string;
36+
transformation?: string;
37+
maxWidth?: number;
38+
minWidth?: number;
39+
bytesStep?: number;
40+
maxImages?: number
41+
}
42+
43+
export type AssetOptions = {
44+
tags?: string[]
45+
context?: string[]
46+
colors?: boolean
47+
faces?: boolean;
48+
qualityAnalysis?: boolean;
49+
accessibilityAnalysis?: boolean;
50+
cinemagraphAnalysis?: boolean;
51+
imageMetadata?: boolean;
52+
phash?: boolean
53+
responsiveBreakpoints?: ResponsiveBreakpointOption[]
54+
autoTagging?: number;
55+
categorization?: string;
56+
detection?: string;
57+
ocr?: string;
58+
exif?: boolean;
59+
}
60+
61+
export type ManupulationOptions = {
62+
eager?: string[];
63+
eageAsync?: boolean;
64+
eagerNotificationUrl?: string
65+
transformation?: string
66+
format?: string;
67+
customCoordinates?: string[]
68+
faceCoordinates?: string[]
69+
backgroundRemoval?: 'cloudinary_ai' | 'pixelz'
70+
rawConvert?: 'apose' | 'google_speech' | 'extract_text'
71+
}
72+
73+
export type UploadOptions = ResourceOptions & ManupulationOptions & AssetOptions & {
74+
publicId?: string;
75+
folder?: string;
76+
useFilename?: boolean;
77+
uniqueFilename?: boolean;
78+
accessControl?: AccessControl;
79+
accessMode?: AccessMode;
80+
discardOriginalFilename?: boolean;
81+
overwrite?: boolean;
82+
allowedFormats?: string[];
83+
async?: boolean;
84+
backup?: boolean;
85+
eval?: string;
86+
headers?: string;
87+
invalidate?: boolean;
88+
moderation?: string;
89+
notificationUrl?: string;
90+
proxy?: string;
91+
returnDeleteToken?: boolean;
92+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export interface TextStyle {
2+
fontFamily?: string;
3+
fontSize?: number;
4+
fontColor?: string;
5+
fontWeight?: string;
6+
fontStyle?: string;
7+
background?: string;
8+
opacity?: number;
9+
textDecoration?: string
10+
}

packages/types/lib/transformation/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export { ColorSpace, VColorSpace } from './ColorSpace'
1313
export { AudioCodec } from './AudioCodec'
1414
export { FPS, FPSType } from './Fps'
1515
export type Transformation = Array<string | string[]>
16-
export { Offset } from './Offset'
16+
export { Offset } from './Offset'
17+
export { TextStyle } from './Overlay'

packages/types/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cld-apis/types",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Cloudinary TypeScript types",
55
"author": "Maya Shavin <maya@cloudinary.com>",
66
"homepage": "https://github.com/mayashavin/cloudinary-api/tree/master/packages/types#readme",
@@ -21,8 +21,8 @@
2121
"agadoo": "agadoo dist/"
2222
},
2323
"dependencies": {
24+
"@cld-apis/utils": "^0.1.2",
2425
"@types/node": "^14.14.10",
25-
"@cld-apis/utils": "^0.1.1",
2626
"agadoo": "^2.0.0",
2727
"bundlewatch": "^0.3.1",
2828
"husky": "^4.3.0"

packages/uploader/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/uploader/__tests__/uploader.test.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)