@proteos/sdk 0.44.0 → 0.46.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.
Files changed (39) hide show
  1. package/dist/{chunk-33EULWIM.cjs → chunk-F5DHWOGW.cjs} +195 -27
  2. package/dist/chunk-F5DHWOGW.cjs.map +1 -0
  3. package/dist/{chunk-IGIAJVX6.js → chunk-Y4CEHIRX.js} +191 -28
  4. package/dist/chunk-Y4CEHIRX.js.map +1 -0
  5. package/dist/index.cjs +453 -178
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +686 -13
  8. package/dist/index.d.ts +686 -13
  9. package/dist/index.js +355 -96
  10. package/dist/index.js.map +1 -1
  11. package/dist/meta/index.cjs +69 -53
  12. package/dist/meta/index.d.cts +1 -1
  13. package/dist/meta/index.d.ts +1 -1
  14. package/dist/meta/index.js +1 -1
  15. package/dist/{types-BTdBFq34.d.cts → types-D1PRIsSO.d.cts} +406 -14
  16. package/dist/{types-BTdBFq34.d.ts → types-D1PRIsSO.d.ts} +406 -14
  17. package/package.json +3 -3
  18. package/src/auth/index.ts +58 -1
  19. package/src/auth/me.ts +14 -1
  20. package/src/auth/platform-entities.ts +27 -0
  21. package/src/auth/roles.ts +3 -1
  22. package/src/auth/shares.ts +181 -0
  23. package/src/auth/teams.ts +135 -0
  24. package/src/auth/types.ts +192 -4
  25. package/src/auth/user-role-assignments.ts +65 -0
  26. package/src/conversation/index.ts +42 -0
  27. package/src/conversation/types.ts +37 -0
  28. package/src/index.ts +36 -0
  29. package/src/knowledge/graph.ts +6 -2
  30. package/src/knowledge/index.ts +15 -0
  31. package/src/knowledge/nodes.ts +4 -1
  32. package/src/knowledge/spaces.ts +86 -0
  33. package/src/knowledge/types.ts +89 -0
  34. package/src/meta/index.ts +11 -0
  35. package/src/meta/layout/control-registry.json +151 -26
  36. package/src/meta/types.ts +186 -4
  37. package/src/workflow/types.ts +20 -3
  38. package/dist/chunk-33EULWIM.cjs.map +0 -1
  39. package/dist/chunk-IGIAJVX6.js.map +0 -1
