@happyvertical/smrt-assets 0.54.2 → 0.54.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -142,3 +142,25 @@ private links, caller-supplied version history, and native multipart uploads.
142
142
  They preserve request identity and failed-action metadata without deriving
143
143
  public storage URLs. See [the attachment contract](agents/attachments.md) for
144
144
  public types, native payloads, recovery, and server responsibilities.
145
+
146
+ ### Polymorphic junction collection types
147
+
148
+ `AssetAssociationCollection` extends `SmrtJunctionBase`, sharing `byRight`,
149
+ ordering, positioning, and registration guards with ordinary junctions. Its
150
+ `byLeft`, `attach`, `detach`, and `setLinks` methods still require both `metaType`
151
+ and `metaId`; they do not implement the single-owner `SmrtJunction` contract.
152
+ Use `instanceof SmrtJunctionBase` when recognizing either kind of junction.
153
+ Asset associations no longer satisfy `instanceof SmrtJunction`.
154
+
155
+ After building the workspace, `node scripts/verify-packed-junction-types.mjs`
156
+ checks actual core/assets tarballs in the standard Bundler mode with
157
+ `skipLibCheck: false`, inherited result types, and negative owner-argument tests.
158
+ Full NodeNext declaration portability is tracked separately in #3524.
159
+
160
+ The consumer fixture installs declared dependencies in a temporary directory
161
+ with no ancestor `node_modules`; it never links producer dependencies. It retains
162
+ the project’s public registry routing without copying credentials. Set
163
+ `SMRT_PACKED_EVIDENCE_DIR` to retain tarballs and the consumer lockfile. For an
164
+ explicitly separate upstream-candidate proof, `SMRT_PACKED_OVERRIDES` may name
165
+ a JSON file of pnpm overrides; such a proof does not establish that the normal
166
+ published dependency graph passes.
@@ -1,26 +1,20 @@
1
1
  /**
2
2
  * AssetAssociationCollection - Polymorphic junction collection.
3
3
  *
4
- * Extends `SmrtJunction` with one critical difference: the "left" side of the
5
- * join is a composite key (`metaType` + `metaId`), not a single column. As a
6
- * result, `byLeft` / `attach` / `detach` / `setLinks` diverge from the base
7
- * signatures by taking both halves of the polymorphic owner key.
8
- *
9
- * - `leftField` is set to `'metaId'` as a placeholder to satisfy the
10
- * `SmrtJunction` contract; the overridden methods never use it.
11
- * - `byRight(assetId)` is inherited unchanged from the base — the right side
12
- * is a single column (`assetId`) and behaves like any other junction.
4
+ * Extends `SmrtJunctionBase`: the left side is a mandatory composite key
5
+ * (`metaType` + `metaId`). Owner methods retain both required arguments without
6
+ * pretending to implement the single-owner `SmrtJunction` contract.
7
+ * `byRight(assetId)` and junction registration/positioning are inherited.
13
8
  *
14
9
  * For non-polymorphic links between two domain models, prefer a dedicated
15
10
  * noun-table junction (e.g. `content_assets`, `place_assets`) extending
16
11
  * `SmrtJunction` directly. Use `AssetAssociation` only for generic/provenance
17
12
  * relationships that aren't worth a dedicated table.
18
13
  */
19
- import { type JunctionAttachOptions, type JunctionFilterOptions, SmrtJunction } from '@happyvertical/smrt-core';
14
+ import { type JunctionAttachOptions, type JunctionFilterOptions, SmrtJunctionBase } from '@happyvertical/smrt-core';
20
15
  import { AssetAssociation } from './asset-association';
21
- export declare class AssetAssociationCollection extends SmrtJunction<AssetAssociation> {
16
+ export declare class AssetAssociationCollection extends SmrtJunctionBase<AssetAssociation> {
22
17
  static readonly _itemClass: typeof AssetAssociation;
23
- protected leftField: string;
24
18
  protected rightField: string;
25
19
  /**
26
20
  * List associations for a polymorphic owner.
@@ -1 +1 @@
1
- {"version":3,"file":"asset-associations.d.ts","sourceRoot":"","sources":["../src/asset-associations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAG1B,YAAY,EAEb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAuBvD,qBACa,0BAA2B,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IAC5E,MAAM,CAAC,QAAQ,CAAC,UAAU,0BAAoB;IAK9C,SAAS,CAAC,SAAS,SAAY;IAC/B,SAAS,CAAC,UAAU,SAAa;IAEjC;;;;OAIG;IAEG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