Zum Hauptinhalt springen
Markdown anzeigen

Add Asset

The add command creates a local asset file and registers it in zeyos.app.json.

Bash
zeysdk add <ASSET_PATH> [options]

Parameters

ParameterDescriptionRequiredExample
ASSET_PATHAsset path including class directory and filenameYesservices/my-service.ixml

Options

OptionDescription
--verboseShow detailed output
--name <name>Asset name
--type <type>Service or weblet type; required with non-interactive service/weblet usage
--view <view>Weblet view
--entity <entity>Entity for an entity-triggered service
--schedule <minutes>TIMING start time as an integer from 0 to 1439
--interval <minutes>TIMING interval as an integer of at least 1
--public <value>Resource public flag (0 or 1)
--url <url>Empty or an http:///https:// URL for a weblet or service
--accesskey <key>HTTP access key for REMOTECALL services
--width <pixels>Popup or embedded weblet width; non-negative integer
--height <pixels>Popup or embedded weblet height; non-negative integer
--svgpath <path>SVG path for an INTEGRATED, STANDALONE, or DETACHED icon
--color <hex>Three or six uppercase hex digits without #, such as FF0000
--langaliases <json>Language aliases as valid JSON text

Any metadata flag selects non-interactive mode. In that mode, services and weblets must include --type; type names are case-insensitive and stored in uppercase. With no metadata flags, the command prompts for applicable fields. Generic assets never prompt for metadata.

Supported Types

  • Services: TIMING, REMOTECALL, AFTER_CREATION, BEFORE_MODIFICATION, AFTER_MODIFICATION, AFTER_CREATION_MODIFICATION, BEFORE_DELETION, AFTER_DELETION
  • Weblets: INTEGRATED, STANDALONE, DETACHED, POPUP_FRAMED, POPUP_PLAIN, EMBEDDED_FRAMED, EMBEDDED_COLLAPSED, EMBEDDED_PLAIN

Entity-triggered services require --entity. TIMING services use --schedule and --interval; interactive mode asks for the schedule as HH:MM. Popup and embedded weblets use width and height. Integrated, standalone, and detached weblets use SVG path and color.

Behavior

  1. Validates the app, asset class, filename, and manifest key.
  2. Rejects absolute paths, traversal, symbolic-link path components, and an existing physical file.
  3. Creates missing parent directories and the local file. New .ixml files receive the default iXML template; other files start empty.
  4. Adds the manifest entry only after file creation succeeds. A later manifest failure removes the newly created file.

assets supports nested paths such as assets/images/logo.png; services, resources, and weblets use a single filename below their class directory.

Error Handling

ErrorDescriptionResolution
Invalid asset classUnsupported asset typeUse correct asset class
Missing app.jsonConfiguration file not foundInitialize app first
Duplicate assetManifest key or physical file already existsUse a different path or update
Unsafe filenameInvalid characters, traversal, absolute path, or symbolic linkKeep the path inside its asset directory
Missing type/entityRequired non-interactive metadata is absentSupply the required flag or use interactive mode
Invalid metadataValue fails type, range, URL, color, or JSON validationCorrect the supplied value

Notes

  • Asset paths start with services, resources, weblets, or assets.
  • MIME type is inferred from the filename.
  • Use zeysdk push or zeysdk sync to send the new asset to an instance
  • Run the command from the application root.

Examples

Bash
# Public resource
zeysdk add resources/logo.png --name "Company Logo" --public 1

# Daily service starting at 02:00
zeysdk add services/daily-backup.ixml \
--name "Daily Backup" --type TIMING --schedule 120 --interval 1440

# Entity hook
zeysdk add services/contact-hook.ixml \
--name "Contact Hook" --type AFTER_CREATION --entity contacts

# Popup weblet
zeysdk add weblets/customer-dashboard.ixml \
--name "Customer Dashboard" --type POPUP_FRAMED \
--width 800 --height 600 --view customers.index

# Integrated weblet with icon metadata
zeysdk add weblets/quick-note.ixml \
--name "Quick Note" --type INTEGRATED --view notes.index \
--color FF0000 --svgpath 'M5 5h90v90h-90z' \
--langaliases '{"de_DE":"Schnellnotiz"}'

# Nested generic asset (no metadata prompt)
zeysdk add assets/images/icons/favicon.ico