@topolo/sdk 0.9.8 → 0.9.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.js CHANGED
@@ -106,6 +106,7 @@ var APP_API_URLS = {
106
106
  agent: "https://agent.topolo.app",
107
107
  auth: "https://auth.topolo.app",
108
108
  backup: "https://backup.topolo.app",
109
+ blog: "https://blog.topolo.app",
109
110
  books: "https://books.topolo.app",
110
111
  brand: "https://brand.topolo.app",
111
112
  bugfix: "https://bugfix.topolo.app",
@@ -118,6 +119,7 @@ var APP_API_URLS = {
118
119
  compose: "https://compose.topolo.app",
119
120
  consent: "https://consent.topolo.app",
120
121
  crm: "https://crm.topolo.app",
122
+ design: "https://design.topolo.app",
121
123
  developers: "https://developers.topolo.app",
122
124
  director: "https://director.topolo.app",
123
125
  feed: "https://feed.topolo.app",
@@ -203,7 +205,9 @@ var APPLICATIONS = {
203
205
  "domains": [
204
206
  "agent.topolo.app"
205
207
  ],
206
- "routes": [],
208
+ "routes": [
209
+ "agent.topolo.app"
210
+ ],
207
211
  "appId": "agent"
208
212
  },
209
213
  {
@@ -264,6 +268,38 @@ var APPLICATIONS = {
264
268
  }
265
269
  ]
266
270
  },
271
+ "blog": {
272
+ "id": "blog",
273
+ "appDir": "TopoloBlog",
274
+ "name": "topolo-blog",
275
+ "packageName": "topolo-blog",
276
+ "productionUrl": "https://blog.topolo.app",
277
+ "services": [
278
+ "blog"
279
+ ],
280
+ "deployTargets": [
281
+ {
282
+ "name": "topolo-blog",
283
+ "kind": "worker",
284
+ "apiUrl": "https://blog.topolo.app",
285
+ "domains": [
286
+ "blog.topolo.app"
287
+ ],
288
+ "routes": [
289
+ "blog.topolo.app"
290
+ ],
291
+ "appId": "blog"
292
+ },
293
+ {
294
+ "name": "topolo-blog-api",
295
+ "kind": "worker",
296
+ "apiUrl": null,
297
+ "domains": [],
298
+ "routes": [],
299
+ "appId": null
300
+ }
301
+ ]
302
+ },
267
303
  "books": {
268
304
  "id": "books",
269
305
  "appDir": "TopoloBooks",
@@ -281,7 +317,9 @@ var APPLICATIONS = {
281
317
  "domains": [
282
318
  "books.topolo.app"
283
319
  ],
284
- "routes": [],
320
+ "routes": [
321
+ "books.topolo.app"
322
+ ],
285
323
  "appId": "books"
286
324
  },
287
325
  {
@@ -431,7 +469,9 @@ var APPLICATIONS = {
431
469
  "domains": [
432
470
  "campaigns.topolo.app"
433
471
  ],
434
- "routes": [],
472
+ "routes": [
473
+ "campaigns.topolo.app"
474
+ ],
435
475
  "appId": "campaigns"
436
476
  },
437
477
  {
@@ -573,7 +613,9 @@ var APPLICATIONS = {
573
613
  "domains": [
574
614
  "compose.topolo.app"
575
615
  ],
576
- "routes": [],
616
+ "routes": [
617
+ "compose.topolo.app"
618
+ ],
577
619
  "appId": "compose"
578
620
  },
579
621
  {
@@ -603,7 +645,9 @@ var APPLICATIONS = {
603
645
  "domains": [
604
646
  "consent.topolo.app"
605
647
  ],
606
- "routes": [],
648
+ "routes": [
649
+ "consent.topolo.app"
650
+ ],
607
651
  "appId": "consent"
608
652
  },
609
653
  {
@@ -641,11 +685,45 @@ var APPLICATIONS = {
641
685
  "domains": [
642
686
  "crm.topolo.app"
643
687
  ],
644
- "routes": [],
688
+ "routes": [
689
+ "crm.topolo.app"
690
+ ],
645
691
  "appId": "crm"
646
692
  }
647
693
  ]
648
694
  },
695
+ "design": {
696
+ "id": "design",
697
+ "appDir": "TopoloDesign",
698
+ "name": "topolo-design",
699
+ "packageName": "@topolo-io/design",
700
+ "productionUrl": "https://design.topolo.app",
701
+ "services": [
702
+ "design"
703
+ ],
704
+ "deployTargets": [
705
+ {
706
+ "name": "topolo-design",
707
+ "kind": "worker",
708
+ "apiUrl": "https://design.topolo.app",
709
+ "domains": [
710
+ "design.topolo.app"
711
+ ],
712
+ "routes": [
713
+ "design.topolo.app"
714
+ ],
715
+ "appId": "design"
716
+ },
717
+ {
718
+ "name": "topolo-design-api",
719
+ "kind": "worker",
720
+ "apiUrl": null,
721
+ "domains": [],
722
+ "routes": [],
723
+ "appId": null
724
+ }
725
+ ]
726
+ },
649
727
  "developers": {
650
728
  "id": "developers",
651
729
  "appDir": "TopoloDevelopers",
@@ -671,7 +749,9 @@ var APPLICATIONS = {
671
749
  "domains": [
672
750
  "developers.topolo.app"
673
751
  ],
674
- "routes": [],
752
+ "routes": [
753
+ "developers.topolo.app"
754
+ ],
675
755
  "appId": "developers"
676
756
  },
677
757
  {
@@ -701,7 +781,9 @@ var APPLICATIONS = {
701
781
  "domains": [
702
782
  "director.topolo.app"
703
783
  ],
704
- "routes": [],
784
+ "routes": [
785
+ "director.topolo.app"
786
+ ],
705
787
  "appId": "director"
706
788
  },
707
789
  {
@@ -809,7 +891,9 @@ var APPLICATIONS = {
809
891
  "domains": [
810
892
  "flow.topolo.app"
811
893
  ],
812
- "routes": [],
894
+ "routes": [
895
+ "flow.topolo.app"
896
+ ],
813
897
  "appId": "flow"
814
898
  },
815
899
  {
@@ -839,7 +923,9 @@ var APPLICATIONS = {
839
923
  "domains": [
840
924
  "forecast.topolo.app"
841
925
  ],
842
- "routes": [],
926
+ "routes": [
927
+ "forecast.topolo.app"
928
+ ],
843
929
  "appId": "forecast"
844
930
  },
845
931
  {
@@ -869,7 +955,9 @@ var APPLICATIONS = {
869
955
  "domains": [
870
956
  "forms.topolo.app"
871
957
  ],
872
- "routes": [],
958
+ "routes": [
959
+ "forms.topolo.app"
960
+ ],
873
961
  "appId": "forms"
874
962
  },
875
963
  {
@@ -931,7 +1019,9 @@ var APPLICATIONS = {
931
1019
  "domains": [
932
1020
  "insights.topolo.app"
933
1021
  ],
934
- "routes": [],
1022
+ "routes": [
1023
+ "insights.topolo.app"
1024
+ ],
935
1025
  "appId": "insights"
936
1026
  },
937
1027
  {
@@ -961,7 +1051,9 @@ var APPLICATIONS = {
961
1051
  "domains": [
962
1052
  "inventory.topolo.app"
963
1053
  ],
964
- "routes": [],
1054
+ "routes": [
1055
+ "inventory.topolo.app"
1056
+ ],
965
1057
  "appId": "inventory"
966
1058
  },
967
1059
  {
@@ -1315,7 +1407,9 @@ var APPLICATIONS = {
1315
1407
  "domains": [
1316
1408
  "pay.topolo.app"
1317
1409
  ],
1318
- "routes": [],
1410
+ "routes": [
1411
+ "pay.topolo.app"
1412
+ ],
1319
1413
  "appId": "pay"
1320
1414
  },
1321
1415
  {
@@ -1345,7 +1439,9 @@ var APPLICATIONS = {
1345
1439
  "domains": [
1346
1440
  "people.topolo.app"
1347
1441
  ],
1348
- "routes": [],
1442
+ "routes": [
1443
+ "people.topolo.app"
1444
+ ],
1349
1445
  "appId": "people"
1350
1446
  },
1351
1447
  {
@@ -1424,7 +1520,9 @@ var APPLICATIONS = {
1424
1520
  "domains": [
1425
1521
  "roadmapper.topolo.app"
1426
1522
  ],
1427
- "routes": [],
1523
+ "routes": [
1524
+ "roadmapper.topolo.app"
1525
+ ],
1428
1526
  "appId": "roadmapper"
1429
1527
  },
1430
1528
  {
@@ -1454,7 +1552,9 @@ var APPLICATIONS = {
1454
1552
  "domains": [
1455
1553
  "sign.topolo.app"
1456
1554
  ],
1457
- "routes": [],
1555
+ "routes": [
1556
+ "sign.topolo.app"
1557
+ ],
1458
1558
  "appId": "sign"
1459
1559
  },
1460
1560
  {
@@ -1568,7 +1668,9 @@ var APPLICATIONS = {
1568
1668
  "domains": [
1569
1669
  "spaces.topolo.app"
1570
1670
  ],
1571
- "routes": [],
1671
+ "routes": [
1672
+ "spaces.topolo.app"
1673
+ ],
1572
1674
  "appId": "spaces"
1573
1675
  },
1574
1676
  {
@@ -1686,7 +1788,9 @@ var APPLICATIONS = {
1686
1788
  "domains": [
1687
1789
  "survey.topolo.app"
1688
1790
  ],
1689
- "routes": [],
1791
+ "routes": [
1792
+ "survey.topolo.app"
1793
+ ],
1690
1794
  "appId": "survey"
1691
1795
  },
1692
1796
  {
@@ -3636,10 +3740,19 @@ function mapActionInput(action, input) {
3636
3740
  delete remaining[key];
3637
3741
  return encodeURIComponent(String(value));
3638
3742
  });
3639
- const explicitQuery = plainObject(remaining.query);
3640
- delete remaining.query;
3641
- const explicitBody = Object.prototype.hasOwnProperty.call(remaining, "body") ? remaining.body : void 0;
3642
- delete remaining.body;
3743
+ const schemaProperties = plainObject(plainObject(action.inputSchema).properties);
3744
+ const schemaOwnsQuery = Object.prototype.hasOwnProperty.call(schemaProperties, "query");
3745
+ const schemaOwnsBody = Object.prototype.hasOwnProperty.call(schemaProperties, "body");
3746
+ let explicitQuery = {};
3747
+ if (!schemaOwnsQuery) {
3748
+ explicitQuery = plainObject(remaining.query);
3749
+ delete remaining.query;
3750
+ }
3751
+ let explicitBody;
3752
+ if (!schemaOwnsBody) {
3753
+ explicitBody = Object.prototype.hasOwnProperty.call(remaining, "body") ? remaining.body : void 0;
3754
+ delete remaining.body;
3755
+ }
3643
3756
  if (action.method === "GET") {
3644
3757
  return {
3645
3758
  path,
@@ -4110,6 +4223,67 @@ var IdentityModule = class {
4110
4223
  }
4111
4224
  };
4112
4225
 
4226
+ // src/modules/workspaces.ts
4227
+ var ACTIONS = {
4228
+ list: "app_topolo_auth.workspaces.list",
4229
+ create: "app_topolo_auth.workspaces.create",
4230
+ rename: "app_topolo_auth.workspaces.rename",
4231
+ setDefault: "app_topolo_auth.workspaces.default.set"
4232
+ };
4233
+ var WorkspacesModule = class {
4234
+ constructor(client) {
4235
+ this.client = client;
4236
+ }
4237
+ client;
4238
+ async list(application) {
4239
+ const context = await this.resolveContext(application);
4240
+ return this.client.callAction(ACTIONS.list, {
4241
+ org_id: context.organizationId,
4242
+ app_id: context.appId
4243
+ });
4244
+ }
4245
+ async create(application, input) {
4246
+ const current = await this.list(application);
4247
+ if (!current.data.policy.canCreate) {
4248
+ throw new TopoloSdkError(
4249
+ "workspace_creation_not_allowed",
4250
+ `Workspace creation is not allowed for ${current.data.appId}: ${current.data.policy.reason}`
4251
+ );
4252
+ }
4253
+ return this.client.callAction(ACTIONS.create, {
4254
+ organizationId: current.data.organizationId,
4255
+ appId: current.data.appId,
4256
+ name: input.name,
4257
+ ...input.isDefault === void 0 ? {} : { isDefault: input.isDefault }
4258
+ }, { confirm: input.confirm === true });
4259
+ }
4260
+ async rename(application, workspaceId, name, confirm = false) {
4261
+ const context = await this.resolveContext(application);
4262
+ return this.client.callAction(ACTIONS.rename, {
4263
+ workspaceId,
4264
+ organizationId: context.organizationId,
4265
+ appId: context.appId,
4266
+ name
4267
+ }, { confirm });
4268
+ }
4269
+ async setDefault(application, workspaceId, confirm = false) {
4270
+ const context = await this.resolveContext(application);
4271
+ return this.client.callAction(ACTIONS.setDefault, {
4272
+ workspaceId,
4273
+ organizationId: context.organizationId,
4274
+ appId: context.appId
4275
+ }, { confirm });
4276
+ }
4277
+ async resolveContext(application) {
4278
+ const identity = await this.client.introspect();
4279
+ if (!identity.organization?.id) {
4280
+ throw new TopoloSdkError("organization_required", "Workspace lifecycle requires an organization-scoped credential.");
4281
+ }
4282
+ const service = await this.client.getService(application);
4283
+ return { organizationId: identity.organization.id, appId: service.appId };
4284
+ }
4285
+ };
4286
+
4113
4287
  // src/modules/p2p.ts
4114
4288
  var P2PModule = class {
4115
4289
  constructor(client) {
@@ -4568,6 +4742,7 @@ function createTopolo(options) {
4568
4742
  return {
4569
4743
  client,
4570
4744
  identity: new IdentityModule(client),
4745
+ workspaces: new WorkspacesModule(client),
4571
4746
  crm: new CrmModule(client)
4572
4747
  };
4573
4748
  }
@@ -4589,6 +4764,7 @@ export {
4589
4764
  TopoloOAuth,
4590
4765
  TopoloPermissionError,
4591
4766
  TopoloSdkError,
4767
+ WorkspacesModule,
4592
4768
  actionContractCompleteness,
4593
4769
  applicationRequirementScopes,
4594
4770
  auditAllApplicationRequirements,
@@ -110,6 +110,7 @@ var APP_API_URLS = {
110
110
  agent: "https://agent.topolo.app",
111
111
  auth: "https://auth.topolo.app",
112
112
  backup: "https://backup.topolo.app",
113
+ blog: "https://blog.topolo.app",
113
114
  books: "https://books.topolo.app",
114
115
  brand: "https://brand.topolo.app",
115
116
  bugfix: "https://bugfix.topolo.app",
@@ -122,6 +123,7 @@ var APP_API_URLS = {
122
123
  compose: "https://compose.topolo.app",
123
124
  consent: "https://consent.topolo.app",
124
125
  crm: "https://crm.topolo.app",
126
+ design: "https://design.topolo.app",
125
127
  developers: "https://developers.topolo.app",
126
128
  director: "https://director.topolo.app",
127
129
  feed: "https://feed.topolo.app",
@@ -66,6 +66,7 @@ var APP_API_URLS = {
66
66
  agent: "https://agent.topolo.app",
67
67
  auth: "https://auth.topolo.app",
68
68
  backup: "https://backup.topolo.app",
69
+ blog: "https://blog.topolo.app",
69
70
  books: "https://books.topolo.app",
70
71
  brand: "https://brand.topolo.app",
71
72
  bugfix: "https://bugfix.topolo.app",
@@ -78,6 +79,7 @@ var APP_API_URLS = {
78
79
  compose: "https://compose.topolo.app",
79
80
  consent: "https://consent.topolo.app",
80
81
  crm: "https://crm.topolo.app",
82
+ design: "https://design.topolo.app",
81
83
  developers: "https://developers.topolo.app",
82
84
  director: "https://director.topolo.app",
83
85
  feed: "https://feed.topolo.app",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topolo/sdk",
3
- "version": "0.9.8",
4
- "topoloPublishedVersion": "0.9.8",
3
+ "version": "0.9.10",
4
+ "topoloPublishedVersion": "0.9.10",
5
5
  "description": "Typed client SDK for the Topolo platform. Used by TopoloCli, TopoloMCP, and third-party agents.",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",