@proteos/sdk 0.21.0 → 0.22.1
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-OUVD2XJX.js → chunk-NYIHV7ET.js} +118 -4
- package/dist/chunk-NYIHV7ET.js.map +1 -0
- package/dist/{chunk-DD6H5PIF.cjs → chunk-V3U7U3IX.cjs} +120 -3
- package/dist/chunk-V3U7U3IX.cjs.map +1 -0
- package/dist/index.cjs +188 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +246 -210
- package/dist/index.d.ts +246 -210
- package/dist/index.js +104 -64
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +62 -50
- 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-PzImL4QI.d.cts → types-B0LqBATf.d.cts} +290 -1
- package/dist/{types-PzImL4QI.d.ts → types-B0LqBATf.d.ts} +290 -1
- package/package.json +1 -1
- package/src/auth/platform-entities.ts +4 -0
- package/src/data/records.ts +60 -0
- package/src/index.ts +29 -21
- package/src/meta/design-references.ts +127 -0
- package/src/meta/entities.ts +17 -0
- package/src/meta/index.ts +15 -0
- package/src/meta/layout/index.ts +4 -0
- package/src/meta/layout/page-layout.ts +54 -0
- package/src/meta/types.ts +94 -0
- package/src/storage/files.ts +31 -0
- package/src/storage/types.ts +10 -0
- package/dist/chunk-DD6H5PIF.cjs.map +0 -1
- package/dist/chunk-OUVD2XJX.js.map +0 -1
|
@@ -675,6 +675,36 @@ interface ComponentService {
|
|
|
675
675
|
bundleUrl(slug: string): string;
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Service for managing an org's stored DESIGN.md documents (design references).
|
|
680
|
+
*
|
|
681
|
+
* The markdown body is split from the metadata methods: list/get never carry
|
|
682
|
+
* `content` — read it with {@link getContent} and write it with
|
|
683
|
+
* {@link setContent} (create may seed it in one shot).
|
|
684
|
+
*/
|
|
685
|
+
interface DesignReferenceService {
|
|
686
|
+
/** Lists design references (metadata only — no `content`). */
|
|
687
|
+
list(options?: ListDesignReferencesOptions): PageIterator<DesignReference, ListDesignReferencesOptions>;
|
|
688
|
+
/** Fetches a single page of design references (metadata only). */
|
|
689
|
+
listPage(options?: ListDesignReferencesOptions): Promise<ListResult<DesignReference>>;
|
|
690
|
+
/** Gets a single design reference by id (metadata only — no `content`). */
|
|
691
|
+
get(id: string): Promise<DesignReference>;
|
|
692
|
+
/** Resolves a design reference by its per-org slug (metadata only). */
|
|
693
|
+
getBySlug(slug: string): Promise<DesignReference>;
|
|
694
|
+
/** Creates a design reference; `content` optionally seeds the body. */
|
|
695
|
+
create(request: CreateDesignReferenceRequest): Promise<DesignReference>;
|
|
696
|
+
/** Creates or (by slug) replaces a design reference, including its body. */
|
|
697
|
+
upsert(request: CreateDesignReferenceRequest): Promise<DesignReference>;
|
|
698
|
+
/** Updates a design reference's metadata (name/description/slug). */
|
|
699
|
+
update(id: string, request: UpdateDesignReferenceRequest): Promise<DesignReference>;
|
|
700
|
+
/** Deletes a design reference. */
|
|
701
|
+
delete(id: string): Promise<void>;
|
|
702
|
+
/** Reads the markdown body for a design reference. */
|
|
703
|
+
getContent(id: string): Promise<string>;
|
|
704
|
+
/** Overwrites the markdown body for a design reference (metadata untouched). */
|
|
705
|
+
setContent(id: string, content: string): Promise<void>;
|
|
706
|
+
}
|
|
707
|
+
|
|
678
708
|
/**
|
|
679
709
|
* Service for managing entity definitions.
|
|
680
710
|
* Entities define the structure of business objects in the system.
|
|
@@ -740,6 +770,12 @@ interface EntityService {
|
|
|
740
770
|
* @throws {ProteosError} If entity not found (404)
|
|
741
771
|
*/
|
|
742
772
|
getWithSchema(slug: string): Promise<EntityWithSchema>;
|
|
773
|
+
/**
|
|
774
|
+
* Gets a public-access (read) entity (with schema) through the UNAUTHENTICATED
|
|
775
|
+
* public endpoint — no Authorization header. A non-public or missing
|
|
776
|
+
* entity 404s identically.
|
|
777
|
+
*/
|
|
778
|
+
getPublic(orgId: string, slug: string): Promise<EntityWithSchema>;
|
|
743
779
|
/**
|
|
744
780
|
* Creates a new entity.
|
|
745
781
|
*
|
|
@@ -1487,6 +1523,47 @@ declare const PageLayoutSidePanelSchema: z.ZodObject<{
|
|
|
1487
1523
|
width?: SizeValue | undefined;
|
|
1488
1524
|
is_sticky?: boolean | undefined;
|
|
1489
1525
|
}>;
|
|
1526
|
+
/**
|
|
1527
|
+
* Design-token keys a page background may name instead of a raw CSS color. The
|
|
1528
|
+
* web resolver maps each to `var(--color-<key>)`. Keep in sync with
|
|
1529
|
+
* `pageBackgroundTokens` in the metadata-service layout validator.
|
|
1530
|
+
*/
|
|
1531
|
+
declare const PAGE_BACKGROUND_TOKENS: readonly ["bg", "bg-2", "bg-3", "ink", "ink-2", "ink-3", "ink-4", "rule", "rule-2", "accent", "accent-2", "accent-ink", "success", "warning", "danger", "info"];
|
|
1532
|
+
type PageBackgroundToken = (typeof PAGE_BACKGROUND_TOKENS)[number];
|
|
1533
|
+
/**
|
|
1534
|
+
* Per-page presentation of a standalone page shell: background color plus the
|
|
1535
|
+
* content container's max-width and side / top padding. Every field is
|
|
1536
|
+
* optional; an omitted field falls back to the renderer default (the historical
|
|
1537
|
+
* bg / 1200px / 24px-32px look). `max_width: "fill"` (or `"auto"`) with zero
|
|
1538
|
+
* padding lets a component fill the page edge-to-edge.
|
|
1539
|
+
*
|
|
1540
|
+
* Honored only on `public` and `kiosk` pages in v1 (enforced server-side).
|
|
1541
|
+
*/
|
|
1542
|
+
interface PageStyle {
|
|
1543
|
+
/** Design-token key (see PAGE_BACKGROUND_TOKENS) or a raw CSS color. */
|
|
1544
|
+
background?: string;
|
|
1545
|
+
/** Content max-width; `"fill"` / `"auto"` removes the cap. */
|
|
1546
|
+
max_width?: SizeValue;
|
|
1547
|
+
/** Horizontal / vertical padding of the content container (Tailwind px/py). */
|
|
1548
|
+
padding_x?: SizeValue;
|
|
1549
|
+
padding_y?: SizeValue;
|
|
1550
|
+
}
|
|
1551
|
+
declare const PageStyleSchema: z.ZodObject<{
|
|
1552
|
+
background: z.ZodOptional<z.ZodString>;
|
|
1553
|
+
max_width: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1554
|
+
padding_x: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1555
|
+
padding_y: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1556
|
+
}, "strip", z.ZodTypeAny, {
|
|
1557
|
+
background?: string | undefined;
|
|
1558
|
+
max_width?: SizeValue | undefined;
|
|
1559
|
+
padding_x?: SizeValue | undefined;
|
|
1560
|
+
padding_y?: SizeValue | undefined;
|
|
1561
|
+
}, {
|
|
1562
|
+
background?: string | undefined;
|
|
1563
|
+
max_width?: SizeValue | undefined;
|
|
1564
|
+
padding_x?: SizeValue | undefined;
|
|
1565
|
+
padding_y?: SizeValue | undefined;
|
|
1566
|
+
}>;
|
|
1490
1567
|
/**
|
|
1491
1568
|
* Top-level page layout. Replaces the legacy `mainContent` / `side_panel`
|
|
1492
1569
|
* arrays of `PageSection`s with a single typed element tree.
|
|
@@ -1495,6 +1572,7 @@ interface PageLayout {
|
|
|
1495
1572
|
version: 1;
|
|
1496
1573
|
main: LayoutElement;
|
|
1497
1574
|
side_panel?: PageLayoutSidePanel;
|
|
1575
|
+
style?: PageStyle;
|
|
1498
1576
|
}
|
|
1499
1577
|
declare const PageLayoutSchema: z.ZodObject<{
|
|
1500
1578
|
version: z.ZodLiteral<1>;
|
|
@@ -1512,6 +1590,22 @@ declare const PageLayoutSchema: z.ZodObject<{
|
|
|
1512
1590
|
width?: SizeValue | undefined;
|
|
1513
1591
|
is_sticky?: boolean | undefined;
|
|
1514
1592
|
}>>;
|
|
1593
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
1594
|
+
background: z.ZodOptional<z.ZodString>;
|
|
1595
|
+
max_width: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1596
|
+
padding_x: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1597
|
+
padding_y: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
1598
|
+
}, "strip", z.ZodTypeAny, {
|
|
1599
|
+
background?: string | undefined;
|
|
1600
|
+
max_width?: SizeValue | undefined;
|
|
1601
|
+
padding_x?: SizeValue | undefined;
|
|
1602
|
+
padding_y?: SizeValue | undefined;
|
|
1603
|
+
}, {
|
|
1604
|
+
background?: string | undefined;
|
|
1605
|
+
max_width?: SizeValue | undefined;
|
|
1606
|
+
padding_x?: SizeValue | undefined;
|
|
1607
|
+
padding_y?: SizeValue | undefined;
|
|
1608
|
+
}>>;
|
|
1515
1609
|
}, "strip", z.ZodTypeAny, {
|
|
1516
1610
|
version: 1;
|
|
1517
1611
|
main: LayoutElement;
|
|
@@ -1520,6 +1614,12 @@ declare const PageLayoutSchema: z.ZodObject<{
|
|
|
1520
1614
|
width?: SizeValue | undefined;
|
|
1521
1615
|
is_sticky?: boolean | undefined;
|
|
1522
1616
|
} | undefined;
|
|
1617
|
+
style?: {
|
|
1618
|
+
background?: string | undefined;
|
|
1619
|
+
max_width?: SizeValue | undefined;
|
|
1620
|
+
padding_x?: SizeValue | undefined;
|
|
1621
|
+
padding_y?: SizeValue | undefined;
|
|
1622
|
+
} | undefined;
|
|
1523
1623
|
}, {
|
|
1524
1624
|
version: 1;
|
|
1525
1625
|
main: LayoutElement;
|
|
@@ -1528,6 +1628,12 @@ declare const PageLayoutSchema: z.ZodObject<{
|
|
|
1528
1628
|
width?: SizeValue | undefined;
|
|
1529
1629
|
is_sticky?: boolean | undefined;
|
|
1530
1630
|
} | undefined;
|
|
1631
|
+
style?: {
|
|
1632
|
+
background?: string | undefined;
|
|
1633
|
+
max_width?: SizeValue | undefined;
|
|
1634
|
+
padding_x?: SizeValue | undefined;
|
|
1635
|
+
padding_y?: SizeValue | undefined;
|
|
1636
|
+
} | undefined;
|
|
1531
1637
|
}>;
|
|
1532
1638
|
|
|
1533
1639
|
/**
|
|
@@ -1587,6 +1693,10 @@ declare class MetaClient {
|
|
|
1587
1693
|
* Service for managing apps.
|
|
1588
1694
|
*/
|
|
1589
1695
|
readonly apps: AppService;
|
|
1696
|
+
/**
|
|
1697
|
+
* Service for managing design references (stored DESIGN.md documents).
|
|
1698
|
+
*/
|
|
1699
|
+
readonly designReferences: DesignReferenceService;
|
|
1590
1700
|
/**
|
|
1591
1701
|
* Creates a new MetaClient instance.
|
|
1592
1702
|
*
|
|
@@ -1879,6 +1989,12 @@ declare function parseUserMeta(attr: Attribute): UserAttributeMeta | null;
|
|
|
1879
1989
|
* with no meta still resolves to an empty `{}` rather than null.
|
|
1880
1990
|
*/
|
|
1881
1991
|
declare function parseFileMeta(attr: Attribute): FileAttributeMeta | null;
|
|
1992
|
+
/**
|
|
1993
|
+
* A single operation a resource may be publicly exposed for. Independent set
|
|
1994
|
+
* (not a level): a resource can be public for `write` without `read`. Only
|
|
1995
|
+
* `read` is honored on the platform today; `write`/`delete` are reserved.
|
|
1996
|
+
*/
|
|
1997
|
+
type PublicAccessOperation = 'read' | 'write' | 'delete';
|
|
1882
1998
|
/**
|
|
1883
1999
|
* Entity definition.
|
|
1884
2000
|
* Note: Entity uses `slug` as its primary identifier, not `id`.
|
|
@@ -1888,6 +2004,14 @@ interface Entity extends AuditFields {
|
|
|
1888
2004
|
name: string;
|
|
1889
2005
|
description: string;
|
|
1890
2006
|
is_remote: boolean;
|
|
2007
|
+
/**
|
|
2008
|
+
* Operations ALL records of the entity are exposed for on the
|
|
2009
|
+
* unauthenticated public surface. Only `["read"]` is honored today (records
|
|
2010
|
+
* become world-readable; the entity definition is implicitly readable so
|
|
2011
|
+
* they can be interpreted); `write`/`delete` are reserved. Empty = private
|
|
2012
|
+
* (default).
|
|
2013
|
+
*/
|
|
2014
|
+
public_record_access: PublicAccessOperation[];
|
|
1891
2015
|
module_slug: string;
|
|
1892
2016
|
/**
|
|
1893
2017
|
* Liquid template that renders a human-readable title for an instance
|
|
@@ -1929,6 +2053,7 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
1929
2053
|
name: z.ZodString;
|
|
1930
2054
|
description: z.ZodString;
|
|
1931
2055
|
is_remote: z.ZodBoolean;
|
|
2056
|
+
public_record_access: z.ZodDefault<z.ZodArray<z.ZodEnum<["read", "write", "delete"]>, "many">>;
|
|
1932
2057
|
module_slug: z.ZodString;
|
|
1933
2058
|
title_template: z.ZodDefault<z.ZodString>;
|
|
1934
2059
|
attributes: z.ZodArray<z.ZodObject<{
|
|
@@ -1996,6 +2121,7 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
1996
2121
|
}[];
|
|
1997
2122
|
slug: string;
|
|
1998
2123
|
is_remote: boolean;
|
|
2124
|
+
public_record_access: ("read" | "write" | "delete")[];
|
|
1999
2125
|
module_slug: string;
|
|
2000
2126
|
title_template: string;
|
|
2001
2127
|
}, {
|
|
@@ -2027,6 +2153,7 @@ declare const EntitySchema: z.ZodObject<{
|
|
|
2027
2153
|
slug: string;
|
|
2028
2154
|
is_remote: boolean;
|
|
2029
2155
|
module_slug: string;
|
|
2156
|
+
public_record_access?: ("read" | "write" | "delete")[] | undefined;
|
|
2030
2157
|
title_template?: string | undefined;
|
|
2031
2158
|
}>;
|
|
2032
2159
|
/**
|
|
@@ -2063,6 +2190,7 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2063
2190
|
name: z.ZodString;
|
|
2064
2191
|
description: z.ZodString;
|
|
2065
2192
|
is_remote: z.ZodBoolean;
|
|
2193
|
+
public_record_access: z.ZodDefault<z.ZodArray<z.ZodEnum<["read", "write", "delete"]>, "many">>;
|
|
2066
2194
|
module_slug: z.ZodString;
|
|
2067
2195
|
title_template: z.ZodDefault<z.ZodString>;
|
|
2068
2196
|
attributes: z.ZodArray<z.ZodObject<{
|
|
@@ -2132,6 +2260,7 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2132
2260
|
}[];
|
|
2133
2261
|
slug: string;
|
|
2134
2262
|
is_remote: boolean;
|
|
2263
|
+
public_record_access: ("read" | "write" | "delete")[];
|
|
2135
2264
|
module_slug: string;
|
|
2136
2265
|
title_template: string;
|
|
2137
2266
|
schema: Record<string, unknown>;
|
|
@@ -2165,6 +2294,7 @@ declare const EntityWithSchemaSchema: z.ZodObject<{
|
|
|
2165
2294
|
is_remote: boolean;
|
|
2166
2295
|
module_slug: string;
|
|
2167
2296
|
schema: Record<string, unknown>;
|
|
2297
|
+
public_record_access?: ("read" | "write" | "delete")[] | undefined;
|
|
2168
2298
|
title_template?: string | undefined;
|
|
2169
2299
|
}>;
|
|
2170
2300
|
/**
|
|
@@ -2183,6 +2313,12 @@ interface CreateEntityRequest {
|
|
|
2183
2313
|
slug: string;
|
|
2184
2314
|
name: string;
|
|
2185
2315
|
is_remote: boolean;
|
|
2316
|
+
/**
|
|
2317
|
+
* Operations to expose all records of the entity for, unauthenticated (only
|
|
2318
|
+
* `["read"]` accepted today). Full-replacement on upsert: an upsert without
|
|
2319
|
+
* the field resets it to private.
|
|
2320
|
+
*/
|
|
2321
|
+
public_record_access?: PublicAccessOperation[];
|
|
2186
2322
|
module_slug: string;
|
|
2187
2323
|
description: string;
|
|
2188
2324
|
title_template?: string;
|
|
@@ -2194,6 +2330,7 @@ interface CreateEntityRequest {
|
|
|
2194
2330
|
interface UpdateEntityRequest {
|
|
2195
2331
|
name?: string;
|
|
2196
2332
|
is_remote?: boolean;
|
|
2333
|
+
public_record_access?: PublicAccessOperation[];
|
|
2197
2334
|
module_slug?: string;
|
|
2198
2335
|
description?: string;
|
|
2199
2336
|
title_template?: string;
|
|
@@ -2984,6 +3121,22 @@ declare const PageSchema: z.ZodObject<{
|
|
|
2984
3121
|
width?: SizeValue | undefined;
|
|
2985
3122
|
is_sticky?: boolean | undefined;
|
|
2986
3123
|
}>>;
|
|
3124
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
3125
|
+
background: z.ZodOptional<z.ZodString>;
|
|
3126
|
+
max_width: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
3127
|
+
padding_x: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
3128
|
+
padding_y: z.ZodOptional<z.ZodType<SizeValue, z.ZodTypeDef, SizeValue>>;
|
|
3129
|
+
}, "strip", z.ZodTypeAny, {
|
|
3130
|
+
background?: string | undefined;
|
|
3131
|
+
max_width?: SizeValue | undefined;
|
|
3132
|
+
padding_x?: SizeValue | undefined;
|
|
3133
|
+
padding_y?: SizeValue | undefined;
|
|
3134
|
+
}, {
|
|
3135
|
+
background?: string | undefined;
|
|
3136
|
+
max_width?: SizeValue | undefined;
|
|
3137
|
+
padding_x?: SizeValue | undefined;
|
|
3138
|
+
padding_y?: SizeValue | undefined;
|
|
3139
|
+
}>>;
|
|
2987
3140
|
}, "strip", z.ZodTypeAny, {
|
|
2988
3141
|
version: 1;
|
|
2989
3142
|
main: LayoutElement;
|
|
@@ -2992,6 +3145,12 @@ declare const PageSchema: z.ZodObject<{
|
|
|
2992
3145
|
width?: SizeValue | undefined;
|
|
2993
3146
|
is_sticky?: boolean | undefined;
|
|
2994
3147
|
} | undefined;
|
|
3148
|
+
style?: {
|
|
3149
|
+
background?: string | undefined;
|
|
3150
|
+
max_width?: SizeValue | undefined;
|
|
3151
|
+
padding_x?: SizeValue | undefined;
|
|
3152
|
+
padding_y?: SizeValue | undefined;
|
|
3153
|
+
} | undefined;
|
|
2995
3154
|
}, {
|
|
2996
3155
|
version: 1;
|
|
2997
3156
|
main: LayoutElement;
|
|
@@ -3000,6 +3159,12 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3000
3159
|
width?: SizeValue | undefined;
|
|
3001
3160
|
is_sticky?: boolean | undefined;
|
|
3002
3161
|
} | undefined;
|
|
3162
|
+
style?: {
|
|
3163
|
+
background?: string | undefined;
|
|
3164
|
+
max_width?: SizeValue | undefined;
|
|
3165
|
+
padding_x?: SizeValue | undefined;
|
|
3166
|
+
padding_y?: SizeValue | undefined;
|
|
3167
|
+
} | undefined;
|
|
3003
3168
|
}>;
|
|
3004
3169
|
}, "strip", z.ZodTypeAny, {
|
|
3005
3170
|
type: "platform" | "record" | "kiosk" | "public";
|
|
@@ -3029,6 +3194,12 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3029
3194
|
width?: SizeValue | undefined;
|
|
3030
3195
|
is_sticky?: boolean | undefined;
|
|
3031
3196
|
} | undefined;
|
|
3197
|
+
style?: {
|
|
3198
|
+
background?: string | undefined;
|
|
3199
|
+
max_width?: SizeValue | undefined;
|
|
3200
|
+
padding_x?: SizeValue | undefined;
|
|
3201
|
+
padding_y?: SizeValue | undefined;
|
|
3202
|
+
} | undefined;
|
|
3032
3203
|
};
|
|
3033
3204
|
entity_slug?: string | undefined;
|
|
3034
3205
|
}, {
|
|
@@ -3059,6 +3230,12 @@ declare const PageSchema: z.ZodObject<{
|
|
|
3059
3230
|
width?: SizeValue | undefined;
|
|
3060
3231
|
is_sticky?: boolean | undefined;
|
|
3061
3232
|
} | undefined;
|
|
3233
|
+
style?: {
|
|
3234
|
+
background?: string | undefined;
|
|
3235
|
+
max_width?: SizeValue | undefined;
|
|
3236
|
+
padding_x?: SizeValue | undefined;
|
|
3237
|
+
padding_y?: SizeValue | undefined;
|
|
3238
|
+
} | undefined;
|
|
3062
3239
|
};
|
|
3063
3240
|
entity_slug?: string | undefined;
|
|
3064
3241
|
}>;
|
|
@@ -3350,5 +3527,117 @@ interface UpdateAppRequest {
|
|
|
3350
3527
|
description?: string;
|
|
3351
3528
|
icon_slug?: string;
|
|
3352
3529
|
}
|
|
3530
|
+
/**
|
|
3531
|
+
* A stored DESIGN.md document — a named design reference an org authors and that
|
|
3532
|
+
* design agents read as the source of truth for a surface. `name` + `description`
|
|
3533
|
+
* are the selector ("which reference, and when to use it").
|
|
3534
|
+
*
|
|
3535
|
+
* `content` (the markdown body) is NOT returned by list/get — fetch it via
|
|
3536
|
+
* {@link DesignReferenceService.getContent} and write it via `setContent`.
|
|
3537
|
+
*/
|
|
3538
|
+
interface DesignReference extends AuditFields {
|
|
3539
|
+
id: string;
|
|
3540
|
+
org_id: string;
|
|
3541
|
+
slug: string;
|
|
3542
|
+
name: string;
|
|
3543
|
+
description: string;
|
|
3544
|
+
/** The DESIGN.md body. Only present on the dedicated content endpoint; undefined on list/get. */
|
|
3545
|
+
content?: string;
|
|
3546
|
+
}
|
|
3547
|
+
declare const DesignReferenceSchema: z.ZodObject<{
|
|
3548
|
+
created_at: z.ZodString;
|
|
3549
|
+
updated_at: z.ZodString;
|
|
3550
|
+
created_by: z.ZodObject<{
|
|
3551
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
3552
|
+
id: z.ZodString;
|
|
3553
|
+
}, "strip", z.ZodTypeAny, {
|
|
3554
|
+
type: "person" | "agent" | "api";
|
|
3555
|
+
id: string;
|
|
3556
|
+
}, {
|
|
3557
|
+
type: "person" | "agent" | "api";
|
|
3558
|
+
id: string;
|
|
3559
|
+
}>;
|
|
3560
|
+
updated_by: z.ZodObject<{
|
|
3561
|
+
type: z.ZodEnum<["person", "agent", "api"]>;
|
|
3562
|
+
id: z.ZodString;
|
|
3563
|
+
}, "strip", z.ZodTypeAny, {
|
|
3564
|
+
type: "person" | "agent" | "api";
|
|
3565
|
+
id: string;
|
|
3566
|
+
}, {
|
|
3567
|
+
type: "person" | "agent" | "api";
|
|
3568
|
+
id: string;
|
|
3569
|
+
}>;
|
|
3570
|
+
} & {
|
|
3571
|
+
id: z.ZodString;
|
|
3572
|
+
slug: z.ZodString;
|
|
3573
|
+
name: z.ZodString;
|
|
3574
|
+
description: z.ZodString;
|
|
3575
|
+
content: z.ZodOptional<z.ZodString>;
|
|
3576
|
+
}, "strip", z.ZodTypeAny, {
|
|
3577
|
+
id: string;
|
|
3578
|
+
name: string;
|
|
3579
|
+
created_at: string;
|
|
3580
|
+
updated_at: string;
|
|
3581
|
+
created_by: {
|
|
3582
|
+
type: "person" | "agent" | "api";
|
|
3583
|
+
id: string;
|
|
3584
|
+
};
|
|
3585
|
+
updated_by: {
|
|
3586
|
+
type: "person" | "agent" | "api";
|
|
3587
|
+
id: string;
|
|
3588
|
+
};
|
|
3589
|
+
description: string;
|
|
3590
|
+
slug: string;
|
|
3591
|
+
content?: string | undefined;
|
|
3592
|
+
}, {
|
|
3593
|
+
id: string;
|
|
3594
|
+
name: string;
|
|
3595
|
+
created_at: string;
|
|
3596
|
+
updated_at: string;
|
|
3597
|
+
created_by: {
|
|
3598
|
+
type: "person" | "agent" | "api";
|
|
3599
|
+
id: string;
|
|
3600
|
+
};
|
|
3601
|
+
updated_by: {
|
|
3602
|
+
type: "person" | "agent" | "api";
|
|
3603
|
+
id: string;
|
|
3604
|
+
};
|
|
3605
|
+
description: string;
|
|
3606
|
+
slug: string;
|
|
3607
|
+
content?: string | undefined;
|
|
3608
|
+
}>;
|
|
3609
|
+
/**
|
|
3610
|
+
* Options for listing design references.
|
|
3611
|
+
*/
|
|
3612
|
+
interface ListDesignReferencesOptions extends MetaListOptions {
|
|
3613
|
+
id?: string;
|
|
3614
|
+
slug?: string;
|
|
3615
|
+
name?: string;
|
|
3616
|
+
description?: string;
|
|
3617
|
+
}
|
|
3618
|
+
/**
|
|
3619
|
+
* Request to create a design reference. `content` optionally seeds the body.
|
|
3620
|
+
*/
|
|
3621
|
+
interface CreateDesignReferenceRequest {
|
|
3622
|
+
slug: string;
|
|
3623
|
+
name: string;
|
|
3624
|
+
description?: string;
|
|
3625
|
+
content?: string;
|
|
3626
|
+
}
|
|
3627
|
+
/**
|
|
3628
|
+
* Request to update a design reference's metadata. Content is edited via the
|
|
3629
|
+
* dedicated content endpoint, not here.
|
|
3630
|
+
*/
|
|
3631
|
+
interface UpdateDesignReferenceRequest {
|
|
3632
|
+
slug?: string;
|
|
3633
|
+
name?: string;
|
|
3634
|
+
description?: string;
|
|
3635
|
+
}
|
|
3636
|
+
/**
|
|
3637
|
+
* The markdown body, from GET/PUT /design-references/:id/content.
|
|
3638
|
+
*/
|
|
3639
|
+
interface DesignReferenceContent {
|
|
3640
|
+
content: string;
|
|
3641
|
+
}
|
|
3353
3642
|
|
|
3354
|
-
export { type
|
|
3643
|
+
export { type FilterGroup as $, type AuditFields as A, CurrencyAttributeMetaSchema as B, type ClientOptions as C, type CurrencySymbolSide as D, type CurrencyValue as E, type FileRef as F, DEFAULT_OPTIONS as G, DEFAULT_PAGE_SIZE as H, DONE as I, type DeployModuleRequest as J, type DesignReference as K, type ListOptions as L, type DesignReferenceContent as M, DesignReferenceSchema as N, type DesignReferenceService as O, PageIterator as P, type Done as Q, type Entity as R, EntitySchema as S, type EntityService as T, type UserRef as U, type EntityWithSchema as V, EntityWithSchemaSchema as W, type FileAttributeMeta as X, FileRefSchema as Y, type FilterElement as Z, FilterElementSchema as _, type Attribute as a, type UpdatePageRequest as a$, FilterGroupSchema as a0, type List as a1, type ListAppsOptions as a2, type ListComponentsOptions as a3, type ListDesignReferencesOptions as a4, type ListEntitiesOptions as a5, type ListFn as a6, type ListListViewsOptions as a7, type ListListsOptions as a8, type ListMenuConfigurationsOptions as a9, type PageAction as aA, PageActionSchema as aB, type PageLayout as aC, PageLayoutSchema as aD, PageSchema as aE, type PageService as aF, type PageType as aG, type PublicPageComponent as aH, type PublicPageResponse as aI, type RelationAttributeMeta as aJ, RelationAttributeMetaSchema as aK, type RequestOptions as aL, type ResolvedClientOptions as aM, type ResponseMeta as aN, ResponseMetaSchema as aO, type SortConfig as aP, SortConfigSchema as aQ, type SortDirection as aR, type Timestamps as aS, type TokenProvider as aT, type UpdateAppRequest as aU, type UpdateComponentRequest as aV, type UpdateDesignReferenceRequest as aW, type UpdateEntityRequest as aX, type UpdateListRequest as aY, type UpdateListViewRequest as aZ, type UpdateMenuConfigurationRequest as a_, type ListModulesOptions as aa, type ListPagesOptions as ab, ListSchema as ac, type ListService as ad, type ListVariablesOptions as ae, type ListView as af, ListViewSchema as ag, type ListViewService as ah, type LogicalOperator as ai, type MenuConfiguration as aj, MenuConfigurationSchema as ak, type MenuConfigurationService as al, type MenuItem as am, MenuItemSchema as an, MenuItemType as ao, MetaClient as ap, type MetaListOptions as aq, type Module as ar, ModuleSchema as as, type ModuleService as at, type ModuleStatus as au, type OnDeleteAction as av, OnDeleteActionSchema as aw, PLATFORM_ATTRIBUTE_NAMES as ax, PLATFORM_USER_ID as ay, type Page as az, type ListResult as b, type TextElement as b$, type UpdateVariableRequest as b0, UserRefSchema as b1, type UserType as b2, type Variable as b3, VariableSchema as b4, type VariableService as b5, allCurrencyCodes as b6, createIterator as b7, createListResultSchema as b8, currencyLabel as b9, type FieldElement as bA, FileAttributeMetaSchema as bB, type LayoutAlign as bC, type LayoutElement as bD, LayoutElementSchema as bE, LayoutElementType as bF, type LayoutGap as bG, type LayoutJustify as bH, type LayoutTab as bI, type NumberAttributeMeta as bJ, type ObjectAttributeMeta as bK, PAGE_BACKGROUND_TOKENS as bL, type PageBackgroundToken as bM, type PageLayoutSidePanel as bN, PageLayoutSidePanelSchema as bO, type PageStyle as bP, PageStyleSchema as bQ, type RelatedListElement as bR, type ResponsiveSizing as bS, type RowElement as bT, type SectionElement as bU, type SizeValue as bV, SizeValueSchema as bW, type SizingProps as bX, type StringAttributeMeta as bY, type StringFormat as bZ, type TabsElement as b_, currencySymbol as ba, currencySymbolSide as bb, formatAmount as bc, formatMoney as bd, isPlatformAttributeName as be, localeNumberSeparators as bf, parseAmount as bg, parseCurrencyMeta as bh, parseFileMeta as bi, parseRelationMeta as bj, platformAttributes as bk, resolveOptions as bl, type ArrayAttributeMeta as bm, type AttributeForLookup as bn, type AttributeMeta as bo, BUILT_IN_CONTROLS as bp, type BuiltInControlSlug as bq, type ColumnElement as br, type CommonProps as bs, type ComponentElement as bt, type ControlBucket as bu, type DatetimeAttributeMeta as bv, type DatetimeFormat as bw, type DividerElement as bx, type EnumAttributeMeta as by, type EnumValue as bz, ProteosClient as c, type TextVariant as c0, type UserAttributeMeta as c1, UserAttributeMetaSchema as c2, isBuiltInControl as c3, lookupCompatibleControls as c4, lookupControls as c5, lookupPrimaryControl as c6, parseUserMeta as c7, type PublicAccessOperation as d, type App as e, AppSchema as f, type AppService as g, AttributeSchema as h, type AttributeType as i, AuditFieldsSchema as j, type Column as k, ColumnSchema as l, type ComparisonOperator as m, type Component as n, ComponentSchema as o, type ComponentService as p, type CreateAppRequest as q, type CreateComponentRequest as r, type CreateDesignReferenceRequest as s, type CreateEntityRequest as t, type CreateListRequest as u, type CreateListViewRequest as v, type CreateMenuConfigurationRequest as w, type CreatePageRequest as x, type CreateVariableRequest as y, type CurrencyAttributeMeta as z };
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
30
30
|
{ slug: 'components', name: 'Components' },
|
|
31
31
|
{ slug: 'lists', name: 'Lists' },
|
|
32
32
|
{ slug: 'list-views', name: 'List Views' },
|
|
33
|
+
{ slug: 'design-references', name: 'Design References' },
|
|
33
34
|
// System (metadata-service)
|
|
34
35
|
{ slug: 'modules', name: 'Modules' },
|
|
35
36
|
{ slug: 'variables', name: 'Variables' },
|
|
@@ -39,6 +40,9 @@ export const PLATFORM_ENTITIES: readonly PlatformEntity[] = [
|
|
|
39
40
|
// Automation (function-service)
|
|
40
41
|
{ slug: 'hooks', name: 'Hooks' },
|
|
41
42
|
{ slug: 'actions', name: 'Actions' },
|
|
43
|
+
// Workflows (workflow-service)
|
|
44
|
+
{ slug: 'workflows', name: 'Workflows' },
|
|
45
|
+
{ slug: 'workflow-executions', name: 'Workflow Executions' },
|
|
42
46
|
// Knowledge (knowledge-service)
|
|
43
47
|
{ slug: 'knowledge-nodes', name: 'Knowledge Nodes' },
|
|
44
48
|
{ slug: 'knowledge-links', name: 'Knowledge Links' },
|
package/src/data/records.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
|
|
11
11
|
const RECORDS_BASE_PATH = '/data/v1/records'
|
|
12
12
|
const BATCH_RECORDS_BASE_PATH = '/data/v1/batch/records'
|
|
13
|
+
const PUBLIC_RECORDS_BASE_PATH = '/data/v1/public/orgs'
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Service for managing records (per-entity data rows) via the data-service.
|
|
@@ -63,6 +64,34 @@ export interface RecordService {
|
|
|
63
64
|
entitySlug: string,
|
|
64
65
|
transactions: BatchUpsertTransaction[],
|
|
65
66
|
): Promise<BatchUpsertRecordsResponse>
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Lists records of a public-read entity through the UNAUTHENTICATED
|
|
70
|
+
* public endpoint (no Authorization header) as an async iterator. A
|
|
71
|
+
* non-public or missing entity 404s identically.
|
|
72
|
+
*/
|
|
73
|
+
listPublic(
|
|
74
|
+
orgId: string,
|
|
75
|
+
entitySlug: string,
|
|
76
|
+
options?: ListRecordsOptions,
|
|
77
|
+
): PageIterator<RecordData, ListRecordsOptions>
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Fetches a single page of records through the unauthenticated public
|
|
81
|
+
* endpoint. Same filter grammar and pagination as `listPage`.
|
|
82
|
+
*/
|
|
83
|
+
listPublicPage(
|
|
84
|
+
orgId: string,
|
|
85
|
+
entitySlug: string,
|
|
86
|
+
options?: ListRecordsOptions,
|
|
87
|
+
): Promise<ListResult<RecordData>>
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets a single record of a public-read entity through the
|
|
91
|
+
* unauthenticated public endpoint. Knowledge-text values stay unenriched
|
|
92
|
+
* (bare refs) on this path.
|
|
93
|
+
*/
|
|
94
|
+
getPublic(orgId: string, entitySlug: string, id: string): Promise<RecordData>
|
|
66
95
|
}
|
|
67
96
|
|
|
68
97
|
/**
|
|
@@ -119,4 +148,35 @@ export class RecordServiceImpl implements RecordService {
|
|
|
119
148
|
transactions,
|
|
120
149
|
)
|
|
121
150
|
}
|
|
151
|
+
|
|
152
|
+
listPublic(
|
|
153
|
+
orgId: string,
|
|
154
|
+
entitySlug: string,
|
|
155
|
+
options: ListRecordsOptions = {},
|
|
156
|
+
): PageIterator<RecordData, ListRecordsOptions> {
|
|
157
|
+
return new PageIterator((opts) => this.listPublicPage(orgId, entitySlug, opts), options)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async listPublicPage(
|
|
161
|
+
orgId: string,
|
|
162
|
+
entitySlug: string,
|
|
163
|
+
options: ListRecordsOptions = {},
|
|
164
|
+
): Promise<ListResult<RecordData>> {
|
|
165
|
+
return this.client.requestWithQuery<ListResult<RecordData>>(
|
|
166
|
+
'GET',
|
|
167
|
+
`${PUBLIC_RECORDS_BASE_PATH}/${encodeURIComponent(orgId)}/records/${encodeURIComponent(entitySlug)}`,
|
|
168
|
+
options,
|
|
169
|
+
undefined,
|
|
170
|
+
{ skipAuth: true },
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async getPublic(orgId: string, entitySlug: string, id: string): Promise<RecordData> {
|
|
175
|
+
return this.client.request<RecordData>(
|
|
176
|
+
'GET',
|
|
177
|
+
`${PUBLIC_RECORDS_BASE_PATH}/${encodeURIComponent(orgId)}/records/${encodeURIComponent(entitySlug)}/${encodeURIComponent(id)}`,
|
|
178
|
+
undefined,
|
|
179
|
+
{ skipAuth: true },
|
|
180
|
+
)
|
|
181
|
+
}
|
|
122
182
|
}
|