@propxchain/core-client 0.4.0-canary.39 → 0.6.0-canary.43
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 +75 -18
- package/dist/canisters/user_management/user_management.did.js +93 -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 +64 -19
- package/src/canisters/user_management/user_management.did.d.ts +75 -18
- package/src/canisters/user_management/user_management.did.js +93 -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,35 @@ 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
|
+
'oauth' : IDL.Null,
|
|
55
|
+
'authMdIdJag' : IDL.Null,
|
|
56
|
+
'invite' : IDL.Null,
|
|
57
|
+
'authMdAnonymous' : IDL.Null,
|
|
58
|
+
});
|
|
59
|
+
const GrantTier = IDL.Variant({
|
|
60
|
+
'readOnly' : IDL.Null,
|
|
61
|
+
'consequential' : IDL.Null,
|
|
62
|
+
});
|
|
63
|
+
const AgentGrant = IDL.Record({
|
|
64
|
+
'status' : GrantStatus,
|
|
65
|
+
'clientId' : IDL.Opt(IDL.Text),
|
|
66
|
+
'expiresAt' : IDL.Opt(Time),
|
|
67
|
+
'source' : GrantSource,
|
|
68
|
+
'ownerPrincipal' : IDL.Opt(IDL.Principal),
|
|
69
|
+
'scopes' : IDL.Vec(IDL.Text),
|
|
70
|
+
'tier' : GrantTier,
|
|
71
|
+
'issuedAt' : Time,
|
|
72
|
+
'lastElevatedAt' : IDL.Opt(Time),
|
|
73
|
+
'agentPrincipal' : IDL.Principal,
|
|
74
|
+
});
|
|
47
75
|
const BotRole = IDL.Variant({
|
|
48
76
|
'BotFirm' : IDL.Null,
|
|
49
77
|
'BotInternal' : IDL.Null,
|
|
@@ -165,12 +193,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
165
193
|
'ok' : AdminRecord,
|
|
166
194
|
'err' : AdminMutationError,
|
|
167
195
|
});
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
'ok' : IDL.Record({ 'ownerPrincipal' : IDL.Principal, 'role' : BotRole }),
|
|
172
|
-
'err' : IDL.Text,
|
|
173
|
-
});
|
|
196
|
+
const Result_1 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
|
|
197
|
+
const Result_4 = IDL.Variant({ 'ok' : AgentGrant, 'err' : IDL.Text });
|
|
198
|
+
const Result_3 = IDL.Variant({ 'ok' : BotAgent, 'err' : IDL.Text });
|
|
174
199
|
return IDL.Service({
|
|
175
200
|
'addTransactionMember' : IDL.Func(
|
|
176
201
|
[IDL.Text, IDL.Principal, UserType, IDL.Bool, IDL.Bool, IDL.Text],
|
|
@@ -179,7 +204,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
179
204
|
),
|
|
180
205
|
'adminLinkPrincipals' : IDL.Func(
|
|
181
206
|
[IDL.Principal, IDL.Principal],
|
|
182
|
-
[
|
|
207
|
+
[Result],
|
|
183
208
|
[],
|
|
184
209
|
),
|
|
185
210
|
'amIAdmin' : IDL.Func([], [IDL.Bool], ['query']),
|
|
@@ -190,13 +215,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
190
215
|
['query'],
|
|
191
216
|
),
|
|
192
217
|
'checkPermissionWithAudit' : IDL.Func([Permission], [IDL.Bool], []),
|
|
193
|
-
'claimLinkCode' : IDL.Func([IDL.Text], [
|
|
218
|
+
'claimLinkCode' : IDL.Func([IDL.Text], [Result], []),
|
|
194
219
|
'createUserForPrincipal' : IDL.Func(
|
|
195
220
|
[IDL.Principal, IDL.Text, IDL.Text, IDL.Text, IDL.Text, IDL.Text],
|
|
196
221
|
[IDL.Bool],
|
|
197
222
|
[],
|
|
198
223
|
),
|
|
199
|
-
'deactivateBot' : IDL.Func([IDL.Principal], [
|
|
224
|
+
'deactivateBot' : IDL.Func([IDL.Principal], [Result_2], []),
|
|
200
225
|
'deleteUserByPrincipal' : IDL.Func(
|
|
201
226
|
[IDL.Principal, IDL.Text],
|
|
202
227
|
[IDL.Bool],
|
|
@@ -208,7 +233,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
208
233
|
[],
|
|
209
234
|
),
|
|
210
235
|
'generateCSRFToken' : IDL.Func([], [IDL.Text], []),
|
|
211
|
-
'generateLinkCode' : IDL.Func([], [
|
|
236
|
+
'generateLinkCode' : IDL.Func([], [Result], []),
|
|
237
|
+
'getAgentGrant' : IDL.Func(
|
|
238
|
+
[IDL.Principal],
|
|
239
|
+
[IDL.Opt(AgentGrant)],
|
|
240
|
+
['query'],
|
|
241
|
+
),
|
|
212
242
|
'getAllBots' : IDL.Func([], [IDL.Vec(BotAgent)], ['query']),
|
|
213
243
|
'getAllUsers' : IDL.Func([], [IDL.Vec(UserProfile)], ['query']),
|
|
214
244
|
'getAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
|
|
@@ -220,11 +250,18 @@ export const idlFactory = ({ IDL }) => {
|
|
|
220
250
|
'getBotAgent' : IDL.Func([IDL.Principal], [IDL.Opt(BotAgent)], ['query']),
|
|
221
251
|
'getCSRFToken' : IDL.Func([], [IDL.Opt(IDL.Text)], ['query']),
|
|
222
252
|
'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
|
|
253
|
+
'getGrantIssuer' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
|
|
223
254
|
'getLinkedPrincipals' : IDL.Func(
|
|
224
255
|
[IDL.Principal],
|
|
225
256
|
[IDL.Vec(IDL.Principal)],
|
|
226
257
|
['query'],
|
|
227
258
|
),
|
|
259
|
+
'getMemberRoleInTransaction' : IDL.Func(
|
|
260
|
+
[IDL.Principal, IDL.Text],
|
|
261
|
+
[IDL.Opt(UserType)],
|
|
262
|
+
['query'],
|
|
263
|
+
),
|
|
264
|
+
'getMyAgentGrants' : IDL.Func([], [IDL.Vec(AgentGrant)], ['query']),
|
|
228
265
|
'getMyBots' : IDL.Func([], [IDL.Vec(BotAgent)], ['query']),
|
|
229
266
|
'getMyLinkedPrincipals' : IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
|
|
230
267
|
'getMyManagingSolicitor' : IDL.Func([], [IDL.Opt(UserProfile)], ['query']),
|
|
@@ -265,7 +302,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
265
302
|
'listAdmins' : IDL.Func([], [IDL.Vec(AdminRecord)], ['query']),
|
|
266
303
|
'logBotAction' : IDL.Func(
|
|
267
304
|
[IDL.Principal, IDL.Text, IDL.Opt(IDL.Text), IDL.Bool, IDL.Text],
|
|
268
|
-
[
|
|
305
|
+
[Result_2],
|
|
269
306
|
[],
|
|
270
307
|
),
|
|
271
308
|
'myAdminRole' : IDL.Func([], [IDL.Opt(AdminRole)], ['query']),
|
|
@@ -274,7 +311,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
274
311
|
[AdminMutationResult],
|
|
275
312
|
[],
|
|
276
313
|
),
|
|
277
|
-
'reactivateBot' : IDL.Func([IDL.Principal], [
|
|
314
|
+
'reactivateBot' : IDL.Func([IDL.Principal], [Result_2], []),
|
|
278
315
|
'recordAuditEntry' : IDL.Func(
|
|
279
316
|
[
|
|
280
317
|
ActorType,
|
|
@@ -285,12 +322,43 @@ export const idlFactory = ({ IDL }) => {
|
|
|
285
322
|
IDL.Bool,
|
|
286
323
|
IDL.Text,
|
|
287
324
|
],
|
|
288
|
-
[
|
|
325
|
+
[Result_1],
|
|
326
|
+
[],
|
|
327
|
+
),
|
|
328
|
+
'recordGrantElevation' : IDL.Func(
|
|
329
|
+
[
|
|
330
|
+
IDL.Principal,
|
|
331
|
+
IDL.Principal,
|
|
332
|
+
GrantTier,
|
|
333
|
+
IDL.Vec(IDL.Text),
|
|
334
|
+
GrantSource,
|
|
335
|
+
IDL.Opt(Time),
|
|
336
|
+
IDL.Opt(IDL.Text),
|
|
337
|
+
],
|
|
338
|
+
[Result_4],
|
|
339
|
+
[],
|
|
340
|
+
),
|
|
341
|
+
'recordGrantIssued' : IDL.Func(
|
|
342
|
+
[
|
|
343
|
+
IDL.Principal,
|
|
344
|
+
IDL.Opt(IDL.Principal),
|
|
345
|
+
GrantTier,
|
|
346
|
+
IDL.Vec(IDL.Text),
|
|
347
|
+
GrantStatus,
|
|
348
|
+
GrantSource,
|
|
349
|
+
IDL.Opt(Time),
|
|
350
|
+
],
|
|
351
|
+
[Result_4],
|
|
352
|
+
[],
|
|
353
|
+
),
|
|
354
|
+
'recordGrantRevocation' : IDL.Func(
|
|
355
|
+
[IDL.Principal, IDL.Text],
|
|
356
|
+
[Result_2],
|
|
289
357
|
[],
|
|
290
358
|
),
|
|
291
359
|
'registerBot' : IDL.Func(
|
|
292
360
|
[IDL.Principal, IDL.Text, IDL.Text, BotRole],
|
|
293
|
-
[
|
|
361
|
+
[Result_3],
|
|
294
362
|
[],
|
|
295
363
|
),
|
|
296
364
|
'registerUser' : IDL.Func(
|
|
@@ -313,13 +381,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
313
381
|
[IDL.Bool],
|
|
314
382
|
[],
|
|
315
383
|
),
|
|
384
|
+
'repairTransactionMemberRole' : IDL.Func(
|
|
385
|
+
[IDL.Text, IDL.Principal, UserType],
|
|
386
|
+
[IDL.Bool],
|
|
387
|
+
[],
|
|
388
|
+
),
|
|
316
389
|
'resendVerificationEmail' : IDL.Func([IDL.Text], [IDL.Bool], []),
|
|
317
390
|
'revokeSolicitorAccess' : IDL.Func(
|
|
318
391
|
[IDL.Principal, IDL.Text],
|
|
319
392
|
[IDL.Bool],
|
|
320
393
|
[],
|
|
321
394
|
),
|
|
322
|
-
'
|
|
395
|
+
'setGrantIssuer' : IDL.Func([IDL.Principal], [Result_2], []),
|
|
396
|
+
'sweepStaleGrants' : IDL.Func([], [Result_1], []),
|
|
397
|
+
'unlinkPrincipal' : IDL.Func([IDL.Principal], [Result], []),
|
|
323
398
|
'updateMemberDocuments' : IDL.Func(
|
|
324
399
|
[IDL.Text, IDL.Text, IDL.Text],
|
|
325
400
|
[IDL.Bool],
|
|
@@ -333,7 +408,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
333
408
|
IDL.Opt(IDL.Text),
|
|
334
409
|
IDL.Opt(IDL.Text),
|
|
335
410
|
],
|
|
336
|
-
[
|
|
411
|
+
[Result],
|
|
337
412
|
[],
|
|
338
413
|
),
|
|
339
414
|
'updateTransactionMemberRequiredDocs' : IDL.Func(
|
|
@@ -342,7 +417,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
342
417
|
[],
|
|
343
418
|
),
|
|
344
419
|
'validateAdmin' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
|
|
345
|
-
'validateBot' : IDL.Func([IDL.Principal], [Result], ['query']),
|
|
346
420
|
'validateCSRFToken' : IDL.Func([IDL.Text], [IDL.Bool], []),
|
|
347
421
|
'verifyEmail' : IDL.Func([IDL.Text, IDL.Text], [IDL.Bool], []),
|
|
348
422
|
'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.6.0-canary.43",
|
|
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) ->
|