diff --git a/pkg/sdk_client.js b/pkg/sdk_client.js index ccd68bc..07fdd2d 100644 --- a/pkg/sdk_client.js +++ b/pkg/sdk_client.js @@ -34,147 +34,147 @@ function get_device(id) { return { success: true, data: { id, name: "stub_device", description: "stub_description" } }; } -export function list_devices() { +function list_devices() { console.log("list_devices called"); return { success: true, data: [{ id: "stub_device_1", name: "stub_device_1" }] }; } -export function delete_device(id) { +function delete_device(id) { console.log("delete_device called with id:", id); return { success: true, data: null }; } -export function create_process(device_id, name, description) { +function create_process(device_id, name, description) { console.log("create_process called"); return { success: true, data: { id: "stub_process_id_flate2", name, description } }; } -export function get_process(id) { +function get_process(id) { console.log("get_process called with id:", id); return { success: true, data: { id, name: "stub_process", description: "stub_description" } }; } -export function list_processes() { +function list_processes() { console.log("list_processes called"); return { success: true, data: [{ id: "stub_process_1", name: "stub_process_1" }] }; } -export function delete_process(id) { +function delete_process(id) { console.log("delete_process called with id:", id); return { success: true, data: null }; } -export function create_member(process_id, name, public_key) { +function create_member(process_id, name, public_key) { console.log("create_member called"); return { success: true, data: { id: "stub_member_id_flate2", name, public_key } }; } -export function get_member(id) { +function get_member(id) { console.log("get_member called with id:", id); return { success: true, data: { id, name: "stub_member", public_key: "stub_key" } }; } -export function list_members(process_id) { +function list_members(process_id) { console.log("list_members called"); return { success: true, data: [{ id: "stub_member_1", name: "stub_member_1" }] }; } -export function delete_member(id) { +function delete_member(id) { console.log("delete_member called with id:", id); return { success: true, data: null }; } -export function create_role(process_id, name, description) { +function create_role(process_id, name, description) { console.log("create_role called"); return { success: true, data: { id: "stub_role_id_flate2", name, description } }; } -export function get_role(id) { +function get_role(id) { console.log("get_role called with id:", id); return { success: true, data: { id, name: "stub_role", description: "stub_description" } }; } -export function list_roles(process_id) { +function list_roles(process_id) { console.log("list_roles called"); return { success: true, data: [{ id: "stub_role_1", name: "stub_role_1" }] }; } -export function delete_role(id) { +function delete_role(id) { console.log("delete_role called with id:", id); return { success: true, data: null }; } -export function assign_member_to_role(member_id, role_id) { +function assign_member_to_role(member_id, role_id) { console.log("assign_member_to_role called"); return { success: true, data: null }; } -export function remove_member_from_role(member_id, role_id) { +function remove_member_from_role(member_id, role_id) { console.log("remove_member_from_role called"); return { success: true, data: null }; } -export function create_validation_rule(role_id, field_name, rule_type, parameters) { +function create_validation_rule(role_id, field_name, rule_type, parameters) { console.log("create_validation_rule called"); return { success: true, data: { id: "stub_rule_id_flate2", field_name, rule_type } }; } -export function get_validation_rule(id) { +function get_validation_rule(id) { console.log("get_validation_rule called with id:", id); return { success: true, data: { id, field_name: "stub_field", rule_type: "stub_type" } }; } -export function list_validation_rules(role_id) { +function list_validation_rules(role_id) { console.log("list_validation_rules called"); return { success: true, data: [{ id: "stub_rule_1", field_name: "stub_field_1" }] }; } -export function delete_validation_rule(id) { +function delete_validation_rule(id) { console.log("delete_validation_rule called with id:", id); return { success: true, data: null }; } -export function create_commitment(process_id, data) { +function create_commitment(process_id, data) { console.log("create_commitment called"); return { success: true, data: { id: "stub_commitment_id_flate2", hash: "stub_hash" } }; } -export function get_commitment(id) { +function get_commitment(id) { console.log("get_commitment called with id:", id); return { success: true, data: { id, hash: "stub_hash", data: "stub_data" } }; } -export function list_commitments(process_id) { +function list_commitments(process_id) { console.log("list_commitments called"); return { success: true, data: [{ id: "stub_commitment_1", hash: "stub_hash_1" }] }; } -export function delete_commitment(id) { +function delete_commitment(id) { console.log("delete_commitment called with id:", id); return { success: true, data: null }; } -export function create_signature(commitment_id, private_key) { +function create_signature(commitment_id, private_key) { console.log("create_signature called"); return { success: true, data: { id: "stub_signature_id_flate2", signature: "stub_signature" } }; } -export function verify_signature(commitment_id, signature, public_key) { +function verify_signature(commitment_id, signature, public_key) { console.log("verify_signature called"); return { success: true, data: { valid: true } }; } -export function list_signatures(commitment_id) { +function list_signatures(commitment_id) { console.log("list_signatures called"); return { success: true, data: [{ id: "stub_signature_1", signature: "stub_signature_1" }] }; } -export function delete_signature(id) { +function delete_signature(id) { console.log("delete_signature called with id:", id); return { success: true, data: null }; } -export function compress_data(data) { +function compress_data(data) { console.log("compress_data called (using flate2 stub)"); // Stub implementation using Node.js zlib (equivalent to flate2) return deflateAsync(Buffer.from(data)).then(compressed => ({ @@ -183,7 +183,7 @@ export function compress_data(data) { })); } -export function decompress_data(compressed_data) { +function decompress_data(compressed_data) { console.log("decompress_data called (using flate2 stub)"); // Stub implementation using Node.js zlib (equivalent to flate2) return inflateAsync(Buffer.from(compressed_data, 'base64')).then(decompressed => ({ @@ -192,67 +192,67 @@ export function decompress_data(compressed_data) { })); } -export function create_handshake_message(device_id, message_type, data) { +function create_handshake_message(device_id, message_type, data) { console.log("create_handshake_message called"); return { success: true, data: { id: "stub_handshake_id_flate2", message_type, data } }; } -export function verify_handshake_message(message, public_key) { +function verify_handshake_message(message, public_key) { console.log("verify_handshake_message called"); return { success: true, data: { valid: true } }; } -export function create_encrypted_message(data, public_key) { +function create_encrypted_message(data, public_key) { console.log("create_encrypted_message called"); return { success: true, data: { encrypted: "stub_encrypted_data_flate2" } }; } -export function decrypt_message(encrypted_data, private_key) { +function decrypt_message(encrypted_data, private_key) { console.log("decrypt_message called"); return { success: true, data: { decrypted: "stub_decrypted_data_flate2" } }; } -export function create_hash(data) { +function create_hash(data) { console.log("create_hash called"); return { success: true, data: { hash: "stub_hash_flate2" } }; } -export function verify_hash(data, hash) { +function verify_hash(data, hash) { console.log("verify_hash called"); return { success: true, data: { valid: true } }; } -export function create_random_bytes(length) { +function create_random_bytes(length) { console.log("create_random_bytes called"); return { success: true, data: { bytes: "stub_random_bytes_flate2" } }; } -export function create_uuid() { +function create_uuid() { console.log("create_uuid called"); return { success: true, data: { uuid: "stub-uuid-flate2" } }; } -export function get_timestamp() { +function get_timestamp() { console.log("get_timestamp called"); return { success: true, data: { timestamp: Date.now() } }; } -export function validate_input(input, validation_rules) { +function validate_input(input, validation_rules) { console.log("validate_input called"); return { success: true, data: { valid: true, errors: [] } }; } -export function format_output(output, format_type) { +function format_output(output, format_type) { console.log("format_output called"); return { success: true, data: { formatted: "stub_formatted_output_flate2" } }; } -export function log_message(level, message) { +function log_message(level, message) { console.log(`[${level}] ${message} (flate2 stub)`); return { success: true, data: null }; } -export function get_version() { +function get_version() { console.log("get_version called"); return { success: true, data: { version: "0.1.4-flate2-stub" } }; }