@topolo/cli 0.1.20 → 0.1.21
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 +4 -82
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4201,18 +4201,6 @@ function scaffoldFiles(options) {
|
|
|
4201
4201
|
content: serviceManifestJson(application, {
|
|
4202
4202
|
tenancy: options.payload.tenancy
|
|
4203
4203
|
})
|
|
4204
|
-
},
|
|
4205
|
-
{
|
|
4206
|
-
path: `PlatformApplications/TopoloAuth/scripts/add-topolo-${slug}-service-production.sql`,
|
|
4207
|
-
purpose: "Auth service catalog registration for embedded first-party login, launcher visibility, and callback origins.",
|
|
4208
|
-
requiredSignals: [
|
|
4209
|
-
"services.id matches the generated Worker service id",
|
|
4210
|
-
"settings.launcher.category is first_party so embedded password login is allowed",
|
|
4211
|
-
"base_url and auth_domain define the production callback origin"
|
|
4212
|
-
],
|
|
4213
|
-
content: serviceRegistrationSql(application, {
|
|
4214
|
-
tenancy: options.payload.tenancy
|
|
4215
|
-
})
|
|
4216
4204
|
}
|
|
4217
4205
|
);
|
|
4218
4206
|
}
|
|
@@ -4455,6 +4443,7 @@ function topoloPackageVersion(packageName, target) {
|
|
|
4455
4443
|
}
|
|
4456
4444
|
function readme(application, target, options) {
|
|
4457
4445
|
const displayName = toTitle(application.name);
|
|
4446
|
+
const slug = toSlug(application.id);
|
|
4458
4447
|
const targetLabel = target === "platform" ? options.portfolio === "personal" ? "first-party Topolo personal application" : "first-party Topolo platform application" : options.audience === "personal" ? "third-party Topolo personal application" : "third-party Topolo business application";
|
|
4459
4448
|
const lines = [
|
|
4460
4449
|
`# ${displayName}`,
|
|
@@ -4502,7 +4491,7 @@ function readme(application, target, options) {
|
|
|
4502
4491
|
"",
|
|
4503
4492
|
"## Platform Registration",
|
|
4504
4493
|
"",
|
|
4505
|
-
|
|
4494
|
+
`This scaffold includes CloudControl metadata, TopoloDocs system coverage, and a Topolo app conformance workflow. Run \`topolo platform apps scaffold ${slug} --write --provision\` with an authenticated platform-admin session to register the app through Topolo Developers and project the service into Auth.`
|
|
4506
4495
|
);
|
|
4507
4496
|
} else {
|
|
4508
4497
|
lines.push(
|
|
@@ -5609,7 +5598,6 @@ function internalDocs(application, options) {
|
|
|
5609
5598
|
...options.api ? [`- \`PlatformApplications/${application.appDir}/src/worker.ts\``] : [],
|
|
5610
5599
|
`- \`PlatformApplications/${application.appDir}/topolo.cloudcontrol.json\``,
|
|
5611
5600
|
...options.api && application.serviceId ? [`- \`PlatformApplications/TopoloAuth/catalog/service-manifests/${application.serviceId}.json\``] : [],
|
|
5612
|
-
...options.api && application.serviceId ? [`- \`PlatformApplications/TopoloAuth/scripts/add-topolo-${slug}-service-production.sql\``] : [],
|
|
5613
5601
|
"",
|
|
5614
5602
|
"## API Reference",
|
|
5615
5603
|
"",
|
|
@@ -5629,7 +5617,7 @@ function internalDocs(application, options) {
|
|
|
5629
5617
|
"",
|
|
5630
5618
|
"## Failure Modes",
|
|
5631
5619
|
"",
|
|
5632
|
-
"-
|
|
5620
|
+
"- Developers provisioning drifts from the generated Worker `SERVICE_ID`.",
|
|
5633
5621
|
"- CloudControl metadata does not match the eventual Cloudflare project or route.",
|
|
5634
5622
|
"- linked Topolo packages resolve a second React runtime and the browser shell renders blank instead of mounting the shared surfaces.",
|
|
5635
5623
|
`- ${boundaryFailureText}`,
|
|
@@ -5640,7 +5628,7 @@ function internalDocs(application, options) {
|
|
|
5640
5628
|
"- run `topolo apps audit <app> --local --repo-root /Users/ashes/Projects/topolo --fail-on needs_review --json` after SDK catalog registration",
|
|
5641
5629
|
"- inspect `topolo.cloudcontrol.json` before deployment changes",
|
|
5642
5630
|
...options.api && application.serviceId ? [`- inspect \`PlatformApplications/TopoloAuth/catalog/service-manifests/${application.serviceId}.json\` when permission grants fail`] : [],
|
|
5643
|
-
...options.api && application.serviceId ? [`-
|
|
5631
|
+
...options.api && application.serviceId ? [`- re-run \`topolo platform apps scaffold ${slug} --write --provision\` when embedded app login, launcher visibility, or callback origins drift`] : [],
|
|
5644
5632
|
"",
|
|
5645
5633
|
"## Change Log / Verification",
|
|
5646
5634
|
"",
|
|
@@ -5784,62 +5772,6 @@ function serviceManifestJson(application, options) {
|
|
|
5784
5772
|
})}
|
|
5785
5773
|
`;
|
|
5786
5774
|
}
|
|
5787
|
-
function serviceRegistrationSql(application, options) {
|
|
5788
|
-
const slug = toSlug(application.id);
|
|
5789
|
-
const title = toTitle(application.name);
|
|
5790
|
-
const serviceId = application.serviceId ?? application.id;
|
|
5791
|
-
const productionUrl = application.productionUrl ?? `https://${slug}.topolo.app`;
|
|
5792
|
-
const authDomain = hostnameFromUrl(productionUrl);
|
|
5793
|
-
const surface = options.tenancy === "household" ? "personal-workspace" : "workspace";
|
|
5794
|
-
const settings = JSON.stringify({
|
|
5795
|
-
app_slug: `topolo-${slug}`,
|
|
5796
|
-
surface,
|
|
5797
|
-
auth_domain: authDomain,
|
|
5798
|
-
launcher: {
|
|
5799
|
-
category: "first_party",
|
|
5800
|
-
app_id: slug
|
|
5801
|
-
}
|
|
5802
|
-
});
|
|
5803
|
-
return [
|
|
5804
|
-
`-- Register ${title} in the Topolo Auth service catalog.`,
|
|
5805
|
-
"-- Safe to rerun.",
|
|
5806
|
-
"",
|
|
5807
|
-
"INSERT INTO services (",
|
|
5808
|
-
" id,",
|
|
5809
|
-
" name,",
|
|
5810
|
-
" description,",
|
|
5811
|
-
" base_url,",
|
|
5812
|
-
" version,",
|
|
5813
|
-
" status,",
|
|
5814
|
-
" settings,",
|
|
5815
|
-
" created_at,",
|
|
5816
|
-
" updated_at,",
|
|
5817
|
-
" show_in_app_switcher",
|
|
5818
|
-
")",
|
|
5819
|
-
"VALUES (",
|
|
5820
|
-
` '${sqlString(serviceId)}',`,
|
|
5821
|
-
` '${sqlString(title)}',`,
|
|
5822
|
-
` 'First-party ${sqlString(title)} ${sqlString(surface)} application.',`,
|
|
5823
|
-
` '${sqlString(productionUrl)}',`,
|
|
5824
|
-
" '1.0.0',",
|
|
5825
|
-
" 'active',",
|
|
5826
|
-
` '${sqlString(settings)}',`,
|
|
5827
|
-
" strftime('%s', 'now'),",
|
|
5828
|
-
" strftime('%s', 'now'),",
|
|
5829
|
-
" 1",
|
|
5830
|
-
")",
|
|
5831
|
-
"ON CONFLICT(id) DO UPDATE SET",
|
|
5832
|
-
" name = excluded.name,",
|
|
5833
|
-
" description = excluded.description,",
|
|
5834
|
-
" base_url = excluded.base_url,",
|
|
5835
|
-
" version = excluded.version,",
|
|
5836
|
-
" status = excluded.status,",
|
|
5837
|
-
" settings = excluded.settings,",
|
|
5838
|
-
" updated_at = strftime('%s', 'now'),",
|
|
5839
|
-
" show_in_app_switcher = excluded.show_in_app_switcher;",
|
|
5840
|
-
""
|
|
5841
|
-
].join("\n");
|
|
5842
|
-
}
|
|
5843
5775
|
function developerManifest(application, options) {
|
|
5844
5776
|
return `${json({
|
|
5845
5777
|
schema: "https://topolo.app/schemas/topolo-app-manifest.v1.json",
|
|
@@ -5963,13 +5895,6 @@ function toTitle(value) {
|
|
|
5963
5895
|
function json(value) {
|
|
5964
5896
|
return JSON.stringify(value, null, 2);
|
|
5965
5897
|
}
|
|
5966
|
-
function hostnameFromUrl(value) {
|
|
5967
|
-
try {
|
|
5968
|
-
return new URL(value).hostname;
|
|
5969
|
-
} catch {
|
|
5970
|
-
return value.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
5971
|
-
}
|
|
5972
|
-
}
|
|
5973
5898
|
async function pathExists(path4) {
|
|
5974
5899
|
try {
|
|
5975
5900
|
await access(path4, constants.F_OK);
|
|
@@ -5992,9 +5917,6 @@ function escapeHtml(value) {
|
|
|
5992
5917
|
function escapeSingleQuoted(value) {
|
|
5993
5918
|
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
5994
5919
|
}
|
|
5995
|
-
function sqlString(value) {
|
|
5996
|
-
return value.replace(/'/g, "''");
|
|
5997
|
-
}
|
|
5998
5920
|
function escapeDoubleQuoted(value) {
|
|
5999
5921
|
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
6000
5922
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|