@turnkey/http 2.0.0 → 2.2.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 (55) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/__generated__/services/coordinator/public/v1/public_api.client.d.ts +46 -1
  3. package/dist/__generated__/services/coordinator/public/v1/public_api.client.d.ts.map +1 -1
  4. package/dist/__generated__/services/coordinator/public/v1/public_api.client.js +76 -1
  5. package/dist/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -1
  6. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts +722 -2061
  7. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts.map +1 -1
  8. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js +76 -4
  9. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -1
  10. package/dist/__generated__/services/coordinator/public/v1/public_api.swagger.json +343 -197
  11. package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts +164 -74
  12. package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts.map +1 -1
  13. package/dist/esm/__generated__/barrel.js +4 -0
  14. package/dist/esm/__generated__/barrel.js.map +1 -0
  15. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.client.js +1212 -0
  16. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -0
  17. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js +1052 -0
  18. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -0
  19. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.swagger.json +5941 -0
  20. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js +6 -0
  21. package/dist/esm/__generated__/services/coordinator/public/v1/public_api.types.js.map +1 -0
  22. package/dist/esm/async.js +158 -0
  23. package/dist/esm/async.js.map +1 -0
  24. package/dist/esm/base.js +157 -0
  25. package/dist/esm/base.js.map +1 -0
  26. package/dist/esm/config.js +41 -0
  27. package/dist/esm/config.js.map +1 -0
  28. package/dist/esm/encoding.js +15 -0
  29. package/dist/esm/encoding.js.map +1 -0
  30. package/dist/esm/index.js +15 -0
  31. package/dist/esm/index.js.map +1 -0
  32. package/dist/esm/shared.js +15 -0
  33. package/dist/esm/shared.js.map +1 -0
  34. package/dist/esm/universal.js +10 -0
  35. package/dist/esm/universal.js.map +1 -0
  36. package/dist/esm/webauthn-json/api.js +24 -0
  37. package/dist/esm/webauthn-json/api.js.map +1 -0
  38. package/dist/esm/webauthn-json/base64url.js +32 -0
  39. package/dist/esm/webauthn-json/base64url.js.map +1 -0
  40. package/dist/esm/webauthn-json/convert.js +62 -0
  41. package/dist/esm/webauthn-json/convert.js.map +1 -0
  42. package/dist/esm/webauthn-json/index.js +13 -0
  43. package/dist/esm/webauthn-json/index.js.map +1 -0
  44. package/dist/esm/webauthn-json/json.js +2 -0
  45. package/dist/esm/webauthn-json/json.js.map +1 -0
  46. package/dist/esm/webauthn-json/schema-format.js +2 -0
  47. package/dist/esm/webauthn-json/schema-format.js.map +1 -0
  48. package/dist/esm/webauthn-json/schema.js +83 -0
  49. package/dist/esm/webauthn-json/schema.js.map +1 -0
  50. package/dist/esm/webauthn.js +90 -0
  51. package/dist/esm/webauthn.js.map +1 -0
  52. package/dist/webauthn.d.ts +1 -1
  53. package/dist/webauthn.d.ts.map +1 -1
  54. package/dist/webauthn.js.map +1 -1
  55. package/package.json +12 -2
