@turnkey/http 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +22 -17
  3. package/dist/__generated__/services/coordinator/public/v1/public_api.client.d.ts +548 -0
  4. package/dist/__generated__/services/coordinator/public/v1/public_api.client.d.ts.map +1 -0
  5. package/dist/__generated__/services/coordinator/public/v1/public_api.client.js +938 -0
  6. package/dist/__generated__/services/coordinator/public/v1/public_api.client.js.map +1 -0
  7. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts +1516 -281
  8. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.d.ts.map +1 -1
  9. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js +25 -9
  10. package/dist/__generated__/services/coordinator/public/v1/public_api.fetcher.js.map +1 -1
  11. package/dist/__generated__/services/coordinator/public/v1/public_api.swagger.json +437 -706
  12. package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts +210 -789
  13. package/dist/__generated__/services/coordinator/public/v1/public_api.types.d.ts.map +1 -1
  14. package/dist/async.d.ts +20 -1
  15. package/dist/async.d.ts.map +1 -1
  16. package/dist/async.js +78 -2
  17. package/dist/async.js.map +1 -1
  18. package/dist/base.d.ts +51 -1
  19. package/dist/base.d.ts.map +1 -1
  20. package/dist/base.js +27 -5
  21. package/dist/base.js.map +1 -1
  22. package/dist/config.d.ts +6 -0
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/config.js +6 -0
  25. package/dist/config.js.map +1 -1
  26. package/dist/encoding.d.ts +0 -4
  27. package/dist/encoding.d.ts.map +1 -1
  28. package/dist/encoding.js +1 -24
  29. package/dist/encoding.js.map +1 -1
  30. package/dist/index.d.ts +5 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +8 -4
  33. package/dist/index.js.map +1 -1
  34. package/dist/shared.d.ts +1 -27
  35. package/dist/shared.d.ts.map +1 -1
  36. package/dist/shared.js +4 -13
  37. package/dist/shared.js.map +1 -1
  38. package/dist/universal.d.ts +1 -3
  39. package/dist/universal.d.ts.map +1 -1
  40. package/dist/universal.js +2 -10
  41. package/dist/universal.js.map +1 -1
  42. package/package.json +5 -3
  43. package/dist/stamp.node.d.ts +0 -3
  44. package/dist/stamp.node.d.ts.map +0 -1
  45. package/dist/stamp.node.js +0 -51
  46. package/dist/stamp.node.js.map +0 -1
  47. package/dist/stamp.webcrypto.d.ts +0 -4
  48. package/dist/stamp.webcrypto.d.ts.map +0 -1
  49. package/dist/stamp.webcrypto.js +0 -110
  50. package/dist/stamp.webcrypto.js.map +0 -1
  51. package/dist/tink/bytes.d.ts +0 -45
  52. package/dist/tink/bytes.d.ts.map +0 -1
  53. package/dist/tink/bytes.js +0 -82
  54. package/dist/tink/bytes.js.map +0 -1
  55. package/dist/tink/elliptic_curves.d.ts +0 -14
  56. package/dist/tink/elliptic_curves.d.ts.map +0 -1
  57. package/dist/tink/elliptic_curves.js +0 -178
  58. package/dist/tink/elliptic_curves.js.map +0 -1
