@xemahq/artifact-store-api-client 0.1.2

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.
Files changed (153) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +62 -0
  3. package/dist/custom-fetch.d.ts +52 -0
  4. package/dist/custom-fetch.js +152 -0
  5. package/dist/endpoints/artifact-store/artifact-store.d.ts +78 -0
  6. package/dist/endpoints/artifact-store/artifact-store.js +269 -0
  7. package/dist/endpoints/artifact-types/artifact-types.d.ts +23 -0
  8. package/dist/endpoints/artifact-types/artifact-types.js +48 -0
  9. package/dist/endpoints/blob-storage/blob-storage.d.ts +23 -0
  10. package/dist/endpoints/blob-storage/blob-storage.js +46 -0
  11. package/dist/endpoints/describe-objects/describe-objects.d.ts +14 -0
  12. package/dist/endpoints/describe-objects/describe-objects.js +19 -0
  13. package/dist/endpoints/health/health.d.ts +15 -0
  14. package/dist/endpoints/health/health.js +53 -0
  15. package/dist/endpoints/mcp/mcp.d.ts +6 -0
  16. package/dist/endpoints/mcp/mcp.js +44 -0
  17. package/dist/endpoints/template-bundles/template-bundles.d.ts +28 -0
  18. package/dist/endpoints/template-bundles/template-bundles.js +119 -0
  19. package/dist/index.d.ts +5 -0
  20. package/dist/index.js +27 -0
  21. package/dist/models/addArtifactVersionDto.d.ts +13 -0
  22. package/dist/models/addArtifactVersionDto.js +9 -0
  23. package/dist/models/appendArtifactEntryDto.d.ts +20 -0
  24. package/dist/models/appendArtifactEntryDto.js +2 -0
  25. package/dist/models/appendArtifactEntryDtoMetadata.d.ts +13 -0
  26. package/dist/models/appendArtifactEntryDtoMetadata.js +9 -0
  27. package/dist/models/artifactEntryResponseDto.d.ts +14 -0
  28. package/dist/models/artifactEntryResponseDto.js +9 -0
  29. package/dist/models/artifactEntryResponseDtoDataEnvelope.d.ts +11 -0
  30. package/dist/models/artifactEntryResponseDtoDataEnvelope.js +2 -0
  31. package/dist/models/artifactLinkResponseDto.d.ts +14 -0
  32. package/dist/models/artifactLinkResponseDto.js +9 -0
  33. package/dist/models/artifactLinkResponseDtoDataEnvelope.d.ts +11 -0
  34. package/dist/models/artifactLinkResponseDtoDataEnvelope.js +2 -0
  35. package/dist/models/artifactResponseDto.d.ts +23 -0
  36. package/dist/models/artifactResponseDto.js +2 -0
  37. package/dist/models/artifactResponseDtoDataArrayEnvelope.d.ts +11 -0
  38. package/dist/models/artifactResponseDtoDataArrayEnvelope.js +2 -0
  39. package/dist/models/artifactResponseDtoDataEnvelope.d.ts +11 -0
  40. package/dist/models/artifactResponseDtoDataEnvelope.js +2 -0
  41. package/dist/models/artifactStoreControllerCleanupByPipelineRunParams.d.ts +13 -0
  42. package/dist/models/artifactStoreControllerCleanupByPipelineRunParams.js +9 -0
  43. package/dist/models/artifactStoreControllerDetachByPipelineRunParams.d.ts +13 -0
  44. package/dist/models/artifactStoreControllerDetachByPipelineRunParams.js +9 -0
  45. package/dist/models/artifactStoreControllerListArtifactsParams.d.ts +27 -0
  46. package/dist/models/artifactStoreControllerListArtifactsParams.js +2 -0
  47. package/dist/models/artifactStoreControllerListArtifactsType.d.ts +48 -0
  48. package/dist/models/artifactStoreControllerListArtifactsType.js +50 -0
  49. package/dist/models/artifactTypeBiomeSourceDto.d.ts +12 -0
  50. package/dist/models/artifactTypeBiomeSourceDto.js +2 -0
  51. package/dist/models/artifactTypeBiomeSourceDtoKind.d.ts +11 -0
  52. package/dist/models/artifactTypeBiomeSourceDtoKind.js +13 -0
  53. package/dist/models/artifactTypeOrgSourceDto.d.ts +12 -0
  54. package/dist/models/artifactTypeOrgSourceDto.js +2 -0
  55. package/dist/models/artifactTypeOrgSourceDtoKind.d.ts +11 -0
  56. package/dist/models/artifactTypeOrgSourceDtoKind.js +13 -0
  57. package/dist/models/artifactTypePlatformSourceDto.d.ts +11 -0
  58. package/dist/models/artifactTypePlatformSourceDto.js +2 -0
  59. package/dist/models/artifactTypePlatformSourceDtoKind.d.ts +11 -0
  60. package/dist/models/artifactTypePlatformSourceDtoKind.js +13 -0
  61. package/dist/models/artifactTypeResponseDto.d.ts +28 -0
  62. package/dist/models/artifactTypeResponseDto.js +2 -0
  63. package/dist/models/artifactTypeResponseDtoDataArrayEnvelope.d.ts +11 -0
  64. package/dist/models/artifactTypeResponseDtoDataArrayEnvelope.js +2 -0
  65. package/dist/models/artifactTypeResponseDtoDataEnvelope.d.ts +11 -0
  66. package/dist/models/artifactTypeResponseDtoDataEnvelope.js +2 -0
  67. package/dist/models/artifactVersionResponseDto.d.ts +37 -0
  68. package/dist/models/artifactVersionResponseDto.js +9 -0
  69. package/dist/models/artifactVersionResponseDtoDataArrayEnvelope.d.ts +11 -0
  70. package/dist/models/artifactVersionResponseDtoDataArrayEnvelope.js +2 -0
  71. package/dist/models/artifactVersionResponseDtoDataEnvelope.d.ts +11 -0
  72. package/dist/models/artifactVersionResponseDtoDataEnvelope.js +2 -0
  73. package/dist/models/artifactVersioningMode.d.ts +16 -0
  74. package/dist/models/artifactVersioningMode.js +15 -0
  75. package/dist/models/blobResponseDto.d.ts +17 -0
  76. package/dist/models/blobResponseDto.js +9 -0
  77. package/dist/models/blobResponseDtoDataEnvelope.d.ts +11 -0
  78. package/dist/models/blobResponseDtoDataEnvelope.js +2 -0
  79. package/dist/models/createArtifactDto.d.ts +14 -0
  80. package/dist/models/createArtifactDto.js +2 -0
  81. package/dist/models/createArtifactDtoType.d.ts +48 -0
  82. package/dist/models/createArtifactDtoType.js +50 -0
  83. package/dist/models/createArtifactTypeDto.d.ts +18 -0
  84. package/dist/models/createArtifactTypeDto.js +9 -0
  85. package/dist/models/createEphemeralArchiveDto.d.ts +21 -0
  86. package/dist/models/createEphemeralArchiveDto.js +2 -0
  87. package/dist/models/createEphemeralArchiveDtoMetadata.d.ts +13 -0
  88. package/dist/models/createEphemeralArchiveDtoMetadata.js +9 -0
  89. package/dist/models/describeObjectsResponseDto.d.ts +14 -0
  90. package/dist/models/describeObjectsResponseDto.js +2 -0
  91. package/dist/models/emitArtifactDto.d.ts +34 -0
  92. package/dist/models/emitArtifactDto.js +2 -0
  93. package/dist/models/emitArtifactDtoLabels.d.ts +13 -0
  94. package/dist/models/emitArtifactDtoLabels.js +9 -0
  95. package/dist/models/emitArtifactDtoPayload.d.ts +13 -0
  96. package/dist/models/emitArtifactDtoPayload.js +9 -0
  97. package/dist/models/ephemeralArchiveResponseDto.d.ts +13 -0
  98. package/dist/models/ephemeralArchiveResponseDto.js +9 -0
  99. package/dist/models/ephemeralArchiveResponseDtoDataEnvelope.d.ts +11 -0
  100. package/dist/models/ephemeralArchiveResponseDtoDataEnvelope.js +2 -0
  101. package/dist/models/errorDetailsDto.d.ts +12 -0
  102. package/dist/models/errorDetailsDto.js +2 -0
  103. package/dist/models/errorDetailsDtoDetails.d.ts +13 -0
  104. package/dist/models/errorDetailsDtoDetails.js +9 -0
  105. package/dist/models/errorPayloadDto.d.ts +13 -0
  106. package/dist/models/errorPayloadDto.js +2 -0
  107. package/dist/models/errorResponseDto.d.ts +11 -0
  108. package/dist/models/errorResponseDto.js +2 -0
  109. package/dist/models/index.d.ts +45 -0
  110. package/dist/models/index.js +62 -0
  111. package/dist/models/linkArtifactDto.d.ts +12 -0
  112. package/dist/models/linkArtifactDto.js +2 -0
  113. package/dist/models/linkArtifactDtoRefType.d.ts +14 -0
  114. package/dist/models/linkArtifactDtoRefType.js +16 -0
  115. package/dist/models/objectLifecycle.d.ts +16 -0
  116. package/dist/models/objectLifecycle.js +15 -0
  117. package/dist/models/promoteTemplateBundleDto.d.ts +15 -0
  118. package/dist/models/promoteTemplateBundleDto.js +2 -0
  119. package/dist/models/promoteTemplateBundleDtoKind.d.ts +13 -0
  120. package/dist/models/promoteTemplateBundleDtoKind.js +15 -0
  121. package/dist/models/spaceKind.d.ts +20 -0
  122. package/dist/models/spaceKind.js +19 -0
  123. package/dist/models/templateBundleDescriptorDto.d.ts +13 -0
  124. package/dist/models/templateBundleDescriptorDto.js +9 -0
  125. package/dist/models/templateBundleVersionResponseDto.d.ts +23 -0
  126. package/dist/models/templateBundleVersionResponseDto.js +2 -0
  127. package/dist/models/templateBundleVersionResponseDtoDataEnvelope.d.ts +11 -0
  128. package/dist/models/templateBundleVersionResponseDtoDataEnvelope.js +2 -0
  129. package/dist/models/templateBundleVersionResponseDtoKind.d.ts +13 -0
  130. package/dist/models/templateBundleVersionResponseDtoKind.js +15 -0
  131. package/dist/models/templateBundlesControllerDeleteByRefKind.d.ts +13 -0
  132. package/dist/models/templateBundlesControllerDeleteByRefKind.js +15 -0
  133. package/dist/models/templateBundlesControllerDeleteByRefParams.d.ts +17 -0
  134. package/dist/models/templateBundlesControllerDeleteByRefParams.js +2 -0
  135. package/dist/models/templateBundlesControllerFindByRefKind.d.ts +13 -0
  136. package/dist/models/templateBundlesControllerFindByRefKind.js +15 -0
  137. package/dist/models/templateBundlesControllerFindByRefParams.d.ts +17 -0
  138. package/dist/models/templateBundlesControllerFindByRefParams.js +2 -0
  139. package/dist/models/templateBundlesControllerPublishKind.d.ts +13 -0
  140. package/dist/models/templateBundlesControllerPublishKind.js +15 -0
  141. package/dist/models/templateBundlesControllerPublishParams.d.ts +34 -0
  142. package/dist/models/templateBundlesControllerPublishParams.js +2 -0
  143. package/dist/models/xemaObjectKind.d.ts +51 -0
  144. package/dist/models/xemaObjectKind.js +50 -0
  145. package/dist/models/xemaObjectResponseDto.d.ts +26 -0
  146. package/dist/models/xemaObjectResponseDto.js +2 -0
  147. package/dist/models/xemaObjectResponseDtoPayload.d.ts +13 -0
  148. package/dist/models/xemaObjectResponseDtoPayload.js +9 -0
  149. package/dist/models/xemaSpaceRefDto.d.ts +16 -0
  150. package/dist/models/xemaSpaceRefDto.js +2 -0
  151. package/dist/models/xemaSubjectRefDto.d.ts +11 -0
  152. package/dist/models/xemaSubjectRefDto.js +9 -0
  153. package/package.json +27 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend, and
