@eigenpal/sdk 0.12.2 → 0.13.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.
@@ -151,6 +151,47 @@ export type ExperimentCreate = {
151
151
  sourceRef?: string;
152
152
  };
153
153
 
154
+ /**
155
+ * Exactly one of `yaml` or `historyId`, plus a bare semver `version`. YAML is capped at 1 MiB. `historyId` copies the selected snapshot into a new tagged row and does not retag the source. Set `activate: false` to create a detached candidate that does not move live HEAD; that path requires an existing current version.
156
+ */
157
+ export type CreateAutomationVersionRequest = {
158
+ /**
159
+ * Validated workflow YAML to publish as a new tagged version. Mutually exclusive with `historyId`. At most 1 MiB.
160
+ */
161
+ yaml: string;
162
+ /**
163
+ * Bare semver tag such as 1.2.0. Do not include a leading v.
164
+ */
165
+ version: string;
166
+ /**
167
+ * Whether to make the new version current immediately. Defaults to true. Set false to keep a tagged candidate off live traffic until promote. `activate: false` requires an existing current workflow version and returns 400 if HEAD is empty.
168
+ */
169
+ activate?: boolean;
170
+ } | {
171
+ /**
172
+ * Existing version id from GET /automations/{id}/versions. Creates a new tagged snapshot copied from that version; the source tag is left unchanged. Mutually exclusive with `yaml`.
173
+ */
174
+ historyId: string;
175
+ /**
176
+ * Bare semver tag such as 1.2.0. Do not include a leading v.
177
+ */
178
+ version: string;
179
+ /**
180
+ * Whether to make the new version current immediately. Defaults to true. Set false to keep a tagged candidate off live traffic until promote. `activate: false` requires an existing current workflow version and returns 400 if HEAD is empty.
181
+ */
182
+ activate?: boolean;
183
+ };
184
+
185
+ /**
186
+ * Optional JSON body. Send `{}` when no message is needed. Restore always creates a new untagged current snapshot; it does not retag the source version.
187
+ */
188
+ export type RestoreAutomationVersionRequest = {
189
+ /**
190
+ * Optional restore commit message. Defaults to a timestamped restore note.
191
+ */
192
+ message?: string;
193
+ };
194
+
154
195
  export type CreateFileMultipartRequest = {
155
196
  /**
156
197
  * Binary file field
@@ -348,6 +389,31 @@ export type RunReviewExpectedFileUpdateRequest = {
348
389
  name: string;
349
390
  };
350
391
 
392
+ export type TemplateFileReferenceRequest = {
393
+ /**
394
+ * Reusable file id produced by the direct file upload flow. It is consumed as upload transport, not exposed as template identity.
395
+ */
396
+ fileId: string;
397
+ name?: string;
398
+ description?: string;
399
+ /**
400
+ * When true, the create response includes a one-time cleanupProof for unpublished CLI staging. Normal uploads omit this.
401
+ */
402
+ staged?: boolean;
403
+ };
404
+
405
+ export type TemplateReplaceRequest = {
406
+ /**
407
+ * Reusable file id produced by the direct file upload flow. It is consumed as upload transport, not exposed as template identity.
408
+ */
409
+ fileId: string;
410
+ };
411
+
412
+ export type TemplateStagingRequest = {
413
+ proof: string;
414
+ action: 'cleanup' | 'finalize';
415
+ };
416
+
351
417
  export type AuthCheckResponse = {
352
418
  ok: true;
353
419
  tenantId: string;
@@ -375,6 +441,10 @@ export type ApiErrorEnvelope = {
375
441
  * Link to relevant docs
376
442
  */
377
443
  docsUrl?: string;
444
+ /**
445
+ * Present on 409 workflow_name_conflict responses. Id of the workflow that already owns the requested name.
446
+ */
447
+ conflictingWorkflowId?: string;
378
448
  };
379
449
 
380
450
  export type ApiErrorIssue = {
@@ -522,13 +592,13 @@ export type DatasetExample = {
522
592
  automationId: string;
523
593
  automationType: AutomationType;
524
594
  /**
525
- * Input arguments used when this example is run.
595
+ * Input arguments used when this example is run. Null when listing with `include=metadata`.
526
596
  */
527
597
  input: {
528
598
  [key: string]: unknown;
529
599
  } | null;
530
600
  /**
531
- * Expected JSON output for evaluator comparisons.
601
+ * Expected JSON output for evaluator comparisons. Null when listing with `include=metadata`.
532
602
  */
533
603
  expected: unknown | null;
534
604
  /**
@@ -980,6 +1050,47 @@ export type AbortFileUploadResponse = {
980
1050
  aborted: true;
981
1051
  };
982
1052
 
1053
+ export type ListModelsResponse = {
1054
+ data: Array<PublicModel>;
1055
+ total: number;
1056
+ };
1057
+
1058
+ export type PublicModel = {
1059
+ id: string;
1060
+ kind: 'llm' | 'ocr';
1061
+ provider: string;
1062
+ label: string;
1063
+ capabilities: Array<'text' | 'vision' | 'ocr'>;
1064
+ configured: boolean;
1065
+ available: boolean;
1066
+ /**
1067
+ * Configuration state only: `configured` means credentials are present in this environment; `unconfigured` means the catalog entry exists but credentials are missing. This list does not probe live providers, so it never reports healthy/degraded/outage. `unknown` is reserved and is not emitted by this endpoint.
1068
+ */
1069
+ health: 'configured' | 'unconfigured' | 'unknown';
1070
+ defaultFor: Array<'text' | 'vision' | 'ocr'>;
1071
+ /**
1072
+ * `local` means on-prem / no cloud provider egress (`local: true` or tesseract). `hosted` means the provider is a cloud API. Endpoints are never returned.
1073
+ */
1074
+ location: 'local' | 'hosted';
1075
+ limits?: PublicModelLimits;
1076
+ /**
1077
+ * Static Eigenpal credit rates when known without a live vendor catalog. Omitted for OpenParser OCR and for LLMs (token prices are not part of this catalog).
1078
+ */
1079
+ cost?: PublicModelCost;
1080
+ aliases: Array<string>;
1081
+ tags: Array<string>;
1082
+ };
1083
+
1084
+ export type PublicModelLimits = {
1085
+ requestTimeoutSeconds?: number;
1086
+ maxConcurrentRequests?: number;
1087
+ };
1088
+
1089
+ export type PublicModelCost = {
1090
+ creditsPerPage?: number;
1091
+ unit: 'credits';
1092
+ };
1093
+
983
1094
  export type RunsListResponse = {
984
1095
  runs: Array<RunListItem>;
985
1096
  nextCursor: string | null;
@@ -1546,6 +1657,94 @@ export type RunUsageResponse = {
1546
1657
  usage: RunUsage | null;
1547
1658
  };
1548
1659
 
1660
+ export type ListTemplatesResponse = {
1661
+ items: Array<Template>;
1662
+ total: number;
1663
+ };
1664
+
1665
+ export type Template = {
1666
+ /**
1667
+ * Stable logical template id (tmpl_…).
1668
+ */
1669
+ id: string;
1670
+ name: string;
1671
+ description?: string | null;
1672
+ filename: string;
1673
+ format: 'docx' | 'xlsx';
1674
+ mimeType: string;
1675
+ size?: number | null;
1676
+ sha256?: string | null;
1677
+ tokens: Array<{
1678
+ name: string;
1679
+ path?: Array<string>;
1680
+ kind?: 'variable' | 'loop';
1681
+ type?: 'string' | 'number' | 'date' | 'boolean' | 'array' | 'object';
1682
+ required?: boolean;
1683
+ description?: string;
1684
+ }>;
1685
+ grammar: {
1686
+ syntax: string;
1687
+ tokenDiscovery: boolean;
1688
+ capabilities: Array<string>;
1689
+ };
1690
+ currentRevision?: TemplateRevision | null;
1691
+ createdAt: string;
1692
+ updatedAt?: string | null;
1693
+ };
1694
+
1695
+ export type TemplateRevision = {
1696
+ /**
1697
+ * Immutable template revision id (tmpr_…).
1698
+ */
1699
+ id: string;
1700
+ number: number;
1701
+ sha256: string;
1702
+ createdAt: string;
1703
+ };
1704
+
1705
+ export type CreatedTemplate = {
1706
+ /**
1707
+ * Stable logical template id (tmpl_…).
1708
+ */
1709
+ id: string;
1710
+ name: string;
1711
+ description?: string | null;
1712
+ filename: string;
1713
+ format: 'docx' | 'xlsx';
1714
+ mimeType: string;
1715
+ size?: number | null;
1716
+ sha256?: string | null;
1717
+ tokens: Array<{
1718
+ name: string;
1719
+ path?: Array<string>;
1720
+ kind?: 'variable' | 'loop';
1721
+ type?: 'string' | 'number' | 'date' | 'boolean' | 'array' | 'object';
1722
+ required?: boolean;
1723
+ description?: string;
1724
+ }>;
1725
+ grammar: {
1726
+ syntax: string;
1727
+ tokenDiscovery: boolean;
1728
+ capabilities: Array<string>;
1729
+ };
1730
+ currentRevision?: TemplateRevision | null;
1731
+ createdAt: string;
1732
+ updatedAt?: string | null;
1733
+ /**
1734
+ * One-time proof to finalize or hard-clean this unpublished staged template. Returned only on staged create, never on GET or list.
1735
+ */
1736
+ cleanupProof?: string;
1737
+ };
1738
+
1739
+ export type DeleteTemplateResponse = {
1740
+ deleted: boolean;
1741
+ };
1742
+
1743
+ export type TemplateStagingResponse = {
1744
+ cleaned?: boolean;
1745
+ finalized?: boolean;
1746
+ };
1747
+
1549
1748
  export type AuthCheckData = {
1550
1749
  body?: never;
1551
1750
  path?: never;
@@ -1953,6 +2152,10 @@ export type AutomationsExamplesListData = {
1953
2152
  * Zero-based offset for paging through examples.
1954
2153
  */
1955
2154
  offset?: number;
2155
+ /**
2156
+ * Response payload scope. `metadata` returns ids, names, metadata, and expected file refs without loading input or expected JSON.
2157
+ */
2158
+ include?: 'full' | 'metadata';
1956
2159
  };
1957
2160
  url: '/v1/automations/{id}/examples';
1958
2161
  };
@@ -3594,6 +3797,188 @@ export type AutomationsVersionsListResponses = {
3594
3797
 
3595
3798
  export type AutomationsVersionsListResponse = AutomationsVersionsListResponses[keyof AutomationsVersionsListResponses];
3596
3799
 
3800
+ export type AutomationsVersionsCreateData = {
3801
+ body: CreateAutomationVersionRequest;
3802
+ path: {
3803
+ /**
3804
+ * Workflow id, agent id, or typed alias like workflows.slug / agents.slug
3805
+ */
3806
+ id: string;
3807
+ };
3808
+ query?: never;
3809
+ url: '/v1/automations/{id}/versions';
3810
+ };
3811
+
3812
+ export type AutomationsVersionsCreateErrors = {
3813
+ /**
3814
+ * Validation error. Request shape did not match the spec.
3815
+ */
3816
+ 400: ApiErrorEnvelope;
3817
+ /**
3818
+ * Missing or invalid API key
3819
+ */
3820
+ 401: ApiErrorEnvelope;
3821
+ /**
3822
+ * API key lacks required scope
3823
+ */
3824
+ 403: ApiErrorEnvelope;
3825
+ /**
3826
+ * Resource not found
3827
+ */
3828
+ 404: ApiErrorEnvelope;
3829
+ /**
3830
+ * Conflict. The resource is in a state that forbids the request.
3831
+ */
3832
+ 409: ApiErrorEnvelope;
3833
+ /**
3834
+ * Payload too large. Upload exceeded the per-request size cap.
3835
+ */
3836
+ 413: ApiErrorEnvelope;
3837
+ /**
3838
+ * Rate limit exceeded
3839
+ */
3840
+ 429: ApiErrorEnvelope;
3841
+ /**
3842
+ * Internal server error
3843
+ */
3844
+ 500: ApiErrorEnvelope;
3845
+ };
3846
+
3847
+ export type AutomationsVersionsCreateError = AutomationsVersionsCreateErrors[keyof AutomationsVersionsCreateErrors];
3848
+
3849
+ export type AutomationsVersionsCreateResponses = {
3850
+ /**
3851
+ * Created workflow version.
3852
+ */
3853
+ 201: AutomationVersion;
3854
+ };
3855
+
3856
+ export type AutomationsVersionsCreateResponse = AutomationsVersionsCreateResponses[keyof AutomationsVersionsCreateResponses];
3857
+
3858
+ export type AutomationsVersionsPromoteData = {
3859
+ body?: never;
3860
+ path: {
3861
+ /**
3862
+ * Workflow id, agent id, or typed alias like workflows.slug / agents.slug
3863
+ */
3864
+ id: string;
3865
+ /**
3866
+ * Tagged version id from GET /automations/{id}/versions. Untagged snapshots (for example after restore) and unknown ids return 404.
3867
+ */
3868
+ versionId: string;
3869
+ };
3870
+ query?: never;
3871
+ url: '/v1/automations/{id}/versions/{versionId}/promote';
3872
+ };
3873
+
3874
+ export type AutomationsVersionsPromoteErrors = {
3875
+ /**
3876
+ * Validation error. Request shape did not match the spec.
3877
+ */
3878
+ 400: ApiErrorEnvelope;
3879
+ /**
3880
+ * Missing or invalid API key
3881
+ */
3882
+ 401: ApiErrorEnvelope;
3883
+ /**
3884
+ * API key lacks required scope
3885
+ */
3886
+ 403: ApiErrorEnvelope;
3887
+ /**
3888
+ * Resource not found
3889
+ */
3890
+ 404: ApiErrorEnvelope;
3891
+ /**
3892
+ * Conflict. The resource is in a state that forbids the request.
3893
+ */
3894
+ 409: ApiErrorEnvelope;
3895
+ /**
3896
+ * Payload too large. Upload exceeded the per-request size cap.
3897
+ */
3898
+ 413: ApiErrorEnvelope;
3899
+ /**
3900
+ * Rate limit exceeded
3901
+ */
3902
+ 429: ApiErrorEnvelope;
3903
+ /**
3904
+ * Internal server error
3905
+ */
3906
+ 500: ApiErrorEnvelope;
3907
+ };
3908
+
3909
+ export type AutomationsVersionsPromoteError = AutomationsVersionsPromoteErrors[keyof AutomationsVersionsPromoteErrors];
3910
+
3911
+ export type AutomationsVersionsPromoteResponses = {
3912
+ /**
3913
+ * Existing tagged workflow version promoted.
3914
+ */
3915
+ 200: AutomationVersion;
3916
+ };
3917
+
3918
+ export type AutomationsVersionsPromoteResponse = AutomationsVersionsPromoteResponses[keyof AutomationsVersionsPromoteResponses];
3919
+
3920
+ export type AutomationsVersionsRestoreData = {
3921
+ body: RestoreAutomationVersionRequest;
3922
+ path: {
3923
+ /**
3924
+ * Workflow id, agent id, or typed alias like workflows.slug / agents.slug
3925
+ */
3926
+ id: string;
3927
+ /**
3928
+ * Version id from GET /automations/{id}/versions (a workflow history id).
3929
+ */
3930
+ versionId: string;
3931
+ };
3932
+ query?: never;
3933
+ url: '/v1/automations/{id}/versions/{versionId}/restore';
3934
+ };
3935
+
3936
+ export type AutomationsVersionsRestoreErrors = {
3937
+ /**
3938
+ * Validation error. Request shape did not match the spec.
3939
+ */
3940
+ 400: ApiErrorEnvelope;
3941
+ /**
3942
+ * Missing or invalid API key
3943
+ */
3944
+ 401: ApiErrorEnvelope;
3945
+ /**
3946
+ * API key lacks required scope
3947
+ */
3948
+ 403: ApiErrorEnvelope;
3949
+ /**
3950
+ * Resource not found
3951
+ */
3952
+ 404: ApiErrorEnvelope;
3953
+ /**
3954
+ * Conflict. The resource is in a state that forbids the request.
3955
+ */
3956
+ 409: ApiErrorEnvelope;
3957
+ /**
3958
+ * Payload too large. Upload exceeded the per-request size cap.
3959
+ */
3960
+ 413: ApiErrorEnvelope;
3961
+ /**
3962
+ * Rate limit exceeded
3963
+ */
3964
+ 429: ApiErrorEnvelope;
3965
+ /**
3966
+ * Internal server error
3967
+ */
3968
+ 500: ApiErrorEnvelope;
3969
+ };
3970
+
3971
+ export type AutomationsVersionsRestoreError = AutomationsVersionsRestoreErrors[keyof AutomationsVersionsRestoreErrors];
3972
+
3973
+ export type AutomationsVersionsRestoreResponses = {
3974
+ /**
3975
+ * New current version created from the restored snapshot.
3976
+ */
3977
+ 201: AutomationVersion;
3978
+ };
3979
+
3980
+ export type AutomationsVersionsRestoreResponse = AutomationsVersionsRestoreResponses[keyof AutomationsVersionsRestoreResponses];
3981
+
3597
3982
  export type ExperimentsResolveData = {
3598
3983
  body?: never;
3599
3984
  path: {
@@ -4005,14 +4390,68 @@ export type FilesUploadsCompleteResponses = {
4005
4390
 
4006
4391
  export type FilesUploadsCompleteResponse = FilesUploadsCompleteResponses[keyof FilesUploadsCompleteResponses];
4007
4392
 
4008
- export type RunsListData = {
4393
+ export type ModelsListData = {
4009
4394
  body?: never;
4010
4395
  path?: never;
4011
4396
  query?: {
4012
- type?: string;
4013
- source?: string;
4014
- status?: string;
4015
- trigger?: string;
4397
+ /**
4398
+ * Return only models that support this capability (`text`, `vision`, or `ocr`).
4399
+ */
4400
+ capability?: 'text' | 'vision' | 'ocr';
4401
+ };
4402
+ url: '/v1/models';
4403
+ };
4404
+
4405
+ export type ModelsListErrors = {
4406
+ /**
4407
+ * Validation error. Request shape did not match the spec.
4408
+ */
4409
+ 400: ApiErrorEnvelope;
4410
+ /**
4411
+ * Missing or invalid API key
4412
+ */
4413
+ 401: ApiErrorEnvelope;
4414
+ /**
4415
+ * API key lacks required scope
4416
+ */
4417
+ 403: ApiErrorEnvelope;
4418
+ /**
4419
+ * Resource not found
4420
+ */
4421
+ 404: ApiErrorEnvelope;
4422
+ /**
4423
+ * Payload too large. Upload exceeded the per-request size cap.
4424
+ */
4425
+ 413: ApiErrorEnvelope;
4426
+ /**
4427
+ * Rate limit exceeded
4428
+ */
4429
+ 429: ApiErrorEnvelope;
4430
+ /**
4431
+ * Internal server error
4432
+ */
4433
+ 500: ApiErrorEnvelope;
4434
+ };
4435
+
4436
+ export type ModelsListError = ModelsListErrors[keyof ModelsListErrors];
4437
+
4438
+ export type ModelsListResponses = {
4439
+ /**
4440
+ * Configured models
4441
+ */
4442
+ 200: ListModelsResponse;
4443
+ };
4444
+
4445
+ export type ModelsListResponse = ModelsListResponses[keyof ModelsListResponses];
4446
+
4447
+ export type RunsListData = {
4448
+ body?: never;
4449
+ path?: never;
4450
+ query?: {
4451
+ type?: string;
4452
+ source?: string;
4453
+ status?: string;
4454
+ trigger?: string;
4016
4455
  triggeredBy?: string;
4017
4456
  sourceRef?: string;
4018
4457
  batchId?: string;
@@ -5225,3 +5664,391 @@ export type RunsUsageGetResponses = {
5225
5664
  };
5226
5665
 
5227
5666
  export type RunsUsageGetResponse = RunsUsageGetResponses[keyof RunsUsageGetResponses];
5667
+
5668
+ export type TemplatesListData = {
5669
+ body?: never;
5670
+ path?: never;
5671
+ query?: {
5672
+ limit?: number;
5673
+ offset?: number;
5674
+ };
5675
+ url: '/v1/templates';
5676
+ };
5677
+
5678
+ export type TemplatesListErrors = {
5679
+ /**
5680
+ * Validation error. Request shape did not match the spec.
5681
+ */
5682
+ 400: ApiErrorEnvelope;
5683
+ /**
5684
+ * Missing or invalid API key
5685
+ */
5686
+ 401: ApiErrorEnvelope;
5687
+ /**
5688
+ * API key lacks required scope
5689
+ */
5690
+ 403: ApiErrorEnvelope;
5691
+ /**
5692
+ * Resource not found
5693
+ */
5694
+ 404: ApiErrorEnvelope;
5695
+ /**
5696
+ * Payload too large. Upload exceeded the per-request size cap.
5697
+ */
5698
+ 413: ApiErrorEnvelope;
5699
+ /**
5700
+ * Rate limit exceeded
5701
+ */
5702
+ 429: ApiErrorEnvelope;
5703
+ /**
5704
+ * Internal server error
5705
+ */
5706
+ 500: ApiErrorEnvelope;
5707
+ };
5708
+
5709
+ export type TemplatesListError = TemplatesListErrors[keyof TemplatesListErrors];
5710
+
5711
+ export type TemplatesListResponses = {
5712
+ /**
5713
+ * Template resources
5714
+ */
5715
+ 200: ListTemplatesResponse;
5716
+ };
5717
+
5718
+ export type TemplatesListResponse = TemplatesListResponses[keyof TemplatesListResponses];
5719
+
5720
+ export type TemplatesCreateData = {
5721
+ body: TemplateFileReferenceRequest;
5722
+ path?: never;
5723
+ query?: never;
5724
+ url: '/v1/templates';
5725
+ };
5726
+
5727
+ export type TemplatesCreateErrors = {
5728
+ /**
5729
+ * Validation error. Request shape did not match the spec.
5730
+ */
5731
+ 400: ApiErrorEnvelope;
5732
+ /**
5733
+ * Missing or invalid API key
5734
+ */
5735
+ 401: ApiErrorEnvelope;
5736
+ /**
5737
+ * API key lacks required scope
5738
+ */
5739
+ 403: ApiErrorEnvelope;
5740
+ /**
5741
+ * Resource not found
5742
+ */
5743
+ 404: ApiErrorEnvelope;
5744
+ /**
5745
+ * Payload too large. Upload exceeded the per-request size cap.
5746
+ */
5747
+ 413: ApiErrorEnvelope;
5748
+ /**
5749
+ * Validation error. Request shape did not match the spec.
5750
+ */
5751
+ 422: ApiErrorEnvelope;
5752
+ /**
5753
+ * Rate limit exceeded
5754
+ */
5755
+ 429: ApiErrorEnvelope;
5756
+ /**
5757
+ * Internal server error
5758
+ */
5759
+ 500: ApiErrorEnvelope;
5760
+ };
5761
+
5762
+ export type TemplatesCreateError = TemplatesCreateErrors[keyof TemplatesCreateErrors];
5763
+
5764
+ export type TemplatesCreateResponses = {
5765
+ /**
5766
+ * Created template
5767
+ */
5768
+ 201: CreatedTemplate;
5769
+ };
5770
+
5771
+ export type TemplatesCreateResponse = TemplatesCreateResponses[keyof TemplatesCreateResponses];
5772
+
5773
+ export type TemplatesDeleteData = {
5774
+ body?: never;
5775
+ path: {
5776
+ /**
5777
+ * Logical template id (tmpl_…).
5778
+ */
5779
+ id: string;
5780
+ };
5781
+ query?: never;
5782
+ url: '/v1/templates/{id}';
5783
+ };
5784
+
5785
+ export type TemplatesDeleteErrors = {
5786
+ /**
5787
+ * Validation error. Request shape did not match the spec.
5788
+ */
5789
+ 400: ApiErrorEnvelope;
5790
+ /**
5791
+ * Missing or invalid API key
5792
+ */
5793
+ 401: ApiErrorEnvelope;
5794
+ /**
5795
+ * API key lacks required scope
5796
+ */
5797
+ 403: ApiErrorEnvelope;
5798
+ /**
5799
+ * Resource not found
5800
+ */
5801
+ 404: ApiErrorEnvelope;
5802
+ /**
5803
+ * Payload too large. Upload exceeded the per-request size cap.
5804
+ */
5805
+ 413: ApiErrorEnvelope;
5806
+ /**
5807
+ * Rate limit exceeded
5808
+ */
5809
+ 429: ApiErrorEnvelope;
5810
+ /**
5811
+ * Internal server error
5812
+ */
5813
+ 500: ApiErrorEnvelope;
5814
+ };
5815
+
5816
+ export type TemplatesDeleteError = TemplatesDeleteErrors[keyof TemplatesDeleteErrors];
5817
+
5818
+ export type TemplatesDeleteResponses = {
5819
+ /**
5820
+ * Template deleted
5821
+ */
5822
+ 200: DeleteTemplateResponse;
5823
+ };
5824
+
5825
+ export type TemplatesDeleteResponse = TemplatesDeleteResponses[keyof TemplatesDeleteResponses];
5826
+
5827
+ export type TemplatesGetData = {
5828
+ body?: never;
5829
+ path: {
5830
+ /**
5831
+ * Logical template id (tmpl_…).
5832
+ */
5833
+ id: string;
5834
+ };
5835
+ query?: never;
5836
+ url: '/v1/templates/{id}';
5837
+ };
5838
+
5839
+ export type TemplatesGetErrors = {
5840
+ /**
5841
+ * Validation error. Request shape did not match the spec.
5842
+ */
5843
+ 400: ApiErrorEnvelope;
5844
+ /**
5845
+ * Missing or invalid API key
5846
+ */
5847
+ 401: ApiErrorEnvelope;
5848
+ /**
5849
+ * API key lacks required scope
5850
+ */
5851
+ 403: ApiErrorEnvelope;
5852
+ /**
5853
+ * Resource not found
5854
+ */
5855
+ 404: ApiErrorEnvelope;
5856
+ /**
5857
+ * Payload too large. Upload exceeded the per-request size cap.
5858
+ */
5859
+ 413: ApiErrorEnvelope;
5860
+ /**
5861
+ * Rate limit exceeded
5862
+ */
5863
+ 429: ApiErrorEnvelope;
5864
+ /**
5865
+ * Internal server error
5866
+ */
5867
+ 500: ApiErrorEnvelope;
5868
+ };
5869
+
5870
+ export type TemplatesGetError = TemplatesGetErrors[keyof TemplatesGetErrors];
5871
+
5872
+ export type TemplatesGetResponses = {
5873
+ /**
5874
+ * Template inspection
5875
+ */
5876
+ 200: Template;
5877
+ };
5878
+
5879
+ export type TemplatesGetResponse = TemplatesGetResponses[keyof TemplatesGetResponses];
5880
+
5881
+ export type TemplatesReplaceData = {
5882
+ body: TemplateReplaceRequest;
5883
+ path: {
5884
+ /**
5885
+ * Logical template id (tmpl_…).
5886
+ */
5887
+ id: string;
5888
+ };
5889
+ query?: never;
5890
+ url: '/v1/templates/{id}';
5891
+ };
5892
+
5893
+ export type TemplatesReplaceErrors = {
5894
+ /**
5895
+ * Validation error. Request shape did not match the spec.
5896
+ */
5897
+ 400: ApiErrorEnvelope;
5898
+ /**
5899
+ * Missing or invalid API key
5900
+ */
5901
+ 401: ApiErrorEnvelope;
5902
+ /**
5903
+ * API key lacks required scope
5904
+ */
5905
+ 403: ApiErrorEnvelope;
5906
+ /**
5907
+ * Resource not found
5908
+ */
5909
+ 404: ApiErrorEnvelope;
5910
+ /**
5911
+ * Payload too large. Upload exceeded the per-request size cap.
5912
+ */
5913
+ 413: ApiErrorEnvelope;
5914
+ /**
5915
+ * Validation error. Request shape did not match the spec.
5916
+ */
5917
+ 422: ApiErrorEnvelope;
5918
+ /**
5919
+ * Rate limit exceeded
5920
+ */
5921
+ 429: ApiErrorEnvelope;
5922
+ /**
5923
+ * Internal server error
5924
+ */
5925
+ 500: ApiErrorEnvelope;
5926
+ };
5927
+
5928
+ export type TemplatesReplaceError = TemplatesReplaceErrors[keyof TemplatesReplaceErrors];
5929
+
5930
+ export type TemplatesReplaceResponses = {
5931
+ /**
5932
+ * Updated template
5933
+ */
5934
+ 200: Template;
5935
+ };
5936
+
5937
+ export type TemplatesReplaceResponse = TemplatesReplaceResponses[keyof TemplatesReplaceResponses];
5938
+
5939
+ export type TemplatesContentGetData = {
5940
+ body?: never;
5941
+ path: {
5942
+ /**
5943
+ * Logical template id (tmpl_…).
5944
+ */
5945
+ id: string;
5946
+ };
5947
+ query?: {
5948
+ /**
5949
+ * Immutable revision id (tmpr_…). Omit for the current content.
5950
+ */
5951
+ revisionId?: string;
5952
+ };
5953
+ url: '/v1/templates/{id}/content';
5954
+ };
5955
+
5956
+ export type TemplatesContentGetErrors = {
5957
+ /**
5958
+ * Validation error. Request shape did not match the spec.
5959
+ */
5960
+ 400: ApiErrorEnvelope;
5961
+ /**
5962
+ * Missing or invalid API key
5963
+ */
5964
+ 401: ApiErrorEnvelope;
5965
+ /**
5966
+ * API key lacks required scope
5967
+ */
5968
+ 403: ApiErrorEnvelope;
5969
+ /**
5970
+ * Resource not found
5971
+ */
5972
+ 404: ApiErrorEnvelope;
5973
+ /**
5974
+ * Payload too large. Upload exceeded the per-request size cap.
5975
+ */
5976
+ 413: ApiErrorEnvelope;
5977
+ /**
5978
+ * Rate limit exceeded
5979
+ */
5980
+ 429: ApiErrorEnvelope;
5981
+ /**
5982
+ * Internal server error
5983
+ */
5984
+ 500: ApiErrorEnvelope;
5985
+ };
5986
+
5987
+ export type TemplatesContentGetError = TemplatesContentGetErrors[keyof TemplatesContentGetErrors];
5988
+
5989
+ export type TemplatesContentGetResponses = {
5990
+ /**
5991
+ * Template file bytes (DOCX or XLSX).
5992
+ */
5993
+ 200: Blob | File;
5994
+ };
5995
+
5996
+ export type TemplatesContentGetResponse = TemplatesContentGetResponses[keyof TemplatesContentGetResponses];
5997
+
5998
+ export type TemplatesStagingData = {
5999
+ body: TemplateStagingRequest;
6000
+ path: {
6001
+ /**
6002
+ * Logical template id (tmpl_…).
6003
+ */
6004
+ id: string;
6005
+ };
6006
+ query?: never;
6007
+ url: '/v1/templates/{id}/staging';
6008
+ };
6009
+
6010
+ export type TemplatesStagingErrors = {
6011
+ /**
6012
+ * Validation error. Request shape did not match the spec.
6013
+ */
6014
+ 400: ApiErrorEnvelope;
6015
+ /**
6016
+ * Missing or invalid API key
6017
+ */
6018
+ 401: ApiErrorEnvelope;
6019
+ /**
6020
+ * API key lacks required scope
6021
+ */
6022
+ 403: ApiErrorEnvelope;
6023
+ /**
6024
+ * Resource not found
6025
+ */
6026
+ 404: ApiErrorEnvelope;
6027
+ /**
6028
+ * Conflict. The resource is in a state that forbids the request.
6029
+ */
6030
+ 409: ApiErrorEnvelope;
6031
+ /**
6032
+ * Payload too large. Upload exceeded the per-request size cap.
6033
+ */
6034
+ 413: ApiErrorEnvelope;
6035
+ /**
6036
+ * Rate limit exceeded
6037
+ */
6038
+ 429: ApiErrorEnvelope;
6039
+ /**
6040
+ * Internal server error
6041
+ */
6042
+ 500: ApiErrorEnvelope;
6043
+ };
6044
+
6045
+ export type TemplatesStagingError = TemplatesStagingErrors[keyof TemplatesStagingErrors];
6046
+
6047
+ export type TemplatesStagingResponses = {
6048
+ /**
6049
+ * Staging action applied
6050
+ */
6051
+ 200: TemplateStagingResponse;
6052
+ };
6053
+
6054
+ export type TemplatesStagingResponse = TemplatesStagingResponses[keyof TemplatesStagingResponses];