@sparkvault/sdk-mobile 4.6.0 → 4.6.2
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/errors.d.ts +4 -5
- package/dist/errors.js +4 -5
- package/dist/errors.js.map +1 -1
- package/dist/types.d.ts +6 -2
- package/dist/users.d.ts +7 -6
- package/dist/users.js +7 -6
- package/dist/users.js.map +1 -1
- package/package.json +1 -1
- package/src/errors.ts +8 -7
- package/src/types.ts +6 -2
- package/src/users.ts +7 -6
package/dist/errors.d.ts
CHANGED
|
@@ -32,13 +32,12 @@ export declare class PlanRequiredError extends SparkVaultMobileError {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Thrown on a 402 QUOTA_EXCEEDED gate: a pooled-capacity
|
|
36
|
-
*
|
|
37
|
-
* subscribe flow (native IAP)
|
|
38
|
-
* seats/identity to a seat or tier change.
|
|
35
|
+
* Thrown on a 402 QUOTA_EXCEEDED gate: a pooled-capacity limit was reached.
|
|
36
|
+
* `resource` identifies which pool to extend, routed through the in-app
|
|
37
|
+
* subscribe flow (native IAP) to the matching capacity add-on block.
|
|
39
38
|
*/
|
|
40
39
|
export declare class QuotaExceededError extends SparkVaultMobileError {
|
|
41
|
-
readonly resource: 'storage' | 'bandwidth'
|
|
40
|
+
readonly resource: 'storage' | 'bandwidth';
|
|
42
41
|
constructor(resource: QuotaExceededError['resource'], message?: string, options?: {
|
|
43
42
|
details?: Record<string, unknown>;
|
|
44
43
|
meta?: ApiMeta;
|
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function isQuotaResource(value) {
|
|
2
|
-
return value === 'storage' || value === 'bandwidth'
|
|
2
|
+
return value === 'storage' || value === 'bandwidth';
|
|
3
3
|
}
|
|
4
4
|
export class SparkVaultMobileError extends Error {
|
|
5
5
|
constructor(message, options = {}) {
|
|
@@ -46,10 +46,9 @@ export class PlanRequiredError extends SparkVaultMobileError {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Thrown on a 402 QUOTA_EXCEEDED gate: a pooled-capacity
|
|
50
|
-
*
|
|
51
|
-
* subscribe flow (native IAP)
|
|
52
|
-
* seats/identity to a seat or tier change.
|
|
49
|
+
* Thrown on a 402 QUOTA_EXCEEDED gate: a pooled-capacity limit was reached.
|
|
50
|
+
* `resource` identifies which pool to extend, routed through the in-app
|
|
51
|
+
* subscribe flow (native IAP) to the matching capacity add-on block.
|
|
53
52
|
*/
|
|
54
53
|
export class QuotaExceededError extends SparkVaultMobileError {
|
|
55
54
|
constructor(resource, message, options = {}) {
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAMA,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,CAAC;AACtD,CAAC;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAM9C,YACE,OAAe,EACf,UAKI,EAAE;QAEN,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAkB,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,qBAAqB;IAClE,Y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AAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -83,8 +83,6 @@ export interface OrgMember {
|
|
|
83
83
|
role: OrgRole;
|
|
84
84
|
/** Effective license tier resolved with account context. */
|
|
85
85
|
seat_type: SeatType | null;
|
|
86
|
-
/** Period-end epoch (seconds) when a scheduled license cancellation lands, else null. */
|
|
87
|
-
seat_cancel_at: number | null;
|
|
88
86
|
status: OrgMemberStatus;
|
|
89
87
|
created_at: number;
|
|
90
88
|
last_login_at: number | null;
|
|
@@ -152,10 +150,16 @@ export interface SparkVaultSubscription {
|
|
|
152
150
|
renewal_date: number | null;
|
|
153
151
|
renewal_amount_usd: string;
|
|
154
152
|
seats: {
|
|
153
|
+
/** Cycle-unique billed counts (flex billing: what the renewal invoices). */
|
|
155
154
|
full: number;
|
|
156
155
|
viewer: number;
|
|
157
156
|
licensed: number;
|
|
158
157
|
used: number;
|
|
158
|
+
/** Members currently HOLDING each tier — the display counts. */
|
|
159
|
+
assigned_full: number;
|
|
160
|
+
assigned_viewer: number;
|
|
161
|
+
/** Roster members with no license (no access until licensed; free). */
|
|
162
|
+
unlicensed_members: number;
|
|
159
163
|
};
|
|
160
164
|
blocks: {
|
|
161
165
|
storage: number;
|
package/dist/users.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ import type { InviteMemberRequest, InviteMemberResponse, ListMembersOptions, Lis
|
|
|
4
4
|
* Organization team client (member admins only — the API gates these on the
|
|
5
5
|
* admin role and returns 403 otherwise).
|
|
6
6
|
*
|
|
7
|
-
* Licensing
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Licensing is a billing action (flex: nothing charges mid-cycle — the renewal
|
|
8
|
+
* bills each cycle's unique license holders), so the only seat-affecting
|
|
9
|
+
* operation exposed here is `invite`, which defaults new members to
|
|
10
|
+
* `unlicensed` and never charges. Assigning or changing a paid license is
|
|
11
|
+
* intentionally absent — clients route that to the web dashboard so native
|
|
12
|
+
* apps never initiate an out-of-band purchase.
|
|
12
13
|
*/
|
|
13
14
|
export declare class MobileUsersClient {
|
|
14
15
|
private readonly http;
|
|
@@ -17,7 +18,7 @@ export declare class MobileUsersClient {
|
|
|
17
18
|
list(options?: ListMembersOptions): Promise<ListMembersResponse>;
|
|
18
19
|
/** Invite a coworker by email. Defaults to an unlicensed seat (no charge). */
|
|
19
20
|
invite(request: InviteMemberRequest): Promise<InviteMemberResponse>;
|
|
20
|
-
/** Remove a member
|
|
21
|
+
/** Remove a member and revoke their DVAKs. Access ends immediately; the current cycle still bills them, and they stop counting next cycle. */
|
|
21
22
|
remove(userId: string): Promise<RemoveMemberResponse>;
|
|
22
23
|
/** Resend a pending invitation email (resets the 7-day expiry). */
|
|
23
24
|
resendInvite(userId: string): Promise<ResendInviteResponse>;
|
package/dist/users.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Organization team client (member admins only — the API gates these on the
|
|
3
3
|
* admin role and returns 403 otherwise).
|
|
4
4
|
*
|
|
5
|
-
* Licensing
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Licensing is a billing action (flex: nothing charges mid-cycle — the renewal
|
|
6
|
+
* bills each cycle's unique license holders), so the only seat-affecting
|
|
7
|
+
* operation exposed here is `invite`, which defaults new members to
|
|
8
|
+
* `unlicensed` and never charges. Assigning or changing a paid license is
|
|
9
|
+
* intentionally absent — clients route that to the web dashboard so native
|
|
10
|
+
* apps never initiate an out-of-band purchase.
|
|
10
11
|
*/
|
|
11
12
|
export class MobileUsersClient {
|
|
12
13
|
constructor(http) {
|
|
@@ -32,7 +33,7 @@ export class MobileUsersClient {
|
|
|
32
33
|
const response = await this.http.post('/users/invite', request);
|
|
33
34
|
return response.data;
|
|
34
35
|
}
|
|
35
|
-
/** Remove a member
|
|
36
|
+
/** Remove a member and revoke their DVAKs. Access ends immediately; the current cycle still bills them, and they stop counting next cycle. */
|
|
36
37
|
async remove(userId) {
|
|
37
38
|
const response = await this.http.delete(`/users/${userId}`);
|
|
38
39
|
return response.data;
|
package/dist/users.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBAAiB;IAG5B,YAAY,IAAsB;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,mFAAmF;IACnF,KAAK,CAAC,IAAI,CAAC,UAA8B,EAAE;QACzC,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAClF,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAClC,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CACrC,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,8EAA8E;IAC9E,KAAK,CAAC,MAAM,CAAC,OAA4B;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAuB,eAAe,EAAE,OAAO,CAAC,CAAC;QACtF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,8IAA8I;IAC9I,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAuB,UAAU,MAAM,EAAE,CAAC,CAAC;QAClF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,mEAAmE;IACnE,KAAK,CAAC,YAAY,CAAC,MAAc;QAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAuB,UAAU,MAAM,gBAAgB,CAAC,CAAC;QAC9F,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
|
package/package.json
CHANGED
package/src/errors.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ApiErrorBody, ApiMeta } from './types.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Only the byte pools hard-gate: flex licensing has no seat limit, and
|
|
4
|
+
// Identity soft-gates through its own path.
|
|
5
|
+
type QuotaResource = 'storage' | 'bandwidth';
|
|
4
6
|
|
|
5
7
|
function isQuotaResource(value: unknown): value is QuotaResource {
|
|
6
|
-
return value === 'storage' || value === 'bandwidth'
|
|
8
|
+
return value === 'storage' || value === 'bandwidth';
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export class SparkVaultMobileError extends Error {
|
|
@@ -72,13 +74,12 @@ export class PlanRequiredError extends SparkVaultMobileError {
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
/**
|
|
75
|
-
* Thrown on a 402 QUOTA_EXCEEDED gate: a pooled-capacity
|
|
76
|
-
*
|
|
77
|
-
* subscribe flow (native IAP)
|
|
78
|
-
* seats/identity to a seat or tier change.
|
|
77
|
+
* Thrown on a 402 QUOTA_EXCEEDED gate: a pooled-capacity limit was reached.
|
|
78
|
+
* `resource` identifies which pool to extend, routed through the in-app
|
|
79
|
+
* subscribe flow (native IAP) to the matching capacity add-on block.
|
|
79
80
|
*/
|
|
80
81
|
export class QuotaExceededError extends SparkVaultMobileError {
|
|
81
|
-
readonly resource: 'storage' | 'bandwidth'
|
|
82
|
+
readonly resource: 'storage' | 'bandwidth';
|
|
82
83
|
|
|
83
84
|
constructor(
|
|
84
85
|
resource: QuotaExceededError['resource'],
|
package/src/types.ts
CHANGED
|
@@ -97,8 +97,6 @@ export interface OrgMember {
|
|
|
97
97
|
role: OrgRole;
|
|
98
98
|
/** Effective license tier resolved with account context. */
|
|
99
99
|
seat_type: SeatType | null;
|
|
100
|
-
/** Period-end epoch (seconds) when a scheduled license cancellation lands, else null. */
|
|
101
|
-
seat_cancel_at: number | null;
|
|
102
100
|
status: OrgMemberStatus;
|
|
103
101
|
created_at: number;
|
|
104
102
|
last_login_at: number | null;
|
|
@@ -174,10 +172,16 @@ export interface SparkVaultSubscription {
|
|
|
174
172
|
renewal_date: number | null;
|
|
175
173
|
renewal_amount_usd: string;
|
|
176
174
|
seats: {
|
|
175
|
+
/** Cycle-unique billed counts (flex billing: what the renewal invoices). */
|
|
177
176
|
full: number;
|
|
178
177
|
viewer: number;
|
|
179
178
|
licensed: number;
|
|
180
179
|
used: number;
|
|
180
|
+
/** Members currently HOLDING each tier — the display counts. */
|
|
181
|
+
assigned_full: number;
|
|
182
|
+
assigned_viewer: number;
|
|
183
|
+
/** Roster members with no license (no access until licensed; free). */
|
|
184
|
+
unlicensed_members: number;
|
|
181
185
|
};
|
|
182
186
|
blocks: {
|
|
183
187
|
storage: number;
|
package/src/users.ts
CHANGED
|
@@ -12,11 +12,12 @@ import type {
|
|
|
12
12
|
* Organization team client (member admins only — the API gates these on the
|
|
13
13
|
* admin role and returns 403 otherwise).
|
|
14
14
|
*
|
|
15
|
-
* Licensing
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* Licensing is a billing action (flex: nothing charges mid-cycle — the renewal
|
|
16
|
+
* bills each cycle's unique license holders), so the only seat-affecting
|
|
17
|
+
* operation exposed here is `invite`, which defaults new members to
|
|
18
|
+
* `unlicensed` and never charges. Assigning or changing a paid license is
|
|
19
|
+
* intentionally absent — clients route that to the web dashboard so native
|
|
20
|
+
* apps never initiate an out-of-band purchase.
|
|
20
21
|
*/
|
|
21
22
|
export class MobileUsersClient {
|
|
22
23
|
private readonly http: MobileHttpClient;
|
|
@@ -45,7 +46,7 @@ export class MobileUsersClient {
|
|
|
45
46
|
return response.data;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
/** Remove a member
|
|
49
|
+
/** Remove a member and revoke their DVAKs. Access ends immediately; the current cycle still bills them, and they stop counting next cycle. */
|
|
49
50
|
async remove(userId: string): Promise<RemoveMemberResponse> {
|
|
50
51
|
const response = await this.http.delete<RemoveMemberResponse>(`/users/${userId}`);
|
|
51
52
|
return response.data;
|