@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.
- 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 +453 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +686 -13
- package/dist/index.d.ts +686 -13
- package/dist/index.js +355 -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 +3 -3
- 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/conversation/index.ts +42 -0
- package/src/conversation/types.ts +37 -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
|
@@ -1779,7 +1779,36 @@ interface MetaListOptions extends ListOptions {
|
|
|
1779
1779
|
* full set; format/structural variation lives on `Attribute.meta` (see
|
|
1780
1780
|
* `AttributeMeta` below), not on the type discriminator.
|
|
1781
1781
|
*/
|
|
1782
|
-
type AttributeType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'datetime' | 'enum' | 'relation' | 'user' | 'currency' | 'knowledge-text' | 'file';
|
|
1782
|
+
type AttributeType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'datetime' | 'enum' | 'relation' | 'user' | 'principal' | 'currency' | 'knowledge-text' | 'file';
|
|
1783
|
+
/**
|
|
1784
|
+
* Attribute-level permissions: restricting a FIELD rather than a record — a
|
|
1785
|
+
* salary column readable only by the people team, a margin column writable only
|
|
1786
|
+
* by finance. Mirror of the Go `metamodel.AttributeRestrictions`.
|
|
1787
|
+
*
|
|
1788
|
+
* Orthogonal to instance-level access: a caller who may see a record may still
|
|
1789
|
+
* be blocked from one of its fields.
|
|
1790
|
+
*
|
|
1791
|
+
* Absent means unrestricted. Both arms FAIL CLOSED — an empty rule matches
|
|
1792
|
+
* nobody rather than everybody, and an unknown role or team slug never matches,
|
|
1793
|
+
* so a typo removes access rather than granting it.
|
|
1794
|
+
*/
|
|
1795
|
+
interface AttributeAccessRule {
|
|
1796
|
+
/** Role slugs, matched against the caller's roles. */
|
|
1797
|
+
roles?: string[];
|
|
1798
|
+
/**
|
|
1799
|
+
* Team slugs. Matched through the caller's team closure, so a member of a
|
|
1800
|
+
* CHILD team is matched by a rule naming an ancestor.
|
|
1801
|
+
*/
|
|
1802
|
+
teams?: string[];
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Read and write are gated independently, so `write` alone yields a field
|
|
1806
|
+
* everyone can see and only some can change.
|
|
1807
|
+
*/
|
|
1808
|
+
interface AttributeRestrictions {
|
|
1809
|
+
read?: AttributeAccessRule;
|
|
1810
|
+
write?: AttributeAccessRule;
|
|
1811
|
+
}
|
|
1783
1812
|
/** JSON-Schema string formats carried by `string` attributes. */
|
|
1784
1813
|
type StringFormat = 'email' | 'uri' | 'uuid' | 'hostname' | 'ipv4' | 'ipv6';
|
|
1785
1814
|
interface StringAttributeMeta {
|
|
@@ -1815,6 +1844,10 @@ interface EnumValue {
|
|
|
1815
1844
|
value: string;
|
|
1816
1845
|
label?: string;
|
|
1817
1846
|
description?: string;
|
|
1847
|
+
/** Lucide icon name, canonical PascalCase (e.g. `CircleCheck`). Replaces the badge dot. */
|
|
1848
|
+
icon?: string;
|
|
1849
|
+
/** Tint as `#rrggbb`. Renderers derive dot/border/background from it; text stays ink. */
|
|
1850
|
+
color?: string;
|
|
1818
1851
|
}
|
|
1819
1852
|
interface EnumAttributeMeta {
|
|
1820
1853
|
values: EnumValue[];
|
|
@@ -1879,6 +1912,54 @@ declare const UserAttributeMetaSchema: z.ZodObject<{
|
|
|
1879
1912
|
}, {
|
|
1880
1913
|
description?: string | undefined;
|
|
1881
1914
|
}>;
|
|
1915
|
+
/**
|
|
1916
|
+
* The stored value of a `principal`-typed attribute: a {@link PrincipalRef}
|
|
1917
|
+
* `{ type, id }` naming anything that can HOLD ACCESS — a user (person, agent
|
|
1918
|
+
* or api client), a team, or the whole organization. Mirror of the Go
|
|
1919
|
+
* `metamodel.PrincipalAttributeMeta`.
|
|
1920
|
+
*
|
|
1921
|
+
* Distinct from `user` on purpose. `user` means "a person did this" — it is
|
|
1922
|
+
* authorship, and its value can never be a team. `principal` means "this party
|
|
1923
|
+
* may be granted access", a different question with a strictly larger
|
|
1924
|
+
* vocabulary. Widening `user` would have made every existing user attribute
|
|
1925
|
+
* silently accept a team, including the created_by / updated_by audit columns.
|
|
1926
|
+
*/
|
|
1927
|
+
interface PrincipalAttributeMeta {
|
|
1928
|
+
description?: string;
|
|
1929
|
+
/**
|
|
1930
|
+
* Turns the attribute into a GRANTING attribute: the verbs its value confers
|
|
1931
|
+
* on the record. `deals.account_manager` with `["read","write"]` means setting
|
|
1932
|
+
* it gives that principal access with no share call — the business field IS
|
|
1933
|
+
* the ACL.
|
|
1934
|
+
*
|
|
1935
|
+
* `share` is the right to hand access on — share the record, set other
|
|
1936
|
+
* granting attributes, revoke shares. `["read","write","delete","share"]` is
|
|
1937
|
+
* full ownership: there is no separate owner field on the platform, the
|
|
1938
|
+
* business field that grants `share` IS the owner. `share` must accompany
|
|
1939
|
+
* at least one of read/write/delete, and an attribute granting it never
|
|
1940
|
+
* accepts an `org` principal.
|
|
1941
|
+
*
|
|
1942
|
+
* Empty (the default) means an ordinary reference that confers nothing, so an
|
|
1943
|
+
* existing principal attribute cannot start granting access by accident.
|
|
1944
|
+
*/
|
|
1945
|
+
grants?: Array<'read' | 'write' | 'delete' | 'share'>;
|
|
1946
|
+
/**
|
|
1947
|
+
* Narrows which principal kinds this attribute accepts; empty means all
|
|
1948
|
+
* (except that an attribute granting `share` refuses `org` regardless —
|
|
1949
|
+
* an org-wide right to re-grant would hand record management to every
|
|
1950
|
+
* member).
|
|
1951
|
+
*/
|
|
1952
|
+
allowed_types?: PrincipalType[];
|
|
1953
|
+
}
|
|
1954
|
+
/** The kinds a principal reference may name. */
|
|
1955
|
+
type PrincipalType = 'person' | 'agent' | 'api' | 'team' | 'org';
|
|
1956
|
+
/**
|
|
1957
|
+
* The stored value of a `principal`-typed attribute.
|
|
1958
|
+
*/
|
|
1959
|
+
interface PrincipalRef {
|
|
1960
|
+
type: PrincipalType;
|
|
1961
|
+
id: string;
|
|
1962
|
+
}
|
|
1882
1963
|
/**
|
|
1883
1964
|
* The stored value of a `currency`-typed attribute: an exact decimal `amount`
|
|
1884
1965
|
* (a STRING, never a JS number — preserves financial-system precision and
|
|
@@ -1949,7 +2030,7 @@ declare const FileAttributeMetaSchema: z.ZodObject<{
|
|
|
1949
2030
|
* appropriate shape based on `Attribute.type`; runtime consumers can
|
|
1950
2031
|
* narrow via the `type` field.
|
|
1951
2032
|
*/
|
|
1952
|
-
type AttributeMeta = StringAttributeMeta | NumberAttributeMeta | DatetimeAttributeMeta | ArrayAttributeMeta | ObjectAttributeMeta | EnumAttributeMeta | RelationAttributeMeta | UserAttributeMeta | CurrencyAttributeMeta | KnowledgeTextAttributeMeta | FileAttributeMeta;
|
|
2033
|
+
type AttributeMeta = StringAttributeMeta | NumberAttributeMeta | DatetimeAttributeMeta | ArrayAttributeMeta | ObjectAttributeMeta | EnumAttributeMeta | RelationAttributeMeta | UserAttributeMeta | PrincipalAttributeMeta | CurrencyAttributeMeta | KnowledgeTextAttributeMeta | FileAttributeMeta;
|
|
1953
2034
|
/**
|
|
1954
2035
|
* Entity attribute definition. Mirrors `model.Attribute` in the Go SDK.
|
|
1955
2036
|
*/
|
|
@@ -1969,6 +2050,17 @@ interface Attribute {
|
|
|
1969
2050
|
* Mirrors `IsPlatformManaged` in the Go `metamodel.Attribute`.
|
|
1970
2051
|
*/
|
|
1971
2052
|
is_platform_managed?: boolean;
|
|
2053
|
+
/**
|
|
2054
|
+
* Attribute-level permissions. Absent means unrestricted (today's behaviour).
|
|
2055
|
+
* Platform-managed attributes cannot carry restrictions.
|
|
2056
|
+
*/
|
|
2057
|
+
restrictions?: AttributeRestrictions;
|
|
2058
|
+
/**
|
|
2059
|
+
* Literal default, or — on a `user` / `principal` attribute only — the
|
|
2060
|
+
* current-user sentinel `{ type: 'current_user' }` (see
|
|
2061
|
+
* `CURRENT_USER_DEFAULT`), which data-service resolves to the writer at
|
|
2062
|
+
* record-write time.
|
|
2063
|
+
*/
|
|
1972
2064
|
default_value?: unknown;
|
|
1973
2065
|
/**
|
|
1974
2066
|
* Type-specific metadata. The concrete shape is determined by `type`
|
|
@@ -2002,6 +2094,46 @@ declare const AttributeSchema: z.ZodObject<{
|
|
|
2002
2094
|
is_nullable: z.ZodOptional<z.ZodBoolean>;
|
|
2003
2095
|
is_unique: z.ZodBoolean;
|
|
2004
2096
|
is_read_only: z.ZodOptional<z.ZodBoolean>;
|
|
2097
|
+
restrictions: z.ZodOptional<z.ZodObject<{
|
|
2098
|
+
read: z.ZodOptional<z.ZodObject<{
|
|
2099
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2100
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2101
|
+
}, "strip", z.ZodTypeAny, {
|
|
2102
|
+
roles?: string[] | undefined;
|
|
2103
|
+
teams?: string[] | undefined;
|
|
2104
|
+
}, {
|
|
2105
|
+
roles?: string[] | undefined;
|
|
2106
|
+
teams?: string[] | undefined;
|
|
2107
|
+
}>>;
|
|
2108
|
+
write: z.ZodOptional<z.ZodObject<{
|
|
2109
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2110
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2111
|
+
}, "strip", z.ZodTypeAny, {
|
|
2112
|
+
roles?: string[] | undefined;
|
|
2113
|
+
teams?: string[] | undefined;
|
|
2114
|
+
}, {
|
|
2115
|
+
roles?: string[] | undefined;
|
|
2116
|
+
teams?: string[] | undefined;
|
|
2117
|
+
}>>;
|
|
2118
|
+
}, "strip", z.ZodTypeAny, {
|
|
2119
|
+
read?: {
|
|
2120
|
+
roles?: string[] | undefined;
|
|
2121
|
+
teams?: string[] | undefined;
|
|
2122
|
+
} | undefined;
|
|
2123
|
+
write?: {
|
|
2124
|
+
roles?: string[] | undefined;
|
|
2125
|
+
teams?: string[] | undefined;
|
|
2126
|
+
} | undefined;
|
|
2127
|
+
}, {
|
|
2128
|
+
read?: {
|
|
2129
|
+
roles?: string[] | undefined;
|
|
2130
|
+
teams?: string[] | undefined;
|
|
2131
|
+
} | undefined;
|
|
2132
|
+
write?: {
|
|
2133
|
+
roles?: string[] | undefined;
|
|
2134
|
+
teams?: string[] | undefined;
|
|
2135
|
+
} | undefined;
|
|
2136
|
+
}>>;
|
|
2005
2137
|
default_value: z.ZodOptional<z.ZodUnknown>;
|
|
2006
2138
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
2007
2139
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2016,6 +2148,16 @@ declare const AttributeSchema: z.ZodObject<{
|
|
|
2016
2148
|
description?: string | undefined;
|
|
2017
2149
|
is_read_only?: boolean | undefined;
|
|
2018
2150
|
is_nullable?: boolean | undefined;
|
|
2151
|
+
restrictions?: {
|
|
2152
|
+
read?: {
|
|
2153
|
+
roles?: string[] | undefined;
|
|
2154
|
+
teams?: string[] | undefined;
|
|
2155
|
+
} | undefined;
|
|
2156
|
+
write?: {
|
|
2157
|
+
roles?: string[] | undefined;
|
|
2158
|
+
teams?: string[] | undefined;
|
|
2159
|
+
} | undefined;
|
|
2160
|
+
} | undefined;
|
|
2019
2161
|
default_value?: unknown;
|
|
2020
2162
|
}, {
|
|
2021
2163
|
type: string;
|
|
@@ -2028,6 +2170,16 @@ declare const AttributeSchema: z.ZodObject<{
|
|
|
2028
2170
|
description?: string | undefined;
|
|
2029
2171
|
is_read_only?: boolean | undefined;
|
|
2030
2172
|
is_nullable?: boolean | undefined;
|
|
2173
|
+
restrictions?: {
|
|
2174
|
+
read?: {
|
|
2175
|
+
roles?: string[] | undefined;
|
|
2176
|
+
teams?: string[] | undefined;
|
|
2177
|
+
} | undefined;
|
|
2178
|
+
write?: {
|
|
2179
|
+
roles?: string[] | undefined;
|
|
2180
|
+
teams?: string[] | undefined;
|
|
2181
|
+
} | undefined;
|
|
2182
|
+
} | undefined;
|
|
2031
2183
|
default_value?: unknown;
|
|
2032
2184
|
}>;
|
|
2033
2185
|
/**
|
|
@@ -2043,6 +2195,12 @@ declare function parseRelationMeta(attr: Attribute): RelationAttributeMeta | nul
|
|
|
2043
2195
|
* attribute with no meta still resolves to an empty `{}` rather than null.
|
|
2044
2196
|
*/
|
|
2045
2197
|
declare function parseCurrencyMeta(attr: Attribute): CurrencyAttributeMeta | null;
|
|
2198
|
+
/**
|
|
2199
|
+
* Returns the typed `PrincipalAttributeMeta` when `attr` is a principal
|
|
2200
|
+
* attribute; null otherwise. Principal meta is optional, so an attribute with
|
|
2201
|
+
* no meta resolves to an empty `{}` rather than null.
|
|
2202
|
+
*/
|
|
2203
|
+
declare function parsePrincipalMeta(attr: Attribute): PrincipalAttributeMeta | null;
|
|
2046
2204
|
declare function parseUserMeta(attr: Attribute): UserAttributeMeta | null;
|
|
2047
2205
|
/**
|
|
2048
2206
|
* Returns the typed `FileAttributeMeta` when `attr` is a file attribute; null
|
|
@@ -2126,6 +2284,46 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
2126
2284
|
is_nullable: z.ZodOptional<z.ZodBoolean>;
|
|
2127
2285
|
is_unique: z.ZodBoolean;
|
|
2128
2286
|
is_read_only: z.ZodOptional<z.ZodBoolean>;
|
|
2287
|
+
restrictions: z.ZodOptional<z.ZodObject<{
|
|
2288
|
+
read: z.ZodOptional<z.ZodObject<{
|
|
2289
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2290
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2291
|
+
}, "strip", z.ZodTypeAny, {
|
|
2292
|
+
roles?: string[] | undefined;
|
|
2293
|
+
teams?: string[] | undefined;
|
|
2294
|
+
}, {
|
|
2295
|
+
roles?: string[] | undefined;
|
|
2296
|
+
teams?: string[] | undefined;
|
|
2297
|
+
}>>;
|
|
2298
|
+
write: z.ZodOptional<z.ZodObject<{
|
|
2299
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2300
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2301
|
+
}, "strip", z.ZodTypeAny, {
|
|
2302
|
+
roles?: string[] | undefined;
|
|
2303
|
+
teams?: string[] | undefined;
|
|
2304
|
+
}, {
|
|
2305
|
+
roles?: string[] | undefined;
|
|
2306
|
+
teams?: string[] | undefined;
|
|
2307
|
+
}>>;
|
|
2308
|
+
}, "strip", z.ZodTypeAny, {
|
|
2309
|
+
read?: {
|
|
2310
|
+
roles?: string[] | undefined;
|
|
2311
|
+
teams?: string[] | undefined;
|
|
2312
|
+
} | undefined;
|
|
2313
|
+
write?: {
|
|
2314
|
+
roles?: string[] | undefined;
|
|
2315
|
+
teams?: string[] | undefined;
|
|
2316
|
+
} | undefined;
|
|
2317
|
+
}, {
|
|
2318
|
+
read?: {
|
|
2319
|
+
roles?: string[] | undefined;
|
|
2320
|
+
teams?: string[] | undefined;
|
|
2321
|
+
} | undefined;
|
|
2322
|
+
write?: {
|
|
2323
|
+
roles?: string[] | undefined;
|
|
2324
|
+
teams?: string[] | undefined;
|
|
2325
|
+
} | undefined;
|
|
2326
|
+
}>>;
|
|
2129
2327
|
default_value: z.ZodOptional<z.ZodUnknown>;
|
|
2130
2328
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
2131
2329
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2140,6 +2338,16 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
2140
2338
|
description?: string | undefined;
|
|
2141
2339
|
is_read_only?: boolean | undefined;
|
|
2142
2340
|
is_nullable?: boolean | undefined;
|
|
2341
|
+
restrictions?: {
|
|
2342
|
+
read?: {
|
|
2343
|
+
roles?: string[] | undefined;
|
|
2344
|
+
teams?: string[] | undefined;
|
|
2345
|
+
} | undefined;
|
|
2346
|
+
write?: {
|
|
2347
|
+
roles?: string[] | undefined;
|
|
2348
|
+
teams?: string[] | undefined;
|
|
2349
|
+
} | undefined;
|
|
2350
|
+
} | undefined;
|
|
2143
2351
|
default_value?: unknown;
|
|
2144
2352
|
}, {
|
|
2145
2353
|
type: string;
|
|
@@ -2152,6 +2360,16 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
2152
2360
|
description?: string | undefined;
|
|
2153
2361
|
is_read_only?: boolean | undefined;
|
|
2154
2362
|
is_nullable?: boolean | undefined;
|
|
2363
|
+
restrictions?: {
|
|
2364
|
+
read?: {
|
|
2365
|
+
roles?: string[] | undefined;
|
|
2366
|
+
teams?: string[] | undefined;
|
|
2367
|
+
} | undefined;
|
|
2368
|
+
write?: {
|
|
2369
|
+
roles?: string[] | undefined;
|
|
2370
|
+
teams?: string[] | undefined;
|
|
2371
|
+
} | undefined;
|
|
2372
|
+
} | undefined;
|
|
2155
2373
|
default_value?: unknown;
|
|
2156
2374
|
}>, "many">;
|
|
2157
2375
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2178,6 +2396,16 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
2178
2396
|
description?: string | undefined;
|
|
2179
2397
|
is_read_only?: boolean | undefined;
|
|
2180
2398
|
is_nullable?: boolean | undefined;
|
|
2399
|
+
restrictions?: {
|
|
2400
|
+
read?: {
|
|
2401
|
+
roles?: string[] | undefined;
|
|
2402
|
+
teams?: string[] | undefined;
|
|
2403
|
+
} | undefined;
|
|
2404
|
+
write?: {
|
|
2405
|
+
roles?: string[] | undefined;
|
|
2406
|
+
teams?: string[] | undefined;
|
|
2407
|
+
} | undefined;
|
|
2408
|
+
} | undefined;
|
|
2181
2409
|
default_value?: unknown;
|
|
2182
2410
|
}[];
|
|
2183
2411
|
slug: string;
|
|
@@ -2209,6 +2437,16 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
2209
2437
|
description?: string | undefined;
|
|
2210
2438
|
is_read_only?: boolean | undefined;
|
|
2211
2439
|
is_nullable?: boolean | undefined;
|
|
2440
|
+
restrictions?: {
|
|
2441
|
+
read?: {
|
|
2442
|
+
roles?: string[] | undefined;
|
|
2443
|
+
teams?: string[] | undefined;
|
|
2444
|
+
} | undefined;
|
|
2445
|
+
write?: {
|
|
2446
|
+
roles?: string[] | undefined;
|
|
2447
|
+
teams?: string[] | undefined;
|
|
2448
|
+
} | undefined;
|
|
2449
|
+
} | undefined;
|
|
2212
2450
|
default_value?: unknown;
|
|
2213
2451
|
}[];
|
|
2214
2452
|
slug: string;
|
|
@@ -2263,6 +2501,46 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2263
2501
|
is_nullable: z.ZodOptional<z.ZodBoolean>;
|
|
2264
2502
|
is_unique: z.ZodBoolean;
|
|
2265
2503
|
is_read_only: z.ZodOptional<z.ZodBoolean>;
|
|
2504
|
+
restrictions: z.ZodOptional<z.ZodObject<{
|
|
2505
|
+
read: z.ZodOptional<z.ZodObject<{
|
|
2506
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2507
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2508
|
+
}, "strip", z.ZodTypeAny, {
|
|
2509
|
+
roles?: string[] | undefined;
|
|
2510
|
+
teams?: string[] | undefined;
|
|
2511
|
+
}, {
|
|
2512
|
+
roles?: string[] | undefined;
|
|
2513
|
+
teams?: string[] | undefined;
|
|
2514
|
+
}>>;
|
|
2515
|
+
write: z.ZodOptional<z.ZodObject<{
|
|
2516
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2517
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2518
|
+
}, "strip", z.ZodTypeAny, {
|
|
2519
|
+
roles?: string[] | undefined;
|
|
2520
|
+
teams?: string[] | undefined;
|
|
2521
|
+
}, {
|
|
2522
|
+
roles?: string[] | undefined;
|
|
2523
|
+
teams?: string[] | undefined;
|
|
2524
|
+
}>>;
|
|
2525
|
+
}, "strip", z.ZodTypeAny, {
|
|
2526
|
+
read?: {
|
|
2527
|
+
roles?: string[] | undefined;
|
|
2528
|
+
teams?: string[] | undefined;
|
|
2529
|
+
} | undefined;
|
|
2530
|
+
write?: {
|
|
2531
|
+
roles?: string[] | undefined;
|
|
2532
|
+
teams?: string[] | undefined;
|
|
2533
|
+
} | undefined;
|
|
2534
|
+
}, {
|
|
2535
|
+
read?: {
|
|
2536
|
+
roles?: string[] | undefined;
|
|
2537
|
+
teams?: string[] | undefined;
|
|
2538
|
+
} | undefined;
|
|
2539
|
+
write?: {
|
|
2540
|
+
roles?: string[] | undefined;
|
|
2541
|
+
teams?: string[] | undefined;
|
|
2542
|
+
} | undefined;
|
|
2543
|
+
}>>;
|
|
2266
2544
|
default_value: z.ZodOptional<z.ZodUnknown>;
|
|
2267
2545
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
2268
2546
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2277,6 +2555,16 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2277
2555
|
description?: string | undefined;
|
|
2278
2556
|
is_read_only?: boolean | undefined;
|
|
2279
2557
|
is_nullable?: boolean | undefined;
|
|
2558
|
+
restrictions?: {
|
|
2559
|
+
read?: {
|
|
2560
|
+
roles?: string[] | undefined;
|
|
2561
|
+
teams?: string[] | undefined;
|
|
2562
|
+
} | undefined;
|
|
2563
|
+
write?: {
|
|
2564
|
+
roles?: string[] | undefined;
|
|
2565
|
+
teams?: string[] | undefined;
|
|
2566
|
+
} | undefined;
|
|
2567
|
+
} | undefined;
|
|
2280
2568
|
default_value?: unknown;
|
|
2281
2569
|
}, {
|
|
2282
2570
|
type: string;
|
|
@@ -2289,6 +2577,16 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2289
2577
|
description?: string | undefined;
|
|
2290
2578
|
is_read_only?: boolean | undefined;
|
|
2291
2579
|
is_nullable?: boolean | undefined;
|
|
2580
|
+
restrictions?: {
|
|
2581
|
+
read?: {
|
|
2582
|
+
roles?: string[] | undefined;
|
|
2583
|
+
teams?: string[] | undefined;
|
|
2584
|
+
} | undefined;
|
|
2585
|
+
write?: {
|
|
2586
|
+
roles?: string[] | undefined;
|
|
2587
|
+
teams?: string[] | undefined;
|
|
2588
|
+
} | undefined;
|
|
2589
|
+
} | undefined;
|
|
2292
2590
|
default_value?: unknown;
|
|
2293
2591
|
}>, "many">;
|
|
2294
2592
|
} & {
|
|
@@ -2317,6 +2615,16 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2317
2615
|
description?: string | undefined;
|
|
2318
2616
|
is_read_only?: boolean | undefined;
|
|
2319
2617
|
is_nullable?: boolean | undefined;
|
|
2618
|
+
restrictions?: {
|
|
2619
|
+
read?: {
|
|
2620
|
+
roles?: string[] | undefined;
|
|
2621
|
+
teams?: string[] | undefined;
|
|
2622
|
+
} | undefined;
|
|
2623
|
+
write?: {
|
|
2624
|
+
roles?: string[] | undefined;
|
|
2625
|
+
teams?: string[] | undefined;
|
|
2626
|
+
} | undefined;
|
|
2627
|
+
} | undefined;
|
|
2320
2628
|
default_value?: unknown;
|
|
2321
2629
|
}[];
|
|
2322
2630
|
slug: string;
|
|
@@ -2349,6 +2657,16 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2349
2657
|
description?: string | undefined;
|
|
2350
2658
|
is_read_only?: boolean | undefined;
|
|
2351
2659
|
is_nullable?: boolean | undefined;
|
|
2660
|
+
restrictions?: {
|
|
2661
|
+
read?: {
|
|
2662
|
+
roles?: string[] | undefined;
|
|
2663
|
+
teams?: string[] | undefined;
|
|
2664
|
+
} | undefined;
|
|
2665
|
+
write?: {
|
|
2666
|
+
roles?: string[] | undefined;
|
|
2667
|
+
teams?: string[] | undefined;
|
|
2668
|
+
} | undefined;
|
|
2669
|
+
} | undefined;
|
|
2352
2670
|
default_value?: unknown;
|
|
2353
2671
|
}[];
|
|
2354
2672
|
slug: string;
|
|
@@ -3079,26 +3397,57 @@ interface UpdateListViewRequest {
|
|
|
3079
3397
|
filters?: FilterGroup[];
|
|
3080
3398
|
}
|
|
3081
3399
|
/**
|
|
3082
|
-
*
|
|
3083
|
-
*
|
|
3400
|
+
* What a page toolbar button invokes. Absent normalizes to `action` (pages
|
|
3401
|
+
* persisted before `kind` existed).
|
|
3402
|
+
*/
|
|
3403
|
+
type PageActionKind = 'action' | 'workflow';
|
|
3404
|
+
/**
|
|
3405
|
+
* Page action definition — one toolbar button. `kind: action` invokes a
|
|
3406
|
+
* function-service Action by slug (`action`) and may prefill its params;
|
|
3407
|
+
* `kind: workflow` starts a manual run of a workflow by key (`workflow`) and
|
|
3408
|
+
* may prefill its manual-trigger inputs. `params` / `inputs` map target field
|
|
3409
|
+
* names to Liquid templates rendered against the page scope
|
|
3410
|
+
* `{ record, entity, params, user }`; a resolved field is locked in the invoke
|
|
3411
|
+
* dialog. `skip_confirmation` fires the target immediately when every required
|
|
3412
|
+
* field resolved from the templates.
|
|
3084
3413
|
*/
|
|
3085
3414
|
interface PageAction {
|
|
3086
3415
|
label: string;
|
|
3087
3416
|
icon: string;
|
|
3088
|
-
|
|
3417
|
+
kind?: PageActionKind;
|
|
3418
|
+
action?: string;
|
|
3419
|
+
workflow?: string;
|
|
3420
|
+
params?: Record<string, string>;
|
|
3421
|
+
inputs?: Record<string, string>;
|
|
3422
|
+
skip_confirmation?: boolean;
|
|
3089
3423
|
}
|
|
3090
3424
|
declare const PageActionSchema: z.ZodObject<{
|
|
3091
3425
|
label: z.ZodString;
|
|
3092
3426
|
icon: z.ZodString;
|
|
3093
|
-
|
|
3427
|
+
kind: z.ZodOptional<z.ZodEnum<["action", "workflow"]>>;
|
|
3428
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3429
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
3430
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3431
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3432
|
+
skip_confirmation: z.ZodOptional<z.ZodBoolean>;
|
|
3094
3433
|
}, "strip", z.ZodTypeAny, {
|
|
3095
3434
|
label: string;
|
|
3096
3435
|
icon: string;
|
|
3097
|
-
|
|
3436
|
+
params?: Record<string, string> | undefined;
|
|
3437
|
+
action?: string | undefined;
|
|
3438
|
+
workflow?: string | undefined;
|
|
3439
|
+
kind?: "action" | "workflow" | undefined;
|
|
3440
|
+
inputs?: Record<string, string> | undefined;
|
|
3441
|
+
skip_confirmation?: boolean | undefined;
|
|
3098
3442
|
}, {
|
|
3099
3443
|
label: string;
|
|
3100
3444
|
icon: string;
|
|
3101
|
-
|
|
3445
|
+
params?: Record<string, string> | undefined;
|
|
3446
|
+
action?: string | undefined;
|
|
3447
|
+
workflow?: string | undefined;
|
|
3448
|
+
kind?: "action" | "workflow" | undefined;
|
|
3449
|
+
inputs?: Record<string, string> | undefined;
|
|
3450
|
+
skip_confirmation?: boolean | undefined;
|
|
3102
3451
|
}>;
|
|
3103
3452
|
/**
|
|
3104
3453
|
* Page type — encodes what the page binds to and how it is served (chrome +
|
|
@@ -3164,15 +3513,30 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3164
3513
|
actions: z.ZodArray<z.ZodObject<{
|
|
3165
3514
|
label: z.ZodString;
|
|
3166
3515
|
icon: z.ZodString;
|
|
3167
|
-
|
|
3516
|
+
kind: z.ZodOptional<z.ZodEnum<["action", "workflow"]>>;
|
|
3517
|
+
action: z.ZodOptional<z.ZodString>;
|
|
3518
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
3519
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3520
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3521
|
+
skip_confirmation: z.ZodOptional<z.ZodBoolean>;
|
|
3168
3522
|
}, "strip", z.ZodTypeAny, {
|
|
3169
3523
|
label: string;
|
|
3170
3524
|
icon: string;
|
|
3171
|
-
|
|
3525
|
+
params?: Record<string, string> | undefined;
|
|
3526
|
+
action?: string | undefined;
|
|
3527
|
+
workflow?: string | undefined;
|
|
3528
|
+
kind?: "action" | "workflow" | undefined;
|
|
3529
|
+
inputs?: Record<string, string> | undefined;
|
|
3530
|
+
skip_confirmation?: boolean | undefined;
|
|
3172
3531
|
}, {
|
|
3173
3532
|
label: string;
|
|
3174
3533
|
icon: string;
|
|
3175
|
-
|
|
3534
|
+
params?: Record<string, string> | undefined;
|
|
3535
|
+
action?: string | undefined;
|
|
3536
|
+
workflow?: string | undefined;
|
|
3537
|
+
kind?: "action" | "workflow" | undefined;
|
|
3538
|
+
inputs?: Record<string, string> | undefined;
|
|
3539
|
+
skip_confirmation?: boolean | undefined;
|
|
3176
3540
|
}>, "many">;
|
|
3177
3541
|
layout: z.ZodObject<{
|
|
3178
3542
|
version: z.ZodLiteral<1>;
|
|
@@ -3253,7 +3617,12 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3253
3617
|
actions: {
|
|
3254
3618
|
label: string;
|
|
3255
3619
|
icon: string;
|
|
3256
|
-
|
|
3620
|
+
params?: Record<string, string> | undefined;
|
|
3621
|
+
action?: string | undefined;
|
|
3622
|
+
workflow?: string | undefined;
|
|
3623
|
+
kind?: "action" | "workflow" | undefined;
|
|
3624
|
+
inputs?: Record<string, string> | undefined;
|
|
3625
|
+
skip_confirmation?: boolean | undefined;
|
|
3257
3626
|
}[];
|
|
3258
3627
|
layout: {
|
|
3259
3628
|
version: 1;
|
|
@@ -3289,7 +3658,12 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3289
3658
|
actions: {
|
|
3290
3659
|
label: string;
|
|
3291
3660
|
icon: string;
|
|
3292
|
-
|
|
3661
|
+
params?: Record<string, string> | undefined;
|
|
3662
|
+
action?: string | undefined;
|
|
3663
|
+
workflow?: string | undefined;
|
|
3664
|
+
kind?: "action" | "workflow" | undefined;
|
|
3665
|
+
inputs?: Record<string, string> | undefined;
|
|
3666
|
+
skip_confirmation?: boolean | undefined;
|
|
3293
3667
|
}[];
|
|
3294
3668
|
layout: {
|
|
3295
3669
|
version: 1;
|
|
@@ -3708,5 +4082,23 @@ interface UpdateDesignReferenceRequest {
|
|
|
3708
4082
|
interface DesignReferenceContent {
|
|
3709
4083
|
content: string;
|
|
3710
4084
|
}
|
|
4085
|
+
/**
|
|
4086
|
+
* The one non-literal `default_value`: "whoever is writing the record".
|
|
4087
|
+
* Meaningful only on `user` and `principal` attributes, where data-service
|
|
4088
|
+
* resolves it to the caller's `{ type, id }` at write time — an owner field
|
|
4089
|
+
* granting `share`, an `assignee`, a `requested_by` fill themselves without a
|
|
4090
|
+
* hook. An object rather than a bare string because a bare string IS a valid
|
|
4091
|
+
* user value (clients send bare ids). Mirrors `metamodel.CurrentUserDefault`.
|
|
4092
|
+
*/
|
|
4093
|
+
declare const CURRENT_USER_DEFAULT: {
|
|
4094
|
+
readonly type: "current_user";
|
|
4095
|
+
};
|
|
4096
|
+
type CurrentUserDefault = {
|
|
4097
|
+
type: 'current_user';
|
|
4098
|
+
};
|
|
4099
|
+
/** True when a `default_value` is the current-user sentinel (and nothing else). */
|
|
4100
|
+
declare function isCurrentUserDefault(value: unknown): value is CurrentUserDefault;
|
|
4101
|
+
/** Only the identity-valued attribute types can carry the sentinel. */
|
|
4102
|
+
declare function acceptsCurrentUserDefault(type: AttributeType): boolean;
|
|
3711
4103
|
|
|
3712
|
-
export {
|
|
4104
|
+
export { type EntityWithSchema as $, type AuditFields as A, type CreateListViewRequest as B, CURRENT_USER_DEFAULT as C, type CreateMenuConfigurationRequest as D, type CreatePageRequest as E, type FileRef as F, type CreateVariableRequest as G, type CurrencyAttributeMeta as H, CurrencyAttributeMetaSchema as I, type CurrencySymbolSide as J, type CurrencyValue as K, type ListOptions as L, type CurrentUserDefault as M, DEFAULT_OPTIONS as N, DEFAULT_PAGE_SIZE as O, PageIterator as P, DONE as Q, type DeployModuleRequest as R, type DesignReference as S, type DesignReferenceContent as T, type UserRef as U, DesignReferenceSchema as V, type DesignReferenceService as W, type Done as X, type Entity as Y, EntitySchema as Z, type EntityService as _, type Attribute as a, type Timestamps as a$, EntityWithSchemaSchema as a0, type EnumAttributeMeta as a1, type EnumValue as a2, type FileAttributeMeta as a3, FileRefSchema as a4, type FilterElement as a5, FilterElementSchema as a6, type FilterGroup as a7, FilterGroupSchema as a8, type List as a9, ModuleSchema as aA, type ModuleService as aB, type ModuleStatus as aC, type OnDeleteAction as aD, OnDeleteActionSchema as aE, PLATFORM_ATTRIBUTE_NAMES as aF, PLATFORM_USER_ID as aG, type Page as aH, type PageAction as aI, type PageActionKind as aJ, PageActionSchema as aK, type PageLayout as aL, PageLayoutSchema as aM, PageSchema as aN, type PageService as aO, type PageType as aP, type PublicPageComponent as aQ, type PublicPageResponse as aR, type RelationAttributeMeta as aS, RelationAttributeMetaSchema as aT, type RequestOptions as aU, type ResolvedClientOptions as aV, type ResponseMeta as aW, ResponseMetaSchema as aX, type SortConfig as aY, SortConfigSchema as aZ, type SortDirection as a_, type ListAppsOptions as aa, type ListComponentsOptions as ab, type ListDesignReferencesOptions as ac, type ListEntitiesOptions as ad, type ListFn as ae, type ListListViewsOptions as af, type ListListsOptions as ag, type ListMenuConfigurationsOptions as ah, type ListModulesOptions as ai, type ListPagesOptions as aj, ListSchema as ak, type ListService as al, type ListVariablesOptions as am, type ListView as an, ListViewSchema as ao, type ListViewService as ap, type LogicalOperator as aq, type MenuConfiguration as ar, MenuConfigurationSchema as as, type MenuConfigurationService as at, type MenuItem as au, MenuItemSchema as av, MenuItemType as aw, MetaClient as ax, type MetaListOptions as ay, type Module as az, type ListResult as b, type PrincipalType as b$, type TokenProvider as b0, type UpdateAppRequest as b1, type UpdateComponentRequest as b2, type UpdateDesignReferenceRequest as b3, type UpdateEntityRequest as b4, type UpdateListRequest as b5, type UpdateListViewRequest as b6, type UpdateMenuConfigurationRequest as b7, type UpdatePageRequest as b8, type UpdateVariableRequest as b9, type BuiltInControlSlug as bA, type CardElement as bB, type ColumnElement as bC, type CommonProps as bD, type ComponentElement as bE, type ControlBucket as bF, type DatetimeAttributeMeta as bG, type DatetimeFormat as bH, type DividerElement as bI, type FieldElement as bJ, FileAttributeMetaSchema as bK, type LayoutAlign as bL, type LayoutElement as bM, LayoutElementSchema as bN, LayoutElementType as bO, type LayoutGap as bP, type LayoutJustify as bQ, type LayoutTab as bR, type NumberAttributeMeta as bS, type ObjectAttributeMeta as bT, PAGE_BACKGROUND_TOKENS as bU, type PageBackgroundToken as bV, type PageLayoutSidePanel as bW, PageLayoutSidePanelSchema as bX, type PageStyle as bY, PageStyleSchema as bZ, type PrincipalAttributeMeta as b_, UserRefSchema as ba, type UserType as bb, type Variable as bc, VariableSchema as bd, type VariableService as be, acceptsCurrentUserDefault as bf, allCurrencyCodes as bg, createIterator as bh, createListResultSchema as bi, currencyLabel as bj, currencySymbol as bk, currencySymbolSide as bl, formatAmount as bm, formatMoney as bn, isCurrentUserDefault as bo, isPlatformAttributeName as bp, localeNumberSeparators as bq, parseAmount as br, parseCurrencyMeta as bs, parseFileMeta as bt, parseRelationMeta as bu, platformAttributes as bv, resolveOptions as bw, type AttributeForLookup as bx, type AttributeMeta as by, BUILT_IN_CONTROLS as bz, ProteosClient as c, type RelatedListElement as c0, type RelatedRecordElement as c1, type ResponsiveSizing as c2, type RowElement as c3, type SectionElement as c4, type SizeValue as c5, SizeValueSchema as c6, type SizingProps as c7, type StringAttributeMeta as c8, type StringFormat as c9, type TabsElement as ca, type TextElement as cb, type TextVariant as cc, type UserAttributeMeta as cd, UserAttributeMetaSchema as ce, isBuiltInControl as cf, lookupCompatibleControls as cg, lookupControls as ch, lookupPrimaryControl as ci, parsePrincipalMeta as cj, parseUserMeta as ck, type PrincipalRef as d, type PublicAccessOperation as e, type App as f, AppSchema as g, type AppService as h, type ArrayAttributeMeta as i, type AttributeAccessRule as j, type AttributeRestrictions as k, AttributeSchema as l, type AttributeType as m, AuditFieldsSchema as n, type ClientOptions as o, type Column as p, ColumnSchema as q, type ComparisonOperator as r, type Component as s, ComponentSchema as t, type ComponentService as u, type CreateAppRequest as v, type CreateComponentRequest as w, type CreateDesignReferenceRequest as x, type CreateEntityRequest as y, type CreateListRequest as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteos/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "TypeScript SDK for the Proteos platform",
|
|
6
6
|
"repository": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"tsup": "^8.3.0",
|
|
67
67
|
"typescript": "^5.7.0",
|
|
68
68
|
"vitest": "^3.0.0",
|
|
69
|
-
"@proteos/
|
|
70
|
-
"@proteos/
|
|
69
|
+
"@proteos/biome-config": "0.0.0",
|
|
70
|
+
"@proteos/tsconfig": "0.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "tsup",
|