openvibers/openvibe.examples Commits
Examples: the scripts' hints and the mod-manifest README point at openvibe.services (where projects, apps and releases live now) (#5)
Changes
@@@ -114,7 +114,7 @@ function explain(err) {case 'config.missing': return err.message;case 'invalid_client': return 'Network refused the client id or secret. Check OV_CLIENT_ID / OV_CLIENT_SECRET (rotate the secret in your project if it was lost).';case 'invalid_target': return 'Network does not issue tokens for openvibe.media to this app (its environment is not enabled for that audience).';-- case 'invalid_scope': return 'The app holds no approved grant for this operation (media.object.upload to upload or delete, media.object.read to read). Request it on your app (openvibe.codes, or the projects API).';++ case 'invalid_scope': return 'The app holds no approved grant for this operation (media.object.upload to upload or delete, media.object.read to read). Request it on your app (openvibe.services, or the projects API).';case 'capability.namespace_denied': return 'Your token is not valid for this project. OV_PROJECT_ID must be the project your app belongs to (or leave it empty).';case 'token.sandbox_refused': return 'Media refused a sandbox token on this route. Sandbox apps can use their own project tenant only (/api/v1/<project id>/files).';default: return isOpenVibeError(err) ? `${err.code}${err.detail ? `: ${err.detail}` : ''}${err.requestId ? ` (request ${err.requestId})` : ''}` : String(err && err.message);@@@ -47,6 +47,6 @@ Validation is offline and works today: `node validate.js mod.json`. The `--regisPublishing a mod is not public yet: registering a mod and managing installs (`games.mod.manage`)is a `first-party` capability and install grants (`mods.grant.manage`) are `planned`. The--developer portal, [OpenVibe.Codes](https://openvibe.codes), is where manifests and releases are++developer platform, [OpenVibe.Services](https://openvibe.services), is where manifests and releases aremeant to be managed, but a mod still cannot reach Games through it. Mod ids are assigned by thatflow; `--new-id` only gives a draft a well-formed id.@@@ -108,7 +108,7 @@ async function main() {if (!template) template = process.stdin.isTTY && process.stdout.isTTY ? await ask() : 'web';const { target, name } = create(opts.dir, template);const rel = path.relative(process.cwd(), target) || '.';-- console.log(`\nCreated ${name} in ${rel} from the ${template} template.\n\nNext:\n cd ${rel}\n npm install\n cp .env.example .env # then fill in your app's values (never commit .env)\n npm test # the template's smoke test, no network needed\n npm start\n\nCreate a project and an app at https://openvibe.codes, and read https://openvibe.codes/docs.`);++ console.log(`\nCreated ${name} in ${rel} from the ${template} template.\n\nNext:\n cd ${rel}\n npm install\n cp .env.example .env # then fill in your app's values (never commit .env)\n npm test # the template's smoke test, no network needed\n npm start\n\nCreate a project and an app at https://openvibe.services, and read https://openvibe.services/docs.`);}if (require.main === module) main().catch((err) => { console.error(err.message); process.exit(1); });@@@ -8,7 +8,7 @@** The app must be a CONFIDENTIAL app of that project with the sandbox grants media.object.upload,* media.object.read, events.app.publish, events.app.read, tools.job.create and tools.job.read-- * (scripts/new-sandbox-app.js or https://openvibe.codes create one). Optional: OV_NETWORK_URL,++ * (scripts/new-sandbox-app.js or https://openvibe.services create one). Optional: OV_NETWORK_URL,* OV_TOOLS_JOBS_URL.** 1. media-uploader upload a small text file into the project's Media tenant, read its@@@ -2,7 +2,7 @@'use strict';/*** Create a project and a sandbox app for the examples with openvibe-sdk/projects, the same-- * /api/v1/projects API https://openvibe.codes uses. Nothing here needs staff: a new project is++ * /api/v1/projects API https://openvibe.services uses. Nothing here needs staff: a new project is* sandbox, and the project owner's grant requests inside the sandbox allowance are approved at once.** npm run new-app # new project + confidential sandbox app -> ./.env@@@ -86,7 +86,7 @@ async function main(argv = process.argv.slice(2)) {return 0;}const secret = (created.credential || app.credential || {}).client_secret || created.client_secret;-- if (!secret) throw new Error('Network returned no client secret; rotate one on the app (openvibe.codes)');++ if (!secret) throw new Error('Network returned no client secret; rotate one on the app (openvibe.services)');fs.writeFileSync(envFile, `OV_CLIENT_ID=${appId}\nOV_CLIENT_SECRET=${secret}\nOV_PROJECT_ID=${projectId}\n`, { mode: 0o600 });console.log(`\nwrote ${envFile} (OV_CLIENT_ID, OV_CLIENT_SECRET, OV_PROJECT_ID; mode 0600). Next: npm run e2e`);return 0;
@@ -114,7 +114,7 @@ function explain(err) {
@@ -114,7 +114,7 @@ function explain(err) {
case 'config.missing': return err.message;
case 'config.missing': return err.message;
case 'invalid_client': return 'Network refused the client id or secret. Check OV_CLIENT_ID / OV_CLIENT_SECRET (rotate the secret in your project if it was lost).';
case 'invalid_client': return 'Network refused the client id or secret. Check OV_CLIENT_ID / OV_CLIENT_SECRET (rotate the secret in your project if it was lost).';
case 'invalid_target': return 'Network does not issue tokens for openvibe.media to this app (its environment is not enabled for that audience).';
case 'invalid_target': return 'Network does not issue tokens for openvibe.media to this app (its environment is not enabled for that audience).';
- case 'invalid_scope': return 'The app holds no approved grant for this operation (media.object.upload to upload or delete, media.object.read to read). Request it on your app (openvibe.codes, or the projects API).';
+ case 'invalid_scope': return 'The app holds no approved grant for this operation (media.object.upload to upload or delete, media.object.read to read). Request it on your app (openvibe.services, or the projects API).';
case 'capability.namespace_denied': return 'Your token is not valid for this project. OV_PROJECT_ID must be the project your app belongs to (or leave it empty).';
case 'capability.namespace_denied': return 'Your token is not valid for this project. OV_PROJECT_ID must be the project your app belongs to (or leave it empty).';
case 'token.sandbox_refused': return 'Media refused a sandbox token on this route. Sandbox apps can use their own project tenant only (/api/v1/<project id>/files).';
case 'token.sandbox_refused': return 'Media refused a sandbox token on this route. Sandbox apps can use their own project tenant only (/api/v1/<project id>/files).';
default: return isOpenVibeError(err) ? `${err.code}${err.detail ? `: ${err.detail}` : ''}${err.requestId ? ` (request ${err.requestId})` : ''}` : String(err && err.message);
default: return isOpenVibeError(err) ? `${err.code}${err.detail ? `: ${err.detail}` : ''}${err.requestId ? ` (request ${err.requestId})` : ''}` : String(err && err.message);
@@ -47,6 +47,6 @@ Validation is offline and works today: `node validate.js mod.json`. The `--regis
@@ -47,6 +47,6 @@ Validation is offline and works today: `node validate.js mod.json`. The `--regis
Publishing a mod is not public yet: registering a mod and managing installs (`games.mod.manage`)
Publishing a mod is not public yet: registering a mod and managing installs (`games.mod.manage`)
is a `first-party` capability and install grants (`mods.grant.manage`) are `planned`. The
is a `first-party` capability and install grants (`mods.grant.manage`) are `planned`. The
-developer portal, [OpenVibe.Codes](https://openvibe.codes), is where manifests and releases are
+developer platform, [OpenVibe.Services](https://openvibe.services), is where manifests and releases are
meant to be managed, but a mod still cannot reach Games through it. Mod ids are assigned by that
meant to be managed, but a mod still cannot reach Games through it. Mod ids are assigned by that
flow; `--new-id` only gives a draft a well-formed id.
flow; `--new-id` only gives a draft a well-formed id.
@@ -108,7 +108,7 @@ async function main() {
@@ -108,7 +108,7 @@ async function main() {
if (!template) template = process.stdin.isTTY && process.stdout.isTTY ? await ask() : 'web';
if (!template) template = process.stdin.isTTY && process.stdout.isTTY ? await ask() : 'web';
const { target, name } = create(opts.dir, template);
const { target, name } = create(opts.dir, template);
const rel = path.relative(process.cwd(), target) || '.';
const rel = path.relative(process.cwd(), target) || '.';
- console.log(`\nCreated ${name} in ${rel} from the ${template} template.\n\nNext:\n cd ${rel}\n npm install\n cp .env.example .env # then fill in your app's values (never commit .env)\n npm test # the template's smoke test, no network needed\n npm start\n\nCreate a project and an app at https://openvibe.codes, and read https://openvibe.codes/docs.`);
+ console.log(`\nCreated ${name} in ${rel} from the ${template} template.\n\nNext:\n cd ${rel}\n npm install\n cp .env.example .env # then fill in your app's values (never commit .env)\n npm test # the template's smoke test, no network needed\n npm start\n\nCreate a project and an app at https://openvibe.services, and read https://openvibe.services/docs.`);
}
}
if (require.main === module) main().catch((err) => { console.error(err.message); process.exit(1); });
if (require.main === module) main().catch((err) => { console.error(err.message); process.exit(1); });
@@ -8,7 +8,7 @@
@@ -8,7 +8,7 @@
*
*
* The app must be a CONFIDENTIAL app of that project with the sandbox grants media.object.upload,
* The app must be a CONFIDENTIAL app of that project with the sandbox grants media.object.upload,
* media.object.read, events.app.publish, events.app.read, tools.job.create and tools.job.read
* media.object.read, events.app.publish, events.app.read, tools.job.create and tools.job.read
- * (scripts/new-sandbox-app.js or https://openvibe.codes create one). Optional: OV_NETWORK_URL,
+ * (scripts/new-sandbox-app.js or https://openvibe.services create one). Optional: OV_NETWORK_URL,
* OV_TOOLS_JOBS_URL.
* OV_TOOLS_JOBS_URL.
*
*
* 1. media-uploader upload a small text file into the project's Media tenant, read its
* 1. media-uploader upload a small text file into the project's Media tenant, read its
@@ -2,7 +2,7 @@
@@ -2,7 +2,7 @@
'use strict';
'use strict';
/**
/**
* Create a project and a sandbox app for the examples with openvibe-sdk/projects, the same
* Create a project and a sandbox app for the examples with openvibe-sdk/projects, the same
- * /api/v1/projects API https://openvibe.codes uses. Nothing here needs staff: a new project is
+ * /api/v1/projects API https://openvibe.services uses. Nothing here needs staff: a new project is
* sandbox, and the project owner's grant requests inside the sandbox allowance are approved at once.
* sandbox, and the project owner's grant requests inside the sandbox allowance are approved at once.
*
*
* npm run new-app # new project + confidential sandbox app -> ./.env
* npm run new-app # new project + confidential sandbox app -> ./.env
@@ -86,7 +86,7 @@ async function main(argv = process.argv.slice(2)) {
@@ -86,7 +86,7 @@ async function main(argv = process.argv.slice(2)) {
return 0;
return 0;
}
}
const secret = (created.credential || app.credential || {}).client_secret || created.client_secret;
const secret = (created.credential || app.credential || {}).client_secret || created.client_secret;
- if (!secret) throw new Error('Network returned no client secret; rotate one on the app (openvibe.codes)');
+ if (!secret) throw new Error('Network returned no client secret; rotate one on the app (openvibe.services)');
fs.writeFileSync(envFile, `OV_CLIENT_ID=${appId}\nOV_CLIENT_SECRET=${secret}\nOV_PROJECT_ID=${projectId}\n`, { mode: 0o600 });
fs.writeFileSync(envFile, `OV_CLIENT_ID=${appId}\nOV_CLIENT_SECRET=${secret}\nOV_PROJECT_ID=${projectId}\n`, { mode: 0o600 });
console.log(`\nwrote ${envFile} (OV_CLIENT_ID, OV_CLIENT_SECRET, OV_PROJECT_ID; mode 0600). Next: npm run e2e`);
console.log(`\nwrote ${envFile} (OV_CLIENT_ID, OV_CLIENT_SECRET, OV_PROJECT_ID; mode 0600). Next: npm run e2e`);
return 0;
return 0;