@azure-rest/confidential-ledger 1.0.0-alpha.20220527.1 → 1.0.0-alpha.20220712.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.
@@ -1,103 +1,116 @@
1
1
  import { Client } from '@azure-rest/core-client';
2
2
  import { ClientOptions } from '@azure-rest/core-client';
3
3
  import { HttpResponse } from '@azure-rest/core-client';
4
+ import { PagedAsyncIterableIterator } from '@azure/core-paging';
5
+ import { PathUncheckedResponse } from '@azure-rest/core-client';
4
6
  import { RawHttpHeaders } from '@azure/core-rest-pipeline';
5
7
  import { RequestParameters } from '@azure-rest/core-client';
8
+ import { StreamableMethod } from '@azure-rest/core-client';
6
9
  import { TokenCredential } from '@azure/core-auth';
7
10
 
8
- declare function ConfidentialLedger(ledgerBaseUrl: string, ledgerTlsCertificate: string, options?: ClientOptions): ConfidentialLedgerRestClient;
11
+ export declare interface CollectionOutput {
12
+ collectionId: string;
13
+ }
14
+
15
+ export declare interface CollectionsOutput {
16
+ /** A list of identifiers for ledger collections. */
17
+ collections: Array<CollectionOutput>;
18
+ }
19
+
20
+ declare function ConfidentialLedger(ledgerBaseUrl: string, ledgerIdentityCertificate: string, options?: ClientOptions): ConfidentialLedgerClient;
9
21
 
10
- declare function ConfidentialLedger(ledgerBaseUrl: string, ledgerTlsCertificate: string, credentials: TokenCredential, options?: ClientOptions): ConfidentialLedgerRestClient;
22
+ declare function ConfidentialLedger(ledgerBaseUrl: string, ledgerIdentityCertificate: string, credentials: TokenCredential, options?: ClientOptions): ConfidentialLedgerClient;
11
23
  export default ConfidentialLedger;
12
24
 
