@dfns/sdk 0.8.21 → 0.8.24

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.
@@ -3,12 +3,17 @@ import * as T from './types';
3
3
  export declare class SignersClient {
4
4
  private apiOptions;
5
5
  constructor(apiOptions: DfnsApiClientOptions);
6
+ createAddMacUserInput(request: T.CreateAddMacUserInputRequest): Promise<T.CreateAddMacUserInputResponse>;
6
7
  createCloneInput(request: T.CreateCloneInputRequest): Promise<T.CreateCloneInputResponse>;
7
8
  createGenesisInput(request: T.CreateGenesisInputRequest): Promise<T.CreateGenesisInputResponse>;
8
9
  createOnchainSignInput(request: T.CreateOnchainSignInputRequest): Promise<T.CreateOnchainSignInputResponse>;
9
10
  createProofOfControlInput(request: T.CreateProofOfControlInputRequest): Promise<T.CreateProofOfControlInputResponse>;
10
11
  listKeyStores(): Promise<T.ListKeyStoresResponse>;
11
12
  listSigners(): Promise<T.ListSignersResponse>;
13
+ submitAddMacUserOutput(request: T.SubmitAddMacUserOutputRequest, file: {
14
+ bytes: Uint8Array;
15
+ name?: string;
16
+ }): Promise<T.SubmitAddMacUserOutputResponse>;
12
17
  submitCloneOutput(request: T.SubmitCloneOutputRequest, file: {
13
18
  bytes: Uint8Array;
14
19
  name?: string;
@@ -9,6 +9,18 @@ class SignersClient {
9
9
  constructor(apiOptions) {
10
10
  this.apiOptions = apiOptions;
11
11
  }
12
+ async createAddMacUserInput(request) {
13
+ const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/add-mac-user/input', {
14
+ path: request ?? {},
15
+ query: {},
16
+ });
17
+ const response = await (0, userActionFetch_1.userActionFetch)(path, {
18
+ method: 'POST',
19
+ body: request.body,
20
+ apiOptions: this.apiOptions,
21
+ });
22
+ return response.json();
23
+ }
12
24
  async createCloneInput(request) {
13
25
  const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/clone/input', {
14
26
  path: request ?? {},
@@ -79,6 +91,19 @@ class SignersClient {
79
91
  });
80
92
  return response.json();
81
93
  }
94
+ async submitAddMacUserOutput(request, file) {
95
+ const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/add-mac-user/output', {
96
+ path: request ?? {},
97
+ query: {},
98
+ });
99
+ const response = await (0, userActionFetch_1.userActionFetch)(path, {
100
+ method: 'POST',
101
+ body: request.body,
102
+ file,
103
+ apiOptions: this.apiOptions,
104
+ });
105
+ return response.json();
106
+ }
82
107
  async submitCloneOutput(request, file) {
83
108
  const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/clone/output', {
84
109
  path: request ?? {},
@@ -4,6 +4,8 @@ import * as T from './types';
4
4
  export declare class DelegatedSignersClient {
5
5
  private apiOptions;
6
6
  constructor(apiOptions: DfnsDelegatedApiClientOptions);
7
+ createAddMacUserInputInit(request: T.CreateAddMacUserInputRequest): Promise<UserActionChallengeResponse>;
8
+ createAddMacUserInputComplete(request: T.CreateAddMacUserInputRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateAddMacUserInputResponse>;
7
9
  createCloneInputInit(request: T.CreateCloneInputRequest): Promise<UserActionChallengeResponse>;
8
10
  createCloneInputComplete(request: T.CreateCloneInputRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateCloneInputResponse>;
9
11
  createGenesisInputInit(request: T.CreateGenesisInputRequest): Promise<UserActionChallengeResponse>;
@@ -8,6 +8,33 @@ class DelegatedSignersClient {
8
8
  constructor(apiOptions) {
9
9
  this.apiOptions = apiOptions;
10
10
  }
11
+ async createAddMacUserInputInit(request) {
12
+ const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/add-mac-user/input', {
13
+ path: request ?? {},
14
+ query: {},
15
+ });
16
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
17
+ userActionHttpMethod: 'POST',
18
+ userActionHttpPath: path,
19
+ userActionPayload: JSON.stringify(request.body),
20
+ userActionServerKind: 'Api',
21
+ }, this.apiOptions);
22
+ return challenge;
23
+ }
24
+ async createAddMacUserInputComplete(request, signedChallenge) {
25
+ const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/add-mac-user/input', {
26
+ path: request ?? {},
27
+ query: {},
28
+ });
29
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
30
+ const response = await (0, fetch_1.simpleFetch)(path, {
31
+ method: 'POST',
32
+ body: request.body,
33
+ headers: { 'x-dfns-useraction': userAction },
34
+ apiOptions: this.apiOptions,
35
+ });
36
+ return response.json();
37
+ }
11
38
  async createCloneInputInit(request) {
12
39
  const path = (0, url_1.buildPathAndQuery)('/key-stores/:storeId/clone/input', {
13
40
  path: request ?? {},
@@ -1,7 +1,20 @@
1
+ export type CreateAddMacUserInputBody = {
2
+ kind: "AddMacUser";
3
+ macTargetSerial: string;
4
+ hsmTargetSerial: string;
5
+ };
6
+ export type CreateAddMacUserInputParams = {
7
+ storeId: string;
8
+ };
9
+ export type CreateAddMacUserInputResponse = string;
10
+ export type CreateAddMacUserInputRequest = CreateAddMacUserInputParams & {
11
+ body: CreateAddMacUserInputBody;
12
+ };
1
13
  export type CreateCloneInputBody = {
2
14
  kind: "Clone";
3
15
  hsmSourceSerial: string;
4
16
  hsmTargetSerial: string;
17
+ macTargetSerial?: string | undefined;
5
18
  };
6
19
  export type CreateCloneInputParams = {
7
20
  storeId: string;
@@ -16,6 +29,7 @@ export type CreateGenesisInputBody = {
16
29
  numSecp256k1: number;
17
30
  numEd25519: number;
18
31
  hsmGenesisSerial: string;
32
+ macGenesisSerial?: string | undefined;
19
33
  hsmGenesisFirmwareVersion?: ("2.2" | "2.4") | undefined;
20
34
  };
21
35
  export type CreateGenesisInputParams = {
@@ -60,6 +74,73 @@ export type ListSignersResponse = {
60
74
  }[];
61
75
  }[];
62
76
  };
77
+ export type __WireSubmitAddMacUserOutputBody = {
78
+ fileChecksum: string;
79
+ outputJson: {
80
+ type: "fleet-output";
81
+ version: 1;
82
+ status: "success";
83
+ org_id: string;
84
+ fleet_id: string;
85
+ fleet_label: string;
86
+ keystore_id: string;
87
+ group_id: string;
88
+ online_domain: string;
89
+ governance?: {
90
+ [x: string]: unknown;
91
+ } | undefined;
92
+ outputs: {
93
+ [x: string]: {
94
+ success: {
95
+ type: "genesis-registration";
96
+ ceremony_mode?: string | undefined;
97
+ hsm_serial: string;
98
+ hsm_identity_key: string;
99
+ mac_serial: string;
100
+ mac_se_wrap_key_pub_key: string;
101
+ provisioners: {
102
+ [x: string]: string;
103
+ };
104
+ hsm_sealed?: unknown | null;
105
+ key_harvest: {
106
+ "ed25519-start": number;
107
+ ed25519: number;
108
+ error: string | null;
109
+ "secp256k1-start": number;
110
+ secp256k1: number;
111
+ };
112
+ } | {
113
+ type: "clone-registration";
114
+ ceremony_mode?: string | undefined;
115
+ hsm_target_serial: string;
116
+ hsm_identity_key: string;
117
+ mac_target_serial: string;
118
+ mac_se_wrap_key_pub_key: string;
119
+ hsm_sealed?: unknown | null;
120
+ } | {
121
+ type: "add-mac-user";
122
+ ceremony_mode?: string | undefined;
123
+ hsm_target_serial: string;
124
+ hsm_identity_key: string;
125
+ mac_target_serial: string;
126
+ mac_username?: string | undefined;
127
+ mac_se_wrap_key_pub_key: string;
128
+ hsm_sealed?: unknown | null;
129
+ };
130
+ };
131
+ };
132
+ };
133
+ };
134
+ export type SubmitAddMacUserOutputBody = Omit<__WireSubmitAddMacUserOutputBody, 'fileChecksum'>;
135
+ export type SubmitAddMacUserOutputParams = {
136
+ storeId: string;
137
+ };
138
+ export type SubmitAddMacUserOutputResponse = {
139
+ message: string;
140
+ };
141
+ export type SubmitAddMacUserOutputRequest = SubmitAddMacUserOutputParams & {
142
+ body: SubmitAddMacUserOutputBody;
143
+ };
63
144
  export type __WireSubmitCloneOutputBody = {
64
145
  fileChecksum: string;
65
146
  outputJson: {
@@ -70,11 +151,16 @@ export type __WireSubmitCloneOutputBody = {
70
151
  fleet_id: string;
71
152
  fleet_label: string;
72
153
  keystore_id: string;
154
+ group_id: string;
155
+ online_domain: string;
156
+ governance?: {
157
+ [x: string]: unknown;
158
+ } | undefined;
73
159
  outputs: {
74
160
  [x: string]: {
75
161
  success: {
76
162
  type: "genesis-registration";
77
- ceremony_mode: string;
163
+ ceremony_mode?: string | undefined;
78
164
  hsm_serial: string;
79
165
  hsm_identity_key: string;
80
166
  mac_serial: string;
@@ -92,12 +178,21 @@ export type __WireSubmitCloneOutputBody = {
92
178
  };
93
179
  } | {
94
180
  type: "clone-registration";
95
- ceremony_mode: string;
181
+ ceremony_mode?: string | undefined;
96
182
  hsm_target_serial: string;
97
183
  hsm_identity_key: string;
98
184
  mac_target_serial: string;
99
185
  mac_se_wrap_key_pub_key: string;
100
186
  hsm_sealed?: unknown | null;
187
+ } | {
188
+ type: "add-mac-user";
189
+ ceremony_mode?: string | undefined;
190
+ hsm_target_serial: string;
191
+ hsm_identity_key: string;
192
+ mac_target_serial: string;
193
+ mac_username?: string | undefined;
194
+ mac_se_wrap_key_pub_key: string;
195
+ hsm_sealed?: unknown | null;
101
196
  };
102
197
  };
103
198
  };
@@ -123,11 +218,16 @@ export type __WireSubmitGenesisOutputBody = {
123
218
  fleet_id: string;
124
219
  fleet_label: string;
125
220
  keystore_id: string;
221
+ group_id: string;
222
+ online_domain: string;
223
+ governance?: {
224
+ [x: string]: unknown;
225
+ } | undefined;
126
226
  outputs: {
127
227
  [x: string]: {
128
228
  success: {
129
229
  type: "genesis-registration";
130
- ceremony_mode: string;
230
+ ceremony_mode?: string | undefined;
131
231
  hsm_serial: string;
132
232
  hsm_identity_key: string;
133
233
  mac_serial: string;
@@ -145,10 +245,19 @@ export type __WireSubmitGenesisOutputBody = {
145
245
  };
146
246
  } | {
147
247
  type: "clone-registration";
148
- ceremony_mode: string;
248
+ ceremony_mode?: string | undefined;
249
+ hsm_target_serial: string;
250
+ hsm_identity_key: string;
251
+ mac_target_serial: string;
252
+ mac_se_wrap_key_pub_key: string;
253
+ hsm_sealed?: unknown | null;
254
+ } | {
255
+ type: "add-mac-user";
256
+ ceremony_mode?: string | undefined;
149
257
  hsm_target_serial: string;
150
258
  hsm_identity_key: string;
151
259
  mac_target_serial: string;
260
+ mac_username?: string | undefined;
152
261
  mac_se_wrap_key_pub_key: string;
153
262
  hsm_sealed?: unknown | null;
154
263
  };