needle-cloud 1.9.8 → 1.9.9-dev.8580754

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.
@@ -4,18 +4,28 @@
4
4
  * @typedef {import("@needle-tools/cloud-sdk/types").JobStatus} JobStatus
5
5
  */
6
6
  /**
7
- * @param {{ org?:string } & ({ name?: string, view_id?:string } | { page: number, limit: number })} opts
8
- * @returns {Promise<Array<import("../web.types.js").Upload>>}
7
+ * Represents a single file job within an upload (e.g. the original upload, a conversion, an optimization, or a deployment).
8
+ * @typedef {{ type: import("@needle-tools/cloud-sdk/types").JobType, status: "failed" | "completed" | string, created_at: string, updated_at: string, name?: string, url: string | null, size: number }} UploadFile
9
+ */
10
+ /**
11
+ * Represents a cloud upload (a "view" on Needle Cloud) and its associated files/jobs.
12
+ * @typedef {{ name: string, thumbnail_url?: string, created_at: string, updated_at: string, files: Array<UploadFile> }} Upload
13
+ */
14
+ /**
15
+ * @param {{ org?:string } & ({ name?: string, view_id?:string, search?: string } | { page: number, limit: number, search?: string })} opts
16
+ * @returns {Promise<Array<Upload>>}
9
17
  */
10
18
  export function getUploads(opts: {
11
19
  org?: string;
12
20
  } & ({
13
21
  name?: string;
14
22
  view_id?: string;
23
+ search?: string;
15
24
  } | {
16
25
  page: number;
17
26
  limit: number;
18
- })): Promise<Array<import("../web.types.js").Upload>>;
27
+ search?: string;
28
+ })): Promise<Array<Upload>>;
19
29
  /**
20
30
  * @param {{ org?:string } & { offset?:number, limit?: number }} opts
21
31
  * @returns {Promise<Array<Deployment>>}
@@ -53,6 +63,28 @@ export type JobType = import("@needle-tools/cloud-sdk/types").JobType;
53
63
  * Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
54
64
  */
55
65
  export type JobStatus = import("@needle-tools/cloud-sdk/types").JobStatus;
66
+ /**
67
+ * Represents a single file job within an upload (e.g. the original upload, a conversion, an optimization, or a deployment).
68
+ */
69
+ export type UploadFile = {
70
+ type: import("@needle-tools/cloud-sdk/types").JobType;
71
+ status: "failed" | "completed" | string;
72
+ created_at: string;
73
+ updated_at: string;
74
+ name?: string;
75
+ url: string | null;
76
+ size: number;
77
+ };
78
+ /**
79
+ * Represents a cloud upload (a "view" on Needle Cloud) and its associated files/jobs.
80
+ */
81
+ export type Upload = {
82
+ name: string;
83
+ thumbnail_url?: string;
84
+ created_at: string;
85
+ updated_at: string;
86
+ files: Array<UploadFile>;
87
+ };
56
88
  export type Deployment = {
57
89
  name: string;
58
90
  url: string;
@@ -4,18 +4,28 @@
4
4
  * @typedef {import("@needle-tools/cloud-sdk/types").JobStatus} JobStatus
5
5
  */
6
6
  /**
7
- * @param {{ org?:string } & ({ name?: string, view_id?:string } | { page: number, limit: number })} opts
8
- * @returns {Promise<Array<import("../web.types.js").Upload>>}
7
+ * Represents a single file job within an upload (e.g. the original upload, a conversion, an optimization, or a deployment).
8
+ * @typedef {{ type: import("@needle-tools/cloud-sdk/types").JobType, status: "failed" | "completed" | string, created_at: string, updated_at: string, name?: string, url: string | null, size: number }} UploadFile
9
+ */
10
+ /**
11
+ * Represents a cloud upload (a "view" on Needle Cloud) and its associated files/jobs.
12
+ * @typedef {{ name: string, thumbnail_url?: string, created_at: string, updated_at: string, files: Array<UploadFile> }} Upload
13
+ */
14
+ /**
15
+ * @param {{ org?:string } & ({ name?: string, view_id?:string, search?: string } | { page: number, limit: number, search?: string })} opts
16
+ * @returns {Promise<Array<Upload>>}
9
17
  */
10
18
  export function getUploads(opts: {
11
19
  org?: string;
12
20
  } & ({
13
21
  name?: string;
14
22
  view_id?: string;
23
+ search?: string;
15
24
  } | {
16
25
  page: number;
17
26
  limit: number;
18
- })): Promise<Array<import("../web.types.js").Upload>>;
27
+ search?: string;
28
+ })): Promise<Array<Upload>>;
19
29
  /**
20
30
  * @param {{ org?:string } & { offset?:number, limit?: number }} opts
21
31
  * @returns {Promise<Array<Deployment>>}
@@ -53,6 +63,28 @@ export type JobType = import("@needle-tools/cloud-sdk/types").JobType;
53
63
  * Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
54
64
  */
