bem-ai-sdk 0.27.0 → 0.28.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/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/resources/entities/entities.d.mts +10 -0
- package/resources/entities/entities.d.mts.map +1 -1
- package/resources/entities/entities.d.ts +10 -0
- package/resources/entities/entities.d.ts.map +1 -1
- package/resources/entities/entities.js.map +1 -1
- package/resources/entities/entities.mjs.map +1 -1
- package/resources/errors.d.mts +9 -0
- package/resources/errors.d.mts.map +1 -1
- package/resources/errors.d.ts +9 -0
- package/resources/errors.d.ts.map +1 -1
- package/resources/functions/functions.d.mts +338 -8
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +338 -8
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js +2 -2
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs +2 -2
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/versions.d.mts +133 -1
- package/resources/functions/versions.d.mts.map +1 -1
- package/resources/functions/versions.d.ts +133 -1
- package/resources/functions/versions.d.ts.map +1 -1
- package/resources/knowledge-graph.d.mts +18 -0
- package/resources/knowledge-graph.d.mts.map +1 -1
- package/resources/knowledge-graph.d.ts +18 -0
- package/resources/knowledge-graph.d.ts.map +1 -1
- package/resources/outputs.d.mts +80 -2
- package/resources/outputs.d.mts.map +1 -1
- package/resources/outputs.d.ts +80 -2
- package/resources/outputs.d.ts.map +1 -1
- package/resources/workflows/workflows.d.mts +8 -0
- package/resources/workflows/workflows.d.mts.map +1 -1
- package/resources/workflows/workflows.d.ts +8 -0
- package/resources/workflows/workflows.d.ts.map +1 -1
- package/resources/workflows/workflows.js.map +1 -1
- package/resources/workflows/workflows.mjs.map +1 -1
- package/src/resources/entities/entities.ts +12 -0
- package/src/resources/errors.ts +10 -0
- package/src/resources/functions/functions.ts +395 -8
- package/src/resources/functions/versions.ts +153 -1
- package/src/resources/knowledge-graph.ts +21 -0
- package/src/resources/outputs.ts +101 -1
- package/src/resources/workflows/workflows.ts +9 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -350,6 +350,12 @@ export namespace EntityRetrieveRelationsResponse {
|
|
|
350
350
|
*/
|
|
351
351
|
canonical: string;
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Hops from the queried entity. This endpoint returns direct relations, so this is
|
|
355
|
+
* 1 (a self-loop's far end is the queried entity itself, 0).
|
|
356
|
+
*/
|
|
357
|
+
depth: number;
|
|
358
|
+
|
|
353
359
|
/**
|
|
354
360
|
* Effective entity type.
|
|
355
361
|
*/
|
|
@@ -401,6 +407,12 @@ export namespace EntityRetrieveRelationsResponse {
|
|
|
401
407
|
*/
|
|
402
408
|
canonical: string;
|
|
403
409
|
|
|
410
|
+
/**
|
|
411
|
+
* Hops from the queried entity. This endpoint returns direct relations, so this is
|
|
412
|
+
* 1 (a self-loop's far end is the queried entity itself, 0).
|
|
413
|
+
*/
|
|
414
|
+
depth: number;
|
|
415
|
+
|
|
404
416
|
/**
|
|
405
417
|
* Effective entity type.
|
|
406
418
|
*/
|
package/src/resources/errors.ts
CHANGED
|
@@ -110,6 +110,16 @@ export interface ErrorEvent {
|
|
|
110
110
|
*/
|
|
111
111
|
inboundEmail?: InboundEmailEvent;
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Open, extensible error-kind label for typed transformation errors. The platform
|
|
115
|
+
* emits these as plain strings and the set grows over time, so clients must accept
|
|
116
|
+
* unknown values. For render functions the known kinds are `render_source_fetch`,
|
|
117
|
+
* `render_template_fetch`, `render_image_unresolved`, `render_validation`,
|
|
118
|
+
* `render_exception`, `render_upload`, and `render_contract`. Omitted for
|
|
119
|
+
* historical events that pre-date the kind column and for non-transform errors.
|
|
120
|
+
*/
|
|
121
|
+
kind?: string;
|
|
122
|
+
|
|
113
123
|
metadata?: ErrorEvent.Metadata;
|
|
114
124
|
|
|
115
125
|
/**
|
|
@@ -34,8 +34,8 @@ export class Functions extends APIResource {
|
|
|
34
34
|
/**
|
|
35
35
|
* **Create a function.**
|
|
36
36
|
*
|
|
37
|
-
* The function type
|
|
38
|
-
* `
|
|
37
|
+
* The function `type` determines which configuration fields are required — see the
|
|
38
|
+
* `CreateFunctionV3` discriminated union and
|
|
39
39
|
* [Function types overview](/guide/function-types/overview) for the per-type
|
|
40
40
|
* contract.
|
|
41
41
|
*
|
|
@@ -341,7 +341,8 @@ export type CreateFunction =
|
|
|
341
341
|
| CreateFunction.JoinFunction
|
|
342
342
|
| CreateFunction.PayloadShapingFunction
|
|
343
343
|
| CreateFunction.EnrichFunction
|
|
344
|
-
| CreateFunction.ParseFunction
|
|
344
|
+
| CreateFunction.ParseFunction
|
|
345
|
+
| CreateFunction.RenderFunction;
|
|
345
346
|
|
|
346
347
|
export namespace CreateFunction {
|
|
347
348
|
export interface ExtractFunction {
|
|
@@ -693,6 +694,63 @@ export namespace CreateFunction {
|
|
|
693
694
|
enableBoundingBoxes?: boolean;
|
|
694
695
|
}
|
|
695
696
|
}
|
|
697
|
+
|
|
698
|
+
export interface RenderFunction {
|
|
699
|
+
/**
|
|
700
|
+
* Name of function. Must be UNIQUE on a per-environment basis.
|
|
701
|
+
*/
|
|
702
|
+
functionName: string;
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Request-side render configuration. Carries the template document as
|
|
706
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
707
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
708
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
709
|
+
* returns the derived contract.
|
|
710
|
+
*/
|
|
711
|
+
renderConfig: RenderFunction.RenderConfig;
|
|
712
|
+
|
|
713
|
+
type: 'render';
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Display name of function. Human-readable name to help you identify the function.
|
|
717
|
+
*/
|
|
718
|
+
displayName?: string;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Array of tags to categorize and organize functions.
|
|
722
|
+
*/
|
|
723
|
+
tags?: Array<string>;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export namespace RenderFunction {
|
|
727
|
+
/**
|
|
728
|
+
* Request-side render configuration. Carries the template document as
|
|
729
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
730
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
731
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
732
|
+
* returns the derived contract.
|
|
733
|
+
*/
|
|
734
|
+
export interface RenderConfig {
|
|
735
|
+
template: RenderConfig.Template;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export namespace RenderConfig {
|
|
739
|
+
export interface Template {
|
|
740
|
+
/**
|
|
741
|
+
* Base64-encoded `.docx` bytes. In the Bem CLI, use `@path/to/file` to embed it
|
|
742
|
+
* automatically.
|
|
743
|
+
*/
|
|
744
|
+
base64: string;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Original upload filename (e.g. `contract.docx`), stored for display only. Does
|
|
748
|
+
* not affect where the template is stored.
|
|
749
|
+
*/
|
|
750
|
+
name?: string;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
696
754
|
}
|
|
697
755
|
|
|
698
756
|
/**
|
|
@@ -1051,7 +1109,8 @@ export type Function =
|
|
|
1051
1109
|
| Function.JoinFunction
|
|
1052
1110
|
| Function.PayloadShapingFunction
|
|
1053
1111
|
| Function.EnrichFunction
|
|
1054
|
-
| Function.ParseFunction
|
|
1112
|
+
| Function.ParseFunction
|
|
1113
|
+
| Function.RenderFunction;
|
|
1055
1114
|
|
|
1056
1115
|
export namespace Function {
|
|
1057
1116
|
export interface TransformFunction {
|
|
@@ -1709,6 +1768,152 @@ export namespace Function {
|
|
|
1709
1768
|
enableBoundingBoxes?: boolean;
|
|
1710
1769
|
}
|
|
1711
1770
|
}
|
|
1771
|
+
|
|
1772
|
+
export interface RenderFunction {
|
|
1773
|
+
/**
|
|
1774
|
+
* Unique identifier of function.
|
|
1775
|
+
*/
|
|
1776
|
+
functionID: string;
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* Name of function. Must be UNIQUE on a per-environment basis.
|
|
1780
|
+
*/
|
|
1781
|
+
functionName: string;
|
|
1782
|
+
|
|
1783
|
+
type: 'render';
|
|
1784
|
+
|
|
1785
|
+
/**
|
|
1786
|
+
* Version number of function.
|
|
1787
|
+
*/
|
|
1788
|
+
versionNum: number;
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* Audit trail information for the function.
|
|
1792
|
+
*/
|
|
1793
|
+
audit?: FunctionsAPI.FunctionAudit;
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* Display name of function. Human-readable name to help you identify the function.
|
|
1797
|
+
*/
|
|
1798
|
+
displayName?: string;
|
|
1799
|
+
|
|
1800
|
+
/**
|
|
1801
|
+
* Per-version configuration for a Render function.
|
|
1802
|
+
*
|
|
1803
|
+
* Render emits a `.docx` from schema-typed JSON by composing the JSON into a
|
|
1804
|
+
* `.docx` template. The template document is stored server-side; this response
|
|
1805
|
+
* exposes only the contract derived from it. Schema validation runs internally in
|
|
1806
|
+
* the ML service against the bundled core schema; no customer-supplied schema
|
|
1807
|
+
* rides this surface.
|
|
1808
|
+
*/
|
|
1809
|
+
renderConfig?: RenderFunction.RenderConfig;
|
|
1810
|
+
|
|
1811
|
+
/**
|
|
1812
|
+
* Array of tags to categorize and organize functions.
|
|
1813
|
+
*/
|
|
1814
|
+
tags?: Array<string>;
|
|
1815
|
+
|
|
1816
|
+
/**
|
|
1817
|
+
* List of workflows that use this function.
|
|
1818
|
+
*/
|
|
1819
|
+
usedInWorkflows?: Array<FunctionsAPI.WorkflowUsageInfo>;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
export namespace RenderFunction {
|
|
1823
|
+
/**
|
|
1824
|
+
* Per-version configuration for a Render function.
|
|
1825
|
+
*
|
|
1826
|
+
* Render emits a `.docx` from schema-typed JSON by composing the JSON into a
|
|
1827
|
+
* `.docx` template. The template document is stored server-side; this response
|
|
1828
|
+
* exposes only the contract derived from it. Schema validation runs internally in
|
|
1829
|
+
* the ML service against the bundled core schema; no customer-supplied schema
|
|
1830
|
+
* rides this surface.
|
|
1831
|
+
*/
|
|
1832
|
+
export interface RenderConfig {
|
|
1833
|
+
/**
|
|
1834
|
+
* The uploaded template: its filename, a short-lived presigned download URL, and
|
|
1835
|
+
* the placeholder/style contract derived from it. Absent on configs created before
|
|
1836
|
+
* template capture existed.
|
|
1837
|
+
*/
|
|
1838
|
+
template?: RenderConfig.Template;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
export namespace RenderConfig {
|
|
1842
|
+
/**
|
|
1843
|
+
* The uploaded template: its filename, a short-lived presigned download URL, and
|
|
1844
|
+
* the placeholder/style contract derived from it. Absent on configs created before
|
|
1845
|
+
* template capture existed.
|
|
1846
|
+
*/
|
|
1847
|
+
export interface Template {
|
|
1848
|
+
/**
|
|
1849
|
+
* Short-lived presigned URL to download the stored `.docx`. The private storage
|
|
1850
|
+
* location is never exposed.
|
|
1851
|
+
*/
|
|
1852
|
+
downloadURL?: string;
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Supported list kinds (`decimal`, `bullet`) the template's `numbering.xml`
|
|
1856
|
+
* defines an `abstractNum` for. Empty means the template can hold no list, so any
|
|
1857
|
+
* list primitive will fail at render.
|
|
1858
|
+
*/
|
|
1859
|
+
listKinds?: Array<'decimal' | 'bullet'>;
|
|
1860
|
+
|
|
1861
|
+
/**
|
|
1862
|
+
* Original filename of the uploaded template (e.g. `contract.docx`), echoed back
|
|
1863
|
+
* for display. Absent on templates uploaded before the filename was captured.
|
|
1864
|
+
*/
|
|
1865
|
+
name?: string;
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* The placeholder contract a Render template declares, grouped by how each
|
|
1869
|
+
* placeholder is filled. Derived from the template at create/update time by
|
|
1870
|
+
* scanning its `docxtpl` tags; not user-supplied.
|
|
1871
|
+
*
|
|
1872
|
+
* - `stringKeys`: bare string placeholders (`{{ key }}`) filled with a single
|
|
1873
|
+
* value.
|
|
1874
|
+
* - `blockKeys`: wrapped-primitive placeholders (`{{p key }}`) — bind one core
|
|
1875
|
+
* primitive (paragraph, table, image, or list). The placeholder's own paragraph
|
|
1876
|
+
* dissolves and is replaced by the rendered subdocument's blocks, rather than
|
|
1877
|
+
* substituting text inline.
|
|
1878
|
+
*/
|
|
1879
|
+
placeholders?: Template.Placeholders;
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Paragraph/character style IDs the uploaded template defines and the rendered
|
|
1883
|
+
* output can reference. Derived from the template's `styles.xml` at create/update
|
|
1884
|
+
* time.
|
|
1885
|
+
*/
|
|
1886
|
+
styleIds?: Array<string>;
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* Style IDs whose type is table — the styles a `table` primitive's required
|
|
1890
|
+
* `styleId` can name. Empty means the template defines no table style, so any
|
|
1891
|
+
* table primitive will fail at render.
|
|
1892
|
+
*/
|
|
1893
|
+
tableStyleIds?: Array<string>;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
export namespace Template {
|
|
1897
|
+
/**
|
|
1898
|
+
* The placeholder contract a Render template declares, grouped by how each
|
|
1899
|
+
* placeholder is filled. Derived from the template at create/update time by
|
|
1900
|
+
* scanning its `docxtpl` tags; not user-supplied.
|
|
1901
|
+
*
|
|
1902
|
+
* - `stringKeys`: bare string placeholders (`{{ key }}`) filled with a single
|
|
1903
|
+
* value.
|
|
1904
|
+
* - `blockKeys`: wrapped-primitive placeholders (`{{p key }}`) — bind one core
|
|
1905
|
+
* primitive (paragraph, table, image, or list). The placeholder's own paragraph
|
|
1906
|
+
* dissolves and is replaced by the rendered subdocument's blocks, rather than
|
|
1907
|
+
* substituting text inline.
|
|
1908
|
+
*/
|
|
1909
|
+
export interface Placeholders {
|
|
1910
|
+
blockKeys: Array<string>;
|
|
1911
|
+
|
|
1912
|
+
stringKeys: Array<string>;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1712
1917
|
}
|
|
1713
1918
|
|
|
1714
1919
|
export interface FunctionAudit {
|
|
@@ -1756,7 +1961,8 @@ export type FunctionType =
|
|
|
1756
1961
|
| 'analyze'
|
|
1757
1962
|
| 'payload_shaping'
|
|
1758
1963
|
| 'enrich'
|
|
1759
|
-
| 'parse'
|
|
1964
|
+
| 'parse'
|
|
1965
|
+
| 'render';
|
|
1760
1966
|
|
|
1761
1967
|
export interface ListFunctionsResponse {
|
|
1762
1968
|
functions?: Array<Function>;
|
|
@@ -1775,6 +1981,13 @@ export interface ListFunctionsResponse {
|
|
|
1775
1981
|
* output concern) and cross-document memory linking (an environment-wide concern).
|
|
1776
1982
|
*/
|
|
1777
1983
|
export interface ParseConfig {
|
|
1984
|
+
/**
|
|
1985
|
+
* Optional bucket NAME that parse-extracted entities land in when no call-level
|
|
1986
|
+
* bucket is supplied. Lower precedence than a call-level bucket, higher than the
|
|
1987
|
+
* account+environment default.
|
|
1988
|
+
*/
|
|
1989
|
+
defaultBucket?: string;
|
|
1990
|
+
|
|
1778
1991
|
/**
|
|
1779
1992
|
* When true, extract named entities (people, organizations, products, studies,
|
|
1780
1993
|
* identifiers, etc.) and the relationships between them, and dedupe by canonical
|
|
@@ -1846,7 +2059,8 @@ export type UpdateFunction =
|
|
|
1846
2059
|
| UpdateFunction.JoinFunction
|
|
1847
2060
|
| UpdateFunction.PayloadShapingFunction
|
|
1848
2061
|
| UpdateFunction.UpsertEnrichFunction
|
|
1849
|
-
| UpdateFunction.ParseFunction
|
|
2062
|
+
| UpdateFunction.ParseFunction
|
|
2063
|
+
| UpdateFunction.RenderFunction;
|
|
1850
2064
|
|
|
1851
2065
|
export namespace UpdateFunction {
|
|
1852
2066
|
export interface ExtractFunction {
|
|
@@ -2202,6 +2416,63 @@ export namespace UpdateFunction {
|
|
|
2202
2416
|
enableBoundingBoxes?: boolean;
|
|
2203
2417
|
}
|
|
2204
2418
|
}
|
|
2419
|
+
|
|
2420
|
+
export interface RenderFunction {
|
|
2421
|
+
type: 'render';
|
|
2422
|
+
|
|
2423
|
+
/**
|
|
2424
|
+
* Display name of function. Human-readable name to help you identify the function.
|
|
2425
|
+
*/
|
|
2426
|
+
displayName?: string;
|
|
2427
|
+
|
|
2428
|
+
/**
|
|
2429
|
+
* Name of function. Must be UNIQUE on a per-environment basis.
|
|
2430
|
+
*/
|
|
2431
|
+
functionName?: string;
|
|
2432
|
+
|
|
2433
|
+
/**
|
|
2434
|
+
* Request-side render configuration. Carries the template document as
|
|
2435
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
2436
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
2437
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
2438
|
+
* returns the derived contract.
|
|
2439
|
+
*/
|
|
2440
|
+
renderConfig?: RenderFunction.RenderConfig;
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* Array of tags to categorize and organize functions.
|
|
2444
|
+
*/
|
|
2445
|
+
tags?: Array<string>;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
export namespace RenderFunction {
|
|
2449
|
+
/**
|
|
2450
|
+
* Request-side render configuration. Carries the template document as
|
|
2451
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
2452
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
2453
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
2454
|
+
* returns the derived contract.
|
|
2455
|
+
*/
|
|
2456
|
+
export interface RenderConfig {
|
|
2457
|
+
template: RenderConfig.Template;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
export namespace RenderConfig {
|
|
2461
|
+
export interface Template {
|
|
2462
|
+
/**
|
|
2463
|
+
* Base64-encoded `.docx` bytes. In the Bem CLI, use `@path/to/file` to embed it
|
|
2464
|
+
* automatically.
|
|
2465
|
+
*/
|
|
2466
|
+
base64: string;
|
|
2467
|
+
|
|
2468
|
+
/**
|
|
2469
|
+
* Original upload filename (e.g. `contract.docx`), stored for display only. Does
|
|
2470
|
+
* not affect where the template is stored.
|
|
2471
|
+
*/
|
|
2472
|
+
name?: string;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2205
2476
|
}
|
|
2206
2477
|
|
|
2207
2478
|
export interface UserActionSummary {
|
|
@@ -3491,7 +3762,8 @@ export type FunctionCreateParams =
|
|
|
3491
3762
|
| FunctionCreateParams.CreateJoinFunction
|
|
3492
3763
|
| FunctionCreateParams.CreatePayloadShapingFunction
|
|
3493
3764
|
| FunctionCreateParams.CreateEnrichFunction
|
|
3494
|
-
| FunctionCreateParams.CreateParseFunction
|
|
3765
|
+
| FunctionCreateParams.CreateParseFunction
|
|
3766
|
+
| FunctionCreateParams.CreateRenderFunction;
|
|
3495
3767
|
|
|
3496
3768
|
export declare namespace FunctionCreateParams {
|
|
3497
3769
|
export interface CreateExtractFunction {
|
|
@@ -3840,6 +4112,63 @@ export declare namespace FunctionCreateParams {
|
|
|
3840
4112
|
enableBoundingBoxes?: boolean;
|
|
3841
4113
|
}
|
|
3842
4114
|
}
|
|
4115
|
+
|
|
4116
|
+
export interface CreateRenderFunction {
|
|
4117
|
+
/**
|
|
4118
|
+
* Name of function. Must be UNIQUE on a per-environment basis.
|
|
4119
|
+
*/
|
|
4120
|
+
functionName: string;
|
|
4121
|
+
|
|
4122
|
+
/**
|
|
4123
|
+
* Request-side render configuration. Carries the template document as
|
|
4124
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
4125
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
4126
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
4127
|
+
* returns the derived contract.
|
|
4128
|
+
*/
|
|
4129
|
+
renderConfig: CreateRenderFunction.RenderConfig;
|
|
4130
|
+
|
|
4131
|
+
type: 'render';
|
|
4132
|
+
|
|
4133
|
+
/**
|
|
4134
|
+
* Display name of function. Human-readable name to help you identify the function.
|
|
4135
|
+
*/
|
|
4136
|
+
displayName?: string;
|
|
4137
|
+
|
|
4138
|
+
/**
|
|
4139
|
+
* Array of tags to categorize and organize functions.
|
|
4140
|
+
*/
|
|
4141
|
+
tags?: Array<string>;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
export namespace CreateRenderFunction {
|
|
4145
|
+
/**
|
|
4146
|
+
* Request-side render configuration. Carries the template document as
|
|
4147
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
4148
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
4149
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
4150
|
+
* returns the derived contract.
|
|
4151
|
+
*/
|
|
4152
|
+
export interface RenderConfig {
|
|
4153
|
+
template: RenderConfig.Template;
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
export namespace RenderConfig {
|
|
4157
|
+
export interface Template {
|
|
4158
|
+
/**
|
|
4159
|
+
* Base64-encoded `.docx` bytes. In the Bem CLI, use `@path/to/file` to embed it
|
|
4160
|
+
* automatically.
|
|
4161
|
+
*/
|
|
4162
|
+
base64: string;
|
|
4163
|
+
|
|
4164
|
+
/**
|
|
4165
|
+
* Original upload filename (e.g. `contract.docx`), stored for display only. Does
|
|
4166
|
+
* not affect where the template is stored.
|
|
4167
|
+
*/
|
|
4168
|
+
name?: string;
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
}
|
|
3843
4172
|
}
|
|
3844
4173
|
|
|
3845
4174
|
export type FunctionUpdateParams =
|
|
@@ -3850,7 +4179,8 @@ export type FunctionUpdateParams =
|
|
|
3850
4179
|
| FunctionUpdateParams.UpsertJoinFunction
|
|
3851
4180
|
| FunctionUpdateParams.UpsertPayloadShapingFunction
|
|
3852
4181
|
| FunctionUpdateParams.UpsertEnrichFunction
|
|
3853
|
-
| FunctionUpdateParams.UpsertParseFunction
|
|
4182
|
+
| FunctionUpdateParams.UpsertParseFunction
|
|
4183
|
+
| FunctionUpdateParams.UpsertRenderFunction;
|
|
3854
4184
|
|
|
3855
4185
|
export declare namespace FunctionUpdateParams {
|
|
3856
4186
|
export interface UpsertExtractFunction {
|
|
@@ -4184,6 +4514,63 @@ export declare namespace FunctionUpdateParams {
|
|
|
4184
4514
|
enableBoundingBoxes?: boolean;
|
|
4185
4515
|
}
|
|
4186
4516
|
}
|
|
4517
|
+
|
|
4518
|
+
export interface UpsertRenderFunction {
|
|
4519
|
+
type: 'render';
|
|
4520
|
+
|
|
4521
|
+
/**
|
|
4522
|
+
* Display name of function. Human-readable name to help you identify the function.
|
|
4523
|
+
*/
|
|
4524
|
+
displayName?: string;
|
|
4525
|
+
|
|
4526
|
+
/**
|
|
4527
|
+
* Name of function. Must be UNIQUE on a per-environment basis.
|
|
4528
|
+
*/
|
|
4529
|
+
functionName?: string;
|
|
4530
|
+
|
|
4531
|
+
/**
|
|
4532
|
+
* Request-side render configuration. Carries the template document as
|
|
4533
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
4534
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
4535
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
4536
|
+
* returns the derived contract.
|
|
4537
|
+
*/
|
|
4538
|
+
renderConfig?: UpsertRenderFunction.RenderConfig;
|
|
4539
|
+
|
|
4540
|
+
/**
|
|
4541
|
+
* Array of tags to categorize and organize functions.
|
|
4542
|
+
*/
|
|
4543
|
+
tags?: Array<string>;
|
|
4544
|
+
}
|
|
4545
|
+
|
|
4546
|
+
export namespace UpsertRenderFunction {
|
|
4547
|
+
/**
|
|
4548
|
+
* Request-side render configuration. Carries the template document as
|
|
4549
|
+
* base64-encoded `.docx` bytes: the server validates them, stores the template,
|
|
4550
|
+
* and derives the placeholder/style-id contract at create/update time, so clients
|
|
4551
|
+
* never submit `placeholders` or `styleIds`. The response shape (`RenderConfig`)
|
|
4552
|
+
* returns the derived contract.
|
|
4553
|
+
*/
|
|
4554
|
+
export interface RenderConfig {
|
|
4555
|
+
template: RenderConfig.Template;
|
|
4556
|
+
}
|
|
4557
|
+
|
|
4558
|
+
export namespace RenderConfig {
|
|
4559
|
+
export interface Template {
|
|
4560
|
+
/**
|
|
4561
|
+
* Base64-encoded `.docx` bytes. In the Bem CLI, use `@path/to/file` to embed it
|
|
4562
|
+
* automatically.
|
|
4563
|
+
*/
|
|
4564
|
+
base64: string;
|
|
4565
|
+
|
|
4566
|
+
/**
|
|
4567
|
+
* Original upload filename (e.g. `contract.docx`), stored for display only. Does
|
|
4568
|
+
* not affect where the template is stored.
|
|
4569
|
+
*/
|
|
4570
|
+
name?: string;
|
|
4571
|
+
}
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4187
4574
|
}
|
|
4188
4575
|
|
|
4189
4576
|
export interface FunctionListParams extends FunctionsPageParams {
|
|
@@ -78,7 +78,8 @@ export type FunctionVersion =
|
|
|
78
78
|
| FunctionVersion.JoinFunctionVersion
|
|
79
79
|
| FunctionVersion.EnrichFunctionVersion
|
|
80
80
|
| FunctionVersion.PayloadShapingFunctionVersion
|
|
81
|
-
| FunctionVersion.ParseFunctionVersion
|
|
81
|
+
| FunctionVersion.ParseFunctionVersion
|
|
82
|
+
| FunctionVersion.RenderFunctionVersion;
|
|
82
83
|
|
|
83
84
|
export namespace FunctionVersion {
|
|
84
85
|
export interface TransformFunctionVersion {
|
|
@@ -756,6 +757,157 @@ export namespace FunctionVersion {
|
|
|
756
757
|
enableBoundingBoxes?: boolean;
|
|
757
758
|
}
|
|
758
759
|
}
|
|
760
|
+
|
|
761
|
+
export interface RenderFunctionVersion {
|
|
762
|
+
/**
|
|
763
|
+
* Unique identifier of function.
|
|
764
|
+
*/
|
|
765
|
+
functionID: string;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Name of function. Must be UNIQUE on a per-environment basis.
|
|
769
|
+
*/
|
|
770
|
+
functionName: string;
|
|
771
|
+
|
|
772
|
+
type: 'render';
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Version number of function.
|
|
776
|
+
*/
|
|
777
|
+
versionNum: number;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Audit trail information for the function version.
|
|
781
|
+
*/
|
|
782
|
+
audit?: FunctionsAPI.FunctionAudit;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* The date and time the function version was created.
|
|
786
|
+
*/
|
|
787
|
+
createdAt?: string;
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Display name of function. Human-readable name to help you identify the function.
|
|
791
|
+
*/
|
|
792
|
+
displayName?: string;
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Per-version configuration for a Render function.
|
|
796
|
+
*
|
|
797
|
+
* Render emits a `.docx` from schema-typed JSON by composing the JSON into a
|
|
798
|
+
* `.docx` template. The template document is stored server-side; this response
|
|
799
|
+
* exposes only the contract derived from it. Schema validation runs internally in
|
|
800
|
+
* the ML service against the bundled core schema; no customer-supplied schema
|
|
801
|
+
* rides this surface.
|
|
802
|
+
*/
|
|
803
|
+
renderConfig?: RenderFunctionVersion.RenderConfig;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Array of tags to categorize and organize functions.
|
|
807
|
+
*/
|
|
808
|
+
tags?: Array<string>;
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* List of workflows that use this function.
|
|
812
|
+
*/
|
|
813
|
+
usedInWorkflows?: Array<FunctionsAPI.WorkflowUsageInfo>;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export namespace RenderFunctionVersion {
|
|
817
|
+
/**
|
|
818
|
+
* Per-version configuration for a Render function.
|
|
819
|
+
*
|
|
820
|
+
* Render emits a `.docx` from schema-typed JSON by composing the JSON into a
|
|
821
|
+
* `.docx` template. The template document is stored server-side; this response
|
|
822
|
+
* exposes only the contract derived from it. Schema validation runs internally in
|
|
823
|
+
* the ML service against the bundled core schema; no customer-supplied schema
|
|
824
|
+
* rides this surface.
|
|
825
|
+
*/
|
|
826
|
+
export interface RenderConfig {
|
|
827
|
+
/**
|
|
828
|
+
* The uploaded template: its filename, a short-lived presigned download URL, and
|
|
829
|
+
* the placeholder/style contract derived from it. Absent on configs created before
|
|
830
|
+
* template capture existed.
|
|
831
|
+
*/
|
|
832
|
+
template?: RenderConfig.Template;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
export namespace RenderConfig {
|
|
836
|
+
/**
|
|
837
|
+
* The uploaded template: its filename, a short-lived presigned download URL, and
|
|
838
|
+
* the placeholder/style contract derived from it. Absent on configs created before
|
|
839
|
+
* template capture existed.
|
|
840
|
+
*/
|
|
841
|
+
export interface Template {
|
|
842
|
+
/**
|
|
843
|
+
* Short-lived presigned URL to download the stored `.docx`. The private storage
|
|
844
|
+
* location is never exposed.
|
|
845
|
+
*/
|
|
846
|
+
downloadURL?: string;
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Supported list kinds (`decimal`, `bullet`) the template's `numbering.xml`
|
|
850
|
+
* defines an `abstractNum` for. Empty means the template can hold no list, so any
|
|
851
|
+
* list primitive will fail at render.
|
|
852
|
+
*/
|
|
853
|
+
listKinds?: Array<'decimal' | 'bullet'>;
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* Original filename of the uploaded template (e.g. `contract.docx`), echoed back
|
|
857
|
+
* for display. Absent on templates uploaded before the filename was captured.
|
|
858
|
+
*/
|
|
859
|
+
name?: string;
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* The placeholder contract a Render template declares, grouped by how each
|
|
863
|
+
* placeholder is filled. Derived from the template at create/update time by
|
|
864
|
+
* scanning its `docxtpl` tags; not user-supplied.
|
|
865
|
+
*
|
|
866
|
+
* - `stringKeys`: bare string placeholders (`{{ key }}`) filled with a single
|
|
867
|
+
* value.
|
|
868
|
+
* - `blockKeys`: wrapped-primitive placeholders (`{{p key }}`) — bind one core
|
|
869
|
+
* primitive (paragraph, table, image, or list). The placeholder's own paragraph
|
|
870
|
+
* dissolves and is replaced by the rendered subdocument's blocks, rather than
|
|
871
|
+
* substituting text inline.
|
|
872
|
+
*/
|
|
873
|
+
placeholders?: Template.Placeholders;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Paragraph/character style IDs the uploaded template defines and the rendered
|
|
877
|
+
* output can reference. Derived from the template's `styles.xml` at create/update
|
|
878
|
+
* time.
|
|
879
|
+
*/
|
|
880
|
+
styleIds?: Array<string>;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Style IDs whose type is table — the styles a `table` primitive's required
|
|
884
|
+
* `styleId` can name. Empty means the template defines no table style, so any
|
|
885
|
+
* table primitive will fail at render.
|
|
886
|
+
*/
|
|
887
|
+
tableStyleIds?: Array<string>;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export namespace Template {
|
|
891
|
+
/**
|
|
892
|
+
* The placeholder contract a Render template declares, grouped by how each
|
|
893
|
+
* placeholder is filled. Derived from the template at create/update time by
|
|
894
|
+
* scanning its `docxtpl` tags; not user-supplied.
|
|
895
|
+
*
|
|
896
|
+
* - `stringKeys`: bare string placeholders (`{{ key }}`) filled with a single
|
|
897
|
+
* value.
|
|
898
|
+
* - `blockKeys`: wrapped-primitive placeholders (`{{p key }}`) — bind one core
|
|
899
|
+
* primitive (paragraph, table, image, or list). The placeholder's own paragraph
|
|
900
|
+
* dissolves and is replaced by the rendered subdocument's blocks, rather than
|
|
901
|
+
* substituting text inline.
|
|
902
|
+
*/
|
|
903
|
+
export interface Placeholders {
|
|
904
|
+
blockKeys: Array<string>;
|
|
905
|
+
|
|
906
|
+
stringKeys: Array<string>;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
759
911
|
}
|
|
760
912
|
|
|
761
913
|
export interface ListFunctionVersionsResponse {
|