@topolo/sdk 0.2.12 → 0.4.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 +1 -1
- package/dist/index.cjs +220 -73
- package/dist/index.d.cts +105 -42
- package/dist/index.d.ts +105 -42
- package/dist/index.js +220 -72
- package/package.json +5 -2
- package/src/application-requirements.ts +10 -6
- package/src/applications.generated.ts +61 -40
- package/src/client.test.ts +172 -6
- package/src/client.ts +214 -2
- package/src/index.ts +1 -1
- package/src/modules/p2p.test.ts +27 -11
- package/src/services.generated.ts +2 -24
- package/src/services.test.ts +5 -13
- package/src/services.ts +1 -2
- package/src/widgets.test.ts +7 -7
package/src/services.test.ts
CHANGED
|
@@ -14,20 +14,19 @@ const EXPECTED_APPLICATION_IDS = [
|
|
|
14
14
|
'admin',
|
|
15
15
|
'agent',
|
|
16
16
|
'auth',
|
|
17
|
+
'backup',
|
|
17
18
|
'books',
|
|
18
19
|
'bugfix',
|
|
19
20
|
'bytes',
|
|
20
21
|
'calendar',
|
|
21
22
|
'capacity',
|
|
22
23
|
'chat',
|
|
23
|
-
'cli',
|
|
24
24
|
'cloudcontrol',
|
|
25
25
|
'commerce',
|
|
26
26
|
'compose',
|
|
27
27
|
'consent',
|
|
28
28
|
'crm',
|
|
29
29
|
'customer_success',
|
|
30
|
-
'd1_backup',
|
|
31
30
|
'developers',
|
|
32
31
|
'director',
|
|
33
32
|
'docs',
|
|
@@ -41,7 +40,6 @@ const EXPECTED_APPLICATION_IDS = [
|
|
|
41
40
|
'learn',
|
|
42
41
|
'localize',
|
|
43
42
|
'mail',
|
|
44
|
-
'mcp',
|
|
45
43
|
'mdm',
|
|
46
44
|
'messaging',
|
|
47
45
|
'nexus',
|
|
@@ -57,6 +55,7 @@ const EXPECTED_APPLICATION_IDS = [
|
|
|
57
55
|
'sign',
|
|
58
56
|
'social_studio',
|
|
59
57
|
'socialize',
|
|
58
|
+
'spaces',
|
|
60
59
|
'status',
|
|
61
60
|
'support',
|
|
62
61
|
'survey',
|
|
@@ -84,11 +83,10 @@ describe('service registry', () => {
|
|
|
84
83
|
expect(DEFAULT_SERVICE_URLS).not.toHaveProperty('web.runtime');
|
|
85
84
|
});
|
|
86
85
|
|
|
87
|
-
it('
|
|
88
|
-
const
|
|
86
|
+
it('does not bake opaque Auth service ids into the generated registry', async () => {
|
|
87
|
+
const services = await import('./services.js');
|
|
89
88
|
|
|
90
|
-
expect(
|
|
91
|
-
expect(PLATFORM_SERVICE_IDS.customer_success).toBe('srv_topolo_success');
|
|
89
|
+
expect(services).not.toHaveProperty('PLATFORM_SERVICE_IDS');
|
|
92
90
|
});
|
|
93
91
|
|
|
94
92
|
it('maps every callable service back to an application catalog entry', () => {
|
|
@@ -160,23 +158,17 @@ describe('application requirements', () => {
|
|
|
160
158
|
expect(applicationRequirementScopes(APPLICATIONS.mail)).toEqual(
|
|
161
159
|
expect.arrayContaining(['all', 'browser', 'api', 'agent_surface']),
|
|
162
160
|
);
|
|
163
|
-
expect(applicationRequirementScopes(APPLICATIONS.cli)).toEqual(
|
|
164
|
-
expect.arrayContaining(['all', 'tooling', 'agent_surface']),
|
|
165
|
-
);
|
|
166
161
|
});
|
|
167
162
|
|
|
168
163
|
it('filters requirements for a target application', () => {
|
|
169
164
|
const adminRequirementIds = requirementsForApplication('admin').map((requirement) => requirement.id);
|
|
170
165
|
const mailRequirementIds = requirementsForApplication('mail').map((requirement) => requirement.id);
|
|
171
|
-
const cliRequirementIds = requirementsForApplication('cli').map((requirement) => requirement.id);
|
|
172
166
|
|
|
173
167
|
expect(adminRequirementIds).toContain('shared-shell-and-launcher');
|
|
174
168
|
expect(adminRequirementIds).not.toContain('organization-scoped-data');
|
|
175
169
|
expect(mailRequirementIds).toContain('organization-scoped-data');
|
|
176
170
|
expect(mailRequirementIds).toContain('service-registration-and-scopes');
|
|
177
171
|
expect(mailRequirementIds).toContain('native-dashboard-widget');
|
|
178
|
-
expect(cliRequirementIds).toContain('agent-and-operator-surfaces');
|
|
179
|
-
expect(cliRequirementIds).not.toContain('service-registration-and-scopes');
|
|
180
172
|
});
|
|
181
173
|
|
|
182
174
|
it('audits one application against the catalog-backed requirements', () => {
|
package/src/services.ts
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import {
|
|
17
17
|
SERVICES,
|
|
18
|
-
PLATFORM_SERVICE_IDS,
|
|
19
18
|
type ServiceId,
|
|
20
19
|
} from './services.generated.js';
|
|
21
20
|
import {
|
|
@@ -41,7 +40,7 @@ export {
|
|
|
41
40
|
type ApplicationRequirementsAuditReport,
|
|
42
41
|
} from './application-requirements.js';
|
|
43
42
|
|
|
44
|
-
export { SERVICES
|
|
43
|
+
export { SERVICES };
|
|
45
44
|
export type { ServiceId };
|
|
46
45
|
export { APPLICATIONS };
|
|
47
46
|
export type { ApplicationCatalogEntry, ApplicationDeployTarget, ApplicationId };
|
package/src/widgets.test.ts
CHANGED
|
@@ -15,7 +15,7 @@ describe("Topolo widget contract", () => {
|
|
|
15
15
|
|
|
16
16
|
it("stamps service metadata and timestamp onto widget drafts", () => {
|
|
17
17
|
const response = createTopoloWidgetResponse({
|
|
18
|
-
serviceId: "
|
|
18
|
+
serviceId: "service_bytes",
|
|
19
19
|
serviceName: "Bytes",
|
|
20
20
|
now: "2026-04-25T00:00:00.000Z",
|
|
21
21
|
widgets: [
|
|
@@ -30,7 +30,7 @@ describe("Topolo widget contract", () => {
|
|
|
30
30
|
success: true,
|
|
31
31
|
widgets: [
|
|
32
32
|
{
|
|
33
|
-
serviceId: "
|
|
33
|
+
serviceId: "service_bytes",
|
|
34
34
|
serviceName: "Bytes",
|
|
35
35
|
lastUpdated: "2026-04-25T00:00:00.000Z",
|
|
36
36
|
type: "stats",
|
|
@@ -42,12 +42,12 @@ describe("Topolo widget contract", () => {
|
|
|
42
42
|
|
|
43
43
|
it("keeps explicit widget metadata when an app needs multiple service cards", () => {
|
|
44
44
|
const response = createTopoloWidgetResponse({
|
|
45
|
-
serviceId: "
|
|
45
|
+
serviceId: "service_platform",
|
|
46
46
|
serviceName: "Platform",
|
|
47
47
|
now: "2026-04-25T00:00:00.000Z",
|
|
48
48
|
widgets: [
|
|
49
49
|
{
|
|
50
|
-
serviceId: "
|
|
50
|
+
serviceId: "service_crm",
|
|
51
51
|
serviceName: "CRM",
|
|
52
52
|
lastUpdated: "2026-04-24T23:00:00.000Z",
|
|
53
53
|
type: "stats",
|
|
@@ -57,7 +57,7 @@ describe("Topolo widget contract", () => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
expect(response.widgets[0]).toMatchObject({
|
|
60
|
-
serviceId: "
|
|
60
|
+
serviceId: "service_crm",
|
|
61
61
|
serviceName: "CRM",
|
|
62
62
|
lastUpdated: "2026-04-24T23:00:00.000Z",
|
|
63
63
|
});
|
|
@@ -73,7 +73,7 @@ describe("Topolo widget contract", () => {
|
|
|
73
73
|
|
|
74
74
|
it("validates a compliant response", () => {
|
|
75
75
|
const response = createTopoloWidgetResponse({
|
|
76
|
-
serviceId: "
|
|
76
|
+
serviceId: "service_crm",
|
|
77
77
|
serviceName: "CRM",
|
|
78
78
|
now: "2026-04-25T00:00:00.000Z",
|
|
79
79
|
widgets: [
|
|
@@ -102,7 +102,7 @@ describe("Topolo widget contract", () => {
|
|
|
102
102
|
|
|
103
103
|
it("keeps optional snapshot metadata for configurable TopoloOne datapoints", () => {
|
|
104
104
|
const response = createTopoloWidgetResponse({
|
|
105
|
-
serviceId: "
|
|
105
|
+
serviceId: "service_admin",
|
|
106
106
|
serviceName: "Admin",
|
|
107
107
|
now: "2026-04-28T00:00:00.000Z",
|
|
108
108
|
widgets: [
|