37 lines
1020 B
Plaintext
37 lines
1020 B
Plaintext
// Test OSIRIS Note Creation
|
|
// Run with: cargo run --bin runner --features rhai-support -- test1 --script-file scripts/test_note.rhai
|
|
|
|
print("=== OSIRIS Note Test ===\n");
|
|
|
|
// Create a note
|
|
print("Creating note...");
|
|
let note = note("test_notes")
|
|
.title("Test from OSIRIS Runner")
|
|
.content("This note was created using the OSIRIS standalone runner!")
|
|
.tag("source", "osiris-runner")
|
|
.tag("test", "true")
|
|
.mime("text/plain");
|
|
|
|
print(`Note created: ${note.get_title()}`);
|
|
|
|
// Store the note
|
|
print("Storing note...");
|
|
let id = put_note(note);
|
|
print(`✓ Note stored with ID: ${id}\n`);
|
|
|
|
// Retrieve the note
|
|
print("Retrieving note...");
|
|
let retrieved = get_note("test_notes", id);
|
|
print(`✓ Retrieved: ${retrieved.get_title()}`);
|
|
print(` Content: ${retrieved.get_content()}\n`);
|
|
|
|
// Query by tag
|
|
print("Querying notes by tag...");
|
|
let ids = query("test_notes", "tags:tag", "source=osiris-runner");
|
|
print("✓ Found notes:");
|
|
for id in ids {
|
|
print(` - ${id}`);
|
|
}
|
|
|
|
print("=== Test Complete ===");
|