172
+ hold each Contributor harmless for any liability incurred by, or
173
+ claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Xema
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ <!-- Generated by @xemahq/api-client-generator. Do not edit by hand. -->
2
+ <p align="center">
3
+ <svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/artifact-store-api-client">
4
+ <rect width="680" height="120" rx="14" fill="#0B1020"/>
5
+ <g transform="translate(28,34)">
6
+ <path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#14B8A6" opacity="0.18"/>
7
+ <path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#14B8A6"/>
8
+ </g>
9
+ <text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/artifact-store-api-client</text>
10
+ <text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Typed, generated HTTP client for the Artifact Store API.</text>
11
+ <text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
12
+ </svg>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://xema.dev">Website</a> &middot;
17
+ <a href="https://www.npmjs.com/package/@xemahq/artifact-store-api-client">npm</a>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fartifact-store-api-client?color=2563eb&label=npm">
22
+ <img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fartifact-store-api-client?color=10b981">
23
+ <img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fartifact-store-api-client?color=3178c6">
24
+ </p>
25
+
26
+ # @xemahq/artifact-store-api-client
27
+
28
+ > Typed, generated HTTP client for the Artifact Store API.
29
+
30
+ ## Overview
31
+
32
+ Auto-generated TypeScript client for the **Artifact Store API**. It exports typed
33
+ request functions and response models that mirror the service's OpenAPI surface,
34
+ so callers get end-to-end type safety without hand-writing HTTP calls. This
35
+ package is produced by `@xemahq/api-client-generator` and regenerated whenever
36
+ the service's API changes — do not edit it by hand.
37
+
38
+ ## When to use it
39
+
40
+ - Use it from any TypeScript service or app that calls the Artifact Store API over HTTP.
41
+ - You get compile-time types for every endpoint and payload; regenerate to pick
42
+ up API changes rather than editing the client.
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ pnpm add @xemahq/artifact-store-api-client
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ ```ts
53
+ // Every endpoint function and response model is exported from the package root.
54
+ import * as client from '@xemahq/artifact-store-api-client';
55
+ ```
56
+
57
+ Call the typed endpoint functions; request and response shapes are fully typed
58
+ from the service's OpenAPI spec.
59
+
60
+ ## License
61
+
62
+ Apache-2.0 &copy; Xema — [xema.dev](https://xema.dev)
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Configurable fetch wrapper for Orval-generated clients.
3
+ *
4
+ * Consumers must call `configureClient()` before using any endpoint function.
5
+ * The baseUrl is prepended to the relative paths generated by Orval.
6
+ *
7
+ * Features:
8
+ * - Automatic bearer-token injection via `getAuthToken` callback
9
+ * - Per-request header injection via `getHeaders` callback
10
+ * - Automatic 401 handling via `onUnauthorized` callback (single retry)
11
+ * - Exponential-backoff retry for transient failures (429, 502, 503, 504)
12
+ * - Typed `ClientError` for non-2xx responses
13
+ * - Per-call header overrides (take precedence over global headers)
14
+ *
15
+ * @example
16
+ * configureClient({
17
+ * baseUrl: 'http://governance-api:3400',
18
+ * getAuthToken: () => identityBootstrapService.getAccessToken(),
19
+ * getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
20
+ * });
21
+ */
22
+ export interface ClientConfig {
23
+ /**
24
+ * Static base URL (e.g. 'http://localhost:3140') — no trailing slash.
25
+ * Mutually exclusive with `baseUrlResolver`; exactly one MUST be set.
26
+ */
27
+ baseUrl?: string;
28
+ /**
29
+ * Per-request base-URL resolver. When set, the peer URL is resolved from
30
+ * the service registry on EVERY request (boot-order-safe). Wired by
31
+ * `configureOrvalClientResolved` from `@xemahq/platform-common`.
32
+ */
33
+ baseUrlResolver?: () => string | Promise<string>;
34
+ /** Optional async callback to get an auth token. Auto-sets Authorization header on every request. */
35
+ getAuthToken?: () => Promise<string>;
36
+ /** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
37
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
38
+ /** Optional callback invoked on 401 before a single retry (e.g. force-refresh auth token). */
39
+ onUnauthorized?: () => Promise<void>;
40
+ /** Maximum retry attempts for transient failures (default: 3). Set to 0 to disable retries. */
41
+ maxRetries?: number;
42
+ }
43
+ export declare class ClientError extends Error {
44
+ readonly status: number;
45
+ readonly url: string;
46
+ readonly body: unknown;
47
+ constructor(status: number, url: string, body: unknown);
48
+ }
49
+ export declare function configureClient(config: ClientConfig): void;
50
+ export declare function getClientConfig(): ClientConfig;
51
+ export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
52
+ export default customFetch;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ /**
3
+ * Configurable fetch wrapper for Orval-generated clients.
4
+ *
5
+ * Consumers must call `configureClient()` before using any endpoint function.
6
+ * The baseUrl is prepended to the relative paths generated by Orval.
7
+ *
8
+ * Features:
9
+ * - Automatic bearer-token injection via `getAuthToken` callback
10
+ * - Per-request header injection via `getHeaders` callback
11
+ * - Automatic 401 handling via `onUnauthorized` callback (single retry)
12
+ * - Exponential-backoff retry for transient failures (429, 502, 503, 504)
13
+ * - Typed `ClientError` for non-2xx responses
14
+ * - Per-call header overrides (take precedence over global headers)
15
+ *
16
+ * @example
17
+ * configureClient({
18
+ * baseUrl: 'http://governance-api:3400',
19
+ * getAuthToken: () => identityBootstrapService.getAccessToken(),
20
+ * getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
21
+ * });
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.customFetch = exports.ClientError = void 0;
25
+ exports.configureClient = configureClient;
26
+ exports.getClientConfig = getClientConfig;
27
+ class ClientError extends Error {
28
+ status;
29
+ url;
30
+ body;
31
+ constructor(status, url, body) {
32
+ super(`HTTP ${status} from ${url}`);
33
+ this.status = status;
34
+ this.url = url;
35
+ this.body = body;
36
+ this.name = 'ClientError';
37
+ }
38
+ }
39
+ exports.ClientError = ClientError;
40
+ let clientConfig = null;
41
+ function configureClient(config) {
42
+ clientConfig = config;
43
+ }
44
+ function getClientConfig() {
45
+ if (!clientConfig) {
46
+ throw new Error('Client not configured. Call configureClient({ baseUrl }) before using endpoint functions.');
47
+ }
48
+ return clientConfig;
49
+ }
50
+ const RETRYABLE_STATUSES = [429, 502, 503, 504];
51
+ async function buildHeaders(config, callerHeaders) {
52
+ const headers = new Headers(callerHeaders);
53
+ // Global headers from config (caller-provided headers take precedence)
54
+ if (config.getHeaders) {
55
+ const globalHeaders = await Promise.resolve(config.getHeaders());
56
+ for (const [key, value] of Object.entries(globalHeaders)) {
57
+ if (!headers.has(key)) {
58
+ headers.set(key, value);
59
+ }
60
+ }
61
+ }
62
+ // Auth token (caller or global headers take precedence)
63
+ if (config.getAuthToken && !headers.has('Authorization')) {
64
+ const token = await config.getAuthToken();
65
+ headers.set('Authorization', `Bearer ${token}`);
66
+ }
67
+ return headers;
68
+ }
69
+ const customFetch = async (url, options) => {
70
+ const config = getClientConfig();
71
+ const base = config.baseUrlResolver
72
+ ? await config.baseUrlResolver()
73
+ : config.baseUrl;
74
+ if (base === undefined) {
75
+ throw new Error('Client not configured: set baseUrl or baseUrlResolver via configureClient().');
76
+ }
77
+ const fullUrl = `${base}${url}`;
78
+ const maxRetries = config.maxRetries ?? 3;
79
+ const headers = await buildHeaders(config, options.headers);
80
+ const requestInit = { ...options, headers };
81
+ let delay = 1000;
82
+ let lastError;
83
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
84
+ try {
85
+ const response = await fetch(fullUrl, requestInit);
86
+ // 401 — invoke onUnauthorized and retry once (outside the transient retry loop)
87
+ if (response.status === 401 && config.onUnauthorized && attempt === 0) {
88
+ await config.onUnauthorized();
89
+ const refreshedHeaders = await buildHeaders(config, options.headers);
90
+ const retryResponse = await fetch(fullUrl, { ...options, headers: refreshedHeaders });
91
+ const retryBody = await parseBody(retryResponse);
92
+ if (retryResponse.status >= 400) {
93
+ throw new ClientError(retryResponse.status, fullUrl, retryBody);
94
+ }
95
+ return retryBody;
96
+ }
97
+ // Non-retryable status — return or throw
98
+ if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
99
+ const body = await parseBody(response);
100
+ if (response.status >= 400) {
101
+ throw new ClientError(response.status, fullUrl, body);
102
+ }
103
+ return body;
104
+ }
105
+ // Retryable — wait and retry
106
+ const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
107
+ const waitMs = retryAfter ?? addJitter(delay);
108
+ await sleep(waitMs);
109
+ delay = Math.min(delay * 2, 30_000);
110
+ }
111
+ catch (error) {
112
+ if (error instanceof ClientError)
113
+ throw error; // Don't retry client errors
114
+ lastError = error instanceof Error ? error : new Error(String(error));
115
+ if (attempt >= maxRetries)
116
+ throw lastError;
117
+ const waitMs = addJitter(delay);
118
+ await sleep(waitMs);
119
+ delay = Math.min(delay * 2, 30_000);
120
+ }
121
+ }
122
+ throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
123
+ };
124
+ exports.customFetch = customFetch;
125
+ async function parseBody(response) {
126
+ const contentType = response.headers.get('content-type');
127
+ if (contentType?.includes('application/json')) {
128
+ return response.json();
129
+ }
130
+ if (response.status === 204) {
131
+ return undefined;
132
+ }
133
+ return response.text();
134
+ }
135
+ function parseRetryAfter(value) {
136
+ if (!value)
137
+ return undefined;
138
+ const seconds = Number(value);
139
+ if (!isNaN(seconds) && seconds >= 0)
140
+ return seconds * 1000;
141
+ const date = new Date(value);
142
+ if (!isNaN(date.getTime()))
143
+ return Math.max(0, date.getTime() - Date.now());
144
+ return undefined;
145
+ }
146
+ function addJitter(delay) {
147
+ return delay + (Math.random() * 2 - 1) * delay * 0.25;
148
+ }
149
+ function sleep(ms) {
150
+ return new Promise(resolve => setTimeout(resolve, ms));
151
+ }
152
+ exports.default = exports.customFetch;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * Artifact Store API
5
+ * Versioned artifacts with storage pointers and cross-system links
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { AddArtifactVersionDto, AppendArtifactEntryDto, ArtifactEntryResponseDtoDataEnvelope, ArtifactLinkResponseDtoDataEnvelope, ArtifactResponseDtoDataArrayEnvelope, ArtifactResponseDtoDataEnvelope, ArtifactStoreControllerCleanupByPipelineRunParams, ArtifactStoreControllerDetachByPipelineRunParams, ArtifactStoreControllerListArtifactsParams, ArtifactVersionResponseDtoDataArrayEnvelope, ArtifactVersionResponseDtoDataEnvelope, CreateArtifactDto, CreateEphemeralArchiveDto, EmitArtifactDto, EphemeralArchiveResponseDtoDataEnvelope, LinkArtifactDto } from '../../models';
9
+ /**
10
+ * @summary List artifacts for project
11
+ */
12
+ export declare const getArtifactStoreControllerListArtifactsUrl: (params?: ArtifactStoreControllerListArtifactsParams) => string;
13
+ export declare const artifactStoreControllerListArtifacts: (params?: ArtifactStoreControllerListArtifactsParams, options?: RequestInit) => Promise<ArtifactResponseDtoDataArrayEnvelope>;
14
+ /**
15
+ * @summary Create artifact metadata
16
+ */
17
+ export declare const getArtifactStoreControllerCreateArtifactUrl: () => string;
18
+ export declare const artifactStoreControllerCreateArtifact: (createArtifactDto: CreateArtifactDto, options?: RequestInit) => Promise<ArtifactResponseDtoDataEnvelope>;
19
+ /**
20
+ * @summary Create an ephemeral archive artifact owned by a workflow run. Auto-cleans on terminal run state. Hidden from user-facing list views.
21
+ */
22
+ export declare const getArtifactStoreControllerCreateEphemeralArchiveUrl: () => string;
23
+ export declare const artifactStoreControllerCreateEphemeralArchive: (createEphemeralArchiveDto: CreateEphemeralArchiveDto, options?: RequestInit) => Promise<EphemeralArchiveResponseDtoDataEnvelope>;
24
+ /**
25
+ * @summary Append a file entry to an ephemeral archive. Accepts inline base64 (≤16 MB) or a reference to an existing Blob.
26
+ */
27
+ export declare const getArtifactStoreControllerAppendArtifactEntryUrl: (id: string) => string;
28
+ export declare const artifactStoreControllerAppendArtifactEntry: (id: string, appendArtifactEntryDto: AppendArtifactEntryDto, options?: RequestInit) => Promise<ArtifactEntryResponseDtoDataEnvelope>;
29
+ /**
30
+ * @summary Atomic create-with-version: create the artifact and store its first version inline.
31
+ */
32
+ export declare const getArtifactStoreControllerEmitArtifactUrl: () => string;
33
+ export declare const artifactStoreControllerEmitArtifact: (emitArtifactDto: EmitArtifactDto, options?: RequestInit) => Promise<ArtifactVersionResponseDtoDataEnvelope>;
34
+ /**
35
+ * @summary Add immutable artifact version
36
+ */
37
+ export declare const getArtifactStoreControllerAddVersionUrl: (id: string) => string;
38
+ export declare const artifactStoreControllerAddVersion: (id: string, addArtifactVersionDto: AddArtifactVersionDto, options?: RequestInit) => Promise<ArtifactVersionResponseDtoDataEnvelope>;
39
+ /**
40
+ * @summary List all versions for an artifact (ordered newest first)
41
+ */
42
+ export declare const getArtifactStoreControllerListVersionsUrl: (id: string) => string;
43
+ export declare const artifactStoreControllerListVersions: (id: string, options?: RequestInit) => Promise<ArtifactVersionResponseDtoDataArrayEnvelope>;
44
+ /**
45
+ * @summary Get artifact with versions and links
46
+ */
47
+ export declare const getArtifactStoreControllerGetArtifactUrl: (id: string) => string;
48
+ export declare const artifactStoreControllerGetArtifact: (id: string, options?: RequestInit) => Promise<ArtifactResponseDtoDataEnvelope>;
49
+ /**
50
+ * @summary Get artifact version by number
51
+ */
52
+ export declare const getArtifactStoreControllerGetVersionUrl: (id: string, version: number) => string;
53
+ export declare const artifactStoreControllerGetVersion: (id: string, version: number, options?: RequestInit) => Promise<ArtifactVersionResponseDtoDataEnvelope>;
54
+ /**
55
+ * @summary Resolve a version's canonical content. Inline payloads return the JSON body; external pointers return metadata so the caller can fetch via storage.
56
+ */
57
+ export declare const getArtifactStoreControllerGetVersionContentUrl: (id: string, version: number) => string;
58
+ export declare const artifactStoreControllerGetVersionContent: (id: string, version: number, options?: RequestInit) => Promise<unknown>;
59
+ /**
60
+ * @summary Link artifact to phase gate, PR, thread, or backlog item
61
+ */
62
+ export declare const getArtifactStoreControllerLinkArtifactUrl: (id: string) => string;
63
+ export declare const artifactStoreControllerLinkArtifact: (id: string, linkArtifactDto: LinkArtifactDto, options?: RequestInit) => Promise<ArtifactLinkResponseDtoDataEnvelope>;
64
+ /**
65
+ * @summary Get the structured report from the latest artifact version (v3.0.0+)
66
+ */
67
+ export declare const getArtifactStoreControllerGetLatestReportUrl: (id: string) => string;
68
+ export declare const artifactStoreControllerGetLatestReport: (id: string, options?: RequestInit) => Promise<unknown>;
69
+ /**
70
+ * @summary Delete artifacts created during a specific pipeline run (used for pipeline stop cleanup)
71
+ */
72
+ export declare const getArtifactStoreControllerCleanupByPipelineRunUrl: (params: ArtifactStoreControllerCleanupByPipelineRunParams) => string;
73
+ export declare const artifactStoreControllerCleanupByPipelineRun: (params: ArtifactStoreControllerCleanupByPipelineRunParams, options?: RequestInit) => Promise<unknown>;
74
+ /**
75
+ * @summary Detach artifacts from a pipeline run (set pipelineRunId=null). Used by undo with retainDocuments=true.
76
+ */
77
+ export declare const getArtifactStoreControllerDetachByPipelineRunUrl: (params: ArtifactStoreControllerDetachByPipelineRunParams) => string;
78
+ export declare const artifactStoreControllerDetachByPipelineRun: (params: ArtifactStoreControllerDetachByPipelineRunParams, options?: RequestInit) => Promise<unknown>;