@@ -638,6 +638,7 @@ var control_registry_default = {
638
638
  "tag-input",
639
639
  "entity-picker",
640
640
  "user-picker",
641
+ "principal-picker",
641
642
  "currency",
642
643
  "knowledge-text",
643
644
  "file",
@@ -646,44 +647,168 @@ var control_registry_default = {
646
647
  controls: {
647
648
  string: {
648
649
  primary: "text",
649
- compatible: ["text", "textarea", "password"],
650
+ compatible: [
651
+ "text",
652
+ "textarea",
653
+ "password"
654
+ ],
650
655
  byFormat: {
651
- email: { primary: "email", compatible: ["email", "text"] },
652
- uri: { primary: "url", compatible: ["url", "text"] },
653
- uuid: { primary: "text", compatible: ["text"] },
654
- hostname: { primary: "text", compatible: ["text"] },
655
- ipv4: { primary: "text", compatible: ["text"] },
656
- ipv6: { primary: "text", compatible: ["text"] }
656
+ email: {
657
+ primary: "email",
658
+ compatible: [
659
+ "email",
660
+ "text"
661
+ ]
662
+ },
663
+ uri: {
664
+ primary: "url",
665
+ compatible: [
666
+ "url",
667
+ "text"
668
+ ]
669
+ },
670
+ uuid: {
671
+ primary: "text",
672
+ compatible: [
673
+ "text"
674
+ ]
675
+ },
676
+ hostname: {
677
+ primary: "text",
678
+ compatible: [
679
+ "text"
680
+ ]
681
+ },
682
+ ipv4: {
683
+ primary: "text",
684
+ compatible: [
685
+ "text"
686
+ ]
687
+ },
688
+ ipv6: {
689
+ primary: "text",
690
+ compatible: [
691
+ "text"
692
+ ]
693
+ }
657
694
  }
658
695
  },
659
- number: { primary: "number", compatible: ["number"] },
660
- integer: { primary: "number", compatible: ["number"] },
661
- boolean: { primary: "switch", compatible: ["switch", "checkbox"] },
662
- enum: { primary: "select", compatible: ["select", "radio-group", "chip-group"] },
696
+ number: {
697
+ primary: "number",
698
+ compatible: [
699
+ "number"
700
+ ]
701
+ },
702
+ integer: {
703
+ primary: "number",
704
+ compatible: [
705
+ "number"
706
+ ]
707
+ },
708
+ boolean: {
709
+ primary: "switch",
710
+ compatible: [
711
+ "switch",
712
+ "checkbox"
713
+ ]
714
+ },
715
+ enum: {
716
+ primary: "select",
717
+ compatible: [
718
+ "select",
719
+ "radio-group",
720
+ "chip-group"
721
+ ]
722
+ },
663
723
  array: {
664
724
  primary: "tag-input",
665
- compatible: ["tag-input"],
725
+ compatible: [
726
+ "tag-input"
727
+ ],
666
728
  byItemsType: {
667
- string: { primary: "tag-input", compatible: ["tag-input"] },
668
- enum: { primary: "multi-select", compatible: ["multi-select"] }
729
+ string: {
730
+ primary: "tag-input",
731
+ compatible: [
732
+ "tag-input"
733
+ ]
734
+ },
735
+ enum: {
736
+ primary: "multi-select",
737
+ compatible: [
738
+ "multi-select"
739
+ ]
740
+ }
669
741
  }
670
742
  },
671
743
  datetime: {
672
744
  primary: null,
673
745
  compatible: [],
674
746
  byFormat: {
675
- date: { primary: "date-picker", compatible: ["date-picker"] },
676
- "date-time": { primary: "datetime-picker", compatible: ["datetime-picker"] },
677
- time: { primary: "time-picker", compatible: ["time-picker"] },
678
- duration: { primary: null, compatible: [] }
747
+ date: {
748
+ primary: "date-picker",
749
+ compatible: [
750
+ "date-picker"
751
+ ]
752
+ },
753
+ "date-time": {
754
+ primary: "datetime-picker",
755
+ compatible: [
756
+ "datetime-picker"
757
+ ]
758
+ },
759
+ time: {
760
+ primary: "time-picker",
761
+ compatible: [
762
+ "time-picker"
763
+ ]
764
+ },
765
+ duration: {
766
+ primary: null,
767
+ compatible: []
768
+ }
679
769
  }
680
770
  },
681
- object: { primary: null, compatible: [] },
682
- relation: { primary: "entity-picker", compatible: ["entity-picker"] },
683
- user: { primary: "user-picker", compatible: ["user-picker"] },
684
- currency: { primary: "currency", compatible: ["currency"] },
685
- "knowledge-text": { primary: "knowledge-text", compatible: ["knowledge-text"] },
686
- file: { primary: "file", compatible: ["file", "file-viewer"] }
771
+ object: {
772
+ primary: null,
773
+ compatible: []
774
+ },
775
+ relation: {
776
+ primary: "entity-picker",
777
+ compatible: [
778
+ "entity-picker"
779
+ ]
780
+ },
781
+ user: {
782
+ primary: "user-picker",
783
+ compatible: [
784
+ "user-picker"
785
+ ]
786
+ },
787
+ currency: {
788
+ primary: "currency",
789
+ compatible: [
790
+ "currency"
791
+ ]
792
+ },
793
+ "knowledge-text": {
794
+ primary: "knowledge-text",
795
+ compatible: [
796
+ "knowledge-text"
797
+ ]
798
+ },
799
+ file: {
800
+ primary: "file",
801
+ compatible: [
802
+ "file",
803
+ "file-viewer"
804
+ ]
805
+ },
806
+ principal: {
807
+ primary: "principal-picker",
808
+ compatible: [
809
+ "principal-picker"
810
+ ]
811
+ }
687
812
  }
688
813
  };
689
814
 
@@ -956,6 +1081,14 @@ var AuditFieldsSchema = zod.z.object({
956
1081
  });
957
1082
 
958
1083
  // src/meta/types.ts
1084
+ var AttributeAccessRuleSchema = zod.z.object({
1085
+ roles: zod.z.array(zod.z.string()).optional(),
1086
+ teams: zod.z.array(zod.z.string()).optional()
1087
+ });
1088
+ var AttributeRestrictionsSchema = zod.z.object({
1089
+ read: AttributeAccessRuleSchema.optional(),
1090
+ write: AttributeAccessRuleSchema.optional()
1091
+ });
959
1092
  var OnDeleteActionSchema = zod.z.enum(["cascade", "restrict", "set-null"]);
960
1093
  var RelationAttributeMetaSchema = zod.z.object({
961
1094
  related_entity_slug: zod.z.string(),
@@ -967,6 +1100,15 @@ var RelationAttributeMetaSchema = zod.z.object({
967
1100
  var UserAttributeMetaSchema = zod.z.object({
968
1101
  description: zod.z.string().optional()
969
1102
  });
1103
+ var PrincipalAttributeMetaSchema = zod.z.object({
1104
+ description: zod.z.string().optional(),
1105
+ grants: zod.z.array(zod.z.enum(["read", "write", "delete", "share"])).optional(),
1106
+ allowed_types: zod.z.array(zod.z.enum(["person", "agent", "api", "team", "org"])).optional()
1107
+ });
1108
+ var PrincipalRefSchema = zod.z.object({
1109
+ type: zod.z.enum(["person", "agent", "api", "team", "org"]),
1110
+ id: zod.z.string()
1111
+ });
970
1112
  var CurrencyAttributeMetaSchema = zod.z.object({
971
1113
  default_currency_code: zod.z.string().optional(),
972
1114
  allowed_currency_codes: zod.z.array(zod.z.string()).optional()
@@ -1052,6 +1194,7 @@ var AttributeSchema = zod.z.object({
1052
1194
  is_nullable: zod.z.boolean().optional(),
1053
1195
  is_unique: zod.z.boolean(),
1054
1196
  is_read_only: zod.z.boolean().optional(),
1197
+ restrictions: AttributeRestrictionsSchema.optional(),
1055
1198
  default_value: zod.z.unknown().optional(),
1056
1199
  meta: zod.z.unknown().optional(),
1057
1200
  options: zod.z.record(zod.z.unknown()).optional()
@@ -1066,6 +1209,12 @@ function parseCurrencyMeta(attr) {
1066
1209
  const parsed = CurrencyAttributeMetaSchema.safeParse(attr.meta ?? {});
1067
1210
  return parsed.success ? parsed.data : null;
1068
1211
  }
1212
+ function parsePrincipalMeta(attr) {
1213
+ if (attr.type !== "principal") return null;
1214
+ if (attr.meta == null) return {};
1215
+ const parsed = PrincipalAttributeMetaSchema.safeParse(attr.meta);
1216
+ return parsed.success ? parsed.data : {};
1217
+ }
1069
1218
  function parseUserMeta(attr) {
1070
1219
  if (attr.type !== "user") return null;
1071
1220
  if (attr.meta == null) return {};
@@ -1156,7 +1305,12 @@ var ListViewSchema = AuditFieldsSchema.extend({
1156
1305
  var PageActionSchema = zod.z.object({
1157
1306
  label: zod.z.string(),
1158
1307
  icon: zod.z.string(),
1159
- action: zod.z.string()
1308
+ kind: zod.z.enum(["action", "workflow"]).optional(),
1309
+ action: zod.z.string().optional(),
1310
+ workflow: zod.z.string().optional(),
1311
+ params: zod.z.record(zod.z.string()).optional(),
1312
+ inputs: zod.z.record(zod.z.string()).optional(),
1313
+ skip_confirmation: zod.z.boolean().optional()
1160
1314
  });
1161
1315
  var PageTypeSchema = zod.z.enum(["record", "platform", "kiosk", "public"]);
1162
1316
  var PageSchema = AuditFieldsSchema.extend({
@@ -1209,6 +1363,15 @@ var DesignReferenceSchema = AuditFieldsSchema.extend({
1209
1363
  description: zod.z.string(),
1210
1364
  content: zod.z.string().optional()
1211
1365
  });
1366
+ var CURRENT_USER_DEFAULT = { type: "current_user" };
1367
+ function isCurrentUserDefault(value) {
1368
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
1369
+ const keys = Object.keys(value);
1370
+ return keys.length === 1 && value.type === "current_user";
1371
+ }
1372
+ function acceptsCurrentUserDefault(type) {
1373
+ return type === "user" || type === "principal";
1374
+ }
1212
1375
 
1213
1376
  // src/meta/index.ts
1214
1377
  var MetaClient = class {
@@ -1275,6 +1438,7 @@ exports.AppSchema = AppSchema;
1275
1438
  exports.AttributeSchema = AttributeSchema;
1276
1439
  exports.AuditFieldsSchema = AuditFieldsSchema;
1277
1440
  exports.BUILT_IN_CONTROLS = BUILT_IN_CONTROLS;
1441
+ exports.CURRENT_USER_DEFAULT = CURRENT_USER_DEFAULT;
1278
1442
  exports.ColumnSchema = ColumnSchema;
1279
1443
  exports.ComponentSchema = ComponentSchema;
1280
1444
  exports.CurrencyAttributeMetaSchema = CurrencyAttributeMetaSchema;
@@ -1306,6 +1470,7 @@ exports.PageLayoutSchema = PageLayoutSchema;
1306
1470
  exports.PageLayoutSidePanelSchema = PageLayoutSidePanelSchema;
1307
1471
  exports.PageSchema = PageSchema;
1308
1472
  exports.PageStyleSchema = PageStyleSchema;
1473
+ exports.PrincipalRefSchema = PrincipalRefSchema;
1309
1474
  exports.RelationAttributeMetaSchema = RelationAttributeMetaSchema;
1310
1475
  exports.ResponseMetaSchema = ResponseMetaSchema;
1311
1476
  exports.SizeValueSchema = SizeValueSchema;
@@ -1313,6 +1478,7 @@ exports.SortConfigSchema = SortConfigSchema;
1313
1478
  exports.UserAttributeMetaSchema = UserAttributeMetaSchema;
1314
1479
  exports.UserRefSchema = UserRefSchema;
1315
1480
  exports.VariableSchema = VariableSchema;
1481
+ exports.acceptsCurrentUserDefault = acceptsCurrentUserDefault;
1316
1482
  exports.allCurrencyCodes = allCurrencyCodes;
1317
1483
  exports.createIterator = createIterator;
1318
1484
  exports.createListResultSchema = createListResultSchema;
@@ -1322,6 +1488,7 @@ exports.currencySymbolSide = currencySymbolSide;
1322
1488
  exports.formatAmount = formatAmount;
1323
1489
  exports.formatMoney = formatMoney;
1324
1490
  exports.isBuiltInControl = isBuiltInControl;
1491
+ exports.isCurrentUserDefault = isCurrentUserDefault;
1325
1492
  exports.isPlatformAttributeName = isPlatformAttributeName;
1326
1493
  exports.localeNumberSeparators = localeNumberSeparators;
1327
1494
  exports.lookupCompatibleControls = lookupCompatibleControls;
@@ -1330,8 +1497,9 @@ exports.lookupPrimaryControl = lookupPrimaryControl;
1330
1497
  exports.parseAmount = parseAmount;
1331
1498
  exports.parseCurrencyMeta = parseCurrencyMeta;
1332
1499
  exports.parseFileMeta = parseFileMeta;
1500
+ exports.parsePrincipalMeta = parsePrincipalMeta;
1333
1501
  exports.parseRelationMeta = parseRelationMeta;
1334
1502
  exports.parseUserMeta = parseUserMeta;
1335
1503
  exports.platformAttributes = platformAttributes;
1336
- //# sourceMappingURL=chunk-33EULWIM.cjs.map
1337
- //# sourceMappingURL=chunk-33EULWIM.cjs.map
1504
+ //# sourceMappingURL=chunk-F5DHWOGW.cjs.map
1505
+ //# sourceMappingURL=chunk-F5DHWOGW.cjs.map