bkper 4.12.26 → 4.12.28
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 +7 -0
- package/lib/agent/system-prompt.js +3 -3
- package/lib/commands/apps/index.d.ts +2 -1
- package/lib/commands/apps/index.d.ts.map +1 -1
- package/lib/commands/apps/index.js +2 -0
- package/lib/commands/apps/index.js.map +1 -1
- package/lib/commands/apps/init.d.ts +8 -0
- package/lib/commands/apps/init.d.ts.map +1 -1
- package/lib/commands/apps/init.js +66 -4
- package/lib/commands/apps/init.js.map +1 -1
- package/lib/commands/apps/logs.d.ts +40 -0
- package/lib/commands/apps/logs.d.ts.map +1 -0
- package/lib/commands/apps/logs.js +124 -0
- package/lib/commands/apps/logs.js.map +1 -0
- package/lib/commands/apps/register.d.ts.map +1 -1
- package/lib/commands/apps/register.js +15 -1
- package/lib/commands/apps/register.js.map +1 -1
- package/lib/commands/apps/types.d.ts +15 -0
- package/lib/commands/apps/types.d.ts.map +1 -1
- package/lib/docs/app-building.md +96 -2
- package/lib/docs/app-management.md +10 -1
- package/lib/docs/cli-reference.md +7 -0
- package/lib/docs/index.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,8 +159,15 @@ Build, deploy, and manage Bkper apps.
|
|
|
159
159
|
bkper app init my-app
|
|
160
160
|
bkper app dev
|
|
161
161
|
bkper app sync && bkper app deploy
|
|
162
|
+
bkper app logs --last 50
|
|
163
|
+
bkper app logs --since 5m --preview --events
|
|
164
|
+
bkper app logs --json
|
|
162
165
|
```
|
|
163
166
|
|
|
167
|
+
`bkper app logs` reads recent app logs kept for 15 days. The default output is human-readable, and JSON is available with `--json` or `--format json`.
|
|
168
|
+
|
|
169
|
+
Log request URLs and sensitive headers follow Cloudflare's default redaction rules, and this first release supports recent retrieval only (`last N` plus optional time filters), not full-text search.
|
|
170
|
+
|
|
164
171
|
→ [Full App Management reference](https://github.com/bkper/bkper-cli/blob/main/docs/app-management.md)
|
|
165
172
|
|
|
166
173
|
---
|
|
@@ -87,13 +87,13 @@ export function getBkperAgentSystemPrompt() {
|
|
|
87
87
|
|
|
88
88
|
Bkper's accounting model is intentionally non-standard. Generic accounting knowledge — debit/credit, account categories, sign conventions — will lead you to wrong answers here.
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
The canonical Bkper data model reference:
|
|
91
91
|
|
|
92
92
|
\`\`\`
|
|
93
93
|
${coreConceptsPath}
|
|
94
94
|
\`\`\`
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
Base all reasoning about Bkper data — books, accounts, groups, transactions, balances, queries, or any accounting or financial flow — on this reference. Prior accounting intuition does not substitute for it.
|
|
97
97
|
|
|
98
98
|
## Reference Routing
|
|
99
99
|
|
|
@@ -137,7 +137,7 @@ ${buildToolPromptSection()}
|
|
|
137
137
|
|
|
138
138
|
## IMPORTANT Operating Principles
|
|
139
139
|
|
|
140
|
-
- Interview me
|
|
140
|
+
- Interview me about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
141
141
|
- Ask the questions one at a time.
|
|
142
142
|
- If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
143
143
|
- Only perform mutating actions (creating/editing files, destructive shell commands, API writes) when the user has explicitly requested that change in the current turn. When exploring, debugging, or unsure, propose the change and wait for confirmation instead of acting.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export type { DeployOptions, DeployResult, Environment, HandlerType, SecretsOptions, SyncResult, UndeployResult, } from './types.js';
|
|
1
|
+
export type { DeployOptions, DeployResult, Environment, HandlerType, LogEntry, LogsMeta, LogsOptions, LogsOutputMode, LogsResponse, SecretsOptions, SyncResult, UndeployResult, } from './types.js';
|
|
2
2
|
export type { DevOptions } from './dev.js';
|
|
3
3
|
export { listApps, listAppsFormatted } from './list.js';
|
|
4
4
|
export { createApp, syncApp, updateApp } from './sync.js';
|
|
5
5
|
export { deployApp, statusApp, undeployApp } from './deploy.js';
|
|
6
|
+
export { buildLogsQuery, logsApp, renderLogsResponse, requestAppLogs, resolveLogsHandler, resolveLogsOutputMode, } from './logs.js';
|
|
6
7
|
export { dev } from './dev.js';
|
|
7
8
|
export { build } from './build.js';
|
|
8
9
|
export { initApp } from './init.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACR,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,cAAc,GACjB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/index.ts"],"names":[],"mappings":"AAIA,YAAY,EACR,aAAa,EACb,YAAY,EACZ,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,GACjB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EACH,cAAc,EACd,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -10,6 +10,8 @@ export { listApps, listAppsFormatted } from './list.js';
|
|
|
10
10
|
export { createApp, syncApp, updateApp } from './sync.js';
|
|
11
11
|
// Deploy
|
|
12
12
|
export { deployApp, statusApp, undeployApp } from './deploy.js';
|
|
13
|
+
//Logs
|
|
14
|
+
export { buildLogsQuery, logsApp, renderLogsResponse, requestAppLogs, resolveLogsHandler, resolveLogsOutputMode, } from './logs.js';
|
|
13
15
|
// Dev
|
|
14
16
|
export { dev } from './dev.js';
|
|
15
17
|
// Build
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/apps/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/apps/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAmBhF,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,OAAO;AACP,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAExD,cAAc;AACd,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE1D,SAAS;AACT,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM;AACN,OAAO,EACH,cAAc,EACd,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,WAAW,CAAC;AAEnB,MAAM;AACN,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO;AACP,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU;AACV,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEtE,oBAAoB;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively replaces 'my-app' with the new app name in all string values.
|
|
3
|
+
*/
|
|
4
|
+
export declare function replaceMyAppInObject(obj: unknown, appName: string): unknown;
|
|
5
|
+
/**
|
|
6
|
+
* Replaces the placeholder app id 'my-app' in event handler source files.
|
|
7
|
+
*/
|
|
8
|
+
export declare function updateEventHandlers(projectDir: string, appName: string): void;
|
|
1
9
|
/**
|
|
2
10
|
* Initializes a new Bkper app from the template.
|
|
3
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/init.ts"],"names":[],"mappings":"AAuGA;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAe3E;AAsCD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAwB7E;AAqDD;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFzD"}
|
|
@@ -96,6 +96,25 @@ function downloadTemplate(targetDir) {
|
|
|
96
96
|
// =============================================================================
|
|
97
97
|
// Project Configuration
|
|
98
98
|
// =============================================================================
|
|
99
|
+
/**
|
|
100
|
+
* Recursively replaces 'my-app' with the new app name in all string values.
|
|
101
|
+
*/
|
|
102
|
+
export function replaceMyAppInObject(obj, appName) {
|
|
103
|
+
if (typeof obj === 'string') {
|
|
104
|
+
return obj.replace(/my-app/g, appName);
|
|
105
|
+
}
|
|
106
|
+
if (Array.isArray(obj)) {
|
|
107
|
+
return obj.map(item => replaceMyAppInObject(item, appName));
|
|
108
|
+
}
|
|
109
|
+
if (obj && typeof obj === 'object') {
|
|
110
|
+
const result = {};
|
|
111
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
112
|
+
result[key] = replaceMyAppInObject(value, appName);
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
return obj;
|
|
117
|
+
}
|
|
99
118
|
/**
|
|
100
119
|
* Updates the bkper.yaml file with the new app name.
|
|
101
120
|
* Also handles bkperapp.yaml for backward compatibility.
|
|
@@ -120,7 +139,36 @@ function updateBkperYaml(projectDir, appName) {
|
|
|
120
139
|
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
121
140
|
.join(' ');
|
|
122
141
|
}
|
|
123
|
-
|
|
142
|
+
// Replace all remaining 'my-app' placeholders in URLs and other values
|
|
143
|
+
const updatedConfig = replaceMyAppInObject(config, appName);
|
|
144
|
+
fs.writeFileSync(yamlPath, YAML.stringify(updatedConfig), 'utf8');
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Replaces the placeholder app id 'my-app' in event handler source files.
|
|
148
|
+
*/
|
|
149
|
+
export function updateEventHandlers(projectDir, appName) {
|
|
150
|
+
const eventsDir = path.join(projectDir, 'packages/events/src');
|
|
151
|
+
if (!fs.existsSync(eventsDir)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
function processDir(dir) {
|
|
155
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
156
|
+
const fullPath = path.join(dir, entry.name);
|
|
157
|
+
if (entry.isDirectory()) {
|
|
158
|
+
processDir(fullPath);
|
|
159
|
+
}
|
|
160
|
+
else if (entry.name.endsWith('.ts')) {
|
|
161
|
+
let content = fs.readFileSync(fullPath, 'utf8');
|
|
162
|
+
const original = content;
|
|
163
|
+
// Replace both single and double quoted 'my-app' used as an identifier
|
|
164
|
+
content = content.replace(/(['"])my-app\1/g, `$1${appName}$1`);
|
|
165
|
+
if (content !== original) {
|
|
166
|
+
fs.writeFileSync(fullPath, content, 'utf8');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
processDir(eventsDir);
|
|
124
172
|
}
|
|
125
173
|
/**
|
|
126
174
|
* Updates the package.json file with the new app name.
|
|
@@ -204,7 +252,16 @@ export function initApp(name) {
|
|
|
204
252
|
console.error('Error updating bkper.yaml:', err instanceof Error ? err.message : err);
|
|
205
253
|
process.exit(1);
|
|
206
254
|
}
|
|
207
|
-
// 5. Update
|
|
255
|
+
// 5. Update event handler loop guards
|
|
256
|
+
try {
|
|
257
|
+
updateEventHandlers(targetDir, name);
|
|
258
|
+
console.log(' Updated event handlers');
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
console.error('Error updating event handlers:', err instanceof Error ? err.message : err);
|
|
262
|
+
process.exit(1);
|
|
263
|
+
}
|
|
264
|
+
// 6. Update package.json
|
|
208
265
|
try {
|
|
209
266
|
updatePackageJson(targetDir, name);
|
|
210
267
|
console.log(' Updated package.json');
|
|
@@ -213,7 +270,7 @@ export function initApp(name) {
|
|
|
213
270
|
console.error('Error updating package.json:', err instanceof Error ? err.message : err);
|
|
214
271
|
process.exit(1);
|
|
215
272
|
}
|
|
216
|
-
//
|
|
273
|
+
// 7. Install dependencies
|
|
217
274
|
console.log(' Installing dependencies...');
|
|
218
275
|
try {
|
|
219
276
|
yield runCommand('bun', ['install'], targetDir);
|
|
@@ -222,12 +279,17 @@ export function initApp(name) {
|
|
|
222
279
|
catch (err) {
|
|
223
280
|
console.log(' Warning: Could not install dependencies. Run "bun install" manually.');
|
|
224
281
|
}
|
|
225
|
-
//
|
|
282
|
+
// 8. Print success message
|
|
226
283
|
console.log(`
|
|
227
284
|
Done! To get started:
|
|
228
285
|
|
|
229
286
|
cd ${name}
|
|
230
287
|
bun run dev
|
|
288
|
+
|
|
289
|
+
Next steps:
|
|
290
|
+
- Review bkper.yaml: update description, ownerName, ownerWebsite, and repoUrl
|
|
291
|
+
- Replace logo-light.svg and logo-dark.svg in packages/web/client/public/images/
|
|
292
|
+
- Edit README.md to explain what your app does for end users
|
|
231
293
|
`);
|
|
232
294
|
});
|
|
233
295
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/commands/apps/init.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,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EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YAC1F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,yBAAyB;QACzB,IAAI,CAAC;YACD,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,0BAA0B;QAC1B,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,IAAI,CAAC;YACD,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;QAC1F,CAAC;QAED,2BAA2B;QAC3B,OAAO,CAAC,GAAG,CAAC;;;OAGT,IAAI;;;;;;;CAOV,CAAC,CAAC;IACH,CAAC;CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { getStoredOAuthToken } from '../../auth/local-auth-service.js';
|
|
3
|
+
import { handleError, loadAppConfig } from './config.js';
|
|
4
|
+
import type { Environment, HandlerType, LogsOptions, LogsOutputMode, LogsResponse } from './types.js';
|
|
5
|
+
interface LogsPlatformClient {
|
|
6
|
+
GET(path: '/api/apps/{appId}/logs', init: {
|
|
7
|
+
params: {
|
|
8
|
+
path: {
|
|
9
|
+
appId: string;
|
|
10
|
+
};
|
|
11
|
+
query: ReturnType<typeof buildLogsQuery>;
|
|
12
|
+
};
|
|
13
|
+
}): Promise<{
|
|
14
|
+
data?: LogsResponse;
|
|
15
|
+
error?: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
interface LogsCommandDependencies {
|
|
19
|
+
loadAppConfig: typeof loadAppConfig;
|
|
20
|
+
getStoredOAuthToken: typeof getStoredOAuthToken;
|
|
21
|
+
createPlatformClient(token?: string): LogsPlatformClient;
|
|
22
|
+
handleError: typeof handleError;
|
|
23
|
+
exit(code?: number): never;
|
|
24
|
+
}
|
|
25
|
+
export declare function resolveLogsHandler(options: Pick<LogsOptions, 'web' | 'events'>): HandlerType | undefined;
|
|
26
|
+
export declare function buildLogsQuery(options: LogsOptions): {
|
|
27
|
+
since?: string;
|
|
28
|
+
until?: string;
|
|
29
|
+
last: number;
|
|
30
|
+
env: Environment;
|
|
31
|
+
handler?: HandlerType;
|
|
32
|
+
outcome?: LogsOptions['outcome'];
|
|
33
|
+
statusCode?: number;
|
|
34
|
+
};
|
|
35
|
+
export declare function resolveLogsOutputMode(command: Pick<Command, 'optsWithGlobals' | 'getOptionValueSourceWithGlobals'>): LogsOutputMode;
|
|
36
|
+
export declare function renderLogsResponse(response: LogsResponse, mode: LogsOutputMode): string;
|
|
37
|
+
export declare function requestAppLogs(options?: LogsOptions, overrides?: Partial<LogsCommandDependencies>): Promise<LogsResponse>;
|
|
38
|
+
export declare function logsApp(options?: LogsOptions, overrides?: Partial<LogsCommandDependencies>, command?: Pick<Command, 'optsWithGlobals' | 'getOptionValueSourceWithGlobals'>): Promise<void>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAYA;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,iCAAiC,CAAC,GAAG,cAAc,CAenI;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAgDvF;AAED,wBAAsB,cAAc,CAChC,OAAO,GAAE,WAAgB,EACzB,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GACjD,OAAO,CAAC,YAAY,CAAC,CAoCvB;AAED,wBAAsB,OAAO,CACzB,OAAO,GAAE,WAAgB,EACzB,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,EAChD,OAAO,GAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,iCAAiC,CAAW,GACxF,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { program } from 'commander';
|
|
11
|
+
import { getStoredOAuthToken } from '../../auth/local-auth-service.js';
|
|
12
|
+
import { createPlatformClient } from '../../platform/client.js';
|
|
13
|
+
import { handleError, loadAppConfig } from './config.js';
|
|
14
|
+
function getLogsDependencies(overrides = {}) {
|
|
15
|
+
return Object.assign({ loadAppConfig,
|
|
16
|
+
getStoredOAuthToken,
|
|
17
|
+
createPlatformClient,
|
|
18
|
+
handleError,
|
|
19
|
+
exit(code) {
|
|
20
|
+
process.exit(code);
|
|
21
|
+
} }, overrides);
|
|
22
|
+
}
|
|
23
|
+
export function resolveLogsHandler(options) {
|
|
24
|
+
if ((options.web && options.events) || (!options.web && !options.events)) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return options.events ? 'events' : 'web';
|
|
28
|
+
}
|
|
29
|
+
export function buildLogsQuery(options) {
|
|
30
|
+
var _a;
|
|
31
|
+
const handler = resolveLogsHandler(options);
|
|
32
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ env: options.preview ? 'preview' : 'production', last: (_a = options.last) !== null && _a !== void 0 ? _a : 100 }, (handler ? { handler } : {})), (options.since ? { since: options.since } : {})), (options.until ? { until: options.until } : {})), (options.outcome ? { outcome: options.outcome } : {})), (options.statusCode !== undefined ? { statusCode: options.statusCode } : {}));
|
|
33
|
+
}
|
|
34
|
+
export function resolveLogsOutputMode(command) {
|
|
35
|
+
const options = command.optsWithGlobals();
|
|
36
|
+
if (options.json || options.format === 'json') {
|
|
37
|
+
return 'json';
|
|
38
|
+
}
|
|
39
|
+
const formatSource = command.getOptionValueSourceWithGlobals('format');
|
|
40
|
+
if (formatSource === 'cli') {
|
|
41
|
+
throw new Error('bkper app logs only supports default human-readable output or JSON. Use --json or --format json.');
|
|
42
|
+
}
|
|
43
|
+
return 'pretty';
|
|
44
|
+
}
|
|
45
|
+
export function renderLogsResponse(response, mode) {
|
|
46
|
+
if (mode === 'json') {
|
|
47
|
+
return JSON.stringify(response, null, 2);
|
|
48
|
+
}
|
|
49
|
+
const lines = [];
|
|
50
|
+
for (const warning of response.meta.warnings) {
|
|
51
|
+
lines.push(`Warning: ${warning}`);
|
|
52
|
+
}
|
|
53
|
+
if (response.logs.length === 0) {
|
|
54
|
+
if (lines.length > 0) {
|
|
55
|
+
lines.push('');
|
|
56
|
+
}
|
|
57
|
+
lines.push('No logs found.');
|
|
58
|
+
return lines.join('\n');
|
|
59
|
+
}
|
|
60
|
+
if (lines.length > 0) {
|
|
61
|
+
lines.push('');
|
|
62
|
+
}
|
|
63
|
+
const orderedLogs = [...response.logs].reverse();
|
|
64
|
+
orderedLogs.forEach((entry, index) => {
|
|
65
|
+
var _a, _b, _c;
|
|
66
|
+
lines.push(`${entry.timestamp} ${entry.environment}/${entry.handler} ${entry.outcome} ${(_a = entry.requestMethod) !== null && _a !== void 0 ? _a : '-'} ${(_b = entry.statusCode) !== null && _b !== void 0 ? _b : '-'} ${(_c = entry.requestUrl) !== null && _c !== void 0 ? _c : ''}`.trim());
|
|
67
|
+
for (const logLine of entry.logs) {
|
|
68
|
+
lines.push(` log: ${logLine}`);
|
|
69
|
+
}
|
|
70
|
+
for (const exception of entry.exceptions) {
|
|
71
|
+
lines.push(` exception: ${exception.name}: ${exception.message}`);
|
|
72
|
+
if (exception.stack) {
|
|
73
|
+
for (const stackLine of exception.stack.split('\n')) {
|
|
74
|
+
lines.push(` ${stackLine}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (index < orderedLogs.length - 1) {
|
|
79
|
+
lines.push('');
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return lines.join('\n');
|
|
83
|
+
}
|
|
84
|
+
export function requestAppLogs() {
|
|
85
|
+
return __awaiter(this, arguments, void 0, function* (options = {}, overrides = {}) {
|
|
86
|
+
const dependencies = getLogsDependencies(overrides);
|
|
87
|
+
let config;
|
|
88
|
+
try {
|
|
89
|
+
config = dependencies.loadAppConfig();
|
|
90
|
+
}
|
|
91
|
+
catch (_a) {
|
|
92
|
+
console.error('Error: bkper.yaml or bkper.json not found');
|
|
93
|
+
return dependencies.exit(1);
|
|
94
|
+
}
|
|
95
|
+
if (!(config === null || config === void 0 ? void 0 : config.id)) {
|
|
96
|
+
console.error('Error: App config is missing "id" field');
|
|
97
|
+
return dependencies.exit(1);
|
|
98
|
+
}
|
|
99
|
+
const token = yield dependencies.getStoredOAuthToken();
|
|
100
|
+
const client = dependencies.createPlatformClient(token);
|
|
101
|
+
const { data, error } = yield client.GET('/api/apps/{appId}/logs', {
|
|
102
|
+
params: {
|
|
103
|
+
path: { appId: config.id },
|
|
104
|
+
query: buildLogsQuery(options),
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
if (error) {
|
|
108
|
+
dependencies.handleError(error);
|
|
109
|
+
}
|
|
110
|
+
if (!data) {
|
|
111
|
+
console.error('Error: Unexpected empty response');
|
|
112
|
+
return dependencies.exit(1);
|
|
113
|
+
}
|
|
114
|
+
return data;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export function logsApp() {
|
|
118
|
+
return __awaiter(this, arguments, void 0, function* (options = {}, overrides = {}, command = program) {
|
|
119
|
+
const outputMode = resolveLogsOutputMode(command);
|
|
120
|
+
const response = yield requestAppLogs(options, overrides);
|
|
121
|
+
console.log(renderLogsResponse(response, outputMode));
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/commands/apps/logs.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAW,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA6BzD,SAAS,mBAAmB,CACxB,YAA8C,EAAE;IAEhD,uBACI,aAAa;QACb,mBAAmB;QACnB,oBAAoB;QACpB,WAAW;QACX,IAAI,CAAC,IAAa;YACd,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,IACE,SAAS,EACd;AACN,CA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,MAAM,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAC1D,CAAC;CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+M1D"}
|
|
@@ -11,7 +11,7 @@ import { withAction } from '../action.js';
|
|
|
11
11
|
import { setupBkper } from '../../bkper-factory.js';
|
|
12
12
|
import { renderListResult, renderItem } from '../../render/index.js';
|
|
13
13
|
import { validateRequiredOptions, throwIfErrors } from '../../utils/validation.js';
|
|
14
|
-
import { listAppsFormatted, syncApp, deployApp, undeployApp, statusApp, initApp, secretsPut, secretsList, secretsDelete, dev, build, installApp, uninstallApp, } from './index.js';
|
|
14
|
+
import { listAppsFormatted, syncApp, deployApp, undeployApp, statusApp, logsApp, initApp, secretsPut, secretsList, secretsDelete, dev, build, installApp, uninstallApp, } from './index.js';
|
|
15
15
|
export function registerAppCommands(program) {
|
|
16
16
|
const appCommand = program.command('app').description('Manage Bkper Apps');
|
|
17
17
|
appCommand
|
|
@@ -58,6 +58,20 @@ export function registerAppCommands(program) {
|
|
|
58
58
|
.action(options => withAction('getting app status', () => __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
yield statusApp();
|
|
60
60
|
}), { skipSetup: true })());
|
|
61
|
+
appCommand
|
|
62
|
+
.command('logs')
|
|
63
|
+
.description('View recent app logs')
|
|
64
|
+
.option('--since <time>', 'ISO8601 or relative lower bound such as 5m, 1h, or 15d')
|
|
65
|
+
.option('--until <time>', 'ISO8601 or relative upper bound such as 5m, 1h, or 15d')
|
|
66
|
+
.option('--last <n>', 'Show newest N entries after filters', value => Number.parseInt(value, 10))
|
|
67
|
+
.option('-p, --preview', 'Query preview logs instead of production logs')
|
|
68
|
+
.option('-w, --web', 'Filter to the web handler')
|
|
69
|
+
.option('-e, --events', 'Filter to the events handler')
|
|
70
|
+
.option('--outcome <outcome>', 'Filter by Cloudflare worker outcome')
|
|
71
|
+
.option('--status-code <code>', 'Filter by HTTP status code', value => Number.parseInt(value, 10))
|
|
72
|
+
.action(options => withAction('getting app logs', () => __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
yield logsApp(options);
|
|
74
|
+
}), { skipSetup: true })());
|
|
61
75
|
appCommand
|
|
62
76
|
.command('dev')
|
|
63
77
|
.description('Start the worker runtime for local development')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/apps/register.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,YAAY,GACf,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAChD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAE3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AAM,WAAW,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5D,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAA,CAAC,EAAE,CACP,CAAC;AACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/apps/register.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,YAAY,GACf,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAChD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAE3E,UAAU;SACL,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE,CACrB,UAAU,CACN,kBAAkB,EAClB,GAAS,EAAE;QACP,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAA,EACD,EAAE,SAAS,EAAE,IAAI,EAAE,CACtB,EAAE,CACN,CAAC;IAEN,UAAU;SACL,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CACH,UAAU,CAAC,cAAc,E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3C,CAAC,CAAA,CAAC,EAAE,CACP,CAAC;IAEN,UAAU;SACL,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,8BAA8B,CAAC;SAC3C,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC;SACxC,MAAM,CAAC,CAAC,KAAa,EAAE,OAAO,EAAE,EAAE,CAC/B,UAAU,CAAC,kBAAkB,EAAE,CAAM,MAAM,EAAC,EAAE;QAC1C,aAAa,CAAC,uBAAuB,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QACpF,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5D,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAA,CAAC,EAAE,CACP,CAAC;AACV,CAAC"}
|
|
@@ -3,6 +3,10 @@ export type DeployResult = components['schemas']['DeployResult'];
|
|
|
3
3
|
export type UndeployResult = components['schemas']['UndeployResult'];
|
|
4
4
|
export type AppStatus = components['schemas']['AppStatus'];
|
|
5
5
|
export type ErrorResponse = components['schemas']['ErrorResponse'];
|
|
6
|
+
export type LogsResponse = components['schemas']['LogsResponse'];
|
|
7
|
+
export type LogEntry = components['schemas']['LogEntry'];
|
|
8
|
+
export type LogsMeta = components['schemas']['LogsMeta'];
|
|
9
|
+
export type LogOutcome = components['schemas']['LogOutcome'];
|
|
6
10
|
export interface DeployOptions {
|
|
7
11
|
preview?: boolean;
|
|
8
12
|
events?: boolean;
|
|
@@ -12,6 +16,17 @@ export interface DeployOptions {
|
|
|
12
16
|
export interface SecretsOptions {
|
|
13
17
|
preview?: boolean;
|
|
14
18
|
}
|
|
19
|
+
export interface LogsOptions {
|
|
20
|
+
since?: string;
|
|
21
|
+
until?: string;
|
|
22
|
+
last?: number;
|
|
23
|
+
preview?: boolean;
|
|
24
|
+
web?: boolean;
|
|
25
|
+
events?: boolean;
|
|
26
|
+
outcome?: LogOutcome;
|
|
27
|
+
statusCode?: number;
|
|
28
|
+
}
|
|
29
|
+
export type LogsOutputMode = 'pretty' | 'json';
|
|
15
30
|
export interface SyncResult {
|
|
16
31
|
id: string;
|
|
17
32
|
action: 'created' | 'updated';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM1D,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/apps/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM1D,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CA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BAAuB,CAAC;IAC7B,MAAM,EAAE,uBAAuB,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAMD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
package/lib/docs/app-building.md
CHANGED
|
@@ -55,7 +55,24 @@ To make your app available to all Bkper users, contact us at [support@bkper.com]
|
|
|
55
55
|
|
|
56
56
|
- **Functionality check** — The app works correctly and handles errors gracefully
|
|
57
57
|
- **Security review** — Event handlers are idempotent and include loop prevention
|
|
58
|
-
- **Listing quality** — The app has a clear name, description, and
|
|
58
|
+
- **Listing quality** — The app has a clear name, description, logo, and user-facing documentation
|
|
59
|
+
|
|
60
|
+
### README matters
|
|
61
|
+
|
|
62
|
+
Your app's `README.md` is displayed to end users on the app listing page. Write it for the people who will install and use your app — not for developers.
|
|
63
|
+
|
|
64
|
+
**README should explain:**
|
|
65
|
+
- What the app does from a user's perspective
|
|
66
|
+
- How to use it (step-by-step for non-technical users)
|
|
67
|
+
- What features are available
|
|
68
|
+
|
|
69
|
+
**README should NOT contain:**
|
|
70
|
+
- Tech stack or architecture details
|
|
71
|
+
- Build commands or development setup
|
|
72
|
+
- Project structure or internal file paths
|
|
73
|
+
- API documentation or SDK references
|
|
74
|
+
|
|
75
|
+
Put developer documentation in `AGENTS.md` or internal docs instead. Keep `README.md` focused on the user experience.
|
|
59
76
|
|
|
60
77
|
### Where published apps appear
|
|
61
78
|
|
|
@@ -598,6 +615,8 @@ Deploy to a separate preview environment for testing before production:
|
|
|
598
615
|
bkper app deploy --preview
|
|
599
616
|
```
|
|
600
617
|
|
|
618
|
+
Preview URLs use a dash suffix: `https://{appId}-preview.bkper.app`. For example, an app with `id: my-app` deploys to `https://my-app-preview.bkper.app`.
|
|
619
|
+
|
|
601
620
|
Preview has independent secrets and KV storage from production.
|
|
602
621
|
|
|
603
622
|
### Independent handler deployment
|
|
@@ -1089,6 +1108,81 @@ The complete current set of event types:
|
|
|
1089
1108
|
| `BOOK_UPDATED` | Book settings were updated. |
|
|
1090
1109
|
| `BOOK_DELETED` | The book was deleted. |
|
|
1091
1110
|
|
|
1111
|
+
---
|
|
1112
|
+
source: /docs/build/apps/first-app.md
|
|
1113
|
+
|
|
1114
|
+
# Your First App
|
|
1115
|
+
|
|
1116
|
+
This tutorial walks you through building and deploying a Bkper app from scratch. For the deep reference on any topic — architecture, configuration, development, events, or deployment — follow the links in each step.
|
|
1117
|
+
|
|
1118
|
+
## Prerequisites
|
|
1119
|
+
|
|
1120
|
+
[Development Setup](https://bkper.com/docs/build/getting-started/setup.md) — the CLI installed and authenticated.
|
|
1121
|
+
|
|
1122
|
+
## Walkthrough
|
|
1123
|
+
|
|
1124
|
+
1. **Scaffold from the template**
|
|
1125
|
+
|
|
1126
|
+
```bash
|
|
1127
|
+
bkper app init my-app
|
|
1128
|
+
cd my-app
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
The CLI sets your app ID, package name, URLs, and event-handler loop guards automatically. See [App Configuration](https://bkper.com/docs/build/apps/configuration.md) for the full `bkper.yaml` reference.
|
|
1132
|
+
|
|
1133
|
+
2. **Start developing**
|
|
1134
|
+
|
|
1135
|
+
```bash
|
|
1136
|
+
npm run dev
|
|
1137
|
+
```
|
|
1138
|
+
|
|
1139
|
+
This runs the Vite client dev server and the local worker runtime with automatic webhook tunneling. See [Development Experience](https://bkper.com/docs/build/apps/development.md) for details.
|
|
1140
|
+
|
|
1141
|
+
3. **Open the app**
|
|
1142
|
+
|
|
1143
|
+
Visit [http://localhost:5173](http://localhost:5173). Select a book to see account balances. No OAuth setup required — the platform handles authentication.
|
|
1144
|
+
|
|
1145
|
+
4. **Trigger an event**
|
|
1146
|
+
|
|
1147
|
+
Go to any Bkper book and check (reconcile) a transaction. Your local event handler receives the webhook via the tunnel and creates a 20% draft transaction. See [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md) for the full event model.
|
|
1148
|
+
|
|
1149
|
+
5. **Make a change**
|
|
1150
|
+
|
|
1151
|
+
Edit the handler in `packages/events/src/handlers/transaction-checked.ts` and save. The worker reloads automatically. Check another transaction to see your change.
|
|
1152
|
+
|
|
1153
|
+
6. **Customize your listing**
|
|
1154
|
+
|
|
1155
|
+
Update `bkper.yaml` with your app's description, owner details, and repository URL. Replace the placeholder logos in `packages/web/client/public/images/`. See [App Listing](https://bkper.com/docs/build/apps/app-listing.md) for publishing details.
|
|
1156
|
+
|
|
1157
|
+
7. **Update the README**
|
|
1158
|
+
|
|
1159
|
+
Edit `README.md` for end users — what the app does and how to use it. Keep developer docs in `AGENTS.md`.
|
|
1160
|
+
|
|
1161
|
+
8. **Deploy**
|
|
1162
|
+
|
|
1163
|
+
```bash
|
|
1164
|
+
npm run build
|
|
1165
|
+
bkper app sync
|
|
1166
|
+
bkper app deploy
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
Your app is live at `https://my-app.bkper.app`. See [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md) for preview environments, secrets, and KV.
|
|
1170
|
+
|
|
1171
|
+
## What you built
|
|
1172
|
+
|
|
1173
|
+
| You wrote | Platform handled |
|
|
1174
|
+
| --- | --- |
|
|
1175
|
+
| ~30 lines of UI | OAuth, consent screen, token refresh |
|
|
1176
|
+
| ~40 lines of event logic | Hosting, SSL, edge routing |
|
|
1177
|
+
| `bkper.yaml` | Webhook tunnels, KV, type generation |
|
|
1178
|
+
|
|
1179
|
+
## Next steps
|
|
1180
|
+
|
|
1181
|
+
- [App Architecture](https://bkper.com/docs/build/apps/architecture.md) — Understand the three-package pattern
|
|
1182
|
+
- [App Configuration](https://bkper.com/docs/build/apps/configuration.md) — Full `bkper.yaml` reference
|
|
1183
|
+
- [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md) — All event types and patterns
|
|
1184
|
+
- [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md) — Preview environments and secrets
|
|
1185
|
+
|
|
1092
1186
|
---
|
|
1093
1187
|
source: /docs/build/apps/overview.md
|
|
1094
1188
|
|
|
@@ -1166,7 +1260,7 @@ npm run dev
|
|
|
1166
1260
|
|
|
1167
1261
|
This gives you a working app with a client UI, server API, and event handler — all running locally with full HMR and webhook tunneling.
|
|
1168
1262
|
|
|
1169
|
-
See [Your First App](https://bkper.com/docs/build/
|
|
1263
|
+
See [Your First App](https://bkper.com/docs/build/apps/first-app.md) for a complete walkthrough, or continue to [App Architecture](https://bkper.com/docs/build/apps/architecture.md) to understand how platform apps are structured.
|
|
1170
1264
|
|
|
1171
1265
|
---
|
|
1172
1266
|
source: /docs/build/apps/self-hosted.md
|
|
@@ -76,7 +76,7 @@ bkper app build
|
|
|
76
76
|
# Sync configuration and deploy to production
|
|
77
77
|
bkper app sync && bkper app deploy
|
|
78
78
|
|
|
79
|
-
# Deploy to
|
|
79
|
+
# Deploy to preview environment (URL: https://{appId}-preview.bkper.app)
|
|
80
80
|
bkper app deploy --preview
|
|
81
81
|
|
|
82
82
|
# Deploy only the events handler
|
|
@@ -369,6 +369,15 @@ deployment:
|
|
|
369
369
|
- `-p, --preview` - Deploy to preview environment
|
|
370
370
|
- `--events` - Deploy events handler instead of web handler
|
|
371
371
|
- `app status` - Show deployment status
|
|
372
|
+
- `app logs` - View recent app logs
|
|
373
|
+
- `--since <time>` - ISO8601 or relative lower bound (e.g. `5m`, `1h`, `15d`)
|
|
374
|
+
- `--until <time>` - ISO8601 or relative upper bound
|
|
375
|
+
- `--last <n>` - Show newest N entries after filters (default: 100)
|
|
376
|
+
- `-p, --preview` - Query preview logs instead of production
|
|
377
|
+
- `-w, --web` - Filter to the web handler
|
|
378
|
+
- `-e, --events` - Filter to the events handler
|
|
379
|
+
- `--outcome <outcome>` - Filter by Cloudflare worker outcome
|
|
380
|
+
- `--status-code <code>` - Filter by HTTP status code
|
|
372
381
|
- `app undeploy` - Remove app from platform
|
|
373
382
|
- `-p, --preview` - Remove from preview environment
|
|
374
383
|
- `--events` - Remove events handler instead of web handler
|
|
@@ -159,8 +159,15 @@ Build, deploy, and manage Bkper apps.
|
|
|
159
159
|
bkper app init my-app
|
|
160
160
|
bkper app dev
|
|
161
161
|
bkper app sync && bkper app deploy
|
|
162
|
+
bkper app logs --last 50
|
|
163
|
+
bkper app logs --since 5m --preview --events
|
|
164
|
+
bkper app logs --json
|
|
162
165
|
```
|
|
163
166
|
|
|
167
|
+
`bkper app logs` reads recent app logs kept for 15 days. The default output is human-readable, and JSON is available with `--json` or `--format json`.
|
|
168
|
+
|
|
169
|
+
Log request URLs and sensitive headers follow Cloudflare's default redaction rules, and this first release supports recent retrieval only (`last N` plus optional time filters), not full-text search.
|
|
170
|
+
|
|
164
171
|
→ [Full App Management reference](https://github.com/bkper/bkper-cli/blob/main/docs/app-management.md)
|
|
165
172
|
|
|
166
173
|
---
|
package/lib/docs/index.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Reference docs for Bkper tasks. Load only the specific doc(s) relevant to the task — do not load all of them. All docs are in the same directory as this index.
|
|
4
4
|
|
|
5
5
|
- **data-management.md** — CLI reference for managing financial data: books, accounts, groups, transactions, per-account balance queries, query operators (on:, after:, before:, account:, group:), output formats (table/json/csv), batch operations via stdin/piping, collections.
|
|
6
|
-
- **app-management.md** — CLI reference for building and deploying Bkper apps: dev/build/deploy workflow, app install/uninstall, secrets management, bkper.yaml configuration reference (identity, branding, events, menu integration, deployment).
|
|
6
|
+
- **app-management.md** — CLI reference for building and deploying Bkper apps: dev/build/deploy workflow, app install/uninstall, secrets management, app logs, bkper.yaml configuration reference (identity, branding, events, menu integration, deployment).
|
|
7
7
|
- **app-building.md** — Full app-building reference: architecture (packages, client/server/events), development loop, event handlers, deployment patterns, the Bkper Platform, and self-hosted alternatives. Includes authentication patterns for web clients (`@bkper/web-auth`), event handlers (`bkper-oauth-token` headers), and local development. Load this for scaffolding apps, understanding app structure, or debugging the dev/build/deploy lifecycle.
|
|
8
8
|
- **financial-statements.md** — Step-by-step workflow for aggregate financial reports (balance sheet, P&L): root group discovery, query patterns, date semantics (before: vs after:+before:), common mistakes to avoid.
|
|
9
9
|
- **bkper-js.md** — bkper-js Node.js/browser SDK: Bkper, Book, Account, Transaction, Group, Balance classes, all methods, getBalancesReport, OAuth configuration, library setup.
|