needle-cloud 1.4.0 → 1.5.0

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.
@@ -3,4 +3,7 @@ export namespace AuthScopes {
3
3
  const Payment: string[];
4
4
  const All: string[];
5
5
  }
6
+ export namespace Licenses {
7
+ const NeedlePro: string[];
8
+ }
6
9
  import { UserScope } from "@logto/browser";
@@ -28,13 +28,23 @@ export function getDeployments(opts: {
28
28
  limit?: number;
29
29
  }): Promise<Array<Deployment>>;
30
30
  /**
31
- * Get licenses for a specific user. A product type is required
32
- * @param {{product:string | string[]}} opts
31
+ * Get licenses for a specific user. A product type is optional.
32
+ * Only valid licenses are returned
33
+ * @param {{product?:string | string[], includeInvalid?: boolean}} opts
33
34
  * @returns {Promise<null | import("../../../../needle-share/types/stripe.js").License[]>}
34
35
  */
35
36
  export function getUserLicenses(opts: {
36
- product: string | string[];
37
+ product?: string | string[];
38
+ includeInvalid?: boolean;
37
39
  }): Promise<null | import("../../../../needle-share/types/stripe.js").License[]>;
40
+ /**
41
+ * Checks if the current user owns a specific product. A product type is optional
42
+ * @param {{product?:string | string[]}} opts
43
+ * @returns {Promise<boolean>}
44
+ */
45
+ export function ownsProduct(opts: {
46
+ product?: string | string[];
47
+ }): Promise<boolean>;
38
48
  /**
39
49
  * Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
40
50
  */
@@ -3,4 +3,7 @@ export namespace AuthScopes {
3
3
  const Payment: string[];
4
4
  const All: string[];
5
5
  }
6
+ export namespace Licenses {
7
+ const NeedlePro: string[];
8
+ }
6
9
  import { UserScope } from "@logto/browser";
@@ -28,13 +28,23 @@ export function getDeployments(opts: {
28
28
  limit?: number;
29
29
  }): Promise<Array<Deployment>>;
30
30
  /**
31
- * Get licenses for a specific user. A product type is required
32
- * @param {{product:string | string[]}} opts
31
+ * Get licenses for a specific user. A product type is optional.
32
+ * Only valid licenses are returned
33
+ * @param {{product?:string | string[], includeInvalid?: boolean}} opts
33
34
  * @returns {Promise<null | import("../../../../needle-share/types/stripe.js").License[]>}
34
35
  */
35
36
  export function getUserLicenses(opts: {
36
- product: string | string[];
37
+ product?: string | string[];
38
+ includeInvalid?: boolean;
37
39
  }): Promise<null | import("../../../../needle-share/types/stripe.js").License[]>;
40
+ /**
41
+ * Checks if the current user owns a specific product. A product type is optional
42
+ * @param {{product?:string | string[]}} opts
43
+ * @returns {Promise<boolean>}
44
+ */
45
+ export function ownsProduct(opts: {
46
+ product?: string | string[];
47
+ }): Promise<boolean>;
38
48
  /**
39
49
  * Unfortunately this doesnt get properly bundles in the final output so we have to write the types below directly
40
50
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "needle-cloud",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "needle-cloud": "./bin/cli.js"