Files
rspade_system/storage-broken/rsx-build/js-model-stubs/file-attachment-model.js
root 9ebcc359ae Fix code quality violations and enhance ROUTE-EXISTS-01 rule
Implement JQHTML function cache ID system and fix bundle compilation
Implement underscore prefix for system tables
Fix JS syntax linter to support decorators and grant exception to Task system
SPA: Update planning docs and wishlists with remaining features
SPA: Document Navigation API abandonment and future enhancements
Implement SPA browser integration with History API (Phase 1)
Convert contacts view page to SPA action
Convert clients pages to SPA actions and document conversion procedure
SPA: Merge GET parameters and update documentation
Implement SPA route URL generation in JavaScript and PHP
Implement SPA bootstrap controller architecture
Add SPA routing manual page (rsx:man spa)
Add SPA routing documentation to CLAUDE.md
Phase 4 Complete: Client-side SPA routing implementation
Update get_routes() consumers for unified route structure
Complete SPA Phase 3: PHP-side route type detection and is_spa flag
Restore unified routes structure and Manifest_Query class
Refactor route indexing and add SPA infrastructure
Phase 3 Complete: SPA route registration in manifest
Implement SPA Phase 2: Extract router code and test decorators
Rename Jqhtml_Component to Component and complete SPA foundation setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 17:48:15 +00:00

185 lines
5.4 KiB
JavaScript
Executable File

/**
* Auto-generated JavaScript stub for File_Attachment_Model
* DO NOT EDIT - This file is automatically regenerated
*/
class File_Attachment_Model extends Rsx_Js_Model {
static get name() {
return 'File_Attachment_Model';
}
static FILE_TYPE_IMAGE = 1;
static FILE_TYPE_ANIMATED_IMAGE = 2;
static FILE_TYPE_VIDEO = 3;
static FILE_TYPE_ARCHIVE = 4;
static FILE_TYPE_TEXT = 5;
static FILE_TYPE_DOCUMENT = 6;
static FILE_TYPE_OTHER = 7;
static file_type_id_enum_val() {
const data = {};
const order = [];
data[1] = {"constant":"FILE_TYPE_IMAGE","label":"Image"};
order.push(1);
data[2] = {"constant":"FILE_TYPE_ANIMATED_IMAGE","label":"Animated Image"};
order.push(2);
data[3] = {"constant":"FILE_TYPE_VIDEO","label":"Video"};
order.push(3);
data[4] = {"constant":"FILE_TYPE_ARCHIVE","label":"Archive"};
order.push(4);
data[5] = {"constant":"FILE_TYPE_TEXT","label":"Text"};
order.push(5);
data[6] = {"constant":"FILE_TYPE_DOCUMENT","label":"Document"};
order.push(6);
data[7] = {"constant":"FILE_TYPE_OTHER","label":"Other"};
order.push(7);
// Return Proxy that maintains sort order for enumeration
return new Proxy(data, {
ownKeys() {
return order.map(String);
},
getOwnPropertyDescriptor(target, prop) {
if (prop in target) {
return {
enumerable: true,
configurable: true,
value: target[prop]
};
}
}
});
}
static file_type_id_label_list() {
const values = {};
values[1] = 'Image';
values[2] = 'Animated Image';
values[3] = 'Video';
values[4] = 'Archive';
values[5] = 'Text';
values[6] = 'Document';
values[7] = 'Other';
return values;
}
static file_type_id_enum_select() {
const fullData = this.file_type_id_enum_val();
const data = {};
const order = [];
// Extract labels from full data, respecting selectable flag
for (const key in fullData) {
const item = fullData[key];
if (item.selectable !== false && item.label) {
data[key] = item.label;
order.push(parseInt(key));
}
}
// Return Proxy that maintains sort order for enumeration
return new Proxy(data, {
ownKeys() {
return order.map(String);
},
getOwnPropertyDescriptor(target, prop) {
if (prop in target) {
return {
enumerable: true,
configurable: true,
value: target[prop]
};
}
}
});
}
/**
* Fetch file_storage relationship
* @returns {Promise} Related model instance(s) or false
*/
async file_storage() {
if (!this.id) {
shouldnt_happen('Cannot fetch relationship without id property');
}
const response = await $.ajax({
url: `/_fetch_rel/File_Attachment_Model/${this.id}/file_storage`,
method: 'POST',
dataType: 'json'
});
if (!response) return false;
// Convert response to model instance(s)
// Framework handles instantiation based on relationship type
return response;
}
/**
* Fetch site relationship
* @returns {Promise} Related model instance(s) or false
*/
async site() {
if (!this.id) {
shouldnt_happen('Cannot fetch relationship without id property');
}
const response = await $.ajax({
url: `/_fetch_rel/File_Attachment_Model/${this.id}/site`,
method: 'POST',
dataType: 'json'
});
if (!response) return false;
// Convert response to model instance(s)
// Framework handles instantiation based on relationship type
return response;
}
/**
* Fetch fileable relationship
* @returns {Promise} Related model instance(s) or false
*/
async fileable() {
if (!this.id) {
shouldnt_happen('Cannot fetch relationship without id property');
}
const response = await $.ajax({
url: `/_fetch_rel/File_Attachment_Model/${this.id}/fileable`,
method: 'POST',
dataType: 'json'
});
if (!response) return false;
// Convert response to model instance(s)
// Framework handles instantiation based on relationship type
return response;
}
/**
* Fetch search_indexes relationship
* @returns {Promise} Related model instance(s) or false
*/
async search_indexes() {
if (!this.id) {
shouldnt_happen('Cannot fetch relationship without id property');
}
const response = await $.ajax({
url: `/_fetch_rel/File_Attachment_Model/${this.id}/search_indexes`,
method: 'POST',
dataType: 'json'
});
if (!response) return false;
// Convert response to model instance(s)
// Framework handles instantiation based on relationship type
return response;
}
}