55
65
  export type JobStatus = import("@needle-tools/cloud-sdk/types").JobStatus;
66
+ /**
67
+ * Represents a single file job within an upload (e.g. the original upload, a conversion, an optimization, or a deployment).
68
+ */
69
+ export type UploadFile = {
70
+ type: import("@needle-tools/cloud-sdk/types").JobType;
71
+ status: "failed" | "completed" | string;
72
+ created_at: string;
73
+ updated_at: string;
74
+ name?: string;
75
+ url: string | null;
76
+ size: number;
77
+ };
78
+ /**
79
+ * Represents a cloud upload (a "view" on Needle Cloud) and its associated files/jobs.
80
+ */
81
+ export type Upload = {
82
+ name: string;
83
+ thumbnail_url?: string;
84
+ created_at: string;
85
+ updated_at: string;
86
+ files: Array<UploadFile>;
87
+ };
56
88
  export type Deployment = {
57
89
  name: string;
58
90
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "needle-cloud",
3
- "version": "1.9.8",
3
+ "version": "1.9.9-dev.8580754",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "needle-cloud": "./bin/cli.js"
@@ -31,14 +31,12 @@
31
31
  "devDependencies": {
32
32
  "@needle-tools/cloud-sdk": "1.0.0-alpha",
33
33
  "concurrently": "^9.0.1",
34
- "microbundle": "^0.15.1",
35
- "vitest": "^2.1.1"
34
+ "microbundle": "^0.15.1"
36
35
  },
37
36
  "engines": {
38
37
  "node": ">= 18"
39
38
  },
40
39
  "scripts": {
41
- "test": "vitest",
42
40
  "install-local-deps": "cd ../needle-share-sdk && npm install",
43
41
  "deploy:main": "npm run deploy -- --tag main",
44
42
  "deploy": "npm run dist & npm publish --access public",
@@ -48,10 +46,10 @@
48
46
  "dev:web": "microbundle watch -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --no-compress",
49
47
  "dev:node": "microbundle watch -i ./src/cli.js -o dist/cli.js --format esm --target node --no-compress",
50
48
  "dist": "npx --yes rimraf dist && npm run dist:web && npm run dist:node",
51
- "dist:web": "microbundle -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --sourcemap true --compress true --define api_endpoint=https://cloud.needle.tools/api,cloud_base_url=https://cloud.needle.tools",
52
- "dist:web-preview": "microbundle -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --sourcemap true --compress true --define api_endpoint=https://cloud-staging.needle.tools/api,cloud_base_url=https://cloud-staging.needle.tools",
53
- "dist:node": "microbundle -i ./src/cli.js -o dist/cli.js --format esm --generateTypes --target node --sourcemap false --compress --define api_endpoint=https://cloud.needle.tools/api,cloud_base_url=https://cloud.needle.tools",
54
- "dist:node-preview": "microbundle -i ./src/cli.js -o dist/cli.js --format esm --generateTypes --target node --sourcemap false --compress --define api_endpoint=https://cloud-staging.needle.tools/api,cloud_base_url=https://cloud-staging.needle.tools",
49
+ "dist:web": "microbundle -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --sourcemap true --compress true --define api_endpoint=https://cloud.needle.tools/api,cloud_base_url=https://cloud.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
50
+ "dist:web-preview": "microbundle -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --sourcemap true --compress true --define api_endpoint=https://cloud-staging.needle.tools/api,cloud_base_url=https://cloud-staging.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
51
+ "dist:node": "microbundle -i ./src/cli.js -o dist/cli.js --format esm --generateTypes --target node --sourcemap false --compress --define api_endpoint=https://cloud.needle.tools/api,cloud_base_url=https://cloud.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
52
+ "dist:node-preview": "microbundle -i ./src/cli.js -o dist/cli.js --format esm --generateTypes --target node --sourcemap false --compress --define api_endpoint=https://cloud-staging.needle.tools/api,cloud_base_url=https://cloud-staging.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
55
53
  "dev:mcp": "npx --yes @modelcontextprotocol/inspector mcp-inspector http://localhost:8424/mcp"
56
54
  },
57
55
  "files": [
@@ -65,4 +63,4 @@
65
63
  "access": "public",
66
64
  "registry": "https://registry.npmjs.org/"
67
65
  }
68
- }
66
+ }