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.
@@ -1 +0,0 @@
1
- export const program: any;
@@ -1 +0,0 @@
1
- export * from "./web/index.js";
@@ -1,9 +0,0 @@
1
- export namespace AuthScopes {
2
- const Basic: UserScope[];
3
- const Payment: string[];
4
- const All: string[];
5
- }
6
- export namespace Licenses {
7
- const NeedlePro: string[];
8
- }
9
- import { UserScope } from "@logto/browser";
@@ -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,10 +0,0 @@
1
- /**
2
- * Start the checkout process
3
- * @param {{ price_id:string }} args
4
- */
5
- export function startCheckoutSession(args: {
6
- price_id: string;
7
- }): Promise<{
8
- ok: boolean;
9
- status: number;
10
- }>;
@@ -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,3 +0,0 @@
1
- export * from "./upload.js";
2
- export * from "./get.js";
3
- export { startCheckoutSession } from "./checkout.js";
@@ -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,5 +0,0 @@
1
- /**
2
- * @param {string | null | undefined} [org]
3
- * @returns {Promise<import("../web.types").AuthData>}
4
- */
5
- export function getAuthHeader(org?: string | null | undefined): Promise<import("../web.types").AuthData>;
@@ -1,4 +0,0 @@
1
- export * from "./auth.js";
2
- export * from "./web-components/index.js";
3
- export * from "./functions/index.js";
4
- export { AuthScopes } from "./auth.config.js";
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export function isDevEnvironment(): boolean;
@@ -1,9 +0,0 @@
1
- /**
2
- * Basic web component for login/logout
3
- */
4
- export class NeedleLoginButton extends HTMLButtonElement {
5
- connectedCallback(): void;
6
- __unsubscribeOnChange: Function;
7
- disconnectedCallback(): void;
8
- __update(): void;
9
- }
@@ -1 +0,0 @@
1
- export { NeedleLoginButton } from "./LoginButton.js";