@@ -0,0 +1,1212 @@
1
+ /* @generated by `@turnkey/fetchers`. DO NOT EDIT BY HAND */
2
+ import { fetch, TurnkeyRequestError, } from "../../../../../base";
3
+ export class TurnkeyClient {
4
+ constructor(config, stamper) {
5
+ /**
6
+ * Get details about an Activity
7
+ *
8
+ * Sign the provided `TGetActivityBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_activity).
9
+ *
10
+ * See also {@link stampGetActivity}.
11
+ */
12
+ this.getActivity = async (input) => {
13
+ return this.request("/public/v1/query/get_activity", input);
14
+ };
15
+ /**
16
+ * Produce a `SignedRequest` from `TGetActivityBody` by using the client's `stamp` function.
17
+ *
18
+ * See also {@link GetActivity}.
19
+ */
20
+ this.stampGetActivity = async (input) => {
21
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_activity";
22
+ const body = JSON.stringify(input);
23
+ const stamp = await this.stamper.stamp(body);
24
+ return {
25
+ body: body,
26
+ stamp: stamp,
27
+ url: fullUrl,
28
+ };
29
+ };
30
+ /**
31
+ * Get details about an authenticator
32
+ *
33
+ * Sign the provided `TGetAuthenticatorBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_authenticator).
34
+ *
35
+ * See also {@link stampGetAuthenticator}.
36
+ */
37
+ this.getAuthenticator = async (input) => {
38
+ return this.request("/public/v1/query/get_authenticator", input);
39
+ };
40
+ /**
41
+ * Produce a `SignedRequest` from `TGetAuthenticatorBody` by using the client's `stamp` function.
42
+ *
43
+ * See also {@link GetAuthenticator}.
44
+ */
45
+ this.stampGetAuthenticator = async (input) => {
46
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_authenticator";
47
+ const body = JSON.stringify(input);
48
+ const stamp = await this.stamper.stamp(body);
49
+ return {
50
+ body: body,
51
+ stamp: stamp,
52
+ url: fullUrl,
53
+ };
54
+ };
55
+ /**
56
+ * Get details about authenticators for a user
57
+ *
58
+ * Sign the provided `TGetAuthenticatorsBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_authenticators).
59
+ *
60
+ * See also {@link stampGetAuthenticators}.
61
+ */
62
+ this.getAuthenticators = async (input) => {
63
+ return this.request("/public/v1/query/get_authenticators", input);
64
+ };
65
+ /**
66
+ * Produce a `SignedRequest` from `TGetAuthenticatorsBody` by using the client's `stamp` function.
67
+ *
68
+ * See also {@link GetAuthenticators}.
69
+ */
70
+ this.stampGetAuthenticators = async (input) => {
71
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_authenticators";
72
+ const body = JSON.stringify(input);
73
+ const stamp = await this.stamper.stamp(body);
74
+ return {
75
+ body: body,
76
+ stamp: stamp,
77
+ url: fullUrl,
78
+ };
79
+ };
80
+ /**
81
+ * Get details about an Organization
82
+ *
83
+ * Sign the provided `TGetOrganizationBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_organization).
84
+ *
85
+ * See also {@link stampGetOrganization}.
86
+ */
87
+ this.getOrganization = async (input) => {
88
+ return this.request("/public/v1/query/get_organization", input);
89
+ };
90
+ /**
91
+ * Produce a `SignedRequest` from `TGetOrganizationBody` by using the client's `stamp` function.
92
+ *
93
+ * See also {@link GetOrganization}.
94
+ */
95
+ this.stampGetOrganization = async (input) => {
96
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_organization";
97
+ const body = JSON.stringify(input);
98
+ const stamp = await this.stamper.stamp(body);
99
+ return {
100
+ body: body,
101
+ stamp: stamp,
102
+ url: fullUrl,
103
+ };
104
+ };
105
+ /**
106
+ * Get details about a Policy
107
+ *
108
+ * Sign the provided `TGetPolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_policy).
109
+ *
110
+ * See also {@link stampGetPolicy}.
111
+ */
112
+ this.getPolicy = async (input) => {
113
+ return this.request("/public/v1/query/get_policy", input);
114
+ };
115
+ /**
116
+ * Produce a `SignedRequest` from `TGetPolicyBody` by using the client's `stamp` function.
117
+ *
118
+ * See also {@link GetPolicy}.
119
+ */
120
+ this.stampGetPolicy = async (input) => {
121
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_policy";
122
+ const body = JSON.stringify(input);
123
+ const stamp = await this.stamper.stamp(body);
124
+ return {
125
+ body: body,
126
+ stamp: stamp,
127
+ url: fullUrl,
128
+ };
129
+ };
130
+ /**
131
+ * Get details about a Private Key
132
+ *
133
+ * Sign the provided `TGetPrivateKeyBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_private_key).
134
+ *
135
+ * See also {@link stampGetPrivateKey}.
136
+ */
137
+ this.getPrivateKey = async (input) => {
138
+ return this.request("/public/v1/query/get_private_key", input);
139
+ };
140
+ /**
141
+ * Produce a `SignedRequest` from `TGetPrivateKeyBody` by using the client's `stamp` function.
142
+ *
143
+ * See also {@link GetPrivateKey}.
144
+ */
145
+ this.stampGetPrivateKey = async (input) => {
146
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_private_key";
147
+ const body = JSON.stringify(input);
148
+ const stamp = await this.stamper.stamp(body);
149
+ return {
150
+ body: body,
151
+ stamp: stamp,
152
+ url: fullUrl,
153
+ };
154
+ };
155
+ /**
156
+ * Get details about a User
157
+ *
158
+ * Sign the provided `TGetUserBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_user).
159
+ *
160
+ * See also {@link stampGetUser}.
161
+ */
162
+ this.getUser = async (input) => {
163
+ return this.request("/public/v1/query/get_user", input);
164
+ };
165
+ /**
166
+ * Produce a `SignedRequest` from `TGetUserBody` by using the client's `stamp` function.
167
+ *
168
+ * See also {@link GetUser}.
169
+ */
170
+ this.stampGetUser = async (input) => {
171
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_user";
172
+ const body = JSON.stringify(input);
173
+ const stamp = await this.stamper.stamp(body);
174
+ return {
175
+ body: body,
176
+ stamp: stamp,
177
+ url: fullUrl,
178
+ };
179
+ };
180
+ /**
181
+ * Get details about a Wallet
182
+ *
183
+ * Sign the provided `TGetWalletBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_wallet).
184
+ *
185
+ * See also {@link stampGetWallet}.
186
+ */
187
+ this.getWallet = async (input) => {
188
+ return this.request("/public/v1/query/get_wallet", input);
189
+ };
190
+ /**
191
+ * Produce a `SignedRequest` from `TGetWalletBody` by using the client's `stamp` function.
192
+ *
193
+ * See also {@link GetWallet}.
194
+ */
195
+ this.stampGetWallet = async (input) => {
196
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_wallet";
197
+ const body = JSON.stringify(input);
198
+ const stamp = await this.stamper.stamp(body);
199
+ return {
200
+ body: body,
201
+ stamp: stamp,
202
+ url: fullUrl,
203
+ };
204
+ };
205
+ /**
206
+ * List all Activities within an Organization
207
+ *
208
+ * Sign the provided `TGetActivitiesBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_activities).
209
+ *
210
+ * See also {@link stampGetActivities}.
211
+ */
212
+ this.getActivities = async (input) => {
213
+ return this.request("/public/v1/query/list_activities", input);
214
+ };
215
+ /**
216
+ * Produce a `SignedRequest` from `TGetActivitiesBody` by using the client's `stamp` function.
217
+ *
218
+ * See also {@link GetActivities}.
219
+ */
220
+ this.stampGetActivities = async (input) => {
221
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_activities";
222
+ const body = JSON.stringify(input);
223
+ const stamp = await this.stamper.stamp(body);
224
+ return {
225
+ body: body,
226
+ stamp: stamp,
227
+ url: fullUrl,
228
+ };
229
+ };
230
+ /**
231
+ * List all Policies within an Organization
232
+ *
233
+ * Sign the provided `TGetPoliciesBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_policies).
234
+ *
235
+ * See also {@link stampGetPolicies}.
236
+ */
237
+ this.getPolicies = async (input) => {
238
+ return this.request("/public/v1/query/list_policies", input);
239
+ };
240
+ /**
241
+ * Produce a `SignedRequest` from `TGetPoliciesBody` by using the client's `stamp` function.
242
+ *
243
+ * See also {@link GetPolicies}.
244
+ */
245
+ this.stampGetPolicies = async (input) => {
246
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_policies";
247
+ const body = JSON.stringify(input);
248
+ const stamp = await this.stamper.stamp(body);
249
+ return {
250
+ body: body,
251
+ stamp: stamp,
252
+ url: fullUrl,
253
+ };
254
+ };
255
+ /**
256
+ * List all Private Keys within an Organization
257
+ *
258
+ * Sign the provided `TGetPrivateKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_private_keys).
259
+ *
260
+ * See also {@link stampGetPrivateKeys}.
261
+ */
262
+ this.getPrivateKeys = async (input) => {
263
+ return this.request("/public/v1/query/list_private_keys", input);
264
+ };
265
+ /**
266
+ * Produce a `SignedRequest` from `TGetPrivateKeysBody` by using the client's `stamp` function.
267
+ *
268
+ * See also {@link GetPrivateKeys}.
269
+ */
270
+ this.stampGetPrivateKeys = async (input) => {
271
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_private_keys";
272
+ const body = JSON.stringify(input);
273
+ const stamp = await this.stamper.stamp(body);
274
+ return {
275
+ body: body,
276
+ stamp: stamp,
277
+ url: fullUrl,
278
+ };
279
+ };
280
+ /**
281
+ * List all Users within an Organization
282
+ *
283
+ * Sign the provided `TGetUsersBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_users).
284
+ *
285
+ * See also {@link stampGetUsers}.
286
+ */
287
+ this.getUsers = async (input) => {
288
+ return this.request("/public/v1/query/list_users", input);
289
+ };
290
+ /**
291
+ * Produce a `SignedRequest` from `TGetUsersBody` by using the client's `stamp` function.
292
+ *
293
+ * See also {@link GetUsers}.
294
+ */
295
+ this.stampGetUsers = async (input) => {
296
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_users";
297
+ const body = JSON.stringify(input);
298
+ const stamp = await this.stamper.stamp(body);
299
+ return {
300
+ body: body,
301
+ stamp: stamp,
302
+ url: fullUrl,
303
+ };
304
+ };
305
+ /**
306
+ * List all Accounts wirhin a Wallet
307
+ *
308
+ * Sign the provided `TGetWalletAccountsBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_wallet_accounts).
309
+ *
310
+ * See also {@link stampGetWalletAccounts}.
311
+ */
312
+ this.getWalletAccounts = async (input) => {
313
+ return this.request("/public/v1/query/list_wallet_accounts", input);
314
+ };
315
+ /**
316
+ * Produce a `SignedRequest` from `TGetWalletAccountsBody` by using the client's `stamp` function.
317
+ *
318
+ * See also {@link GetWalletAccounts}.
319
+ */
320
+ this.stampGetWalletAccounts = async (input) => {
321
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_wallet_accounts";
322
+ const body = JSON.stringify(input);
323
+ const stamp = await this.stamper.stamp(body);
324
+ return {
325
+ body: body,
326
+ stamp: stamp,
327
+ url: fullUrl,
328
+ };
329
+ };
330
+ /**
331
+ * List all Wallets within an Organization
332
+ *
333
+ * Sign the provided `TGetWalletsBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_wallets).
334
+ *
335
+ * See also {@link stampGetWallets}.
336
+ */
337
+ this.getWallets = async (input) => {
338
+ return this.request("/public/v1/query/list_wallets", input);
339
+ };
340
+ /**
341
+ * Produce a `SignedRequest` from `TGetWalletsBody` by using the client's `stamp` function.
342
+ *
343
+ * See also {@link GetWallets}.
344
+ */
345
+ this.stampGetWallets = async (input) => {
346
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_wallets";
347
+ const body = JSON.stringify(input);
348
+ const stamp = await this.stamper.stamp(body);
349
+ return {
350
+ body: body,
351
+ stamp: stamp,
352
+ url: fullUrl,
353
+ };
354
+ };
355
+ /**
356
+ * Get basic information about your current API or WebAuthN user and their organization. Affords Sub-Organization look ups via Parent Organization for WebAuthN users.
357
+ *
358
+ * Sign the provided `TGetWhoamiBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/whoami).
359
+ *
360
+ * See also {@link stampGetWhoami}.
361
+ */
362
+ this.getWhoami = async (input) => {
363
+ return this.request("/public/v1/query/whoami", input);
364
+ };
365
+ /**
366
+ * Produce a `SignedRequest` from `TGetWhoamiBody` by using the client's `stamp` function.
367
+ *
368
+ * See also {@link GetWhoami}.
369
+ */
370
+ this.stampGetWhoami = async (input) => {
371
+ const fullUrl = this.config.baseUrl + "/public/v1/query/whoami";
372
+ const body = JSON.stringify(input);
373
+ const stamp = await this.stamper.stamp(body);
374
+ return {
375
+ body: body,
376
+ stamp: stamp,
377
+ url: fullUrl,
378
+ };
379
+ };
380
+ /**
381
+ * Approve an Activity
382
+ *
383
+ * Sign the provided `TApproveActivityBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/approve_activity).
384
+ *
385
+ * See also {@link stampApproveActivity}.
386
+ */
387
+ this.approveActivity = async (input) => {
388
+ return this.request("/public/v1/submit/approve_activity", input);
389
+ };
390
+ /**
391
+ * Produce a `SignedRequest` from `TApproveActivityBody` by using the client's `stamp` function.
392
+ *
393
+ * See also {@link ApproveActivity}.
394
+ */
395
+ this.stampApproveActivity = async (input) => {
396
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/approve_activity";
397
+ const body = JSON.stringify(input);
398
+ const stamp = await this.stamper.stamp(body);
399
+ return {
400
+ body: body,
401
+ stamp: stamp,
402
+ url: fullUrl,
403
+ };
404
+ };
405
+ /**
406
+ * Add api keys to an existing User
407
+ *
408
+ * Sign the provided `TCreateApiKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_api_keys).
409
+ *
410
+ * See also {@link stampCreateApiKeys}.
411
+ */
412
+ this.createApiKeys = async (input) => {
413
+ return this.request("/public/v1/submit/create_api_keys", input);
414
+ };
415
+ /**
416
+ * Produce a `SignedRequest` from `TCreateApiKeysBody` by using the client's `stamp` function.
417
+ *
418
+ * See also {@link CreateApiKeys}.
419
+ */
420
+ this.stampCreateApiKeys = async (input) => {
421
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_api_keys";
422
+ const body = JSON.stringify(input);
423
+ const stamp = await this.stamper.stamp(body);
424
+ return {
425
+ body: body,
426
+ stamp: stamp,
427
+ url: fullUrl,
428
+ };
429
+ };
430
+ /**
431
+ * Create API-only Users in an existing Organization
432
+ *
433
+ * Sign the provided `TCreateApiOnlyUsersBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_api_only_users).
434
+ *
435
+ * See also {@link stampCreateApiOnlyUsers}.
436
+ */
437
+ this.createApiOnlyUsers = async (input) => {
438
+ return this.request("/public/v1/submit/create_api_only_users", input);
439
+ };
440
+ /**
441
+ * Produce a `SignedRequest` from `TCreateApiOnlyUsersBody` by using the client's `stamp` function.
442
+ *
443
+ * See also {@link CreateApiOnlyUsers}.
444
+ */
445
+ this.stampCreateApiOnlyUsers = async (input) => {
446
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_api_only_users";
447
+ const body = JSON.stringify(input);
448
+ const stamp = await this.stamper.stamp(body);
449
+ return {
450
+ body: body,
451
+ stamp: stamp,
452
+ url: fullUrl,
453
+ };
454
+ };
455
+ /**
456
+ * Create Authenticators to authenticate requests to Turnkey
457
+ *
458
+ * Sign the provided `TCreateAuthenticatorsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_authenticators).
459
+ *
460
+ * See also {@link stampCreateAuthenticators}.
461
+ */
462
+ this.createAuthenticators = async (input) => {
463
+ return this.request("/public/v1/submit/create_authenticators", input);
464
+ };
465
+ /**
466
+ * Produce a `SignedRequest` from `TCreateAuthenticatorsBody` by using the client's `stamp` function.
467
+ *
468
+ * See also {@link CreateAuthenticators}.
469
+ */
470
+ this.stampCreateAuthenticators = async (input) => {
471
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_authenticators";
472
+ const body = JSON.stringify(input);
473
+ const stamp = await this.stamper.stamp(body);
474
+ return {
475
+ body: body,
476
+ stamp: stamp,
477
+ url: fullUrl,
478
+ };
479
+ };
480
+ /**
481
+ * Create Invitations to join an existing Organization
482
+ *
483
+ * Sign the provided `TCreateInvitationsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_invitations).
484
+ *
485
+ * See also {@link stampCreateInvitations}.
486
+ */
487
+ this.createInvitations = async (input) => {
488
+ return this.request("/public/v1/submit/create_invitations", input);
489
+ };
490
+ /**
491
+ * Produce a `SignedRequest` from `TCreateInvitationsBody` by using the client's `stamp` function.
492
+ *
493
+ * See also {@link CreateInvitations}.
494
+ */
495
+ this.stampCreateInvitations = async (input) => {
496
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_invitations";
497
+ const body = JSON.stringify(input);
498
+ const stamp = await this.stamper.stamp(body);
499
+ return {
500
+ body: body,
501
+ stamp: stamp,
502
+ url: fullUrl,
503
+ };
504
+ };
505
+ /**
506
+ * Create a new Policy
507
+ *
508
+ * Sign the provided `TCreatePolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_policy).
509
+ *
510
+ * See also {@link stampCreatePolicy}.
511
+ */
512
+ this.createPolicy = async (input) => {
513
+ return this.request("/public/v1/submit/create_policy", input);
514
+ };
515
+ /**
516
+ * Produce a `SignedRequest` from `TCreatePolicyBody` by using the client's `stamp` function.
517
+ *
518
+ * See also {@link CreatePolicy}.
519
+ */
520
+ this.stampCreatePolicy = async (input) => {
521
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_policy";
522
+ const body = JSON.stringify(input);
523
+ const stamp = await this.stamper.stamp(body);
524
+ return {
525
+ body: body,
526
+ stamp: stamp,
527
+ url: fullUrl,
528
+ };
529
+ };
530
+ /**
531
+ * Create a private key tag and add it to private keys.
532
+ *
533
+ * Sign the provided `TCreatePrivateKeyTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_private_key_tag).
534
+ *
535
+ * See also {@link stampCreatePrivateKeyTag}.
536
+ */
537
+ this.createPrivateKeyTag = async (input) => {
538
+ return this.request("/public/v1/submit/create_private_key_tag", input);
539
+ };
540
+ /**
541
+ * Produce a `SignedRequest` from `TCreatePrivateKeyTagBody` by using the client's `stamp` function.
542
+ *
543
+ * See also {@link CreatePrivateKeyTag}.
544
+ */
545
+ this.stampCreatePrivateKeyTag = async (input) => {
546
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_private_key_tag";
547
+ const body = JSON.stringify(input);
548
+ const stamp = await this.stamper.stamp(body);
549
+ return {
550
+ body: body,
551
+ stamp: stamp,
552
+ url: fullUrl,
553
+ };
554
+ };
555
+ /**
556
+ * Create new Private Keys
557
+ *
558
+ * Sign the provided `TCreatePrivateKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_private_keys).
559
+ *
560
+ * See also {@link stampCreatePrivateKeys}.
561
+ */
562
+ this.createPrivateKeys = async (input) => {
563
+ return this.request("/public/v1/submit/create_private_keys", input);
564
+ };
565
+ /**
566
+ * Produce a `SignedRequest` from `TCreatePrivateKeysBody` by using the client's `stamp` function.
567
+ *
568
+ * See also {@link CreatePrivateKeys}.
569
+ */
570
+ this.stampCreatePrivateKeys = async (input) => {
571
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_private_keys";
572
+ const body = JSON.stringify(input);
573
+ const stamp = await this.stamper.stamp(body);
574
+ return {
575
+ body: body,
576
+ stamp: stamp,
577
+ url: fullUrl,
578
+ };
579
+ };
580
+ /**
581
+ * Create a new Sub-Organization
582
+ *
583
+ * Sign the provided `TCreateSubOrganizationBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_sub_organization).
584
+ *
585
+ * See also {@link stampCreateSubOrganization}.
586
+ */
587
+ this.createSubOrganization = async (input) => {
588
+ return this.request("/public/v1/submit/create_sub_organization", input);
589
+ };
590
+ /**
591
+ * Produce a `SignedRequest` from `TCreateSubOrganizationBody` by using the client's `stamp` function.
592
+ *
593
+ * See also {@link CreateSubOrganization}.
594
+ */
595
+ this.stampCreateSubOrganization = async (input) => {
596
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_sub_organization";
597
+ const body = JSON.stringify(input);
598
+ const stamp = await this.stamper.stamp(body);
599
+ return {
600
+ body: body,
601
+ stamp: stamp,
602
+ url: fullUrl,
603
+ };
604
+ };
605
+ /**
606
+ * Create a user tag and add it to users.
607
+ *
608
+ * Sign the provided `TCreateUserTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_user_tag).
609
+ *
610
+ * See also {@link stampCreateUserTag}.
611
+ */
612
+ this.createUserTag = async (input) => {
613
+ return this.request("/public/v1/submit/create_user_tag", input);
614
+ };
615
+ /**
616
+ * Produce a `SignedRequest` from `TCreateUserTagBody` by using the client's `stamp` function.
617
+ *
618
+ * See also {@link CreateUserTag}.
619
+ */
620
+ this.stampCreateUserTag = async (input) => {
621
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_user_tag";
622
+ const body = JSON.stringify(input);
623
+ const stamp = await this.stamper.stamp(body);
624
+ return {
625
+ body: body,
626
+ stamp: stamp,
627
+ url: fullUrl,
628
+ };
629
+ };
630
+ /**
631
+ * Create Users in an existing Organization
632
+ *
633
+ * Sign the provided `TCreateUsersBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_users).
634
+ *
635
+ * See also {@link stampCreateUsers}.
636
+ */
637
+ this.createUsers = async (input) => {
638
+ return this.request("/public/v1/submit/create_users", input);
639
+ };
640
+ /**
641
+ * Produce a `SignedRequest` from `TCreateUsersBody` by using the client's `stamp` function.
642
+ *
643
+ * See also {@link CreateUsers}.
644
+ */
645
+ this.stampCreateUsers = async (input) => {
646
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_users";
647
+ const body = JSON.stringify(input);
648
+ const stamp = await this.stamper.stamp(body);
649
+ return {
650
+ body: body,
651
+ stamp: stamp,
652
+ url: fullUrl,
653
+ };
654
+ };
655
+ /**
656
+ * Create a Wallet and derive addresses
657
+ *
658
+ * Sign the provided `TCreateWalletBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_wallet).
659
+ *
660
+ * See also {@link stampCreateWallet}.
661
+ */
662
+ this.createWallet = async (input) => {
663
+ return this.request("/public/v1/submit/create_wallet", input);
664
+ };
665
+ /**
666
+ * Produce a `SignedRequest` from `TCreateWalletBody` by using the client's `stamp` function.
667
+ *
668
+ * See also {@link CreateWallet}.
669
+ */
670
+ this.stampCreateWallet = async (input) => {
671
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_wallet";
672
+ const body = JSON.stringify(input);
673
+ const stamp = await this.stamper.stamp(body);
674
+ return {
675
+ body: body,
676
+ stamp: stamp,
677
+ url: fullUrl,
678
+ };
679
+ };
680
+ /**
681
+ * Derive additional addresses using an existing wallet
682
+ *
683
+ * Sign the provided `TCreateWalletAccountsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_wallet_accounts).
684
+ *
685
+ * See also {@link stampCreateWalletAccounts}.
686
+ */
687
+ this.createWalletAccounts = async (input) => {
688
+ return this.request("/public/v1/submit/create_wallet_accounts", input);
689
+ };
690
+ /**
691
+ * Produce a `SignedRequest` from `TCreateWalletAccountsBody` by using the client's `stamp` function.
692
+ *
693
+ * See also {@link CreateWalletAccounts}.
694
+ */
695
+ this.stampCreateWalletAccounts = async (input) => {
696
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_wallet_accounts";
697
+ const body = JSON.stringify(input);
698
+ const stamp = await this.stamper.stamp(body);
699
+ return {
700
+ body: body,
701
+ stamp: stamp,
702
+ url: fullUrl,
703
+ };
704
+ };
705
+ /**
706
+ * Remove api keys from a User
707
+ *
708
+ * Sign the provided `TDeleteApiKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_api_keys).
709
+ *
710
+ * See also {@link stampDeleteApiKeys}.
711
+ */
712
+ this.deleteApiKeys = async (input) => {
713
+ return this.request("/public/v1/submit/delete_api_keys", input);
714
+ };
715
+ /**
716
+ * Produce a `SignedRequest` from `TDeleteApiKeysBody` by using the client's `stamp` function.
717
+ *
718
+ * See also {@link DeleteApiKeys}.
719
+ */
720
+ this.stampDeleteApiKeys = async (input) => {
721
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_api_keys";
722
+ const body = JSON.stringify(input);
723
+ const stamp = await this.stamper.stamp(body);
724
+ return {
725
+ body: body,
726
+ stamp: stamp,
727
+ url: fullUrl,
728
+ };
729
+ };
730
+ /**
731
+ * Remove authenticators from a User
732
+ *
733
+ * Sign the provided `TDeleteAuthenticatorsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_authenticators).
734
+ *
735
+ * See also {@link stampDeleteAuthenticators}.
736
+ */
737
+ this.deleteAuthenticators = async (input) => {
738
+ return this.request("/public/v1/submit/delete_authenticators", input);
739
+ };
740
+ /**
741
+ * Produce a `SignedRequest` from `TDeleteAuthenticatorsBody` by using the client's `stamp` function.
742
+ *
743
+ * See also {@link DeleteAuthenticators}.
744
+ */
745
+ this.stampDeleteAuthenticators = async (input) => {
746
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_authenticators";
747
+ const body = JSON.stringify(input);
748
+ const stamp = await this.stamper.stamp(body);
749
+ return {
750
+ body: body,
751
+ stamp: stamp,
752
+ url: fullUrl,
753
+ };
754
+ };
755
+ /**
756
+ * Delete an existing Invitation
757
+ *
758
+ * Sign the provided `TDeleteInvitationBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_invitation).
759
+ *
760
+ * See also {@link stampDeleteInvitation}.
761
+ */
762
+ this.deleteInvitation = async (input) => {
763
+ return this.request("/public/v1/submit/delete_invitation", input);
764
+ };
765
+ /**
766
+ * Produce a `SignedRequest` from `TDeleteInvitationBody` by using the client's `stamp` function.
767
+ *
768
+ * See also {@link DeleteInvitation}.
769
+ */
770
+ this.stampDeleteInvitation = async (input) => {
771
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_invitation";
772
+ const body = JSON.stringify(input);
773
+ const stamp = await this.stamper.stamp(body);
774
+ return {
775
+ body: body,
776
+ stamp: stamp,
777
+ url: fullUrl,
778
+ };
779
+ };
780
+ /**
781
+ * Delete an existing Policy
782
+ *
783
+ * Sign the provided `TDeletePolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_policy).
784
+ *
785
+ * See also {@link stampDeletePolicy}.
786
+ */
787
+ this.deletePolicy = async (input) => {
788
+ return this.request("/public/v1/submit/delete_policy", input);
789
+ };
790
+ /**
791
+ * Produce a `SignedRequest` from `TDeletePolicyBody` by using the client's `stamp` function.
792
+ *
793
+ * See also {@link DeletePolicy}.
794
+ */
795
+ this.stampDeletePolicy = async (input) => {
796
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_policy";
797
+ const body = JSON.stringify(input);
798
+ const stamp = await this.stamper.stamp(body);
799
+ return {
800
+ body: body,
801
+ stamp: stamp,
802
+ url: fullUrl,
803
+ };
804
+ };
805
+ /**
806
+ * Exports a Private Key
807
+ *
808
+ * Sign the provided `TExportPrivateKeyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/export_private_key).
809
+ *
810
+ * See also {@link stampExportPrivateKey}.
811
+ */
812
+ this.exportPrivateKey = async (input) => {
813
+ return this.request("/public/v1/submit/export_private_key", input);
814
+ };
815
+ /**
816
+ * Produce a `SignedRequest` from `TExportPrivateKeyBody` by using the client's `stamp` function.
817
+ *
818
+ * See also {@link ExportPrivateKey}.
819
+ */
820
+ this.stampExportPrivateKey = async (input) => {
821
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/export_private_key";
822
+ const body = JSON.stringify(input);
823
+ const stamp = await this.stamper.stamp(body);
824
+ return {
825
+ body: body,
826
+ stamp: stamp,
827
+ url: fullUrl,
828
+ };
829
+ };
830
+ /**
831
+ * Exports a Wallet
832
+ *
833
+ * Sign the provided `TExportWalletBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/export_wallet).
834
+ *
835
+ * See also {@link stampExportWallet}.
836
+ */
837
+ this.exportWallet = async (input) => {
838
+ return this.request("/public/v1/submit/export_wallet", input);
839
+ };
840
+ /**
841
+ * Produce a `SignedRequest` from `TExportWalletBody` by using the client's `stamp` function.
842
+ *
843
+ * See also {@link ExportWallet}.
844
+ */
845
+ this.stampExportWallet = async (input) => {
846
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/export_wallet";
847
+ const body = JSON.stringify(input);
848
+ const stamp = await this.stamper.stamp(body);
849
+ return {
850
+ body: body,
851
+ stamp: stamp,
852
+ url: fullUrl,
853
+ };
854
+ };
855
+ /**
856
+ * Initializes a new email recovery
857
+ *
858
+ * Sign the provided `TInitUserEmailRecoveryBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/init_user_email_recovery).
859
+ *
860
+ * See also {@link stampInitUserEmailRecovery}.
861
+ */
862
+ this.initUserEmailRecovery = async (input) => {
863
+ return this.request("/public/v1/submit/init_user_email_recovery", input);
864
+ };
865
+ /**
866
+ * Produce a `SignedRequest` from `TInitUserEmailRecoveryBody` by using the client's `stamp` function.
867
+ *
868
+ * See also {@link InitUserEmailRecovery}.
869
+ */
870
+ this.stampInitUserEmailRecovery = async (input) => {
871
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/init_user_email_recovery";
872
+ const body = JSON.stringify(input);
873
+ const stamp = await this.stamper.stamp(body);
874
+ return {
875
+ body: body,
876
+ stamp: stamp,
877
+ url: fullUrl,
878
+ };
879
+ };
880
+ /**
881
+ * Completes the process of recovering a user by adding an authenticator
882
+ *
883
+ * Sign the provided `TRecoverUserBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/recover_user).
884
+ *
885
+ * See also {@link stampRecoverUser}.
886
+ */
887
+ this.recoverUser = async (input) => {
888
+ return this.request("/public/v1/submit/recover_user", input);
889
+ };
890
+ /**
891
+ * Produce a `SignedRequest` from `TRecoverUserBody` by using the client's `stamp` function.
892
+ *
893
+ * See also {@link RecoverUser}.
894
+ */
895
+ this.stampRecoverUser = async (input) => {
896
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/recover_user";
897
+ const body = JSON.stringify(input);
898
+ const stamp = await this.stamper.stamp(body);
899
+ return {
900
+ body: body,
901
+ stamp: stamp,
902
+ url: fullUrl,
903
+ };
904
+ };
905
+ /**
906
+ * Reject an Activity
907
+ *
908
+ * Sign the provided `TRejectActivityBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/reject_activity).
909
+ *
910
+ * See also {@link stampRejectActivity}.
911
+ */
912
+ this.rejectActivity = async (input) => {
913
+ return this.request("/public/v1/submit/reject_activity", input);
914
+ };
915
+ /**
916
+ * Produce a `SignedRequest` from `TRejectActivityBody` by using the client's `stamp` function.
917
+ *
918
+ * See also {@link RejectActivity}.
919
+ */
920
+ this.stampRejectActivity = async (input) => {
921
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/reject_activity";
922
+ const body = JSON.stringify(input);
923
+ const stamp = await this.stamper.stamp(body);
924
+ return {
925
+ body: body,
926
+ stamp: stamp,
927
+ url: fullUrl,
928
+ };
929
+ };
930
+ /**
931
+ * Removes an organization feature
932
+ *
933
+ * Sign the provided `TRemoveOrganizationFeatureBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/remove_organization_feature).
934
+ *
935
+ * See also {@link stampRemoveOrganizationFeature}.
936
+ */
937
+ this.removeOrganizationFeature = async (input) => {
938
+ return this.request("/public/v1/submit/remove_organization_feature", input);
939
+ };
940
+ /**
941
+ * Produce a `SignedRequest` from `TRemoveOrganizationFeatureBody` by using the client's `stamp` function.
942
+ *
943
+ * See also {@link RemoveOrganizationFeature}.
944
+ */
945
+ this.stampRemoveOrganizationFeature = async (input) => {
946
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/remove_organization_feature";
947
+ const body = JSON.stringify(input);
948
+ const stamp = await this.stamper.stamp(body);
949
+ return {
950
+ body: body,
951
+ stamp: stamp,
952
+ url: fullUrl,
953
+ };
954
+ };
955
+ /**
956
+ * Sets an organization feature
957
+ *
958
+ * Sign the provided `TSetOrganizationFeatureBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/set_organization_feature).
959
+ *
960
+ * See also {@link stampSetOrganizationFeature}.
961
+ */
962
+ this.setOrganizationFeature = async (input) => {
963
+ return this.request("/public/v1/submit/set_organization_feature", input);
964
+ };
965
+ /**
966
+ * Produce a `SignedRequest` from `TSetOrganizationFeatureBody` by using the client's `stamp` function.
967
+ *
968
+ * See also {@link SetOrganizationFeature}.
969
+ */
970
+ this.stampSetOrganizationFeature = async (input) => {
971
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/set_organization_feature";
972
+ const body = JSON.stringify(input);
973
+ const stamp = await this.stamper.stamp(body);
974
+ return {
975
+ body: body,
976
+ stamp: stamp,
977
+ url: fullUrl,
978
+ };
979
+ };
980
+ /**
981
+ * Sign a raw payload
982
+ *
983
+ * Sign the provided `TSignRawPayloadBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/sign_raw_payload).
984
+ *
985
+ * See also {@link stampSignRawPayload}.
986
+ */
987
+ this.signRawPayload = async (input) => {
988
+ return this.request("/public/v1/submit/sign_raw_payload", input);
989
+ };
990
+ /**
991
+ * Produce a `SignedRequest` from `TSignRawPayloadBody` by using the client's `stamp` function.
992
+ *
993
+ * See also {@link SignRawPayload}.
994
+ */
995
+ this.stampSignRawPayload = async (input) => {
996
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/sign_raw_payload";
997
+ const body = JSON.stringify(input);
998
+ const stamp = await this.stamper.stamp(body);
999
+ return {
1000
+ body: body,
1001
+ stamp: stamp,
1002
+ url: fullUrl,
1003
+ };
1004
+ };
1005
+ /**
1006
+ * Sign a transaction
1007
+ *
1008
+ * Sign the provided `TSignTransactionBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/sign_transaction).
1009
+ *
1010
+ * See also {@link stampSignTransaction}.
1011
+ */
1012
+ this.signTransaction = async (input) => {
1013
+ return this.request("/public/v1/submit/sign_transaction", input);
1014
+ };
1015
+ /**
1016
+ * Produce a `SignedRequest` from `TSignTransactionBody` by using the client's `stamp` function.
1017
+ *
1018
+ * See also {@link SignTransaction}.
1019
+ */
1020
+ this.stampSignTransaction = async (input) => {
1021
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/sign_transaction";
1022
+ const body = JSON.stringify(input);
1023
+ const stamp = await this.stamper.stamp(body);
1024
+ return {
1025
+ body: body,
1026
+ stamp: stamp,
1027
+ url: fullUrl,
1028
+ };
1029
+ };
1030
+ /**
1031
+ * Update the origins WebAuthN credentials are allowed to sign requests from. Setting this on a Parent-Organization applies to all Sub-Organizations.
1032
+ *
1033
+ * Sign the provided `TUpdateAllowedOriginsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_allowed_origins).
1034
+ *
1035
+ * See also {@link stampUpdateAllowedOrigins}.
1036
+ */
1037
+ this.updateAllowedOrigins = async (input) => {
1038
+ return this.request("/public/v1/submit/update_allowed_origins", input);
1039
+ };
1040
+ /**
1041
+ * Produce a `SignedRequest` from `TUpdateAllowedOriginsBody` by using the client's `stamp` function.
1042
+ *
1043
+ * See also {@link UpdateAllowedOrigins}.
1044
+ */
1045
+ this.stampUpdateAllowedOrigins = async (input) => {
1046
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_allowed_origins";
1047
+ const body = JSON.stringify(input);
1048
+ const stamp = await this.stamper.stamp(body);
1049
+ return {
1050
+ body: body,
1051
+ stamp: stamp,
1052
+ url: fullUrl,
1053
+ };
1054
+ };
1055
+ /**
1056
+ * Update an existing Policy
1057
+ *
1058
+ * Sign the provided `TUpdatePolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_policy).
1059
+ *
1060
+ * See also {@link stampUpdatePolicy}.
1061
+ */
1062
+ this.updatePolicy = async (input) => {
1063
+ return this.request("/public/v1/submit/update_policy", input);
1064
+ };
1065
+ /**
1066
+ * Produce a `SignedRequest` from `TUpdatePolicyBody` by using the client's `stamp` function.
1067
+ *
1068
+ * See also {@link UpdatePolicy}.
1069
+ */
1070
+ this.stampUpdatePolicy = async (input) => {
1071
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_policy";
1072
+ const body = JSON.stringify(input);
1073
+ const stamp = await this.stamper.stamp(body);
1074
+ return {
1075
+ body: body,
1076
+ stamp: stamp,
1077
+ url: fullUrl,
1078
+ };
1079
+ };
1080
+ /**
1081
+ * Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.
1082
+ *
1083
+ * Sign the provided `TUpdatePrivateKeyTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_private_key_tag).
1084
+ *
1085
+ * See also {@link stampUpdatePrivateKeyTag}.
1086
+ */
1087
+ this.updatePrivateKeyTag = async (input) => {
1088
+ return this.request("/public/v1/submit/update_private_key_tag", input);
1089
+ };
1090
+ /**
1091
+ * Produce a `SignedRequest` from `TUpdatePrivateKeyTagBody` by using the client's `stamp` function.
1092
+ *
1093
+ * See also {@link UpdatePrivateKeyTag}.
1094
+ */
1095
+ this.stampUpdatePrivateKeyTag = async (input) => {
1096
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_private_key_tag";
1097
+ const body = JSON.stringify(input);
1098
+ const stamp = await this.stamper.stamp(body);
1099
+ return {
1100
+ body: body,
1101
+ stamp: stamp,
1102
+ url: fullUrl,
1103
+ };
1104
+ };
1105
+ /**
1106
+ * Set the threshold and members of the root quorum. This must be approved by the current root quorum.
1107
+ *
1108
+ * Sign the provided `TUpdateRootQuorumBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_root_quorum).
1109
+ *
1110
+ * See also {@link stampUpdateRootQuorum}.
1111
+ */
1112
+ this.updateRootQuorum = async (input) => {
1113
+ return this.request("/public/v1/submit/update_root_quorum", input);
1114
+ };
1115
+ /**
1116
+ * Produce a `SignedRequest` from `TUpdateRootQuorumBody` by using the client's `stamp` function.
1117
+ *
1118
+ * See also {@link UpdateRootQuorum}.
1119
+ */
1120
+ this.stampUpdateRootQuorum = async (input) => {
1121
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_root_quorum";
1122
+ const body = JSON.stringify(input);
1123
+ const stamp = await this.stamper.stamp(body);
1124
+ return {
1125
+ body: body,
1126
+ stamp: stamp,
1127
+ url: fullUrl,
1128
+ };
1129
+ };
1130
+ /**
1131
+ * Update a User in an existing Organization
1132
+ *
1133
+ * Sign the provided `TUpdateUserBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_user).
1134
+ *
1135
+ * See also {@link stampUpdateUser}.
1136
+ */
1137
+ this.updateUser = async (input) => {
1138
+ return this.request("/public/v1/submit/update_user", input);
1139
+ };
1140
+ /**
1141
+ * Produce a `SignedRequest` from `TUpdateUserBody` by using the client's `stamp` function.
1142
+ *
1143
+ * See also {@link UpdateUser}.
1144
+ */
1145
+ this.stampUpdateUser = async (input) => {
1146
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_user";
1147
+ const body = JSON.stringify(input);
1148
+ const stamp = await this.stamper.stamp(body);
1149
+ return {
1150
+ body: body,
1151
+ stamp: stamp,
1152
+ url: fullUrl,
1153
+ };
1154
+ };
1155
+ /**
1156
+ * Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.
1157
+ *
1158
+ * Sign the provided `TUpdateUserTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_user_tag).
1159
+ *
1160
+ * See also {@link stampUpdateUserTag}.
1161
+ */
1162
+ this.updateUserTag = async (input) => {
1163
+ return this.request("/public/v1/submit/update_user_tag", input);
1164
+ };
1165
+ /**
1166
+ * Produce a `SignedRequest` from `TUpdateUserTagBody` by using the client's `stamp` function.
1167
+ *
1168
+ * See also {@link UpdateUserTag}.
1169
+ */
1170
+ this.stampUpdateUserTag = async (input) => {
1171
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_user_tag";
1172
+ const body = JSON.stringify(input);
1173
+ const stamp = await this.stamper.stamp(body);
1174
+ return {
1175
+ body: body,
1176
+ stamp: stamp,
1177
+ url: fullUrl,
1178
+ };
1179
+ };
1180
+ if (!config.baseUrl) {
1181
+ throw new Error(`Missing base URL. Please verify env vars.`);
1182
+ }
1183
+ this.config = config;
1184
+ this.stamper = stamper;
1185
+ }
1186
+ async request(url, body) {
1187
+ const fullUrl = this.config.baseUrl + url;
1188
+ const stringifiedBody = JSON.stringify(body);
1189
+ const stamp = await this.stamper.stamp(stringifiedBody);
1190
+ const response = await fetch(fullUrl, {
1191
+ method: "POST",
1192
+ headers: {
1193
+ [stamp.stampHeaderName]: stamp.stampHeaderValue,
1194
+ },
1195
+ body: stringifiedBody,
1196
+ redirect: "follow",
1197
+ });
1198
+ if (!response.ok) {
1199
+ let res;
1200
+ try {
1201
+ res = await response.json();
1202
+ }
1203
+ catch (_) {
1204
+ throw new Error(`${response.status} ${response.statusText}`);
1205
+ }
1206
+ throw new TurnkeyRequestError(res);
1207
+ }
1208
+ const data = await response.json();
1209
+ return data;
1210
+ }
1211
+ }
1212
+ //# sourceMappingURL=public_api.client.js.map