needle-cloud 0.1.0-alpha.8 → 0.2.0-alpha
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/CHANGELOG.md +4 -1
- package/README.md +11 -4
- package/bin/cli.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.esm.js +22080 -1
- package/dist/cli.esm.js.map +1 -0
- package/dist/index.esm.js +7074 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/web/index.d.ts +43 -13
- package/package.json +7 -3
package/dist/web/index.d.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* import("@needle-tools/cloud-sdk/types").FileLike
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* @typedef {{ token: string, endpoint?:string }} AuthData
|
|
6
|
+
* @typedef {{ name: string, mimetype: string, buffer:Buffer }} Filelike
|
|
3
7
|
*/
|
|
4
8
|
/**
|
|
5
|
-
* @param {Array<
|
|
9
|
+
* @param {Array<Filelike>} files
|
|
6
10
|
* @param {AuthData & {
|
|
7
11
|
* name?:string,
|
|
8
12
|
* abort?:AbortSignal,
|
|
9
13
|
* }} opts
|
|
10
14
|
* @returns {Promise<{error:string} | {job_id:string, view_id:string, url?:string, skipped?:boolean}>}
|
|
11
15
|
*/
|
|
12
|
-
export function uploadFiles(files: Array<
|
|
16
|
+
export function uploadFiles(files: Array<Filelike>, opts: AuthData & {
|
|
13
17
|
name?: string;
|
|
14
18
|
abort?: AbortSignal;
|
|
15
19
|
}): Promise<{
|
|
@@ -21,17 +25,26 @@ export function uploadFiles(files: Array<import("@needle-tools/cloud-sdk/types")
|
|
|
21
25
|
skipped?: boolean;
|
|
22
26
|
}>;
|
|
23
27
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
29
|
+
* @typedef {import("@needle-tools/cloud-sdk/types").JobType} JobType
|
|
30
|
+
* @typedef {import("@needle-tools/cloud-sdk/types").JobStatus} JobStatus
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {{
|
|
34
|
+
* name: string,
|
|
35
|
+
* thumbnail_url?: string,
|
|
31
36
|
* created_at: string,
|
|
32
37
|
* updated_at: string,
|
|
33
|
-
*
|
|
34
|
-
*
|
|
38
|
+
* files: Array<{
|
|
39
|
+
* type: "upload" | "conversion" | "optimization" | "deployment",
|
|
40
|
+
* status: "failed" | "completed" | (string & {}),
|
|
41
|
+
* created_at: string,
|
|
42
|
+
* updated_at: string,
|
|
43
|
+
* name? :string,
|
|
44
|
+
* url:string,
|
|
45
|
+
* size: number,
|
|
46
|
+
* additional_size?: number,
|
|
47
|
+
* }>}} Upload
|
|
35
48
|
*/
|
|
36
49
|
/**
|
|
37
50
|
* @param {AuthData & ({ name?: string, view_id?:string } | { page: number, limit: number })} opts
|
|
@@ -48,15 +61,32 @@ export type AuthData = {
|
|
|
48
61
|
token: string;
|
|
49
62
|
endpoint?: string;
|
|
50
63
|
};
|
|
64
|
+
export type Filelike = {
|
|
65
|
+
name: string;
|
|
66
|
+
mimetype: string;
|
|
67
|
+
buffer: Buffer;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
71
|
+
*/
|
|
72
|
+
export type JobType = import("@needle-tools/cloud-sdk/types").JobType;
|
|
73
|
+
/**
|
|
74
|
+
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
75
|
+
*/
|
|
76
|
+
export type JobStatus = import("@needle-tools/cloud-sdk/types").JobStatus;
|
|
51
77
|
export type Upload = {
|
|
52
78
|
name: string;
|
|
79
|
+
thumbnail_url?: string;
|
|
53
80
|
created_at: string;
|
|
54
81
|
updated_at: string;
|
|
55
82
|
files: Array<{
|
|
56
|
-
|
|
57
|
-
|
|
83
|
+
type: "upload" | "conversion" | "optimization" | "deployment";
|
|
84
|
+
status: "failed" | "completed" | (string & {});
|
|
58
85
|
created_at: string;
|
|
59
86
|
updated_at: string;
|
|
87
|
+
name?: string;
|
|
60
88
|
url: string;
|
|
89
|
+
size: number;
|
|
90
|
+
additional_size?: number;
|
|
61
91
|
}>;
|
|
62
92
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "needle-cloud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"needle-cloud": "./bin/cli.js"
|
|
@@ -45,5 +45,9 @@
|
|
|
45
45
|
"README.md",
|
|
46
46
|
"CHANGELOG.md",
|
|
47
47
|
"package-lock.json"
|
|
48
|
-
]
|
|
49
|
-
|
|
48
|
+
],
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org/"
|
|
52
|
+
}
|
|
53
|
+
}
|