@sphereon/ssi-sdk.data-store 0.18.2-unstable.7 → 0.18.2-unstable.85
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/LICENSE +201 -201
- package/README.md +77 -77
- package/dist/contact/AbstractContactStore.d.ts +33 -23
- package/dist/contact/AbstractContactStore.d.ts.map +1 -1
- package/dist/contact/AbstractContactStore.js +6 -6
- package/dist/contact/AbstractContactStore.js.map +1 -1
- package/dist/contact/ContactStore.d.ts +44 -32
- package/dist/contact/ContactStore.d.ts.map +1 -1
- package/dist/contact/ContactStore.js +528 -365
- package/dist/contact/ContactStore.js.map +1 -1
- package/dist/digitalCredential/AbstractDigitalCredentialStore.d.ts +10 -0
- package/dist/digitalCredential/AbstractDigitalCredentialStore.d.ts.map +1 -0
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js +7 -0
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js.map +1 -0
- package/dist/digitalCredential/DigitalCredentialStore.d.ts +15 -0
- package/dist/digitalCredential/DigitalCredentialStore.d.ts.map +1 -0
- package/dist/digitalCredential/DigitalCredentialStore.js +97 -0
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -0
- package/dist/entities/contact/BaseConfigEntity.d.ts +6 -6
- package/dist/entities/contact/BaseConfigEntity.js +33 -33
- package/dist/entities/contact/BaseContactEntity.d.ts +9 -9
- package/dist/entities/contact/BaseContactEntity.js +53 -53
- package/dist/entities/contact/ConnectionEntity.d.ts +10 -10
- package/dist/entities/contact/ConnectionEntity.js +46 -46
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +10 -10
- package/dist/entities/contact/CorrelationIdentifierEntity.js +71 -71
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +6 -6
- package/dist/entities/contact/DidAuthConfigEntity.js +32 -32
- package/dist/entities/contact/ElectronicAddressEntity.d.ts +14 -13
- package/dist/entities/contact/ElectronicAddressEntity.d.ts.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +95 -91
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IdentityEntity.d.ts +20 -20
- package/dist/entities/contact/IdentityEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +128 -128
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +9 -9
- package/dist/entities/contact/IdentityMetadataItemEntity.js +68 -68
- package/dist/entities/contact/NaturalPersonEntity.d.ts +8 -8
- package/dist/entities/contact/NaturalPersonEntity.js +71 -71
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +10 -10
- package/dist/entities/contact/OpenIdConfigEntity.js +48 -48
- package/dist/entities/contact/OrganizationEntity.d.ts +8 -8
- package/dist/entities/contact/OrganizationEntity.js +66 -66
- package/dist/entities/contact/PartyEntity.d.ts +21 -19
- package/dist/entities/contact/PartyEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyEntity.js +142 -131
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.d.ts +12 -12
- package/dist/entities/contact/PartyRelationshipEntity.js +94 -94
- package/dist/entities/contact/PartyTypeEntity.d.ts +14 -14
- package/dist/entities/contact/PartyTypeEntity.js +103 -103
- package/dist/entities/contact/PhysicalAddressEntity.d.ts +21 -0
- package/dist/entities/contact/PhysicalAddressEntity.d.ts.map +1 -0
- package/dist/entities/contact/PhysicalAddressEntity.js +126 -0
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -0
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts +23 -0
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -0
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +93 -0
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -0
- package/dist/entities/eventLogger/AuditEventEntity.d.ts +26 -26
- package/dist/entities/eventLogger/AuditEventEntity.js +123 -123
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +10 -10
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +73 -73
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts +17 -17
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +119 -119
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +14 -14
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +101 -101
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +48 -48
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +13 -13
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +91 -91
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +38 -38
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +13 -13
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +94 -94
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +48 -48
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +8 -8
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +61 -61
- package/dist/entities/statusList2021/StatusList2021Entity.d.ts +18 -18
- package/dist/entities/statusList2021/StatusList2021Entity.js +114 -114
- package/dist/entities/statusList2021/StatusList2021EntryEntity.d.ts +10 -10
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js +50 -50
- package/dist/entities/validators/index.d.ts +6 -6
- package/dist/entities/validators/index.js +26 -26
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts +6 -6
- package/dist/eventLogger/AbstractEventLoggerStore.js +6 -6
- package/dist/eventLogger/EventLoggerStore.d.ts +12 -12
- package/dist/eventLogger/EventLoggerStore.js +43 -43
- package/dist/index.d.ts +45 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +143 -127
- package/dist/index.js.map +1 -1
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts +19 -19
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +6 -6
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +30 -30
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.js +390 -374
- package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -1
- package/dist/migrations/generic/1-CreateContacts.d.ts +6 -6
- package/dist/migrations/generic/1-CreateContacts.js +77 -77
- package/dist/migrations/generic/2-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/generic/2-CreateIssuanceBranding.js +77 -77
- package/dist/migrations/generic/3-CreateContacts.d.ts +6 -6
- package/dist/migrations/generic/3-CreateContacts.js +77 -77
- package/dist/migrations/generic/4-CreateStatusList.d.ts +6 -6
- package/dist/migrations/generic/4-CreateStatusList.js +71 -71
- package/dist/migrations/generic/5-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/generic/5-CreateAuditEvents.js +77 -77
- package/dist/migrations/generic/{2-CreateContacts.d.ts → 6-CreateDigitalCredential.d.ts} +2 -2
- package/dist/migrations/generic/6-CreateDigitalCredential.d.ts.map +1 -0
- package/dist/migrations/generic/{2-CreateContacts.js → 6-CreateDigitalCredential.js} +23 -23
- package/dist/migrations/generic/6-CreateDigitalCredential.js.map +1 -0
- package/dist/migrations/generic/index.d.ts +18 -16
- package/dist/migrations/generic/index.d.ts.map +1 -1
- package/dist/migrations/generic/index.js +30 -27
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +10 -5
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -6
- package/dist/migrations/internal-migrations-ormconfig.js +26 -26
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +6 -6
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +56 -56
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +68 -68
- package/dist/migrations/postgres/1690925872592-CreateContacts.d.ts +6 -6
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +68 -68
- package/dist/migrations/postgres/1693866470001-CreateStatusList.d.ts +6 -6
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js +31 -31
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +42 -42
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/{generic/3-CreateStatusList.d.ts → postgres/1708525189001-CreateDigitalCredential.d.ts} +2 -2
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.d.ts.map +1 -0
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +59 -0
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +6 -6
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +78 -78
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts +6 -6
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +88 -88
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts +6 -6
- package/dist/migrations/sqlite/1690925872693-CreateContacts.d.ts.map +1 -1
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +104 -107
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.d.ts +6 -6
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +31 -31
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts +6 -6
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +28 -28
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/{postgres/CreateStatusList1693866470001-CreateStatusList.d.ts → sqlite/1708525189002-CreateDigitalCredential.d.ts} +2 -2
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.d.ts.map +1 -0
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +50 -0
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js.map +1 -0
- package/dist/statusList/IStatusListStore.d.ts +19 -19
- package/dist/statusList/IStatusListStore.js +2 -2
- package/dist/statusList/StatusListStore.d.ts +35 -35
- package/dist/statusList/StatusListStore.js +212 -212
- package/dist/types/contact/IAbstractContactStore.d.ts +109 -74
- package/dist/types/contact/IAbstractContactStore.d.ts.map +1 -1
- package/dist/types/contact/IAbstractContactStore.js +2 -2
- package/dist/types/contact/contact.d.ts +196 -173
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js +25 -25
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.d.ts +27 -0
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.d.ts.map +1 -0
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.js +3 -0
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.js.map +1 -0
- package/dist/types/digitalCredential/digitalCredential.d.ts +41 -0
- package/dist/types/digitalCredential/digitalCredential.d.ts.map +1 -0
- package/dist/types/digitalCredential/digitalCredential.js +28 -0
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -0
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -9
- package/dist/types/eventLogger/IAbstractEventLoggerStore.js +2 -2
- package/dist/types/eventLogger/eventLogger.d.ts +2 -2
- package/dist/types/eventLogger/eventLogger.js +2 -2
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.js +25 -25
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts +58 -58
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +2 -2
- package/dist/types/issuanceBranding/issuanceBranding.d.ts +114 -114
- package/dist/types/issuanceBranding/issuanceBranding.js +2 -2
- package/dist/types/statusList/IAbstractStatusListStore.d.ts +37 -37
- package/dist/types/statusList/IAbstractStatusListStore.js +2 -2
- package/dist/types/statusList/statusList.d.ts +24 -24
- package/dist/types/statusList/statusList.js +2 -2
- package/dist/types/validation/validation.d.ts +3 -3
- package/dist/types/validation/validation.js +2 -2
- package/dist/utils/ValidatorUtils.d.ts +3 -3
- package/dist/utils/ValidatorUtils.js +12 -12
- package/dist/utils/contact/MappingUtils.d.ts +49 -46
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.js +326 -290
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.d.ts +9 -0
- package/dist/utils/digitalCredential/MappingUtils.d.ts.map +1 -0
- package/dist/utils/digitalCredential/MappingUtils.js +92 -0
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -0
- package/package.json +5 -4
- package/src/__tests__/contact.entities.test.ts +323 -23
- package/src/__tests__/contact.store.test.ts +586 -10
- package/src/__tests__/digitalCredential.entities.test.ts +247 -0
- package/src/__tests__/digitalCredential.store.test.ts +194 -0
- package/src/__tests__/eventLogger.entities.test.ts +73 -73
- package/src/__tests__/eventLogger.store.test.ts +136 -136
- package/src/contact/AbstractContactStore.ts +38 -17
- package/src/contact/ContactStore.ts +715 -501
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +16 -0
- package/src/digitalCredential/DigitalCredentialStore.ts +107 -0
- package/src/entities/contact/ElectronicAddressEntity.ts +3 -0
- package/src/entities/contact/IdentityEntity.ts +1 -1
- package/src/entities/contact/PartyEntity.ts +11 -1
- package/src/entities/contact/PhysicalAddressEntity.ts +87 -0
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +64 -0
- package/src/entities/eventLogger/AuditEventEntity.ts +99 -99
- package/src/entities/statusList2021/StatusList2021Entity.ts +96 -96
- package/src/eventLogger/AbstractEventLoggerStore.ts +7 -7
- package/src/eventLogger/EventLoggerStore.ts +62 -62
- package/src/index.ts +131 -113
- package/src/issuanceBranding/IssuanceBrandingStore.ts +78 -62
- package/src/migrations/generic/1-CreateContacts.ts +66 -66
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +64 -64
- package/src/migrations/generic/3-CreateContacts.ts +66 -66
- package/src/migrations/generic/4-CreateStatusList.ts +54 -54
- package/src/migrations/generic/5-CreateAuditEvents.ts +66 -66
- package/src/migrations/generic/6-CreateDigitalCredential.ts +66 -0
- package/src/migrations/generic/index.ts +30 -27
- package/src/migrations/index.ts +8 -1
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +44 -0
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +158 -163
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +34 -0
- package/src/types/contact/IAbstractContactStore.ts +58 -8
- package/src/types/contact/contact.ts +29 -4
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +26 -0
- package/src/types/digitalCredential/digitalCredential.ts +45 -0
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
- package/src/types/eventLogger/eventLogger.ts +3 -3
- package/src/types/index.ts +9 -9
- package/src/utils/contact/MappingUtils.ts +39 -1
- package/src/utils/digitalCredential/MappingUtils.ts +112 -0
- package/dist/entities/contact/ContactEntity.d.ts +0 -16
- package/dist/entities/contact/ContactEntity.d.ts.map +0 -1
- package/dist/entities/contact/ContactEntity.js +0 -164
- package/dist/entities/contact/ContactEntity.js.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +0 -7
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +0 -1
- package/dist/migrations/generic/1-CreateIssuanceBranding.js +0 -96
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +0 -1
- package/dist/migrations/generic/2-CreateContacts.d.ts.map +0 -1
- package/dist/migrations/generic/2-CreateContacts.js.map +0 -1
- package/dist/migrations/generic/3-CreateStatusList.d.ts.map +0 -1
- package/dist/migrations/generic/3-CreateStatusList.js +0 -72
- package/dist/migrations/generic/3-CreateStatusList.js.map +0 -1
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.d.ts.map +0 -1
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js +0 -32
- package/dist/migrations/postgres/CreateStatusList1693866470001-CreateStatusList.js.map +0 -1
- package/dist/migrations/postgres/uuid.d.ts +0 -3
- package/dist/migrations/postgres/uuid.d.ts.map +0 -1
- package/dist/migrations/postgres/uuid.js +0 -25
- package/dist/migrations/postgres/uuid.js.map +0 -1
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.StatusListStore = void 0;
|
|
16
|
-
const debug_1 = __importDefault(require("debug"));
|
|
17
|
-
const typeorm_1 = require("typeorm");
|
|
18
|
-
const StatusList2021Entity_1 = require("../entities/statusList2021/StatusList2021Entity");
|
|
19
|
-
const StatusList2021EntryEntity_1 = require("../entities/statusList2021/StatusList2021EntryEntity");
|
|
20
|
-
const debug = (0, debug_1.default)('sphereon:ssi-sdk:data-store:status-list');
|
|
21
|
-
class StatusListStore {
|
|
22
|
-
constructor(dbConnection) {
|
|
23
|
-
this._dbConnection = dbConnection;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Get's the available status list indices from the provided indices. Meaning it will filter out any index that is already known.
|
|
27
|
-
*
|
|
28
|
-
* The idea is that the caller provides a set of random status list indices. We can relatively easy check against the DB in an optimized way.
|
|
29
|
-
* If the status list is large it is probably best ot also provide at least a good number of indices. So something like 10 or 20 values.
|
|
30
|
-
* Callers are also expected to call this function multiple times if it does not yield results
|
|
31
|
-
*
|
|
32
|
-
* @param args
|
|
33
|
-
*/
|
|
34
|
-
availableStatusListEntries(args) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const statusListIndex = Array.isArray(args.statusListIndex) ? args.statusListIndex : [args.statusListIndex];
|
|
37
|
-
const statusList = yield this.getStatusList(Object.assign(Object.assign({}, args), { id: args.statusListId }));
|
|
38
|
-
const repo = yield this.getStatusListEntryRepo();
|
|
39
|
-
const results = (yield repo.find({
|
|
40
|
-
where: {
|
|
41
|
-
statusList,
|
|
42
|
-
statusListIndex: (0, typeorm_1.In)(statusListIndex),
|
|
43
|
-
},
|
|
44
|
-
})).map((index) => index.statusListIndex);
|
|
45
|
-
return statusListIndex.filter((index) => !results.includes(index));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
addStatusListEntry(args) {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
return (yield this.getStatusListEntryRepo()).save(args);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
updateStatusListEntry(args) {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const statusListId = typeof args.statusList === 'string' ? args.statusList : args.statusList.id;
|
|
56
|
-
const result = yield this.getStatusListEntryByIndex(Object.assign(Object.assign({}, args), { statusListId, errorOnNotFound: false }));
|
|
57
|
-
const updatedEntry = {
|
|
58
|
-
value: args.value,
|
|
59
|
-
correlationId: args.correlationId,
|
|
60
|
-
credentialHash: args.credentialHash,
|
|
61
|
-
credentialId: args.credentialId,
|
|
62
|
-
};
|
|
63
|
-
const updateResult = yield (yield this.getStatusListEntryRepo()).upsert(Object.assign(Object.assign({}, (result !== null && result !== void 0 ? result : { statusList: args.statusList, statusListIndex: args.statusListIndex })), updatedEntry), { conflictPaths: ['statusList', 'statusListIndex'] });
|
|
64
|
-
console.log(updateResult);
|
|
65
|
-
return (yield this.getStatusListEntryByIndex(Object.assign(Object.assign({}, args), { statusListId, errorOnNotFound: true })));
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
getStatusListEntryByIndex(args) {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
if (!args.statusListId && !args.correlationId) {
|
|
71
|
-
throw Error(`Cannot get statusList entry if not either a statusList id or correlationId is provided`);
|
|
72
|
-
}
|
|
73
|
-
const result = yield (yield this.getStatusListEntryRepo()).findOne({
|
|
74
|
-
where: Object.assign(Object.assign(Object.assign({}, (args.statusListId && { statusList: args.statusListId })), (args.correlationId && { correlationId: args.correlationId })), { statusListIndex: args.statusListIndex }),
|
|
75
|
-
});
|
|
76
|
-
if (!result && args.errorOnNotFound) {
|
|
77
|
-
throw Error(`Could not find status list index ${args.statusListIndex} for status list id ${args.statusListId}`);
|
|
78
|
-
}
|
|
79
|
-
return result !== null && result !== void 0 ? result : undefined;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
removeStatusListEntryByIndex(args) {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
let error = false;
|
|
85
|
-
try {
|
|
86
|
-
yield this.getStatusListEntryByIndex(args); // only used to check it exists
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
89
|
-
error = true;
|
|
90
|
-
}
|
|
91
|
-
if (error) {
|
|
92
|
-
console.log(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
const result = yield (yield this.getStatusListEntryRepo()).delete(Object.assign(Object.assign(Object.assign({}, (args.statusListId && { statusList: args.statusListId })), (args.correlationId && { correlationId: args.correlationId })), { statusListIndex: args.statusListIndex }));
|
|
96
|
-
error = !result.affected || result.affected !== 1;
|
|
97
|
-
}
|
|
98
|
-
return !error;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
getStatusListEntryByCredentialId(args) {
|
|
102
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
const credentialId = args.credentialId;
|
|
104
|
-
if (!credentialId) {
|
|
105
|
-
throw Error('Can only get a credential by credentialId when a credentialId is supplied');
|
|
106
|
-
}
|
|
107
|
-
const statusList = yield this.getStatusList({ id: args.statusListId, correlationId: args.statusListCorrelationId });
|
|
108
|
-
const where = Object.assign(Object.assign({ statusList: statusList.id }, (args.entryCorrelationId && { correlationId: args.entryCorrelationId })), { credentialId });
|
|
109
|
-
console.log(`Entries: ${JSON.stringify(yield (yield this.getStatusListEntryRepo()).find(), null, 2)}`);
|
|
110
|
-
const result = yield (yield this.getStatusListEntryRepo()).findOne({ where });
|
|
111
|
-
if (!result && args.errorOnNotFound) {
|
|
112
|
-
throw Error(`Could not find status list credential id ${credentialId} for status list id ${statusList.id}`);
|
|
113
|
-
}
|
|
114
|
-
return result !== null && result !== void 0 ? result : undefined;
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
removeStatusListEntryByCredentialId(args) {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
let error = false;
|
|
120
|
-
try {
|
|
121
|
-
yield this.getStatusListEntryByCredentialId(args); // only used to check it exists
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
error = true;
|
|
125
|
-
}
|
|
126
|
-
if (!error) {
|
|
127
|
-
const result = yield (yield this.getStatusListEntryRepo()).delete(Object.assign(Object.assign(Object.assign({}, (args.statusListId && { statusList: args.statusListId })), (args.entryCorrelationId && { correlationId: args.entryCorrelationId })), { credentialId: args.credentialId }));
|
|
128
|
-
error = !result.affected || result.affected !== 1;
|
|
129
|
-
}
|
|
130
|
-
return !error;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
getStatusListEntries(args) {
|
|
134
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
return (yield this.getStatusListEntryRepo()).find({ where: Object.assign(Object.assign({}, args === null || args === void 0 ? void 0 : args.filter), { statusList: args.statusListId }) });
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
getStatusList(args) {
|
|
139
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
-
if (!args.id && !args.correlationId) {
|
|
141
|
-
throw Error(`At least and 'id' or 'correlationId' needs to be provided to lookup a status list`);
|
|
142
|
-
}
|
|
143
|
-
const where = [];
|
|
144
|
-
if (args.id) {
|
|
145
|
-
where.push({ id: args.id });
|
|
146
|
-
}
|
|
147
|
-
if (args.correlationId) {
|
|
148
|
-
where.push({ correlationId: args.correlationId });
|
|
149
|
-
}
|
|
150
|
-
const result = yield (yield this.getStatusListRepo()).findOne({ where });
|
|
151
|
-
if (!result) {
|
|
152
|
-
throw Error(`No status list found for id ${args.id}`);
|
|
153
|
-
}
|
|
154
|
-
return result;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
getStatusLists(args) {
|
|
158
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
-
const result = yield (yield this.getStatusListRepo()).find({
|
|
160
|
-
where: args.filter,
|
|
161
|
-
});
|
|
162
|
-
if (!result) {
|
|
163
|
-
return [];
|
|
164
|
-
}
|
|
165
|
-
return result;
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
addStatusList(args) {
|
|
169
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
const { id, correlationId } = args;
|
|
171
|
-
const result = yield (yield this.getStatusListRepo()).findOne({
|
|
172
|
-
where: [{ id }, { correlationId }],
|
|
173
|
-
});
|
|
174
|
-
if (result) {
|
|
175
|
-
throw Error(`Status list for id ${id}, correlationId ${correlationId} already exists`);
|
|
176
|
-
}
|
|
177
|
-
debug('Adding status list ', id);
|
|
178
|
-
const createdResult = yield (yield this.getStatusListRepo()).save(args);
|
|
179
|
-
return createdResult;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
updateStatusList(args) {
|
|
183
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
const result = yield this.getStatusList(args);
|
|
185
|
-
debug('Updating status list', result);
|
|
186
|
-
const updatedResult = yield (yield this.getStatusListRepo()).save(args, { transaction: true });
|
|
187
|
-
return updatedResult;
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
removeStatusList(args) {
|
|
191
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
-
const result = yield this.getStatusList(args);
|
|
193
|
-
yield (yield this.getStatusListRepo()).delete(result);
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
getDS() {
|
|
197
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
-
return yield this._dbConnection;
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
getStatusListRepo() {
|
|
202
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
return (yield this.getDS()).getRepository(StatusList2021Entity_1.StatusListEntity);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
getStatusListEntryRepo() {
|
|
207
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
-
return (yield this.getDS()).getRepository(StatusList2021EntryEntity_1.StatusListEntryEntity);
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
exports.StatusListStore = StatusListStore;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.StatusListStore = void 0;
|
|
16
|
+
const debug_1 = __importDefault(require("debug"));
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const StatusList2021Entity_1 = require("../entities/statusList2021/StatusList2021Entity");
|
|
19
|
+
const StatusList2021EntryEntity_1 = require("../entities/statusList2021/StatusList2021EntryEntity");
|
|
20
|
+
const debug = (0, debug_1.default)('sphereon:ssi-sdk:data-store:status-list');
|
|
21
|
+
class StatusListStore {
|
|
22
|
+
constructor(dbConnection) {
|
|
23
|
+
this._dbConnection = dbConnection;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get's the available status list indices from the provided indices. Meaning it will filter out any index that is already known.
|
|
27
|
+
*
|
|
28
|
+
* The idea is that the caller provides a set of random status list indices. We can relatively easy check against the DB in an optimized way.
|
|
29
|
+
* If the status list is large it is probably best ot also provide at least a good number of indices. So something like 10 or 20 values.
|
|
30
|
+
* Callers are also expected to call this function multiple times if it does not yield results
|
|
31
|
+
*
|
|
32
|
+
* @param args
|
|
33
|
+
*/
|
|
34
|
+
availableStatusListEntries(args) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const statusListIndex = Array.isArray(args.statusListIndex) ? args.statusListIndex : [args.statusListIndex];
|
|
37
|
+
const statusList = yield this.getStatusList(Object.assign(Object.assign({}, args), { id: args.statusListId }));
|
|
38
|
+
const repo = yield this.getStatusListEntryRepo();
|
|
39
|
+
const results = (yield repo.find({
|
|
40
|
+
where: {
|
|
41
|
+
statusList,
|
|
42
|
+
statusListIndex: (0, typeorm_1.In)(statusListIndex),
|
|
43
|
+
},
|
|
44
|
+
})).map((index) => index.statusListIndex);
|
|
45
|
+
return statusListIndex.filter((index) => !results.includes(index));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
addStatusListEntry(args) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return (yield this.getStatusListEntryRepo()).save(args);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
updateStatusListEntry(args) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const statusListId = typeof args.statusList === 'string' ? args.statusList : args.statusList.id;
|
|
56
|
+
const result = yield this.getStatusListEntryByIndex(Object.assign(Object.assign({}, args), { statusListId, errorOnNotFound: false }));
|
|
57
|
+
const updatedEntry = {
|
|
58
|
+
value: args.value,
|
|
59
|
+
correlationId: args.correlationId,
|
|
60
|
+
credentialHash: args.credentialHash,
|
|
61
|
+
credentialId: args.credentialId,
|
|
62
|
+
};
|
|
63
|
+
const updateResult = yield (yield this.getStatusListEntryRepo()).upsert(Object.assign(Object.assign({}, (result !== null && result !== void 0 ? result : { statusList: args.statusList, statusListIndex: args.statusListIndex })), updatedEntry), { conflictPaths: ['statusList', 'statusListIndex'] });
|
|
64
|
+
console.log(updateResult);
|
|
65
|
+
return (yield this.getStatusListEntryByIndex(Object.assign(Object.assign({}, args), { statusListId, errorOnNotFound: true })));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
getStatusListEntryByIndex(args) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
if (!args.statusListId && !args.correlationId) {
|
|
71
|
+
throw Error(`Cannot get statusList entry if not either a statusList id or correlationId is provided`);
|
|
72
|
+
}
|
|
73
|
+
const result = yield (yield this.getStatusListEntryRepo()).findOne({
|
|
74
|
+
where: Object.assign(Object.assign(Object.assign({}, (args.statusListId && { statusList: args.statusListId })), (args.correlationId && { correlationId: args.correlationId })), { statusListIndex: args.statusListIndex }),
|
|
75
|
+
});
|
|
76
|
+
if (!result && args.errorOnNotFound) {
|
|
77
|
+
throw Error(`Could not find status list index ${args.statusListIndex} for status list id ${args.statusListId}`);
|
|
78
|
+
}
|
|
79
|
+
return result !== null && result !== void 0 ? result : undefined;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
removeStatusListEntryByIndex(args) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
let error = false;
|
|
85
|
+
try {
|
|
86
|
+
yield this.getStatusListEntryByIndex(args); // only used to check it exists
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
error = true;
|
|
90
|
+
}
|
|
91
|
+
if (error) {
|
|
92
|
+
console.log(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const result = yield (yield this.getStatusListEntryRepo()).delete(Object.assign(Object.assign(Object.assign({}, (args.statusListId && { statusList: args.statusListId })), (args.correlationId && { correlationId: args.correlationId })), { statusListIndex: args.statusListIndex }));
|
|
96
|
+
error = !result.affected || result.affected !== 1;
|
|
97
|
+
}
|
|
98
|
+
return !error;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
getStatusListEntryByCredentialId(args) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const credentialId = args.credentialId;
|
|
104
|
+
if (!credentialId) {
|
|
105
|
+
throw Error('Can only get a credential by credentialId when a credentialId is supplied');
|
|
106
|
+
}
|
|
107
|
+
const statusList = yield this.getStatusList({ id: args.statusListId, correlationId: args.statusListCorrelationId });
|
|
108
|
+
const where = Object.assign(Object.assign({ statusList: statusList.id }, (args.entryCorrelationId && { correlationId: args.entryCorrelationId })), { credentialId });
|
|
109
|
+
console.log(`Entries: ${JSON.stringify(yield (yield this.getStatusListEntryRepo()).find(), null, 2)}`);
|
|
110
|
+
const result = yield (yield this.getStatusListEntryRepo()).findOne({ where });
|
|
111
|
+
if (!result && args.errorOnNotFound) {
|
|
112
|
+
throw Error(`Could not find status list credential id ${credentialId} for status list id ${statusList.id}`);
|
|
113
|
+
}
|
|
114
|
+
return result !== null && result !== void 0 ? result : undefined;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
removeStatusListEntryByCredentialId(args) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
let error = false;
|
|
120
|
+
try {
|
|
121
|
+
yield this.getStatusListEntryByCredentialId(args); // only used to check it exists
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
error = true;
|
|
125
|
+
}
|
|
126
|
+
if (!error) {
|
|
127
|
+
const result = yield (yield this.getStatusListEntryRepo()).delete(Object.assign(Object.assign(Object.assign({}, (args.statusListId && { statusList: args.statusListId })), (args.entryCorrelationId && { correlationId: args.entryCorrelationId })), { credentialId: args.credentialId }));
|
|
128
|
+
error = !result.affected || result.affected !== 1;
|
|
129
|
+
}
|
|
130
|
+
return !error;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
getStatusListEntries(args) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
return (yield this.getStatusListEntryRepo()).find({ where: Object.assign(Object.assign({}, args === null || args === void 0 ? void 0 : args.filter), { statusList: args.statusListId }) });
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
getStatusList(args) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
if (!args.id && !args.correlationId) {
|
|
141
|
+
throw Error(`At least and 'id' or 'correlationId' needs to be provided to lookup a status list`);
|
|
142
|
+
}
|
|
143
|
+
const where = [];
|
|
144
|
+
if (args.id) {
|
|
145
|
+
where.push({ id: args.id });
|
|
146
|
+
}
|
|
147
|
+
if (args.correlationId) {
|
|
148
|
+
where.push({ correlationId: args.correlationId });
|
|
149
|
+
}
|
|
150
|
+
const result = yield (yield this.getStatusListRepo()).findOne({ where });
|
|
151
|
+
if (!result) {
|
|
152
|
+
throw Error(`No status list found for id ${args.id}`);
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
getStatusLists(args) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
const result = yield (yield this.getStatusListRepo()).find({
|
|
160
|
+
where: args.filter,
|
|
161
|
+
});
|
|
162
|
+
if (!result) {
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
165
|
+
return result;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
addStatusList(args) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
const { id, correlationId } = args;
|
|
171
|
+
const result = yield (yield this.getStatusListRepo()).findOne({
|
|
172
|
+
where: [{ id }, { correlationId }],
|
|
173
|
+
});
|
|
174
|
+
if (result) {
|
|
175
|
+
throw Error(`Status list for id ${id}, correlationId ${correlationId} already exists`);
|
|
176
|
+
}
|
|
177
|
+
debug('Adding status list ', id);
|
|
178
|
+
const createdResult = yield (yield this.getStatusListRepo()).save(args);
|
|
179
|
+
return createdResult;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
updateStatusList(args) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
const result = yield this.getStatusList(args);
|
|
185
|
+
debug('Updating status list', result);
|
|
186
|
+
const updatedResult = yield (yield this.getStatusListRepo()).save(args, { transaction: true });
|
|
187
|
+
return updatedResult;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
removeStatusList(args) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
const result = yield this.getStatusList(args);
|
|
193
|
+
yield (yield this.getStatusListRepo()).delete(result);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
getDS() {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
return yield this._dbConnection;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
getStatusListRepo() {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
return (yield this.getDS()).getRepository(StatusList2021Entity_1.StatusListEntity);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
getStatusListEntryRepo() {
|
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
return (yield this.getDS()).getRepository(StatusList2021EntryEntity_1.StatusListEntryEntity);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.StatusListStore = StatusListStore;
|
|
213
213
|
//# sourceMappingURL=StatusListStore.js.map
|
|
@@ -1,75 +1,110 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type FindPartyArgs = Array<PartialParty>;
|
|
3
|
-
export type FindIdentityArgs = Array<PartialIdentity>;
|
|
4
|
-
export type FindPartyTypeArgs = Array<PartialPartyType>;
|
|
5
|
-
export type FindRelationshipArgs = Array<PartialPartyRelationship>;
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
export type
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
export type
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
export type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
identity:
|
|
37
|
-
};
|
|
38
|
-
export type
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
export type
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
export type
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
export type
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
export type
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
export type
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
export type
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
export type
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
export type
|
|
73
|
-
|
|
74
|
-
};
|
|
1
|
+
import { ElectronicAddress, Identity, NonPersistedContact, NonPersistedElectronicAddress, NonPersistedIdentity, NonPersistedPartyType, NonPersistedPhysicalAddress, PartialElectronicAddress, PartialIdentity, PartialParty, PartialPartyRelationship, PartialPartyType, PartialPhysicalAddress, Party, PartyRelationship, PartyType, PartyTypeEnum, PhysicalAddress } from './contact';
|
|
2
|
+
export type FindPartyArgs = Array<PartialParty>;
|
|
3
|
+
export type FindIdentityArgs = Array<PartialIdentity>;
|
|
4
|
+
export type FindPartyTypeArgs = Array<PartialPartyType>;
|
|
5
|
+
export type FindRelationshipArgs = Array<PartialPartyRelationship>;
|
|
6
|
+
export type FindElectronicAddressArgs = Array<PartialElectronicAddress>;
|
|
7
|
+
export type FindPhysicalAddressArgs = Array<PartialPhysicalAddress>;
|
|
8
|
+
export type GetPartyArgs = {
|
|
9
|
+
partyId: string;
|
|
10
|
+
};
|
|
11
|
+
export type GetPartiesArgs = {
|
|
12
|
+
filter?: FindPartyArgs;
|
|
13
|
+
};
|
|
14
|
+
export type AddPartyArgs = {
|
|
15
|
+
uri?: string;
|
|
16
|
+
partyType: NonPersistedPartyType;
|
|
17
|
+
contact: NonPersistedContact;
|
|
18
|
+
identities?: Array<NonPersistedIdentity>;
|
|
19
|
+
electronicAddresses?: Array<NonPersistedElectronicAddress>;
|
|
20
|
+
physicalAddresses?: Array<NonPersistedPhysicalAddress>;
|
|
21
|
+
};
|
|
22
|
+
export type UpdatePartyArgs = {
|
|
23
|
+
party: Omit<Party, 'identities' | 'electronicAddresses' | 'partyType' | 'createdAt' | 'lastUpdatedAt'>;
|
|
24
|
+
};
|
|
25
|
+
export type RemovePartyArgs = {
|
|
26
|
+
partyId: string;
|
|
27
|
+
};
|
|
28
|
+
export type GetIdentityArgs = {
|
|
29
|
+
identityId: string;
|
|
30
|
+
};
|
|
31
|
+
export type GetIdentitiesArgs = {
|
|
32
|
+
filter?: FindIdentityArgs;
|
|
33
|
+
};
|
|
34
|
+
export type AddIdentityArgs = {
|
|
35
|
+
partyId: string;
|
|
36
|
+
identity: NonPersistedIdentity;
|
|
37
|
+
};
|
|
38
|
+
export type UpdateIdentityArgs = {
|
|
39
|
+
identity: Identity;
|
|
40
|
+
};
|
|
41
|
+
export type RemoveIdentityArgs = {
|
|
42
|
+
identityId: string;
|
|
43
|
+
};
|
|
44
|
+
export type RemoveRelationshipArgs = {
|
|
45
|
+
relationshipId: string;
|
|
46
|
+
};
|
|
47
|
+
export type AddRelationshipArgs = {
|
|
48
|
+
leftId: string;
|
|
49
|
+
rightId: string;
|
|
50
|
+
};
|
|
51
|
+
export type GetRelationshipArgs = {
|
|
52
|
+
relationshipId: string;
|
|
53
|
+
};
|
|
54
|
+
export type GetRelationshipsArgs = {
|
|
55
|
+
filter: FindRelationshipArgs;
|
|
56
|
+
};
|
|
57
|
+
export type UpdateRelationshipArgs = {
|
|
58
|
+
relationship: Omit<PartyRelationship, 'createdAt' | 'lastUpdatedAt'>;
|
|
59
|
+
};
|
|
60
|
+
export type AddPartyTypeArgs = {
|
|
61
|
+
type: PartyTypeEnum;
|
|
62
|
+
name: string;
|
|
63
|
+
tenantId: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
};
|
|
66
|
+
export type GetPartyTypeArgs = {
|
|
67
|
+
partyTypeId: string;
|
|
68
|
+
};
|
|
69
|
+
export type GetPartyTypesArgs = {
|
|
70
|
+
filter?: FindPartyTypeArgs;
|
|
71
|
+
};
|
|
72
|
+
export type UpdatePartyTypeArgs = {
|
|
73
|
+
partyType: Omit<PartyType, 'createdAt' | 'lastUpdatedAt'>;
|
|
74
|
+
};
|
|
75
|
+
export type RemovePartyTypeArgs = {
|
|
76
|
+
partyTypeId: string;
|
|
77
|
+
};
|
|
78
|
+
export type GetElectronicAddressArgs = {
|
|
79
|
+
electronicAddressId: string;
|
|
80
|
+
};
|
|
81
|
+
export type GetElectronicAddressesArgs = {
|
|
82
|
+
filter?: FindElectronicAddressArgs;
|
|
83
|
+
};
|
|
84
|
+
export type AddElectronicAddressArgs = {
|
|
85
|
+
partyId: string;
|
|
86
|
+
electronicAddress: NonPersistedElectronicAddress;
|
|
87
|
+
};
|
|
88
|
+
export type UpdateElectronicAddressArgs = {
|
|
89
|
+
electronicAddress: ElectronicAddress;
|
|
90
|
+
};
|
|
91
|
+
export type RemoveElectronicAddressArgs = {
|
|
92
|
+
electronicAddressId: string;
|
|
93
|
+
};
|
|
94
|
+
export type GetPhysicalAddressArgs = {
|
|
95
|
+
physicalAddressId: string;
|
|
96
|
+
};
|
|
97
|
+
export type GetPhysicalAddressesArgs = {
|
|
98
|
+
filter?: FindPhysicalAddressArgs;
|
|
99
|
+
};
|
|
100
|
+
export type AddPhysicalAddressArgs = {
|
|
101
|
+
partyId: string;
|
|
102
|
+
physicalAddress: NonPersistedPhysicalAddress;
|
|
103
|
+
};
|
|
104
|
+
export type UpdatePhysicalAddressArgs = {
|
|
105
|
+
physicalAddress: PhysicalAddress;
|
|
106
|
+
};
|
|
107
|
+
export type RemovePhysicalAddressArgs = {
|
|
108
|
+
physicalAddressId: string;
|
|
109
|
+
};
|
|
75
110
|
//# sourceMappingURL=IAbstractContactStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAbstractContactStore.d.ts","sourceRoot":"","sources":["../../../src/types/contact/IAbstractContactStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"IAbstractContactStore.d.ts","sourceRoot":"","sources":["../../../src/types/contact/IAbstractContactStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EAChB,MAAM,WAAW,CAAA;AAElB,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,CAAA;AAC/C,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,eAAe,CAAC,CAAA;AACrD,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAA;AACvD,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAA;AAClE,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAA;AACvE,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAEnE,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,qBAAqB,CAAA;IAChC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAA;IACxC,mBAAmB,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAA;IAC1D,iBAAiB,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAA;CACvD,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,qBAAqB,GAAG,WAAW,GAAG,WAAW,GAAG,eAAe,CAAC,CAAA;CACvG,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,QAAQ,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,eAAe,CAAC,CAAA;CACrE,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,GAAG,eAAe,CAAC,CAAA;CAC1D,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,CAAC,EAAE,yBAAyB,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,6BAA6B,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,iBAAiB,EAAE,iBAAiB,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,CAAC,EAAE,uBAAuB,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,2BAA2B,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,eAAe,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=IAbstractContactStore.js.map
|