@@ -0,0 +1,938 @@
1
+ "use strict";
2
+ /* @generated by `@turnkey/fetchers`. DO NOT EDIT BY HAND */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TurnkeyClient = void 0;
5
+ const base_1 = require("../../../../../base");
6
+ class TurnkeyClient {
7
+ constructor(config, stamper) {
8
+ /**
9
+ * Get details about an Activity
10
+ *
11
+ * Sign the provided `TGetActivityBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_activity).
12
+ *
13
+ * See also {@link stampGetActivity}.
14
+ */
15
+ this.getActivity = async (input) => {
16
+ return this.request("/public/v1/query/get_activity", input);
17
+ };
18
+ /**
19
+ * Produce a `SignedRequest` from `TGetActivityBody` by using the client's `stamp` function.
20
+ *
21
+ * See also {@link GetActivity}.
22
+ */
23
+ this.stampGetActivity = async (input) => {
24
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_activity";
25
+ const body = JSON.stringify(input);
26
+ const stamp = await this.stamper.stamp(body);
27
+ return {
28
+ body: body,
29
+ stamp: stamp,
30
+ url: fullUrl,
31
+ };
32
+ };
33
+ /**
34
+ * Get details about an authenticator
35
+ *
36
+ * Sign the provided `TGetAuthenticatorBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_authenticator).
37
+ *
38
+ * See also {@link stampGetAuthenticator}.
39
+ */
40
+ this.getAuthenticator = async (input) => {
41
+ return this.request("/public/v1/query/get_authenticator", input);
42
+ };
43
+ /**
44
+ * Produce a `SignedRequest` from `TGetAuthenticatorBody` by using the client's `stamp` function.
45
+ *
46
+ * See also {@link GetAuthenticator}.
47
+ */
48
+ this.stampGetAuthenticator = async (input) => {
49
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_authenticator";
50
+ const body = JSON.stringify(input);
51
+ const stamp = await this.stamper.stamp(body);
52
+ return {
53
+ body: body,
54
+ stamp: stamp,
55
+ url: fullUrl,
56
+ };
57
+ };
58
+ /**
59
+ * Get details about authenticators for a user
60
+ *
61
+ * Sign the provided `TGetAuthenticatorsBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_authenticators).
62
+ *
63
+ * See also {@link stampGetAuthenticators}.
64
+ */
65
+ this.getAuthenticators = async (input) => {
66
+ return this.request("/public/v1/query/get_authenticators", input);
67
+ };
68
+ /**
69
+ * Produce a `SignedRequest` from `TGetAuthenticatorsBody` by using the client's `stamp` function.
70
+ *
71
+ * See also {@link GetAuthenticators}.
72
+ */
73
+ this.stampGetAuthenticators = async (input) => {
74
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_authenticators";
75
+ const body = JSON.stringify(input);
76
+ const stamp = await this.stamper.stamp(body);
77
+ return {
78
+ body: body,
79
+ stamp: stamp,
80
+ url: fullUrl,
81
+ };
82
+ };
83
+ /**
84
+ * Get details about an Organization
85
+ *
86
+ * Sign the provided `TGetOrganizationBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_organization).
87
+ *
88
+ * See also {@link stampGetOrganization}.
89
+ */
90
+ this.getOrganization = async (input) => {
91
+ return this.request("/public/v1/query/get_organization", input);
92
+ };
93
+ /**
94
+ * Produce a `SignedRequest` from `TGetOrganizationBody` by using the client's `stamp` function.
95
+ *
96
+ * See also {@link GetOrganization}.
97
+ */
98
+ this.stampGetOrganization = async (input) => {
99
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_organization";
100
+ const body = JSON.stringify(input);
101
+ const stamp = await this.stamper.stamp(body);
102
+ return {
103
+ body: body,
104
+ stamp: stamp,
105
+ url: fullUrl,
106
+ };
107
+ };
108
+ /**
109
+ * Get details about a Policy
110
+ *
111
+ * Sign the provided `TGetPolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_policy).
112
+ *
113
+ * See also {@link stampGetPolicy}.
114
+ */
115
+ this.getPolicy = async (input) => {
116
+ return this.request("/public/v1/query/get_policy", input);
117
+ };
118
+ /**
119
+ * Produce a `SignedRequest` from `TGetPolicyBody` by using the client's `stamp` function.
120
+ *
121
+ * See also {@link GetPolicy}.
122
+ */
123
+ this.stampGetPolicy = async (input) => {
124
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_policy";
125
+ const body = JSON.stringify(input);
126
+ const stamp = await this.stamper.stamp(body);
127
+ return {
128
+ body: body,
129
+ stamp: stamp,
130
+ url: fullUrl,
131
+ };
132
+ };
133
+ /**
134
+ * Get details about a Private Key
135
+ *
136
+ * Sign the provided `TGetPrivateKeyBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_private_key).
137
+ *
138
+ * See also {@link stampGetPrivateKey}.
139
+ */
140
+ this.getPrivateKey = async (input) => {
141
+ return this.request("/public/v1/query/get_private_key", input);
142
+ };
143
+ /**
144
+ * Produce a `SignedRequest` from `TGetPrivateKeyBody` by using the client's `stamp` function.
145
+ *
146
+ * See also {@link GetPrivateKey}.
147
+ */
148
+ this.stampGetPrivateKey = async (input) => {
149
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_private_key";
150
+ const body = JSON.stringify(input);
151
+ const stamp = await this.stamper.stamp(body);
152
+ return {
153
+ body: body,
154
+ stamp: stamp,
155
+ url: fullUrl,
156
+ };
157
+ };
158
+ /**
159
+ * Get details about a User
160
+ *
161
+ * Sign the provided `TGetUserBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/get_user).
162
+ *
163
+ * See also {@link stampGetUser}.
164
+ */
165
+ this.getUser = async (input) => {
166
+ return this.request("/public/v1/query/get_user", input);
167
+ };
168
+ /**
169
+ * Produce a `SignedRequest` from `TGetUserBody` by using the client's `stamp` function.
170
+ *
171
+ * See also {@link GetUser}.
172
+ */
173
+ this.stampGetUser = async (input) => {
174
+ const fullUrl = this.config.baseUrl + "/public/v1/query/get_user";
175
+ const body = JSON.stringify(input);
176
+ const stamp = await this.stamper.stamp(body);
177
+ return {
178
+ body: body,
179
+ stamp: stamp,
180
+ url: fullUrl,
181
+ };
182
+ };
183
+ /**
184
+ * List all Activities within an Organization
185
+ *
186
+ * Sign the provided `TGetActivitiesBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_activities).
187
+ *
188
+ * See also {@link stampGetActivities}.
189
+ */
190
+ this.getActivities = async (input) => {
191
+ return this.request("/public/v1/query/list_activities", input);
192
+ };
193
+ /**
194
+ * Produce a `SignedRequest` from `TGetActivitiesBody` by using the client's `stamp` function.
195
+ *
196
+ * See also {@link GetActivities}.
197
+ */
198
+ this.stampGetActivities = async (input) => {
199
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_activities";
200
+ const body = JSON.stringify(input);
201
+ const stamp = await this.stamper.stamp(body);
202
+ return {
203
+ body: body,
204
+ stamp: stamp,
205
+ url: fullUrl,
206
+ };
207
+ };
208
+ /**
209
+ * List all Policies within an Organization
210
+ *
211
+ * Sign the provided `TGetPoliciesBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_policies).
212
+ *
213
+ * See also {@link stampGetPolicies}.
214
+ */
215
+ this.getPolicies = async (input) => {
216
+ return this.request("/public/v1/query/list_policies", input);
217
+ };
218
+ /**
219
+ * Produce a `SignedRequest` from `TGetPoliciesBody` by using the client's `stamp` function.
220
+ *
221
+ * See also {@link GetPolicies}.
222
+ */
223
+ this.stampGetPolicies = async (input) => {
224
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_policies";
225
+ const body = JSON.stringify(input);
226
+ const stamp = await this.stamper.stamp(body);
227
+ return {
228
+ body: body,
229
+ stamp: stamp,
230
+ url: fullUrl,
231
+ };
232
+ };
233
+ /**
234
+ * List all Private Keys within an Organization
235
+ *
236
+ * Sign the provided `TGetPrivateKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_private_keys).
237
+ *
238
+ * See also {@link stampGetPrivateKeys}.
239
+ */
240
+ this.getPrivateKeys = async (input) => {
241
+ return this.request("/public/v1/query/list_private_keys", input);
242
+ };
243
+ /**
244
+ * Produce a `SignedRequest` from `TGetPrivateKeysBody` by using the client's `stamp` function.
245
+ *
246
+ * See also {@link GetPrivateKeys}.
247
+ */
248
+ this.stampGetPrivateKeys = async (input) => {
249
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_private_keys";
250
+ const body = JSON.stringify(input);
251
+ const stamp = await this.stamper.stamp(body);
252
+ return {
253
+ body: body,
254
+ stamp: stamp,
255
+ url: fullUrl,
256
+ };
257
+ };
258
+ /**
259
+ * List all Users within an Organization
260
+ *
261
+ * Sign the provided `TGetUsersBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/list_users).
262
+ *
263
+ * See also {@link stampGetUsers}.
264
+ */
265
+ this.getUsers = async (input) => {
266
+ return this.request("/public/v1/query/list_users", input);
267
+ };
268
+ /**
269
+ * Produce a `SignedRequest` from `TGetUsersBody` by using the client's `stamp` function.
270
+ *
271
+ * See also {@link GetUsers}.
272
+ */
273
+ this.stampGetUsers = async (input) => {
274
+ const fullUrl = this.config.baseUrl + "/public/v1/query/list_users";
275
+ const body = JSON.stringify(input);
276
+ const stamp = await this.stamper.stamp(body);
277
+ return {
278
+ body: body,
279
+ stamp: stamp,
280
+ url: fullUrl,
281
+ };
282
+ };
283
+ /**
284
+ * Get basic information about your current API user and your organization
285
+ *
286
+ * Sign the provided `TGetWhoamiBody` with the client's `stamp` function, and submit the request (POST /public/v1/query/whoami).
287
+ *
288
+ * See also {@link stampGetWhoami}.
289
+ */
290
+ this.getWhoami = async (input) => {
291
+ return this.request("/public/v1/query/whoami", input);
292
+ };
293
+ /**
294
+ * Produce a `SignedRequest` from `TGetWhoamiBody` by using the client's `stamp` function.
295
+ *
296
+ * See also {@link GetWhoami}.
297
+ */
298
+ this.stampGetWhoami = async (input) => {
299
+ const fullUrl = this.config.baseUrl + "/public/v1/query/whoami";
300
+ const body = JSON.stringify(input);
301
+ const stamp = await this.stamper.stamp(body);
302
+ return {
303
+ body: body,
304
+ stamp: stamp,
305
+ url: fullUrl,
306
+ };
307
+ };
308
+ /**
309
+ * Approve an Activity
310
+ *
311
+ * Sign the provided `TApproveActivityBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/approve_activity).
312
+ *
313
+ * See also {@link stampApproveActivity}.
314
+ */
315
+ this.approveActivity = async (input) => {
316
+ return this.request("/public/v1/submit/approve_activity", input);
317
+ };
318
+ /**
319
+ * Produce a `SignedRequest` from `TApproveActivityBody` by using the client's `stamp` function.
320
+ *
321
+ * See also {@link ApproveActivity}.
322
+ */
323
+ this.stampApproveActivity = async (input) => {
324
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/approve_activity";
325
+ const body = JSON.stringify(input);
326
+ const stamp = await this.stamper.stamp(body);
327
+ return {
328
+ body: body,
329
+ stamp: stamp,
330
+ url: fullUrl,
331
+ };
332
+ };
333
+ /**
334
+ * Add api keys to an existing User
335
+ *
336
+ * Sign the provided `TCreateApiKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_api_keys).
337
+ *
338
+ * See also {@link stampCreateApiKeys}.
339
+ */
340
+ this.createApiKeys = async (input) => {
341
+ return this.request("/public/v1/submit/create_api_keys", input);
342
+ };
343
+ /**
344
+ * Produce a `SignedRequest` from `TCreateApiKeysBody` by using the client's `stamp` function.
345
+ *
346
+ * See also {@link CreateApiKeys}.
347
+ */
348
+ this.stampCreateApiKeys = async (input) => {
349
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_api_keys";
350
+ const body = JSON.stringify(input);
351
+ const stamp = await this.stamper.stamp(body);
352
+ return {
353
+ body: body,
354
+ stamp: stamp,
355
+ url: fullUrl,
356
+ };
357
+ };
358
+ /**
359
+ * Create API-only Users in an existing Organization
360
+ *
361
+ * Sign the provided `TCreateApiOnlyUsersBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_api_only_users).
362
+ *
363
+ * See also {@link stampCreateApiOnlyUsers}.
364
+ */
365
+ this.createApiOnlyUsers = async (input) => {
366
+ return this.request("/public/v1/submit/create_api_only_users", input);
367
+ };
368
+ /**
369
+ * Produce a `SignedRequest` from `TCreateApiOnlyUsersBody` by using the client's `stamp` function.
370
+ *
371
+ * See also {@link CreateApiOnlyUsers}.
372
+ */
373
+ this.stampCreateApiOnlyUsers = async (input) => {
374
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_api_only_users";
375
+ const body = JSON.stringify(input);
376
+ const stamp = await this.stamper.stamp(body);
377
+ return {
378
+ body: body,
379
+ stamp: stamp,
380
+ url: fullUrl,
381
+ };
382
+ };
383
+ /**
384
+ * Create Authenticators to authenticate requests to Turnkey
385
+ *
386
+ * Sign the provided `TCreateAuthenticatorsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_authenticators).
387
+ *
388
+ * See also {@link stampCreateAuthenticators}.
389
+ */
390
+ this.createAuthenticators = async (input) => {
391
+ return this.request("/public/v1/submit/create_authenticators", input);
392
+ };
393
+ /**
394
+ * Produce a `SignedRequest` from `TCreateAuthenticatorsBody` by using the client's `stamp` function.
395
+ *
396
+ * See also {@link CreateAuthenticators}.
397
+ */
398
+ this.stampCreateAuthenticators = async (input) => {
399
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_authenticators";
400
+ const body = JSON.stringify(input);
401
+ const stamp = await this.stamper.stamp(body);
402
+ return {
403
+ body: body,
404
+ stamp: stamp,
405
+ url: fullUrl,
406
+ };
407
+ };
408
+ /**
409
+ * Create Invitations to join an existing Organization
410
+ *
411
+ * Sign the provided `TCreateInvitationsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_invitations).
412
+ *
413
+ * See also {@link stampCreateInvitations}.
414
+ */
415
+ this.createInvitations = async (input) => {
416
+ return this.request("/public/v1/submit/create_invitations", input);
417
+ };
418
+ /**
419
+ * Produce a `SignedRequest` from `TCreateInvitationsBody` by using the client's `stamp` function.
420
+ *
421
+ * See also {@link CreateInvitations}.
422
+ */
423
+ this.stampCreateInvitations = async (input) => {
424
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_invitations";
425
+ const body = JSON.stringify(input);
426
+ const stamp = await this.stamper.stamp(body);
427
+ return {
428
+ body: body,
429
+ stamp: stamp,
430
+ url: fullUrl,
431
+ };
432
+ };
433
+ /**
434
+ * Create a new Policy
435
+ *
436
+ * Sign the provided `TCreatePolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_policy).
437
+ *
438
+ * See also {@link stampCreatePolicy}.
439
+ */
440
+ this.createPolicy = async (input) => {
441
+ return this.request("/public/v1/submit/create_policy", input);
442
+ };
443
+ /**
444
+ * Produce a `SignedRequest` from `TCreatePolicyBody` by using the client's `stamp` function.
445
+ *
446
+ * See also {@link CreatePolicy}.
447
+ */
448
+ this.stampCreatePolicy = async (input) => {
449
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_policy";
450
+ const body = JSON.stringify(input);
451
+ const stamp = await this.stamper.stamp(body);
452
+ return {
453
+ body: body,
454
+ stamp: stamp,
455
+ url: fullUrl,
456
+ };
457
+ };
458
+ /**
459
+ * Create a private key tag and add it to private keys.
460
+ *
461
+ * Sign the provided `TCreatePrivateKeyTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_private_key_tag).
462
+ *
463
+ * See also {@link stampCreatePrivateKeyTag}.
464
+ */
465
+ this.createPrivateKeyTag = async (input) => {
466
+ return this.request("/public/v1/submit/create_private_key_tag", input);
467
+ };
468
+ /**
469
+ * Produce a `SignedRequest` from `TCreatePrivateKeyTagBody` by using the client's `stamp` function.
470
+ *
471
+ * See also {@link CreatePrivateKeyTag}.
472
+ */
473
+ this.stampCreatePrivateKeyTag = async (input) => {
474
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_private_key_tag";
475
+ const body = JSON.stringify(input);
476
+ const stamp = await this.stamper.stamp(body);
477
+ return {
478
+ body: body,
479
+ stamp: stamp,
480
+ url: fullUrl,
481
+ };
482
+ };
483
+ /**
484
+ * Create new Private Keys
485
+ *
486
+ * Sign the provided `TCreatePrivateKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_private_keys).
487
+ *
488
+ * See also {@link stampCreatePrivateKeys}.
489
+ */
490
+ this.createPrivateKeys = async (input) => {
491
+ return this.request("/public/v1/submit/create_private_keys", input);
492
+ };
493
+ /**
494
+ * Produce a `SignedRequest` from `TCreatePrivateKeysBody` by using the client's `stamp` function.
495
+ *
496
+ * See also {@link CreatePrivateKeys}.
497
+ */
498
+ this.stampCreatePrivateKeys = async (input) => {
499
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_private_keys";
500
+ const body = JSON.stringify(input);
501
+ const stamp = await this.stamper.stamp(body);
502
+ return {
503
+ body: body,
504
+ stamp: stamp,
505
+ url: fullUrl,
506
+ };
507
+ };
508
+ /**
509
+ * Create a new Sub-Organization
510
+ *
511
+ * Sign the provided `TCreateSubOrganizationBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_sub_organization).
512
+ *
513
+ * See also {@link stampCreateSubOrganization}.
514
+ */
515
+ this.createSubOrganization = async (input) => {
516
+ return this.request("/public/v1/submit/create_sub_organization", input);
517
+ };
518
+ /**
519
+ * Produce a `SignedRequest` from `TCreateSubOrganizationBody` by using the client's `stamp` function.
520
+ *
521
+ * See also {@link CreateSubOrganization}.
522
+ */
523
+ this.stampCreateSubOrganization = async (input) => {
524
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_sub_organization";
525
+ const body = JSON.stringify(input);
526
+ const stamp = await this.stamper.stamp(body);
527
+ return {
528
+ body: body,
529
+ stamp: stamp,
530
+ url: fullUrl,
531
+ };
532
+ };
533
+ /**
534
+ * Create a user tag and add it to users.
535
+ *
536
+ * Sign the provided `TCreateUserTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_user_tag).
537
+ *
538
+ * See also {@link stampCreateUserTag}.
539
+ */
540
+ this.createUserTag = async (input) => {
541
+ return this.request("/public/v1/submit/create_user_tag", input);
542
+ };
543
+ /**
544
+ * Produce a `SignedRequest` from `TCreateUserTagBody` by using the client's `stamp` function.
545
+ *
546
+ * See also {@link CreateUserTag}.
547
+ */
548
+ this.stampCreateUserTag = async (input) => {
549
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_user_tag";
550
+ const body = JSON.stringify(input);
551
+ const stamp = await this.stamper.stamp(body);
552
+ return {
553
+ body: body,
554
+ stamp: stamp,
555
+ url: fullUrl,
556
+ };
557
+ };
558
+ /**
559
+ * Create Users in an existing Organization
560
+ *
561
+ * Sign the provided `TCreateUsersBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/create_users).
562
+ *
563
+ * See also {@link stampCreateUsers}.
564
+ */
565
+ this.createUsers = async (input) => {
566
+ return this.request("/public/v1/submit/create_users", input);
567
+ };
568
+ /**
569
+ * Produce a `SignedRequest` from `TCreateUsersBody` by using the client's `stamp` function.
570
+ *
571
+ * See also {@link CreateUsers}.
572
+ */
573
+ this.stampCreateUsers = async (input) => {
574
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/create_users";
575
+ const body = JSON.stringify(input);
576
+ const stamp = await this.stamper.stamp(body);
577
+ return {
578
+ body: body,
579
+ stamp: stamp,
580
+ url: fullUrl,
581
+ };
582
+ };
583
+ /**
584
+ * Remove api keys from a User
585
+ *
586
+ * Sign the provided `TDeleteApiKeysBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_api_keys).
587
+ *
588
+ * See also {@link stampDeleteApiKeys}.
589
+ */
590
+ this.deleteApiKeys = async (input) => {
591
+ return this.request("/public/v1/submit/delete_api_keys", input);
592
+ };
593
+ /**
594
+ * Produce a `SignedRequest` from `TDeleteApiKeysBody` by using the client's `stamp` function.
595
+ *
596
+ * See also {@link DeleteApiKeys}.
597
+ */
598
+ this.stampDeleteApiKeys = async (input) => {
599
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_api_keys";
600
+ const body = JSON.stringify(input);
601
+ const stamp = await this.stamper.stamp(body);
602
+ return {
603
+ body: body,
604
+ stamp: stamp,
605
+ url: fullUrl,
606
+ };
607
+ };
608
+ /**
609
+ * Remove authenticators from a User
610
+ *
611
+ * Sign the provided `TDeleteAuthenticatorsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_authenticators).
612
+ *
613
+ * See also {@link stampDeleteAuthenticators}.
614
+ */
615
+ this.deleteAuthenticators = async (input) => {
616
+ return this.request("/public/v1/submit/delete_authenticators", input);
617
+ };
618
+ /**
619
+ * Produce a `SignedRequest` from `TDeleteAuthenticatorsBody` by using the client's `stamp` function.
620
+ *
621
+ * See also {@link DeleteAuthenticators}.
622
+ */
623
+ this.stampDeleteAuthenticators = async (input) => {
624
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_authenticators";
625
+ const body = JSON.stringify(input);
626
+ const stamp = await this.stamper.stamp(body);
627
+ return {
628
+ body: body,
629
+ stamp: stamp,
630
+ url: fullUrl,
631
+ };
632
+ };
633
+ /**
634
+ * Delete an existing Invitation
635
+ *
636
+ * Sign the provided `TDeleteInvitationBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_invitations).
637
+ *
638
+ * See also {@link stampDeleteInvitation}.
639
+ */
640
+ this.deleteInvitation = async (input) => {
641
+ return this.request("/public/v1/submit/delete_invitations", input);
642
+ };
643
+ /**
644
+ * Produce a `SignedRequest` from `TDeleteInvitationBody` by using the client's `stamp` function.
645
+ *
646
+ * See also {@link DeleteInvitation}.
647
+ */
648
+ this.stampDeleteInvitation = async (input) => {
649
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_invitations";
650
+ const body = JSON.stringify(input);
651
+ const stamp = await this.stamper.stamp(body);
652
+ return {
653
+ body: body,
654
+ stamp: stamp,
655
+ url: fullUrl,
656
+ };
657
+ };
658
+ /**
659
+ * Delete an existing Policy
660
+ *
661
+ * Sign the provided `TDeletePolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/delete_policy).
662
+ *
663
+ * See also {@link stampDeletePolicy}.
664
+ */
665
+ this.deletePolicy = async (input) => {
666
+ return this.request("/public/v1/submit/delete_policy", input);
667
+ };
668
+ /**
669
+ * Produce a `SignedRequest` from `TDeletePolicyBody` by using the client's `stamp` function.
670
+ *
671
+ * See also {@link DeletePolicy}.
672
+ */
673
+ this.stampDeletePolicy = async (input) => {
674
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/delete_policy";
675
+ const body = JSON.stringify(input);
676
+ const stamp = await this.stamper.stamp(body);
677
+ return {
678
+ body: body,
679
+ stamp: stamp,
680
+ url: fullUrl,
681
+ };
682
+ };
683
+ /**
684
+ * Reject an Activity
685
+ *
686
+ * Sign the provided `TRejectActivityBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/reject_activity).
687
+ *
688
+ * See also {@link stampRejectActivity}.
689
+ */
690
+ this.rejectActivity = async (input) => {
691
+ return this.request("/public/v1/submit/reject_activity", input);
692
+ };
693
+ /**
694
+ * Produce a `SignedRequest` from `TRejectActivityBody` by using the client's `stamp` function.
695
+ *
696
+ * See also {@link RejectActivity}.
697
+ */
698
+ this.stampRejectActivity = async (input) => {
699
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/reject_activity";
700
+ const body = JSON.stringify(input);
701
+ const stamp = await this.stamper.stamp(body);
702
+ return {
703
+ body: body,
704
+ stamp: stamp,
705
+ url: fullUrl,
706
+ };
707
+ };
708
+ /**
709
+ * Sign a raw payload with a Private Key
710
+ *
711
+ * Sign the provided `TSignRawPayloadBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/sign_raw_payload).
712
+ *
713
+ * See also {@link stampSignRawPayload}.
714
+ */
715
+ this.signRawPayload = async (input) => {
716
+ return this.request("/public/v1/submit/sign_raw_payload", input);
717
+ };
718
+ /**
719
+ * Produce a `SignedRequest` from `TSignRawPayloadBody` by using the client's `stamp` function.
720
+ *
721
+ * See also {@link SignRawPayload}.
722
+ */
723
+ this.stampSignRawPayload = async (input) => {
724
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/sign_raw_payload";
725
+ const body = JSON.stringify(input);
726
+ const stamp = await this.stamper.stamp(body);
727
+ return {
728
+ body: body,
729
+ stamp: stamp,
730
+ url: fullUrl,
731
+ };
732
+ };
733
+ /**
734
+ * Sign a transaction with a Private Key
735
+ *
736
+ * Sign the provided `TSignTransactionBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/sign_transaction).
737
+ *
738
+ * See also {@link stampSignTransaction}.
739
+ */
740
+ this.signTransaction = async (input) => {
741
+ return this.request("/public/v1/submit/sign_transaction", input);
742
+ };
743
+ /**
744
+ * Produce a `SignedRequest` from `TSignTransactionBody` by using the client's `stamp` function.
745
+ *
746
+ * See also {@link SignTransaction}.
747
+ */
748
+ this.stampSignTransaction = async (input) => {
749
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/sign_transaction";
750
+ const body = JSON.stringify(input);
751
+ const stamp = await this.stamper.stamp(body);
752
+ return {
753
+ body: body,
754
+ stamp: stamp,
755
+ url: fullUrl,
756
+ };
757
+ };
758
+ /**
759
+ * Update the allowable origins for credentials and requests
760
+ *
761
+ * Sign the provided `TUpdateAllowedOriginsBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_allowed_origins).
762
+ *
763
+ * See also {@link stampUpdateAllowedOrigins}.
764
+ */
765
+ this.updateAllowedOrigins = async (input) => {
766
+ return this.request("/public/v1/submit/update_allowed_origins", input);
767
+ };
768
+ /**
769
+ * Produce a `SignedRequest` from `TUpdateAllowedOriginsBody` by using the client's `stamp` function.
770
+ *
771
+ * See also {@link UpdateAllowedOrigins}.
772
+ */
773
+ this.stampUpdateAllowedOrigins = async (input) => {
774
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_allowed_origins";
775
+ const body = JSON.stringify(input);
776
+ const stamp = await this.stamper.stamp(body);
777
+ return {
778
+ body: body,
779
+ stamp: stamp,
780
+ url: fullUrl,
781
+ };
782
+ };
783
+ /**
784
+ * Update an existing Policy
785
+ *
786
+ * Sign the provided `TUpdatePolicyBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_policy).
787
+ *
788
+ * See also {@link stampUpdatePolicy}.
789
+ */
790
+ this.updatePolicy = async (input) => {
791
+ return this.request("/public/v1/submit/update_policy", input);
792
+ };
793
+ /**
794
+ * Produce a `SignedRequest` from `TUpdatePolicyBody` by using the client's `stamp` function.
795
+ *
796
+ * See also {@link UpdatePolicy}.
797
+ */
798
+ this.stampUpdatePolicy = async (input) => {
799
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_policy";
800
+ const body = JSON.stringify(input);
801
+ const stamp = await this.stamper.stamp(body);
802
+ return {
803
+ body: body,
804
+ stamp: stamp,
805
+ url: fullUrl,
806
+ };
807
+ };
808
+ /**
809
+ * 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.
810
+ *
811
+ * Sign the provided `TUpdatePrivateKeyTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_private_key_tag).
812
+ *
813
+ * See also {@link stampUpdatePrivateKeyTag}.
814
+ */
815
+ this.updatePrivateKeyTag = async (input) => {
816
+ return this.request("/public/v1/submit/update_private_key_tag", input);
817
+ };
818
+ /**
819
+ * Produce a `SignedRequest` from `TUpdatePrivateKeyTagBody` by using the client's `stamp` function.
820
+ *
821
+ * See also {@link UpdatePrivateKeyTag}.
822
+ */
823
+ this.stampUpdatePrivateKeyTag = async (input) => {
824
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_private_key_tag";
825
+ const body = JSON.stringify(input);
826
+ const stamp = await this.stamper.stamp(body);
827
+ return {
828
+ body: body,
829
+ stamp: stamp,
830
+ url: fullUrl,
831
+ };
832
+ };
833
+ /**
834
+ * Set the threshold and members of the root quorum. This must be approved by the current root quorum.
835
+ *
836
+ * Sign the provided `TUpdateRootQuorumBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_root_quorum).
837
+ *
838
+ * See also {@link stampUpdateRootQuorum}.
839
+ */
840
+ this.updateRootQuorum = async (input) => {
841
+ return this.request("/public/v1/submit/update_root_quorum", input);
842
+ };
843
+ /**
844
+ * Produce a `SignedRequest` from `TUpdateRootQuorumBody` by using the client's `stamp` function.
845
+ *
846
+ * See also {@link UpdateRootQuorum}.
847
+ */
848
+ this.stampUpdateRootQuorum = async (input) => {
849
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_root_quorum";
850
+ const body = JSON.stringify(input);
851
+ const stamp = await this.stamper.stamp(body);
852
+ return {
853
+ body: body,
854
+ stamp: stamp,
855
+ url: fullUrl,
856
+ };
857
+ };
858
+ /**
859
+ * Update a User in an existing Organization
860
+ *
861
+ * Sign the provided `TUpdateUserBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_user).
862
+ *
863
+ * See also {@link stampUpdateUser}.
864
+ */
865
+ this.updateUser = async (input) => {
866
+ return this.request("/public/v1/submit/update_user", input);
867
+ };
868
+ /**
869
+ * Produce a `SignedRequest` from `TUpdateUserBody` by using the client's `stamp` function.
870
+ *
871
+ * See also {@link UpdateUser}.
872
+ */
873
+ this.stampUpdateUser = async (input) => {
874
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_user";
875
+ const body = JSON.stringify(input);
876
+ const stamp = await this.stamper.stamp(body);
877
+ return {
878
+ body: body,
879
+ stamp: stamp,
880
+ url: fullUrl,
881
+ };
882
+ };
883
+ /**
884
+ * 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.
885
+ *
886
+ * Sign the provided `TUpdateUserTagBody` with the client's `stamp` function, and submit the request (POST /public/v1/submit/update_user_tag).
887
+ *
888
+ * See also {@link stampUpdateUserTag}.
889
+ */
890
+ this.updateUserTag = async (input) => {
891
+ return this.request("/public/v1/submit/update_user_tag", input);
892
+ };
893
+ /**
894
+ * Produce a `SignedRequest` from `TUpdateUserTagBody` by using the client's `stamp` function.
895
+ *
896
+ * See also {@link UpdateUserTag}.
897
+ */
898
+ this.stampUpdateUserTag = async (input) => {
899
+ const fullUrl = this.config.baseUrl + "/public/v1/submit/update_user_tag";
900
+ const body = JSON.stringify(input);
901
+ const stamp = await this.stamper.stamp(body);
902
+ return {
903
+ body: body,
904
+ stamp: stamp,
905
+ url: fullUrl,
906
+ };
907
+ };
908
+ this.config = config;
909
+ this.stamper = stamper;
910
+ }
911
+ async request(url, body) {
912
+ const fullUrl = this.config.baseUrl + url;
913
+ const stringifiedBody = JSON.stringify(body);
914
+ const stamp = await this.stamper.stamp(stringifiedBody);
915
+ const response = await (0, base_1.fetch)(fullUrl, {
916
+ method: "POST",
917
+ headers: {
918
+ [stamp.stampHeaderName]: stamp.stampHeaderValue,
919
+ },
920
+ body: stringifiedBody,
921
+ redirect: "follow",
922
+ });
923
+ if (!response.ok) {
924
+ let res;
925
+ try {
926
+ res = await response.json();
927
+ }
928
+ catch (_) {
929
+ throw new Error(`${response.status} ${response.statusText}`);
930
+ }
931
+ throw new base_1.TurnkeyRequestError(res);
932
+ }
933
+ const data = await response.json();
934
+ return data;
935
+ }
936
+ }
937
+ exports.TurnkeyClient = TurnkeyClient;
938
+ //# sourceMappingURL=public_api.client.js.map