@proteos/sdk 0.45.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.
@@ -636,6 +636,7 @@ var control_registry_default = {
636
636
  "tag-input",
637
637
  "entity-picker",
638
638
  "user-picker",
639
+ "principal-picker",
639
640
  "currency",
640
641
  "knowledge-text",
641
642
  "file",
@@ -644,44 +645,168 @@ var control_registry_default = {
644
645
  controls: {
645
646
  string: {
646
647
  primary: "text",
647
- compatible: ["text", "textarea", "password"],
648
+ compatible: [
649
+ "text",
650
+ "textarea",
651
+ "password"
652
+ ],
648
653
  byFormat: {
649
- email: { primary: "email", compatible: ["email", "text"] },
650
- uri: { primary: "url", compatible: ["url", "text"] },
651
- uuid: { primary: "text", compatible: ["text"] },
652
- hostname: { primary: "text", compatible: ["text"] },
653
- ipv4: { primary: "text", compatible: ["text"] },
654
- ipv6: { primary: "text", compatible: ["text"] }
654
+ email: {
655
+ primary: "email",
656
+ compatible: [
657
+ "email",
658
+ "text"
659
+ ]
660
+ },
661
+ uri: {
662
+ primary: "url",
663
+ compatible: [
664
+ "url",
665
+ "text"
666
+ ]
667
+ },
668
+ uuid: {
669
+ primary: "text",
670
+ compatible: [
671
+ "text"
672
+ ]
673
+ },
674
+ hostname: {
675
+ primary: "text",
676
+ compatible: [
677
+ "text"
678
+ ]
679
+ },
680
+ ipv4: {
681
+ primary: "text",
682
+ compatible: [
683
+ "text"
684
+ ]
685
+ },
686
+ ipv6: {
687
+ primary: "text",
688
+ compatible: [
689
+ "text"
690
+ ]
691
+ }
655
692
  }
656
693
  },
657
- number: { primary: "number", compatible: ["number"] },
658
- integer: { primary: "number", compatible: ["number"] },
659
- boolean: { primary: "switch", compatible: ["switch", "checkbox"] },
660
- enum: { primary: "select", compatible: ["select", "radio-group", "chip-group"] },
694
+ number: {
695
+ primary: "number",
696
+ compatible: [
697
+ "number"
698
+ ]
699
+ },
700
+ integer: {
701
+ primary: "number",
702
+ compatible: [
703
+ "number"
704
+ ]
705
+ },
706
+ boolean: {
707
+ primary: "switch",
708
+ compatible: [
709
+ "switch",
710
+ "checkbox"
711
+ ]
712
+ },
713
+ enum: {
714
+ primary: "select",
715
+ compatible: [
716
+ "select",
717
+ "radio-group",
718
+ "chip-group"
719
+ ]
720
+ },
661
721
  array: {
662
722
  primary: "tag-input",
663
- compatible: ["tag-input"],
723
+ compatible: [
724
+ "tag-input"
725
+ ],
664
726
  byItemsType: {
665
- string: { primary: "tag-input", compatible: ["tag-input"] },
666
- enum: { primary: "multi-select", compatible: ["multi-select"] }
727
+ string: {
728
+ primary: "tag-input",
729
+ compatible: [
730
+ "tag-input"
731
+ ]
732
+ },
733
+ enum: {
734
+ primary: "multi-select",
735
+ compatible: [
736
+ "multi-select"
737
+ ]
738
+ }
667
739
  }
668
740
  },
669
741
  datetime: {
670
742
  primary: null,
671
743
  compatible: [],
672
744
  byFormat: {
673
- date: { primary: "date-picker", compatible: ["date-picker"] },
674
- "date-time": { primary: "datetime-picker", compatible: ["datetime-picker"] },
675
- time: { primary: "time-picker", compatible: ["time-picker"] },
676
- duration: { primary: null, compatible: [] }
745
+ date: {
746
+ primary: "date-picker",
747
+ compatible: [
748
+ "date-picker"
749
+ ]
750
+ },
751
+ "date-time": {
752
+ primary: "datetime-picker",
753
+ compatible: [
754
+ "datetime-picker"
755
+ ]
756
+ },
757
+ time: {
758
+ primary: "time-picker",
759
+ compatible: [
760
+ "time-picker"
761
+ ]
762
+ },
763
+ duration: {
764
+ primary: null,
765
+ compatible: []
766
+ }
677
767
  }
678
768
  },
679
- object: { primary: null, compatible: [] },
680
- relation: { primary: "entity-picker", compatible: ["entity-picker"] },
681
- user: { primary: "user-picker", compatible: ["user-picker"] },
682
- currency: { primary: "currency", compatible: ["currency"] },
683
- "knowledge-text": { primary: "knowledge-text", compatible: ["knowledge-text"] },
684
- file: { primary: "file", compatible: ["file", "file-viewer"] }
769
+ object: {
770
+ primary: null,
771
+ compatible: []
772
+ },
773
+ relation: {
774
+ primary: "entity-picker",
775
+ compatible: [
776
+ "entity-picker"
777
+ ]
778
+ },
779
+ user: {
780
+ primary: "user-picker",
781
+ compatible: [
782
+ "user-picker"
783
+ ]
784
+ },
785
+ currency: {
786
+ primary: "currency",
787
+ compatible: [
788
+ "currency"
789
+ ]
790
+ },
791
+ "knowledge-text": {
792
+ primary: "knowledge-text",
793
+ compatible: [
794
+ "knowledge-text"
795
+ ]
796
+ },
797
+ file: {
798
+ primary: "file",
799
+ compatible: [
800
+ "file",
801
+ "file-viewer"
802
+ ]
803
+ },
804
+ principal: {
805
+ primary: "principal-picker",
806
+ compatible: [
807
+ "principal-picker"
808
+ ]
809
+ }
685
810
  }
686
811
  };
687
812
 
@@ -954,6 +1079,14 @@ var AuditFieldsSchema = z.object({
954
1079
  });
955
1080
 
956
1081
  // src/meta/types.ts
1082
+ var AttributeAccessRuleSchema = z.object({
1083
+ roles: z.array(z.string()).optional(),
1084
+ teams: z.array(z.string()).optional()
1085
+ });
1086
+ var AttributeRestrictionsSchema = z.object({
1087
+ read: AttributeAccessRuleSchema.optional(),
1088
+ write: AttributeAccessRuleSchema.optional()
1089
+ });
957
1090
  var OnDeleteActionSchema = z.enum(["cascade", "restrict", "set-null"]);
958
1091
  var RelationAttributeMetaSchema = z.object({
959
1092
  related_entity_slug: z.string(),
@@ -965,6 +1098,15 @@ var RelationAttributeMetaSchema = z.object({
965
1098
  var UserAttributeMetaSchema = z.object({
966
1099
  description: z.string().optional()
967
1100
  });
1101
+ var PrincipalAttributeMetaSchema = z.object({
1102
+ description: z.string().optional(),
1103
+ grants: z.array(z.enum(["read", "write", "delete", "share"])).optional(),
1104
+ allowed_types: z.array(z.enum(["person", "agent", "api", "team", "org"])).optional()
1105
+ });
1106
+ var PrincipalRefSchema = z.object({
1107
+ type: z.enum(["person", "agent", "api", "team", "org"]),
1108
+ id: z.string()
1109
+ });
968
1110
  var CurrencyAttributeMetaSchema = z.object({
969
1111
  default_currency_code: z.string().optional(),
970
1112
  allowed_currency_codes: z.array(z.string()).optional()
@@ -1050,6 +1192,7 @@ var AttributeSchema = z.object({
1050
1192
  is_nullable: z.boolean().optional(),
1051
1193
  is_unique: z.boolean(),
1052
1194
  is_read_only: z.boolean().optional(),
1195
+ restrictions: AttributeRestrictionsSchema.optional(),
1053
1196
  default_value: z.unknown().optional(),
1054
1197
  meta: z.unknown().optional(),
1055
1198
  options: z.record(z.unknown()).optional()
@@ -1064,6 +1207,12 @@ function parseCurrencyMeta(attr) {
1064
1207
  const parsed = CurrencyAttributeMetaSchema.safeParse(attr.meta ?? {});
1065
1208
  return parsed.success ? parsed.data : null;
1066
1209
  }
1210
+ function parsePrincipalMeta(attr) {
1211
+ if (attr.type !== "principal") return null;
1212
+ if (attr.meta == null) return {};
1213
+ const parsed = PrincipalAttributeMetaSchema.safeParse(attr.meta);
1214
+ return parsed.success ? parsed.data : {};
1215
+ }
1067
1216
  function parseUserMeta(attr) {
1068
1217
  if (attr.type !== "user") return null;
1069
1218
  if (attr.meta == null) return {};
@@ -1154,7 +1303,12 @@ var ListViewSchema = AuditFieldsSchema.extend({
1154
1303
  var PageActionSchema = z.object({
1155
1304
  label: z.string(),
1156
1305
  icon: z.string(),
1157
- action: z.string()
1306
+ kind: z.enum(["action", "workflow"]).optional(),
1307
+ action: z.string().optional(),
1308
+ workflow: z.string().optional(),
1309
+ params: z.record(z.string()).optional(),
1310
+ inputs: z.record(z.string()).optional(),
1311
+ skip_confirmation: z.boolean().optional()
1158
1312
  });
1159
1313
  var PageTypeSchema = z.enum(["record", "platform", "kiosk", "public"]);
1160
1314
  var PageSchema = AuditFieldsSchema.extend({
@@ -1207,6 +1361,15 @@ var DesignReferenceSchema = AuditFieldsSchema.extend({
1207
1361
  description: z.string(),
1208
1362
  content: z.string().optional()
1209
1363
  });
1364
+ var CURRENT_USER_DEFAULT = { type: "current_user" };
1365
+ function isCurrentUserDefault(value) {
1366
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
1367
+ const keys = Object.keys(value);
1368
+ return keys.length === 1 && value.type === "current_user";
1369
+ }
1370
+ function acceptsCurrentUserDefault(type) {
1371
+ return type === "user" || type === "principal";
1372
+ }
1210
1373
 
1211
1374
  // src/meta/index.ts
1212
1375
  var MetaClient = class {
@@ -1269,6 +1432,6 @@ var MetaClient = class {
1269
1432
  }
1270
1433
  };
1271
1434
 
1272
- export { AppSchema, AttributeSchema, AuditFieldsSchema, BUILT_IN_CONTROLS, ColumnSchema, ComponentSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntitySchema, EntityWithSchemaSchema, FileAttributeMetaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, LayoutElementSchema, LayoutElementType, ListSchema, ListViewSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PAGE_BACKGROUND_TOKENS, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageIterator, PageLayoutSchema, PageLayoutSidePanelSchema, PageSchema, PageStyleSchema, RelationAttributeMetaSchema, ResponseMetaSchema, SizeValueSchema, SortConfigSchema, UserAttributeMetaSchema, UserRefSchema, VariableSchema, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isBuiltInControl, isPlatformAttributeName, localeNumberSeparators, lookupCompatibleControls, lookupControls, lookupPrimaryControl, parseAmount, parseCurrencyMeta, parseFileMeta, parseRelationMeta, parseUserMeta, platformAttributes };
1273
- //# sourceMappingURL=chunk-IGIAJVX6.js.map
1274
- //# sourceMappingURL=chunk-IGIAJVX6.js.map
1435
+ export { AppSchema, AttributeSchema, AuditFieldsSchema, BUILT_IN_CONTROLS, CURRENT_USER_DEFAULT, ColumnSchema, ComponentSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntitySchema, EntityWithSchemaSchema, FileAttributeMetaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, LayoutElementSchema, LayoutElementType, ListSchema, ListViewSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PAGE_BACKGROUND_TOKENS, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageIterator, PageLayoutSchema, PageLayoutSidePanelSchema, PageSchema, PageStyleSchema, PrincipalRefSchema, RelationAttributeMetaSchema, ResponseMetaSchema, SizeValueSchema, SortConfigSchema, UserAttributeMetaSchema, UserRefSchema, VariableSchema, acceptsCurrentUserDefault, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isBuiltInControl, isCurrentUserDefault, isPlatformAttributeName, localeNumberSeparators, lookupCompatibleControls, lookupControls, lookupPrimaryControl, parseAmount, parseCurrencyMeta, parseFileMeta, parsePrincipalMeta, parseRelationMeta, parseUserMeta, platformAttributes };
1436
+ //# sourceMappingURL=chunk-Y4CEHIRX.js.map
1437
+ //# sourceMappingURL=chunk-Y4CEHIRX.js.map