needle-cloud 1.9.9-dev.dd2b398 → 1.9.9-dev.ec1ecfb
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/dist/cli.esm.js +1 -1
- package/dist/index.esm.js +1 -2
- package/dist/web/functions/get.d.ts +0 -58
- package/dist/web/functions/upload.d.ts +2 -2
- package/package.json +5 -5
- package/dist/index.esm.js.map +0 -1
- package/dist/needle-share-cli/src/cli.d.ts +0 -1
- package/dist/needle-share-cli/src/index.d.ts +0 -1
- package/dist/needle-share-cli/src/web/auth.config.d.ts +0 -9
- package/dist/needle-share-cli/src/web/auth.d.ts +0 -79
- package/dist/needle-share-cli/src/web/functions/checkout.d.ts +0 -10
- package/dist/needle-share-cli/src/web/functions/get.d.ts +0 -91
- package/dist/needle-share-cli/src/web/functions/index.d.ts +0 -3
- package/dist/needle-share-cli/src/web/functions/upload.d.ts +0 -28
- package/dist/needle-share-cli/src/web/functions/utils.d.ts +0 -5
- package/dist/needle-share-cli/src/web/index.d.ts +0 -4
- package/dist/needle-share-cli/src/web/polyfill.d.ts +0 -1
- package/dist/needle-share-cli/src/web/utils.d.ts +0 -1
- package/dist/needle-share-cli/src/web/web-components/LoginButton.d.ts +0 -9
- package/dist/needle-share-cli/src/web/web-components/index.d.ts +0 -1
- package/dist/pako.esm-01431bd2.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const program: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./web/index.js";
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export namespace Auth {
|
|
2
|
-
/** @param {boolean} _debug */
|
|
3
|
-
function setDebug(_debug: boolean): void;
|
|
4
|
-
const baseUrl: string;
|
|
5
|
-
const redirectUri: string;
|
|
6
|
-
const postSignOutRedirectUri: string;
|
|
7
|
-
/**
|
|
8
|
-
* Register a callback to be called when the authentication state changes
|
|
9
|
-
* @param {Function} callback - The callback to register
|
|
10
|
-
* @returns {Function} - A function to unregister the callback
|
|
11
|
-
*/
|
|
12
|
-
function onChanged(callback: Function): Function;
|
|
13
|
-
/**
|
|
14
|
-
* Returns a promise that resolves when Auth is initialized
|
|
15
|
-
* @returns {Promise<boolean>}
|
|
16
|
-
*/
|
|
17
|
-
function ready(): Promise<boolean>;
|
|
18
|
-
/**
|
|
19
|
-
* Initialize the Auth system
|
|
20
|
-
* @internal
|
|
21
|
-
* @param {AuthInitOpts} [opts] - Initialization options
|
|
22
|
-
* @returns {Promise<boolean>}
|
|
23
|
-
*/
|
|
24
|
-
function init(opts?: AuthInitOpts): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Check if the user is currently authenticated
|
|
27
|
-
* @returns {boolean}
|
|
28
|
-
*/
|
|
29
|
-
function isAuthenticated(): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Check authentication status with the server
|
|
32
|
-
* @returns {Promise<boolean>}
|
|
33
|
-
*/
|
|
34
|
-
function checkIsAuthenticated(): Promise<boolean>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the current user information (if fetched previously)
|
|
37
|
-
* @returns {UserInfoResponse|null}
|
|
38
|
-
*/
|
|
39
|
-
function getUserInfo(): import("@logto/browser").UserInfoResponse;
|
|
40
|
-
/**
|
|
41
|
-
* Get the current user ID (sub)
|
|
42
|
-
* @returns {string|null}
|
|
43
|
-
*/
|
|
44
|
-
function getUserId(): string;
|
|
45
|
-
/**
|
|
46
|
-
* Get the user's name or username (if available)
|
|
47
|
-
* @returns {string|null}
|
|
48
|
-
*/
|
|
49
|
-
function getName(): string;
|
|
50
|
-
/**
|
|
51
|
-
* Request user information from the server
|
|
52
|
-
* @returns {Promise<UserInfoResponse|null>}
|
|
53
|
-
*/
|
|
54
|
-
function requestUserInfo(): Promise<import("@logto/browser").UserInfoResponse>;
|
|
55
|
-
/**
|
|
56
|
-
* Request an access token for the configured resource
|
|
57
|
-
* @param {string | undefined | null} [org_id] - The organization ID (optional). If none is provided the user access token will be requested.
|
|
58
|
-
* @returns {Promise<string>}
|
|
59
|
-
*/
|
|
60
|
-
function requestAccessToken(org_id?: string): Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* Initiate the sign-in process
|
|
63
|
-
*/
|
|
64
|
-
function signIn(): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Sign out the current user
|
|
67
|
-
*/
|
|
68
|
-
function signOut(): Promise<void>;
|
|
69
|
-
}
|
|
70
|
-
export type UserInfoResponse = import("@logto/browser").UserInfoResponse;
|
|
71
|
-
export type ResourceUrl = "https://cloud.needle.tools/api" | ({} & string);
|
|
72
|
-
export type AuthInitOpts = {
|
|
73
|
-
appId?: string;
|
|
74
|
-
/**
|
|
75
|
-
* User scopes. If an empty array is passed
|
|
76
|
-
*/
|
|
77
|
-
scopes?: string[] | "payment" | "all";
|
|
78
|
-
debug?: boolean;
|
|
79
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
3
|
-
* @typedef {import("@needle-tools/cloud-sdk/types").JobType} JobType
|
|
4
|
-
* @typedef {import("@needle-tools/cloud-sdk/types").JobStatus} JobStatus
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
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>>}
|
|
17
|
-
*/
|
|
18
|
-
export function getUploads(opts: {
|
|
19
|
-
org?: string;
|
|
20
|
-
} & ({
|
|
21
|
-
name?: string;
|
|
22
|
-
view_id?: string;
|
|
23
|
-
search?: string;
|
|
24
|
-
} | {
|
|
25
|
-
page: number;
|
|
26
|
-
limit: number;
|
|
27
|
-
search?: string;
|
|
28
|
-
})): Promise<Array<Upload>>;
|
|
29
|
-
/**
|
|
30
|
-
* @param {{ org?:string } & { offset?:number, limit?: number }} opts
|
|
31
|
-
* @returns {Promise<Array<Deployment>>}
|
|
32
|
-
* @typedef {{ name: string, url: string }} Deployment
|
|
33
|
-
*/
|
|
34
|
-
export function getDeployments(opts: {
|
|
35
|
-
org?: string;
|
|
36
|
-
} & {
|
|
37
|
-
offset?: number;
|
|
38
|
-
limit?: number;
|
|
39
|
-
}): Promise<Array<Deployment>>;
|
|
40
|
-
/**
|
|
41
|
-
* Get licenses for a specific user. A product type is optional.
|
|
42
|
-
* Only valid licenses are returned
|
|
43
|
-
* @param {{product?:string | string[], includeInvalid?: boolean}} opts
|
|
44
|
-
* @returns {Promise<null | import("../../../../needle-share/types/stripe.js").License[]>}
|
|
45
|
-
*/
|
|
46
|
-
export function getUserLicenses(opts: {
|
|
47
|
-
product?: string | string[];
|
|
48
|
-
includeInvalid?: boolean;
|
|
49
|
-
}): Promise<null | import("../../../../needle-share/types/stripe.js").License[]>;
|
|
50
|
-
/**
|
|
51
|
-
* Checks if the current user owns a specific product. A product type is optional
|
|
52
|
-
* @param {{product?:string | string[]}} opts
|
|
53
|
-
* @returns {Promise<boolean>}
|
|
54
|
-
*/
|
|
55
|
-
export function ownsProduct(opts: {
|
|
56
|
-
product?: string | string[];
|
|
57
|
-
}): Promise<boolean>;
|
|
58
|
-
/**
|
|
59
|
-
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
60
|
-
*/
|
|
61
|
-
export type JobType = import("@needle-tools/cloud-sdk/types").JobType;
|
|
62
|
-
/**
|
|
63
|
-
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
64
|
-
*/
|
|
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
|
-
};
|
|
88
|
-
export type Deployment = {
|
|
89
|
-
name: string;
|
|
90
|
-
url: string;
|
|
91
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {{ name: string, mimetype: string, buffer:Buffer }} Filelike
|
|
3
|
-
* @typedef {import("../web.types.js").AuthData} AuthData
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @param {Array<Filelike>} files
|
|
7
|
-
* @param {{org?:string|null} & { name?:string, abort?:AbortSignal, }} opts
|
|
8
|
-
* @returns {Promise<{error:string} | {job_id:string, view_id:string, url?:string | null, skipped?:boolean}>}
|
|
9
|
-
*/
|
|
10
|
-
export function uploadFiles(files: Array<Filelike>, opts: {
|
|
11
|
-
org?: string | null;
|
|
12
|
-
} & {
|
|
13
|
-
name?: string;
|
|
14
|
-
abort?: AbortSignal;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
error: string;
|
|
17
|
-
} | {
|
|
18
|
-
job_id: string;
|
|
19
|
-
view_id: string;
|
|
20
|
-
url?: string | null;
|
|
21
|
-
skipped?: boolean;
|
|
22
|
-
}>;
|
|
23
|
-
export type Filelike = {
|
|
24
|
-
name: string;
|
|
25
|
-
mimetype: string;
|
|
26
|
-
buffer: Buffer;
|
|
27
|
-
};
|
|
28
|
-
export type AuthData = import("../web.types.js").AuthData;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function isDevEnvironment(): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NeedleLoginButton } from "./LoginButton.js";
|