@topolo/sdk 0.4.9 → 0.4.10
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.cjs +8 -3
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +8 -3
- package/package.json +1 -1
- package/src/client.ts +11 -3
- package/src/index.test.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2422,8 +2422,9 @@ var TopoloClient = class _TopoloClient {
|
|
|
2422
2422
|
return entries;
|
|
2423
2423
|
}
|
|
2424
2424
|
/**
|
|
2425
|
-
* List callable actions from the live
|
|
2426
|
-
* the
|
|
2425
|
+
* List callable actions from the live registry-canonical catalog (definitions
|
|
2426
|
+
* from the Catalog registry, scoping from Auth). The response is scoped to the
|
|
2427
|
+
* caller's organization and effective permissions; no bundled/static app
|
|
2427
2428
|
* action list is used as an authorization source.
|
|
2428
2429
|
*/
|
|
2429
2430
|
async listActions(options = {}) {
|
|
@@ -2432,7 +2433,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2432
2433
|
return this.actionCatalogCache.entries;
|
|
2433
2434
|
}
|
|
2434
2435
|
const res = await this.request({
|
|
2435
|
-
service: "
|
|
2436
|
+
service: "developers",
|
|
2436
2437
|
method: "GET",
|
|
2437
2438
|
path: "/api/actions/catalog",
|
|
2438
2439
|
...options.service ? { query: { service: options.service } } : {}
|
|
@@ -2667,6 +2668,7 @@ function normalizeActionCatalogEntry(item) {
|
|
|
2667
2668
|
readOnly: Boolean(a.read_only ?? a.readOnly),
|
|
2668
2669
|
destructive: Boolean(a.destructive),
|
|
2669
2670
|
requiresConfirmation: Boolean(a.requires_confirmation ?? a.requiresConfirmation),
|
|
2671
|
+
agentAccess: pickAgentAccess(a.agent_access ?? a.agentAccess),
|
|
2670
2672
|
status: pickActionString(a.status),
|
|
2671
2673
|
sourceRevision: pickActionString(a.source_revision) ?? pickActionString(a.sourceRevision)
|
|
2672
2674
|
};
|
|
@@ -2677,6 +2679,9 @@ function isHttpMethod(value) {
|
|
|
2677
2679
|
function pickActionString(value) {
|
|
2678
2680
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2679
2681
|
}
|
|
2682
|
+
function pickAgentAccess(value) {
|
|
2683
|
+
return value === "auto" || value === "confirm" || value === "off" ? value : null;
|
|
2684
|
+
}
|
|
2680
2685
|
function plainObject(value) {
|
|
2681
2686
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
2682
2687
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -145,6 +145,8 @@ interface TopoloActionCatalogEntry {
|
|
|
145
145
|
readOnly: boolean;
|
|
146
146
|
destructive: boolean;
|
|
147
147
|
requiresConfirmation: boolean;
|
|
148
|
+
/** Agent access tier. null/absent when the catalog does not specify one (consumers derive a default). */
|
|
149
|
+
agentAccess?: 'auto' | 'confirm' | 'off' | null;
|
|
148
150
|
status: string | null;
|
|
149
151
|
sourceRevision: string | null;
|
|
150
152
|
}
|
|
@@ -206,8 +208,9 @@ declare class TopoloClient {
|
|
|
206
208
|
*/
|
|
207
209
|
listServices(): Promise<TopoloServiceCatalogEntry[]>;
|
|
208
210
|
/**
|
|
209
|
-
* List callable actions from the live
|
|
210
|
-
* the
|
|
211
|
+
* List callable actions from the live registry-canonical catalog (definitions
|
|
212
|
+
* from the Catalog registry, scoping from Auth). The response is scoped to the
|
|
213
|
+
* caller's organization and effective permissions; no bundled/static app
|
|
211
214
|
* action list is used as an authorization source.
|
|
212
215
|
*/
|
|
213
216
|
listActions(options?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -145,6 +145,8 @@ interface TopoloActionCatalogEntry {
|
|
|
145
145
|
readOnly: boolean;
|
|
146
146
|
destructive: boolean;
|
|
147
147
|
requiresConfirmation: boolean;
|
|
148
|
+
/** Agent access tier. null/absent when the catalog does not specify one (consumers derive a default). */
|
|
149
|
+
agentAccess?: 'auto' | 'confirm' | 'off' | null;
|
|
148
150
|
status: string | null;
|
|
149
151
|
sourceRevision: string | null;
|
|
150
152
|
}
|
|
@@ -206,8 +208,9 @@ declare class TopoloClient {
|
|
|
206
208
|
*/
|
|
207
209
|
listServices(): Promise<TopoloServiceCatalogEntry[]>;
|
|
208
210
|
/**
|
|
209
|
-
* List callable actions from the live
|
|
210
|
-
* the
|
|
211
|
+
* List callable actions from the live registry-canonical catalog (definitions
|
|
212
|
+
* from the Catalog registry, scoping from Auth). The response is scoped to the
|
|
213
|
+
* caller's organization and effective permissions; no bundled/static app
|
|
211
214
|
* action list is used as an authorization source.
|
|
212
215
|
*/
|
|
213
216
|
listActions(options?: {
|
package/dist/index.js
CHANGED
|
@@ -2367,8 +2367,9 @@ var TopoloClient = class _TopoloClient {
|
|
|
2367
2367
|
return entries;
|
|
2368
2368
|
}
|
|
2369
2369
|
/**
|
|
2370
|
-
* List callable actions from the live
|
|
2371
|
-
* the
|
|
2370
|
+
* List callable actions from the live registry-canonical catalog (definitions
|
|
2371
|
+
* from the Catalog registry, scoping from Auth). The response is scoped to the
|
|
2372
|
+
* caller's organization and effective permissions; no bundled/static app
|
|
2372
2373
|
* action list is used as an authorization source.
|
|
2373
2374
|
*/
|
|
2374
2375
|
async listActions(options = {}) {
|
|
@@ -2377,7 +2378,7 @@ var TopoloClient = class _TopoloClient {
|
|
|
2377
2378
|
return this.actionCatalogCache.entries;
|
|
2378
2379
|
}
|
|
2379
2380
|
const res = await this.request({
|
|
2380
|
-
service: "
|
|
2381
|
+
service: "developers",
|
|
2381
2382
|
method: "GET",
|
|
2382
2383
|
path: "/api/actions/catalog",
|
|
2383
2384
|
...options.service ? { query: { service: options.service } } : {}
|
|
@@ -2612,6 +2613,7 @@ function normalizeActionCatalogEntry(item) {
|
|
|
2612
2613
|
readOnly: Boolean(a.read_only ?? a.readOnly),
|
|
2613
2614
|
destructive: Boolean(a.destructive),
|
|
2614
2615
|
requiresConfirmation: Boolean(a.requires_confirmation ?? a.requiresConfirmation),
|
|
2616
|
+
agentAccess: pickAgentAccess(a.agent_access ?? a.agentAccess),
|
|
2615
2617
|
status: pickActionString(a.status),
|
|
2616
2618
|
sourceRevision: pickActionString(a.source_revision) ?? pickActionString(a.sourceRevision)
|
|
2617
2619
|
};
|
|
@@ -2622,6 +2624,9 @@ function isHttpMethod(value) {
|
|
|
2622
2624
|
function pickActionString(value) {
|
|
2623
2625
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2624
2626
|
}
|
|
2627
|
+
function pickAgentAccess(value) {
|
|
2628
|
+
return value === "auto" || value === "confirm" || value === "off" ? value : null;
|
|
2629
|
+
}
|
|
2625
2630
|
function plainObject(value) {
|
|
2626
2631
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
2627
2632
|
}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -151,6 +151,8 @@ export interface TopoloActionCatalogEntry {
|
|
|
151
151
|
readOnly: boolean;
|
|
152
152
|
destructive: boolean;
|
|
153
153
|
requiresConfirmation: boolean;
|
|
154
|
+
/** Agent access tier. null/absent when the catalog does not specify one (consumers derive a default). */
|
|
155
|
+
agentAccess?: 'auto' | 'confirm' | 'off' | null;
|
|
154
156
|
status: string | null;
|
|
155
157
|
sourceRevision: string | null;
|
|
156
158
|
}
|
|
@@ -539,8 +541,9 @@ export class TopoloClient {
|
|
|
539
541
|
}
|
|
540
542
|
|
|
541
543
|
/**
|
|
542
|
-
* List callable actions from the live
|
|
543
|
-
* the
|
|
544
|
+
* List callable actions from the live registry-canonical catalog (definitions
|
|
545
|
+
* from the Catalog registry, scoping from Auth). The response is scoped to the
|
|
546
|
+
* caller's organization and effective permissions; no bundled/static app
|
|
544
547
|
* action list is used as an authorization source.
|
|
545
548
|
*/
|
|
546
549
|
async listActions(options: { service?: string } = {}): Promise<TopoloActionCatalogEntry[]> {
|
|
@@ -553,7 +556,7 @@ export class TopoloClient {
|
|
|
553
556
|
| { data?: { actions?: unknown[] } }
|
|
554
557
|
| { actions?: unknown[] }
|
|
555
558
|
>({
|
|
556
|
-
service: '
|
|
559
|
+
service: 'developers',
|
|
557
560
|
method: 'GET',
|
|
558
561
|
path: '/api/actions/catalog',
|
|
559
562
|
...(options.service ? { query: { service: options.service } } : {}),
|
|
@@ -855,6 +858,7 @@ function normalizeActionCatalogEntry(item: unknown): TopoloActionCatalogEntry |
|
|
|
855
858
|
readOnly: Boolean(a.read_only ?? a.readOnly),
|
|
856
859
|
destructive: Boolean(a.destructive),
|
|
857
860
|
requiresConfirmation: Boolean(a.requires_confirmation ?? a.requiresConfirmation),
|
|
861
|
+
agentAccess: pickAgentAccess(a.agent_access ?? a.agentAccess),
|
|
858
862
|
status: pickActionString(a.status),
|
|
859
863
|
sourceRevision: pickActionString(a.source_revision) ?? pickActionString(a.sourceRevision),
|
|
860
864
|
};
|
|
@@ -868,6 +872,10 @@ function pickActionString(value: unknown): string | null {
|
|
|
868
872
|
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
869
873
|
}
|
|
870
874
|
|
|
875
|
+
function pickAgentAccess(value: unknown): 'auto' | 'confirm' | 'off' | null {
|
|
876
|
+
return value === 'auto' || value === 'confirm' || value === 'off' ? value : null;
|
|
877
|
+
}
|
|
878
|
+
|
|
871
879
|
function plainObject(value: unknown): Record<string, unknown> {
|
|
872
880
|
return value && typeof value === 'object' && !Array.isArray(value)
|
|
873
881
|
? value as Record<string, unknown>
|
package/src/index.test.ts
CHANGED
|
@@ -63,7 +63,7 @@ describe('createTopolo', () => {
|
|
|
63
63
|
describe('package surface re-exports', () => {
|
|
64
64
|
it('re-exports the error classes from the barrel', () => {
|
|
65
65
|
expect(new TopoloAuthError('x').name).toBe('TopoloAuthError');
|
|
66
|
-
expect(new TopoloHttpError('auth', '/p', 500).name).toBe('TopoloHttpError');
|
|
66
|
+
expect(new TopoloHttpError('auth', '/p', 500, null).name).toBe('TopoloHttpError');
|
|
67
67
|
expect(new TopoloPermissionError('nope', []).name).toBe('TopoloPermissionError');
|
|
68
68
|
});
|
|
69
69
|
});
|