Configuration Files
When using the SDK, you will notice that a couple of configuration files are being created:
1. Application Manifest (zeyos.app.json)
Describes the application's properties and represents the properties of all included assets
{
"identifier": "myapp",
"name": "My Application",
"version": 10000,
"vendor": "Company Name",
"resources": {
"logo": {
"mimetype": "image/png",
"public": 1
}
},
"services": {
"reminder": {
"type": "timing",
"schedule": 600,
"interval": 60
}
},
"weblets": {
"dashboard": {
"type": "popup_framed",
"width": 800,
"height": 600
}
}
}
2. The ZeyOS Sync File (sync.json)
The sync.json file is created whenever you are syncing an application with a ZeyOS instance.
The instance configuration stores the authentication information when executing zeysdk link <instanceid>. By using zeysdk use <instanceid> a user can switch between different instances.
Example:
{
"id": "instance-id",
"url": "platform-url",
"syncstates": {
"settings": {
"hash": "file-hash",
"lastmodified": "timestamp"
},
"defaultsettings": {
"hash": "file-hash",
"lastmodified": "timestamp"
},
"services": {},
"weblets": {},
"resources": {}
}
}
The sync configuration consists of two core sections:
1. Connection Settings
{
"id": "instance-id",
"url": "https://platform-url"
}
- Updated automatically when running
zeysdk link - Contains platform URL
- Manages instance connection details
2. Sync States
{
"syncstates": {
"settings": {
"hash": "file-hash",
"lastmodified": 1234567890
},
"resources": {},
"services": {},
"weblets": {}
}
}
- Tracks file states for settings, resources, services, and weblets
- Uses
lastmodifiedtimestamp andhashfor change detection - Manages synchronization between local and server files
Sync Scenarios
New Files (Empty States)
When lastmodified and hash are empty:
| Scenario | Action | Resolution Options |
|---|---|---|
| File doesn't exist on server | Auto-create | N/A |
| File exists on server | Conflict | • theirs: Use server version• mine: Use local version |
Existing Files (With States)
When lastmodified and hash exist:
| Scenario | Action | Resolution Options |
|---|---|---|
| File missing on server | Conflict | • theirs: Remove locally• mine: Create on server |
| States don't match | Conflict | • theirs: Use server version• mine: Use local version |
| States match | Auto-sync | Copy to server |
We highly recommend using the SDK's interface to edit those file and restrain from editing them directly.
However, in some cases you might want to automate certain tasks through additional scripts and task runners - in such cases it is certainly useful to have a better understanding about the underlying file structure and properties.
BE CAREFUL WHEN MANIPULATING THE SYNC STATES, YOU ARE PUTTING YOUR SYSTEM INTEGRITY AT RISK!