aurabase-js 0.6.0 → 0.7.0
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/.omc/state/hud-stdin-cache.json +1 -1
- package/dist/cli.js +21 -1
- package/dist/cli.mjs +21 -1
- package/package.json +1 -1
- package/src/cli.ts +21 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"session_id":"1c1e8df6-335a-4058-8bd4-4c0a67d996cd","transcript_path":"C:\\Users\\Jay\\.claude\\projects\\D--000-FrontEnd-242-dino-game\\1c1e8df6-335a-4058-8bd4-4c0a67d996cd.jsonl","cwd":"D:\\000.FrontEnd\\242.dino_game\\packages\\aurabase-js","model":{"id":"GLM-5","display_name":"GLM-5"},"workspace":{"current_dir":"D:\\000.FrontEnd\\242.dino_game\\packages\\aurabase-js","project_dir":"D:\\000.FrontEnd\\242.dino_game","added_dirs":[]},"version":"2.1.71","output_style":{"name":"default"},"cost":{"total_cost_usd":3.
|
|
1
|
+
{"session_id":"1c1e8df6-335a-4058-8bd4-4c0a67d996cd","transcript_path":"C:\\Users\\Jay\\.claude\\projects\\D--000-FrontEnd-242-dino-game\\1c1e8df6-335a-4058-8bd4-4c0a67d996cd.jsonl","cwd":"D:\\000.FrontEnd\\242.dino_game\\packages\\aurabase-js","model":{"id":"GLM-5","display_name":"GLM-5"},"workspace":{"current_dir":"D:\\000.FrontEnd\\242.dino_game\\packages\\aurabase-js","project_dir":"D:\\000.FrontEnd\\242.dino_game","added_dirs":[]},"version":"2.1.71","output_style":{"name":"default"},"cost":{"total_cost_usd":3.3941639999999995,"total_duration_ms":2016455,"total_api_duration_ms":968316,"total_lines_added":378,"total_lines_removed":170},"context_window":{"total_input_tokens":84534,"total_output_tokens":25270,"context_window_size":200000,"current_usage":{"input_tokens":278,"output_tokens":64,"cache_creation_input_tokens":0,"cache_read_input_tokens":90368},"used_percentage":45,"remaining_percentage":55},"exceeds_200k_tokens":false}
|
package/dist/cli.js
CHANGED
|
@@ -52,12 +52,30 @@ export async function server() {
|
|
|
52
52
|
|
|
53
53
|
return client;
|
|
54
54
|
}
|
|
55
|
+
`,
|
|
56
|
+
"lib/admin.ts": `import { createClient } from 'aurabase-js';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Admin client with service_role key
|
|
60
|
+
* \u26A0\uFE0F ONLY use on server-side (API routes, server components)
|
|
61
|
+
* \u26A0\uFE0F Bypasses all RLS policies - use with caution!
|
|
62
|
+
*/
|
|
63
|
+
export const admin = createClient({
|
|
64
|
+
url: process.env.NEXT_PUBLIC_AURABASE_URL || '',
|
|
65
|
+
anonKey: process.env.AURABASE_SERVICE_ROLE_KEY || '',
|
|
66
|
+
});
|
|
55
67
|
`
|
|
56
68
|
};
|
|
57
69
|
var ENV_TEMPLATE = `
|
|
58
70
|
# AuraBase Configuration (.env.local)
|
|
71
|
+
|
|
72
|
+
# Public keys (client + server)
|
|
59
73
|
NEXT_PUBLIC_AURABASE_URL=https://your-project.cloudfront.net
|
|
60
74
|
NEXT_PUBLIC_AURABASE_ANON_KEY=your-anon-key-here
|
|
75
|
+
|
|
76
|
+
# Service role key (server only - bypasses RLS!)
|
|
77
|
+
# \u26A0\uFE0F NEVER expose this to the client!
|
|
78
|
+
AURABASE_SERVICE_ROLE_KEY=your-service-role-key-here
|
|
61
79
|
`;
|
|
62
80
|
function findProjectRoot() {
|
|
63
81
|
let dir = process.cwd();
|
|
@@ -93,6 +111,7 @@ function init() {
|
|
|
93
111
|
console.log("\x1B[1m\n\u{1F680} Initializing AuraBase...\x1B[0m\n");
|
|
94
112
|
createFile(projectRoot, "lib/client.ts");
|
|
95
113
|
createFile(projectRoot, "lib/server.ts");
|
|
114
|
+
createFile(projectRoot, "lib/admin.ts");
|
|
96
115
|
console.log("\x1B[36m%s\x1B[0m", ENV_TEMPLATE);
|
|
97
116
|
}
|
|
98
117
|
function showHelp() {
|
|
@@ -107,8 +126,9 @@ function showHelp() {
|
|
|
107
126
|
-v, --version Show version
|
|
108
127
|
|
|
109
128
|
\x1B[1mGenerated files:\x1B[0m
|
|
110
|
-
lib/client.ts Browser client
|
|
129
|
+
lib/client.ts Browser client (anon key)
|
|
111
130
|
lib/server.ts Server client (with cookie auth)
|
|
131
|
+
lib/admin.ts Admin client (service role, bypasses RLS)
|
|
112
132
|
`);
|
|
113
133
|
}
|
|
114
134
|
function showVersion() {
|
package/dist/cli.mjs
CHANGED
|
@@ -29,12 +29,30 @@ export async function server() {
|
|
|
29
29
|
|
|
30
30
|
return client;
|
|
31
31
|
}
|
|
32
|
+
`,
|
|
33
|
+
"lib/admin.ts": `import { createClient } from 'aurabase-js';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Admin client with service_role key
|
|
37
|
+
* \u26A0\uFE0F ONLY use on server-side (API routes, server components)
|
|
38
|
+
* \u26A0\uFE0F Bypasses all RLS policies - use with caution!
|
|
39
|
+
*/
|
|
40
|
+
export const admin = createClient({
|
|
41
|
+
url: process.env.NEXT_PUBLIC_AURABASE_URL || '',
|
|
42
|
+
anonKey: process.env.AURABASE_SERVICE_ROLE_KEY || '',
|
|
43
|
+
});
|
|
32
44
|
`
|
|
33
45
|
};
|
|
34
46
|
var ENV_TEMPLATE = `
|
|
35
47
|
# AuraBase Configuration (.env.local)
|
|
48
|
+
|
|
49
|
+
# Public keys (client + server)
|
|
36
50
|
NEXT_PUBLIC_AURABASE_URL=https://your-project.cloudfront.net
|
|
37
51
|
NEXT_PUBLIC_AURABASE_ANON_KEY=your-anon-key-here
|
|
52
|
+
|
|
53
|
+
# Service role key (server only - bypasses RLS!)
|
|
54
|
+
# \u26A0\uFE0F NEVER expose this to the client!
|
|
55
|
+
AURABASE_SERVICE_ROLE_KEY=your-service-role-key-here
|
|
38
56
|
`;
|
|
39
57
|
function findProjectRoot() {
|
|
40
58
|
let dir = process.cwd();
|
|
@@ -70,6 +88,7 @@ function init() {
|
|
|
70
88
|
console.log("\x1B[1m\n\u{1F680} Initializing AuraBase...\x1B[0m\n");
|
|
71
89
|
createFile(projectRoot, "lib/client.ts");
|
|
72
90
|
createFile(projectRoot, "lib/server.ts");
|
|
91
|
+
createFile(projectRoot, "lib/admin.ts");
|
|
73
92
|
console.log("\x1B[36m%s\x1B[0m", ENV_TEMPLATE);
|
|
74
93
|
}
|
|
75
94
|
function showHelp() {
|
|
@@ -84,8 +103,9 @@ function showHelp() {
|
|
|
84
103
|
-v, --version Show version
|
|
85
104
|
|
|
86
105
|
\x1B[1mGenerated files:\x1B[0m
|
|
87
|
-
lib/client.ts Browser client
|
|
106
|
+
lib/client.ts Browser client (anon key)
|
|
88
107
|
lib/server.ts Server client (with cookie auth)
|
|
108
|
+
lib/admin.ts Admin client (service role, bypasses RLS)
|
|
89
109
|
`);
|
|
90
110
|
}
|
|
91
111
|
function showVersion() {
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -29,13 +29,31 @@ export async function server() {
|
|
|
29
29
|
|
|
30
30
|
return client;
|
|
31
31
|
}
|
|
32
|
+
`,
|
|
33
|
+
'lib/admin.ts': `import { createClient } from 'aurabase-js';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Admin client with service_role key
|
|
37
|
+
* ⚠️ ONLY use on server-side (API routes, server components)
|
|
38
|
+
* ⚠️ Bypasses all RLS policies - use with caution!
|
|
39
|
+
*/
|
|
40
|
+
export const admin = createClient({
|
|
41
|
+
url: process.env.NEXT_PUBLIC_AURABASE_URL || '',
|
|
42
|
+
anonKey: process.env.AURABASE_SERVICE_ROLE_KEY || '',
|
|
43
|
+
});
|
|
32
44
|
`,
|
|
33
45
|
};
|
|
34
46
|
|
|
35
47
|
const ENV_TEMPLATE = `
|
|
36
48
|
# AuraBase Configuration (.env.local)
|
|
49
|
+
|
|
50
|
+
# Public keys (client + server)
|
|
37
51
|
NEXT_PUBLIC_AURABASE_URL=https://your-project.cloudfront.net
|
|
38
52
|
NEXT_PUBLIC_AURABASE_ANON_KEY=your-anon-key-here
|
|
53
|
+
|
|
54
|
+
# Service role key (server only - bypasses RLS!)
|
|
55
|
+
# ⚠️ NEVER expose this to the client!
|
|
56
|
+
AURABASE_SERVICE_ROLE_KEY=your-service-role-key-here
|
|
39
57
|
`;
|
|
40
58
|
|
|
41
59
|
function findProjectRoot(): string {
|
|
@@ -80,6 +98,7 @@ function init() {
|
|
|
80
98
|
|
|
81
99
|
createFile(projectRoot, 'lib/client.ts');
|
|
82
100
|
createFile(projectRoot, 'lib/server.ts');
|
|
101
|
+
createFile(projectRoot, 'lib/admin.ts');
|
|
83
102
|
|
|
84
103
|
console.log('\x1b[36m%s\x1b[0m', ENV_TEMPLATE);
|
|
85
104
|
}
|
|
@@ -96,8 +115,9 @@ function showHelp() {
|
|
|
96
115
|
-v, --version Show version
|
|
97
116
|
|
|
98
117
|
\x1b[1mGenerated files:\x1b[0m
|
|
99
|
-
lib/client.ts Browser client
|
|
118
|
+
lib/client.ts Browser client (anon key)
|
|
100
119
|
lib/server.ts Server client (with cookie auth)
|
|
120
|
+
lib/admin.ts Admin client (service role, bypasses RLS)
|
|
101
121
|
`);
|
|
102
122
|
}
|
|
103
123
|
|