13
- export declare interface ConfidentialLedgerEnclaves {
25
+ export declare type ConfidentialLedgerClient = Client & {
26
+ path: Routes;
27
+ };
28
+
29
+ export declare interface ConfidentialLedgerEnclavesOutput {
14
30
  /** Id of the Confidential Ledger node responding to the request. */
15
31
  currentNodeId: string;
16
32
  /** Dictionary of enclave quotes, indexed by node id. */
17
- enclaveQuotes: EnclaveQuotesDictionary;
33
+ enclaveQuotes: Record<string, EnclaveQuoteOutput>;
18
34
  }
19
35
 
20
- export declare interface ConfidentialLedgerError {
21
- /** An error response from Confidential Ledger. */
22
- error?: ConfidentialLedgerErrorBody;
23
- }
24
-
25
- export declare interface ConfidentialLedgerErrorBody {
36
+ export declare interface ConfidentialLedgerErrorBodyOutput {
26
37
  /** The error code. */
27
38
  code?: string;
28
39
  /** The error message. */
29
40
  message?: string;
30
- /** An error response from Confidential Ledger. */
31
- innerError?: ConfidentialLedgerErrorBody;
32
41
  }
33
42
 
34
- export declare type ConfidentialLedgerQueryState = "Loading" | "Ready";
35
-
36
- export declare type ConfidentialLedgerRestClient = Client & {
37
- path: Routes;
38
- };
39
-
40
- export declare type ConfidentialLedgerUserRoleName = "Administrator" | "Contributor" | "Reader";
41
-
42
- export declare interface Consortium {
43
- members: ConsortiumMember[];
43
+ export declare interface ConfidentialLedgerErrorOutput {
44
+ /** An error response from Confidential Ledger. */
45
+ error?: ConfidentialLedgerErrorBodyOutput;
44
46
  }
45
47
 
46
- export declare interface ConsortiumMember {
48
+ export declare interface ConsortiumMemberOutput {
47
49
  /** PEM-encoded certificate associated with the member. */
48
50
  certificate: string;
49
51
  /** Identifier assigned to the member. */
50
52
  id: string;
51
53
  }
52
54
 
53
- export declare interface Constitution {
55
+ export declare interface ConsortiumOutput {
56
+ members: Array<ConsortiumMemberOutput>;
57
+ }
58
+
59
+ export declare interface ConstitutionOutput {
54
60
  /** SHA256 digest of the constitution script. */
55
61
  digest: string;
56
62
  /** Contents of the constitution. */
57
63
  script: string;
58
64
  }
59
65
 
60
- export declare interface CreateOrUpdateUser {
61
- /** Deletes a user from the Confidential Ledger. */
62
- delete(options?: DeleteUserParameters): Promise<DeleteUser204Response | DeleteUserdefaultResponse>;
63
- /** Gets a user. */
64
- get(options?: GetUserParameters): Promise<GetUser200Response | GetUserdefaultResponse>;
65
- /** A JSON merge patch is applied for existing users */
66
- patch(options: CreateOrUpdateUserParameters): Promise<CreateOrUpdateUser200Response | CreateOrUpdateUserdefaultResponse>;
67
- }
68
-
69
66
  /** A JSON merge patch is applied for existing users */
70
67
  export declare interface CreateOrUpdateUser200Response extends HttpResponse {
71
68
  status: "200";
72
- body: LedgerUser;
69
+ body: LedgerUserOutput;
73
70
  }
74
71
 
75
72
  export declare interface CreateOrUpdateUserBodyParam {
73
+ /** Details about a Confidential Ledger user. */
76
74
  body: LedgerUser;
77
75
  }
78
76
 
79
77
  /** A JSON merge patch is applied for existing users */
80
78
  export declare interface CreateOrUpdateUserdefaultResponse extends HttpResponse {
81
- status: "500";
82
- body: ConfidentialLedgerError;
79
+ status: string;
80
+ body: ConfidentialLedgerErrorOutput;
81
+ }
82
+
83
+ export declare interface CreateOrUpdateUserMediaTypesParam {
84
+ /** Request content type */
85
+ contentType?: "application/merge-patch+json";
83
86
  }
84
87
 
85
- export declare type CreateOrUpdateUserParameters = RequestParameters & CreateOrUpdateUserBodyParam;
88
+ export declare type CreateOrUpdateUserParameters = CreateOrUpdateUserMediaTypesParam & CreateOrUpdateUserBodyParam & RequestParameters;
89
+
90
+ export declare interface DeleteUser {
91
+ /** Deletes a user from the Confidential Ledger. */
92
+ delete(options?: DeleteUserParameters): StreamableMethod<DeleteUser204Response | DeleteUserdefaultResponse>;
93
+ /** Gets a user. */
94
+ get(options?: GetUserParameters): StreamableMethod<GetUser200Response | GetUserdefaultResponse>;
95
+ /** A JSON merge patch is applied for existing users */
96
+ patch(options: CreateOrUpdateUserParameters): StreamableMethod<CreateOrUpdateUser200Response | CreateOrUpdateUserdefaultResponse>;
97
+ }
86
98
 
87
99
  /** Deletes a user from the Confidential Ledger. */
88
100
  export declare interface DeleteUser204Response extends HttpResponse {
89
101
  status: "204";
102
+ body: Record<string, unknown>;
90
103
  }
91
104
 
92
105
  /** Deletes a user from the Confidential Ledger. */
93
106
  export declare interface DeleteUserdefaultResponse extends HttpResponse {
94
- status: "500";
95
- body: ConfidentialLedgerError;
107
+ status: string;
108
+ body: ConfidentialLedgerErrorOutput;
96
109
  }
97
110
 
98
111
  export declare type DeleteUserParameters = RequestParameters;
99
112
 
100
- export declare interface EnclaveQuote {
113
+ export declare interface EnclaveQuoteOutput {
101
114
  /** ID assigned to this node. */
102
115
  nodeId: string;
103
116
  /** MRENCLAVE value of the code running in the enclave. */
@@ -108,184 +121,168 @@ export declare interface EnclaveQuote {
108
121
  raw: string;
109
122
  }
110
123
 
111
- export declare type EnclaveQuotesDictionary = Record<string, EnclaveQuote>;
124
+ /**
125
+ * Helper type to extract the type of an array
126
+ */
127
+ export declare type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
112
128
 
113
129
  export declare interface GetConsortiumMembers {
114
130
  /** Consortium members can manage the Confidential Ledger. */
115
- get(options?: GetConsortiumMembersParameters): Promise<GetConsortiumMembers200Response | GetConsortiumMembersdefaultResponse>;
131
+ get(options?: GetConsortiumMembersParameters): StreamableMethod<GetConsortiumMembers200Response | GetConsortiumMembersdefaultResponse>;
116
132
  }
117
133
 
118
134
  /** Consortium members can manage the Confidential Ledger. */
119
135
  export declare interface GetConsortiumMembers200Response extends HttpResponse {
120
136
  status: "200";
121
- body: Consortium;
137
+ body: ConsortiumOutput;
122
138
  }
123
139
 
124
140
  /** Consortium members can manage the Confidential Ledger. */
125
141
  export declare interface GetConsortiumMembersdefaultResponse extends HttpResponse {
126
- status: "500";
127
- body: ConfidentialLedgerError;
142
+ status: string;
143
+ body: ConfidentialLedgerErrorOutput;
128
144
  }
129
145
 
130
146
  export declare type GetConsortiumMembersParameters = RequestParameters;
131
147
 
132
148
  export declare interface GetConstitution {
133
149
  /** The constitution is a script that assesses and applies proposals from consortium members. */
134
- get(options?: GetConstitutionParameters): Promise<GetConstitution200Response | GetConstitutiondefaultResponse>;
150
+ get(options?: GetConstitutionParameters): StreamableMethod<GetConstitution200Response | GetConstitutiondefaultResponse>;
135
151
  }
136
152
 
137
153
  /** The constitution is a script that assesses and applies proposals from consortium members. */
138
154
  export declare interface GetConstitution200Response extends HttpResponse {
139
155
  status: "200";
140
- body: Constitution;
156
+ body: ConstitutionOutput;
141
157
  }
142
158
 
143
159
  /** The constitution is a script that assesses and applies proposals from consortium members. */
144
160
  export declare interface GetConstitutiondefaultResponse extends HttpResponse {
145
- status: "500";
146
- body: ConfidentialLedgerError;
161
+ status: string;
162
+ body: ConfidentialLedgerErrorOutput;
147
163
  }
148
164
 
149
165
  export declare type GetConstitutionParameters = RequestParameters;
150
166
 
151
167
  export declare interface GetCurrentLedgerEntry {
152
- /** A sub-ledger id may optionally be specified. */
153
- get(options?: GetCurrentLedgerEntryParameters): Promise<GetCurrentLedgerEntry200Response | GetCurrentLedgerEntrydefaultResponse>;
168
+ /** A collection id may optionally be specified. */
169
+ get(options?: GetCurrentLedgerEntryParameters): StreamableMethod<GetCurrentLedgerEntry200Response | GetCurrentLedgerEntrydefaultResponse>;
154
170
  }
155
171
 
156
- /** A sub-ledger id may optionally be specified. */
172
+ /** A collection id may optionally be specified. */
157
173
  export declare interface GetCurrentLedgerEntry200Response extends HttpResponse {
158
174
  status: "200";
159
- body: LedgerEntry;
175
+ body: LedgerEntryOutput;
160
176
  }
161
177
 
162
- /** A sub-ledger id may optionally be specified. */
178
+ /** A collection id may optionally be specified. */
163
179
  export declare interface GetCurrentLedgerEntrydefaultResponse extends HttpResponse {
164
- status: "500";
165
- body: ConfidentialLedgerError;
180
+ status: string;
181
+ body: ConfidentialLedgerErrorOutput;
166
182
  }
167
183
 
168
- export declare type GetCurrentLedgerEntryParameters = RequestParameters & GetCurrentLedgerEntryQueryParam;
184
+ export declare type GetCurrentLedgerEntryParameters = GetCurrentLedgerEntryQueryParam & RequestParameters;
169
185
 
170
186
  export declare interface GetCurrentLedgerEntryQueryParam {
171
187
  queryParameters?: GetCurrentLedgerEntryQueryParamProperties;
172
188
  }
173
189
 
174
190
  export declare interface GetCurrentLedgerEntryQueryParamProperties {
175
- /** The sub-ledger id. */
176
- subLedgerId?: string;
191
+ /** The collection id. */
192
+ collectionId?: string;
177
193
  }
178
194
 
179
195
  export declare interface GetEnclaveQuotes {
180
196
  /** A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave. */
181
- get(options?: GetEnclaveQuotesParameters): Promise<GetEnclaveQuotes200Response | GetEnclaveQuotesdefaultResponse>;
197
+ get(options?: GetEnclaveQuotesParameters): StreamableMethod<GetEnclaveQuotes200Response | GetEnclaveQuotesdefaultResponse>;
182
198
  }
183
199
 
184
200
  /** A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave. */
185
201
  export declare interface GetEnclaveQuotes200Response extends HttpResponse {
186
202
  status: "200";
187
- body: ConfidentialLedgerEnclaves;
203
+ body: ConfidentialLedgerEnclavesOutput;
188
204
  }
189
205
 
190
206
  /** A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave. */
191
207
  export declare interface GetEnclaveQuotesdefaultResponse extends HttpResponse {
192
- status: "500";
193
- body: ConfidentialLedgerError;
208
+ status: string;
209
+ body: ConfidentialLedgerErrorOutput;
194
210
  }
195
211
 
196
212
  export declare type GetEnclaveQuotesParameters = RequestParameters;
197
213
 
198
- /** A sub-ledger id may optionally be specified. Only entries in the specified (or default) sub-ledger will be returned. */
199
- export declare interface GetLedgerEntries200Response extends HttpResponse {
200
- status: "200";
201
- body: PagedLedgerEntries;
202
- }
203
-
204
- /** A sub-ledger id may optionally be specified. Only entries in the specified (or default) sub-ledger will be returned. */
205
- export declare interface GetLedgerEntriesdefaultResponse extends HttpResponse {
206
- status: "500";
207
- body: ConfidentialLedgerError;
208
- }
209
-
210
- export declare type GetLedgerEntriesParameters = RequestParameters & GetLedgerEntriesQueryParam;
211
-
212
- export declare interface GetLedgerEntriesQueryParam {
213
- queryParameters?: GetLedgerEntriesQueryParamProperties;
214
- }
215
-
216
- export declare interface GetLedgerEntriesQueryParamProperties {
217
- /** The sub-ledger id. */
218
- subLedgerId?: string;
219
- /** Specify the first transaction ID in a range. */
220
- fromTransactionId?: string;
221
- /** Specify the last transaction ID in a range. */
222
- toTransactionId?: string;
223
- }
224
-
225
214
  export declare interface GetLedgerEntry {
226
215
  /** To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the response, or if the loading is still ongoing. */
227
- get(options?: GetLedgerEntryParameters): Promise<GetLedgerEntry200Response | GetLedgerEntrydefaultResponse>;
216
+ get(options?: GetLedgerEntryParameters): StreamableMethod<GetLedgerEntry200Response | GetLedgerEntrydefaultResponse>;
228
217
  }
229
218
 
230
219
  /** To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the response, or if the loading is still ongoing. */
231
220
  export declare interface GetLedgerEntry200Response extends HttpResponse {
232
221
  status: "200";
233
- body: LedgerQueryResult;
222
+ body: LedgerQueryResultOutput;
234
223
  }
235
224
 
236
225
  /** To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the response, or if the loading is still ongoing. */
237
226
  export declare interface GetLedgerEntrydefaultResponse extends HttpResponse {
238
- status: "500";
239
- body: ConfidentialLedgerError;
227
+ status: string;
228
+ body: ConfidentialLedgerErrorOutput;
240
229
  }
241
230
 
242
- export declare type GetLedgerEntryParameters = RequestParameters & GetLedgerEntryQueryParam;
231
+ export declare type GetLedgerEntryParameters = GetLedgerEntryQueryParam & RequestParameters;
243
232
 
244
233
  export declare interface GetLedgerEntryQueryParam {
245
234
  queryParameters?: GetLedgerEntryQueryParamProperties;
246
235
  }
247
236
 
248
237
  export declare interface GetLedgerEntryQueryParamProperties {
249
- /** The sub-ledger id. */
250
- subLedgerId?: string;
238
+ /** The collection id. */
239
+ collectionId?: string;
251
240
  }
252
241
 
253
242
  export declare function getLedgerIdentity(ledgerId: string, identityServiceBaseUrl?: string): Promise<LedgerIdentity>;
254
243
 
244
+ /**
245
+ * The type of a custom function that defines how to get a page and a link to the next one if any.
246
+ */
247
+ export declare type GetPage<TPage> = (pageLink: string, maxPageSize?: number) => Promise<{
248
+ page: TPage;
249
+ nextPageLink?: string;
250
+ }>;
251
+
255
252
  export declare interface GetReceipt {
256
253
  /** Gets a receipt certifying ledger contents at a particular transaction id. */
257
- get(options?: GetReceiptParameters): Promise<GetReceipt200Response | GetReceiptdefaultResponse>;
254
+ get(options?: GetReceiptParameters): StreamableMethod<GetReceipt200Response | GetReceiptdefaultResponse>;
258
255
  }
259
256
 
260
257
  /** Gets a receipt certifying ledger contents at a particular transaction id. */
261
258
  export declare interface GetReceipt200Response extends HttpResponse {
262
259
  status: "200";
263
- body: TransactionReceipt;
260
+ body: TransactionReceiptOutput;
264
261
  }
265
262
 
266
263
  /** Gets a receipt certifying ledger contents at a particular transaction id. */
267
264
  export declare interface GetReceiptdefaultResponse extends HttpResponse {
268
- status: "500";
269
- body: ConfidentialLedgerError;
265
+ status: string;
266
+ body: ConfidentialLedgerErrorOutput;
270
267
  }
271
268
 
272
269
  export declare type GetReceiptParameters = RequestParameters;
273
270
 
274
271
  export declare interface GetTransactionStatus {
275
272
  /** Gets the status of an entry identified by a transaction id. */
276
- get(options?: GetTransactionStatusParameters): Promise<GetTransactionStatus200Response | GetTransactionStatusdefaultResponse>;
273
+ get(options?: GetTransactionStatusParameters): StreamableMethod<GetTransactionStatus200Response | GetTransactionStatusdefaultResponse>;
277
274
  }
278
275
 
279
276
  /** Gets the status of an entry identified by a transaction id. */
280
277
  export declare interface GetTransactionStatus200Response extends HttpResponse {
281
278
  status: "200";
282
- body: TransactionStatus;
279
+ body: TransactionStatusOutput;
283
280
  }
284
281
 
285
282
  /** Gets the status of an entry identified by a transaction id. */
286
283
  export declare interface GetTransactionStatusdefaultResponse extends HttpResponse {
287
- status: "500";
288
- body: ConfidentialLedgerError;
284
+ status: string;
285
+ body: ConfidentialLedgerErrorOutput;
289
286
  }
290
287
 
291
288
  export declare type GetTransactionStatusParameters = RequestParameters;
@@ -293,69 +290,185 @@ export declare type GetTransactionStatusParameters = RequestParameters;
293
290
  /** Gets a user. */
294
291
  export declare interface GetUser200Response extends HttpResponse {
295
292
  status: "200";
296
- body: LedgerUser;
293
+ body: LedgerUserOutput;
297
294
  }
298
295
 
299
296
  /** Gets a user. */
300
297
  export declare interface GetUserdefaultResponse extends HttpResponse {
301
- status: "500";
302
- body: ConfidentialLedgerError;
298
+ status: string;
299
+ body: ConfidentialLedgerErrorOutput;
303
300
  }
304
301
 
305
302
  export declare type GetUserParameters = RequestParameters;
306
303
 
304
+ export declare function isUnexpected(response: GetConstitution200Response | GetConstitutiondefaultResponse): response is GetConstitutiondefaultResponse;
305
+
306
+ export declare function isUnexpected(response: GetConsortiumMembers200Response | GetConsortiumMembersdefaultResponse): response is GetConsortiumMembersdefaultResponse;
307
+
308
+ export declare function isUnexpected(response: GetEnclaveQuotes200Response | GetEnclaveQuotesdefaultResponse): response is GetEnclaveQuotesdefaultResponse;
309
+
310
+ export declare function isUnexpected(response: ListCollections200Response | ListCollectionsdefaultResponse): response is ListCollectionsdefaultResponse;
311
+
312
+ export declare function isUnexpected(response: ListLedgerEntries200Response | ListLedgerEntriesdefaultResponse): response is ListLedgerEntriesdefaultResponse;
313
+
314
+ export declare function isUnexpected(response: PostLedgerEntry200Response | PostLedgerEntrydefaultResponse): response is PostLedgerEntrydefaultResponse;
315
+
316
+ export declare function isUnexpected(response: GetLedgerEntry200Response | GetLedgerEntrydefaultResponse): response is GetLedgerEntrydefaultResponse;
317
+
318
+ export declare function isUnexpected(response: GetReceipt200Response | GetReceiptdefaultResponse): response is GetReceiptdefaultResponse;
319
+
320
+ export declare function isUnexpected(response: GetTransactionStatus200Response | GetTransactionStatusdefaultResponse): response is GetTransactionStatusdefaultResponse;
321
+
322
+ export declare function isUnexpected(response: GetCurrentLedgerEntry200Response | GetCurrentLedgerEntrydefaultResponse): response is GetCurrentLedgerEntrydefaultResponse;
323
+
324
+ export declare function isUnexpected(response: DeleteUser204Response | DeleteUserdefaultResponse): response is DeleteUserdefaultResponse;
325
+
326
+ export declare function isUnexpected(response: GetUser200Response | GetUserdefaultResponse): response is GetUserdefaultResponse;
327
+
328
+ export declare function isUnexpected(response: CreateOrUpdateUser200Response | CreateOrUpdateUserdefaultResponse): response is CreateOrUpdateUserdefaultResponse;
329
+
307
330
  export declare interface LedgerEntry {
308
331
  /** Contents of the ledger entry. */
309
332
  contents: string;
310
- /** Identifier for sub-ledgers. */
311
- subLedgerId?: string;
333
+ collectionId?: string;
334
+ /** A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read. */
335
+ transactionId?: string;
336
+ }
337
+
338
+ export declare interface LedgerEntryOutput {
339
+ /** Contents of the ledger entry. */
340
+ contents: string;
341
+ collectionId?: string;
312
342
  /** A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read. */
313
343
  transactionId?: string;
314
344
  }
315
345
 
316
346
  export declare interface LedgerIdentity {
317
- ledgerTlsCertificate: string;
347
+ ledgerIdentityCertificate: string;
318
348
  ledgerId: string;
319
349
  }
320
350
 
321
- export declare interface LedgerQueryResult {
351
+ export declare interface LedgerQueryResultOutput {
322
352
  /** State of a ledger query. */
323
- state: ConfidentialLedgerQueryState;
353
+ state: "Loading" | "Ready";
324
354
  /** The ledger entry found as a result of the query. This is only available if the query is in Ready state. */
325
- entry?: LedgerEntry;
355
+ entry?: LedgerEntryOutput;
326
356
  }
327
357
 
328
358
  export declare interface LedgerUser {
329
359
  /** Represents an assignable role. */
330
- assignedRole: ConfidentialLedgerUserRoleName;
360
+ assignedRole: "Administrator" | "Contributor" | "Reader";
331
361
  /** Identifier for the user. This must either be an AAD object id or a certificate fingerprint. */
332
362
  userId?: string;
333
363
  }
334
364
 
335
- export declare interface LedgerWriteResult {
336
- /** Identifier for sub-ledgers. */
337
- subLedgerId: string;
365
+ export declare interface LedgerUserOutput {
366
+ /** Represents an assignable role. */
367
+ assignedRole: "Administrator" | "Contributor" | "Reader";
368
+ /** Identifier for the user. This must either be an AAD object id or a certificate fingerprint. */
369
+ userId?: string;
338
370
  }
339
371
 
340
- export declare interface MerkleProofElement {
341
- left?: string;
342
- right?: string;
372
+ export declare interface LedgerWriteResultOutput {
373
+ collectionId: string;
374
+ }
375
+
376
+ export declare interface ListCollections {
377
+ /** Collection ids are user-created collections of ledger entries */
378
+ get(options?: ListCollectionsParameters): StreamableMethod<ListCollections200Response | ListCollectionsdefaultResponse>;
379
+ }
380
+
381
+ /** Collection ids are user-created collections of ledger entries */
382
+ export declare interface ListCollections200Response extends HttpResponse {
383
+ status: "200";
384
+ body: CollectionsOutput;
385
+ }
386
+
387
+ /** Collection ids are user-created collections of ledger entries */
388
+ export declare interface ListCollectionsdefaultResponse extends HttpResponse {
389
+ status: string;
390
+ body: ConfidentialLedgerErrorOutput;
391
+ }
392
+
393
+ export declare type ListCollectionsParameters = RequestParameters;
394
+
395
+ export declare interface ListLedgerEntries {
396
+ /** A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned. */
397
+ get(options?: ListLedgerEntriesParameters): StreamableMethod<ListLedgerEntries200Response | ListLedgerEntriesdefaultResponse>;
398
+ /** A collection id may optionally be specified. */
399
+ post(options: PostLedgerEntryParameters): StreamableMethod<PostLedgerEntry200Response | PostLedgerEntrydefaultResponse>;
400
+ }
401
+
402
+ /** A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned. */
403
+ export declare interface ListLedgerEntries200Response extends HttpResponse {
404
+ status: "200";
405
+ body: PagedLedgerEntriesOutput;
406
+ }
407
+
408
+ /** A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned. */
409
+ export declare interface ListLedgerEntriesdefaultResponse extends HttpResponse {
410
+ status: string;
411
+ body: ConfidentialLedgerErrorOutput;
343
412
  }
344
413
 
345
- export declare interface PagedLedgerEntries {
414
+ export declare type ListLedgerEntriesParameters = ListLedgerEntriesQueryParam & RequestParameters;
415
+
416
+ export declare interface ListLedgerEntriesQueryParam {
417
+ queryParameters?: ListLedgerEntriesQueryParamProperties;
418
+ }
419
+
420
+ export declare interface ListLedgerEntriesQueryParamProperties {
421
+ /** The collection id. */
422
+ collectionId?: string;
423
+ /** Specify the first transaction ID in a range. */
424
+ fromTransactionId?: string;
425
+ /** Specify the last transaction ID in a range. */
426
+ toTransactionId?: string;
427
+ }
428
+
429
+ export declare interface PagedLedgerEntriesOutput {
346
430
  /** State of a ledger query. */
347
- state: ConfidentialLedgerQueryState;
431
+ state: "Loading" | "Ready";
348
432
  /** Path from which to retrieve the next page of results. */
349
433
  nextLink?: string;
350
434
  /** Array of ledger entries. */
351
- entries: LedgerEntry[];
352
- }
353
-
354
- export declare interface PostLedgerEntry {
355
- /** A sub-ledger id may optionally be specified. Only entries in the specified (or default) sub-ledger will be returned. */
356
- get(options?: GetLedgerEntriesParameters): Promise<GetLedgerEntries200Response | GetLedgerEntriesdefaultResponse>;
357
- /** A sub-ledger id may optionally be specified. */
358
- post(options?: PostLedgerEntryParameters): Promise<PostLedgerEntry200Response | PostLedgerEntrydefaultResponse>;
435
+ entries: Array<LedgerEntryOutput>;
436
+ }
437
+
438
+ /**
439
+ * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
440
+ * @param client - Client to use for sending the next page requests
441
+ * @param initialResponse - Initial response containing the nextLink and current page of elements
442
+ * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
443
+ * @returns - PagedAsyncIterableIterator to iterate the elements
444
+ */
445
+ export declare function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
446
+
447
+ /**
448
+ * Helper type to infer the Type of the paged elements from the response type
449
+ * This type is generated based on the swagger information for x-ms-pageable
450
+ * specifically on the itemName property which indicates the property of the response
451
+ * where the page items are found. The default value is `value`.
452
+ * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
453
+ */
454
+ export declare type PaginateReturn<TResult> = TResult extends {
455
+ body: {
456
+ value?: infer TPage;
457
+ };
458
+ } | {
459
+ body: {
460
+ entries?: infer TPage;
461
+ };
462
+ } ? GetArrayType<TPage> : Array<unknown>;
463
+
464
+ /**
465
+ * Options for the paging helper
466
+ */
467
+ export declare interface PagingOptions<TResponse> {
468
+ /**
469
+ * Custom function to extract pagination details for crating the PagedAsyncIterableIterator
470
+ */
471
+ customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
359
472
  }
360
473
 
361
474
  export declare interface PostLedgerEntry200Headers {
@@ -363,52 +476,60 @@ export declare interface PostLedgerEntry200Headers {
363
476
  "x-ms-ccf-transaction-id"?: string;
364
477
  }
365
478
 
366
- /** A sub-ledger id may optionally be specified. */
479
+ /** A collection id may optionally be specified. */
367
480
  export declare interface PostLedgerEntry200Response extends HttpResponse {
368
481
  status: "200";
369
- body: LedgerWriteResult;
482
+ body: LedgerWriteResultOutput;
370
483
  headers: RawHttpHeaders & PostLedgerEntry200Headers;
371
484
  }
372
485
 
373
486
  export declare interface PostLedgerEntryBodyParam {
374
- body?: LedgerEntry;
487
+ /** Ledger entry. */
488
+ body: LedgerEntry;
375
489
  }
376
490
 
377
- /** A sub-ledger id may optionally be specified. */
491
+ /** A collection id may optionally be specified. */
378
492
  export declare interface PostLedgerEntrydefaultResponse extends HttpResponse {
379
- status: "500";
380
- body: ConfidentialLedgerError;
493
+ status: string;
494
+ body: ConfidentialLedgerErrorOutput;
495
+ }
496
+
497
+ export declare interface PostLedgerEntryMediaTypesParam {
498
+ /** Request content type */
499
+ contentType?: "application/json";
381
500
  }
382
501
 
383
- export declare type PostLedgerEntryParameters = RequestParameters & PostLedgerEntryQueryParam & PostLedgerEntryBodyParam;
502
+ export declare type PostLedgerEntryParameters = PostLedgerEntryQueryParam & PostLedgerEntryMediaTypesParam & PostLedgerEntryBodyParam & RequestParameters;
384
503
 
385
504
  export declare interface PostLedgerEntryQueryParam {
386
505
  queryParameters?: PostLedgerEntryQueryParamProperties;
387
506
  }
388
507
 
389
508
  export declare interface PostLedgerEntryQueryParamProperties {
390
- /** The sub-ledger id. */
391
- subLedgerId?: string;
509
+ /** The collection id. */
510
+ collectionId?: string;
392
511
  }
393
512
 
394
- export declare interface ReceiptContents {
395
- /** Merkle tree leaf for this transaction. */
396
- leaf: string;
397
- /** Id of the node returning the receipt. */
513
+ export declare interface ReceiptContentsOutput {
514
+ cert?: string;
515
+ leaf?: string;
516
+ leafComponents?: ReceiptLeafComponentsOutput;
398
517
  nodeId: string;
399
- /** Merkle proof. */
400
- proof: MerkleProofElement[];
401
- /** Root of the Merkle tree at the time the transaction was recorded. */
402
- root: string;
403
- /** Signature by the node, with its certificate, over the Merkle root. */
518
+ proof: Array<ReceiptElementOutput>;
519
+ root?: string;
520
+ serviceEndorsements?: Array<string>;
404
521
  signature: string;
405
522
  }
406
523
 
407
- export declare interface RoleAssignment {
408
- /** Represents an assignable role. */
409
- roleName: ConfidentialLedgerUserRoleName;
410
- /** Description of the role. */
411
- description?: string;
524
+ export declare interface ReceiptElementOutput {
525
+ left?: string;
526
+ right?: string;
527
+ }
528
+
529
+ export declare interface ReceiptLeafComponentsOutput {
530
+ claimsDigest?: string;
531
+ commitEvidence?: string;
532
+ writeSetDigest?: string;
412
533
  }
413
534
 
414
535
  export declare interface Routes {
@@ -418,8 +539,10 @@ export declare interface Routes {
418
539
  (path: "/app/governance/members"): GetConsortiumMembers;
419
540
  /** Resource for '/app/enclaveQuotes' has methods for the following verbs: get */
420
541
  (path: "/app/enclaveQuotes"): GetEnclaveQuotes;
542
+ /** Resource for '/app/collections' has methods for the following verbs: get */
543
+ (path: "/app/collections"): ListCollections;
421
544
  /** Resource for '/app/transactions' has methods for the following verbs: get, post */
422
- (path: "/app/transactions"): PostLedgerEntry;
545
+ (path: "/app/transactions"): ListLedgerEntries;
423
546
  /** Resource for '/app/transactions/\{transactionId\}' has methods for the following verbs: get */
424
547
  (path: "/app/transactions/{transactionId}", transactionId: string): GetLedgerEntry;
425
548
  /** Resource for '/app/transactions/\{transactionId\}/receipt' has methods for the following verbs: get */
@@ -429,23 +552,20 @@ export declare interface Routes {
429
552
  /** Resource for '/app/transactions/current' has methods for the following verbs: get */
430
553
  (path: "/app/transactions/current"): GetCurrentLedgerEntry;
431
554
  /** Resource for '/app/users/\{userId\}' has methods for the following verbs: delete, get, patch */
432
- (path: "/app/users/{userId}", userId: string): CreateOrUpdateUser;
555
+ (path: "/app/users/{userId}", userId: string): DeleteUser;
433
556
  }
434
557
 
435
- export declare interface TransactionReceipt {
436
- /** A receipt certifying the transaction at the specified id. */
437
- receipt?: ReceiptContents;
558
+ export declare interface TransactionReceiptOutput {
559
+ receipt?: ReceiptContentsOutput;
438
560
  /** State of a ledger query. */
439
- state: ConfidentialLedgerQueryState;
561
+ state: "Loading" | "Ready";
440
562
  /** A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read. */
441
563
  transactionId: string;
442
564
  }
443
565
 
444
- export declare type TransactionState = "Committed" | "Pending";
445
-
446
- export declare interface TransactionStatus {
566
+ export declare interface TransactionStatusOutput {
447
567
  /** Represents the state of the transaction. */
448
- state: TransactionState;
568
+ state: "Committed" | "Pending";
449
569
  /** A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read. */
450
570
  transactionId: string;
451
571
  }