needle-cloud 1.2.0 → 1.2.1-experimental.1e6da59
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 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/needle-share-cli/src/web/auth.d.ts +14 -6
- package/dist/needle-share-cli/src/web/functions/checkout.d.ts +10 -0
- package/dist/needle-share-cli/src/web/functions/get.d.ts +8 -0
- package/dist/needle-share-cli/src/web/functions/index.d.ts +1 -0
- package/dist/needle-share-cli/src/web/index.d.ts +1 -0
- package/dist/needle-share-cli/src/web/web-components/LoginButton.d.ts +9 -0
- package/dist/needle-share-cli/src/web/web-components/index.d.ts +1 -0
- package/dist/web/auth.d.ts +14 -6
- package/dist/web/functions/checkout.d.ts +10 -0
- package/dist/web/functions/get.d.ts +8 -0
- package/dist/web/functions/index.d.ts +1 -0
- package/dist/web/index.d.ts +1 -0
- package/dist/web/web-components/LoginButton.d.ts +9 -0
- package/dist/web/web-components/index.d.ts +1 -0
- package/package.json +5 -3
|
@@ -3,6 +3,12 @@ export namespace Auth {
|
|
|
3
3
|
const baseUrl: string;
|
|
4
4
|
const redirectUri: string;
|
|
5
5
|
const postSignOutRedirectUri: string;
|
|
6
|
+
/**
|
|
7
|
+
* Register a callback to be called when the authentication state changes
|
|
8
|
+
* @param {Function} callback - The callback to register
|
|
9
|
+
* @returns {Function} - A function to unregister the callback
|
|
10
|
+
*/
|
|
11
|
+
function onChanged(callback: Function): Function;
|
|
6
12
|
/**
|
|
7
13
|
* Returns a promise that resolves when Auth is initialized
|
|
8
14
|
* @returns {Promise<boolean>}
|
|
@@ -11,10 +17,10 @@ export namespace Auth {
|
|
|
11
17
|
/**
|
|
12
18
|
* Initialize the Auth system
|
|
13
19
|
* @internal
|
|
14
|
-
* @param {
|
|
20
|
+
* @param {AuthInitOpts} [opts] - Initialization options
|
|
15
21
|
* @returns {Promise<boolean>}
|
|
16
22
|
*/
|
|
17
|
-
function init(opts?:
|
|
23
|
+
function init(opts?: AuthInitOpts): Promise<boolean>;
|
|
18
24
|
/**
|
|
19
25
|
* Check if the user is currently authenticated
|
|
20
26
|
* @returns {boolean}
|
|
@@ -61,11 +67,13 @@ export namespace Auth {
|
|
|
61
67
|
function signOut(): Promise<void>;
|
|
62
68
|
}
|
|
63
69
|
export type UserInfoResponse = import("@logto/browser").UserInfoResponse;
|
|
64
|
-
export type ResourceUrl = "https://cloud.needle.tools/api";
|
|
65
|
-
export type
|
|
66
|
-
|
|
70
|
+
export type ResourceUrl = "https://cloud.needle.tools/api" | ({} & string);
|
|
71
|
+
export type AuthInitOpts = {
|
|
72
|
+
api_endpoint?: string;
|
|
67
73
|
appId?: string;
|
|
68
74
|
debug?: boolean;
|
|
69
75
|
};
|
|
70
|
-
|
|
76
|
+
import { api_endpoint } from "../constants.js";
|
|
77
|
+
/** @type {string | undefined} */
|
|
78
|
+
declare let appId: string | undefined;
|
|
71
79
|
export {};
|
|
@@ -27,6 +27,14 @@ export function getDeployments(opts: {
|
|
|
27
27
|
offset?: number;
|
|
28
28
|
limit?: number;
|
|
29
29
|
}): Promise<Array<Deployment>>;
|
|
30
|
+
/**
|
|
31
|
+
* Get licenses for a specific user. A product type is required
|
|
32
|
+
* @param {{product:string | string[]}} opts
|
|
33
|
+
* @returns {Promise<null | import("../../../../needle-share/types/stripe.js").License[]>}
|
|
34
|
+
*/
|
|
35
|
+
export function getUserLicenses(opts: {
|
|
36
|
+
product: string | string[];
|
|
37
|
+
}): Promise<null | import("../../../../needle-share/types/stripe.js").License[]>;
|
|
30
38
|
/**
|
|
31
39
|
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
32
40
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NeedleLoginButton } from "./LoginButton.js";
|
package/dist/web/auth.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ export namespace Auth {
|
|
|
3
3
|
const baseUrl: string;
|
|
4
4
|
const redirectUri: string;
|
|
5
5
|
const postSignOutRedirectUri: string;
|
|
6
|
+
/**
|
|
7
|
+
* Register a callback to be called when the authentication state changes
|
|
8
|
+
* @param {Function} callback - The callback to register
|
|
9
|
+
* @returns {Function} - A function to unregister the callback
|
|
10
|
+
*/
|
|
11
|
+
function onChanged(callback: Function): Function;
|
|
6
12
|
/**
|
|
7
13
|
* Returns a promise that resolves when Auth is initialized
|
|
8
14
|
* @returns {Promise<boolean>}
|
|
@@ -11,10 +17,10 @@ export namespace Auth {
|
|
|
11
17
|
/**
|
|
12
18
|
* Initialize the Auth system
|
|
13
19
|
* @internal
|
|
14
|
-
* @param {
|
|
20
|
+
* @param {AuthInitOpts} [opts] - Initialization options
|
|
15
21
|
* @returns {Promise<boolean>}
|
|
16
22
|
*/
|
|
17
|
-
function init(opts?:
|
|
23
|
+
function init(opts?: AuthInitOpts): Promise<boolean>;
|
|
18
24
|
/**
|
|
19
25
|
* Check if the user is currently authenticated
|
|
20
26
|
* @returns {boolean}
|
|
@@ -61,11 +67,13 @@ export namespace Auth {
|
|
|
61
67
|
function signOut(): Promise<void>;
|
|
62
68
|
}
|
|
63
69
|
export type UserInfoResponse = import("@logto/browser").UserInfoResponse;
|
|
64
|
-
export type ResourceUrl = "https://cloud.needle.tools/api";
|
|
65
|
-
export type
|
|
66
|
-
|
|
70
|
+
export type ResourceUrl = "https://cloud.needle.tools/api" | ({} & string);
|
|
71
|
+
export type AuthInitOpts = {
|
|
72
|
+
api_endpoint?: string;
|
|
67
73
|
appId?: string;
|
|
68
74
|
debug?: boolean;
|
|
69
75
|
};
|
|
70
|
-
|
|
76
|
+
import { api_endpoint } from "../constants.js";
|
|
77
|
+
/** @type {string | undefined} */
|
|
78
|
+
declare let appId: string | undefined;
|
|
71
79
|
export {};
|
|
@@ -27,6 +27,14 @@ export function getDeployments(opts: {
|
|
|
27
27
|
offset?: number;
|
|
28
28
|
limit?: number;
|
|
29
29
|
}): Promise<Array<Deployment>>;
|
|
30
|
+
/**
|
|
31
|
+
* Get licenses for a specific user. A product type is required
|
|
32
|
+
* @param {{product:string | string[]}} opts
|
|
33
|
+
* @returns {Promise<null | import("../../../../needle-share/types/stripe.js").License[]>}
|
|
34
|
+
*/
|
|
35
|
+
export function getUserLicenses(opts: {
|
|
36
|
+
product: string | string[];
|
|
37
|
+
}): Promise<null | import("../../../../needle-share/types/stripe.js").License[]>;
|
|
30
38
|
/**
|
|
31
39
|
* Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
|
|
32
40
|
*/
|
package/dist/web/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NeedleLoginButton } from "./LoginButton.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "needle-cloud",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1-experimental.1e6da59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"needle-cloud": "./bin/cli.js"
|
|
@@ -46,7 +46,9 @@
|
|
|
46
46
|
"dev:node": "microbundle watch -i ./src/cli.js -o dist/cli.js --format esm --target node --no-compress",
|
|
47
47
|
"dist": "npx --yes rimraf dist && npm run dist:web && npm run dist:node",
|
|
48
48
|
"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",
|
|
49
|
-
"dist:
|
|
49
|
+
"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",
|
|
50
|
+
"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",
|
|
51
|
+
"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"
|
|
50
52
|
},
|
|
51
53
|
"files": [
|
|
52
54
|
"bin/",
|
|
@@ -59,4 +61,4 @@
|
|
|
59
61
|
"access": "public",
|
|
60
62
|
"registry": "https://registry.npmjs.org/"
|
|
61
63
|
}
|
|
62
|
-
}
|
|
64
|
+
}
|