Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .changeset/spec-cloud-provided-package-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"@objectstack/spec": minor
---

`CLOUD_PROVIDED_OBJECT_NAMES` (`@objectstack/spec/system`) gains a member:
`sys_package_version`. `isPlatformProvidedObjectName('sys_package_version')` now
returns `true`, so a reference to that name resolves instead of being flagged as
a platform-prefixed name nothing registers (#16745).

This widens an accept set. The name was previously refused, the list is a closed
set, and nothing in the published header enumerated this member — so the ladder
now accepts a value it used to warn on, and the widening reaches every surface
that consults the predicate: a dataset `object`, an action parameter
`reference`, a dashboard `optionsFrom.object` and a navigation `requiresObject`
naming `sys_package_version` all stop being diagnosed.

Why this name and not another: the list already carried `sys_package` and
`sys_package_installation` — the head and tail of the three-table package family
that `cloud/package.zod.ts` declares — but not the release-snapshot table
between them, whose row schema this repository ships as
`cloud/package-version.zod.ts`. Platform metadata that ships with the product
references it: `sys_metadata.package_version_id` in `@objectstack/metadata-core`
is a `Field.lookup('sys_package_version', …)`.

One entry is added; no other member moves and nothing is removed or narrowed.
The cloud-side half of the contract — that `@objectstack/service-tenant`
registers the table — is owned by the cloud repository per the list's header and
is not asserted from here.
17 changes: 17 additions & 0 deletions packages/spec/src/system/constants/platform-object-names.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,21 @@ describe('platform-object predicates', () => {
expect(isPlatformProvidedObjectName('sys_license')).toBe(true);
expect(CLOUD_PROVIDED_OBJECT_NAMES).toContain('sys_license');
});

it('resolves the middle table of the cloud package family', () => {
// `sys_package` and `sys_package_installation` were registered; the
// release-snapshot table between them was not, although this repo declares
// its row schema (`cloud/package-version.zod.ts`) and ships a platform
// object that looks it up (`sys_metadata.package_version_id` in
// `@objectstack/metadata-core`). While it was absent the object-reference
// ladder classed that shipped lookup target as a platform-prefixed name
// nothing registers. Pinned by name, beside `sys_license`, for the same
// reason. The other half of the contract — that the cloud runtime really
// registers the table — is owned by the cloud repository, per the list's
// header, and is not asserted here.
for (const name of ['sys_package', 'sys_package_version', 'sys_package_installation']) {
expect(isPlatformProvidedObjectName(name), name).toBe(true);
expect(CLOUD_PROVIDED_OBJECT_NAMES, name).toContain(name);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export const CLOUD_PROVIDED_OBJECT_NAMES: readonly string[] = [
'sys_license',
'sys_package',
'sys_package_installation',
'sys_package_version',
];

/**
Expand Down
Loading