@topolo/sdk 0.5.0 → 0.7.0
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 +3 -3
- package/dist/index.cjs +27 -24
- package/dist/index.d.cts +20 -20
- package/dist/index.d.ts +20 -20
- package/dist/index.js +26 -23
- package/dist/node/credential-store.cjs +471 -0
- package/dist/node/credential-store.d.cts +108 -0
- package/dist/node/credential-store.d.ts +108 -0
- package/dist/node/credential-store.js +427 -0
- package/package.json +7 -2
- package/src/application-requirements.ts +13 -13
- package/src/client.test.ts +7 -7
- package/src/client.ts +10 -10
- package/src/index.ts +2 -2
- package/src/node/credential-store.ts +378 -0
- package/src/oauth.ts +2 -2
- package/src/services.generated.ts +2 -2
- package/src/services.test.ts +15 -15
- package/src/services.ts +17 -17
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ services and actions become usable without an SDK, CLI, or MCP release.
|
|
|
96
96
|
|
|
97
97
|
`APPLICATIONS` describes every Topolo platform application discovered from the
|
|
98
98
|
PlatformApplications metadata, including Worker apps that do not expose a
|
|
99
|
-
callable
|
|
99
|
+
callable app API. `DEFAULT_APP_URLS` is the bundled callable API service
|
|
100
100
|
snapshot generated from `topolo.cloudcontrol.json`.
|
|
101
101
|
|
|
102
102
|
For agent-scale fleets, the bundle is packaging metadata, not an authorization
|
|
@@ -104,7 +104,7 @@ source. `TopoloClient.listServices()` always calls the live TopoloAuth catalog
|
|
|
104
104
|
with the current credential and returns only services that credential can use in
|
|
105
105
|
its organization, including the granted permissions. `TopoloClient.request()`
|
|
106
106
|
uses that credential-scoped catalog before routing any non-Auth service, so a
|
|
107
|
-
bundled
|
|
107
|
+
bundled app ID is only a convenient alias after Auth confirms access.
|
|
108
108
|
|
|
109
109
|
`listBundledServices()` is available for packaging/audit tooling that needs the
|
|
110
110
|
generated snapshot. Do not use it to decide what an end user or agent may call.
|
|
@@ -143,7 +143,7 @@ import { createTopoloWidgetResponse } from '@topolo/sdk';
|
|
|
143
143
|
|
|
144
144
|
return Response.json(createTopoloWidgetResponse({
|
|
145
145
|
appId: '<runtime-app-id>',
|
|
146
|
-
|
|
146
|
+
appName: 'Example',
|
|
147
147
|
widgets: [
|
|
148
148
|
{
|
|
149
149
|
type: 'stats',
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
APPLICATION_REQUIREMENTS: () => APPLICATION_REQUIREMENTS,
|
|
25
25
|
APPLICATION_REQUIREMENTS_VERSION: () => APPLICATION_REQUIREMENTS_VERSION,
|
|
26
26
|
CrmModule: () => CrmModule,
|
|
27
|
-
|
|
27
|
+
DEFAULT_APP_URLS: () => DEFAULT_APP_URLS,
|
|
28
28
|
IdentityModule: () => IdentityModule,
|
|
29
29
|
P2PModule: () => P2PModule,
|
|
30
30
|
TOPOLO_WIDGET_ENDPOINT: () => TOPOLO_WIDGET_ENDPOINT,
|
|
@@ -112,7 +112,7 @@ var TopoloHttpError = class extends TopoloSdkError {
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
// src/services.generated.ts
|
|
115
|
-
var
|
|
115
|
+
var APP_API_URLS = {
|
|
116
116
|
agent: "https://agent.topolo.app",
|
|
117
117
|
auth: "https://auth.topolo.app",
|
|
118
118
|
backup: "https://backup.topolo.app",
|
|
@@ -1703,12 +1703,12 @@ var APPLICATION_REQUIREMENTS = [
|
|
|
1703
1703
|
{
|
|
1704
1704
|
id: "shared-auth-boundary",
|
|
1705
1705
|
title: "Use the shared Topolo auth boundary",
|
|
1706
|
-
summary: "Applications must derive identity, organization, scopes, and
|
|
1706
|
+
summary: "Applications must derive identity, organization, scopes, and app entitlement from TopoloAuth rather than inventing parallel auth state.",
|
|
1707
1707
|
appliesTo: ["browser", "api", "tooling", "agent_surface"],
|
|
1708
1708
|
evidence: [
|
|
1709
1709
|
"@topolo/auth-client or @topolo-io/worker-runtime is used where applicable",
|
|
1710
1710
|
"No public command, tool, or SDK method accepts orgId",
|
|
1711
|
-
"
|
|
1711
|
+
"App slug and Auth app registration are documented for protected APIs"
|
|
1712
1712
|
],
|
|
1713
1713
|
implementation: [
|
|
1714
1714
|
"Use shared auth/runtime packages instead of copying token parsing, gateway, or browser storage flows",
|
|
@@ -1741,20 +1741,20 @@ var APPLICATION_REQUIREMENTS = [
|
|
|
1741
1741
|
]
|
|
1742
1742
|
},
|
|
1743
1743
|
{
|
|
1744
|
-
id: "
|
|
1745
|
-
title: "Register protected APIs as platform
|
|
1746
|
-
summary: "Callable app APIs need a stable
|
|
1744
|
+
id: "app-registration-and-scopes",
|
|
1745
|
+
title: "Register protected APIs as platform apps",
|
|
1746
|
+
summary: "Callable app APIs need a stable app ID, app slug, permissions, role bundles, and API-key scopes before agents or users rely on them.",
|
|
1747
1747
|
appliesTo: ["api"],
|
|
1748
1748
|
evidence: [
|
|
1749
|
-
"Auth
|
|
1750
|
-
"Permissions, role bundles, and API-key scopes exist for the
|
|
1751
|
-
"SDK, CLI, and MCP
|
|
1752
|
-
"CloudControl production HTTP targets classify agent reachability with
|
|
1749
|
+
"Auth app catalog contains the app ID and slug",
|
|
1750
|
+
"Permissions, role bundles, and API-key scopes exist for the app",
|
|
1751
|
+
"SDK, CLI, and MCP app discovery include the callable production API",
|
|
1752
|
+
"CloudControl production HTTP targets classify agent reachability with sdk_app_id or agent_callable:false"
|
|
1753
1753
|
],
|
|
1754
1754
|
implementation: [
|
|
1755
|
-
"Add production Worker api_url metadata and
|
|
1755
|
+
"Add production Worker api_url metadata and sdk_app_id for every agent-callable API target",
|
|
1756
1756
|
"Mark browser, documentation, and runtime-only Worker targets with agent_callable:false",
|
|
1757
|
-
"Expose stable
|
|
1757
|
+
"Expose stable app IDs through generated DEFAULT_APP_URLS and live catalog discovery",
|
|
1758
1758
|
"Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes"
|
|
1759
1759
|
]
|
|
1760
1760
|
},
|
|
@@ -1960,7 +1960,7 @@ function evaluateRequirement(application, requirement) {
|
|
|
1960
1960
|
"Catalog metadata cannot verify shared shell, launcher, and account menu adoption.",
|
|
1961
1961
|
evidence
|
|
1962
1962
|
);
|
|
1963
|
-
case "
|
|
1963
|
+
case "app-registration-and-scopes": {
|
|
1964
1964
|
if (application.services.length > 0) {
|
|
1965
1965
|
evidence.push(`services=${application.services.join(",")}`);
|
|
1966
1966
|
return finding(
|
|
@@ -1970,7 +1970,7 @@ function evaluateRequirement(application, requirement) {
|
|
|
1970
1970
|
evidence
|
|
1971
1971
|
);
|
|
1972
1972
|
}
|
|
1973
|
-
return finding(requirement, "missing", "No SDK
|
|
1973
|
+
return finding(requirement, "missing", "No SDK app API id is registered for this callable API surface.", evidence);
|
|
1974
1974
|
}
|
|
1975
1975
|
case "organization-scoped-data":
|
|
1976
1976
|
return finding(
|
|
@@ -2057,7 +2057,7 @@ function statusRank(status) {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
|
|
2059
2059
|
// src/services.ts
|
|
2060
|
-
var
|
|
2060
|
+
var DEFAULT_APP_URLS = APP_API_URLS;
|
|
2061
2061
|
function resolveCatalogServiceUrl(entry, options = {}) {
|
|
2062
2062
|
const keys = catalogServiceKeyCandidates(entry, options.serviceKey);
|
|
2063
2063
|
const override = resolveServiceUrlOverride(keys, options.overrides);
|
|
@@ -2069,7 +2069,7 @@ function resolveCatalogServiceUrl(entry, options = {}) {
|
|
|
2069
2069
|
function resolveServiceUrl(service, overrides) {
|
|
2070
2070
|
const override = resolveServiceUrlOverride([service], overrides);
|
|
2071
2071
|
if (override) return override;
|
|
2072
|
-
return
|
|
2072
|
+
return DEFAULT_APP_URLS[service];
|
|
2073
2073
|
}
|
|
2074
2074
|
function catalogServiceKeyCandidates(entry, preferred) {
|
|
2075
2075
|
const values = [preferred, entry.slug, entry.name, entry.appId].filter(
|
|
@@ -2100,7 +2100,7 @@ function resolveServiceUrlOverride(keys, overrides) {
|
|
|
2100
2100
|
if (envStyle) return envStyle;
|
|
2101
2101
|
}
|
|
2102
2102
|
for (const key of keys) {
|
|
2103
|
-
const envKey = `
|
|
2103
|
+
const envKey = `TOPOLO_APP_URL_${key.replace(/\./g, "_").toUpperCase()}`;
|
|
2104
2104
|
const envValue = typeof process !== "undefined" ? process.env?.[envKey] : void 0;
|
|
2105
2105
|
if (envValue) return envValue;
|
|
2106
2106
|
}
|
|
@@ -2287,7 +2287,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2287
2287
|
const derived = deriveDevelopersFromAuth(resolveConfiguredServiceUrl("auth", this.serviceUrls));
|
|
2288
2288
|
if (derived) return { serviceKey, baseUrl: derived };
|
|
2289
2289
|
}
|
|
2290
|
-
return { serviceKey, baseUrl:
|
|
2290
|
+
return { serviceKey, baseUrl: DEFAULT_APP_URLS[serviceKey] };
|
|
2291
2291
|
}
|
|
2292
2292
|
const live = await this.resolveLiveCallableService(serviceKey);
|
|
2293
2293
|
if (live) {
|
|
@@ -2296,7 +2296,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2296
2296
|
}
|
|
2297
2297
|
throw new TopoloSdkError(
|
|
2298
2298
|
"unknown_service",
|
|
2299
|
-
`Unknown Topolo
|
|
2299
|
+
`Unknown Topolo app API "${service}". Run app discovery first and pass a callable app id or slug.`
|
|
2300
2300
|
);
|
|
2301
2301
|
}
|
|
2302
2302
|
async resolveLiveCallableService(serviceKey) {
|
|
@@ -2469,7 +2469,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2469
2469
|
async callAction(action, input = {}, options = {}) {
|
|
2470
2470
|
const entry = await this.getAction(action);
|
|
2471
2471
|
const mapped = mapActionInput(entry, input);
|
|
2472
|
-
const service = entry.
|
|
2472
|
+
const service = entry.appSlug || entry.appId;
|
|
2473
2473
|
return this.request({
|
|
2474
2474
|
service,
|
|
2475
2475
|
method: entry.method,
|
|
@@ -2657,8 +2657,8 @@ function normalizeActionCatalogEntry(item) {
|
|
|
2657
2657
|
title: pickActionString(a.title) ?? name,
|
|
2658
2658
|
description: pickActionString(a.description) ?? "",
|
|
2659
2659
|
appId,
|
|
2660
|
-
|
|
2661
|
-
|
|
2660
|
+
appSlug: pickActionString(a.app_slug) ?? pickActionString(a.appSlug) ?? null,
|
|
2661
|
+
appName: pickActionString(a.app_name) ?? pickActionString(a.appName) ?? null,
|
|
2662
2662
|
method,
|
|
2663
2663
|
path,
|
|
2664
2664
|
permissionName: pickActionString(a.permission_name) ?? pickActionString(a.permissionName) ?? "",
|
|
@@ -2775,6 +2775,7 @@ var CrmModule = class {
|
|
|
2775
2775
|
constructor(client) {
|
|
2776
2776
|
this.client = client;
|
|
2777
2777
|
}
|
|
2778
|
+
client;
|
|
2778
2779
|
async listContacts(options = {}) {
|
|
2779
2780
|
const res = await this.client.request({
|
|
2780
2781
|
service: "crm",
|
|
@@ -2822,6 +2823,7 @@ var IdentityModule = class {
|
|
|
2822
2823
|
constructor(client) {
|
|
2823
2824
|
this.client = client;
|
|
2824
2825
|
}
|
|
2826
|
+
client;
|
|
2825
2827
|
/** Returns the resolved user, organization, and permission set for the
|
|
2826
2828
|
* current credential. Equivalent to `TopoloClient.introspect()` — exposed
|
|
2827
2829
|
* on this module for symmetry with the other domain modules. */
|
|
@@ -2835,6 +2837,7 @@ var P2PModule = class {
|
|
|
2835
2837
|
constructor(client) {
|
|
2836
2838
|
this.client = client;
|
|
2837
2839
|
}
|
|
2840
|
+
client;
|
|
2838
2841
|
// Directory ----------------------------------------------------------------
|
|
2839
2842
|
async listDirectory(options = {}) {
|
|
2840
2843
|
const res = await this.client.request({
|
|
@@ -3296,7 +3299,7 @@ function createTopolo(options) {
|
|
|
3296
3299
|
APPLICATION_REQUIREMENTS,
|
|
3297
3300
|
APPLICATION_REQUIREMENTS_VERSION,
|
|
3298
3301
|
CrmModule,
|
|
3299
|
-
|
|
3302
|
+
DEFAULT_APP_URLS,
|
|
3300
3303
|
IdentityModule,
|
|
3301
3304
|
P2PModule,
|
|
3302
3305
|
TOPOLO_WIDGET_ENDPOINT,
|
package/dist/index.d.cts
CHANGED
|
@@ -134,8 +134,8 @@ interface TopoloActionCatalogEntry {
|
|
|
134
134
|
title: string;
|
|
135
135
|
description: string;
|
|
136
136
|
appId: string;
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
appSlug: string | null;
|
|
138
|
+
appName: string | null;
|
|
139
139
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
140
140
|
path: string;
|
|
141
141
|
permissionName: string;
|
|
@@ -252,7 +252,7 @@ interface CredentialIntrospection {
|
|
|
252
252
|
} | null;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
declare const
|
|
255
|
+
declare const APP_API_URLS: {
|
|
256
256
|
readonly agent: "https://agent.topolo.app";
|
|
257
257
|
readonly auth: "https://auth.topolo.app";
|
|
258
258
|
readonly backup: "https://backup.topolo.app";
|
|
@@ -301,7 +301,7 @@ declare const SERVICES: {
|
|
|
301
301
|
readonly voice: "https://voice.topolo.app";
|
|
302
302
|
readonly web: "https://web.topolo.app";
|
|
303
303
|
};
|
|
304
|
-
type
|
|
304
|
+
type AppApiId = keyof typeof APP_API_URLS;
|
|
305
305
|
|
|
306
306
|
declare const APPLICATIONS: {
|
|
307
307
|
readonly admin: {
|
|
@@ -1492,9 +1492,9 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
|
|
|
1492
1492
|
}, {
|
|
1493
1493
|
readonly id: "shared-auth-boundary";
|
|
1494
1494
|
readonly title: "Use the shared Topolo auth boundary";
|
|
1495
|
-
readonly summary: "Applications must derive identity, organization, scopes, and
|
|
1495
|
+
readonly summary: "Applications must derive identity, organization, scopes, and app entitlement from TopoloAuth rather than inventing parallel auth state.";
|
|
1496
1496
|
readonly appliesTo: readonly ["browser", "api", "tooling", "agent_surface"];
|
|
1497
|
-
readonly evidence: readonly ["@topolo/auth-client or @topolo-io/worker-runtime is used where applicable", "No public command, tool, or SDK method accepts orgId", "
|
|
1497
|
+
readonly evidence: readonly ["@topolo/auth-client or @topolo-io/worker-runtime is used where applicable", "No public command, tool, or SDK method accepts orgId", "App slug and Auth app registration are documented for protected APIs"];
|
|
1498
1498
|
readonly implementation: readonly ["Use shared auth/runtime packages instead of copying token parsing, gateway, or browser storage flows", "Derive organization from the credential on every request", "Route OAuth, refresh, logout, and SSO paths according to the shared Auth contract"];
|
|
1499
1499
|
}, {
|
|
1500
1500
|
readonly id: "shared-shell-and-launcher";
|
|
@@ -1504,12 +1504,12 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
|
|
|
1504
1504
|
readonly evidence: readonly ["@topolo-io/app-shell is used for the platform shell where the app has authenticated UI", "@topolo-io/app-launcher keeps the shared launcher/app switcher reachable from authenticated app chrome", "Account menu and sign-out behavior use TopoloAppShell or the ui-kit TopoloAccountMenu primitive", "Repeated app body surfaces use shared TopoloAppLayout primitives instead of local stat cards, empty states, or status badges", "Local preview supports deterministic visual QA fixtures for overview, list, detail, settings, and empty/loading states", "Authenticated app body content stays inside the viewport on mobile and desktop widths"];
|
|
1505
1505
|
readonly implementation: readonly ["Use @topolo-io/app-shell TopoloAppShell for authenticated app layouts", "Use the @topolo-io/ui-kit TopoloAccountMenu primitive when a partial-shell surface still needs account chrome", "Pass app-specific account actions as additive menu items instead of forking dropdowns", "Use shared design tokens and platform UI primitives before creating local equivalents", "Use TopoloAppMetricCard, TopoloAppEmptyState, TopoloAppStatusBadge, TopoloAppGrid, and TopoloAppSection for repeated app body patterns", "Keep visual QA fixtures available through visualQa=1 or __devpreview=1 so screenshot checks do not depend on live API state", "Keep mobile and desktop shell behavior aligned with the platform UI kit", "Constrain app-owned workspace wrappers with min-width: 0, width: auto, and viewport-aware max-width so shell padding cannot create page-level horizontal overflow"];
|
|
1506
1506
|
}, {
|
|
1507
|
-
readonly id: "
|
|
1508
|
-
readonly title: "Register protected APIs as platform
|
|
1509
|
-
readonly summary: "Callable app APIs need a stable
|
|
1507
|
+
readonly id: "app-registration-and-scopes";
|
|
1508
|
+
readonly title: "Register protected APIs as platform apps";
|
|
1509
|
+
readonly summary: "Callable app APIs need a stable app ID, app slug, permissions, role bundles, and API-key scopes before agents or users rely on them.";
|
|
1510
1510
|
readonly appliesTo: readonly ["api"];
|
|
1511
|
-
readonly evidence: readonly ["Auth
|
|
1512
|
-
readonly implementation: readonly ["Add production Worker api_url metadata and
|
|
1511
|
+
readonly evidence: readonly ["Auth app catalog contains the app ID and slug", "Permissions, role bundles, and API-key scopes exist for the app", "SDK, CLI, and MCP app discovery include the callable production API", "CloudControl production HTTP targets classify agent reachability with sdk_app_id or agent_callable:false"];
|
|
1512
|
+
readonly implementation: readonly ["Add production Worker api_url metadata and sdk_app_id for every agent-callable API target", "Mark browser, documentation, and runtime-only Worker targets with agent_callable:false", "Expose stable app IDs through generated DEFAULT_APP_URLS and live catalog discovery", "Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes"];
|
|
1513
1513
|
}, {
|
|
1514
1514
|
readonly id: "organization-scoped-data";
|
|
1515
1515
|
readonly title: "Keep application data organization-scoped";
|
|
@@ -1559,22 +1559,22 @@ declare function auditApplicationRequirements(applicationOrId: ApplicationCatalo
|
|
|
1559
1559
|
declare function auditAllApplicationRequirements(applicationIds?: readonly ApplicationId[]): ApplicationRequirementsAuditReport;
|
|
1560
1560
|
|
|
1561
1561
|
/**
|
|
1562
|
-
*
|
|
1562
|
+
* App API registry — base URLs for callable Topolo platform APIs.
|
|
1563
1563
|
*
|
|
1564
1564
|
* Source of truth lives in each app's `topolo.cloudcontrol.json`. The
|
|
1565
|
-
* `
|
|
1565
|
+
* `APP_API_URLS` map is regenerated from those files via
|
|
1566
1566
|
* `scripts/generate-services.mjs`; edit the JSON, not the generated file.
|
|
1567
1567
|
*
|
|
1568
1568
|
* Any entry can be overridden per-call via `TopoloClient` options, or globally
|
|
1569
|
-
* via env vars like `
|
|
1570
|
-
* (dots in
|
|
1569
|
+
* via env vars like `TOPOLO_APP_URL_MAIL` or `TOPOLO_APP_URL_WEB_API`
|
|
1570
|
+
* (dots in app API keys become underscores in env vars).
|
|
1571
1571
|
*
|
|
1572
1572
|
* IMPORTANT: The SDK NEVER accepts `orgId` as a parameter. Every request is
|
|
1573
1573
|
* scoped to the organization embedded in the auth credential (JWT claim or
|
|
1574
1574
|
* API-key binding). This is the load-bearing cross-org isolation guarantee.
|
|
1575
1575
|
*/
|
|
1576
1576
|
|
|
1577
|
-
declare const
|
|
1577
|
+
declare const DEFAULT_APP_URLS: Record<AppApiId, string>;
|
|
1578
1578
|
interface ServiceCatalogUrlEntry {
|
|
1579
1579
|
appId?: string | null;
|
|
1580
1580
|
slug?: string | null;
|
|
@@ -1586,9 +1586,9 @@ interface ServiceCatalogUrlEntry {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
declare function resolveCatalogServiceUrl(entry: ServiceCatalogUrlEntry, options?: {
|
|
1588
1588
|
serviceKey?: string;
|
|
1589
|
-
overrides?: Record<string, string> | Partial<Record<
|
|
1589
|
+
overrides?: Record<string, string> | Partial<Record<AppApiId, string>>;
|
|
1590
1590
|
}): string | null;
|
|
1591
|
-
declare function resolveServiceUrl(service:
|
|
1591
|
+
declare function resolveServiceUrl(service: AppApiId, overrides?: Partial<Record<AppApiId, string>>): string;
|
|
1592
1592
|
|
|
1593
1593
|
declare class TopoloSdkError extends Error {
|
|
1594
1594
|
readonly code: string;
|
|
@@ -1904,7 +1904,7 @@ interface TokenResponse {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
interface OAuthHelperOptions {
|
|
1906
1906
|
/** Overrides for TopoloAuth URL. Staging/dev should pass a mapping. */
|
|
1907
|
-
serviceUrls?: Partial<Record<
|
|
1907
|
+
serviceUrls?: Partial<Record<AppApiId, string>>;
|
|
1908
1908
|
/** Injected fetch. Defaults to global fetch. */
|
|
1909
1909
|
fetch?: typeof fetch;
|
|
1910
1910
|
}
|
|
@@ -2092,4 +2092,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
2092
2092
|
};
|
|
2093
2093
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
2094
2094
|
|
|
2095
|
-
export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule,
|
|
2095
|
+
export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionCatalogEntry, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveCatalogServiceUrl, resolveServiceUrl, validateTopoloWidgetResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -134,8 +134,8 @@ interface TopoloActionCatalogEntry {
|
|
|
134
134
|
title: string;
|
|
135
135
|
description: string;
|
|
136
136
|
appId: string;
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
appSlug: string | null;
|
|
138
|
+
appName: string | null;
|
|
139
139
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
140
140
|
path: string;
|
|
141
141
|
permissionName: string;
|
|
@@ -252,7 +252,7 @@ interface CredentialIntrospection {
|
|
|
252
252
|
} | null;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
declare const
|
|
255
|
+
declare const APP_API_URLS: {
|
|
256
256
|
readonly agent: "https://agent.topolo.app";
|
|
257
257
|
readonly auth: "https://auth.topolo.app";
|
|
258
258
|
readonly backup: "https://backup.topolo.app";
|
|
@@ -301,7 +301,7 @@ declare const SERVICES: {
|
|
|
301
301
|
readonly voice: "https://voice.topolo.app";
|
|
302
302
|
readonly web: "https://web.topolo.app";
|
|
303
303
|
};
|
|
304
|
-
type
|
|
304
|
+
type AppApiId = keyof typeof APP_API_URLS;
|
|
305
305
|
|
|
306
306
|
declare const APPLICATIONS: {
|
|
307
307
|
readonly admin: {
|
|
@@ -1492,9 +1492,9 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
|
|
|
1492
1492
|
}, {
|
|
1493
1493
|
readonly id: "shared-auth-boundary";
|
|
1494
1494
|
readonly title: "Use the shared Topolo auth boundary";
|
|
1495
|
-
readonly summary: "Applications must derive identity, organization, scopes, and
|
|
1495
|
+
readonly summary: "Applications must derive identity, organization, scopes, and app entitlement from TopoloAuth rather than inventing parallel auth state.";
|
|
1496
1496
|
readonly appliesTo: readonly ["browser", "api", "tooling", "agent_surface"];
|
|
1497
|
-
readonly evidence: readonly ["@topolo/auth-client or @topolo-io/worker-runtime is used where applicable", "No public command, tool, or SDK method accepts orgId", "
|
|
1497
|
+
readonly evidence: readonly ["@topolo/auth-client or @topolo-io/worker-runtime is used where applicable", "No public command, tool, or SDK method accepts orgId", "App slug and Auth app registration are documented for protected APIs"];
|
|
1498
1498
|
readonly implementation: readonly ["Use shared auth/runtime packages instead of copying token parsing, gateway, or browser storage flows", "Derive organization from the credential on every request", "Route OAuth, refresh, logout, and SSO paths according to the shared Auth contract"];
|
|
1499
1499
|
}, {
|
|
1500
1500
|
readonly id: "shared-shell-and-launcher";
|
|
@@ -1504,12 +1504,12 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
|
|
|
1504
1504
|
readonly evidence: readonly ["@topolo-io/app-shell is used for the platform shell where the app has authenticated UI", "@topolo-io/app-launcher keeps the shared launcher/app switcher reachable from authenticated app chrome", "Account menu and sign-out behavior use TopoloAppShell or the ui-kit TopoloAccountMenu primitive", "Repeated app body surfaces use shared TopoloAppLayout primitives instead of local stat cards, empty states, or status badges", "Local preview supports deterministic visual QA fixtures for overview, list, detail, settings, and empty/loading states", "Authenticated app body content stays inside the viewport on mobile and desktop widths"];
|
|
1505
1505
|
readonly implementation: readonly ["Use @topolo-io/app-shell TopoloAppShell for authenticated app layouts", "Use the @topolo-io/ui-kit TopoloAccountMenu primitive when a partial-shell surface still needs account chrome", "Pass app-specific account actions as additive menu items instead of forking dropdowns", "Use shared design tokens and platform UI primitives before creating local equivalents", "Use TopoloAppMetricCard, TopoloAppEmptyState, TopoloAppStatusBadge, TopoloAppGrid, and TopoloAppSection for repeated app body patterns", "Keep visual QA fixtures available through visualQa=1 or __devpreview=1 so screenshot checks do not depend on live API state", "Keep mobile and desktop shell behavior aligned with the platform UI kit", "Constrain app-owned workspace wrappers with min-width: 0, width: auto, and viewport-aware max-width so shell padding cannot create page-level horizontal overflow"];
|
|
1506
1506
|
}, {
|
|
1507
|
-
readonly id: "
|
|
1508
|
-
readonly title: "Register protected APIs as platform
|
|
1509
|
-
readonly summary: "Callable app APIs need a stable
|
|
1507
|
+
readonly id: "app-registration-and-scopes";
|
|
1508
|
+
readonly title: "Register protected APIs as platform apps";
|
|
1509
|
+
readonly summary: "Callable app APIs need a stable app ID, app slug, permissions, role bundles, and API-key scopes before agents or users rely on them.";
|
|
1510
1510
|
readonly appliesTo: readonly ["api"];
|
|
1511
|
-
readonly evidence: readonly ["Auth
|
|
1512
|
-
readonly implementation: readonly ["Add production Worker api_url metadata and
|
|
1511
|
+
readonly evidence: readonly ["Auth app catalog contains the app ID and slug", "Permissions, role bundles, and API-key scopes exist for the app", "SDK, CLI, and MCP app discovery include the callable production API", "CloudControl production HTTP targets classify agent reachability with sdk_app_id or agent_callable:false"];
|
|
1512
|
+
readonly implementation: readonly ["Add production Worker api_url metadata and sdk_app_id for every agent-callable API target", "Mark browser, documentation, and runtime-only Worker targets with agent_callable:false", "Expose stable app IDs through generated DEFAULT_APP_URLS and live catalog discovery", "Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes"];
|
|
1513
1513
|
}, {
|
|
1514
1514
|
readonly id: "organization-scoped-data";
|
|
1515
1515
|
readonly title: "Keep application data organization-scoped";
|
|
@@ -1559,22 +1559,22 @@ declare function auditApplicationRequirements(applicationOrId: ApplicationCatalo
|
|
|
1559
1559
|
declare function auditAllApplicationRequirements(applicationIds?: readonly ApplicationId[]): ApplicationRequirementsAuditReport;
|
|
1560
1560
|
|
|
1561
1561
|
/**
|
|
1562
|
-
*
|
|
1562
|
+
* App API registry — base URLs for callable Topolo platform APIs.
|
|
1563
1563
|
*
|
|
1564
1564
|
* Source of truth lives in each app's `topolo.cloudcontrol.json`. The
|
|
1565
|
-
* `
|
|
1565
|
+
* `APP_API_URLS` map is regenerated from those files via
|
|
1566
1566
|
* `scripts/generate-services.mjs`; edit the JSON, not the generated file.
|
|
1567
1567
|
*
|
|
1568
1568
|
* Any entry can be overridden per-call via `TopoloClient` options, or globally
|
|
1569
|
-
* via env vars like `
|
|
1570
|
-
* (dots in
|
|
1569
|
+
* via env vars like `TOPOLO_APP_URL_MAIL` or `TOPOLO_APP_URL_WEB_API`
|
|
1570
|
+
* (dots in app API keys become underscores in env vars).
|
|
1571
1571
|
*
|
|
1572
1572
|
* IMPORTANT: The SDK NEVER accepts `orgId` as a parameter. Every request is
|
|
1573
1573
|
* scoped to the organization embedded in the auth credential (JWT claim or
|
|
1574
1574
|
* API-key binding). This is the load-bearing cross-org isolation guarantee.
|
|
1575
1575
|
*/
|
|
1576
1576
|
|
|
1577
|
-
declare const
|
|
1577
|
+
declare const DEFAULT_APP_URLS: Record<AppApiId, string>;
|
|
1578
1578
|
interface ServiceCatalogUrlEntry {
|
|
1579
1579
|
appId?: string | null;
|
|
1580
1580
|
slug?: string | null;
|
|
@@ -1586,9 +1586,9 @@ interface ServiceCatalogUrlEntry {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
declare function resolveCatalogServiceUrl(entry: ServiceCatalogUrlEntry, options?: {
|
|
1588
1588
|
serviceKey?: string;
|
|
1589
|
-
overrides?: Record<string, string> | Partial<Record<
|
|
1589
|
+
overrides?: Record<string, string> | Partial<Record<AppApiId, string>>;
|
|
1590
1590
|
}): string | null;
|
|
1591
|
-
declare function resolveServiceUrl(service:
|
|
1591
|
+
declare function resolveServiceUrl(service: AppApiId, overrides?: Partial<Record<AppApiId, string>>): string;
|
|
1592
1592
|
|
|
1593
1593
|
declare class TopoloSdkError extends Error {
|
|
1594
1594
|
readonly code: string;
|
|
@@ -1904,7 +1904,7 @@ interface TokenResponse {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
interface OAuthHelperOptions {
|
|
1906
1906
|
/** Overrides for TopoloAuth URL. Staging/dev should pass a mapping. */
|
|
1907
|
-
serviceUrls?: Partial<Record<
|
|
1907
|
+
serviceUrls?: Partial<Record<AppApiId, string>>;
|
|
1908
1908
|
/** Injected fetch. Defaults to global fetch. */
|
|
1909
1909
|
fetch?: typeof fetch;
|
|
1910
1910
|
}
|
|
@@ -2092,4 +2092,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
2092
2092
|
};
|
|
2093
2093
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
2094
2094
|
|
|
2095
|
-
export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule,
|
|
2095
|
+
export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type AppApiId, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_APP_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceCatalogUrlEntry, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, type TopoloActionCatalogEntry, type TopoloApiKeyResourceMetadata, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveCatalogServiceUrl, resolveServiceUrl, validateTopoloWidgetResponse };
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var TopoloHttpError = class extends TopoloSdkError {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
// src/services.generated.ts
|
|
60
|
-
var
|
|
60
|
+
var APP_API_URLS = {
|
|
61
61
|
agent: "https://agent.topolo.app",
|
|
62
62
|
auth: "https://auth.topolo.app",
|
|
63
63
|
backup: "https://backup.topolo.app",
|
|
@@ -1648,12 +1648,12 @@ var APPLICATION_REQUIREMENTS = [
|
|
|
1648
1648
|
{
|
|
1649
1649
|
id: "shared-auth-boundary",
|
|
1650
1650
|
title: "Use the shared Topolo auth boundary",
|
|
1651
|
-
summary: "Applications must derive identity, organization, scopes, and
|
|
1651
|
+
summary: "Applications must derive identity, organization, scopes, and app entitlement from TopoloAuth rather than inventing parallel auth state.",
|
|
1652
1652
|
appliesTo: ["browser", "api", "tooling", "agent_surface"],
|
|
1653
1653
|
evidence: [
|
|
1654
1654
|
"@topolo/auth-client or @topolo-io/worker-runtime is used where applicable",
|
|
1655
1655
|
"No public command, tool, or SDK method accepts orgId",
|
|
1656
|
-
"
|
|
1656
|
+
"App slug and Auth app registration are documented for protected APIs"
|
|
1657
1657
|
],
|
|
1658
1658
|
implementation: [
|
|
1659
1659
|
"Use shared auth/runtime packages instead of copying token parsing, gateway, or browser storage flows",
|
|
@@ -1686,20 +1686,20 @@ var APPLICATION_REQUIREMENTS = [
|
|
|
1686
1686
|
]
|
|
1687
1687
|
},
|
|
1688
1688
|
{
|
|
1689
|
-
id: "
|
|
1690
|
-
title: "Register protected APIs as platform
|
|
1691
|
-
summary: "Callable app APIs need a stable
|
|
1689
|
+
id: "app-registration-and-scopes",
|
|
1690
|
+
title: "Register protected APIs as platform apps",
|
|
1691
|
+
summary: "Callable app APIs need a stable app ID, app slug, permissions, role bundles, and API-key scopes before agents or users rely on them.",
|
|
1692
1692
|
appliesTo: ["api"],
|
|
1693
1693
|
evidence: [
|
|
1694
|
-
"Auth
|
|
1695
|
-
"Permissions, role bundles, and API-key scopes exist for the
|
|
1696
|
-
"SDK, CLI, and MCP
|
|
1697
|
-
"CloudControl production HTTP targets classify agent reachability with
|
|
1694
|
+
"Auth app catalog contains the app ID and slug",
|
|
1695
|
+
"Permissions, role bundles, and API-key scopes exist for the app",
|
|
1696
|
+
"SDK, CLI, and MCP app discovery include the callable production API",
|
|
1697
|
+
"CloudControl production HTTP targets classify agent reachability with sdk_app_id or agent_callable:false"
|
|
1698
1698
|
],
|
|
1699
1699
|
implementation: [
|
|
1700
|
-
"Add production Worker api_url metadata and
|
|
1700
|
+
"Add production Worker api_url metadata and sdk_app_id for every agent-callable API target",
|
|
1701
1701
|
"Mark browser, documentation, and runtime-only Worker targets with agent_callable:false",
|
|
1702
|
-
"Expose stable
|
|
1702
|
+
"Expose stable app IDs through generated DEFAULT_APP_URLS and live catalog discovery",
|
|
1703
1703
|
"Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes"
|
|
1704
1704
|
]
|
|
1705
1705
|
},
|
|
@@ -1905,7 +1905,7 @@ function evaluateRequirement(application, requirement) {
|
|
|
1905
1905
|
"Catalog metadata cannot verify shared shell, launcher, and account menu adoption.",
|
|
1906
1906
|
evidence
|
|
1907
1907
|
);
|
|
1908
|
-
case "
|
|
1908
|
+
case "app-registration-and-scopes": {
|
|
1909
1909
|
if (application.services.length > 0) {
|
|
1910
1910
|
evidence.push(`services=${application.services.join(",")}`);
|
|
1911
1911
|
return finding(
|
|
@@ -1915,7 +1915,7 @@ function evaluateRequirement(application, requirement) {
|
|
|
1915
1915
|
evidence
|
|
1916
1916
|
);
|
|
1917
1917
|
}
|
|
1918
|
-
return finding(requirement, "missing", "No SDK
|
|
1918
|
+
return finding(requirement, "missing", "No SDK app API id is registered for this callable API surface.", evidence);
|
|
1919
1919
|
}
|
|
1920
1920
|
case "organization-scoped-data":
|
|
1921
1921
|
return finding(
|
|
@@ -2002,7 +2002,7 @@ function statusRank(status) {
|
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
2004
|
// src/services.ts
|
|
2005
|
-
var
|
|
2005
|
+
var DEFAULT_APP_URLS = APP_API_URLS;
|
|
2006
2006
|
function resolveCatalogServiceUrl(entry, options = {}) {
|
|
2007
2007
|
const keys = catalogServiceKeyCandidates(entry, options.serviceKey);
|
|
2008
2008
|
const override = resolveServiceUrlOverride(keys, options.overrides);
|
|
@@ -2014,7 +2014,7 @@ function resolveCatalogServiceUrl(entry, options = {}) {
|
|
|
2014
2014
|
function resolveServiceUrl(service, overrides) {
|
|
2015
2015
|
const override = resolveServiceUrlOverride([service], overrides);
|
|
2016
2016
|
if (override) return override;
|
|
2017
|
-
return
|
|
2017
|
+
return DEFAULT_APP_URLS[service];
|
|
2018
2018
|
}
|
|
2019
2019
|
function catalogServiceKeyCandidates(entry, preferred) {
|
|
2020
2020
|
const values = [preferred, entry.slug, entry.name, entry.appId].filter(
|
|
@@ -2045,7 +2045,7 @@ function resolveServiceUrlOverride(keys, overrides) {
|
|
|
2045
2045
|
if (envStyle) return envStyle;
|
|
2046
2046
|
}
|
|
2047
2047
|
for (const key of keys) {
|
|
2048
|
-
const envKey = `
|
|
2048
|
+
const envKey = `TOPOLO_APP_URL_${key.replace(/\./g, "_").toUpperCase()}`;
|
|
2049
2049
|
const envValue = typeof process !== "undefined" ? process.env?.[envKey] : void 0;
|
|
2050
2050
|
if (envValue) return envValue;
|
|
2051
2051
|
}
|
|
@@ -2232,7 +2232,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2232
2232
|
const derived = deriveDevelopersFromAuth(resolveConfiguredServiceUrl("auth", this.serviceUrls));
|
|
2233
2233
|
if (derived) return { serviceKey, baseUrl: derived };
|
|
2234
2234
|
}
|
|
2235
|
-
return { serviceKey, baseUrl:
|
|
2235
|
+
return { serviceKey, baseUrl: DEFAULT_APP_URLS[serviceKey] };
|
|
2236
2236
|
}
|
|
2237
2237
|
const live = await this.resolveLiveCallableService(serviceKey);
|
|
2238
2238
|
if (live) {
|
|
@@ -2241,7 +2241,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2241
2241
|
}
|
|
2242
2242
|
throw new TopoloSdkError(
|
|
2243
2243
|
"unknown_service",
|
|
2244
|
-
`Unknown Topolo
|
|
2244
|
+
`Unknown Topolo app API "${service}". Run app discovery first and pass a callable app id or slug.`
|
|
2245
2245
|
);
|
|
2246
2246
|
}
|
|
2247
2247
|
async resolveLiveCallableService(serviceKey) {
|
|
@@ -2414,7 +2414,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2414
2414
|
async callAction(action, input = {}, options = {}) {
|
|
2415
2415
|
const entry = await this.getAction(action);
|
|
2416
2416
|
const mapped = mapActionInput(entry, input);
|
|
2417
|
-
const service = entry.
|
|
2417
|
+
const service = entry.appSlug || entry.appId;
|
|
2418
2418
|
return this.request({
|
|
2419
2419
|
service,
|
|
2420
2420
|
method: entry.method,
|
|
@@ -2602,8 +2602,8 @@ function normalizeActionCatalogEntry(item) {
|
|
|
2602
2602
|
title: pickActionString(a.title) ?? name,
|
|
2603
2603
|
description: pickActionString(a.description) ?? "",
|
|
2604
2604
|
appId,
|
|
2605
|
-
|
|
2606
|
-
|
|
2605
|
+
appSlug: pickActionString(a.app_slug) ?? pickActionString(a.appSlug) ?? null,
|
|
2606
|
+
appName: pickActionString(a.app_name) ?? pickActionString(a.appName) ?? null,
|
|
2607
2607
|
method,
|
|
2608
2608
|
path,
|
|
2609
2609
|
permissionName: pickActionString(a.permission_name) ?? pickActionString(a.permissionName) ?? "",
|
|
@@ -2720,6 +2720,7 @@ var CrmModule = class {
|
|
|
2720
2720
|
constructor(client) {
|
|
2721
2721
|
this.client = client;
|
|
2722
2722
|
}
|
|
2723
|
+
client;
|
|
2723
2724
|
async listContacts(options = {}) {
|
|
2724
2725
|
const res = await this.client.request({
|
|
2725
2726
|
service: "crm",
|
|
@@ -2767,6 +2768,7 @@ var IdentityModule = class {
|
|
|
2767
2768
|
constructor(client) {
|
|
2768
2769
|
this.client = client;
|
|
2769
2770
|
}
|
|
2771
|
+
client;
|
|
2770
2772
|
/** Returns the resolved user, organization, and permission set for the
|
|
2771
2773
|
* current credential. Equivalent to `TopoloClient.introspect()` — exposed
|
|
2772
2774
|
* on this module for symmetry with the other domain modules. */
|
|
@@ -2780,6 +2782,7 @@ var P2PModule = class {
|
|
|
2780
2782
|
constructor(client) {
|
|
2781
2783
|
this.client = client;
|
|
2782
2784
|
}
|
|
2785
|
+
client;
|
|
2783
2786
|
// Directory ----------------------------------------------------------------
|
|
2784
2787
|
async listDirectory(options = {}) {
|
|
2785
2788
|
const res = await this.client.request({
|
|
@@ -3240,7 +3243,7 @@ export {
|
|
|
3240
3243
|
APPLICATION_REQUIREMENTS,
|
|
3241
3244
|
APPLICATION_REQUIREMENTS_VERSION,
|
|
3242
3245
|
CrmModule,
|
|
3243
|
-
|
|
3246
|
+
DEFAULT_APP_URLS,
|
|
3244
3247
|
IdentityModule,
|
|
3245
3248
|
P2PModule,
|
|
3246
3249
|
TOPOLO_WIDGET_ENDPOINT,
|