@freeappstore/sdk 0.16.41 → 0.16.43
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/README.md +2 -2
- package/dist/counters.d.ts +6 -2
- package/dist/counters.d.ts.map +1 -1
- package/dist/counters.js +6 -2
- package/dist/counters.js.map +1 -1
- package/dist/email.d.ts +3 -1
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +3 -1
- package/dist/email.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,7 +93,7 @@ Limits (server-enforced): max 1MB per user, max 100 keys per user, max 64KB per
|
|
|
93
93
|
|
|
94
94
|
### Shared counters
|
|
95
95
|
|
|
96
|
-
App-wide atomic counters — not user-scoped. Anyone can read; authenticated users can increment. Use for vote tallies, view counts, leaderboards.
|
|
96
|
+
App-wide atomic counters — not user-scoped. Anyone can read; authenticated users can increment. Decrementing is reserved for the app owner and users with a privileged app role (anything other than `member` / `viewer`). Use for vote tallies, view counts, leaderboards.
|
|
97
97
|
|
|
98
98
|
```ts
|
|
99
99
|
// Read (no auth required)
|
|
@@ -103,7 +103,7 @@ const views = await fas.counters.get('views'); // 100
|
|
|
103
103
|
// Increment (auth required)
|
|
104
104
|
const newVal = await fas.counters.increment('likes'); // +1, returns new value
|
|
105
105
|
const newVal2 = await fas.counters.increment('score', 10); // +10
|
|
106
|
-
await fas.counters.increment('lives', -1); // decrement
|
|
106
|
+
await fas.counters.increment('lives', -1); // decrement — owner / privileged role only
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Limits: max 1000 counters per app, increment range -1000 to +1000 per call.
|
package/dist/counters.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Auth } from './auth.js';
|
|
2
2
|
/**
|
|
3
3
|
* Shared atomic counters — not user-scoped.
|
|
4
|
-
* Any authenticated user can increment; anyone can read.
|
|
4
|
+
* Any authenticated user can increment; anyone can read. Decrementing is
|
|
5
|
+
* reserved for the app owner and users with a privileged app role.
|
|
5
6
|
* Use for: vote tallies, view counts, leaderboards.
|
|
6
7
|
*/
|
|
7
8
|
export declare class Counters {
|
|
@@ -15,7 +16,10 @@ export declare class Counters {
|
|
|
15
16
|
}): Promise<Record<string, number>>;
|
|
16
17
|
/** Get a single counter value. Public — no auth required. */
|
|
17
18
|
get(key: string): Promise<number>;
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Increment (or decrement) a counter. Requires auth. Returns new value.
|
|
21
|
+
* A negative amount needs the app owner or a privileged app role (403 otherwise).
|
|
22
|
+
*/
|
|
19
23
|
increment(key: string, amount?: number): Promise<number>;
|
|
20
24
|
}
|
|
21
25
|
//# sourceMappingURL=counters.d.ts.map
|
package/dist/counters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counters.d.ts","sourceRoot":"","sources":["../src/counters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"counters.d.ts","sourceRoot":"","sources":["../src/counters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;GAKG;AACH,qBAAa,QAAQ;IAEjB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFJ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI;IAG7B,yEAAyE;IACnE,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAQvE,6DAA6D;IACvD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWvC;;;OAGG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,MAAM,CAAC;CAuB1D"}
|
package/dist/counters.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared atomic counters — not user-scoped.
|
|
3
|
-
* Any authenticated user can increment; anyone can read.
|
|
3
|
+
* Any authenticated user can increment; anyone can read. Decrementing is
|
|
4
|
+
* reserved for the app owner and users with a privileged app role.
|
|
4
5
|
* Use for: vote tallies, view counts, leaderboards.
|
|
5
6
|
*/
|
|
6
7
|
export class Counters {
|
|
@@ -31,7 +32,10 @@ export class Counters {
|
|
|
31
32
|
const data = (await response.json());
|
|
32
33
|
return data.value;
|
|
33
34
|
}
|
|
34
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Increment (or decrement) a counter. Requires auth. Returns new value.
|
|
37
|
+
* A negative amount needs the app owner or a privileged app role (403 otherwise).
|
|
38
|
+
*/
|
|
35
39
|
async increment(key, amount = 1) {
|
|
36
40
|
const token = this.auth.token;
|
|
37
41
|
if (!token)
|
package/dist/counters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counters.js","sourceRoot":"","sources":["../src/counters.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"counters.js","sourceRoot":"","sources":["../src/counters.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,QAAQ;IAEA;IACA;IACA;IAHnB,YACmB,KAAa,EACb,OAAe,EACf,IAAU;QAFV,UAAK,GAAL,KAAK,CAAQ;QACb,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAM;IAC1B,CAAC;IAEJ,yEAAyE;IACzE,KAAK,CAAC,IAAI,CAAC,IAA0B;QACnC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,YAAY,kBA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CAAC,KAAK,CAAC,aAAa,kBAAkB,CAAC,GAAG,CAAC,EAAE,EAChF,IAAI,CAAC,OAAO,CACb,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;SAC5C,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACnF,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAsB,CAAC;QAC1D,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
package/dist/email.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import type { Auth } from './auth.js';
|
|
|
5
5
|
* Apps don't need their own email provider. The platform sends on behalf
|
|
6
6
|
* of the app using the platform's managed sending domain.
|
|
7
7
|
*
|
|
8
|
-
* Rate limit: 100 emails/day per app (free tier).
|
|
8
|
+
* Rate limit: 100 emails/day per app (free tier), 50/day per sender.
|
|
9
|
+
* The app owner may send to any recipient; any other signed-in user must
|
|
10
|
+
* hold a role in the app and may only send to their own verified address.
|
|
9
11
|
*/
|
|
10
12
|
export declare class Email {
|
|
11
13
|
private readonly appId;
|
package/dist/email.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;GASG;AACH,qBAAa,KAAK;IAEd,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFJ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI;IAG7B;;;;;;OAMG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB/F"}
|
package/dist/email.js
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Apps don't need their own email provider. The platform sends on behalf
|
|
5
5
|
* of the app using the platform's managed sending domain.
|
|
6
6
|
*
|
|
7
|
-
* Rate limit: 100 emails/day per app (free tier).
|
|
7
|
+
* Rate limit: 100 emails/day per app (free tier), 50/day per sender.
|
|
8
|
+
* The app owner may send to any recipient; any other signed-in user must
|
|
9
|
+
* hold a role in the app and may only send to their own verified address.
|
|
8
10
|
*/
|
|
9
11
|
export class Email {
|
|
10
12
|
appId;
|
package/dist/email.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.js","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,OAAO,KAA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@@ export interface BuildMeta {
|
|
|
35
35
|
viewport: string;
|
|
36
36
|
theme?: string | undefined;
|
|
37
37
|
}
|
|
38
|
-
export declare const SDK_VERSION = "0.16.
|
|
38
|
+
export declare const SDK_VERSION = "0.16.43";
|
|
39
39
|
export declare class Logger {
|
|
40
40
|
private readonly appId;
|
|
41
41
|
private readonly apiBase;
|
package/dist/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Must track package.json version — bumped on release. Guarded by version.test.ts
|
|
2
2
|
// so a forgotten bump fails CI instead of silently misattributing telemetry.
|
|
3
|
-
export const SDK_VERSION = '0.16.
|
|
3
|
+
export const SDK_VERSION = '0.16.43';
|
|
4
4
|
const MEMORY_LIMIT = 200;
|
|
5
5
|
const STORAGE_LIMIT = 500;
|
|
6
6
|
const STORAGE_KEY_PREFIX = 'fas_logs:';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freeappstore/sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.43",
|
|
4
4
|
"description": "Browser SDK for FreeAppStore — auth, KV, collections, counters, rooms, proxy, encrypted user keys, roles, friends, email, push reminders, device-local persistence, validated backup and file export, React hooks, and UI components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|