@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.
@@ -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
- * Page action definition. Page-level toolbar item; addressed by permissions
3083
- * and shortcuts systems.
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
- action: string;
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
- action: z.ZodString;
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
- action: string;
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
- action: string;
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
- action: z.ZodString;
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
- action: string;
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
- action: string;
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
- action: string;
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
- action: string;
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 { FileRefSchema as $, type AuditFields as A, type CurrencyAttributeMeta as B, type ClientOptions as C, CurrencyAttributeMetaSchema as D, type CurrencySymbolSide as E, type FileRef as F, type CurrencyValue as G, DEFAULT_OPTIONS as H, DEFAULT_PAGE_SIZE as I, DONE as J, type DeployModuleRequest as K, type ListOptions as L, type DesignReference as M, type DesignReferenceContent as N, DesignReferenceSchema as O, PageIterator as P, type DesignReferenceService as Q, type Done as R, type Entity as S, EntitySchema as T, type UserRef as U, type EntityService as V, type EntityWithSchema as W, EntityWithSchemaSchema as X, type EnumAttributeMeta as Y, type EnumValue as Z, type FileAttributeMeta as _, type Attribute as a, type UpdateListRequest as a$, type FilterElement as a0, FilterElementSchema as a1, type FilterGroup as a2, FilterGroupSchema as a3, type List as a4, type ListAppsOptions as a5, type ListComponentsOptions as a6, type ListDesignReferencesOptions as a7, type ListEntitiesOptions as a8, type ListFn as a9, PLATFORM_ATTRIBUTE_NAMES as aA, PLATFORM_USER_ID as aB, type Page as aC, type PageAction as aD, PageActionSchema as aE, type PageLayout as aF, PageLayoutSchema as aG, PageSchema as aH, type PageService as aI, type PageType as aJ, type PublicPageComponent as aK, type PublicPageResponse as aL, type RelationAttributeMeta as aM, RelationAttributeMetaSchema as aN, type RequestOptions as aO, type ResolvedClientOptions as aP, type ResponseMeta as aQ, ResponseMetaSchema as aR, type SortConfig as aS, SortConfigSchema as aT, type SortDirection as aU, type Timestamps as aV, type TokenProvider as aW, type UpdateAppRequest as aX, type UpdateComponentRequest as aY, type UpdateDesignReferenceRequest as aZ, type UpdateEntityRequest as a_, type ListListViewsOptions as aa, type ListListsOptions as ab, type ListMenuConfigurationsOptions as ac, type ListModulesOptions as ad, type ListPagesOptions as ae, ListSchema as af, type ListService as ag, type ListVariablesOptions as ah, type ListView as ai, ListViewSchema as aj, type ListViewService as ak, type LogicalOperator as al, type MenuConfiguration as am, MenuConfigurationSchema as an, type MenuConfigurationService as ao, type MenuItem as ap, MenuItemSchema as aq, MenuItemType as ar, MetaClient as as, type MetaListOptions as at, type Module as au, ModuleSchema as av, type ModuleService as aw, type ModuleStatus as ax, type OnDeleteAction as ay, OnDeleteActionSchema as az, type ListResult as b, type StringFormat as b$, type UpdateListViewRequest as b0, type UpdateMenuConfigurationRequest as b1, type UpdatePageRequest as b2, type UpdateVariableRequest as b3, UserRefSchema as b4, type UserType as b5, type Variable as b6, VariableSchema as b7, type VariableService as b8, allCurrencyCodes as b9, type DividerElement as bA, type FieldElement as bB, FileAttributeMetaSchema as bC, type LayoutAlign as bD, type LayoutElement as bE, LayoutElementSchema as bF, LayoutElementType as bG, type LayoutGap as bH, type LayoutJustify as bI, type LayoutTab as bJ, type NumberAttributeMeta as bK, type ObjectAttributeMeta as bL, PAGE_BACKGROUND_TOKENS as bM, type PageBackgroundToken as bN, type PageLayoutSidePanel as bO, PageLayoutSidePanelSchema as bP, type PageStyle as bQ, PageStyleSchema as bR, type RelatedListElement as bS, type RelatedRecordElement as bT, type ResponsiveSizing as bU, type RowElement as bV, type SectionElement as bW, type SizeValue as bX, SizeValueSchema as bY, type SizingProps as bZ, type StringAttributeMeta as b_, createIterator as ba, createListResultSchema as bb, currencyLabel as bc, currencySymbol as bd, currencySymbolSide as be, formatAmount as bf, formatMoney as bg, isPlatformAttributeName as bh, localeNumberSeparators as bi, parseAmount as bj, parseCurrencyMeta as bk, parseFileMeta as bl, parseRelationMeta as bm, platformAttributes as bn, resolveOptions as bo, type AttributeForLookup as bp, type AttributeMeta as bq, BUILT_IN_CONTROLS as br, type BuiltInControlSlug as bs, type CardElement as bt, type ColumnElement as bu, type CommonProps as bv, type ComponentElement as bw, type ControlBucket as bx, type DatetimeAttributeMeta as by, type DatetimeFormat as bz, ProteosClient as c, type TabsElement as c0, type TextElement as c1, type TextVariant as c2, type UserAttributeMeta as c3, UserAttributeMetaSchema as c4, isBuiltInControl as c5, lookupCompatibleControls as c6, lookupControls as c7, lookupPrimaryControl as c8, parseUserMeta as c9, type PublicAccessOperation as d, type App as e, AppSchema as f, type AppService as g, type ArrayAttributeMeta as h, AttributeSchema as i, type AttributeType as j, AuditFieldsSchema as k, type Column as l, ColumnSchema as m, type ComparisonOperator as n, type Component as o, ComponentSchema as p, type ComponentService as q, type CreateAppRequest as r, type CreateComponentRequest as s, type CreateDesignReferenceRequest as t, type CreateEntityRequest as u, type CreateListRequest as v, type CreateListViewRequest as w, type CreateMenuConfigurationRequest as x, type CreatePageRequest as y, type CreateVariableRequest as z };
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.45.0",
3
+ "version": "0.46.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "TypeScript SDK for the Proteos platform",
6
6
  "repository": {