@helix3/helix-cli 0.1.18-helix3.280 → 0.1.18-helix3.281
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/dist/addOnPackageVersion.d.ts +14 -0
- package/dist/addOnPackageVersion.js +40 -0
- package/dist/addOnPackageVersion.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
- package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
|
@@ -9,6 +9,20 @@ export type PublishAddOnPackageVersionOptions = {
|
|
|
9
9
|
notes?: string;
|
|
10
10
|
expectedCurrentVersionId?: string;
|
|
11
11
|
updateId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Update the add-on's fitment/hide-ops BEFORE sealing the new mesh into a
|
|
14
|
+
* Version, so the seal freezes the NEW contract rather than the old one —
|
|
15
|
+
* `AddOnPackagePublisher.publishNextVersion` reads `item.fits` and
|
|
16
|
+
* `item.properties.ops` off the item row at seal time (it does not take
|
|
17
|
+
* either from the seal request), so updating the row first is what makes
|
|
18
|
+
* either one land in the new Version at all.
|
|
19
|
+
*
|
|
20
|
+
* Validated with the exact same `validateAddOnContract` a brand-new
|
|
21
|
+
* `publish` runs, so a hide op this command would accept is never one
|
|
22
|
+
* `publish` would refuse on a fresh item, or the reverse.
|
|
23
|
+
*/
|
|
24
|
+
fits?: Record<string, unknown>;
|
|
25
|
+
ops?: Record<string, unknown>[];
|
|
12
26
|
/** Bounded wait for the uploaded mesh to clear verify/optimize and reach `ready`. */
|
|
13
27
|
assetReadyTimeoutMs?: number;
|
|
14
28
|
onProgress?: (message: string) => void;
|
|
@@ -47,6 +47,9 @@ async function publishAddOnPackageVersion(itemId, file, options, credentials) {
|
|
|
47
47
|
const api = api_1.HelixApi.forCredentials(credentials);
|
|
48
48
|
const filename = (0, node_path_1.basename)(file);
|
|
49
49
|
const mimeType = 'model/gltf-binary';
|
|
50
|
+
if (options.fits !== undefined || options.ops !== undefined) {
|
|
51
|
+
await updateFitsAndOps(api, itemId, options.fits, options.ops, progress);
|
|
52
|
+
}
|
|
50
53
|
progress('Requesting a presigned upload for the corrected mesh…');
|
|
51
54
|
const presign = await api.requestItem('POST', `/api/v1/universal-items/${itemId}/assets`, {
|
|
52
55
|
rendition: 'web',
|
|
@@ -75,6 +78,43 @@ async function publishAddOnPackageVersion(itemId, file, options, credentials) {
|
|
|
75
78
|
body.updateId = options.updateId;
|
|
76
79
|
return api.request('POST', `/api/v1/universal-items/${itemId}/add-on-package/versions`, body);
|
|
77
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Update this add-on's `fits` and/or `properties.ops` through the ordinary
|
|
83
|
+
* `PATCH :itemId` route, BEFORE the mesh upload + seal below — so the new
|
|
84
|
+
* Package Version freezes the contract this call just wrote.
|
|
85
|
+
*
|
|
86
|
+
* `PATCH`'s `properties` is a full replacement, not a merge (the backend's
|
|
87
|
+
* `preservePinnedVehiclePackageProperties` only special-cases a pinned
|
|
88
|
+
* vehicle artifact) — sending `{ properties: { ops } }` on its own would
|
|
89
|
+
* silently drop every other key the item's `properties` already carried.
|
|
90
|
+
* This always reads the item first and republishes its FULL current
|
|
91
|
+
* `properties` with only `ops` replaced, when `ops` is the field changing.
|
|
92
|
+
*
|
|
93
|
+
* Validated with the exact same `validateAddOnContract` a fresh `publish`
|
|
94
|
+
* enforces, checked against whichever of `fits`/`ops` the caller did NOT
|
|
95
|
+
* pass (the item's current value) — so a request that only changes ops is
|
|
96
|
+
* still checked against its real, current fitment, and vice versa.
|
|
97
|
+
*/
|
|
98
|
+
async function updateFitsAndOps(api, itemId, fits, ops, progress) {
|
|
99
|
+
progress('Reading the item to merge its fitment/ops update…');
|
|
100
|
+
const item = await api.requestItem('GET', `/api/v1/universal-items/${itemId}`);
|
|
101
|
+
if (item.kind !== 'add_on') {
|
|
102
|
+
throw new Error(`--fits/--ops apply to add-ons only; ${itemId} is kind "${item.kind}".`);
|
|
103
|
+
}
|
|
104
|
+
const nextFits = fits ?? item.fits ?? {};
|
|
105
|
+
const nextOps = ops ?? (Array.isArray(item.properties?.ops) ? item.properties.ops : []);
|
|
106
|
+
// The SAME validator a brand-new `publish` runs — a hide op this command
|
|
107
|
+
// accepts is never one `publish` would refuse on a fresh item.
|
|
108
|
+
(0, item_1.validateAddOnContract)(nextFits, nextOps);
|
|
109
|
+
const body = {};
|
|
110
|
+
if (fits !== undefined)
|
|
111
|
+
body.fits = nextFits;
|
|
112
|
+
if (ops !== undefined) {
|
|
113
|
+
body.properties = { ...(item.properties ?? {}), ops: nextOps };
|
|
114
|
+
}
|
|
115
|
+
progress('Updating fitment/ops before sealing the new mesh…');
|
|
116
|
+
await api.request('PATCH', `/api/v1/universal-items/${itemId}`, body);
|
|
117
|
+
}
|
|
78
118
|
async function waitForAssetReady(api, itemId, assetId, timeoutMs) {
|
|
79
119
|
const deadline = Date.now() + timeoutMs;
|
|
80
120
|
for (;;) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addOnPackageVersion.js","sourceRoot":"","sources":["../src/addOnPackageVersion.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"addOnPackageVersion.js","sourceRoot":"","sources":["../src/addOnPackageVersion.ts"],"names":[],"mappings":";;AAuFA,gEAgEC;AAvJD,+CAA4C;AAC5C,yCAAqC;AACrC,+BAAiD;AAEjD,iCAAmE;AAEnE,MAAM,OAAO,GAAG,iEAAiE,CAAC;AAClF,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,kDAAkD;AACpG,MAAM,8BAA8B,GAAG,OAAO,C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AC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1252,6 +1252,8 @@ item
|
|
|
1252
1252
|
.option('--notes <text>', 'optional creator-facing changelog note')
|
|
1253
1253
|
.option('--expected-current-version-id <uuid>', 'refuse if the item has moved off this Package Version since you last read it')
|
|
1254
1254
|
.option('--update-id <uuid>', 'idempotency key — retrying with the same id never double-publishes')
|
|
1255
|
+
.option('--fits <json|file>', 'update the { slotType, requires, only? } fitment BEFORE sealing this Version, so the new Version freezes it — same shape and validation as `publish`')
|
|
1256
|
+
.option('--ops <json|file>', 'update the hide/tune/mount/patch op array BEFORE sealing this Version — same shape and validation as `publish`; e.g. a new region-hide op')
|
|
1255
1257
|
.option('--json', 'machine-readable output')
|
|
1256
1258
|
.action(async (itemId, file, opts) => {
|
|
1257
1259
|
const creds = requireAuth();
|
|
@@ -1261,6 +1263,8 @@ item
|
|
|
1261
1263
|
notes: opts.notes,
|
|
1262
1264
|
expectedCurrentVersionId: opts.expectedCurrentVersionId,
|
|
1263
1265
|
updateId: opts.updateId,
|
|
1266
|
+
fits: opts.fits !== undefined ? (0, lib_1.parseJsonObjectOrFile)(opts.fits, '--fits') : undefined,
|
|
1267
|
+
ops: opts.ops !== undefined ? (0, lib_1.parseJsonArrayOrFile)(opts.ops, '--ops') : undefined,
|
|
1264
1268
|
onProgress: (message) => !opts.json && console.log(message),
|
|
1265
1269
|
}, creds);
|
|
1266
1270
|
if (opts.json) {
|