@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.
- package/dist/{chunk-33EULWIM.cjs → chunk-F5DHWOGW.cjs} +195 -27
- package/dist/chunk-F5DHWOGW.cjs.map +1 -0
- package/dist/{chunk-IGIAJVX6.js → chunk-Y4CEHIRX.js} +191 -28
- package/dist/chunk-Y4CEHIRX.js.map +1 -0
- package/dist/index.cjs +428 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +643 -11
- package/dist/index.d.ts +643 -11
- package/dist/index.js +330 -96
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +69 -53
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.js +1 -1
- package/dist/{types-BTdBFq34.d.cts → types-D1PRIsSO.d.cts} +406 -14
- package/dist/{types-BTdBFq34.d.ts → types-D1PRIsSO.d.ts} +406 -14
- package/package.json +1 -1
- package/src/auth/index.ts +58 -1
- package/src/auth/me.ts +14 -1
- package/src/auth/platform-entities.ts +27 -0
- package/src/auth/roles.ts +3 -1
- package/src/auth/shares.ts +181 -0
- package/src/auth/teams.ts +135 -0
- package/src/auth/types.ts +192 -4
- package/src/auth/user-role-assignments.ts +65 -0
- package/src/index.ts +36 -0
- package/src/knowledge/graph.ts +6 -2
- package/src/knowledge/index.ts +15 -0
- package/src/knowledge/nodes.ts +4 -1
- package/src/knowledge/spaces.ts +86 -0
- package/src/knowledge/types.ts +89 -0
- package/src/meta/index.ts +11 -0
- package/src/meta/layout/control-registry.json +151 -26
- package/src/meta/types.ts +186 -4
- package/src/workflow/types.ts +20 -3
- package/dist/chunk-33EULWIM.cjs.map +0 -1
- package/dist/chunk-IGIAJVX6.js.map +0 -1
|
@@ -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: [
|
|
648
|
+
compatible: [
|
|
649
|
+
"text",
|
|
650
|
+
"textarea",
|
|
651
|
+
"password"
|
|
652
|
+
],
|
|
648
653
|
byFormat: {
|
|
649
|
-
email: {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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: {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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: [
|
|
723
|
+
compatible: [
|
|
724
|
+
"tag-input"
|
|
725
|
+
],
|
|
664
726
|
byItemsType: {
|
|
665
|
-
string: {
|
|
666
|
-
|
|
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: {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
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: {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
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
|
-
|
|
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-
|
|
1274
|
-
//# sourceMappingURL=chunk-
|
|
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
|