@propxchain/core-client 0.1.0-canary.6 → 0.2.0-canary.7
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/auth.d.ts +17 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +15 -0
- package/dist/auth.js.map +1 -0
- package/dist/canisters/document_verification/document_verification.did.d.ts +7 -0
- package/dist/canisters/document_verification/document_verification.did.d.ts.map +1 -0
- package/dist/canisters/document_verification/document_verification.did.js +96 -0
- package/dist/canisters/document_verification/document_verification.did.js.map +1 -0
- package/dist/canisters/document_verification/index.d.ts +4 -0
- package/dist/canisters/document_verification/index.d.ts.map +1 -0
- package/dist/canisters/document_verification/index.js +2 -0
- package/dist/canisters/document_verification/index.js.map +1 -0
- package/dist/canisters/email_service/email_service.did.d.ts +7 -0
- package/dist/canisters/email_service/email_service.did.d.ts.map +1 -0
- package/dist/canisters/email_service/email_service.did.js +36 -0
- package/dist/canisters/email_service/email_service.did.js.map +1 -0
- package/dist/canisters/email_service/index.d.ts +4 -0
- package/dist/canisters/email_service/index.d.ts.map +1 -0
- package/dist/canisters/email_service/index.js +2 -0
- package/dist/canisters/email_service/index.js.map +1 -0
- package/dist/canisters/land_registry_integration/index.d.ts +4 -0
- package/dist/canisters/land_registry_integration/index.d.ts.map +1 -0
- package/dist/canisters/land_registry_integration/index.js +2 -0
- package/dist/canisters/land_registry_integration/index.js.map +1 -0
- package/dist/canisters/land_registry_integration/land_registry_integration.did.d.ts +7 -0
- package/dist/canisters/land_registry_integration/land_registry_integration.did.d.ts.map +1 -0
- package/dist/canisters/land_registry_integration/land_registry_integration.did.js +145 -0
- package/dist/canisters/land_registry_integration/land_registry_integration.did.js.map +1 -0
- package/dist/canisters/property_registry/index.d.ts +4 -0
- package/dist/canisters/property_registry/index.d.ts.map +1 -0
- package/dist/canisters/property_registry/index.js +2 -0
- package/dist/canisters/property_registry/index.js.map +1 -0
- package/dist/canisters/property_registry/property_registry.did.d.ts +7 -0
- package/dist/canisters/property_registry/property_registry.did.d.ts.map +1 -0
- package/dist/canisters/property_registry/property_registry.did.js +58 -0
- package/dist/canisters/property_registry/property_registry.did.js.map +1 -0
- package/dist/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mock.d.ts +9 -1
- package/dist/mock.d.ts.map +1 -1
- package/dist/mock.js +42 -0
- package/dist/mock.js.map +1 -1
- package/dist/types.d.ts +13 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -1
- package/package.json +7 -1
- package/src/auth.ts +26 -0
- package/src/canisters/document_verification/document_verification.did +98 -0
- package/src/canisters/document_verification/document_verification.did.d.ts +112 -0
- package/src/canisters/document_verification/document_verification.did.js +139 -0
- package/src/canisters/document_verification/index.ts +5 -0
- package/src/canisters/email_service/email_service.did +37 -0
- package/src/canisters/email_service/email_service.did.d.ts +45 -0
- package/src/canisters/email_service/email_service.did.js +63 -0
- package/src/canisters/email_service/index.ts +5 -0
- package/src/canisters/land_registry_integration/index.ts +5 -0
- package/src/canisters/land_registry_integration/land_registry_integration.did +169 -0
- package/src/canisters/land_registry_integration/land_registry_integration.did.d.ts +157 -0
- package/src/canisters/land_registry_integration/land_registry_integration.did.js +182 -0
- package/src/canisters/property_registry/index.ts +5 -0
- package/src/canisters/property_registry/property_registry.did +78 -0
- package/src/canisters/property_registry/property_registry.did.d.ts +71 -0
- package/src/canisters/property_registry/property_registry.did.js +77 -0
- package/src/client.ts +29 -0
- package/src/index.ts +18 -0
- package/src/mock.ts +50 -0
- package/src/types.ts +20 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export { MockPropXchainClient, isMockEnabled, MOCK_ENV_FLAG, } from "./mock.js";
|
|
|
3
3
|
export { CoreClientError, wrapAgentError, type CoreClientErrorCode, } from "./errors.js";
|
|
4
4
|
export { withRetry, type RetryOptions } from "./retry.js";
|
|
5
5
|
export { createAuditTrailStub, createAgentHarnessStub, type AuditTrailStub, type AgentHarnessStub, type AuditEvent, type AuditFilter, } from "./stubs.js";
|
|
6
|
-
export { MAINNET_CANISTER_IDS, type CanisterIds, type IPropXchainClient, type PropXchainClientOptions, type TransactionManagerService, type DocumentStorageService, type UserManagementService, type LedgerManagerService, } from "./types.js";
|
|
6
|
+
export { MAINNET_CANISTER_IDS, type CanisterIds, type IPropXchainClient, type PropXchainClientOptions, type TransactionManagerService, type DocumentStorageService, type UserManagementService, type LedgerManagerService, type PropertyRegistryService, type DocumentVerificationService, type EmailServiceService, type LandRegistryIntegrationService, } from "./types.js";
|
|
7
|
+
export { Principal, Ed25519KeyIdentity, AuthClient, Actor, HttpAgent, type Identity, type ActorSubclass, type ActorConfig, type ActorMethod, type AuthClientCreateOptions, type AuthClientLoginOptions, type IdbStorage, } from "./auth.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,GACpC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,5 @@ export { CoreClientError, wrapAgentError, } from "./errors.js";
|
|
|
4
4
|
export { withRetry } from "./retry.js";
|
|
5
5
|
export { createAuditTrailStub, createAgentHarnessStub, } from "./stubs.js";
|
|
6
6
|
export { MAINNET_CANISTER_IDS, } from "./types.js";
|
|
7
|
+
export { Principal, Ed25519KeyIdentity, AuthClient, Actor, HttpAgent, } from "./auth.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAqB,MAAM,YAAY,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GAKvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAqB,MAAM,YAAY,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GAKvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,GAYrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,SAAS,GAQV,MAAM,WAAW,CAAC"}
|
package/dist/mock.d.ts
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import type { IPropXchainClient, TransactionManagerService, DocumentStorageService, UserManagementService, LedgerManagerService } from "./types.js";
|
|
1
|
+
import type { IPropXchainClient, TransactionManagerService, DocumentStorageService, UserManagementService, LedgerManagerService, PropertyRegistryService, DocumentVerificationService, EmailServiceService, LandRegistryIntegrationService } from "./types.js";
|
|
2
2
|
import { type AuditTrailStub, type AgentHarnessStub } from "./stubs.js";
|
|
3
3
|
export declare const MOCK_ENV_FLAG = "NEXT_PUBLIC_USE_MOCK";
|
|
4
4
|
export declare function createMockTransactionManager(): TransactionManagerService;
|
|
5
5
|
export declare function createMockDocumentStorage(): DocumentStorageService;
|
|
6
6
|
export declare function createMockUserManagement(): UserManagementService;
|
|
7
7
|
export declare function createMockLedgerManager(): LedgerManagerService;
|
|
8
|
+
export declare function createMockPropertyRegistry(): PropertyRegistryService;
|
|
9
|
+
export declare function createMockDocumentVerification(): DocumentVerificationService;
|
|
10
|
+
export declare function createMockEmailService(): EmailServiceService;
|
|
11
|
+
export declare function createMockLandRegistryIntegration(): LandRegistryIntegrationService;
|
|
8
12
|
export declare class MockPropXchainClient implements IPropXchainClient {
|
|
9
13
|
readonly transactionManager: TransactionManagerService;
|
|
10
14
|
readonly documentStorage: DocumentStorageService;
|
|
11
15
|
readonly userManagement: UserManagementService;
|
|
12
16
|
readonly ledgerManager: LedgerManagerService;
|
|
17
|
+
readonly propertyRegistry: PropertyRegistryService;
|
|
18
|
+
readonly documentVerification: DocumentVerificationService;
|
|
19
|
+
readonly emailService: EmailServiceService;
|
|
20
|
+
readonly landRegistryIntegration: LandRegistryIntegrationService;
|
|
13
21
|
readonly auditTrail: AuditTrailStub;
|
|
14
22
|
readonly agentHarness: AgentHarnessStub;
|
|
15
23
|
constructor();
|
package/dist/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,oB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AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAa,GAAG,OAAO,CAG1F"}
|
package/dist/mock.js
CHANGED
|
@@ -62,11 +62,49 @@ export function createMockLedgerManager() {
|
|
|
62
62
|
getCycles: async () => 600000000000n,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
+
export function createMockPropertyRegistry() {
|
|
66
|
+
return mockService({
|
|
67
|
+
getAllProperties: async () => [],
|
|
68
|
+
getProperty: async () => [],
|
|
69
|
+
verifyProperty: async () => false,
|
|
70
|
+
transferOwnership: async () => false,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export function createMockDocumentVerification() {
|
|
74
|
+
return mockService({
|
|
75
|
+
getPropertyDocuments: async () => [],
|
|
76
|
+
getUnverifiedDocuments: async () => [],
|
|
77
|
+
getDocumentVerifications: async () => [],
|
|
78
|
+
getStats: async () => ({
|
|
79
|
+
totalDocuments: 0n,
|
|
80
|
+
verifiedDocuments: 0n,
|
|
81
|
+
unverifiedDocuments: 0n,
|
|
82
|
+
}),
|
|
83
|
+
getAuditLogs: async () => [],
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
export function createMockEmailService() {
|
|
87
|
+
return mockService({
|
|
88
|
+
getAllNotifications: async () => [],
|
|
89
|
+
getUnprocessedCount: async () => 0n,
|
|
90
|
+
getUnprocessedNotifications: async () => [],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export function createMockLandRegistryIntegration() {
|
|
94
|
+
return mockService({
|
|
95
|
+
get_all_transactions: async () => [],
|
|
96
|
+
get_all_pending_land_registry_submissions: async () => [],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
65
99
|
export class MockPropXchainClient {
|
|
66
100
|
transactionManager;
|
|
67
101
|
documentStorage;
|
|
68
102
|
userManagement;
|
|
69
103
|
ledgerManager;
|
|
104
|
+
propertyRegistry;
|
|
105
|
+
documentVerification;
|
|
106
|
+
emailService;
|
|
107
|
+
landRegistryIntegration;
|
|
70
108
|
auditTrail;
|
|
71
109
|
agentHarness;
|
|
72
110
|
constructor() {
|
|
@@ -74,6 +112,10 @@ export class MockPropXchainClient {
|
|
|
74
112
|
this.documentStorage = createMockDocumentStorage();
|
|
75
113
|
this.userManagement = createMockUserManagement();
|
|
76
114
|
this.ledgerManager = createMockLedgerManager();
|
|
115
|
+
this.propertyRegistry = createMockPropertyRegistry();
|
|
116
|
+
this.documentVerification = createMockDocumentVerification();
|
|
117
|
+
this.emailService = createMockEmailService();
|
|
118
|
+
this.landRegistryIntegration = createMockLandRegistryIntegration();
|
|
77
119
|
this.auditTrail = createAuditTrailStub();
|
|
78
120
|
this.agentHarness = createAgentHarnessStub();
|
|
79
121
|
}
|
package/dist/mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAY/C,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GAGvB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAEpD,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACvD,MAAM,GAAG,GAAG,oBAA0B,CAAC,CAAC,0CAA0C;AAIlF;;;;GAIG;AACH,SAAS,WAAW,CAClB,SAA0C;IAE1C,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE;QACxB,GAAG,CAAC,OAAO,EAAE,IAAqB;YAChC,MAAM,QAAQ,GAAI,SAA4C,CAAC,IAAI,CAAC,CAAC;YACrE,IAAI,OAAO,QAAQ,KAAK,UAA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d,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC;IACtE,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,12 +3,20 @@ import type { TransactionManagerService } from "./canisters/transaction_manager/
|
|
|
3
3
|
import type { DocumentStorageService } from "./canisters/document_storage/index.js";
|
|
4
4
|
import type { UserManagementService } from "./canisters/user_management/index.js";
|
|
5
5
|
import type { LedgerManagerService } from "./canisters/ledger_manager/index.js";
|
|
6
|
+
import type { PropertyRegistryService } from "./canisters/property_registry/index.js";
|
|
7
|
+
import type { DocumentVerificationService } from "./canisters/document_verification/index.js";
|
|
8
|
+
import type { EmailServiceService } from "./canisters/email_service/index.js";
|
|
9
|
+
import type { LandRegistryIntegrationService } from "./canisters/land_registry_integration/index.js";
|
|
6
10
|
import type { AuditTrailStub, AgentHarnessStub } from "./stubs.js";
|
|
7
11
|
export interface CanisterIds {
|
|
8
12
|
transactionManager: string;
|
|
9
13
|
documentStorage: string;
|
|
10
14
|
userManagement: string;
|
|
11
15
|
ledgerManager: string;
|
|
16
|
+
propertyRegistry: string;
|
|
17
|
+
documentVerification: string;
|
|
18
|
+
emailService: string;
|
|
19
|
+
landRegistryIntegration: string;
|
|
12
20
|
}
|
|
13
21
|
export declare const MAINNET_CANISTER_IDS: CanisterIds;
|
|
14
22
|
export interface PropXchainClientOptions {
|
|
@@ -23,8 +31,12 @@ export interface IPropXchainClient {
|
|
|
23
31
|
readonly documentStorage: DocumentStorageService;
|
|
24
32
|
readonly userManagement: UserManagementService;
|
|
25
33
|
readonly ledgerManager: LedgerManagerService;
|
|
34
|
+
readonly propertyRegistry: PropertyRegistryService;
|
|
35
|
+
readonly documentVerification: DocumentVerificationService;
|
|
36
|
+
readonly emailService: EmailServiceService;
|
|
37
|
+
readonly landRegistryIntegration: LandRegistryIntegrationService;
|
|
26
38
|
readonly auditTrail: AuditTrailStub;
|
|
27
39
|
readonly agentHarness: AgentHarnessStub;
|
|
28
40
|
}
|
|
29
|
-
export type { TransactionManagerService, DocumentStorageService, UserManagementService, LedgerManagerService, };
|
|
41
|
+
export type { TransactionManagerService, DocumentStorageService, UserManagementService, LedgerManagerService, PropertyRegistryService, DocumentVerificationService, EmailServiceService, LandRegistryIntegrationService, };
|
|
30
42
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,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AAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C,QAAQ,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;CACzC;AAED,YAAY,EACV,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,EACnB,8BAA8B,GAC/B,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -3,5 +3,9 @@ export const MAINNET_CANISTER_IDS = {
|
|
|
3
3
|
documentStorage: "646az-pqaaa-aaaaa-qczja-cai",
|
|
4
4
|
userManagement: "lmizp-piaaa-aaaaa-qcwwq-cai",
|
|
5
5
|
ledgerManager: "hty74-maaaa-aaaaa-qcxza-cai",
|
|
6
|
+
propertyRegistry: "l6oow-dyaaa-aaaaa-qcwvq-cai",
|
|
7
|
+
documentVerification: "xand7-wiaaa-aaaah-arlea-cai",
|
|
8
|
+
emailService: "5by6v-qyaaa-aaaaa-qc65a-cai",
|
|
9
|
+
landRegistryIntegration: "o4flv-xaaaa-aaaaa-qdaeq-cai",
|
|
6
10
|
};
|
|
7
11
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,kBAAkB,EAAE,6BAA6B;IACjD,eAAe,EAAE,6BAA6B;IAC9C,cAAc,EAAE,6BAA6B;IAC7C,aAAa,EAAE,6BAA6B;IAC5C,gBAAgB,EAAE,6BAA6B;IAC/C,oBAAoB,EAAE,6BAA6B;IACnD,YAAY,EAAE,6BAA6B;IAC3C,uBAAuB,EAAE,6BAA6B;CACvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propxchain/core-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-canary.7",
|
|
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",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"./mock": {
|
|
15
15
|
"types": "./dist/mock.d.ts",
|
|
16
16
|
"import": "./dist/mock.js"
|
|
17
|
+
},
|
|
18
|
+
"./auth": {
|
|
19
|
+
"types": "./dist/auth.d.ts",
|
|
20
|
+
"import": "./dist/auth.js"
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
"files": [
|
|
@@ -32,7 +36,9 @@
|
|
|
32
36
|
},
|
|
33
37
|
"dependencies": {
|
|
34
38
|
"@dfinity/agent": "^3.4.1",
|
|
39
|
+
"@dfinity/auth-client": "^3.4.1",
|
|
35
40
|
"@dfinity/candid": "^3.4.1",
|
|
41
|
+
"@dfinity/identity": "^3.4.1",
|
|
36
42
|
"@dfinity/principal": "^3.4.1"
|
|
37
43
|
},
|
|
38
44
|
"devDependencies": {
|
package/src/auth.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth primitives re-exported from `@dfinity/*` so consumers do not need
|
|
3
|
+
* to depend on those packages directly. The consumer authenticates with
|
|
4
|
+
* either Internet Identity (via `AuthClient`) or an Ed25519 key pair
|
|
5
|
+
* (derived from a Supabase session), then hands the resulting `Identity`
|
|
6
|
+
* to `PropXchainClient`.
|
|
7
|
+
*
|
|
8
|
+
* Re-export surface is intentionally narrow. Anything not listed here is
|
|
9
|
+
* considered internal to core-client.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export { Principal } from "@dfinity/principal";
|
|
13
|
+
export { Ed25519KeyIdentity } from "@dfinity/identity";
|
|
14
|
+
export { AuthClient } from "@dfinity/auth-client";
|
|
15
|
+
export type {
|
|
16
|
+
AuthClientCreateOptions,
|
|
17
|
+
AuthClientLoginOptions,
|
|
18
|
+
IdbStorage,
|
|
19
|
+
} from "@dfinity/auth-client";
|
|
20
|
+
export { Actor, HttpAgent } from "@dfinity/agent";
|
|
21
|
+
export type {
|
|
22
|
+
Identity,
|
|
23
|
+
ActorSubclass,
|
|
24
|
+
ActorConfig,
|
|
25
|
+
ActorMethod,
|
|
26
|
+
} from "@dfinity/agent";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
type VerificationMethod =
|
|
2
|
+
variant {
|
|
3
|
+
commercial_api: text;
|
|
4
|
+
dvla_api;
|
|
5
|
+
manual_solicitor;
|
|
6
|
+
passport_dcs;
|
|
7
|
+
system_hash_only;
|
|
8
|
+
};
|
|
9
|
+
type Time = int;
|
|
10
|
+
type Result =
|
|
11
|
+
variant {
|
|
12
|
+
err: text;
|
|
13
|
+
ok: DocumentVerification;
|
|
14
|
+
};
|
|
15
|
+
type DocumentVerification =
|
|
16
|
+
record {
|
|
17
|
+
calculatedHash: text;
|
|
18
|
+
documentId: nat;
|
|
19
|
+
documentType: text;
|
|
20
|
+
expectedHash: text;
|
|
21
|
+
expiresAt: opt Time;
|
|
22
|
+
failureReason: opt text;
|
|
23
|
+
hashVerified: bool;
|
|
24
|
+
id: nat;
|
|
25
|
+
isValid: bool;
|
|
26
|
+
notes: opt text;
|
|
27
|
+
propertyId: nat;
|
|
28
|
+
verificationDate: Time;
|
|
29
|
+
verificationMethod: VerificationMethod;
|
|
30
|
+
verifiedBy: principal;
|
|
31
|
+
};
|
|
32
|
+
type DocumentMetadata =
|
|
33
|
+
record {
|
|
34
|
+
contentType: opt text;
|
|
35
|
+
documentHash: text;
|
|
36
|
+
documentType: text;
|
|
37
|
+
fileName: opt text;
|
|
38
|
+
fileSize: opt nat;
|
|
39
|
+
id: nat;
|
|
40
|
+
isVerified: bool;
|
|
41
|
+
lastVerificationId: opt nat;
|
|
42
|
+
propertyId: nat;
|
|
43
|
+
storageDocumentId: opt nat;
|
|
44
|
+
transactionId: opt nat;
|
|
45
|
+
uploadedAt: Time;
|
|
46
|
+
uploadedBy: principal;
|
|
47
|
+
};
|
|
48
|
+
type AuditLog =
|
|
49
|
+
record {
|
|
50
|
+
action: text;
|
|
51
|
+
details: text;
|
|
52
|
+
documentId: nat;
|
|
53
|
+
id: nat;
|
|
54
|
+
performedBy: principal;
|
|
55
|
+
success: bool;
|
|
56
|
+
timestamp: Time;
|
|
57
|
+
};
|
|
58
|
+
service : {
|
|
59
|
+
deleteDocument: (documentId: nat) -> (variant {
|
|
60
|
+
err: text;
|
|
61
|
+
ok;
|
|
62
|
+
});
|
|
63
|
+
getAuditLogs: () -> (vec AuditLog) query;
|
|
64
|
+
getConfiguration: () ->
|
|
65
|
+
(record {
|
|
66
|
+
documentStorage: opt principal;
|
|
67
|
+
userManagement: opt principal;
|
|
68
|
+
}) query;
|
|
69
|
+
getCycles: () -> (nat) query;
|
|
70
|
+
getDocument: (id: nat) -> (opt DocumentMetadata) query;
|
|
71
|
+
getDocumentVerifications: (documentId: nat) ->
|
|
72
|
+
(vec DocumentVerification) query;
|
|
73
|
+
getPropertyDocuments: (propertyId: nat) -> (vec DocumentMetadata) query;
|
|
74
|
+
getRecentAuditLogs: (limit: nat) -> (vec AuditLog) query;
|
|
75
|
+
getStats: () ->
|
|
76
|
+
(record {
|
|
77
|
+
totalAuditLogs: nat;
|
|
78
|
+
totalDocuments: nat;
|
|
79
|
+
totalVerifications: nat;
|
|
80
|
+
verifiedDocuments: nat;
|
|
81
|
+
}) query;
|
|
82
|
+
getUnverifiedDocuments: (propertyId: nat) -> (vec DocumentMetadata) query;
|
|
83
|
+
getVerification: (verificationId: nat) -> (opt DocumentVerification) query;
|
|
84
|
+
getVerificationsByVerifier: (verifier: principal) ->
|
|
85
|
+
(vec DocumentVerification) query;
|
|
86
|
+
registerDocument: (propertyId: nat, transactionId: opt nat, documentType:
|
|
87
|
+
text, documentHash: text, storageDocumentId: opt nat, fileName: opt text,
|
|
88
|
+
fileSize: opt nat, contentType: opt text) -> (nat);
|
|
89
|
+
setDocumentStorageCanister: (canisterId: principal) -> ();
|
|
90
|
+
setUserManagementCanister: (canisterId: principal) -> ();
|
|
91
|
+
verifyDocument: (documentId: nat) -> (bool);
|
|
92
|
+
verifyDocumentWithHash: (documentId: nat, notes: opt text) -> (Result);
|
|
93
|
+
verifyWithCommercialAPI: (_documentId: nat, _apiProvider: text,
|
|
94
|
+
_verificationData: text) -> (Result);
|
|
95
|
+
verifyWithDVLA: (_documentId: nat, _drivingLicenseNumber: text) -> (Result);
|
|
96
|
+
verifyWithPassportDCS: (_documentId: nat, _passportNumber: text) ->
|
|
97
|
+
(Result);
|
|
98
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Principal } from '@dfinity/principal';
|
|
2
|
+
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
import type { IDL } from '@dfinity/candid';
|
|
4
|
+
|
|
5
|
+
export interface AuditLog {
|
|
6
|
+
'id' : bigint,
|
|
7
|
+
'action' : string,
|
|
8
|
+
'performedBy' : Principal,
|
|
9
|
+
'timestamp' : Time,
|
|
10
|
+
'details' : string,
|
|
11
|
+
'success' : boolean,
|
|
12
|
+
'documentId' : bigint,
|
|
13
|
+
}
|
|
14
|
+
export interface DocumentMetadata {
|
|
15
|
+
'id' : bigint,
|
|
16
|
+
'documentHash' : string,
|
|
17
|
+
'documentType' : string,
|
|
18
|
+
'contentType' : [] | [string],
|
|
19
|
+
'propertyId' : bigint,
|
|
20
|
+
'fileName' : [] | [string],
|
|
21
|
+
'fileSize' : [] | [bigint],
|
|
22
|
+
'isVerified' : boolean,
|
|
23
|
+
'lastVerificationId' : [] | [bigint],
|
|
24
|
+
'storageDocumentId' : [] | [bigint],
|
|
25
|
+
'uploadedAt' : Time,
|
|
26
|
+
'uploadedBy' : Principal,
|
|
27
|
+
'transactionId' : [] | [bigint],
|
|
28
|
+
}
|
|
29
|
+
export interface DocumentVerification {
|
|
30
|
+
'id' : bigint,
|
|
31
|
+
'documentType' : string,
|
|
32
|
+
'verificationDate' : Time,
|
|
33
|
+
'expiresAt' : [] | [Time],
|
|
34
|
+
'failureReason' : [] | [string],
|
|
35
|
+
'propertyId' : bigint,
|
|
36
|
+
'hashVerified' : boolean,
|
|
37
|
+
'notes' : [] | [string],
|
|
38
|
+
'documentId' : bigint,
|
|
39
|
+
'isValid' : boolean,
|
|
40
|
+
'expectedHash' : string,
|
|
41
|
+
'calculatedHash' : string,
|
|
42
|
+
'verifiedBy' : Principal,
|
|
43
|
+
'verificationMethod' : VerificationMethod,
|
|
44
|
+
}
|
|
45
|
+
export type Result = { 'ok' : DocumentVerification } |
|
|
46
|
+
{ 'err' : string };
|
|
47
|
+
export type Time = bigint;
|
|
48
|
+
export type VerificationMethod = { 'passport_dcs' : null } |
|
|
49
|
+
{ 'commercial_api' : string } |
|
|
50
|
+
{ 'system_hash_only' : null } |
|
|
51
|
+
{ 'manual_solicitor' : null } |
|
|
52
|
+
{ 'dvla_api' : null };
|
|
53
|
+
export interface _SERVICE {
|
|
54
|
+
'deleteDocument' : ActorMethod<
|
|
55
|
+
[bigint],
|
|
56
|
+
{ 'ok' : null } |
|
|
57
|
+
{ 'err' : string }
|
|
58
|
+
>,
|
|
59
|
+
'getAuditLogs' : ActorMethod<[], Array<AuditLog>>,
|
|
60
|
+
'getConfiguration' : ActorMethod<
|
|
61
|
+
[],
|
|
62
|
+
{
|
|
63
|
+
'userManagement' : [] | [Principal],
|
|
64
|
+
'documentStorage' : [] | [Principal],
|
|
65
|
+
}
|
|
66
|
+
>,
|
|
67
|
+
'getCycles' : ActorMethod<[], bigint>,
|
|
68
|
+
'getDocument' : ActorMethod<[bigint], [] | [DocumentMetadata]>,
|
|
69
|
+
'getDocumentVerifications' : ActorMethod<
|
|
70
|
+
[bigint],
|
|
71
|
+
Array<DocumentVerification>
|
|
72
|
+
>,
|
|
73
|
+
'getPropertyDocuments' : ActorMethod<[bigint], Array<DocumentMetadata>>,
|
|
74
|
+
'getRecentAuditLogs' : ActorMethod<[bigint], Array<AuditLog>>,
|
|
75
|
+
'getStats' : ActorMethod<
|
|
76
|
+
[],
|
|
77
|
+
{
|
|
78
|
+
'totalVerifications' : bigint,
|
|
79
|
+
'totalAuditLogs' : bigint,
|
|
80
|
+
'verifiedDocuments' : bigint,
|
|
81
|
+
'totalDocuments' : bigint,
|
|
82
|
+
}
|
|
83
|
+
>,
|
|
84
|
+
'getUnverifiedDocuments' : ActorMethod<[bigint], Array<DocumentMetadata>>,
|
|
85
|
+
'getVerification' : ActorMethod<[bigint], [] | [DocumentVerification]>,
|
|
86
|
+
'getVerificationsByVerifier' : ActorMethod<
|
|
87
|
+
[Principal],
|
|
88
|
+
Array<DocumentVerification>
|
|
89
|
+
>,
|
|
90
|
+
'registerDocument' : ActorMethod<
|
|
91
|
+
[
|
|
92
|
+
bigint,
|
|
93
|
+
[] | [bigint],
|
|
94
|
+
string,
|
|
95
|
+
string,
|
|
96
|
+
[] | [bigint],
|
|
97
|
+
[] | [string],
|
|
98
|
+
[] | [bigint],
|
|
99
|
+
[] | [string],
|
|
100
|
+
],
|
|
101
|
+
bigint
|
|
102
|
+
>,
|
|
103
|
+
'setDocumentStorageCanister' : ActorMethod<[Principal], undefined>,
|
|
104
|
+
'setUserManagementCanister' : ActorMethod<[Principal], undefined>,
|
|
105
|
+
'verifyDocument' : ActorMethod<[bigint], boolean>,
|
|
106
|
+
'verifyDocumentWithHash' : ActorMethod<[bigint, [] | [string]], Result>,
|
|
107
|
+
'verifyWithCommercialAPI' : ActorMethod<[bigint, string, string], Result>,
|
|
108
|
+
'verifyWithDVLA' : ActorMethod<[bigint, string], Result>,
|
|
109
|
+
'verifyWithPassportDCS' : ActorMethod<[bigint, string], Result>,
|
|
110
|
+
}
|
|
111
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
112
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export const idlFactory = ({ IDL }) => {
|
|
2
|
+
const Time = IDL.Int;
|
|
3
|
+
const AuditLog = IDL.Record({
|
|
4
|
+
'id' : IDL.Nat,
|
|
5
|
+
'action' : IDL.Text,
|
|
6
|
+
'performedBy' : IDL.Principal,
|
|
7
|
+
'timestamp' : Time,
|
|
8
|
+
'details' : IDL.Text,
|
|
9
|
+
'success' : IDL.Bool,
|
|
10
|
+
'documentId' : IDL.Nat,
|
|
11
|
+
});
|
|
12
|
+
const DocumentMetadata = IDL.Record({
|
|
13
|
+
'id' : IDL.Nat,
|
|
14
|
+
'documentHash' : IDL.Text,
|
|
15
|
+
'documentType' : IDL.Text,
|
|
16
|
+
'contentType' : IDL.Opt(IDL.Text),
|
|
17
|
+
'propertyId' : IDL.Nat,
|
|
18
|
+
'fileName' : IDL.Opt(IDL.Text),
|
|
19
|
+
'fileSize' : IDL.Opt(IDL.Nat),
|
|
20
|
+
'isVerified' : IDL.Bool,
|
|
21
|
+
'lastVerificationId' : IDL.Opt(IDL.Nat),
|
|
22
|
+
'storageDocumentId' : IDL.Opt(IDL.Nat),
|
|
23
|
+
'uploadedAt' : Time,
|
|
24
|
+
'uploadedBy' : IDL.Principal,
|
|
25
|
+
'transactionId' : IDL.Opt(IDL.Nat),
|
|
26
|
+
});
|
|
27
|
+
const VerificationMethod = IDL.Variant({
|
|
28
|
+
'passport_dcs' : IDL.Null,
|
|
29
|
+
'commercial_api' : IDL.Text,
|
|
30
|
+
'system_hash_only' : IDL.Null,
|
|
31
|
+
'manual_solicitor' : IDL.Null,
|
|
32
|
+
'dvla_api' : IDL.Null,
|
|
33
|
+
});
|
|
34
|
+
const DocumentVerification = IDL.Record({
|
|
35
|
+
'id' : IDL.Nat,
|
|
36
|
+
'documentType' : IDL.Text,
|
|
37
|
+
'verificationDate' : Time,
|
|
38
|
+
'expiresAt' : IDL.Opt(Time),
|
|
39
|
+
'failureReason' : IDL.Opt(IDL.Text),
|
|
40
|
+
'propertyId' : IDL.Nat,
|
|
41
|
+
'hashVerified' : IDL.Bool,
|
|
42
|
+
'notes' : IDL.Opt(IDL.Text),
|
|
43
|
+
'documentId' : IDL.Nat,
|
|
44
|
+
'isValid' : IDL.Bool,
|
|
45
|
+
'expectedHash' : IDL.Text,
|
|
46
|
+
'calculatedHash' : IDL.Text,
|
|
47
|
+
'verifiedBy' : IDL.Principal,
|
|
48
|
+
'verificationMethod' : VerificationMethod,
|
|
49
|
+
});
|
|
50
|
+
const Result = IDL.Variant({ 'ok' : DocumentVerification, 'err' : IDL.Text });
|
|
51
|
+
return IDL.Service({
|
|
52
|
+
'deleteDocument' : IDL.Func(
|
|
53
|
+
[IDL.Nat],
|
|
54
|
+
[IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text })],
|
|
55
|
+
[],
|
|
56
|
+
),
|
|
57
|
+
'getAuditLogs' : IDL.Func([], [IDL.Vec(AuditLog)], ['query']),
|
|
58
|
+
'getConfiguration' : IDL.Func(
|
|
59
|
+
[],
|
|
60
|
+
[
|
|
61
|
+
IDL.Record({
|
|
62
|
+
'userManagement' : IDL.Opt(IDL.Principal),
|
|
63
|
+
'documentStorage' : IDL.Opt(IDL.Principal),
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
['query'],
|
|
67
|
+
),
|
|
68
|
+
'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
|
|
69
|
+
'getDocument' : IDL.Func([IDL.Nat], [IDL.Opt(DocumentMetadata)], ['query']),
|
|
70
|
+
'getDocumentVerifications' : IDL.Func(
|
|
71
|
+
[IDL.Nat],
|
|
72
|
+
[IDL.Vec(DocumentVerification)],
|
|
73
|
+
['query'],
|
|
74
|
+
),
|
|
75
|
+
'getPropertyDocuments' : IDL.Func(
|
|
76
|
+
[IDL.Nat],
|
|
77
|
+
[IDL.Vec(DocumentMetadata)],
|
|
78
|
+
['query'],
|
|
79
|
+
),
|
|
80
|
+
'getRecentAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
|
|
81
|
+
'getStats' : IDL.Func(
|
|
82
|
+
[],
|
|
83
|
+
[
|
|
84
|
+
IDL.Record({
|
|
85
|
+
'totalVerifications' : IDL.Nat,
|
|
86
|
+
'totalAuditLogs' : IDL.Nat,
|
|
87
|
+
'verifiedDocuments' : IDL.Nat,
|
|
88
|
+
'totalDocuments' : IDL.Nat,
|
|
89
|
+
}),
|
|
90
|
+
],
|
|
91
|
+
['query'],
|
|
92
|
+
),
|
|
93
|
+
'getUnverifiedDocuments' : IDL.Func(
|
|
94
|
+
[IDL.Nat],
|
|
95
|
+
[IDL.Vec(DocumentMetadata)],
|
|
96
|
+
['query'],
|
|
97
|
+
),
|
|
98
|
+
'getVerification' : IDL.Func(
|
|
99
|
+
[IDL.Nat],
|
|
100
|
+
[IDL.Opt(DocumentVerification)],
|
|
101
|
+
['query'],
|
|
102
|
+
),
|
|
103
|
+
'getVerificationsByVerifier' : IDL.Func(
|
|
104
|
+
[IDL.Principal],
|
|
105
|
+
[IDL.Vec(DocumentVerification)],
|
|
106
|
+
['query'],
|
|
107
|
+
),
|
|
108
|
+
'registerDocument' : IDL.Func(
|
|
109
|
+
[
|
|
110
|
+
IDL.Nat,
|
|
111
|
+
IDL.Opt(IDL.Nat),
|
|
112
|
+
IDL.Text,
|
|
113
|
+
IDL.Text,
|
|
114
|
+
IDL.Opt(IDL.Nat),
|
|
115
|
+
IDL.Opt(IDL.Text),
|
|
116
|
+
IDL.Opt(IDL.Nat),
|
|
117
|
+
IDL.Opt(IDL.Text),
|
|
118
|
+
],
|
|
119
|
+
[IDL.Nat],
|
|
120
|
+
[],
|
|
121
|
+
),
|
|
122
|
+
'setDocumentStorageCanister' : IDL.Func([IDL.Principal], [], []),
|
|
123
|
+
'setUserManagementCanister' : IDL.Func([IDL.Principal], [], []),
|
|
124
|
+
'verifyDocument' : IDL.Func([IDL.Nat], [IDL.Bool], []),
|
|
125
|
+
'verifyDocumentWithHash' : IDL.Func(
|
|
126
|
+
[IDL.Nat, IDL.Opt(IDL.Text)],
|
|
127
|
+
[Result],
|
|
128
|
+
[],
|
|
129
|
+
),
|
|
130
|
+
'verifyWithCommercialAPI' : IDL.Func(
|
|
131
|
+
[IDL.Nat, IDL.Text, IDL.Text],
|
|
132
|
+
[Result],
|
|
133
|
+
[],
|
|
134
|
+
),
|
|
135
|
+
'verifyWithDVLA' : IDL.Func([IDL.Nat, IDL.Text], [Result], []),
|
|
136
|
+
'verifyWithPassportDCS' : IDL.Func([IDL.Nat, IDL.Text], [Result], []),
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
export const init = ({ IDL }) => { return []; };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
type EmailNotification =
|
|
2
|
+
record {
|
|
3
|
+
company: opt text;
|
|
4
|
+
contactType: ContactType;
|
|
5
|
+
email: text;
|
|
6
|
+
id: nat;
|
|
7
|
+
message: text;
|
|
8
|
+
name: text;
|
|
9
|
+
partnerType: opt text;
|
|
10
|
+
phone: opt text;
|
|
11
|
+
processed: bool;
|
|
12
|
+
subject: text;
|
|
13
|
+
timestamp: int;
|
|
14
|
+
userType: opt text;
|
|
15
|
+
volume: opt text;
|
|
16
|
+
website: opt text;
|
|
17
|
+
};
|
|
18
|
+
type ContactType =
|
|
19
|
+
variant {
|
|
20
|
+
partners;
|
|
21
|
+
sales;
|
|
22
|
+
support;
|
|
23
|
+
};
|
|
24
|
+
service : {
|
|
25
|
+
formatNotificationAsEmail: (id: nat) -> (opt text) query;
|
|
26
|
+
getAllNotifications: () -> (vec EmailNotification) query;
|
|
27
|
+
getNotification: (id: nat) -> (opt EmailNotification) query;
|
|
28
|
+
getUnprocessedCount: () -> (nat) query;
|
|
29
|
+
getUnprocessedNotifications: () -> (vec EmailNotification) query;
|
|
30
|
+
markAsProcessed: (id: nat) -> (bool);
|
|
31
|
+
submitPartnerInquiry: (name: text, email: text, company: text, website:
|
|
32
|
+
text, partnerType: text, message: text) -> (nat);
|
|
33
|
+
submitSalesInquiry: (name: text, email: text, company: text, phone:
|
|
34
|
+
text, userType: text, volume: text, message: text) -> (nat);
|
|
35
|
+
submitSupportRequest: (name: text, email: text, subject: text, message:
|
|
36
|
+
text) -> (nat);
|
|
37
|
+
}
|