funifier-mcp 0.3.16 → 0.3.18
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/.cursor/rules/funifier.mdc +1 -0
- package/.github/copilot-instructions.md +1 -0
- package/AGENTS.md +1 -0
- package/datasource-funifier-docs/.coverage.json +12 -5
- package/datasource-funifier-docs/.search-index.json +59345 -0
- package/datasource-funifier-docs/.skills-map.json +145 -0
- package/datasource-funifier-docs/.validation.json +38 -2
- package/datasource-funifier-docs/knowledge/guides/permission-audit.md +229 -0
- package/datasource-funifier-docs/knowledge/index.md +1 -0
- package/dist/mcp/bundle.js +108 -108
- package/dist/mcp/tools/_audit.d.ts +103 -0
- package/dist/mcp/tools/_audit.d.ts.map +1 -0
- package/dist/mcp/tools/_audit.js +241 -0
- package/dist/mcp/tools/_audit.js.map +1 -0
- package/dist/mcp/tools/_audit.test.d.ts +2 -0
- package/dist/mcp/tools/_audit.test.d.ts.map +1 -0
- package/dist/mcp/tools/_audit.test.js +412 -0
- package/dist/mcp/tools/_audit.test.js.map +1 -0
- package/dist/mcp/tools/_backup.d.ts +37 -3
- package/dist/mcp/tools/_backup.d.ts.map +1 -1
- package/dist/mcp/tools/_backup.js +137 -8
- package/dist/mcp/tools/_backup.js.map +1 -1
- package/dist/mcp/tools/_backup.test.js +195 -0
- package/dist/mcp/tools/_backup.test.js.map +1 -1
- package/dist/mcp/tools/_scope-engine.d.ts +40 -0
- package/dist/mcp/tools/_scope-engine.d.ts.map +1 -0
- package/dist/mcp/tools/_scope-engine.js +197 -0
- package/dist/mcp/tools/_scope-engine.js.map +1 -0
- package/dist/mcp/tools/_scope-engine.test.d.ts +2 -0
- package/dist/mcp/tools/_scope-engine.test.d.ts.map +1 -0
- package/dist/mcp/tools/_scope-engine.test.js +241 -0
- package/dist/mcp/tools/_scope-engine.test.js.map +1 -0
- package/dist/mcp/tools/permissions.d.ts.map +1 -1
- package/dist/mcp/tools/permissions.js +68 -11
- package/dist/mcp/tools/permissions.js.map +1 -1
- package/dist/mcp/tools/permissions.test.js +268 -4
- package/dist/mcp/tools/permissions.test.js.map +1 -1
- package/package.json +1 -1
- package/skills/funifier/SKILL.md +1 -0
- package/skills/funifier/references/audit-permissions.md +89 -0
- package/skills/funifier/references/configure-security.md +0 -6
- package/skills/funifier/references/create-action.md +0 -7
- package/skills/funifier/references/create-aggregate.md +3 -7
- package/skills/funifier/references/create-audit.md +0 -8
- package/skills/funifier/references/create-challenge.md +0 -7
- package/skills/funifier/references/create-competition.md +0 -7
- package/skills/funifier/references/create-crossword.md +0 -6
- package/skills/funifier/references/create-custom-object.md +0 -6
- package/skills/funifier/references/create-custom-page.md +0 -6
- package/skills/funifier/references/create-folder.md +0 -7
- package/skills/funifier/references/create-lastmile.md +0 -6
- package/skills/funifier/references/create-leaderboard.md +0 -6
- package/skills/funifier/references/create-level.md +0 -7
- package/skills/funifier/references/create-lottery.md +0 -7
- package/skills/funifier/references/create-mystery.md +0 -6
- package/skills/funifier/references/create-notification.md +0 -6
- package/skills/funifier/references/create-point.md +0 -7
- package/skills/funifier/references/create-quiz.md +0 -7
- package/skills/funifier/references/create-scheduler.md +0 -6
- package/skills/funifier/references/create-story.md +0 -6
- package/skills/funifier/references/create-swap.md +0 -6
- package/skills/funifier/references/create-trigger.md +0 -8
- package/skills/funifier/references/create-virtual-good.md +0 -6
- package/skills/funifier/references/create-webhook.md +0 -6
- package/skills/funifier/references/create-websocket.md +0 -6
- package/skills/funifier/references/create-widget.md +0 -6
- package/skills/funifier/references/date-handling.md +0 -6
- package/skills/funifier/references/debug.md +0 -6
- package/skills/funifier/references/help.md +0 -6
- package/skills/funifier/references/implement-frontend.md +0 -7
- package/skills/funifier/references/import-csv.md +0 -6
- package/skills/funifier/references/manage-indexes.md +0 -6
- package/skills/funifier/references/manage-player.md +0 -7
- package/skills/funifier/references/manage-team.md +0 -6
- package/skills/funifier/references/upload-file.md +0 -6
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# funifier-audit-permissions
|
|
2
|
+
|
|
3
|
+
Cross-check a project's Funifier API calls against the live security document — scan code for usage, build an evidence-backed manifest, run the deterministic audit engine, and report missing scopes, excess tokens, and static danger findings; use when debugging 401s, auditing minimum privilege, or verifying permissions before deploying; audit is read-only and never changes any configuration
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Before starting — find relevant docs
|
|
8
|
+
|
|
9
|
+
Use the `funifier_search_docs` MCP tool to load only what you need:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
funifier_search_docs "audit permissions security scope 401 missing-scope excess-token danger manifest bearer basic app-secret role least-privilege"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then read the most relevant results with `funifier_read_doc path=<path>`.
|
|
16
|
+
|
|
17
|
+
## Primary docs for this skill
|
|
18
|
+
|
|
19
|
+
If search returns insufficient results, read these directly:
|
|
20
|
+
|
|
21
|
+
- `funifier_read_doc path=guides/permission-audit`
|
|
22
|
+
- `funifier_read_doc path=modules/security`
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
## Regras críticas
|
|
27
|
+
|
|
28
|
+
- **O audit é read-only.** Nenhuma configuração é alterada. O MCP apenas lê o documento de segurança e avalia o manifest.
|
|
29
|
+
- **Bearer tokens embtem o scope no login.** Corrigir o role não invalida tokens existentes — o jogador precisa fazer login novamente.
|
|
30
|
+
- **Excess findings podem ser necessários** a consumidores fora deste manifest. Verifique antes de remover qualquer token.
|
|
31
|
+
- **Low-confidence entries** (URLs dinâmicas ou wrappers): use `"confidence": "low"` e um path com o prefixo mais específico possível. Nunca omita chamadas suspeitas.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Steps
|
|
36
|
+
|
|
37
|
+
### 1. Descobrir chamadas Funifier no projeto
|
|
38
|
+
|
|
39
|
+
Procure no código todas as chamadas à API Funifier (endpoints, métodos HTTP e mecanismo de auth):
|
|
40
|
+
|
|
41
|
+
- **Com GitNexus indexado:** `gitnexus_query("funifier API calls")` para localizar call sites
|
|
42
|
+
- **Fallback (busca em código):** grep por `/v3/`, `funifier`, `apiKey`, `app_secret`, `Authorization`
|
|
43
|
+
- Para cada chamada, registre: `method`, `path`, `auth context` (ver tabela em `guides/permission-audit.md` §2), e `file:line` como `evidence`
|
|
44
|
+
- Classifique o auth:
|
|
45
|
+
- Sem secret / token público → `"public"`
|
|
46
|
+
- Player Bearer → `"player"`
|
|
47
|
+
- App secret em config/env → `"app:<name>"` (use o `name` da entrada em `apps[]`)
|
|
48
|
+
|
|
49
|
+
### 2. Montar o manifest
|
|
50
|
+
|
|
51
|
+
Construa o JSON seguindo o schema de `guides/permission-audit.md` §3. Exemplo mínimo:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"version": 1,
|
|
56
|
+
"entries": [
|
|
57
|
+
{ "method": "GET", "path": "/v3/player/me", "auth": "player", "evidence": "src/api.ts:12" },
|
|
58
|
+
{ "method": "POST", "path": "/v3/action/log", "auth": "player", "evidence": "src/events.ts:58" },
|
|
59
|
+
{ "method": "POST", "path": "/v3/player", "auth": "app:backend", "evidence": "workers/sync.ts:34" },
|
|
60
|
+
{ "method": "GET", "path": "/v3/database/orders", "auth": "app:backend", "evidence": "workers/sync.ts:80" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Para chamadas com URL dinâmica: use o prefixo mais específico e defina `"confidence": "low"`.
|
|
66
|
+
|
|
67
|
+
### 3. Executar o audit
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
funifier_permissions action=audit data=<manifest JSON>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
O resultado inclui:
|
|
74
|
+
- `missing`: chamadas que seriam negadas — 401 em produção. Campo `requiredTokens` indica o token mínimo.
|
|
75
|
+
- `excess`: tokens concedidos que nenhuma entrada requer. Campo `narrowingSuggestion` para broad tokens.
|
|
76
|
+
- `danger`: riscos estáticos no documento de segurança (independentes do manifest).
|
|
77
|
+
- `manual-review`: tokens não verificáveis por análise de paths (`cross_domain`, `write_upload`, etc.).
|
|
78
|
+
- `missing-principal`: auth context referenciado no manifest não existe no documento de segurança.
|
|
79
|
+
|
|
80
|
+
### 4. Apresentar o relatório e encaminhar remediação
|
|
81
|
+
|
|
82
|
+
Apresente os findings agrupados por severidade (`missing` primeiro). Para cada `missing`:
|
|
83
|
+
- Indique o token exato necessário (`requiredTokens`), a chamada e a evidência.
|
|
84
|
+
- **Não aplique a correção automaticamente.** Apresente a ação sugerida ao utilizador e aguarde aprovação.
|
|
85
|
+
- Quando aprovado: `funifier_permissions action=save_security_role` ou `save_api_app` (cada mutação cria backup automático).
|
|
86
|
+
|
|
87
|
+
Para `excess`: adverta que o token pode ser necessário a consumidores fora deste manifest antes de sugerir remoção.
|
|
88
|
+
|
|
89
|
+
Para `danger`: explique o risco e sugira remoção ou restrição do scope afetado como ação separada.
|
|
@@ -112,9 +112,3 @@ funifier_permissions action=restore_backup backup_path=<path retornado por list_
|
|
|
112
112
|
O restore valida que o `serverUrl` do snapshot coincide com a conexão atual — não aplique backup de outro tenant. O próprio restore também gera um snapshot prévio, permitindo desfazer o rollback.
|
|
113
113
|
|
|
114
114
|
Variáveis opcionais: `FUNIFIER_PROJECT_ROOT` (diretório do projeto; definida nos configs gerados pelo `init`) e `FUNIFIER_BACKUP_ROOT` (substitui `.funifier/backups/` por outro diretório). Snapshots não expiram automaticamente — remova arquivos antigos manualmente quando necessário.
|
|
115
|
-
|
|
116
|
-
## Verified References
|
|
117
|
-
|
|
118
|
-
| Claim | Status | Evidence |
|
|
119
|
-
|-------|--------|----------|
|
|
120
|
-
|
|
@@ -91,10 +91,3 @@ funifier_list type=action search=<_id>
|
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
Do NOT use `funifier_logs` — that is only for triggers and schedulers.
|
|
94
|
-
|
|
95
|
-
## Verified References
|
|
96
|
-
|
|
97
|
-
| Claim | Status | Evidence |
|
|
98
|
-
|-------|--------|----------|
|
|
99
|
-
| ActionLog is the entity class recording each player action event with fields actionId, userId, attributes, time, and id | ✓ verified | Class:src/main/java/com/funifier/engine/action/ActionLog.java:ActionLog |
|
|
100
|
-
| ActionManager handles action registration and dispatching in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/action/ActionManager.java:ActionManager |
|
|
@@ -131,12 +131,14 @@ POST /v3/database/achievement/aggregate
|
|
|
131
131
|
|
|
132
132
|
### 4. Registrar como Prepared Aggregate
|
|
133
133
|
|
|
134
|
+
**Formatação obrigatória:** o campo `aggregate` é o pipeline serializado como **string identada**, com `\n` ao fim de cada linha (equivalente a `JSON.stringify(pipeline, null, 4)`) — **nunca** minificado em uma linha única. O `script` Groovy também preserva indentação e `\n`. Os escapes (`\"`, `\\`) seguem a seção "Formato do payload" acima.
|
|
135
|
+
|
|
134
136
|
```json
|
|
135
137
|
{
|
|
136
138
|
"_id": "top_players_month",
|
|
137
139
|
"title": "Top Players Month",
|
|
138
140
|
"collection": "achievement",
|
|
139
|
-
"aggregate": "[{\"
|
|
141
|
+
"aggregate": "[\n {\n \"$match\": {\n \"type\": 0,\n \"item\": \"xp\"\n }\n },\n {\n \"$group\": {\n \"_id\": \"$player\",\n \"total\": {\n \"$sum\": \"$total\"\n }\n }\n },\n {\n \"$sort\": {\n \"total\": -1\n }\n },\n {\n \"$limit\": 10\n }\n]",
|
|
140
142
|
"script": ""
|
|
141
143
|
}
|
|
142
144
|
```
|
|
@@ -176,9 +178,3 @@ api.post('/v3/find/<id>', { player: 'abc' })
|
|
|
176
178
|
| Script vazio | Se o pipeline só usa `"$param:nome"`, o `script` pode ser `""` — não precisa de `prepare()` |
|
|
177
179
|
|
|
178
180
|
Se o resultado vier vazio ou inesperado: `GET /v3/find/<id>/params` lista os params que o pipeline espera, e `POST /v3/prepared/aggregate/<id>/analyze` (mesmo corpo da execução) retorna outputs/exceções do script e o resultado de cada etapa do pipeline (`aggregate_step_N`) — veja `references/debug.md`.
|
|
179
|
-
|
|
180
|
-
## Verified References
|
|
181
|
-
|
|
182
|
-
| Claim | Status | Evidence |
|
|
183
|
-
|-------|--------|----------|
|
|
184
|
-
| DatabaseManager provides MongoDB connection and collection access for aggregate queries in Groovy scripts | ✓ verified | Class:src/main/java/com/funifier/engine/database/DatabaseManager.java:DatabaseManager |
|
|
@@ -113,11 +113,3 @@ Filtros combináveis em `$match`: `user`/`login` (ator), `type` (`studio`/`playe
|
|
|
113
113
|
### 6. Exclusão (cuidado)
|
|
114
114
|
|
|
115
115
|
`funifier_delete type=audit id=<id>` remove a config **e todos os seus logs em cascata**. Confirme com o usuário antes.
|
|
116
|
-
|
|
117
|
-
## Verified References
|
|
118
|
-
|
|
119
|
-
| Claim | Status | Evidence |
|
|
120
|
-
|-------|--------|----------|
|
|
121
|
-
| Audit config fields are _id, title, active, entity, event, clean, type with event constants create/update/delete and type constants studio/player/all | ✓ verified | Class:src/main/java/com/funifier/engine/audit/Audit.java:Audit |
|
|
122
|
-
| AuditManager.log only writes an AuditLog when an active Audit matches entity+event and the config type matches the operation origin | ✓ verified | Class:src/main/java/com/funifier/engine/audit/AuditManager.java:AuditManager |
|
|
123
|
-
| clearExpiredLogs purges audit_log entries older than each config's clean retention and is invoked from AsyncProcessor | ✓ verified | Method:src/main/java/com/funifier/engine/audit/AuditManager.java:AuditManager.clearExpiredLogs#0 |
|
|
@@ -114,10 +114,3 @@ funifier_get type=challenge id=<_id>
|
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Não use `funifier_logs` — isso é só para triggers e schedulers.
|
|
117
|
-
|
|
118
|
-
## Verified References
|
|
119
|
-
|
|
120
|
-
| Claim | Status | Evidence |
|
|
121
|
-
|-------|--------|----------|
|
|
122
|
-
| Challenge is the core entity class storing action rules and reward configuration in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/challenge/Challenge.java:Challenge |
|
|
123
|
-
| ChallengeManager manages challenge lifecycle including progress checking and achievement dispatch | ✓ verified | Class:src/main/java/com/funifier/engine/challenge/ChallengeManager.java:ChallengeManager |
|
|
@@ -96,10 +96,3 @@ POST /v3/competition/join { "competition": "<_id>", "player": "<player_id>" }
|
|
|
96
96
|
POST /v3/competition/leader/aggregate?id=<_id>
|
|
97
97
|
GET /v3/competition/<_id>/execute (manual execution only)
|
|
98
98
|
```
|
|
99
|
-
|
|
100
|
-
## Verified References
|
|
101
|
-
|
|
102
|
-
| Claim | Status | Evidence |
|
|
103
|
-
|-------|--------|----------|
|
|
104
|
-
| Competition is the entity class for timed ranking contests with enrollment and position-based rewards in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/competition/Competition.java:Competition |
|
|
105
|
-
| CompetitionManager manages competition execution, ranking computation, and reward distribution in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/competition/CompetitionManager.java:CompetitionManager |
|
|
@@ -572,9 +572,3 @@ funifier_list type=crossword search=<titulo>
|
|
|
572
572
|
```
|
|
573
573
|
|
|
574
574
|
Teste o jogo no Studio e verifique que as dicas e palavras estão corretas.
|
|
575
|
-
|
|
576
|
-
## Verified References
|
|
577
|
-
|
|
578
|
-
| Claim | Status | Evidence |
|
|
579
|
-
|-------|--------|----------|
|
|
580
|
-
| Crossword is the entity class for word puzzle games with title, words, and clue positions in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/crossword/Crossword.java:Crossword |
|
|
@@ -89,9 +89,3 @@ DELETE /v3/database/car__c?q=_id:'car001'
|
|
|
89
89
|
### 7. Usar em triggers
|
|
90
90
|
|
|
91
91
|
Para executar trigger em eventos da coleção, use `entity: "car__c"` no payload do trigger.
|
|
92
|
-
|
|
93
|
-
## Verified References
|
|
94
|
-
|
|
95
|
-
| Claim | Status | Evidence |
|
|
96
|
-
|-------|--------|----------|
|
|
97
|
-
| DatabaseManager provides MongoDB connection for custom __c collection CRUD operations in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/database/DatabaseManager.java:DatabaseManager |
|
|
@@ -133,9 +133,3 @@ PUT /v3/database/studio_page { "_id": "...", "display": true, "title": "...",
|
|
|
133
133
|
|
|
134
134
|
Acesse `/studio/custom/<slug>` no browser para testar.
|
|
135
135
|
Para CRUD completo: crie página de lista (`display: true`) + formulário (`display: false`, slug com `/:id`).
|
|
136
|
-
|
|
137
|
-
## Verified References
|
|
138
|
-
|
|
139
|
-
| Claim | Status | Evidence |
|
|
140
|
-
|-------|--------|----------|
|
|
141
|
-
| DatabaseManager provides MongoDB connection access for aggregate-backed Studio custom pages | ✓ verified | Class:src/main/java/com/funifier/engine/database/DatabaseManager.java:DatabaseManager |
|
|
@@ -102,10 +102,3 @@ funifier_save type=folder-log payload=<json>
|
|
|
102
102
|
funifier_folder operation=progress { "folder": "<root_id>", "player": "player123" }
|
|
103
103
|
funifier_folder operation=inside { "folder": "<root_id>" }
|
|
104
104
|
```
|
|
105
|
-
|
|
106
|
-
## Verified References
|
|
107
|
-
|
|
108
|
-
| Claim | Status | Evidence |
|
|
109
|
-
|-------|--------|----------|
|
|
110
|
-
| Folder is the entity class for learning trail nodes with unlock_policy, parent, and position fields in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/folder/Folder.java:Folder |
|
|
111
|
-
| FolderManager handles folder tree traversal, progress computation, and cascade deletion in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/folder/FolderManager.java:FolderManager |
|
|
@@ -641,9 +641,3 @@ funifier_list type=lastmile
|
|
|
641
641
|
```
|
|
642
642
|
|
|
643
643
|
Simule progresso do jogador até 80% do desafio e verifique se a mensagem é disparada.
|
|
644
|
-
|
|
645
|
-
## Verified References
|
|
646
|
-
|
|
647
|
-
| Claim | Status | Evidence |
|
|
648
|
-
|-------|--------|----------|
|
|
649
|
-
| LastMile is the entity class for threshold-triggered motivational messages linked to challenge progress in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/lastmile/LastMile.java:LastMile |
|
|
@@ -124,9 +124,3 @@ funifier_list type=leaderboard search=<title>
|
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
If scores look wrong, reset cache: `GET /v3/leaderboard/reset`
|
|
127
|
-
|
|
128
|
-
## Verified References
|
|
129
|
-
|
|
130
|
-
| Claim | Status | Evidence |
|
|
131
|
-
|-------|--------|----------|
|
|
132
|
-
| LeaderBoardManager manages leaderboard ranking computation and cache reset in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/leader/LeaderBoardManager.java:LeaderBoardManager |
|
|
@@ -92,10 +92,3 @@ funifier_list type=level
|
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Confirme que os níveis estão em ordem crescente de `minPoints`.
|
|
95
|
-
|
|
96
|
-
## Verified References
|
|
97
|
-
|
|
98
|
-
| Claim | Status | Evidence |
|
|
99
|
-
|-------|--------|----------|
|
|
100
|
-
| Level is the entity class defining level thresholds and point item reference in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/level/Level.java:Level |
|
|
101
|
-
| LevelManager tracks player level progression and threshold evaluation | ✓ verified | Class:src/main/java/com/funifier/engine/level/LevelManager.java:LevelManager |
|
|
@@ -911,10 +911,3 @@ GET /v3/lottery/participants?lottery=<_id>
|
|
|
911
911
|
```
|
|
912
912
|
|
|
913
913
|
To undo: `DELETE /v3/lottery/:id/execute`
|
|
914
|
-
|
|
915
|
-
## Verified References
|
|
916
|
-
|
|
917
|
-
| Claim | Status | Evidence |
|
|
918
|
-
|-------|--------|----------|
|
|
919
|
-
| Lottery is the entity class for ticket-based prize draws with drawDate, choiceMethod, and maxWinners in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/lottery/Lottery.java:Lottery |
|
|
920
|
-
| LotteryManager handles ticket generation, draw execution, and winner selection in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/lottery/LotteryManager.java:LotteryManager |
|
|
@@ -767,9 +767,3 @@ funifier_save type=mystery payload=<json>
|
|
|
767
767
|
GET /v3/mystery/evaluate/<_id>?player=<player_id>
|
|
768
768
|
GET /v3/mystery/execute/<_id>?player=<player_id>
|
|
769
769
|
```
|
|
770
|
-
|
|
771
|
-
## Verified References
|
|
772
|
-
|
|
773
|
-
| Claim | Status | Evidence |
|
|
774
|
-
|-------|--------|----------|
|
|
775
|
-
| MysteryBox is the entity class for probability-based instant games with options, win_chart, and requirements in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/mystery/MysteryBox.java:MysteryBox |
|
|
@@ -73,9 +73,3 @@ funifier_list type=notification
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Dispare o evento correspondente e verifique se a notificação é entregue.
|
|
76
|
-
|
|
77
|
-
## Verified References
|
|
78
|
-
|
|
79
|
-
| Claim | Status | Evidence |
|
|
80
|
-
|-------|--------|----------|
|
|
81
|
-
| Notification is the entity class for automated player feedback messages with event, scope, and content fields in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/notify/Notification.java:Notification |
|
|
@@ -93,10 +93,3 @@ funifier_list type=point search=<_id>
|
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
Do NOT use `funifier_logs` — that is only for triggers and schedulers.
|
|
96
|
-
|
|
97
|
-
## Verified References
|
|
98
|
-
|
|
99
|
-
| Claim | Status | Evidence |
|
|
100
|
-
|-------|--------|----------|
|
|
101
|
-
| PointCategory is the entity class with category, shortName, and techniques fields for defining point types | ✓ verified | Class:src/main/java/com/funifier/engine/point/PointCategory.java:PointCategory |
|
|
102
|
-
| PointManager manages point accumulation and balance queries in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/point/PointManager.java:PointManager |
|
|
@@ -96,10 +96,3 @@ POST /v3/quiz/start { "quiz": "<id>", "player": "<player_id>" }
|
|
|
96
96
|
POST /v3/question/log/bulk [{ "quiz": "<id>", "quiz_log": "<log_id>", "question": "<q_id>", "answer": ["1"], "player": "<player_id>" }]
|
|
97
97
|
POST /v3/quiz/finish { "quiz_log": "<log_id>" }
|
|
98
98
|
```
|
|
99
|
-
|
|
100
|
-
## Verified References
|
|
101
|
-
|
|
102
|
-
| Claim | Status | Evidence |
|
|
103
|
-
|-------|--------|----------|
|
|
104
|
-
| Quiz is the entity class storing questions and answer configuration in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/quiz/Quiz.java:Quiz |
|
|
105
|
-
| QuizManager handles quiz scoring, lifecycle, and player response processing | ✓ verified | Class:src/main/java/com/funifier/engine/quiz/QuizManager.java:QuizManager |
|
|
@@ -139,9 +139,3 @@ funifier_logs type=scheduler id=<_id>
|
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
Confirme que não há erros de compilação ou execução no stack trace.
|
|
142
|
-
|
|
143
|
-
## Verified References
|
|
144
|
-
|
|
145
|
-
| Claim | Status | Evidence |
|
|
146
|
-
|-------|--------|----------|
|
|
147
|
-
| SchedulerManager is the class that manages cron-based script execution in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/integration/scheduler/SchedulerManager.java:SchedulerManager |
|
|
@@ -93,9 +93,3 @@ POST /v3/swap/receive { "swap": "<swap_id>" }
|
|
|
93
93
|
POST /v3/swap/counter/offer { "swap": "<swap_id>", "buyer": "jerry", "offer": [{ "total": 1, "type": 0, "item": "coin" }] }
|
|
94
94
|
POST /v3/swap/counter/offer/accept { "offer": "<offer_id>" }
|
|
95
95
|
```
|
|
96
|
-
|
|
97
|
-
## Verified References
|
|
98
|
-
|
|
99
|
-
| Claim | Status | Evidence |
|
|
100
|
-
|-------|--------|----------|
|
|
101
|
-
| Swap is the entity class for player-to-player trade offers with seller, rewards, and requires fields in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/swap/Swap.java:Swap |
|
|
@@ -183,11 +183,3 @@ funifier_logs type=trigger id=<_id>
|
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
Confirme que não há erros de compilação ou execução. Se houver, leia o stack trace e corrija o script.
|
|
186
|
-
|
|
187
|
-
## Verified References
|
|
188
|
-
|
|
189
|
-
| Claim | Status | Evidence |
|
|
190
|
-
|-------|--------|----------|
|
|
191
|
-
| Achievement constants TYPE_POINT=0, TYPE_CHALLENGE=1, TYPE_VIRTUAL_GOOD=2, TYPE_LEVEL=3 are defined in the Achievement class | ✓ verified | Class:src/main/java/com/funifier/engine/achievement/Achievement.java:Achievement |
|
|
192
|
-
| ActionLog is the entity class for action triggers with fields actionId, userId, attributes (Map), time, and id | ✓ verified | Class:src/main/java/com/funifier/engine/action/ActionLog.java:ActionLog |
|
|
193
|
-
| TriggerManager is the class that manages trigger script execution and lifecycle in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/integration/trigger/TriggerManager.java:TriggerManager |
|
|
@@ -94,9 +94,3 @@ Para testar uma compra:
|
|
|
94
94
|
```
|
|
95
95
|
POST /v3/virtualgoods/purchase { "player": "<id>", "item": "<item_id>", "total": 1 }
|
|
96
96
|
```
|
|
97
|
-
|
|
98
|
-
## Verified References
|
|
99
|
-
|
|
100
|
-
| Claim | Status | Evidence |
|
|
101
|
-
|-------|--------|----------|
|
|
102
|
-
| CatalogManager is the class managing virtual goods catalog items, pricing, and purchase lifecycle in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/catalog/CatalogManager.java:CatalogManager |
|
|
@@ -70,9 +70,3 @@ funifier_list type=webhook
|
|
|
70
70
|
### 5. Testar
|
|
71
71
|
|
|
72
72
|
Dispare um evento (ex: log uma ação que gera conquista) e verifique se o endpoint externo recebeu o payload.
|
|
73
|
-
|
|
74
|
-
## Verified References
|
|
75
|
-
|
|
76
|
-
| Claim | Status | Evidence |
|
|
77
|
-
|-------|--------|----------|
|
|
78
|
-
| Webhook is the entity class for outbound event notifications to external HTTP endpoints in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/webhook/Webhook.java:Webhook |
|
|
@@ -69,9 +69,3 @@ funifier_list type=websocket
|
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Conecte um cliente WebSocket e dispare um evento para confirmar que as mensagens chegam em tempo real.
|
|
72
|
-
|
|
73
|
-
## Verified References
|
|
74
|
-
|
|
75
|
-
| Claim | Status | Evidence |
|
|
76
|
-
|-------|--------|----------|
|
|
77
|
-
| WebSocket is the entity class for real-time bidirectional communication configuration in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/websocket/WebSocket.java:WebSocket |
|
|
@@ -74,9 +74,3 @@ Cole o código de embed na página destino (intranet, LMS, etc.) e verifique que
|
|
|
74
74
|
funifier_list type=widget
|
|
75
75
|
GET /v3/widget/<_id>
|
|
76
76
|
```
|
|
77
|
-
|
|
78
|
-
## Verified References
|
|
79
|
-
|
|
80
|
-
| Claim | Status | Evidence |
|
|
81
|
-
|-------|--------|----------|
|
|
82
|
-
| Widget is the entity class for embeddable visual gamification components with type, configuration, and display settings in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/widget/Widget.java:Widget |
|
|
@@ -170,9 +170,3 @@ Não coloque o parâmetro convertido para `Date` dentro de `{ "$date": "$param:s
|
|
|
170
170
|
- [ ] Em prepared aggregate, usar `"$param:nome"` exatamente como string.
|
|
171
171
|
- [ ] Para data absoluta em prepared aggregate, converter no `script` com `DateUtil.parse`, validar `null`, e substituir o `Date` diretamente em `$gte`/`$lte`.
|
|
172
172
|
- [ ] Testar aggregate direto antes de salvar como prepared aggregate.
|
|
173
|
-
|
|
174
|
-
## Verified References
|
|
175
|
-
|
|
176
|
-
| Claim | Status | Evidence |
|
|
177
|
-
|-------|--------|----------|
|
|
178
|
-
|
|
@@ -90,9 +90,3 @@ Leia o arquivo de doc específico para o módulo com problema:
|
|
|
90
90
|
- Scheduler → `funifier_read_doc path=modules/scheduler`
|
|
91
91
|
- Aggregate → `funifier_read_doc path=guides/aggregates`
|
|
92
92
|
- Security/Auth → `funifier_read_doc path=modules/security`
|
|
93
|
-
|
|
94
|
-
## Verified References
|
|
95
|
-
|
|
96
|
-
| Claim | Status | Evidence |
|
|
97
|
-
|-------|--------|----------|
|
|
98
|
-
| TriggerManager is the entry point for trigger script execution and error capture in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/integration/trigger/TriggerManager.java:TriggerManager |
|
|
@@ -79,9 +79,3 @@ Baseado na tabela acima, instrua o usuário a usar a skill específica.
|
|
|
79
79
|
### 4. Se não encontrar skill específica
|
|
80
80
|
|
|
81
81
|
Consulte `funifier_read_doc path=index` e leia o módulo relevante diretamente.
|
|
82
|
-
|
|
83
|
-
## Verified References
|
|
84
|
-
|
|
85
|
-
| Claim | Status | Evidence |
|
|
86
|
-
|-------|--------|----------|
|
|
87
|
-
| Achievement is the core entity class representing all gamification rewards in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/achievement/Achievement.java:Achievement |
|
|
@@ -122,10 +122,3 @@ await fetch('/v3/database/cycle__c?strict=true', {
|
|
|
122
122
|
### 5. Hospedar no Funifier (opcional)
|
|
123
123
|
|
|
124
124
|
Para arquivos estáticos, leia `funifier_read_doc path=modules/static-repo`.
|
|
125
|
-
|
|
126
|
-
## Verified References
|
|
127
|
-
|
|
128
|
-
| Claim | Status | Evidence |
|
|
129
|
-
|-------|--------|----------|
|
|
130
|
-
| PlayerManager handles player authentication and session management in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/player/PlayerManager.java:PlayerManager |
|
|
131
|
-
| ActionManager processes action event registration from frontend clients | ✓ verified | Class:src/main/java/com/funifier/engine/action/ActionManager.java:ActionManager |
|
|
@@ -83,9 +83,3 @@ Get the index name from `action=list`. The `_id_` index cannot be dropped.
|
|
|
83
83
|
| Unique email | `{"email": 1}` (uniqueness enforced by MongoDB, not this API) |
|
|
84
84
|
|
|
85
85
|
For a composite (e.g. `{player: 1, time: -1}` to back filter+sort in one plan), use the Groovy/trigger path shown in the Limitation section — not this tool.
|
|
86
|
-
|
|
87
|
-
## Verified References
|
|
88
|
-
|
|
89
|
-
| Claim | Status | Evidence |
|
|
90
|
-
|-------|--------|----------|
|
|
91
|
-
|
|
@@ -80,10 +80,3 @@ GET /v3/player/<_id>/status
|
|
|
80
80
|
```
|
|
81
81
|
GET /v3/team/<team_id>/member/add/<player_id>
|
|
82
82
|
```
|
|
83
|
-
|
|
84
|
-
## Verified References
|
|
85
|
-
|
|
86
|
-
| Claim | Status | Evidence |
|
|
87
|
-
|-------|--------|----------|
|
|
88
|
-
| Player is the entity class with _id, name, email, teams, extra fields in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/player/Player.java:Player |
|
|
89
|
-
| PlayerManager handles player CRUD, authentication, and status queries in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/player/PlayerManager.java:PlayerManager |
|
|
@@ -74,9 +74,3 @@ GET /v3/team/sales/status
|
|
|
74
74
|
```
|
|
75
75
|
GET /v3/team/sales/member/remove/tom
|
|
76
76
|
```
|
|
77
|
-
|
|
78
|
-
## Verified References
|
|
79
|
-
|
|
80
|
-
| Claim | Status | Evidence |
|
|
81
|
-
|-------|--------|----------|
|
|
82
|
-
| Team is the entity class for player groups with _id, name, members, owner fields in funifier-service | ✓ verified | Class:src/main/java/com/funifier/engine/team/Team.java:Team |
|