@helix3/helix-cli 0.1.13-helix3.145 → 0.1.13-helix3.146
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/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/dist/sceneImport/packageReader.js +90 -4
- package/dist/sceneImport/packageReader.js.map +1 -1
- package/dist/sceneImport/publish.d.ts +28 -0
- package/dist/sceneImport/publish.js +37 -2
- package/dist/sceneImport/publish.js.map +1 -1
- package/dist/sceneImport/vaultPin.d.ts +158 -0
- package/dist/sceneImport/vaultPin.js +550 -0
- package/dist/sceneImport/vaultPin.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3217,6 +3217,46 @@ sceneSource
|
|
|
3217
3217
|
fail(`✖ ${err instanceof Error ? err.message : String(err)}`);
|
|
3218
3218
|
}
|
|
3219
3219
|
});
|
|
3220
|
+
sceneSource
|
|
3221
|
+
.command('vault-pin')
|
|
3222
|
+
.description('Publish a compiled package\'s resources to the Vault and rewrite its Scene to pin them, so the published bundle is the Scene document alone')
|
|
3223
|
+
.argument('<package-dir>', 'compiled Scene v2 package directory (from compile-pack or compile)')
|
|
3224
|
+
.option('--kind <kind>', 'Vault kind for every resource (default: inferred per file extension)')
|
|
3225
|
+
.option('--license <license>', 'Vault license: helix_standard, cc0, cc_by, or all_rights_reserved (default: from the import receipt)')
|
|
3226
|
+
.option('--title-prefix <text>', 'prefix for each uploaded asset title')
|
|
3227
|
+
.option('--concurrency <n>', 'parallel uploads, 1-8', parsePositiveFloat)
|
|
3228
|
+
.option('--dry-run', 'report what would be uploaded without sending any bytes or touching the Scene', false)
|
|
3229
|
+
.action(async (packageDir, opts) => {
|
|
3230
|
+
try {
|
|
3231
|
+
const { pinScenePackageToVault } = await Promise.resolve().then(() => __importStar(require('./sceneImport/vaultPin')));
|
|
3232
|
+
const { isVaultAssetKind, isVaultAssetLicense, VAULT_ASSET_LICENSES } = await Promise.resolve().then(() => __importStar(require('./vaultPublish')));
|
|
3233
|
+
if (opts.kind !== undefined && !isVaultAssetKind(opts.kind)) {
|
|
3234
|
+
fail(`✖ --kind must be one of: ${lib_1.VAULT_ASSET_KINDS.join(', ')}`);
|
|
3235
|
+
}
|
|
3236
|
+
if (opts.license !== undefined && !isVaultAssetLicense(opts.license)) {
|
|
3237
|
+
fail(`✖ --license must be one of: ${VAULT_ASSET_LICENSES.join(', ')}`);
|
|
3238
|
+
}
|
|
3239
|
+
const creds = requireAuth();
|
|
3240
|
+
const result = await pinScenePackageToVault({
|
|
3241
|
+
packageDir: (0, node_path_1.resolve)(packageDir),
|
|
3242
|
+
api: lib_1.HelixApi.forCredentials(creds),
|
|
3243
|
+
apiUrl: creds.apiUrl,
|
|
3244
|
+
...(opts.kind !== undefined ? { kind: opts.kind } : {}),
|
|
3245
|
+
...(opts.license !== undefined
|
|
3246
|
+
? { license: opts.license }
|
|
3247
|
+
: {}),
|
|
3248
|
+
...(opts.titlePrefix !== undefined ? { titlePrefix: opts.titlePrefix } : {}),
|
|
3249
|
+
...(opts.concurrency !== undefined ? { concurrency: opts.concurrency } : {}),
|
|
3250
|
+
dryRun: opts.dryRun,
|
|
3251
|
+
// Progress goes to stderr so stdout stays one parseable JSON document.
|
|
3252
|
+
onProgress: (message) => process.stderr.write(`${message}\n`),
|
|
3253
|
+
});
|
|
3254
|
+
console.log(JSON.stringify(result, null, 2));
|
|
3255
|
+
}
|
|
3256
|
+
catch (err) {
|
|
3257
|
+
fail(err instanceof lib_1.ApiError ? err.render() : `✖ ${err instanceof Error ? err.message : String(err)}`);
|
|
3258
|
+
}
|
|
3259
|
+
});
|
|
3220
3260
|
sceneSource
|
|
3221
3261
|
.command('publish')
|
|
3222
3262
|
.description('Validate and dry-run the native Scene v2 World-build multipart request')
|
|
@@ -3266,6 +3306,8 @@ sceneSource
|
|
|
3266
3306
|
worldId: input.worldId,
|
|
3267
3307
|
profileId: input.profileId,
|
|
3268
3308
|
visibility: input.visibility,
|
|
3309
|
+
bundleResources: input.resources.length,
|
|
3310
|
+
vaultPinnedResources: input.vaultPins.length,
|
|
3269
3311
|
contentDelivery: 'public-content-addressed; --visibility gates World discovery only',
|
|
3270
3312
|
receipt,
|
|
3271
3313
|
}, null, 2));
|