@propxchain/core-client 0.4.0-canary.39 → 0.5.0-canary.42
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.
- package/dist/canisters/document_storage/document_storage.did.d.ts +31 -21
- package/dist/canisters/document_storage/document_storage.did.js +31 -21
- package/dist/canisters/document_verification/document_verification.did.d.ts +9 -9
- package/dist/canisters/document_verification/document_verification.did.js +28 -28
- package/dist/canisters/land_registry_integration/land_registry_integration.did.js +23 -139
- package/dist/canisters/ledger_manager/ledger_manager.did.d.ts +1 -0
- package/dist/canisters/ledger_manager/ledger_manager.did.js +2 -5
- package/dist/canisters/property_registry/property_registry.did.d.ts +7 -3
- package/dist/canisters/property_registry/property_registry.did.js +12 -4
- package/dist/canisters/transaction_manager/transaction_manager.did.d.ts +90 -42
- package/dist/canisters/transaction_manager/transaction_manager.did.js +117 -40
- package/dist/canisters/user_management/user_management.did.d.ts +65 -18
- package/dist/canisters/user_management/user_management.did.js +90 -19
- package/dist/mock.js +1 -1
- package/package.json +1 -1
- package/src/canisters/document_storage/document_storage.did +32 -21
- package/src/canisters/document_storage/document_storage.did.d.ts +31 -21
- package/src/canisters/document_storage/document_storage.did.js +31 -21
- package/src/canisters/document_verification/document_verification.did +6 -6
- package/src/canisters/document_verification/document_verification.did.d.ts +9 -9
- package/src/canisters/document_verification/document_verification.did.js +28 -28
- package/src/canisters/land_registry_integration/land_registry_integration.did.js +23 -139
- package/src/canisters/ledger_manager/ledger_manager.did +2 -1
- package/src/canisters/ledger_manager/ledger_manager.did.d.ts +1 -0
- package/src/canisters/ledger_manager/ledger_manager.did.js +2 -5
- package/src/canisters/property_registry/property_registry.did +7 -3
- package/src/canisters/property_registry/property_registry.did.d.ts +7 -3
- package/src/canisters/property_registry/property_registry.did.js +12 -4
- package/src/canisters/transaction_manager/transaction_manager.did +104 -48
- package/src/canisters/transaction_manager/transaction_manager.did.d.ts +90 -42
- package/src/canisters/transaction_manager/transaction_manager.did.js +117 -40
- package/src/canisters/user_management/user_management.did +62 -19
- package/src/canisters/user_management/user_management.did.d.ts +65 -18
- package/src/canisters/user_management/user_management.did.js +90 -19
- package/src/mock.ts +1 -1
|
@@ -19,7 +19,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
19
19
|
'solicitor_managed' : IDL.Null,
|
|
20
20
|
'assisted_buyer' : IDL.Null,
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const Result = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
|
|
23
23
|
const Permission = IDL.Variant({
|
|
24
24
|
'ViewTransactionProgress' : IDL.Text,
|
|
25
25
|
'ViewSharedTransaction' : IDL.Text,
|
|
@@ -30,7 +30,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
30
30
|
'AdminManageUsers' : IDL.Null,
|
|
31
31
|
'UpdateMemberDocuments' : IDL.Tuple(IDL.Text, IDL.Principal),
|
|
32
32
|
});
|
|
33
|
-
const
|
|
33
|
+
const Result_2 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
|
|
34
34
|
const AdminMutationError = IDL.Variant({
|
|
35
35
|
'targetIsAnonymous' : IDL.Null,
|
|
36
36
|
'cannotDemoteController' : IDL.Null,
|
|
@@ -43,7 +43,33 @@ export const idlFactory = ({ IDL }) => {
|
|
|
43
43
|
'ok' : IDL.Null,
|
|
44
44
|
'err' : AdminMutationError,
|
|
45
45
|
});
|
|
46
|
+
const GrantStatus = IDL.Variant({
|
|
47
|
+
'active' : IDL.Null,
|
|
48
|
+
'revoked' : IDL.Null,
|
|
49
|
+
'preClaim' : IDL.Null,
|
|
50
|
+
});
|
|
46
51
|
const Time = IDL.Int;
|
|
52
|
+
const GrantSource = IDL.Variant({
|
|
53
|
+
'authMdEmail' : IDL.Null,
|
|
54
|
+
'authMdIdJag' : IDL.Null,
|
|
55
|
+
'invite' : IDL.Null,
|
|
56
|
+
'authMdAnonymous' : IDL.Null,
|
|
57
|
+
});
|
|
58
|
+
const GrantTier = IDL.Variant({
|
|
59
|
+
'readOnly' : IDL.Null,
|
|
60
|
+
'consequential' : IDL.Null,
|
|
61
|
+
});
|
|
62
|
+
const AgentGrant = IDL.Record({
|
|
63
|
+
'status' : GrantStatus,
|
|
64
|
+
'expiresAt' : IDL.Opt(Time),
|
|
65
|
+
'source' : GrantSource,
|
|
66
|
+
'ownerPrincipal' : IDL.Opt(IDL.Principal),
|
|
67
|
+
'scopes' : IDL.Vec(IDL.Text),
|
|
68
|
+
'tier' : GrantTier,
|
|
69
|
+
'issuedAt' : Time,
|
|
70
|
+
'lastElevatedAt' : IDL.Opt(Time),
|
|
71
|
+
'agentPrincipal' : IDL.Principal,
|
|
72
|
+
});
|
|
47
73
|
const BotRole = IDL.Variant({
|
|
48
74
|
'BotFirm' : IDL.Null,
|
|
49
75
|
'BotInternal' : IDL.Null,
|
|
@@ -165,12 +191,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
165
191
|
'ok' : AdminRecord,
|
|
166
192
|
'err' : AdminMutationError,
|
|
167
193
|
});
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
'ok' : IDL.Record({ 'ownerPrincipal' : IDL.Principal, 'role' : BotRole }),
|
|
172
|
-
'err' : IDL.Text,
|
|
173
|
-
});
|
|
194
|
+
const Result_1 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
|
|
195
|
+
const Result_4 = IDL.Variant({ 'ok' : AgentGrant, 'err' : IDL.Text });
|
|
196
|
+
const Result_3 = IDL.Variant({ 'ok' : BotAgent, 'err' : IDL.Text });
|
|
174
197
|
return IDL.Service({
|
|
175
198
|
'addTransactionMember' : IDL.Func(
|
|
176
199
|
[IDL.Text, IDL.Principal, UserType, IDL.Bool, IDL.Bool, IDL.Text],
|
|
@@ -179,7 +202,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
179
202
|
),
|
|
180
203
|
'adminLinkPrincipals' : IDL.Func(
|
|
181
204
|
[IDL.Principal, IDL.Principal],
|
|
182
|
-
[
|
|
205
|
+
[Result],
|
|
183
206
|
[],
|
|
184
207
|
),
|
|
185
208
|
'amIAdmin' : IDL.Func([], [IDL.Bool], ['query']),
|
|
@@ -190,13 +213,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
190
213
|
['query'],
|
|
191
214
|
),
|
|
192
215
|
'checkPermissionWithAudit' : IDL.Func([Permission], [IDL.Bool], []),
|
|
193
|
-
'claimLinkCode' : IDL.Func([IDL.Text], [
|
|
216
|
+
'claimLinkCode' : IDL.Func([IDL.Text], [Result], []),
|
|
194
217
|
'createUserForPrincipal' : IDL.Func(
|
|
195
218
|
[IDL.Principal, IDL.Text, IDL.Text, IDL.Text, IDL.Text, IDL.Text],
|
|
196
219
|
[IDL.Bool],
|
|
197
220
|
[],
|
|
198
221
|
),
|
|
199
|
-
'deactivateBot' : IDL.Func([IDL.Principal], [
|
|
222
|
+
'deactivateBot' : IDL.Func([IDL.Principal], [Result_2], []),
|
|
200
223
|
'deleteUserByPrincipal' : IDL.Func(
|
|
201
224
|
[IDL.Principal, IDL.Text],
|
|
202
225
|
[IDL.Bool],
|
|
@@ -208,7 +231,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
208
231
|
[],
|
|
209
232
|
),
|
|
210
233
|
'generateCSRFToken' : IDL.Func([], [IDL.Text], []),
|
|
211
|
-
'generateLinkCode' : IDL.Func([], [
|
|
234
|
+
'generateLinkCode' : IDL.Func([], [Result], []),
|
|
235
|
+
'getAgentGrant' : IDL.Func(
|
|
236
|
+
[IDL.Principal],
|
|
237
|
+
[IDL.Opt(AgentGrant)],
|
|
238
|
+
['query'],
|
|
239
|
+
),
|
|
212
240
|
'getAllBots' : IDL.Func([], [IDL.Vec(BotAgent)], ['query']),
|
|
213
241
|
'getAllUsers' : IDL.Func([], [IDL.Vec(UserProfile)], ['query']),
|
|
214
242
|
'getAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
|
|
@@ -220,11 +248,18 @@ export const idlFactory = ({ IDL }) => {
|
|
|
220
248
|
'getBotAgent' : IDL.Func([IDL.Principal], [IDL.Opt(BotAgent)], ['query']),
|
|
221
249
|
'getCSRFToken' : IDL.Func([], [IDL.Opt(IDL.Text)], ['query']),
|
|
222
250
|
'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
|
|
251
|
+
'getGrantIssuer' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
|
|
223
252
|
'getLinkedPrincipals' : IDL.Func(
|
|
224
253
|
[IDL.Principal],
|
|
225
254
|
[IDL.Vec(IDL.Principal)],
|
|
226
255
|
['query'],
|
|
227
256
|
),
|
|
257
|
+
'getMemberRoleInTransaction' : IDL.Func(
|
|
258
|
+
[IDL.Principal, IDL.Text],
|
|
259
|
+
[IDL.Opt(UserType)],
|
|
260
|
+
['query'],
|
|
261
|
+
),
|
|
262
|
+
'getMyAgentGrants' : IDL.Func([], [IDL.Vec(AgentGrant)], ['query']),
|
|
228
263
|
'getMyBots' : IDL.Func([], [IDL.Vec(BotAgent)], ['query']),
|
|
229
264
|
'getMyLinkedPrincipals' : IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
|
|
230
265
|
'getMyManagingSolicitor' : IDL.Func([], [IDL.Opt(UserProfile)], ['query']),
|
|
@@ -265,7 +300,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
265
300
|
'listAdmins' : IDL.Func([], [IDL.Vec(AdminRecord)], ['query']),
|
|
266
301
|
'logBotAction' : IDL.Func(
|
|
267
302
|
[IDL.Principal, IDL.Text, IDL.Opt(IDL.Text), IDL.Bool, IDL.Text],
|
|
268
|
-
[
|
|
303
|
+
[Result_2],
|
|
269
304
|
[],
|
|
270
305
|
),
|
|
271
306
|
'myAdminRole' : IDL.Func([], [IDL.Opt(AdminRole)], ['query']),
|
|
@@ -274,7 +309,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
274
309
|
[AdminMutationResult],
|
|
275
310
|
[],
|
|
276
311
|
),
|
|
277
|
-
'reactivateBot' : IDL.Func([IDL.Principal], [
|
|
312
|
+
'reactivateBot' : IDL.Func([IDL.Principal], [Result_2], []),
|
|
278
313
|
'recordAuditEntry' : IDL.Func(
|
|
279
314
|
[
|
|
280
315
|
ActorType,
|
|
@@ -285,12 +320,42 @@ export const idlFactory = ({ IDL }) => {
|
|
|
285
320
|
IDL.Bool,
|
|
286
321
|
IDL.Text,
|
|
287
322
|
],
|
|
288
|
-
[
|
|
323
|
+
[Result_1],
|
|
324
|
+
[],
|
|
325
|
+
),
|
|
326
|
+
'recordGrantElevation' : IDL.Func(
|
|
327
|
+
[
|
|
328
|
+
IDL.Principal,
|
|
329
|
+
IDL.Principal,
|
|
330
|
+
GrantTier,
|
|
331
|
+
IDL.Vec(IDL.Text),
|
|
332
|
+
GrantSource,
|
|
333
|
+
IDL.Opt(Time),
|
|
334
|
+
],
|
|
335
|
+
[Result_4],
|
|
336
|
+
[],
|
|
337
|
+
),
|
|
338
|
+
'recordGrantIssued' : IDL.Func(
|
|
339
|
+
[
|
|
340
|
+
IDL.Principal,
|
|
341
|
+
IDL.Opt(IDL.Principal),
|
|
342
|
+
GrantTier,
|
|
343
|
+
IDL.Vec(IDL.Text),
|
|
344
|
+
GrantStatus,
|
|
345
|
+
GrantSource,
|
|
346
|
+
IDL.Opt(Time),
|
|
347
|
+
],
|
|
348
|
+
[Result_4],
|
|
349
|
+
[],
|
|
350
|
+
),
|
|
351
|
+
'recordGrantRevocation' : IDL.Func(
|
|
352
|
+
[IDL.Principal, IDL.Text],
|
|
353
|
+
[Result_2],
|
|
289
354
|
[],
|
|
290
355
|
),
|
|
291
356
|
'registerBot' : IDL.Func(
|
|
292
357
|
[IDL.Principal, IDL.Text, IDL.Text, BotRole],
|
|
293
|
-
[
|
|
358
|
+
[Result_3],
|
|
294
359
|
[],
|
|
295
360
|
),
|
|
296
361
|
'registerUser' : IDL.Func(
|
|
@@ -313,13 +378,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
313
378
|
[IDL.Bool],
|
|
314
379
|
[],
|
|
315
380
|
),
|
|
381
|
+
'repairTransactionMemberRole' : IDL.Func(
|
|
382
|
+
[IDL.Text, IDL.Principal, UserType],
|
|
383
|
+
[IDL.Bool],
|
|
384
|
+
[],
|
|
385
|
+
),
|
|
316
386
|
'resendVerificationEmail' : IDL.Func([IDL.Text], [IDL.Bool], []),
|
|
317
387
|
'revokeSolicitorAccess' : IDL.Func(
|
|
318
388
|
[IDL.Principal, IDL.Text],
|
|
319
389
|
[IDL.Bool],
|
|
320
390
|
[],
|
|
321
391
|
),
|
|
322
|
-
'
|
|
392
|
+
'setGrantIssuer' : IDL.Func([IDL.Principal], [Result_2], []),
|
|
393
|
+
'sweepStaleGrants' : IDL.Func([], [Result_1], []),
|
|
394
|
+
'unlinkPrincipal' : IDL.Func([IDL.Principal], [Result], []),
|
|
323
395
|
'updateMemberDocuments' : IDL.Func(
|
|
324
396
|
[IDL.Text, IDL.Text, IDL.Text],
|
|
325
397
|
[IDL.Bool],
|
|
@@ -333,7 +405,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
333
405
|
IDL.Opt(IDL.Text),
|
|
334
406
|
IDL.Opt(IDL.Text),
|
|
335
407
|
],
|
|
336
|
-
[
|
|
408
|
+
[Result],
|
|
337
409
|
[],
|
|
338
410
|
),
|
|
339
411
|
'updateTransactionMemberRequiredDocs' : IDL.Func(
|
|
@@ -342,7 +414,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
342
414
|
[],
|
|
343
415
|
),
|
|
344
416
|
'validateAdmin' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
|
|
345
|
-
'validateBot' : IDL.Func([IDL.Principal], [Result], ['query']),
|
|
346
417
|
'validateCSRFToken' : IDL.Func([IDL.Text], [IDL.Bool], []),
|
|
347
418
|
'verifyEmail' : IDL.Func([IDL.Text, IDL.Text], [IDL.Bool], []),
|
|
348
419
|
'verifyUser' : IDL.Func([IDL.Principal, IDL.Text], [IDL.Bool], []),
|
package/dist/mock.js
CHANGED
|
@@ -66,7 +66,7 @@ export function createMockPropertyRegistry() {
|
|
|
66
66
|
return mockService({
|
|
67
67
|
getAllProperties: async () => [],
|
|
68
68
|
getProperty: async () => [],
|
|
69
|
-
|
|
69
|
+
attestProperty: async () => false,
|
|
70
70
|
transferOwnership: async () => false,
|
|
71
71
|
});
|
|
72
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propxchain/core-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-canary.42",
|
|
4
4
|
"description": "Typed TypeScript client for the PropXchain core canisters on the Internet Computer. Includes a deterministic mock mode for local development and tests.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type Time = int;
|
|
2
|
-
type
|
|
2
|
+
type Result_7 =
|
|
3
3
|
variant {
|
|
4
4
|
err: text;
|
|
5
5
|
ok: blob;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
7
|
+
type Result_6 =
|
|
8
8
|
variant {
|
|
9
9
|
err: text;
|
|
10
10
|
ok:
|
|
@@ -19,9 +19,10 @@ type Result_5 =
|
|
|
19
19
|
transactionId: opt text;
|
|
20
20
|
uploadedAt: int;
|
|
21
21
|
uploadedBy: principal;
|
|
22
|
+
verified: bool;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
type
|
|
25
|
+
type Result_5 =
|
|
25
26
|
variant {
|
|
26
27
|
err: text;
|
|
27
28
|
ok:
|
|
@@ -32,17 +33,17 @@ type Result_4 =
|
|
|
32
33
|
uploadedChunks: nat;
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
|
-
type
|
|
36
|
+
type Result_4 =
|
|
36
37
|
variant {
|
|
37
38
|
err: text;
|
|
38
39
|
ok: nat;
|
|
39
40
|
};
|
|
40
|
-
type
|
|
41
|
+
type Result_3 =
|
|
41
42
|
variant {
|
|
42
43
|
err: text;
|
|
43
44
|
ok: text;
|
|
44
45
|
};
|
|
45
|
-
type
|
|
46
|
+
type Result_2 =
|
|
46
47
|
variant {
|
|
47
48
|
err: text;
|
|
48
49
|
ok: record {
|
|
@@ -51,11 +52,20 @@ type Result_1 =
|
|
|
51
52
|
uploadedChunks: nat;
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
|
-
type
|
|
55
|
+
type Result_1 =
|
|
55
56
|
variant {
|
|
56
57
|
err: text;
|
|
57
58
|
ok: bool;
|
|
58
59
|
};
|
|
60
|
+
type Result =
|
|
61
|
+
variant {
|
|
62
|
+
err: text;
|
|
63
|
+
ok: record {
|
|
64
|
+
computedHash: text;
|
|
65
|
+
matches: bool;
|
|
66
|
+
registeredHash: text;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
59
69
|
type DocumentSource =
|
|
60
70
|
variant {
|
|
61
71
|
LandRegistryAPI;
|
|
@@ -104,17 +114,17 @@ type ActorType =
|
|
|
104
114
|
user;
|
|
105
115
|
};
|
|
106
116
|
service : {
|
|
107
|
-
deleteDocument: (documentId: nat, csrfToken: text) -> (
|
|
108
|
-
downloadDocumentChunk: (documentId: nat, chunkIndex: nat) -> (
|
|
117
|
+
deleteDocument: (documentId: nat, csrfToken: text) -> (Result_3);
|
|
118
|
+
downloadDocumentChunk: (documentId: nat, chunkIndex: nat) -> (Result_7);
|
|
109
119
|
generateCSRFToken: () -> (text);
|
|
110
120
|
getAuditLogs: (documentId: nat) -> (vec AuditLog) query;
|
|
111
121
|
getCSRFToken: () -> (opt text) query;
|
|
112
122
|
getCycles: () -> (nat) query;
|
|
113
123
|
getDocumentByLandRegistryReference: (lrRef: text) ->
|
|
114
124
|
(opt DocumentProof) query;
|
|
115
|
-
getDocumentMetadata: (documentId: nat) -> (
|
|
125
|
+
getDocumentMetadata: (documentId: nat) -> (Result_6) query;
|
|
116
126
|
getDocumentProof: (documentId: nat) -> (opt DocumentProof) query;
|
|
117
|
-
getDocumentUploadStatus: (documentId: nat) -> (
|
|
127
|
+
getDocumentUploadStatus: (documentId: nat) -> (Result_5) query;
|
|
118
128
|
getDocumentVerificationCanister: () -> (opt principal) query;
|
|
119
129
|
getExpiredLandRegistryDocuments: () -> (vec DocumentProof) query;
|
|
120
130
|
getLandRegistryCanister: () -> (opt principal) query;
|
|
@@ -134,26 +144,27 @@ service : {
|
|
|
134
144
|
getTransactionDocuments: (transactionId: text) -> (vec DocumentProof) query;
|
|
135
145
|
getTransactionManagerCanister: () -> (opt principal) query;
|
|
136
146
|
getUserManagementCanister: () -> (opt principal) query;
|
|
137
|
-
markDocumentDeleted: (documentId: nat, csrfToken: text) -> (
|
|
147
|
+
markDocumentDeleted: (documentId: nat, csrfToken: text) -> (Result_3);
|
|
138
148
|
recordAuditEntry: (actorType: ActorType, delegatedBy: opt principal,
|
|
139
149
|
action: text, documentId: nat, success: bool, metadata: text) ->
|
|
140
|
-
(
|
|
150
|
+
(Result_4);
|
|
141
151
|
registerDocumentProof: (fileName: text, fileHash: text, fileSize: nat,
|
|
142
152
|
contentType: text, storageLocation: text, transactionId: opt text,
|
|
143
|
-
docType: text, csrfToken: text) -> (
|
|
153
|
+
docType: text, csrfToken: text) -> (Result_4);
|
|
144
154
|
registerLandRegistryDocument: (transactionId: text, titleNumber: text,
|
|
145
155
|
documentType: text, fileHash: text, fileSize: nat, contentType: text,
|
|
146
156
|
landRegistryReference: text, validUntil: opt int, costPence: nat) ->
|
|
147
|
-
(
|
|
148
|
-
setDocumentVerificationCanister: (canisterId: principal) -> (
|
|
149
|
-
setLandRegistryCanister: (canisterId: principal) -> (
|
|
157
|
+
(Result_4);
|
|
158
|
+
setDocumentVerificationCanister: (canisterId: principal) -> (Result_3);
|
|
159
|
+
setLandRegistryCanister: (canisterId: principal) -> (Result_3);
|
|
150
160
|
setTransactionManagerCanister: (canisterId: principal, _csrfToken:
|
|
151
|
-
text) -> (
|
|
161
|
+
text) -> (Result_3);
|
|
152
162
|
setUserManagementCanister: (canisterId: principal, _csrfToken: text) ->
|
|
153
|
-
(
|
|
163
|
+
(Result_3);
|
|
154
164
|
uploadDocumentChunk: (documentId: nat, chunkIndex: nat, data: blob,
|
|
155
|
-
csrfToken: text) -> (
|
|
165
|
+
csrfToken: text) -> (Result_2);
|
|
156
166
|
validateCSRFToken: (token: text) -> (bool);
|
|
157
167
|
verifyDocumentHash: (documentId: nat, providedHash: text, csrfToken:
|
|
158
|
-
text) -> (
|
|
168
|
+
text) -> (Result_1);
|
|
169
|
+
verifyOnChainIntegrity: (documentId: nat) -> (Result);
|
|
159
170
|
}
|
|
@@ -41,9 +41,17 @@ export type DocumentSource = { 'UserUploaded' : null } |
|
|
|
41
41
|
{ 'LandRegistryAPI' : null } |
|
|
42
42
|
{ 'LandRegistryNotification' : null } |
|
|
43
43
|
{ 'SystemGenerated' : null };
|
|
44
|
-
export type Result = {
|
|
44
|
+
export type Result = {
|
|
45
|
+
'ok' : {
|
|
46
|
+
'matches' : boolean,
|
|
47
|
+
'computedHash' : string,
|
|
48
|
+
'registeredHash' : string,
|
|
49
|
+
}
|
|
50
|
+
} |
|
|
45
51
|
{ 'err' : string };
|
|
46
|
-
export type Result_1 = {
|
|
52
|
+
export type Result_1 = { 'ok' : boolean } |
|
|
53
|
+
{ 'err' : string };
|
|
54
|
+
export type Result_2 = {
|
|
47
55
|
'ok' : {
|
|
48
56
|
'uploadedChunks' : bigint,
|
|
49
57
|
'totalChunks' : bigint,
|
|
@@ -51,11 +59,11 @@ export type Result_1 = {
|
|
|
51
59
|
}
|
|
52
60
|
} |
|
|
53
61
|
{ 'err' : string };
|
|
54
|
-
export type
|
|
62
|
+
export type Result_3 = { 'ok' : string } |
|
|
55
63
|
{ 'err' : string };
|
|
56
|
-
export type
|
|
64
|
+
export type Result_4 = { 'ok' : bigint } |
|
|
57
65
|
{ 'err' : string };
|
|
58
|
-
export type
|
|
66
|
+
export type Result_5 = {
|
|
59
67
|
'ok' : {
|
|
60
68
|
'uploadedChunks' : bigint,
|
|
61
69
|
'totalChunks' : bigint,
|
|
@@ -64,9 +72,10 @@ export type Result_4 = {
|
|
|
64
72
|
}
|
|
65
73
|
} |
|
|
66
74
|
{ 'err' : string };
|
|
67
|
-
export type
|
|
75
|
+
export type Result_6 = {
|
|
68
76
|
'ok' : {
|
|
69
77
|
'id' : bigint,
|
|
78
|
+
'verified' : boolean,
|
|
70
79
|
'contentType' : string,
|
|
71
80
|
'fileHash' : string,
|
|
72
81
|
'fileName' : string,
|
|
@@ -79,12 +88,12 @@ export type Result_5 = {
|
|
|
79
88
|
}
|
|
80
89
|
} |
|
|
81
90
|
{ 'err' : string };
|
|
82
|
-
export type
|
|
91
|
+
export type Result_7 = { 'ok' : Uint8Array | number[] } |
|
|
83
92
|
{ 'err' : string };
|
|
84
93
|
export type Time = bigint;
|
|
85
94
|
export interface _SERVICE {
|
|
86
|
-
'deleteDocument' : ActorMethod<[bigint, string],
|
|
87
|
-
'downloadDocumentChunk' : ActorMethod<[bigint, bigint],
|
|
95
|
+
'deleteDocument' : ActorMethod<[bigint, string], Result_3>,
|
|
96
|
+
'downloadDocumentChunk' : ActorMethod<[bigint, bigint], Result_7>,
|
|
88
97
|
'generateCSRFToken' : ActorMethod<[], string>,
|
|
89
98
|
'getAuditLogs' : ActorMethod<[bigint], Array<AuditLog>>,
|
|
90
99
|
'getCSRFToken' : ActorMethod<[], [] | [string]>,
|
|
@@ -93,9 +102,9 @@ export interface _SERVICE {
|
|
|
93
102
|
[string],
|
|
94
103
|
[] | [DocumentProof]
|
|
95
104
|
>,
|
|
96
|
-
'getDocumentMetadata' : ActorMethod<[bigint],
|
|
105
|
+
'getDocumentMetadata' : ActorMethod<[bigint], Result_6>,
|
|
97
106
|
'getDocumentProof' : ActorMethod<[bigint], [] | [DocumentProof]>,
|
|
98
|
-
'getDocumentUploadStatus' : ActorMethod<[bigint],
|
|
107
|
+
'getDocumentUploadStatus' : ActorMethod<[bigint], Result_5>,
|
|
99
108
|
'getDocumentVerificationCanister' : ActorMethod<[], [] | [Principal]>,
|
|
100
109
|
'getExpiredLandRegistryDocuments' : ActorMethod<[], Array<DocumentProof>>,
|
|
101
110
|
'getLandRegistryCanister' : ActorMethod<[], [] | [Principal]>,
|
|
@@ -121,14 +130,14 @@ export interface _SERVICE {
|
|
|
121
130
|
'getTransactionDocuments' : ActorMethod<[string], Array<DocumentProof>>,
|
|
122
131
|
'getTransactionManagerCanister' : ActorMethod<[], [] | [Principal]>,
|
|
123
132
|
'getUserManagementCanister' : ActorMethod<[], [] | [Principal]>,
|
|
124
|
-
'markDocumentDeleted' : ActorMethod<[bigint, string],
|
|
133
|
+
'markDocumentDeleted' : ActorMethod<[bigint, string], Result_3>,
|
|
125
134
|
'recordAuditEntry' : ActorMethod<
|
|
126
135
|
[ActorType, [] | [Principal], string, bigint, boolean, string],
|
|
127
|
-
|
|
136
|
+
Result_4
|
|
128
137
|
>,
|
|
129
138
|
'registerDocumentProof' : ActorMethod<
|
|
130
139
|
[string, string, bigint, string, string, [] | [string], string, string],
|
|
131
|
-
|
|
140
|
+
Result_4
|
|
132
141
|
>,
|
|
133
142
|
'registerLandRegistryDocument' : ActorMethod<
|
|
134
143
|
[
|
|
@@ -142,18 +151,19 @@ export interface _SERVICE {
|
|
|
142
151
|
[] | [bigint],
|
|
143
152
|
bigint,
|
|
144
153
|
],
|
|
145
|
-
|
|
154
|
+
Result_4
|
|
146
155
|
>,
|
|
147
|
-
'setDocumentVerificationCanister' : ActorMethod<[Principal],
|
|
148
|
-
'setLandRegistryCanister' : ActorMethod<[Principal],
|
|
149
|
-
'setTransactionManagerCanister' : ActorMethod<[Principal, string],
|
|
150
|
-
'setUserManagementCanister' : ActorMethod<[Principal, string],
|
|
156
|
+
'setDocumentVerificationCanister' : ActorMethod<[Principal], Result_3>,
|
|
157
|
+
'setLandRegistryCanister' : ActorMethod<[Principal], Result_3>,
|
|
158
|
+
'setTransactionManagerCanister' : ActorMethod<[Principal, string], Result_3>,
|
|
159
|
+
'setUserManagementCanister' : ActorMethod<[Principal, string], Result_3>,
|
|
151
160
|
'uploadDocumentChunk' : ActorMethod<
|
|
152
161
|
[bigint, bigint, Uint8Array | number[], string],
|
|
153
|
-
|
|
162
|
+
Result_2
|
|
154
163
|
>,
|
|
155
164
|
'validateCSRFToken' : ActorMethod<[string], boolean>,
|
|
156
|
-
'verifyDocumentHash' : ActorMethod<[bigint, string, string],
|
|
165
|
+
'verifyDocumentHash' : ActorMethod<[bigint, string, string], Result_1>,
|
|
166
|
+
'verifyOnChainIntegrity' : ActorMethod<[bigint], Result>,
|
|
157
167
|
}
|
|
158
168
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
159
169
|
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const idlFactory = ({ IDL }) => {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const Result_3 = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
|
|
3
|
+
const Result_7 = IDL.Variant({ 'ok' : IDL.Vec(IDL.Nat8), 'err' : IDL.Text });
|
|
4
4
|
const ActorType = IDL.Variant({
|
|
5
5
|
'agent' : IDL.Null,
|
|
6
6
|
'systemActor' : IDL.Null,
|
|
@@ -45,9 +45,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
45
45
|
'validUntil' : IDL.Opt(IDL.Int),
|
|
46
46
|
'transactionId' : IDL.Opt(IDL.Text),
|
|
47
47
|
});
|
|
48
|
-
const
|
|
48
|
+
const Result_6 = IDL.Variant({
|
|
49
49
|
'ok' : IDL.Record({
|
|
50
50
|
'id' : IDL.Nat,
|
|
51
|
+
'verified' : IDL.Bool,
|
|
51
52
|
'contentType' : IDL.Text,
|
|
52
53
|
'fileHash' : IDL.Text,
|
|
53
54
|
'fileName' : IDL.Text,
|
|
@@ -60,7 +61,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
60
61
|
}),
|
|
61
62
|
'err' : IDL.Text,
|
|
62
63
|
});
|
|
63
|
-
const
|
|
64
|
+
const Result_5 = IDL.Variant({
|
|
64
65
|
'ok' : IDL.Record({
|
|
65
66
|
'uploadedChunks' : IDL.Nat,
|
|
66
67
|
'totalChunks' : IDL.Nat,
|
|
@@ -69,8 +70,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
69
70
|
}),
|
|
70
71
|
'err' : IDL.Text,
|
|
71
72
|
});
|
|
72
|
-
const
|
|
73
|
-
const
|
|
73
|
+
const Result_4 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
|
|
74
|
+
const Result_2 = IDL.Variant({
|
|
74
75
|
'ok' : IDL.Record({
|
|
75
76
|
'uploadedChunks' : IDL.Nat,
|
|
76
77
|
'totalChunks' : IDL.Nat,
|
|
@@ -78,10 +79,18 @@ export const idlFactory = ({ IDL }) => {
|
|
|
78
79
|
}),
|
|
79
80
|
'err' : IDL.Text,
|
|
80
81
|
});
|
|
81
|
-
const
|
|
82
|
+
const Result_1 = IDL.Variant({ 'ok' : IDL.Bool, 'err' : IDL.Text });
|
|
83
|
+
const Result = IDL.Variant({
|
|
84
|
+
'ok' : IDL.Record({
|
|
85
|
+
'matches' : IDL.Bool,
|
|
86
|
+
'computedHash' : IDL.Text,
|
|
87
|
+
'registeredHash' : IDL.Text,
|
|
88
|
+
}),
|
|
89
|
+
'err' : IDL.Text,
|
|
90
|
+
});
|
|
82
91
|
return IDL.Service({
|
|
83
|
-
'deleteDocument' : IDL.Func([IDL.Nat, IDL.Text], [
|
|
84
|
-
'downloadDocumentChunk' : IDL.Func([IDL.Nat, IDL.Nat], [
|
|
92
|
+
'deleteDocument' : IDL.Func([IDL.Nat, IDL.Text], [Result_3], []),
|
|
93
|
+
'downloadDocumentChunk' : IDL.Func([IDL.Nat, IDL.Nat], [Result_7], []),
|
|
85
94
|
'generateCSRFToken' : IDL.Func([], [IDL.Text], []),
|
|
86
95
|
'getAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
|
|
87
96
|
'getCSRFToken' : IDL.Func([], [IDL.Opt(IDL.Text)], ['query']),
|
|
@@ -91,13 +100,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
91
100
|
[IDL.Opt(DocumentProof)],
|
|
92
101
|
['query'],
|
|
93
102
|
),
|
|
94
|
-
'getDocumentMetadata' : IDL.Func([IDL.Nat], [
|
|
103
|
+
'getDocumentMetadata' : IDL.Func([IDL.Nat], [Result_6], ['query']),
|
|
95
104
|
'getDocumentProof' : IDL.Func(
|
|
96
105
|
[IDL.Nat],
|
|
97
106
|
[IDL.Opt(DocumentProof)],
|
|
98
107
|
['query'],
|
|
99
108
|
),
|
|
100
|
-
'getDocumentUploadStatus' : IDL.Func([IDL.Nat], [
|
|
109
|
+
'getDocumentUploadStatus' : IDL.Func([IDL.Nat], [Result_5], ['query']),
|
|
101
110
|
'getDocumentVerificationCanister' : IDL.Func(
|
|
102
111
|
[],
|
|
103
112
|
[IDL.Opt(IDL.Principal)],
|
|
@@ -156,7 +165,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
156
165
|
[IDL.Opt(IDL.Principal)],
|
|
157
166
|
['query'],
|
|
158
167
|
),
|
|
159
|
-
'markDocumentDeleted' : IDL.Func([IDL.Nat, IDL.Text], [
|
|
168
|
+
'markDocumentDeleted' : IDL.Func([IDL.Nat, IDL.Text], [Result_3], []),
|
|
160
169
|
'recordAuditEntry' : IDL.Func(
|
|
161
170
|
[
|
|
162
171
|
ActorType,
|
|
@@ -166,7 +175,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
166
175
|
IDL.Bool,
|
|
167
176
|
IDL.Text,
|
|
168
177
|
],
|
|
169
|
-
[
|
|
178
|
+
[Result_4],
|
|
170
179
|
[],
|
|
171
180
|
),
|
|
172
181
|
'registerDocumentProof' : IDL.Func(
|
|
@@ -180,7 +189,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
180
189
|
IDL.Text,
|
|
181
190
|
IDL.Text,
|
|
182
191
|
],
|
|
183
|
-
[
|
|
192
|
+
[Result_4],
|
|
184
193
|
[],
|
|
185
194
|
),
|
|
186
195
|
'registerLandRegistryDocument' : IDL.Func(
|
|
@@ -195,36 +204,37 @@ export const idlFactory = ({ IDL }) => {
|
|
|
195
204
|
IDL.Opt(IDL.Int),
|
|
196
205
|
IDL.Nat,
|
|
197
206
|
],
|
|
198
|
-
[
|
|
207
|
+
[Result_4],
|
|
199
208
|
[],
|
|
200
209
|
),
|
|
201
210
|
'setDocumentVerificationCanister' : IDL.Func(
|
|
202
211
|
[IDL.Principal],
|
|
203
|
-
[
|
|
212
|
+
[Result_3],
|
|
204
213
|
[],
|
|
205
214
|
),
|
|
206
|
-
'setLandRegistryCanister' : IDL.Func([IDL.Principal], [
|
|
215
|
+
'setLandRegistryCanister' : IDL.Func([IDL.Principal], [Result_3], []),
|
|
207
216
|
'setTransactionManagerCanister' : IDL.Func(
|
|
208
217
|
[IDL.Principal, IDL.Text],
|
|
209
|
-
[
|
|
218
|
+
[Result_3],
|
|
210
219
|
[],
|
|
211
220
|
),
|
|
212
221
|
'setUserManagementCanister' : IDL.Func(
|
|
213
222
|
[IDL.Principal, IDL.Text],
|
|
214
|
-
[
|
|
223
|
+
[Result_3],
|
|
215
224
|
[],
|
|
216
225
|
),
|
|
217
226
|
'uploadDocumentChunk' : IDL.Func(
|
|
218
227
|
[IDL.Nat, IDL.Nat, IDL.Vec(IDL.Nat8), IDL.Text],
|
|
219
|
-
[
|
|
228
|
+
[Result_2],
|
|
220
229
|
[],
|
|
221
230
|
),
|
|
222
231
|
'validateCSRFToken' : IDL.Func([IDL.Text], [IDL.Bool], []),
|
|
223
232
|
'verifyDocumentHash' : IDL.Func(
|
|
224
233
|
[IDL.Nat, IDL.Text, IDL.Text],
|
|
225
|
-
[
|
|
234
|
+
[Result_1],
|
|
226
235
|
[],
|
|
227
236
|
),
|
|
237
|
+
'verifyOnChainIntegrity' : IDL.Func([IDL.Nat], [Result], []),
|
|
228
238
|
});
|
|
229
239
|
};
|
|
230
240
|
export const init = ({ IDL }) => { return []; };
|
|
@@ -196,6 +196,12 @@ service : {
|
|
|
196
196
|
err: text;
|
|
197
197
|
ok;
|
|
198
198
|
});
|
|
199
|
+
fetchDocument: (id: nat) -> (opt DocumentMetadata);
|
|
200
|
+
fetchDocumentVerifications: (documentId: nat) -> (vec DocumentVerification);
|
|
201
|
+
fetchPropertyDocuments: (propertyId: nat) -> (vec DocumentMetadata);
|
|
202
|
+
fetchUnverifiedDocuments: (propertyId: nat) -> (vec DocumentMetadata);
|
|
203
|
+
fetchVerification: (verificationId: nat) -> (opt DocumentVerification);
|
|
204
|
+
fetchVerificationsByTransaction: (txId: nat) -> (vec DocumentVerification);
|
|
199
205
|
getAuditLogs: () -> (vec AuditLog) query;
|
|
200
206
|
getConfiguration: () ->
|
|
201
207
|
(record {
|
|
@@ -204,12 +210,6 @@ service : {
|
|
|
204
210
|
}) query;
|
|
205
211
|
getCycles: () -> (nat) query;
|
|
206
212
|
getDocument: (id: nat) -> (opt DocumentMetadata) query;
|
|
207
|
-
fetchDocument: (id: nat) -> (opt DocumentMetadata);
|
|
208
|
-
fetchDocumentVerifications: (documentId: nat) -> (vec DocumentVerification);
|
|
209
|
-
fetchPropertyDocuments: (propertyId: nat) -> (vec DocumentMetadata);
|
|
210
|
-
fetchUnverifiedDocuments: (propertyId: nat) -> (vec DocumentMetadata);
|
|
211
|
-
fetchVerification: (verificationId: nat) -> (opt DocumentVerification);
|
|
212
|
-
fetchVerificationsByTransaction: (txId: nat) -> (vec DocumentVerification);
|
|
213
213
|
getDocumentVerifications: (documentId: nat) ->
|
|
214
214
|
(vec DocumentVerification) query;
|
|
215
215
|
getOscarVerificationDetails: (verificationId: nat) ->
|