Package Resource Schemas
Section titled “Package Resource Schemas”The Package Format specifies the archive container. This page specifies what goes inside resources/{Type}/{normalizedName}.json — the payload shape per resource type, taken from the model classes that define them in the backend source. It is the piece a reader needs in order to transform or generate a package payload, and the piece that is otherwise only discoverable by reading an export. The packaging engine this contract belongs to shipped in the 1.8 line; on an older deployment these endpoints and the export UI are absent.
What this page covers — and what it does not
Section titled “What this page covers — and what it does not”This is a tiered reference, and it does not cover all seventeen exportable types. The six Tier-1 types below are what a typical module package is made of; documenting all seventeen at once would mean documenting the platform’s entire metadata model, and doing six precisely is more useful than doing seventeen shallowly.
| Type | Status |
|---|---|
DataModule | Documented below |
DataEntity | Documented below |
DataView | Documented below |
DataQuery | Documented below |
DataReaction | Documented below — top-level shape; the action tree at outline depth |
DataEntityAggregate | Documented below — new this cycle (Since 1.10) |
DataRelation, DataCollection, GenericView, SystemButton, StatisticQuery, Report, Function, CounterWidget, Announcement | Not documented. Export a package containing one and read the emitted JSON — the same procedure that verified this page. Two facts are verified: Since dev a Function’s value.secrets[] rows carry the secret key with a null value, and it has no identity and no OSOS_API_TOKEN row (Function secrets); and Since dev a GenericView (page) widget that points at a view outside the package is a mappable soft reference (Page widgets pointing outside the package). |
QuickFilterGroup, TagGroup (both Since 1.10) | Not documented. Only their import rules are verified: id and dataEntity are never written, normalizedName is the match identity, an update changes only name and queries (and never a tag group’s color). Their graph edges are in The dependency graph. |
Do not infer a Tier-2 shape from the six documented here; the types differ more than their names suggest.
Invariants across every packaged resource
Section titled “Invariants across every packaged resource”Six things hold for all of the types below, and knowing them first makes the per-type tables much shorter to read.
idis present and is the source-environment UUID. Every model extends anIdentifiedbase (services/data-service/src/models/identified.model.ts) that defaultsidto a UUID v4. The importer uses it to verify filename lookups and to key the id-remap table — a payload without it cannot be identity-checked.specificationVersionis the per-resource format version, distinct from the package’sschemaVersion. Every Tier-1 model declares it required with a default of1. A resource whose version a parser does not support produces anUNSUPPORTED_SPEC_VERSIONwarning at validation, not a hard failure.nameis a localized object, never a bare string — aLocalizedValueof the form{"en": …, "ar": …}.description, where present, is aNullableLocalizedValue. A generator emitting a plain string here produces a payload data-service will reject.normalizedNameis the stable machine identifier. It is validated against^[a-zA-Z_][a-zA-Z0-9_$]{2,127}$(3–128 characters,NormalizedNameValidationinpackages/osos-shared/src/utils/normalize-name.ts), and the platform’s own slugifier lowercases and replaces every other character with_. It is unique-indexed onDataModuleandDataEntity, but a plain validated string onDataView,DataQuery, andDataReaction. It is also not necessarily the resource’s filename in the ZIP — that isnameMap’s job (see the package format).- Enums serialize as numbers, not names.
type,state,visibility, and their kin are numeric enums (packages/osos-shared/src/models/enums.ts): a packaged entity carries"state": 1, never"state": "Active". - Server-managed keys are absent.
creationInfo,updateInfo,stateHistory,updateIdentifier,version,createdAt,updatedAt,createdBy,updatedBy,spaceId,space,_id,_resolved, and__vare deleted at export and stripped again by the import parsers (SERVER_MANAGED_KEYS,services/packaging-service/src/resource-parsers/parser-utils.ts). The per-type tables below still list the ones each model declares — marked stripped — so that a reader diffing a payload against the model source is not surprised by the gap.
One filtering rule bears repeating from the export pipeline because it shapes what can appear in a package at all: archived entities (with their nested subtrees), user-scoped resources (any resource whose relatedTo.user carries a dataEntry), implicit DataEntity without implicitOptions.allowEdit, and implicit DataReaction are never exported (isNonExportableResource, services/packaging-service/src/libs/resource-utils.ts).
DataModule
Section titled “DataModule”The smallest Tier-1 shape (services/data-service/src/models/data-module/data-module.model.ts) — a module is a named, iconed container whose membership is expressed by its children pointing at it.
| Property | Type | Notes |
|---|---|---|
specificationVersion | 1 | Required; literal 1. |
normalizedName | string | Required, unique-indexed, pattern-validated. |
name | LocalizedValue | Required. |
description | NullableLocalizedValue | Optional, nullable. |
icon | Icon | Required. |
isImplicit | boolean | Required. |
sharing | ApplicationSharing | Required — the sharing level. |
creationInfo, updateInfo | ActionInfo | Declared on the model; stripped from packages. |
Note what is absent: there is no entities array. Membership runs the other way — each DataEntity carries a module property pointing at its module. This is why exporting a module withChildren consults the dependency graph’s membership edges rather than reading anything off the module document itself.
DataEntity
Section titled “DataEntity”The most consequential Tier-1 shape, and the largest: 40 declared properties (services/data-service/src/models/data-entity/data-entity.model.ts).
Two of them are misspelled in the product, and the misspellings are load-bearing: the property extentions (the model carries a TODO rename and fix typo comment beside it) and the type DataEntityFromSettings — From, not Form, even though its source file is named data-entity-form-settings.model.ts. Emit them exactly as the product spells them; a correctly spelled extensions key is simply ignored.
| Property | Type | Notes |
|---|---|---|
specificationVersion | number | Required; default 1. |
name | LocalizedValue | Required. |
description | NullableLocalizedValue | Optional. |
normalizedName | string | Required, unique-indexed, pattern-validated. |
version | number | Entity schema revision; stripped from packages. |
isImplicit | boolean | Required. |
virtual | DataEntityVirtualOptions | Optional — present on virtual entities and aggregators. |
implicitOptions | DataEntityIsImplicitOptions | Optional. allowEdit decides whether an implicit entity is exportable at all. |
type | DataEntityTypeEnum | Required, numeric (Custom = 0, ADT = 1, Service = 2, …). |
typeOptions | TypeOptions | VirtualProxyEntityOptions | AggregatorVirtualEntityOptions | Optional; open-typed. |
icon | Icon | Required. |
archiveInfo | ActionInfo | Optional. |
state | DataEntityStateEnum | Numeric: Draft = 0, Active = 1, Archived = 2. Archived entities are never packaged, so expect 0 or 1. |
stateHistory | StateHistory[] | Stripped from packages. |
creationInfo, updateInfo | ActionInfo | Stripped from packages. |
internalEntities | InternalEntity[] | Default []. Nested entity definitions, each with its own fields. |
internalCollections | InternalCollection[] | Default []. |
fields | DataEntityField[] | Default [] — in practice the bulk of every real payload. Each field carries a type discriminator and a type-specific options object; the catalogue is documented in Field Types and not reproduced here. |
validation | string | null | Optional entity-level validation expression. |
tags | string[] | Default []. |
workflows | DataEntityWorkflow[] | Default []. |
meta | ServiceMeta | Record<string, any> | Optional, open-ended. |
module | UUID | Required — the membership edge to the owning DataModule. |
displayOption | DataEntityDisplayOptionEnum | Optional numeric enum; default KeyValue. |
formSettings | DataEntityFromSettings | Optional. The misspelled type name. |
deletedFields | DataEntityDeletedFields[] | Optional. |
breakingFields | DataEntityBreakingFields[] | Declared, but listed in the model’s hiddenProperties — never serialized, so never packaged. |
extentions | DataEntityExtensions | Optional. The misspelled property name. |
entryNames | DataEntityEntryNames | Optional. |
discussions | DataEntityDiscussions | Optional. |
templates | DataEntityExportTemplate[] | Optional — export/print templates. |
treeStructure | DataEntityTreeStructureConfig | Optional. |
indexes | DataEntityIndex[] | Default []. |
dataSources | DataEntityFieldSources[] | Optional. |
storeRules | StoreRule[] | Optional. Shared stores (type === 2) are additionally snapshotted into the package’s store-references.json. |
sharing | ApplicationSharing | Optional on this model (required on DataModule and DataView). |
updateIdentifier | string | Optimistic-concurrency token; stripped from packages. |
displayTemplate | EntityDisplayTemplate | null | Optional. |
scriptAttributes | object | Optional, nullable, open-ended. |
Since 1.10 — a VirtualProxy entity’s typeOptions.sources[*].sourceViewId is a new hard dependency edge to its bound kind: Proxy DataView; on the read side (not the packaged payload) the response-only proxyCapabilities enrichment joins forbiddenOnWrite alongside typeDetails/moduleDetails. See Proxy view governance in Virtual Entities.
DataView
Section titled “DataView”46 declared properties — the widest Tier-1 shape. The class is named DataViews (plural) in services/data-service/src/models/data-view/data-views.model.ts, which is worth knowing because searching the backend for class DataView finds nothing. (A related misspelling lives nearby: data-view-exceptions.ts declares DataViewExcpetion — not part of the payload, but you will meet it reading the view code paths.)
Grouped by role:
Identity and placement — specificationVersion (required, default 1), name (required), normalizedName (validated, not unique-indexed), description, icon (optional here, unlike entity/module), dataEntity (required — the entity the view reads), module (optional), displayOrder (default 0), domain (NullableReferenceProperty).
Source — dataSource (DataEntrySource, required), sourceOptions, sourceEntitiesMapping (default []), relations (ViewRelation[], default [] — relation composites inside are remapped at import), and fields (string[], required with at least one item — the projected field set).
Access — isPublic (deprecated in the model’s own schema), anonymous (AnonymousViewOption | null), authenticated (AuthenticatedViewOption | null), isPublished (default false), isPinned (default false), sharing (ApplicationSharing, required), qrCode (default {enabled: false}).
Configuration — the three required blocks that carry most of a real payload: viewConfiguration (DisplayViewConfiguration), editConfiguration (EditDataViewConfiguration), entriesConfiguration (EntriesDataViewConfiguration); plus the optional dashboardConfiguration, sideBarConfig, displayConfig, actionButtonsConfig, systemButtons (default []), systemButtonsOrder (deprecated in favour of ordering within systemButtons), screenOrder, defaultViewTemplate, redirectionRules (default []), help, and the open-ended uiAttributes / scriptAttributes.
Behaviour toggles — showArchivedEntries (default false), showInvalidEntries, allowObsoleteFilter (default false), allowInvalidRequirementsFilter (default false).
Aggregates enabled on the view Since 1.10 — viewConfiguration.aggregates is a string[] of DataEntityAggregate ids: the aggregates this view displays. Import filters the array to non-empty strings, and an id that cannot be remapped — because the aggregate was not included in the package, or was deleted before the export — is dropped rather than treated as an error. The view simply ends up showing one aggregate fewer, which is the same outcome as deleting the aggregate directly. The type this array points at is documented below.
Derived and server-managed — executionPlan is explicitly deleted at export and re-derived by the target: a generated package that includes one is at best ignored. isImplicit (default false) and implicitType (numeric, default NONE) mark platform-generated views — and because data-service spawns implicit views asynchronously after an entity is created, the import pipeline has env-tunable settle/poll timings (PKG_IMPLICIT_SETTLE_MS, PKG_IMPLICIT_POLL_ATTEMPTS, PKG_IMPLICIT_POLL_DELAY_MS in services/packaging-service/src/services/package-import.service.ts) to wait for them. creationInfo, updateInfo, and updateIdentifier are declared but stripped from packages.
Client-owned keys and packageLabels Since 1.10
Section titled “Client-owned keys and packageLabels Since 1.10”An installed view is locked by its package, except for a short list of keys the client may change and an update keeps (CLIENT_KEYS in services/packaging-service/src/libs/update-carry-over.ts): isPublished, displayOrder, authenticated, anonymous and permissions (the access-right rows the view read joins in). The content hash leaves them out, so a client changing one is not an edit of the package — and a package must not rely on shipping them: an update lays the client’s values back over the incoming resource.
packageLabels ({name?, description?, icon?}) records what the package shipped for a label the client renamed on an installed view or page. It is stored on the document and excluded from the hash, but it is never accepted from an ordinary caller — data-service drops it from every create, and from an update unless the caller is exempt from the installed-resource guard — so a generated package should not emit it. How a client reads and changes those labels is on Data views.
DataQuery
Section titled “DataQuery”services/data-service/src/models/data-query/data-query.model.ts:
| Property | Type | Notes |
|---|---|---|
specificationVersion | number | Required; default 1. |
name | LocalizedValue | Required. |
normalizedName | string | Pattern-validated; not required, not unique-indexed. |
description | NullableLocalizedValue | Optional. |
dataEntity | UUID | Required — the entity queried. |
dataSource | DataEntrySource | Optional. |
visibility | VisibilityEnum | Required, numeric: Organization = 0, Private = 1, Public = 2. |
criteria | FilterExpression | Required — the recursive expression tree. See below. |
relatedTo | DataQueryRelatedTo | Optional, nullable. A query whose relatedTo.user carries a dataEntry is user-scoped and therefore never exported. |
renderedCriteria | string | Marked deprecated in the model schema. A derived rendering of criteria; if you edit one, keep the other consistent — or omit it. |
isImplicit | boolean | Default false. |
useInQuickFilter | boolean | Default false — whether the query is offered as a quick filter. |
creationInfo, updateInfo | ActionInfo | Stripped from packages. |
tag | DataQueryTag | null | Optional. |
updateIdentifier | string | Stripped from packages. |
parameters | DataQueryParameter[] | Optional. |
isParameterized | boolean | Optional. |
The single most useful fact here for a generator: criteria is the very same FilterExpression class the HTTP API accepts as the criteria member of filterCriteria — data-service’s criteria-filter schema imports it from models/data-query/filter-expression.model.ts (customJsonSchema/filter-criteria-json-schema.ts). The operator vocabulary is documented with the v2/v3 filter dialect, and a criteria tree can be validated against the live criteria-parser endpoint before being written into a package — the only pre-import validation available for any fragment of a resource payload.
DataReaction
Section titled “DataReaction”The reaction model lives in a different service from its four siblings: services/reaction-service/src/models/data-reaction/data-reaction.model.ts.
| Property | Type | Notes |
|---|---|---|
specificationVersion | number | Required; default 1. |
normalizedName | string | Optional, pattern-validated. |
definingEntity | ReferenceProperty | Required — the owning entity, as {dataEntity, dataEntry}. Drives the hard membership edge. At import the parser strips it from the write body (the parent travels in the URL path), but keep it in the payload: validation and the dependency graph read it. |
eventType | EventTypeEnum | Required, numeric. |
executorType | CollectionValueModel<EventExecutorTypeEnum> | Optional. |
query | ReferenceProperty | null | Optional — a soft edge to a DataQuery. |
criteria | FilterExpression | Optional — the same expression model as DataQuery.criteria. |
eventConfig | DataReactionEventConfig | Optional, open-typed. Outline depth — see below. |
actions | DataReactionAction[] | Required. Outline depth — see below. |
isImplicit | boolean | Default false. Implicit reactions are never exported. |
disabled | boolean | Default false. |
name | LocalizedValue | Required. |
spaceScope | DataReactionSpaceScope | Required. |
loopThreshold | number | Optional; default 0 (execute the trigger loop once). |
relatedEntities | DataReactionRelatedEntities[] | Optional, nullable. |
sourceEntity | DataReactionSourceEntity | null | Optional. For relation-scoped reactions, sourceEntity.sourceId is a relation composite — entityId:fieldId[:relatedEntityId] — which packaging parses and remaps as a unit (libs/relation-composite.ts); it is a resource identifier, not an entry UUID. |
type | DataReactionTriggerTypeEnum | Required, numeric; default 0. |
updateIdentifier | string | Stripped from packages. |
validations | DataReactionValidation | null | Optional. |
creationInfo, updateInfo | ActionInfo | Stripped from packages. |
actions and eventConfig are deliberately left at outline depth: a reaction is an event-condition-action tree whose action vocabulary is broad and extensible, and a shallow table would mislead more than it helps. Use Reactions & Automation for what the actions do, and a real export for their serialized shape. One import-time behaviour is worth knowing when generating: the reaction parser keeps id in the create body on purpose — the platform honours a client-supplied reaction id because self-referencing tokens inside action configs are pre-rewritten against the planned target id (services/packaging-service/src/resource-parsers/data-reaction.parser.ts).
DataEntityAggregate Since 1.10
Section titled “DataEntityAggregate Since 1.10”The newest packageable type — the resource behind the Aggregator list on an entity: a named (field, aggregationFunction) pair the platform computes server-side over that entity’s entries. Its model is services/data-service/src/models/data-entity-aggregate/data-entity-aggregate.model.ts, and it travels as resources/DataEntityAggregate/{normalizedName}.json. For what an aggregate is and how a view enables one, see Entity Aggregates & Entry Grouping.
| Property | Type | Notes |
|---|---|---|
specificationVersion | number | Required; default 1. |
dataEntity | UUID | Required — the owning entity. Structurally immutable (see below). |
normalizedName | string | Required, pattern-validated. The cross-environment identity key. |
name | NullableLocalizedValue | Optional — the backend deliberately permits an unnamed aggregate. |
field | string | Required — the fullNormalizedName of the aggregated field. |
aggregationFunction | AggregationFunctionEnum | Required, numeric. |
sensitiveDataAccessPolicy | SensitiveDataAccessPolicyEnum | Optional; absent means the default (privileged) policy. |
id | UUID | Server-generated at both ends, and forbidden on write (forbiddenOnWrite = ['id'] in resource-parsers/data-entity-aggregate.parser.ts). |
Note what is missing relative to every other type on this page: this model declares no creationInfo / updateInfo at all, so there is nothing for the server-managed strip to remove.
Identity across environments is normalizedName, not id. The importer keys an aggregate DataEntityAggregate::{entityId}::{normalizedName} — the owning entity is part of the key, because a normalizedName is only unique within its entity.
It is an entity child, and that is tracked separately from being entity-scoped. Entity-scoping decides how validation matches an incoming aggregate against the target: by normalizedName within the target entity, not space-wide. Being an entity child is what drives the “patch the existing child rather than create a new one” decision. Both matter: if an aggregate that already exists under the target entity took the create path, the uniqueness guard on normalizedName inside that entity would reject it and the resource would fail the import.
dataEntity is structurally immutable on an override — a payload override cannot repoint an aggregate at a different entity. normalizedName deliberately is not immutable: renaming an aggregate through an override is a supported action.
Its dependency-graph edges — a hard one from the entity, a deliberately soft one from each view that enabled it — are documented in The dependency graph.
Model truth versus packaged truth
Section titled “Model truth versus packaged truth”The tables above are the declared model properties, read from the source classes named in each section, with the export-side stripping rules (SERVER_MANAGED_KEYS, executionPlan, collection items) verified in package-export.service.ts and parser-utils.ts. They have not been diffed field-by-field against every possible emitted archive, and model defaults tell you what data-service will fill in, not what every historical export contains. When a payload you are transforming disagrees with a table here, trust the payload for reading and the model for writing — and report the difference. For the nine Tier-2 types, export a real specimen; do not extrapolate.
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27