@topolo/sdk 0.2.6 → 0.2.7
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 +111 -0
- package/dist/index.d.cts +86 -15
- package/dist/index.d.ts +86 -15
- package/dist/index.js +111 -0
- package/package.json +1 -1
- package/src/applications.generated.ts +71 -0
- package/src/index.ts +18 -11
- package/src/services.generated.ts +5 -0
- package/src/services.test.ts +3 -0
- package/src/widgets.test.ts +88 -49
- package/src/widgets.ts +114 -43
package/dist/index.cjs
CHANGED
|
@@ -118,8 +118,10 @@ var SERVICES = {
|
|
|
118
118
|
bugfix: "https://bugfix.topolo.app",
|
|
119
119
|
bytes: "https://r2-media-manager-worker.topolo.workers.dev",
|
|
120
120
|
calendar: "https://calendar.topolo.app",
|
|
121
|
+
capacity: "https://topolo-capacity.topolo.workers.dev",
|
|
121
122
|
chat: "https://chat.topolo.app",
|
|
122
123
|
commerce: "https://topolo-commerce-api.topolo.workers.dev",
|
|
124
|
+
compose: "https://compose.topolo.app",
|
|
123
125
|
crm: "https://crm-api.topolo.app",
|
|
124
126
|
customer_success: "https://customer-success.topolo.app",
|
|
125
127
|
feed: "https://topolo-feed-api.topolo.app",
|
|
@@ -133,6 +135,7 @@ var SERVICES = {
|
|
|
133
135
|
mdm: "https://topolo-mdm-api.topolo.app",
|
|
134
136
|
messaging: "https://messages.topolo.app",
|
|
135
137
|
nexus: "https://topolo-nexus-gateway.topolo.workers.dev",
|
|
138
|
+
notify: "https://notify.topolo.app",
|
|
136
139
|
one: "https://one.topolo.app",
|
|
137
140
|
pay: "https://topolo-pay.topolo.workers.dev",
|
|
138
141
|
people: "https://people.topolo.app",
|
|
@@ -149,12 +152,14 @@ var SERVICES = {
|
|
|
149
152
|
};
|
|
150
153
|
var PLATFORM_SERVICE_IDS = {
|
|
151
154
|
books: "srv_topolo_books",
|
|
155
|
+
compose: "srv_topolo_compose",
|
|
152
156
|
crm: "srv_iCwM4jGXcwlj",
|
|
153
157
|
customer_success: "srv_topolo_customer_success",
|
|
154
158
|
flow: "srv_topolo_flow",
|
|
155
159
|
forms: "srv_topolo_forms",
|
|
156
160
|
insights: "srv_topolo_insights",
|
|
157
161
|
inventory: "srv_topolo_inventory",
|
|
162
|
+
notify: "svc_topolo_notify",
|
|
158
163
|
people: "srv_topolo_people",
|
|
159
164
|
sign: "srv_topolo_sign",
|
|
160
165
|
survey: "srv_topolo_survey",
|
|
@@ -333,6 +338,29 @@ var APPLICATIONS = {
|
|
|
333
338
|
}
|
|
334
339
|
]
|
|
335
340
|
},
|
|
341
|
+
"capacity": {
|
|
342
|
+
"id": "capacity",
|
|
343
|
+
"appDir": "TopoloCapacity",
|
|
344
|
+
"name": "topolo-capacity",
|
|
345
|
+
"packageName": "topolo-capacity",
|
|
346
|
+
"productionUrl": "https://capacity.topolo.app",
|
|
347
|
+
"services": [
|
|
348
|
+
"capacity"
|
|
349
|
+
],
|
|
350
|
+
"deployTargets": [
|
|
351
|
+
{
|
|
352
|
+
"name": "topolo-capacity",
|
|
353
|
+
"kind": "worker",
|
|
354
|
+
"apiUrl": "https://topolo-capacity.topolo.workers.dev",
|
|
355
|
+
"domains": [
|
|
356
|
+
"capacity.topolo.app",
|
|
357
|
+
"topolo-capacity.topolo.workers.dev"
|
|
358
|
+
],
|
|
359
|
+
"routes": [],
|
|
360
|
+
"serviceId": "capacity"
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
},
|
|
336
364
|
"chat": {
|
|
337
365
|
"id": "chat",
|
|
338
366
|
"appDir": "TopoloChat",
|
|
@@ -430,6 +458,30 @@ var APPLICATIONS = {
|
|
|
430
458
|
}
|
|
431
459
|
]
|
|
432
460
|
},
|
|
461
|
+
"compose": {
|
|
462
|
+
"id": "compose",
|
|
463
|
+
"appDir": "TopoloCompose",
|
|
464
|
+
"name": "topolo-compose",
|
|
465
|
+
"packageName": "@topolo/compose",
|
|
466
|
+
"productionUrl": "https://compose.topolo.app",
|
|
467
|
+
"services": [
|
|
468
|
+
"compose"
|
|
469
|
+
],
|
|
470
|
+
"deployTargets": [
|
|
471
|
+
{
|
|
472
|
+
"name": "topolo-compose",
|
|
473
|
+
"kind": "worker",
|
|
474
|
+
"apiUrl": "https://compose.topolo.app",
|
|
475
|
+
"domains": [
|
|
476
|
+
"compose.topolo.app"
|
|
477
|
+
],
|
|
478
|
+
"routes": [
|
|
479
|
+
"compose.topolo.app"
|
|
480
|
+
],
|
|
481
|
+
"serviceId": "compose"
|
|
482
|
+
}
|
|
483
|
+
]
|
|
484
|
+
},
|
|
433
485
|
"crm": {
|
|
434
486
|
"id": "crm",
|
|
435
487
|
"appDir": "TopoloCRM",
|
|
@@ -847,6 +899,30 @@ var APPLICATIONS = {
|
|
|
847
899
|
}
|
|
848
900
|
]
|
|
849
901
|
},
|
|
902
|
+
"notify": {
|
|
903
|
+
"id": "notify",
|
|
904
|
+
"appDir": "TopoloNotify",
|
|
905
|
+
"name": "topolo-notify",
|
|
906
|
+
"packageName": "@topolo/notify",
|
|
907
|
+
"productionUrl": "https://notify.topolo.app",
|
|
908
|
+
"services": [
|
|
909
|
+
"notify"
|
|
910
|
+
],
|
|
911
|
+
"deployTargets": [
|
|
912
|
+
{
|
|
913
|
+
"name": "topolo-notify",
|
|
914
|
+
"kind": "worker",
|
|
915
|
+
"apiUrl": "https://notify.topolo.app",
|
|
916
|
+
"domains": [
|
|
917
|
+
"notify.topolo.app"
|
|
918
|
+
],
|
|
919
|
+
"routes": [
|
|
920
|
+
"notify.topolo.app"
|
|
921
|
+
],
|
|
922
|
+
"serviceId": "notify"
|
|
923
|
+
}
|
|
924
|
+
]
|
|
925
|
+
},
|
|
850
926
|
"one": {
|
|
851
927
|
"id": "one",
|
|
852
928
|
"appDir": "TopoloOne",
|
|
@@ -2023,6 +2099,7 @@ function validateWidget(widget, path, errors) {
|
|
|
2023
2099
|
validateNonEmptyString(widget.serviceId, `${path}.serviceId`, errors);
|
|
2024
2100
|
validateNonEmptyString(widget.serviceName, `${path}.serviceName`, errors);
|
|
2025
2101
|
validateNonEmptyString(widget.lastUpdated, `${path}.lastUpdated`, errors);
|
|
2102
|
+
validateSnapshotMetadata(widget.snapshot, `${path}.snapshot`, errors);
|
|
2026
2103
|
switch (widget.type) {
|
|
2027
2104
|
case "stats":
|
|
2028
2105
|
validateArray(widget.stats, `${path}.stats`, errors);
|
|
@@ -2053,6 +2130,40 @@ function validateWidget(widget, path, errors) {
|
|
|
2053
2130
|
errors.push(`${path}.type must be a supported Topolo widget type`);
|
|
2054
2131
|
}
|
|
2055
2132
|
}
|
|
2133
|
+
function validateSnapshotMetadata(snapshot, path, errors) {
|
|
2134
|
+
if (snapshot === void 0) {
|
|
2135
|
+
return;
|
|
2136
|
+
}
|
|
2137
|
+
if (!isRecord(snapshot)) {
|
|
2138
|
+
errors.push(`${path} must be an object when provided`);
|
|
2139
|
+
return;
|
|
2140
|
+
}
|
|
2141
|
+
if (snapshot.defaultMetricKeys !== void 0 && !Array.isArray(snapshot.defaultMetricKeys)) {
|
|
2142
|
+
errors.push(`${path}.defaultMetricKeys must be an array when provided`);
|
|
2143
|
+
}
|
|
2144
|
+
if (snapshot.highlights !== void 0 && !Array.isArray(snapshot.highlights)) {
|
|
2145
|
+
errors.push(`${path}.highlights must be an array when provided`);
|
|
2146
|
+
}
|
|
2147
|
+
if (snapshot.availableMetrics === void 0) {
|
|
2148
|
+
return;
|
|
2149
|
+
}
|
|
2150
|
+
if (!Array.isArray(snapshot.availableMetrics)) {
|
|
2151
|
+
errors.push(`${path}.availableMetrics must be an array when provided`);
|
|
2152
|
+
return;
|
|
2153
|
+
}
|
|
2154
|
+
snapshot.availableMetrics.forEach((metric, index) => {
|
|
2155
|
+
const metricPath = `${path}.availableMetrics[${index}]`;
|
|
2156
|
+
if (!isRecord(metric)) {
|
|
2157
|
+
errors.push(`${metricPath} must be an object`);
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2160
|
+
validateNonEmptyString(metric.key, `${metricPath}.key`, errors);
|
|
2161
|
+
validateNonEmptyString(metric.label, `${metricPath}.label`, errors);
|
|
2162
|
+
if (typeof metric.value !== "number" || Number.isNaN(metric.value)) {
|
|
2163
|
+
errors.push(`${metricPath}.value must be a number`);
|
|
2164
|
+
}
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2056
2167
|
function validateNonEmptyString(value, path, errors) {
|
|
2057
2168
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
2058
2169
|
errors.push(`${path} must be a non-empty string`);
|
package/dist/index.d.cts
CHANGED
|
@@ -38,8 +38,10 @@ declare const SERVICES: {
|
|
|
38
38
|
readonly bugfix: "https://bugfix.topolo.app";
|
|
39
39
|
readonly bytes: "https://r2-media-manager-worker.topolo.workers.dev";
|
|
40
40
|
readonly calendar: "https://calendar.topolo.app";
|
|
41
|
+
readonly capacity: "https://topolo-capacity.topolo.workers.dev";
|
|
41
42
|
readonly chat: "https://chat.topolo.app";
|
|
42
43
|
readonly commerce: "https://topolo-commerce-api.topolo.workers.dev";
|
|
44
|
+
readonly compose: "https://compose.topolo.app";
|
|
43
45
|
readonly crm: "https://crm-api.topolo.app";
|
|
44
46
|
readonly customer_success: "https://customer-success.topolo.app";
|
|
45
47
|
readonly feed: "https://topolo-feed-api.topolo.app";
|
|
@@ -53,6 +55,7 @@ declare const SERVICES: {
|
|
|
53
55
|
readonly mdm: "https://topolo-mdm-api.topolo.app";
|
|
54
56
|
readonly messaging: "https://messages.topolo.app";
|
|
55
57
|
readonly nexus: "https://topolo-nexus-gateway.topolo.workers.dev";
|
|
58
|
+
readonly notify: "https://notify.topolo.app";
|
|
56
59
|
readonly one: "https://one.topolo.app";
|
|
57
60
|
readonly pay: "https://topolo-pay.topolo.workers.dev";
|
|
58
61
|
readonly people: "https://people.topolo.app";
|
|
@@ -197,6 +200,22 @@ declare const APPLICATIONS: {
|
|
|
197
200
|
readonly serviceId: "calendar";
|
|
198
201
|
}];
|
|
199
202
|
};
|
|
203
|
+
readonly capacity: {
|
|
204
|
+
readonly id: "capacity";
|
|
205
|
+
readonly appDir: "TopoloCapacity";
|
|
206
|
+
readonly name: "topolo-capacity";
|
|
207
|
+
readonly packageName: "topolo-capacity";
|
|
208
|
+
readonly productionUrl: "https://capacity.topolo.app";
|
|
209
|
+
readonly services: readonly ["capacity"];
|
|
210
|
+
readonly deployTargets: readonly [{
|
|
211
|
+
readonly name: "topolo-capacity";
|
|
212
|
+
readonly kind: "worker";
|
|
213
|
+
readonly apiUrl: "https://topolo-capacity.topolo.workers.dev";
|
|
214
|
+
readonly domains: readonly ["capacity.topolo.app", "topolo-capacity.topolo.workers.dev"];
|
|
215
|
+
readonly routes: readonly [];
|
|
216
|
+
readonly serviceId: "capacity";
|
|
217
|
+
}];
|
|
218
|
+
};
|
|
200
219
|
readonly chat: {
|
|
201
220
|
readonly id: "chat";
|
|
202
221
|
readonly appDir: "TopoloChat";
|
|
@@ -268,6 +287,22 @@ declare const APPLICATIONS: {
|
|
|
268
287
|
readonly serviceId: null;
|
|
269
288
|
}];
|
|
270
289
|
};
|
|
290
|
+
readonly compose: {
|
|
291
|
+
readonly id: "compose";
|
|
292
|
+
readonly appDir: "TopoloCompose";
|
|
293
|
+
readonly name: "topolo-compose";
|
|
294
|
+
readonly packageName: "@topolo/compose";
|
|
295
|
+
readonly productionUrl: "https://compose.topolo.app";
|
|
296
|
+
readonly services: readonly ["compose"];
|
|
297
|
+
readonly deployTargets: readonly [{
|
|
298
|
+
readonly name: "topolo-compose";
|
|
299
|
+
readonly kind: "worker";
|
|
300
|
+
readonly apiUrl: "https://compose.topolo.app";
|
|
301
|
+
readonly domains: readonly ["compose.topolo.app"];
|
|
302
|
+
readonly routes: readonly ["compose.topolo.app"];
|
|
303
|
+
readonly serviceId: "compose";
|
|
304
|
+
}];
|
|
305
|
+
};
|
|
271
306
|
readonly crm: {
|
|
272
307
|
readonly id: "crm";
|
|
273
308
|
readonly appDir: "TopoloCRM";
|
|
@@ -566,6 +601,22 @@ declare const APPLICATIONS: {
|
|
|
566
601
|
readonly serviceId: "nexus";
|
|
567
602
|
}];
|
|
568
603
|
};
|
|
604
|
+
readonly notify: {
|
|
605
|
+
readonly id: "notify";
|
|
606
|
+
readonly appDir: "TopoloNotify";
|
|
607
|
+
readonly name: "topolo-notify";
|
|
608
|
+
readonly packageName: "@topolo/notify";
|
|
609
|
+
readonly productionUrl: "https://notify.topolo.app";
|
|
610
|
+
readonly services: readonly ["notify"];
|
|
611
|
+
readonly deployTargets: readonly [{
|
|
612
|
+
readonly name: "topolo-notify";
|
|
613
|
+
readonly kind: "worker";
|
|
614
|
+
readonly apiUrl: "https://notify.topolo.app";
|
|
615
|
+
readonly domains: readonly ["notify.topolo.app"];
|
|
616
|
+
readonly routes: readonly ["notify.topolo.app"];
|
|
617
|
+
readonly serviceId: "notify";
|
|
618
|
+
}];
|
|
619
|
+
};
|
|
569
620
|
readonly one: {
|
|
570
621
|
readonly id: "one";
|
|
571
622
|
readonly appDir: "TopoloOne";
|
|
@@ -1244,13 +1295,14 @@ declare class TopoloOAuth {
|
|
|
1244
1295
|
|
|
1245
1296
|
declare const TOPOLO_WIDGET_ENDPOINT = "/api/widget";
|
|
1246
1297
|
declare const TOPOLO_WIDGET_REFRESH_INTERVAL_MS = 60000;
|
|
1247
|
-
type TopoloWidgetType =
|
|
1298
|
+
type TopoloWidgetType = "stats" | "recent-activity" | "quick-actions" | "notifications" | "chart";
|
|
1248
1299
|
interface TopoloWidgetBase {
|
|
1249
1300
|
serviceId: string;
|
|
1250
1301
|
serviceName: string;
|
|
1251
1302
|
serviceIcon?: string;
|
|
1252
1303
|
type: TopoloWidgetType;
|
|
1253
1304
|
lastUpdated: string;
|
|
1305
|
+
snapshot?: TopoloWidgetSnapshotMetadata;
|
|
1254
1306
|
}
|
|
1255
1307
|
interface TopoloWidgetMetric {
|
|
1256
1308
|
label: string;
|
|
@@ -1259,8 +1311,27 @@ interface TopoloWidgetMetric {
|
|
|
1259
1311
|
changeLabel?: string;
|
|
1260
1312
|
icon?: string;
|
|
1261
1313
|
}
|
|
1314
|
+
interface TopoloWidgetSnapshotMetric {
|
|
1315
|
+
key: string;
|
|
1316
|
+
label: string;
|
|
1317
|
+
value: number;
|
|
1318
|
+
unit?: string;
|
|
1319
|
+
change?: number;
|
|
1320
|
+
changeLabel?: string;
|
|
1321
|
+
}
|
|
1322
|
+
interface TopoloWidgetSnapshotMetadata {
|
|
1323
|
+
presetKey?: string;
|
|
1324
|
+
audience?: string;
|
|
1325
|
+
scope?: string;
|
|
1326
|
+
scopeLabel?: string;
|
|
1327
|
+
generatedAt?: string;
|
|
1328
|
+
summary?: string;
|
|
1329
|
+
defaultMetricKeys?: string[];
|
|
1330
|
+
availableMetrics?: TopoloWidgetSnapshotMetric[];
|
|
1331
|
+
highlights?: string[];
|
|
1332
|
+
}
|
|
1262
1333
|
interface TopoloStatsWidget extends TopoloWidgetBase {
|
|
1263
|
-
type:
|
|
1334
|
+
type: "stats";
|
|
1264
1335
|
stats: TopoloWidgetMetric[];
|
|
1265
1336
|
}
|
|
1266
1337
|
interface TopoloWidgetActivityItem {
|
|
@@ -1272,7 +1343,7 @@ interface TopoloWidgetActivityItem {
|
|
|
1272
1343
|
link?: string;
|
|
1273
1344
|
}
|
|
1274
1345
|
interface TopoloRecentActivityWidget extends TopoloWidgetBase {
|
|
1275
|
-
type:
|
|
1346
|
+
type: "recent-activity";
|
|
1276
1347
|
activities: TopoloWidgetActivityItem[];
|
|
1277
1348
|
}
|
|
1278
1349
|
interface TopoloWidgetActionItem {
|
|
@@ -1283,26 +1354,26 @@ interface TopoloWidgetActionItem {
|
|
|
1283
1354
|
primary?: boolean;
|
|
1284
1355
|
}
|
|
1285
1356
|
interface TopoloQuickActionsWidget extends TopoloWidgetBase {
|
|
1286
|
-
type:
|
|
1357
|
+
type: "quick-actions";
|
|
1287
1358
|
actions: TopoloWidgetActionItem[];
|
|
1288
1359
|
}
|
|
1289
1360
|
interface TopoloWidgetNotificationItem {
|
|
1290
1361
|
id: string;
|
|
1291
1362
|
title: string;
|
|
1292
1363
|
message: string;
|
|
1293
|
-
type:
|
|
1364
|
+
type: "info" | "warning" | "error" | "success";
|
|
1294
1365
|
timestamp: string;
|
|
1295
1366
|
read: boolean;
|
|
1296
1367
|
link?: string;
|
|
1297
1368
|
}
|
|
1298
1369
|
interface TopoloNotificationsWidget extends TopoloWidgetBase {
|
|
1299
|
-
type:
|
|
1370
|
+
type: "notifications";
|
|
1300
1371
|
notifications: TopoloWidgetNotificationItem[];
|
|
1301
1372
|
unreadCount: number;
|
|
1302
1373
|
}
|
|
1303
1374
|
interface TopoloChartWidget extends TopoloWidgetBase {
|
|
1304
|
-
type:
|
|
1305
|
-
chartType:
|
|
1375
|
+
type: "chart";
|
|
1376
|
+
chartType: "line" | "bar" | "pie" | "donut";
|
|
1306
1377
|
title: string;
|
|
1307
1378
|
data: {
|
|
1308
1379
|
labels: string[];
|
|
@@ -1310,7 +1381,7 @@ interface TopoloChartWidget extends TopoloWidgetBase {
|
|
|
1310
1381
|
};
|
|
1311
1382
|
}
|
|
1312
1383
|
type TopoloWidget = TopoloStatsWidget | TopoloRecentActivityWidget | TopoloQuickActionsWidget | TopoloNotificationsWidget | TopoloChartWidget;
|
|
1313
|
-
type TopoloWidgetWithOptionalMetadata<T extends TopoloWidget> = Omit<T,
|
|
1384
|
+
type TopoloWidgetWithOptionalMetadata<T extends TopoloWidget> = Omit<T, "serviceId" | "serviceName" | "lastUpdated"> & Partial<Pick<TopoloWidgetBase, "serviceId" | "serviceName" | "lastUpdated">>;
|
|
1314
1385
|
type TopoloWidgetDraft = TopoloWidget extends infer Widget ? Widget extends TopoloWidget ? TopoloWidgetWithOptionalMetadata<Widget> : never : never;
|
|
1315
1386
|
interface TopoloWidgetApiResponse {
|
|
1316
1387
|
success: boolean;
|
|
@@ -1335,11 +1406,11 @@ interface TopoloWidgetConfig {
|
|
|
1335
1406
|
enabled: boolean;
|
|
1336
1407
|
refreshInterval: number;
|
|
1337
1408
|
}
|
|
1338
|
-
declare function defineTopoloStatsWidget(widget: Omit<TopoloStatsWidget,
|
|
1339
|
-
declare function defineTopoloRecentActivityWidget(widget: Omit<TopoloRecentActivityWidget,
|
|
1340
|
-
declare function defineTopoloQuickActionsWidget(widget: Omit<TopoloQuickActionsWidget,
|
|
1341
|
-
declare function defineTopoloNotificationsWidget(widget: Omit<TopoloNotificationsWidget,
|
|
1342
|
-
declare function defineTopoloChartWidget(widget: Omit<TopoloChartWidget,
|
|
1409
|
+
declare function defineTopoloStatsWidget(widget: Omit<TopoloStatsWidget, "type">): TopoloStatsWidget;
|
|
1410
|
+
declare function defineTopoloRecentActivityWidget(widget: Omit<TopoloRecentActivityWidget, "type">): TopoloRecentActivityWidget;
|
|
1411
|
+
declare function defineTopoloQuickActionsWidget(widget: Omit<TopoloQuickActionsWidget, "type">): TopoloQuickActionsWidget;
|
|
1412
|
+
declare function defineTopoloNotificationsWidget(widget: Omit<TopoloNotificationsWidget, "type">): TopoloNotificationsWidget;
|
|
1413
|
+
declare function defineTopoloChartWidget(widget: Omit<TopoloChartWidget, "type">): TopoloChartWidget;
|
|
1343
1414
|
declare function createTopoloWidgetResponse({ serviceId, serviceName, widgets, now, }: TopoloWidgetResponseOptions): TopoloWidgetApiResponse;
|
|
1344
1415
|
declare function createTopoloWidgetError(error: string): TopoloWidgetApiResponse;
|
|
1345
1416
|
declare function validateTopoloWidgetResponse(response: unknown): TopoloWidgetValidationResult;
|
|
@@ -1358,4 +1429,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
1358
1429
|
};
|
|
1359
1430
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
1360
1431
|
|
|
1361
|
-
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, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, PLATFORM_SERVICE_IDS, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };
|
|
1432
|
+
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, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, PLATFORM_SERVICE_IDS, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, 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, resolveServiceUrl, validateTopoloWidgetResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,8 +38,10 @@ declare const SERVICES: {
|
|
|
38
38
|
readonly bugfix: "https://bugfix.topolo.app";
|
|
39
39
|
readonly bytes: "https://r2-media-manager-worker.topolo.workers.dev";
|
|
40
40
|
readonly calendar: "https://calendar.topolo.app";
|
|
41
|
+
readonly capacity: "https://topolo-capacity.topolo.workers.dev";
|
|
41
42
|
readonly chat: "https://chat.topolo.app";
|
|
42
43
|
readonly commerce: "https://topolo-commerce-api.topolo.workers.dev";
|
|
44
|
+
readonly compose: "https://compose.topolo.app";
|
|
43
45
|
readonly crm: "https://crm-api.topolo.app";
|
|
44
46
|
readonly customer_success: "https://customer-success.topolo.app";
|
|
45
47
|
readonly feed: "https://topolo-feed-api.topolo.app";
|
|
@@ -53,6 +55,7 @@ declare const SERVICES: {
|
|
|
53
55
|
readonly mdm: "https://topolo-mdm-api.topolo.app";
|
|
54
56
|
readonly messaging: "https://messages.topolo.app";
|
|
55
57
|
readonly nexus: "https://topolo-nexus-gateway.topolo.workers.dev";
|
|
58
|
+
readonly notify: "https://notify.topolo.app";
|
|
56
59
|
readonly one: "https://one.topolo.app";
|
|
57
60
|
readonly pay: "https://topolo-pay.topolo.workers.dev";
|
|
58
61
|
readonly people: "https://people.topolo.app";
|
|
@@ -197,6 +200,22 @@ declare const APPLICATIONS: {
|
|
|
197
200
|
readonly serviceId: "calendar";
|
|
198
201
|
}];
|
|
199
202
|
};
|
|
203
|
+
readonly capacity: {
|
|
204
|
+
readonly id: "capacity";
|
|
205
|
+
readonly appDir: "TopoloCapacity";
|
|
206
|
+
readonly name: "topolo-capacity";
|
|
207
|
+
readonly packageName: "topolo-capacity";
|
|
208
|
+
readonly productionUrl: "https://capacity.topolo.app";
|
|
209
|
+
readonly services: readonly ["capacity"];
|
|
210
|
+
readonly deployTargets: readonly [{
|
|
211
|
+
readonly name: "topolo-capacity";
|
|
212
|
+
readonly kind: "worker";
|
|
213
|
+
readonly apiUrl: "https://topolo-capacity.topolo.workers.dev";
|
|
214
|
+
readonly domains: readonly ["capacity.topolo.app", "topolo-capacity.topolo.workers.dev"];
|
|
215
|
+
readonly routes: readonly [];
|
|
216
|
+
readonly serviceId: "capacity";
|
|
217
|
+
}];
|
|
218
|
+
};
|
|
200
219
|
readonly chat: {
|
|
201
220
|
readonly id: "chat";
|
|
202
221
|
readonly appDir: "TopoloChat";
|
|
@@ -268,6 +287,22 @@ declare const APPLICATIONS: {
|
|
|
268
287
|
readonly serviceId: null;
|
|
269
288
|
}];
|
|
270
289
|
};
|
|
290
|
+
readonly compose: {
|
|
291
|
+
readonly id: "compose";
|
|
292
|
+
readonly appDir: "TopoloCompose";
|
|
293
|
+
readonly name: "topolo-compose";
|
|
294
|
+
readonly packageName: "@topolo/compose";
|
|
295
|
+
readonly productionUrl: "https://compose.topolo.app";
|
|
296
|
+
readonly services: readonly ["compose"];
|
|
297
|
+
readonly deployTargets: readonly [{
|
|
298
|
+
readonly name: "topolo-compose";
|
|
299
|
+
readonly kind: "worker";
|
|
300
|
+
readonly apiUrl: "https://compose.topolo.app";
|
|
301
|
+
readonly domains: readonly ["compose.topolo.app"];
|
|
302
|
+
readonly routes: readonly ["compose.topolo.app"];
|
|
303
|
+
readonly serviceId: "compose";
|
|
304
|
+
}];
|
|
305
|
+
};
|
|
271
306
|
readonly crm: {
|
|
272
307
|
readonly id: "crm";
|
|
273
308
|
readonly appDir: "TopoloCRM";
|
|
@@ -566,6 +601,22 @@ declare const APPLICATIONS: {
|
|
|
566
601
|
readonly serviceId: "nexus";
|
|
567
602
|
}];
|
|
568
603
|
};
|
|
604
|
+
readonly notify: {
|
|
605
|
+
readonly id: "notify";
|
|
606
|
+
readonly appDir: "TopoloNotify";
|
|
607
|
+
readonly name: "topolo-notify";
|
|
608
|
+
readonly packageName: "@topolo/notify";
|
|
609
|
+
readonly productionUrl: "https://notify.topolo.app";
|
|
610
|
+
readonly services: readonly ["notify"];
|
|
611
|
+
readonly deployTargets: readonly [{
|
|
612
|
+
readonly name: "topolo-notify";
|
|
613
|
+
readonly kind: "worker";
|
|
614
|
+
readonly apiUrl: "https://notify.topolo.app";
|
|
615
|
+
readonly domains: readonly ["notify.topolo.app"];
|
|
616
|
+
readonly routes: readonly ["notify.topolo.app"];
|
|
617
|
+
readonly serviceId: "notify";
|
|
618
|
+
}];
|
|
619
|
+
};
|
|
569
620
|
readonly one: {
|
|
570
621
|
readonly id: "one";
|
|
571
622
|
readonly appDir: "TopoloOne";
|
|
@@ -1244,13 +1295,14 @@ declare class TopoloOAuth {
|
|
|
1244
1295
|
|
|
1245
1296
|
declare const TOPOLO_WIDGET_ENDPOINT = "/api/widget";
|
|
1246
1297
|
declare const TOPOLO_WIDGET_REFRESH_INTERVAL_MS = 60000;
|
|
1247
|
-
type TopoloWidgetType =
|
|
1298
|
+
type TopoloWidgetType = "stats" | "recent-activity" | "quick-actions" | "notifications" | "chart";
|
|
1248
1299
|
interface TopoloWidgetBase {
|
|
1249
1300
|
serviceId: string;
|
|
1250
1301
|
serviceName: string;
|
|
1251
1302
|
serviceIcon?: string;
|
|
1252
1303
|
type: TopoloWidgetType;
|
|
1253
1304
|
lastUpdated: string;
|
|
1305
|
+
snapshot?: TopoloWidgetSnapshotMetadata;
|
|
1254
1306
|
}
|
|
1255
1307
|
interface TopoloWidgetMetric {
|
|
1256
1308
|
label: string;
|
|
@@ -1259,8 +1311,27 @@ interface TopoloWidgetMetric {
|
|
|
1259
1311
|
changeLabel?: string;
|
|
1260
1312
|
icon?: string;
|
|
1261
1313
|
}
|
|
1314
|
+
interface TopoloWidgetSnapshotMetric {
|
|
1315
|
+
key: string;
|
|
1316
|
+
label: string;
|
|
1317
|
+
value: number;
|
|
1318
|
+
unit?: string;
|
|
1319
|
+
change?: number;
|
|
1320
|
+
changeLabel?: string;
|
|
1321
|
+
}
|
|
1322
|
+
interface TopoloWidgetSnapshotMetadata {
|
|
1323
|
+
presetKey?: string;
|
|
1324
|
+
audience?: string;
|
|
1325
|
+
scope?: string;
|
|
1326
|
+
scopeLabel?: string;
|
|
1327
|
+
generatedAt?: string;
|
|
1328
|
+
summary?: string;
|
|
1329
|
+
defaultMetricKeys?: string[];
|
|
1330
|
+
availableMetrics?: TopoloWidgetSnapshotMetric[];
|
|
1331
|
+
highlights?: string[];
|
|
1332
|
+
}
|
|
1262
1333
|
interface TopoloStatsWidget extends TopoloWidgetBase {
|
|
1263
|
-
type:
|
|
1334
|
+
type: "stats";
|
|
1264
1335
|
stats: TopoloWidgetMetric[];
|
|
1265
1336
|
}
|
|
1266
1337
|
interface TopoloWidgetActivityItem {
|
|
@@ -1272,7 +1343,7 @@ interface TopoloWidgetActivityItem {
|
|
|
1272
1343
|
link?: string;
|
|
1273
1344
|
}
|
|
1274
1345
|
interface TopoloRecentActivityWidget extends TopoloWidgetBase {
|
|
1275
|
-
type:
|
|
1346
|
+
type: "recent-activity";
|
|
1276
1347
|
activities: TopoloWidgetActivityItem[];
|
|
1277
1348
|
}
|
|
1278
1349
|
interface TopoloWidgetActionItem {
|
|
@@ -1283,26 +1354,26 @@ interface TopoloWidgetActionItem {
|
|
|
1283
1354
|
primary?: boolean;
|
|
1284
1355
|
}
|
|
1285
1356
|
interface TopoloQuickActionsWidget extends TopoloWidgetBase {
|
|
1286
|
-
type:
|
|
1357
|
+
type: "quick-actions";
|
|
1287
1358
|
actions: TopoloWidgetActionItem[];
|
|
1288
1359
|
}
|
|
1289
1360
|
interface TopoloWidgetNotificationItem {
|
|
1290
1361
|
id: string;
|
|
1291
1362
|
title: string;
|
|
1292
1363
|
message: string;
|
|
1293
|
-
type:
|
|
1364
|
+
type: "info" | "warning" | "error" | "success";
|
|
1294
1365
|
timestamp: string;
|
|
1295
1366
|
read: boolean;
|
|
1296
1367
|
link?: string;
|
|
1297
1368
|
}
|
|
1298
1369
|
interface TopoloNotificationsWidget extends TopoloWidgetBase {
|
|
1299
|
-
type:
|
|
1370
|
+
type: "notifications";
|
|
1300
1371
|
notifications: TopoloWidgetNotificationItem[];
|
|
1301
1372
|
unreadCount: number;
|
|
1302
1373
|
}
|
|
1303
1374
|
interface TopoloChartWidget extends TopoloWidgetBase {
|
|
1304
|
-
type:
|
|
1305
|
-
chartType:
|
|
1375
|
+
type: "chart";
|
|
1376
|
+
chartType: "line" | "bar" | "pie" | "donut";
|
|
1306
1377
|
title: string;
|
|
1307
1378
|
data: {
|
|
1308
1379
|
labels: string[];
|
|
@@ -1310,7 +1381,7 @@ interface TopoloChartWidget extends TopoloWidgetBase {
|
|
|
1310
1381
|
};
|
|
1311
1382
|
}
|
|
1312
1383
|
type TopoloWidget = TopoloStatsWidget | TopoloRecentActivityWidget | TopoloQuickActionsWidget | TopoloNotificationsWidget | TopoloChartWidget;
|
|
1313
|
-
type TopoloWidgetWithOptionalMetadata<T extends TopoloWidget> = Omit<T,
|
|
1384
|
+
type TopoloWidgetWithOptionalMetadata<T extends TopoloWidget> = Omit<T, "serviceId" | "serviceName" | "lastUpdated"> & Partial<Pick<TopoloWidgetBase, "serviceId" | "serviceName" | "lastUpdated">>;
|
|
1314
1385
|
type TopoloWidgetDraft = TopoloWidget extends infer Widget ? Widget extends TopoloWidget ? TopoloWidgetWithOptionalMetadata<Widget> : never : never;
|
|
1315
1386
|
interface TopoloWidgetApiResponse {
|
|
1316
1387
|
success: boolean;
|
|
@@ -1335,11 +1406,11 @@ interface TopoloWidgetConfig {
|
|
|
1335
1406
|
enabled: boolean;
|
|
1336
1407
|
refreshInterval: number;
|
|
1337
1408
|
}
|
|
1338
|
-
declare function defineTopoloStatsWidget(widget: Omit<TopoloStatsWidget,
|
|
1339
|
-
declare function defineTopoloRecentActivityWidget(widget: Omit<TopoloRecentActivityWidget,
|
|
1340
|
-
declare function defineTopoloQuickActionsWidget(widget: Omit<TopoloQuickActionsWidget,
|
|
1341
|
-
declare function defineTopoloNotificationsWidget(widget: Omit<TopoloNotificationsWidget,
|
|
1342
|
-
declare function defineTopoloChartWidget(widget: Omit<TopoloChartWidget,
|
|
1409
|
+
declare function defineTopoloStatsWidget(widget: Omit<TopoloStatsWidget, "type">): TopoloStatsWidget;
|
|
1410
|
+
declare function defineTopoloRecentActivityWidget(widget: Omit<TopoloRecentActivityWidget, "type">): TopoloRecentActivityWidget;
|
|
1411
|
+
declare function defineTopoloQuickActionsWidget(widget: Omit<TopoloQuickActionsWidget, "type">): TopoloQuickActionsWidget;
|
|
1412
|
+
declare function defineTopoloNotificationsWidget(widget: Omit<TopoloNotificationsWidget, "type">): TopoloNotificationsWidget;
|
|
1413
|
+
declare function defineTopoloChartWidget(widget: Omit<TopoloChartWidget, "type">): TopoloChartWidget;
|
|
1343
1414
|
declare function createTopoloWidgetResponse({ serviceId, serviceName, widgets, now, }: TopoloWidgetResponseOptions): TopoloWidgetApiResponse;
|
|
1344
1415
|
declare function createTopoloWidgetError(error: string): TopoloWidgetApiResponse;
|
|
1345
1416
|
declare function validateTopoloWidgetResponse(response: unknown): TopoloWidgetValidationResult;
|
|
@@ -1358,4 +1429,4 @@ declare function createTopolo(options: TopoloClientOptions): {
|
|
|
1358
1429
|
};
|
|
1359
1430
|
type Topolo = ReturnType<typeof createTopolo>;
|
|
1360
1431
|
|
|
1361
|
-
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, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, PLATFORM_SERVICE_IDS, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };
|
|
1432
|
+
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, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, PLATFORM_SERVICE_IDS, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, 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, resolveServiceUrl, validateTopoloWidgetResponse };
|