@happyvertical/smrt-reactions 0.0.0-stage → 0.57.23
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/AGENTS.md +5 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +38 -2
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/chunks/src-Cfi_AjeE.js +263 -0
- package/dist/chunks/src-Cfi_AjeE.js.map +1 -0
- package/dist/collections/index.d.ts +14 -0
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/manifest.json +1265 -0
- package/dist/models/Poll.d.ts +28 -0
- package/dist/models/Poll.d.ts.map +1 -0
- package/dist/models/PollVote.d.ts +20 -0
- package/dist/models/PollVote.d.ts.map +1 -0
- package/dist/models/Reaction.d.ts +15 -0
- package/dist/models/Reaction.d.ts.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +323 -0
- package/dist/server.js.map +1 -0
- package/dist/services.d.ts +59 -0
- package/dist/services.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +480 -0
- package/dist/svelte/PollCard.svelte +40 -0
- package/dist/svelte/PollCard.svelte.d.ts +13 -0
- package/dist/svelte/PollCard.svelte.d.ts.map +1 -0
- package/dist/svelte/ReactionBar.svelte +33 -0
- package/dist/svelte/ReactionBar.svelte.d.ts +13 -0
- package/dist/svelte/ReactionBar.svelte.d.ts.map +1 -0
- package/dist/svelte/index.d.ts +3 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +2 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/write-authority.d.ts +4 -0
- package/dist/write-authority.d.ts.map +1 -0
- package/package.json +67 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type {\n ParticipationAuthorizer,\n ParticipationTarget,\n} from '@happyvertical/smrt-comments/participation';\n\n/** Host authenticates both IDs and verifies that the profile belongs to this user. */\nexport interface ParticipationActor {\n tenantId: string;\n userId: string;\n profileId: string;\n}\nexport interface RecordAccess extends ParticipationActor, ParticipationTarget {\n action: 'read' | 'react' | 'vote' | 'manage';\n}\n/** Owned supported connection configuration; arbitrary executors are not accepted. */\nexport interface ParticipationDatabaseConfig {\n type: 'sqlite' | 'postgres';\n url: string;\n cache?: false;\n dbid?: string;\n authToken?: string;\n encryptionKey?: string;\n transactionQueueTimeout?: number;\n max?: number;\n connectionTimeoutMillis?: number;\n idleTimeoutMillis?: number;\n}\nexport interface ServiceOptions {\n database: ParticipationDatabaseConfig;\n actor: ParticipationActor;\n authorizeRecord: (access: RecordAccess) => Promise<boolean>;\n /** Required: hosts compose their subscriptions and eligibility/record-date hooks here. */\n participation: ParticipationAuthorizer;\n now?: () => Date;\n}\nexport type ReactionKind =\n | 'like'\n | 'love'\n | 'celebrate'\n | 'insightful'\n | 'support';\nexport const REACTION_KINDS: readonly ReactionKind[] = [\n 'like',\n 'love',\n 'celebrate',\n 'insightful',\n 'support',\n];\nexport interface PollOption {\n id: string;\n label: string;\n}\nexport type PollVisibility = 'always' | 'after_vote' | 'after_close';\nexport interface CreatePollInput {\n recordType: string;\n recordId: string;\n question: string;\n options: readonly PollOption[];\n opensAt?: Date | null;\n closesAt?: Date | null;\n visibility?: PollVisibility;\n anonymousTally?: boolean;\n}\nexport interface PollProjection {\n id: string;\n question: string;\n options: PollOption[];\n closed: boolean;\n selectedOptionId: string | null;\n results: Record<string, number> | null;\n totalVotes: number | null;\n}\nexport interface ReactionTally {\n kind: ReactionKind;\n count: number;\n selected: boolean;\n}\n"],"mappings":";AAyCO,IAAM,iBAA0C;CACrD;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Package-private authority; never re-export from a public entry point. */
|
|
2
|
+
export declare function withParticipationWrite<T>(executor: object, work: () => Promise<T>): Promise<T>;
|
|
3
|
+
export declare function assertParticipationWrite(executor: object): void;
|
|
4
|
+
//# sourceMappingURL=write-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-authority.d.ts","sourceRoot":"","sources":["../src/write-authority.ts"],"names":[],"mappings":"AAIA,4EAA4E;AAC5E,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,CAAC,CASZ;AACD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAM/D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-reactions",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.57.23",
|
|
4
|
+
"description": "Tenant-scoped reactions and lightweight polls with shared participation enforcement",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"CLAUDE.md",
|
|
11
|
+
"AGENTS.md"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./svelte": {
|
|
19
|
+
"types": "./dist/svelte/index.d.ts",
|
|
20
|
+
"svelte": "./dist/svelte/index.js",
|
|
21
|
+
"import": "./dist/svelte/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./manifest": "./dist/manifest.json",
|
|
24
|
+
"./manifest.json": "./dist/manifest.json",
|
|
25
|
+
"./server": {
|
|
26
|
+
"types": "./dist/server.d.ts",
|
|
27
|
+
"import": "./dist/server.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@happyvertical/smrt-core": "0.57.23",
|
|
32
|
+
"@happyvertical/smrt-tenancy": "0.57.23",
|
|
33
|
+
"@happyvertical/smrt-comments": "0.57.23",
|
|
34
|
+
"@happyvertical/sql": "^0.106.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"svelte": "^5.57.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"svelte": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"author": "HappyVertical",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/happyvertical/smrt.git",
|
|
49
|
+
"directory": "packages/reactions"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@happyvertical/smrt-vitest": "0.57.23",
|
|
53
|
+
"@sveltejs/package": "^2.5.8",
|
|
54
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
55
|
+
"@testing-library/svelte": "^5.4.2",
|
|
56
|
+
"@types/node": "24.13.6",
|
|
57
|
+
"svelte": "^5.57.1",
|
|
58
|
+
"svelte-check": "^4.7.6",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"vite": "8.1.6",
|
|
61
|
+
"vitest": "4.1.10"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "vite build --mode library && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json && node ../../scripts/prune-svelte-package-artifacts.js dist",
|
|
65
|
+
"test": "vitest run",
|
|
66
|
+
"check": "svelte-check --tsconfig ./tsconfig.svelte.json",
|
|
67
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.test.json && node ../../scripts/svelte-check-a11y.mjs --tsconfig ./tsconfig.svelte-test.json",
|
|
68
|
+
"test:postgres": "node ../../scripts/run-with-ci-postgres.mjs -- pnpm exec vitest run src/reactions.test.ts"
|
|
69
|
+
}
|
|
6
70
|
}
|