@tsg-dsp/tsg-sdk 0.0.0-stage → 0.21.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.
Files changed (222) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +362 -2
  3. package/dist/.generated/control-plane.d.ts +7825 -0
  4. package/dist/.generated/sso-bridge.d.ts +3999 -0
  5. package/dist/.generated/wallet.d.ts +6248 -0
  6. package/dist/auth/auth.provider.d.ts +49 -0
  7. package/dist/auth/auth.provider.d.ts.map +1 -0
  8. package/dist/auth/auth.provider.js +166 -0
  9. package/dist/auth/auth.provider.js.map +1 -0
  10. package/dist/auth/auth.types.d.ts +27 -0
  11. package/dist/auth/auth.types.d.ts.map +1 -0
  12. package/dist/auth/auth.types.js +2 -0
  13. package/dist/auth/auth.types.js.map +1 -0
  14. package/dist/auth/index.d.ts +3 -0
  15. package/dist/auth/index.d.ts.map +1 -0
  16. package/dist/auth/index.js +3 -0
  17. package/dist/auth/index.js.map +1 -0
  18. package/dist/browser.d.ts +1245 -0
  19. package/dist/browser.d.ts.map +1 -0
  20. package/dist/browser.js +228 -0
  21. package/dist/browser.js.map +1 -0
  22. package/dist/catalog/catalog.sdk.d.ts +149 -0
  23. package/dist/catalog/catalog.sdk.d.ts.map +1 -0
  24. package/dist/catalog/catalog.sdk.js +155 -0
  25. package/dist/catalog/catalog.sdk.js.map +1 -0
  26. package/dist/catalog/index.d.ts +2 -0
  27. package/dist/catalog/index.d.ts.map +1 -0
  28. package/dist/catalog/index.js +2 -0
  29. package/dist/catalog/index.js.map +1 -0
  30. package/dist/client.d.ts +43 -0
  31. package/dist/client.d.ts.map +1 -0
  32. package/dist/client.js +109 -0
  33. package/dist/client.js.map +1 -0
  34. package/dist/config/index.d.ts +2 -0
  35. package/dist/config/index.d.ts.map +1 -0
  36. package/dist/config/index.js +2 -0
  37. package/dist/config/index.js.map +1 -0
  38. package/dist/config/sdk.config.d.ts +97 -0
  39. package/dist/config/sdk.config.d.ts.map +1 -0
  40. package/dist/config/sdk.config.js +2 -0
  41. package/dist/config/sdk.config.js.map +1 -0
  42. package/dist/index.d.ts +18 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +25 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/metadata/index.d.ts +2 -0
  47. package/dist/metadata/index.d.ts.map +1 -0
  48. package/dist/metadata/index.js +2 -0
  49. package/dist/metadata/index.js.map +1 -0
  50. package/dist/metadata/metadata.sdk.d.ts +114 -0
  51. package/dist/metadata/metadata.sdk.d.ts.map +1 -0
  52. package/dist/metadata/metadata.sdk.js +145 -0
  53. package/dist/metadata/metadata.sdk.js.map +1 -0
  54. package/dist/negotiations/index.d.ts +2 -0
  55. package/dist/negotiations/index.d.ts.map +1 -0
  56. package/dist/negotiations/index.js +2 -0
  57. package/dist/negotiations/index.js.map +1 -0
  58. package/dist/negotiations/negotiations.sdk.d.ts +113 -0
  59. package/dist/negotiations/negotiations.sdk.d.ts.map +1 -0
  60. package/dist/negotiations/negotiations.sdk.js +146 -0
  61. package/dist/negotiations/negotiations.sdk.js.map +1 -0
  62. package/dist/requirements/index.d.ts +2 -0
  63. package/dist/requirements/index.d.ts.map +1 -0
  64. package/dist/requirements/index.js +2 -0
  65. package/dist/requirements/index.js.map +1 -0
  66. package/dist/requirements/requirements.sdk.d.ts +52 -0
  67. package/dist/requirements/requirements.sdk.d.ts.map +1 -0
  68. package/dist/requirements/requirements.sdk.js +123 -0
  69. package/dist/requirements/requirements.sdk.js.map +1 -0
  70. package/dist/sso/index.d.ts +3 -0
  71. package/dist/sso/index.d.ts.map +1 -0
  72. package/dist/sso/index.js +3 -0
  73. package/dist/sso/index.js.map +1 -0
  74. package/dist/sso/sso-management.sdk.d.ts +96 -0
  75. package/dist/sso/sso-management.sdk.d.ts.map +1 -0
  76. package/dist/sso/sso-management.sdk.js +152 -0
  77. package/dist/sso/sso-management.sdk.js.map +1 -0
  78. package/dist/sso/sso.sdk.d.ts +75 -0
  79. package/dist/sso/sso.sdk.d.ts.map +1 -0
  80. package/dist/sso/sso.sdk.js +149 -0
  81. package/dist/sso/sso.sdk.js.map +1 -0
  82. package/dist/tenants/tenant-management.sdk.d.ts +48 -0
  83. package/dist/tenants/tenant-management.sdk.d.ts.map +1 -0
  84. package/dist/tenants/tenant-management.sdk.js +107 -0
  85. package/dist/tenants/tenant-management.sdk.js.map +1 -0
  86. package/dist/transfers/index.d.ts +2 -0
  87. package/dist/transfers/index.d.ts.map +1 -0
  88. package/dist/transfers/index.js +2 -0
  89. package/dist/transfers/index.js.map +1 -0
  90. package/dist/transfers/transfers.sdk.d.ts +174 -0
  91. package/dist/transfers/transfers.sdk.d.ts.map +1 -0
  92. package/dist/transfers/transfers.sdk.js +200 -0
  93. package/dist/transfers/transfers.sdk.js.map +1 -0
  94. package/dist/tsg-sdk.d.ts +68 -0
  95. package/dist/tsg-sdk.d.ts.map +1 -0
  96. package/dist/tsg-sdk.js +145 -0
  97. package/dist/tsg-sdk.js.map +1 -0
  98. package/dist/utils/errors.d.ts +67 -0
  99. package/dist/utils/errors.d.ts.map +1 -0
  100. package/dist/utils/errors.js +79 -0
  101. package/dist/utils/errors.js.map +1 -0
  102. package/dist/utils/index.d.ts +5 -0
  103. package/dist/utils/index.d.ts.map +1 -0
  104. package/dist/utils/index.js +5 -0
  105. package/dist/utils/index.js.map +1 -0
  106. package/dist/utils/polling.d.ts +20 -0
  107. package/dist/utils/polling.d.ts.map +1 -0
  108. package/dist/utils/polling.js +35 -0
  109. package/dist/utils/polling.js.map +1 -0
  110. package/dist/utils/reason.d.ts +16 -0
  111. package/dist/utils/reason.d.ts.map +1 -0
  112. package/dist/utils/reason.js +34 -0
  113. package/dist/utils/reason.js.map +1 -0
  114. package/dist/utils/shape-validation.d.ts +59 -0
  115. package/dist/utils/shape-validation.d.ts.map +1 -0
  116. package/dist/utils/shape-validation.js +85 -0
  117. package/dist/utils/shape-validation.js.map +1 -0
  118. package/dist/utils/validate.d.ts +47 -0
  119. package/dist/utils/validate.d.ts.map +1 -0
  120. package/dist/utils/validate.js +68 -0
  121. package/dist/utils/validate.js.map +1 -0
  122. package/dist/vendor/common-dtos/abac.policy.d.ts +69 -0
  123. package/dist/vendor/common-dtos/abac.policy.js +5 -0
  124. package/dist/vendor/common-dtos/audit.types.d.ts +74 -0
  125. package/dist/vendor/common-dtos/audit.types.js +8 -0
  126. package/dist/vendor/common-dtos/credential-requirements.d.ts +18 -0
  127. package/dist/vendor/common-dtos/credential-requirements.dto.d.ts +46 -0
  128. package/dist/vendor/common-dtos/credential-requirements.dto.js +250 -0
  129. package/dist/vendor/common-dtos/credential-requirements.js +180 -0
  130. package/dist/vendor/common-dtos/dataplane.dto.d.ts +5 -0
  131. package/dist/vendor/common-dtos/dataplane.dto.js +28 -0
  132. package/dist/vendor/common-dtos/dcp.dto.d.ts +89 -0
  133. package/dist/vendor/common-dtos/dcp.dto.js +489 -0
  134. package/dist/vendor/common-dtos/dcql.dto.d.ts +88 -0
  135. package/dist/vendor/common-dtos/dcql.dto.js +449 -0
  136. package/dist/vendor/common-dtos/did.schemas.d.ts +39 -0
  137. package/dist/vendor/common-dtos/did.schemas.js +259 -0
  138. package/dist/vendor/common-dtos/index.d.ts +19 -0
  139. package/dist/vendor/common-dtos/index.js +19 -0
  140. package/dist/vendor/common-dtos/metadata.dto.d.ts +5 -0
  141. package/dist/vendor/common-dtos/metadata.dto.js +29 -0
  142. package/dist/vendor/common-dtos/negotiations.dto.d.ts +28 -0
  143. package/dist/vendor/common-dtos/negotiations.dto.js +204 -0
  144. package/dist/vendor/common-dtos/permission-resources.d.ts +3 -0
  145. package/dist/vendor/common-dtos/permission-resources.js +18 -0
  146. package/dist/vendor/common-dtos/permissions.d.ts +242 -0
  147. package/dist/vendor/common-dtos/permissions.js +409 -0
  148. package/dist/vendor/common-dtos/presentation.request.dto.d.ts +8 -0
  149. package/dist/vendor/common-dtos/presentation.request.dto.js +54 -0
  150. package/dist/vendor/common-dtos/presentation.status.dto.d.ts +12 -0
  151. package/dist/vendor/common-dtos/presentation.status.dto.js +82 -0
  152. package/dist/vendor/common-dtos/presentationdefinition.dto.d.ts +74 -0
  153. package/dist/vendor/common-dtos/presentationdefinition.dto.js +447 -0
  154. package/dist/vendor/common-dtos/signatures.dto.d.ts +31 -0
  155. package/dist/vendor/common-dtos/signatures.dto.js +209 -0
  156. package/dist/vendor/common-dtos/transfer.dto.d.ts +16 -0
  157. package/dist/vendor/common-dtos/transfer.dto.js +101 -0
  158. package/dist/vendor/common-dtos/utils.swagger.d.ts +12 -0
  159. package/dist/vendor/common-dtos/utils.swagger.js +62 -0
  160. package/dist/vendor/control-plane-dtos/index.d.ts +4 -0
  161. package/dist/vendor/control-plane-dtos/index.js +4 -0
  162. package/dist/vendor/control-plane-dtos/registry/registry.dto.d.ts +4 -0
  163. package/dist/vendor/control-plane-dtos/registry/registry.dto.js +25 -0
  164. package/dist/vendor/control-plane-dtos/registry/registry.search.dto.d.ts +28 -0
  165. package/dist/vendor/control-plane-dtos/registry/registry.search.dto.js +126 -0
  166. package/dist/vendor/control-plane-dtos/ssi/verifiablePresentations.dto.d.ts +9 -0
  167. package/dist/vendor/control-plane-dtos/ssi/verifiablePresentations.dto.js +43 -0
  168. package/dist/vendor/control-plane-dtos/status/status.dto.d.ts +37 -0
  169. package/dist/vendor/control-plane-dtos/status/status.dto.js +172 -0
  170. package/dist/vendor/sso-bridge-dtos/clients.dto.d.ts +25 -0
  171. package/dist/vendor/sso-bridge-dtos/clients.dto.js +147 -0
  172. package/dist/vendor/sso-bridge-dtos/grants.d.ts +4 -0
  173. package/dist/vendor/sso-bridge-dtos/grants.js +7 -0
  174. package/dist/vendor/sso-bridge-dtos/index.d.ts +5 -0
  175. package/dist/vendor/sso-bridge-dtos/index.js +5 -0
  176. package/dist/vendor/sso-bridge-dtos/tenant.dto.d.ts +70 -0
  177. package/dist/vendor/sso-bridge-dtos/tenant.dto.js +1 -0
  178. package/dist/vendor/sso-bridge-dtos/users.dto.d.ts +42 -0
  179. package/dist/vendor/sso-bridge-dtos/users.dto.js +173 -0
  180. package/dist/vendor/tenant-dtos/authorization.dto.d.ts +46 -0
  181. package/dist/vendor/tenant-dtos/authorization.dto.js +5 -0
  182. package/dist/vendor/tenant-dtos/consumer.dto.d.ts +29 -0
  183. package/dist/vendor/tenant-dtos/consumer.dto.js +1 -0
  184. package/dist/vendor/tenant-dtos/fixtures.d.ts +15 -0
  185. package/dist/vendor/tenant-dtos/fixtures.js +48 -0
  186. package/dist/vendor/tenant-dtos/index.d.ts +8 -0
  187. package/dist/vendor/tenant-dtos/index.js +8 -0
  188. package/dist/vendor/tenant-dtos/management.dto.d.ts +137 -0
  189. package/dist/vendor/tenant-dtos/management.dto.js +1 -0
  190. package/dist/vendor/tenant-dtos/membership.dto.d.ts +22 -0
  191. package/dist/vendor/tenant-dtos/membership.dto.js +7 -0
  192. package/dist/vendor/tenant-dtos/principal.dto.d.ts +13 -0
  193. package/dist/vendor/tenant-dtos/principal.dto.js +6 -0
  194. package/dist/vendor/tenant-dtos/provisioning.dto.d.ts +47 -0
  195. package/dist/vendor/tenant-dtos/provisioning.dto.js +1 -0
  196. package/dist/vendor/tenant-dtos/service-binding.dto.d.ts +9 -0
  197. package/dist/vendor/tenant-dtos/service-binding.dto.js +1 -0
  198. package/dist/vendor/tenant-dtos/tenant.dto.d.ts +15 -0
  199. package/dist/vendor/tenant-dtos/tenant.dto.js +1 -0
  200. package/dist/vendor/wallet-dtos/clients.dto.d.ts +21 -0
  201. package/dist/vendor/wallet-dtos/clients.dto.js +13 -0
  202. package/dist/vendor/wallet-dtos/credentials.dto.d.ts +31 -0
  203. package/dist/vendor/wallet-dtos/credentials.dto.js +46 -0
  204. package/dist/vendor/wallet-dtos/index.d.ts +6 -0
  205. package/dist/vendor/wallet-dtos/index.js +6 -0
  206. package/dist/vendor/wallet-dtos/issuance.dto.d.ts +237 -0
  207. package/dist/vendor/wallet-dtos/issuance.dto.js +1139 -0
  208. package/dist/vendor/wallet-dtos/scopes.dto.d.ts +24 -0
  209. package/dist/vendor/wallet-dtos/scopes.dto.js +151 -0
  210. package/dist/vendor/wallet-dtos/status.dto.d.ts +35 -0
  211. package/dist/vendor/wallet-dtos/status.dto.js +169 -0
  212. package/dist/vendor/wallet-dtos/utils/schema-converter.d.ts +13 -0
  213. package/dist/vendor/wallet-dtos/utils/schema-converter.js +42 -0
  214. package/dist/wallet/index.d.ts +2 -0
  215. package/dist/wallet/index.d.ts.map +1 -0
  216. package/dist/wallet/index.js +2 -0
  217. package/dist/wallet/index.js.map +1 -0
  218. package/dist/wallet/wallet.sdk.d.ts +285 -0
  219. package/dist/wallet/wallet.sdk.d.ts.map +1 -0
  220. package/dist/wallet/wallet.sdk.js +384 -0
  221. package/dist/wallet/wallet.sdk.js.map +1 -0
  222. package/package.json +79 -3
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 reasonable and customary use in describing the
141
+ origin of the Work and 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 Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
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 2023 TNO Security Gateway / DAPS Backend
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 CHANGED
@@ -1,3 +1,363 @@
1
- # Temporary Holding Version
1
+ # @tsg-dsp/tsg-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ TypeScript SDK for interacting with TSG (TNO Security Gateway) Dataspace Protocol capabilities.
4
+
5
+ ## Installation
6
+
7
+ Install the latest released SDK from npm:
8
+
9
+ ```bash
10
+ npm install @tsg-dsp/tsg-sdk
11
+ ```
12
+
13
+ Within this monorepo, use a workspace dependency to consume the current source:
14
+
15
+ ```bash
16
+ pnpm --filter <consumer-package> add '@tsg-dsp/tsg-sdk@workspace:*'
17
+ ```
18
+
19
+ For an interactive example against the current shared services, use the
20
+ [managed SDK playground](../../sample/sdk/README.md).
21
+
22
+ ## Quick start
23
+
24
+ Use URLs, audiences, canonical tenant ID, service-local slugs and workload
25
+ credentials from your provisioned deployment. Values below illustrate the
26
+ configuration shape; they are not seeded accounts or deployment defaults.
27
+ The [module examples](samples/README.md) read these settings from environment
28
+ variables and support an offline construction check.
29
+
30
+ ```typescript
31
+ import { TsgSdk } from "@tsg-dsp/tsg-sdk";
32
+
33
+ const sdk = TsgSdk.create({
34
+ controlPlaneBaseUrl: "http://localhost:3000",
35
+ walletBaseUrl: "http://localhost:3001",
36
+ ssoBridgeBaseUrl: "http://localhost:3002",
37
+ tenantSlug: "acme", // sent as X-Tenant-Slug on control-plane / wallet calls
38
+ canonicalTenantId: "11111111-1111-4111-8111-111111111111",
39
+ controlPlaneAudience: "control-plane-api",
40
+ walletAudience: "wallet-api",
41
+ auth: {
42
+ method: "client_secret_post",
43
+ clientId: controlPlaneClientId,
44
+ clientSecret: controlPlaneClientSecret
45
+ },
46
+ walletAuth: {
47
+ method: "client_secret_post",
48
+ clientId: walletClientId,
49
+ clientSecret: walletClientSecret
50
+ }
51
+ });
52
+
53
+ // Browse catalogs
54
+ const catalog = await sdk.catalog.getOwnCatalog();
55
+ const participants = await sdk.catalog.getRegistryAddresses();
56
+
57
+ // Negotiate for a dataset
58
+ const negotiation = await sdk.negotiations.requestNegotiation(
59
+ datasetId,
60
+ participantId,
61
+ remoteAddress,
62
+ offer
63
+ );
64
+
65
+ // Wait for agreement
66
+ const finalized = await sdk.negotiations.waitForAgreement(negotiation.id);
67
+
68
+ // Request a transfer
69
+ const transfer = await sdk.transfers.requestTransfer(
70
+ agreementId,
71
+ participantId,
72
+ remoteAddress,
73
+ "https://w3id.org/dspace-sig/profile/http-pull"
74
+ );
75
+ ```
76
+
77
+ ## Managed tenants
78
+
79
+ `TenantManagementSdk` is a standalone client for the central manager. Use a
80
+ human token issued for its audience. Workload provisioning credentials cannot
81
+ administer organizations through these endpoints.
82
+
83
+ ```typescript
84
+ import { AuthProvider, TenantManagementSdk } from "@tsg-dsp/tsg-sdk";
85
+
86
+ const tenants = new TenantManagementSdk(
87
+ "https://hosted.example.com/tenant-management/api",
88
+ new AuthProvider(
89
+ { method: "access_token", accessToken: humanToken },
90
+ undefined
91
+ )
92
+ );
93
+ const accepted = await tenants.createForPlatform(
94
+ {
95
+ name: "Alice Corp",
96
+ slug: "alice-corp",
97
+ profile: "default",
98
+ owner: { kind: "new", username: "alice", email: "alice@example.com" }
99
+ },
100
+ "alice-corp-create-1"
101
+ );
102
+ const operation = await tenants.operation(accepted.operationId);
103
+ ```
104
+
105
+ The client covers capabilities, account lookup/onboarding, setup links, operation
106
+ history/retry, invitations, memberships, grants, ownership, lifecycle, audit and
107
+ workload credential rotation. Self-service `create` requires explicit deployment
108
+ policy. A setup link contains a URL only when email delivery is disabled.
109
+ The browser export also provides `TenantManagementSdk`; omit its auth argument
110
+ for same-origin cookie sessions.
111
+
112
+ For managed Wallet/Control Plane calls, set `canonicalTenantId`,
113
+ `controlPlaneAudience` and `walletAudience`. Keep the target-local tenant selector
114
+ in `tenantSlug`, or use `controlPlaneTenantSlug` and `walletTenantSlug` when
115
+ imported services have different URL names. `walletAuth` supplies a separate
116
+ Wallet token or credential whenever explicit Control Plane authentication is configured. Tokens are never inherited across services. Setting `ssoBridgeBaseUrl` allows
117
+ workload token discovery; it does not give `sdk.sso` management authority.
118
+ Use `ssoAuth` and `ssoAudience` for a separate credential authorized to administer
119
+ SSO. Tenant Management administration and consumer authorization use separate
120
+ audiences. A tenant slug selects a service-local tenant; it does not replace the
121
+ canonical tenant UUID in workload token requests. There is no implicit `default`
122
+ tenant, seeded workload client, or token audience fallback.
123
+
124
+ ## Modules
125
+
126
+ The SDK is organized into focused modules, each accessible as a property on the `TsgSdk` instance:
127
+
128
+ ### `sdk.catalog` — Catalog & Registry
129
+
130
+ Browse catalogs, discover participants, and search datasets.
131
+
132
+ | Method | Description |
133
+ | ---------------------------------------------- | ------------------------------------------ |
134
+ | `getOwnCatalog()` | Get the local participant's catalog |
135
+ | `getParticipantCatalog(participantId)` | Get a remote participant's catalog |
136
+ | `getRegistryAddresses()` | Get all known participant addresses |
137
+ | `getRegistryCatalogs()` | Get all catalogs from the registry |
138
+ | `getDidDocuments()` | Get DID documents from the registry |
139
+ | `refreshRegistry()` | Refresh the registry to discover new peers |
140
+ | `getDataplanes()` | List configured data planes |
141
+ | `getDataset(id, audience, address)` | Get a specific dataset |
142
+ | `getDatasetConformingTo(conformsTo, audience)` | Find a dataset by conformance URI |
143
+
144
+ ### `sdk.negotiations` — Contract Negotiations
145
+
146
+ Manage the full negotiation lifecycle.
147
+
148
+ | Method | Description |
149
+ | --------------------------------------------------- | ------------------------------ |
150
+ | `listNegotiations()` | List all negotiations |
151
+ | `getNegotiation(processId)` | Get negotiation details |
152
+ | `getAgreement(agreementId)` | Get an agreement |
153
+ | `getNegotiationsForDataset(datasetId)` | Get negotiations for a dataset |
154
+ | `requestNegotiation(datasetId, participantId, ...)` | Request a new negotiation |
155
+ | `terminateNegotiation(processId, code, reason)` | Terminate a negotiation |
156
+ | `waitForState(processId, targetState)` | Poll until target state |
157
+ | `waitForAgreement(processId)` | Poll until FINALIZED |
158
+ | `negotiateAndWait(datasetId, participantId, ...)` | Request + wait for agreement |
159
+
160
+ ### `sdk.transfers` — Data Transfers
161
+
162
+ Manage the full transfer lifecycle.
163
+
164
+ | Method | Description |
165
+ | ---------------------------------------------------------- | ------------------------------ |
166
+ | `listTransfers()` | List all transfers |
167
+ | `requestTransfer(agreementId, participantId, ...)` | Request a new transfer |
168
+ | `getTransfer(processId)` | Get transfer details |
169
+ | `startTransfer(processId, dataAddress?)` | Start a transfer |
170
+ | `completeTransfer(processId)` | Complete a transfer |
171
+ | `terminateTransfer(processId, code?, reason?)` | Terminate a transfer |
172
+ | `suspendTransfer(processId, reason?)` | Suspend a transfer |
173
+ | `waitForState(processId, targetState)` | Poll until target state |
174
+ | `waitForStart(processId)` / `waitForCompletion(processId)` | Poll until STARTED / COMPLETED |
175
+ | `transferAndWaitForStart(agreementId, ...)` | Request + wait for start |
176
+
177
+ ### `sdk.wallet` — Wallet & Credentials
178
+
179
+ Signing, credentials, keys, and DID management.
180
+
181
+ | Method | Description |
182
+ | -------------------------------- | ---------------------------- |
183
+ | `signJwt(request)` | Request a JWT signature |
184
+ | `validateJwt(request)` | Validate a JWT |
185
+ | `listCredentials()` | List all credentials |
186
+ | `getCredential(credentialId)` | Get a specific credential |
187
+ | `deleteCredential(credentialId)` | Delete a credential |
188
+ | `revokeCredential(credentialId)` | Revoke a credential |
189
+ | `getCredentialConfig()` | Get credential configuration |
190
+ | `listDataspaceCredentials()` | List dataspace credentials |
191
+ | `getDidDocument()` | Get the DID document |
192
+ | `getDidServices()` | Get registered DID services |
193
+ | `listKeys()` | List all keys |
194
+ | `getKey(keyId)` | Get a specific key |
195
+ | `deleteKey(keyId)` | Delete a key |
196
+ | `setDefaultKey(keyId)` | Set the default key |
197
+ | `createOffer(request)` | Create a credential offer |
198
+ | `requestOfferViaDcp(request)` | Request offer via DCP |
199
+ | `getOffer(id)` | Get a credential offer |
200
+ | `revokeOffer(id)` | Revoke a credential offer |
201
+
202
+ ### `sdk.sso` — SSO Bridge
203
+
204
+ Token management, OpenID Connect, and user/client management.
205
+
206
+ | Method | Description |
207
+ | -------------------------------------------- | ------------------------------ |
208
+ | `getAccessToken()` | Get an access token |
209
+ | `getOpenIdConfiguration()` | Get OpenID configuration |
210
+ | `getJwks()` | Get the JWKS |
211
+ | `exchangeAuthorizationCode(code, ...)` | Exchange an authorization code |
212
+ | `refreshAccessToken(refreshToken, clientId)` | Refresh an access token |
213
+ | `management.getUsers()` | List users |
214
+ | `management.createUser(user)` | Create a user |
215
+ | `management.updateUser(id, user)` | Update a user |
216
+ | `management.deleteUser(id)` | Delete a user |
217
+ | `management.getClients()` | List OAuth clients |
218
+ | `management.createClient(client)` | Create a client |
219
+ | `management.updateClient(id, client)` | Update a client |
220
+ | `management.deleteClient(id)` | Delete a client |
221
+ | `management.getPermissions()` | List permissions |
222
+
223
+ ## Authentication
224
+
225
+ The SDK supports three authentication methods:
226
+
227
+ ### Client Secret (M2M)
228
+
229
+ ```typescript
230
+ const sdk = TsgSdk.create({
231
+ controlPlaneBaseUrl: "http://localhost:3000",
232
+ ssoBridgeBaseUrl: "http://localhost:3002",
233
+ canonicalTenantId,
234
+ controlPlaneTenantSlug,
235
+ controlPlaneAudience,
236
+ auth: {
237
+ method: "client_secret_post",
238
+ clientId: controlPlaneClientId,
239
+ clientSecret: controlPlaneClientSecret
240
+ }
241
+ });
242
+ ```
243
+
244
+ ### Private Key JWT (M2M)
245
+
246
+ ```typescript
247
+ const sdk = TsgSdk.create({
248
+ controlPlaneBaseUrl: "http://localhost:3000",
249
+ ssoBridgeBaseUrl: "http://localhost:3002",
250
+ canonicalTenantId,
251
+ controlPlaneTenantSlug,
252
+ controlPlaneAudience,
253
+ auth: {
254
+ method: "private_key_jwt",
255
+ clientId: controlPlaneClientId,
256
+ privateKeyJwk: controlPlanePrivateKey
257
+ }
258
+ });
259
+ ```
260
+
261
+ ### Pre-obtained access token
262
+
263
+ Use a token issued for the receiving service and intended tenant. The SDK does
264
+ not change its claims or refresh it. Configure `walletAuth` and `ssoAuth` with
265
+ separate tokens when calling those services.
266
+
267
+ ```typescript
268
+ const sdk = TsgSdk.create({
269
+ controlPlaneBaseUrl: "http://localhost:3000",
270
+ controlPlaneTenantSlug,
271
+ auth: {
272
+ method: "access_token",
273
+ accessToken: controlPlaneToken
274
+ }
275
+ });
276
+ ```
277
+
278
+ ### Cookie sessions
279
+
280
+ Omitting auth sends no bearer token. It does not bypass service authorization or
281
+ select a tenant. In a same-origin browser session, configure the service-local
282
+ tenant slug explicitly and let the browser send its existing session cookie.
283
+ The Node.js module examples use explicit workload credentials instead.
284
+
285
+ ## Optional Modules
286
+
287
+ The `wallet` and `sso` modules are optional. If their base URLs are not provided, accessing their methods will throw a `NOT_CONFIGURED` error with a helpful message:
288
+
289
+ ```typescript
290
+ const sdk = TsgSdk.create({
291
+ controlPlaneBaseUrl: "http://localhost:3000"
292
+ });
293
+
294
+ // This will throw: "wallet module is not configured. Provide 'walletBaseUrl' in TsgSdkConfig."
295
+ await sdk.wallet.signJwt(request);
296
+ ```
297
+
298
+ ## Error Handling
299
+
300
+ All SDK errors are instances of `SdkError` with a typed `code` property:
301
+
302
+ ```typescript
303
+ import { SdkError, SdkErrorCode } from "@tsg-dsp/tsg-sdk";
304
+
305
+ try {
306
+ await sdk.catalog.getParticipantCatalog("unknown-participant");
307
+ } catch (error) {
308
+ if (error instanceof SdkError) {
309
+ switch (error.code) {
310
+ case SdkErrorCode.NOT_FOUND:
311
+ console.log("Participant not found");
312
+ break;
313
+ case SdkErrorCode.AUTH_FAILED:
314
+ console.log("Authentication failed");
315
+ break;
316
+ case SdkErrorCode.POLLING_TIMEOUT:
317
+ console.log("Operation timed out");
318
+ break;
319
+ }
320
+ }
321
+ }
322
+ ```
323
+
324
+ ## Polling
325
+
326
+ Methods that wait for state changes (`waitForAgreement`, `waitForStart`, etc.) accept polling options:
327
+
328
+ ```typescript
329
+ await sdk.negotiations.waitForAgreement("process-id", {
330
+ intervalMs: 2000, // Poll every 2 seconds (default: 1000)
331
+ maxRetries: 30 // Max attempts (default: 20)
332
+ });
333
+ ```
334
+
335
+ ## License
336
+
337
+ Apache-2.0
338
+
339
+ ### External packaging
340
+
341
+ The SDK build includes compiled private DTOs and their declarations under
342
+ `dist/vendor`, plus generated OpenAPI types. Packaging preserves decorator
343
+ metadata by copying the TypeScript compiler output. Only `common-dsp` remains a
344
+ separately published TSG dependency. The browser entry does not load the DTOs.
345
+
346
+ To check an external installation locally, build with
347
+ `pnpm --filter @tsg-dsp/tsg-sdk... -r build`, pack with
348
+ `pnpm --filter @tsg-dsp/tsg-sdk pack`, install the tarball outside the workspace,
349
+ and compile a TypeScript consumer using both the main and browser entries.
350
+
351
+ ### Renewable HTTP data access
352
+
353
+ Use `transfers.dataAccess(transferId)` before sending an HTTP data request. The
354
+ control plane coordinates refresh-token rotation across clients and persists the
355
+ new credentials. The returned object contains `endpoint` and `headers`.
356
+
357
+ ```ts
358
+ const access = await sdk.transfers.dataAccess(transferId);
359
+ const response = await fetch(access.endpoint, { headers: access.headers });
360
+ ```
361
+
362
+ After a 401, request `{ forceRefresh: true }` and decide whether to repeat the
363
+ request. The SDK never retries data requests automatically.