@sphereon/ssi-sdk.contact-manager 0.18.1 → 0.18.2-unstable.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,56 +1,56 @@
1
- import { IAgentPlugin } from '@veramo/core';
2
- import { IContactManager } from '../types/IContactManager';
3
- import { AbstractContactStore } from '@sphereon/ssi-sdk.data-store';
4
- /**
5
- * {@inheritDoc IContactManager}
6
- */
7
- export declare class ContactManager implements IAgentPlugin {
8
- readonly schema: any;
9
- readonly methods: IContactManager;
10
- private readonly store;
11
- constructor(options: {
12
- store: AbstractContactStore;
13
- });
14
- /** {@inheritDoc IContactManager.cmGetContact} */
15
- private cmGetContact;
16
- /** {@inheritDoc IContactManager.cmGetContacts} */
17
- private cmGetContacts;
18
- /** {@inheritDoc IContactManager.cmAddContact} */
19
- private cmAddContact;
20
- /** {@inheritDoc IContactManager.cmUpdateContact} */
21
- private cmUpdateContact;
22
- /** {@inheritDoc IContactManager.cmRemoveContact} */
23
- private cmRemoveContact;
24
- /** {@inheritDoc IContactManager.cmGetIdentity} */
25
- private cmGetIdentity;
26
- /** {@inheritDoc IContactManager.cmGetIdentities} */
27
- private cmGetIdentities;
28
- /** {@inheritDoc IContactManager.cmAddIdentity} */
29
- private cmAddIdentity;
30
- /** {@inheritDoc IContactManager.cmUpdateIdentity} */
31
- private cmUpdateIdentity;
32
- /** {@inheritDoc IContactManager.cmRemoveIdentity} */
33
- private cmRemoveIdentity;
34
- /** {@inheritDoc IContactManager.cmAddRelationship} */
35
- private cmAddRelationship;
36
- /** {@inheritDoc IContactManager.cmRemoveRelationship} */
37
- private cmRemoveRelationship;
38
- /** {@inheritDoc IContactManager.cmGetRelationship} */
39
- private cmGetRelationship;
40
- /** {@inheritDoc IContactManager.cmGetRelationships} */
41
- private cmGetRelationships;
42
- /** {@inheritDoc IContactManager.cmUpdateRelationship} */
43
- private cmUpdateRelationship;
44
- /** {@inheritDoc IContactManager.cmGetContactType} */
45
- private cmGetContactType;
46
- /** {@inheritDoc IContactManager.cmGetContactTypes} */
47
- private cmGetContactTypes;
48
- /** {@inheritDoc IContactManager.cmAddContactType} */
49
- private cmAddContactType;
50
- /** {@inheritDoc IContactManager.cmUpdateContactType} */
51
- private cmUpdateContactType;
52
- /** {@inheritDoc IContactManager.cmRemoveContactType} */
53
- private cmRemoveContactType;
54
- private getContactInformationFrom;
55
- }
1
+ import { IAgentPlugin } from '@veramo/core';
2
+ import { IContactManager } from '../types/IContactManager';
3
+ import { AbstractContactStore } from '@sphereon/ssi-sdk.data-store';
4
+ /**
5
+ * {@inheritDoc IContactManager}
6
+ */
7
+ export declare class ContactManager implements IAgentPlugin {
8
+ readonly schema: any;
9
+ readonly methods: IContactManager;
10
+ private readonly store;
11
+ constructor(options: {
12
+ store: AbstractContactStore;
13
+ });
14
+ /** {@inheritDoc IContactManager.cmGetContact} */
15
+ private cmGetContact;
16
+ /** {@inheritDoc IContactManager.cmGetContacts} */
17
+ private cmGetContacts;
18
+ /** {@inheritDoc IContactManager.cmAddContact} */
19
+ private cmAddContact;
20
+ /** {@inheritDoc IContactManager.cmUpdateContact} */
21
+ private cmUpdateContact;
22
+ /** {@inheritDoc IContactManager.cmRemoveContact} */
23
+ private cmRemoveContact;
24
+ /** {@inheritDoc IContactManager.cmGetIdentity} */
25
+ private cmGetIdentity;
26
+ /** {@inheritDoc IContactManager.cmGetIdentities} */
27
+ private cmGetIdentities;
28
+ /** {@inheritDoc IContactManager.cmAddIdentity} */
29
+ private cmAddIdentity;
30
+ /** {@inheritDoc IContactManager.cmUpdateIdentity} */
31
+ private cmUpdateIdentity;
32
+ /** {@inheritDoc IContactManager.cmRemoveIdentity} */
33
+ private cmRemoveIdentity;
34
+ /** {@inheritDoc IContactManager.cmAddRelationship} */
35
+ private cmAddRelationship;
36
+ /** {@inheritDoc IContactManager.cmRemoveRelationship} */
37
+ private cmRemoveRelationship;
38
+ /** {@inheritDoc IContactManager.cmGetRelationship} */
39
+ private cmGetRelationship;
40
+ /** {@inheritDoc IContactManager.cmGetRelationships} */
41
+ private cmGetRelationships;
42
+ /** {@inheritDoc IContactManager.cmUpdateRelationship} */
43
+ private cmUpdateRelationship;
44
+ /** {@inheritDoc IContactManager.cmGetContactType} */
45
+ private cmGetContactType;
46
+ /** {@inheritDoc IContactManager.cmGetContactTypes} */
47
+ private cmGetContactTypes;
48
+ /** {@inheritDoc IContactManager.cmAddContactType} */
49
+ private cmAddContactType;
50
+ /** {@inheritDoc IContactManager.cmUpdateContactType} */
51
+ private cmUpdateContactType;
52
+ /** {@inheritDoc IContactManager.cmRemoveContactType} */
53
+ private cmRemoveContactType;
54
+ private getContactInformationFrom;
55
+ }
56
56
  //# sourceMappingURL=ContactManager.d.ts.map
@@ -1,182 +1,182 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ContactManager = void 0;
13
- const index_1 = require("../index");
14
- const ssi_sdk_data_store_1 = require("@sphereon/ssi-sdk.data-store");
15
- /**
16
- * {@inheritDoc IContactManager}
17
- */
18
- class ContactManager {
19
- constructor(options) {
20
- this.schema = index_1.schema.IContactManager;
21
- this.methods = {
22
- cmGetContact: this.cmGetContact.bind(this),
23
- cmGetContacts: this.cmGetContacts.bind(this),
24
- cmAddContact: this.cmAddContact.bind(this),
25
- cmUpdateContact: this.cmUpdateContact.bind(this),
26
- cmRemoveContact: this.cmRemoveContact.bind(this),
27
- cmGetIdentity: this.cmGetIdentity.bind(this),
28
- cmGetIdentities: this.cmGetIdentities.bind(this),
29
- cmAddIdentity: this.cmAddIdentity.bind(this),
30
- cmUpdateIdentity: this.cmUpdateIdentity.bind(this),
31
- cmRemoveIdentity: this.cmRemoveIdentity.bind(this),
32
- cmAddRelationship: this.cmAddRelationship.bind(this),
33
- cmRemoveRelationship: this.cmRemoveRelationship.bind(this),
34
- cmGetRelationship: this.cmGetRelationship.bind(this),
35
- cmGetRelationships: this.cmGetRelationships.bind(this),
36
- cmUpdateRelationship: this.cmUpdateRelationship.bind(this),
37
- cmGetContactType: this.cmGetContactType.bind(this),
38
- cmGetContactTypes: this.cmGetContactTypes.bind(this),
39
- cmAddContactType: this.cmAddContactType.bind(this),
40
- cmUpdateContactType: this.cmUpdateContactType.bind(this),
41
- cmRemoveContactType: this.cmRemoveContactType.bind(this),
42
- };
43
- this.store = options.store;
44
- }
45
- /** {@inheritDoc IContactManager.cmGetContact} */
46
- cmGetContact(args, context) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- return this.store.getParty({ partyId: args.contactId });
49
- });
50
- }
51
- /** {@inheritDoc IContactManager.cmGetContacts} */
52
- cmGetContacts(args) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- return this.store.getParties(args);
55
- });
56
- }
57
- /** {@inheritDoc IContactManager.cmAddContact} */
58
- cmAddContact(args, context) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- return this.store.addParty({
61
- uri: args.uri,
62
- partyType: args.contactType,
63
- contact: this.getContactInformationFrom(args),
64
- identities: args.identities,
65
- electronicAddresses: args.electronicAddresses,
66
- });
67
- });
68
- }
69
- /** {@inheritDoc IContactManager.cmUpdateContact} */
70
- cmUpdateContact(args, context) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- return this.store.updateParty({ party: args.contact });
73
- });
74
- }
75
- /** {@inheritDoc IContactManager.cmRemoveContact} */
76
- cmRemoveContact(args, context) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- return this.store.removeParty({ partyId: args.contactId }).then(() => true);
79
- });
80
- }
81
- /** {@inheritDoc IContactManager.cmGetIdentity} */
82
- cmGetIdentity(args, context) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- return this.store.getIdentity(args);
85
- });
86
- }
87
- /** {@inheritDoc IContactManager.cmGetIdentities} */
88
- cmGetIdentities(args) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- return this.store.getIdentities(args);
91
- });
92
- }
93
- /** {@inheritDoc IContactManager.cmAddIdentity} */
94
- cmAddIdentity(args, context) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- return this.store.addIdentity({ partyId: args.contactId, identity: args.identity });
97
- });
98
- }
99
- /** {@inheritDoc IContactManager.cmUpdateIdentity} */
100
- cmUpdateIdentity(args, context) {
101
- return __awaiter(this, void 0, void 0, function* () {
102
- return this.store.updateIdentity(args);
103
- });
104
- }
105
- /** {@inheritDoc IContactManager.cmRemoveIdentity} */
106
- cmRemoveIdentity(args, context) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- return this.store.removeIdentity(args).then(() => true);
109
- });
110
- }
111
- /** {@inheritDoc IContactManager.cmAddRelationship} */
112
- cmAddRelationship(args, context) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- return this.store.addRelationship(args);
115
- });
116
- }
117
- /** {@inheritDoc IContactManager.cmRemoveRelationship} */
118
- cmRemoveRelationship(args, context) {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- return this.store.removeRelationship(args).then(() => true);
121
- });
122
- }
123
- /** {@inheritDoc IContactManager.cmGetRelationship} */
124
- cmGetRelationship(args, context) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- return this.store.getRelationship(args);
127
- });
128
- }
129
- /** {@inheritDoc IContactManager.cmGetRelationships} */
130
- cmGetRelationships(args) {
131
- return __awaiter(this, void 0, void 0, function* () {
132
- return this.store.getRelationships(args);
133
- });
134
- }
135
- /** {@inheritDoc IContactManager.cmUpdateRelationship} */
136
- cmUpdateRelationship(args, context) {
137
- return __awaiter(this, void 0, void 0, function* () {
138
- return this.store.updateRelationship(args);
139
- });
140
- }
141
- /** {@inheritDoc IContactManager.cmGetContactType} */
142
- cmGetContactType(args, context) {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- return this.store.getPartyType({ partyTypeId: args.contactTypeId });
145
- });
146
- }
147
- /** {@inheritDoc IContactManager.cmGetContactTypes} */
148
- cmGetContactTypes(args) {
149
- return __awaiter(this, void 0, void 0, function* () {
150
- return this.store.getPartyTypes(args);
151
- });
152
- }
153
- /** {@inheritDoc IContactManager.cmAddContactType} */
154
- cmAddContactType(args, context) {
155
- return __awaiter(this, void 0, void 0, function* () {
156
- return this.store.addPartyType(args);
157
- });
158
- }
159
- /** {@inheritDoc IContactManager.cmUpdateContactType} */
160
- cmUpdateContactType(args, context) {
161
- return __awaiter(this, void 0, void 0, function* () {
162
- return this.store.updatePartyType({ partyType: args.contactType });
163
- });
164
- }
165
- /** {@inheritDoc IContactManager.cmRemoveContactType} */
166
- cmRemoveContactType(args, context) {
167
- return __awaiter(this, void 0, void 0, function* () {
168
- return this.store.removePartyType({ partyTypeId: args.contactTypeId }).then(() => true);
169
- });
170
- }
171
- getContactInformationFrom(contact) {
172
- if ((0, ssi_sdk_data_store_1.isNaturalPerson)(contact)) {
173
- return { firstName: contact.firstName, middleName: contact.middleName, lastName: contact.lastName, displayName: contact.displayName };
174
- }
175
- else if ((0, ssi_sdk_data_store_1.isOrganization)(contact)) {
176
- return { legalName: contact.legalName, displayName: contact.displayName };
177
- }
178
- throw new Error('Contact not supported');
179
- }
180
- }
181
- exports.ContactManager = ContactManager;
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContactManager = void 0;
13
+ const index_1 = require("../index");
14
+ const ssi_sdk_data_store_1 = require("@sphereon/ssi-sdk.data-store");
15
+ /**
16
+ * {@inheritDoc IContactManager}
17
+ */
18
+ class ContactManager {
19
+ constructor(options) {
20
+ this.schema = index_1.schema.IContactManager;
21
+ this.methods = {
22
+ cmGetContact: this.cmGetContact.bind(this),
23
+ cmGetContacts: this.cmGetContacts.bind(this),
24
+ cmAddContact: this.cmAddContact.bind(this),
25
+ cmUpdateContact: this.cmUpdateContact.bind(this),
26
+ cmRemoveContact: this.cmRemoveContact.bind(this),
27
+ cmGetIdentity: this.cmGetIdentity.bind(this),
28
+ cmGetIdentities: this.cmGetIdentities.bind(this),
29
+ cmAddIdentity: this.cmAddIdentity.bind(this),
30
+ cmUpdateIdentity: this.cmUpdateIdentity.bind(this),
31
+ cmRemoveIdentity: this.cmRemoveIdentity.bind(this),
32
+ cmAddRelationship: this.cmAddRelationship.bind(this),
33
+ cmRemoveRelationship: this.cmRemoveRelationship.bind(this),
34
+ cmGetRelationship: this.cmGetRelationship.bind(this),
35
+ cmGetRelationships: this.cmGetRelationships.bind(this),
36
+ cmUpdateRelationship: this.cmUpdateRelationship.bind(this),
37
+ cmGetContactType: this.cmGetContactType.bind(this),
38
+ cmGetContactTypes: this.cmGetContactTypes.bind(this),
39
+ cmAddContactType: this.cmAddContactType.bind(this),
40
+ cmUpdateContactType: this.cmUpdateContactType.bind(this),
41
+ cmRemoveContactType: this.cmRemoveContactType.bind(this),
42
+ };
43
+ this.store = options.store;
44
+ }
45
+ /** {@inheritDoc IContactManager.cmGetContact} */
46
+ cmGetContact(args, context) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ return this.store.getParty({ partyId: args.contactId });
49
+ });
50
+ }
51
+ /** {@inheritDoc IContactManager.cmGetContacts} */
52
+ cmGetContacts(args) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ return this.store.getParties(args);
55
+ });
56
+ }
57
+ /** {@inheritDoc IContactManager.cmAddContact} */
58
+ cmAddContact(args, context) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ return this.store.addParty({
61
+ uri: args.uri,
62
+ partyType: args.contactType,
63
+ contact: this.getContactInformationFrom(args),
64
+ identities: args.identities,
65
+ electronicAddresses: args.electronicAddresses,
66
+ });
67
+ });
68
+ }
69
+ /** {@inheritDoc IContactManager.cmUpdateContact} */
70
+ cmUpdateContact(args, context) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ return this.store.updateParty({ party: args.contact });
73
+ });
74
+ }
75
+ /** {@inheritDoc IContactManager.cmRemoveContact} */
76
+ cmRemoveContact(args, context) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ return this.store.removeParty({ partyId: args.contactId }).then(() => true);
79
+ });
80
+ }
81
+ /** {@inheritDoc IContactManager.cmGetIdentity} */
82
+ cmGetIdentity(args, context) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ return this.store.getIdentity(args);
85
+ });
86
+ }
87
+ /** {@inheritDoc IContactManager.cmGetIdentities} */
88
+ cmGetIdentities(args) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ return this.store.getIdentities(args);
91
+ });
92
+ }
93
+ /** {@inheritDoc IContactManager.cmAddIdentity} */
94
+ cmAddIdentity(args, context) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ return this.store.addIdentity({ partyId: args.contactId, identity: args.identity });
97
+ });
98
+ }
99
+ /** {@inheritDoc IContactManager.cmUpdateIdentity} */
100
+ cmUpdateIdentity(args, context) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ return this.store.updateIdentity(args);
103
+ });
104
+ }
105
+ /** {@inheritDoc IContactManager.cmRemoveIdentity} */
106
+ cmRemoveIdentity(args, context) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return this.store.removeIdentity(args).then(() => true);
109
+ });
110
+ }
111
+ /** {@inheritDoc IContactManager.cmAddRelationship} */
112
+ cmAddRelationship(args, context) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ return this.store.addRelationship(args);
115
+ });
116
+ }
117
+ /** {@inheritDoc IContactManager.cmRemoveRelationship} */
118
+ cmRemoveRelationship(args, context) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ return this.store.removeRelationship(args).then(() => true);
121
+ });
122
+ }
123
+ /** {@inheritDoc IContactManager.cmGetRelationship} */
124
+ cmGetRelationship(args, context) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ return this.store.getRelationship(args);
127
+ });
128
+ }
129
+ /** {@inheritDoc IContactManager.cmGetRelationships} */
130
+ cmGetRelationships(args) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ return this.store.getRelationships(args);
133
+ });
134
+ }
135
+ /** {@inheritDoc IContactManager.cmUpdateRelationship} */
136
+ cmUpdateRelationship(args, context) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ return this.store.updateRelationship(args);
139
+ });
140
+ }
141
+ /** {@inheritDoc IContactManager.cmGetContactType} */
142
+ cmGetContactType(args, context) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ return this.store.getPartyType({ partyTypeId: args.contactTypeId });
145
+ });
146
+ }
147
+ /** {@inheritDoc IContactManager.cmGetContactTypes} */
148
+ cmGetContactTypes(args) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ return this.store.getPartyTypes(args);
151
+ });
152
+ }
153
+ /** {@inheritDoc IContactManager.cmAddContactType} */
154
+ cmAddContactType(args, context) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ return this.store.addPartyType(args);
157
+ });
158
+ }
159
+ /** {@inheritDoc IContactManager.cmUpdateContactType} */
160
+ cmUpdateContactType(args, context) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ return this.store.updatePartyType({ partyType: args.contactType });
163
+ });
164
+ }
165
+ /** {@inheritDoc IContactManager.cmRemoveContactType} */
166
+ cmRemoveContactType(args, context) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ return this.store.removePartyType({ partyTypeId: args.contactTypeId }).then(() => true);
169
+ });
170
+ }
171
+ getContactInformationFrom(contact) {
172
+ if ((0, ssi_sdk_data_store_1.isNaturalPerson)(contact)) {
173
+ return { firstName: contact.firstName, middleName: contact.middleName, lastName: contact.lastName, displayName: contact.displayName };
174
+ }
175
+ else if ((0, ssi_sdk_data_store_1.isOrganization)(contact)) {
176
+ return { legalName: contact.legalName, displayName: contact.displayName };
177
+ }
178
+ throw new Error('Contact not supported');
179
+ }
180
+ }
181
+ exports.ContactManager = ContactManager;
182
182
  //# sourceMappingURL=ContactManager.js.map
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- * @public
3
- */
4
- declare const schema: any;
5
- export { schema };
6
- export { ContactManager } from './agent/ContactManager';
7
- export * from './types/IContactManager';
1
+ /**
2
+ * @public
3
+ */
4
+ declare const schema: any;
5
+ export { schema };
6
+ export { ContactManager } from './agent/ContactManager';
7
+ export * from './types/IContactManager';
8
8
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ContactManager = exports.schema = void 0;
18
- /**
19
- * @public
20
- */
21
- const schema = require('../plugin.schema.json');
22
- exports.schema = schema;
23
- var ContactManager_1 = require("./agent/ContactManager");
24
- Object.defineProperty(exports, "ContactManager", { enumerable: true, get: function () { return ContactManager_1.ContactManager; } });
25
- __exportStar(require("./types/IContactManager"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ContactManager = exports.schema = void 0;
18
+ /**
19
+ * @public
20
+ */
21
+ const schema = require('../plugin.schema.json');
22
+ exports.schema = schema;
23
+ var ContactManager_1 = require("./agent/ContactManager");
24
+ Object.defineProperty(exports, "ContactManager", { enumerable: true, get: function () { return ContactManager_1.ContactManager; } });
25
+ __exportStar(require("./types/IContactManager"), exports);
26
26
  //# sourceMappingURL=index.js.map
@@ -1,91 +1,91 @@
1
- import { IAgentContext, IPluginMethodMap } from '@veramo/core';
2
- import { Identity, NonPersistedIdentity, FindRelationshipArgs, FindIdentityArgs, NonPersistedContact, PartyTypeEnum as ContactTypeEnum, NonPersistedPartyType as NonPersistedContactType, FindPartyTypeArgs as FindContactTypeArgs, FindPartyArgs as FindContactArgs, PartyRelationship as ContactRelationship, PartyType as ContactType, Party as Contact, NonPersistedParty } from '@sphereon/ssi-sdk.data-store';
3
- export interface IContactManager extends IPluginMethodMap {
4
- cmGetContact(args: GetContactArgs, context: RequiredContext): Promise<Contact>;
5
- cmGetContacts(args?: GetContactsArgs): Promise<Array<Contact>>;
6
- cmAddContact(args: AddContactArgs, context: RequiredContext): Promise<Contact>;
7
- cmUpdateContact(args: UpdateContactArgs, context: RequiredContext): Promise<Contact>;
8
- cmRemoveContact(args: RemoveContactArgs, context: RequiredContext): Promise<boolean>;
9
- cmGetIdentity(args: GetIdentityArgs, context: RequiredContext): Promise<Identity>;
10
- cmGetIdentities(args?: GetIdentitiesArgs): Promise<Array<Identity>>;
11
- cmAddIdentity(args: AddIdentityArgs, context: RequiredContext): Promise<Identity>;
12
- cmUpdateIdentity(args: UpdateIdentityArgs, context: RequiredContext): Promise<Identity>;
13
- cmRemoveIdentity(args: RemoveIdentityArgs, context: RequiredContext): Promise<boolean>;
14
- cmGetRelationship(args: GetRelationshipArgs, context: RequiredContext): Promise<ContactRelationship>;
15
- cmGetRelationships(args?: GetRelationshipsArgs): Promise<Array<ContactRelationship>>;
16
- cmUpdateRelationship(args: UpdateRelationshipArgs, context: RequiredContext): Promise<ContactRelationship>;
17
- cmAddRelationship(args: AddRelationshipArgs, context: RequiredContext): Promise<ContactRelationship>;
18
- cmRemoveRelationship(args: RemoveRelationshipArgs, context: RequiredContext): Promise<boolean>;
19
- cmGetContactType(args: GetContactTypeArgs, context: RequiredContext): Promise<ContactType>;
20
- cmGetContactTypes(args?: GetContactTypesArgs): Promise<Array<ContactType>>;
21
- cmAddContactType(args: AddContactTypeArgs, context: RequiredContext): Promise<ContactType>;
22
- cmUpdateContactType(args: UpdateContactTypeArgs, context: RequiredContext): Promise<ContactType>;
23
- cmRemoveContactType(args: RemoveContactTypeArgs, context: RequiredContext): Promise<boolean>;
24
- }
25
- export type GetContactArgs = {
26
- contactId: string;
27
- };
28
- export type GetContactsArgs = {
29
- filter?: FindContactArgs;
30
- };
31
- export type AddContactArgs = Omit<NonPersistedParty, 'contact' | 'partyType'> & NonPersistedContact & {
32
- contactType: NonPersistedContactType;
33
- };
34
- export type UpdateContactArgs = {
35
- contact: Contact;
36
- };
37
- export type RemoveContactArgs = {
38
- contactId: string;
39
- };
40
- export type GetIdentityArgs = {
41
- identityId: string;
42
- };
43
- export type GetIdentitiesArgs = {
44
- filter?: FindIdentityArgs;
45
- };
46
- export type AddIdentityArgs = {
47
- contactId: string;
48
- identity: NonPersistedIdentity;
49
- };
50
- export type UpdateIdentityArgs = {
51
- identity: Identity;
52
- };
53
- export type RemoveIdentityArgs = {
54
- identityId: string;
55
- };
56
- export type AddRelationshipArgs = {
57
- leftId: string;
58
- rightId: string;
59
- };
60
- export type RemoveRelationshipArgs = {
61
- relationshipId: string;
62
- };
63
- export type GetRelationshipArgs = {
64
- relationshipId: string;
65
- };
66
- export type GetRelationshipsArgs = {
67
- filter: FindRelationshipArgs;
68
- };
69
- export type UpdateRelationshipArgs = {
70
- relationship: Omit<ContactRelationship, 'createdAt' | 'lastUpdatedAt'>;
71
- };
72
- export type AddContactTypeArgs = {
73
- type: ContactTypeEnum;
74
- name: string;
75
- tenantId: string;
76
- description?: string;
77
- };
78
- export type GetContactTypeArgs = {
79
- contactTypeId: string;
80
- };
81
- export type GetContactTypesArgs = {
82
- filter?: FindContactTypeArgs;
83
- };
84
- export type UpdateContactTypeArgs = {
85
- contactType: Omit<ContactType, 'createdAt' | 'lastUpdatedAt'>;
86
- };
87
- export type RemoveContactTypeArgs = {
88
- contactTypeId: string;
89
- };
90
- export type RequiredContext = IAgentContext<never>;
1
+ import { IAgentContext, IPluginMethodMap } from '@veramo/core';
2
+ import { Identity, NonPersistedIdentity, FindRelationshipArgs, FindIdentityArgs, NonPersistedContact, PartyTypeEnum as ContactTypeEnum, NonPersistedPartyType as NonPersistedContactType, FindPartyTypeArgs as FindContactTypeArgs, FindPartyArgs as FindContactArgs, PartyRelationship as ContactRelationship, PartyType as ContactType, Party as Contact, NonPersistedParty } from '@sphereon/ssi-sdk.data-store';
3
+ export interface IContactManager extends IPluginMethodMap {
4
+ cmGetContact(args: GetContactArgs, context: RequiredContext): Promise<Contact>;
5
+ cmGetContacts(args?: GetContactsArgs): Promise<Array<Contact>>;
6
+ cmAddContact(args: AddContactArgs, context: RequiredContext): Promise<Contact>;
7
+ cmUpdateContact(args: UpdateContactArgs, context: RequiredContext): Promise<Contact>;
8
+ cmRemoveContact(args: RemoveContactArgs, context: RequiredContext): Promise<boolean>;
9
+ cmGetIdentity(args: GetIdentityArgs, context: RequiredContext): Promise<Identity>;
10
+ cmGetIdentities(args?: GetIdentitiesArgs): Promise<Array<Identity>>;
11
+ cmAddIdentity(args: AddIdentityArgs, context: RequiredContext): Promise<Identity>;
12
+ cmUpdateIdentity(args: UpdateIdentityArgs, context: RequiredContext): Promise<Identity>;
13
+ cmRemoveIdentity(args: RemoveIdentityArgs, context: RequiredContext): Promise<boolean>;
14
+ cmGetRelationship(args: GetRelationshipArgs, context: RequiredContext): Promise<ContactRelationship>;
15
+ cmGetRelationships(args?: GetRelationshipsArgs): Promise<Array<ContactRelationship>>;
16
+ cmUpdateRelationship(args: UpdateRelationshipArgs, context: RequiredContext): Promise<ContactRelationship>;
17
+ cmAddRelationship(args: AddRelationshipArgs, context: RequiredContext): Promise<ContactRelationship>;
18
+ cmRemoveRelationship(args: RemoveRelationshipArgs, context: RequiredContext): Promise<boolean>;
19
+ cmGetContactType(args: GetContactTypeArgs, context: RequiredContext): Promise<ContactType>;
20
+ cmGetContactTypes(args?: GetContactTypesArgs): Promise<Array<ContactType>>;
21
+ cmAddContactType(args: AddContactTypeArgs, context: RequiredContext): Promise<ContactType>;
22
+ cmUpdateContactType(args: UpdateContactTypeArgs, context: RequiredContext): Promise<ContactType>;
23
+ cmRemoveContactType(args: RemoveContactTypeArgs, context: RequiredContext): Promise<boolean>;
24
+ }
25
+ export type GetContactArgs = {
26
+ contactId: string;
27
+ };
28
+ export type GetContactsArgs = {
29
+ filter?: FindContactArgs;
30
+ };
31
+ export type AddContactArgs = Omit<NonPersistedParty, 'contact' | 'partyType'> & NonPersistedContact & {
32
+ contactType: NonPersistedContactType;
33
+ };
34
+ export type UpdateContactArgs = {
35
+ contact: Contact;
36
+ };
37
+ export type RemoveContactArgs = {
38
+ contactId: string;
39
+ };
40
+ export type GetIdentityArgs = {
41
+ identityId: string;
42
+ };
43
+ export type GetIdentitiesArgs = {
44
+ filter?: FindIdentityArgs;
45
+ };
46
+ export type AddIdentityArgs = {
47
+ contactId: string;
48
+ identity: NonPersistedIdentity;
49
+ };
50
+ export type UpdateIdentityArgs = {
51
+ identity: Identity;
52
+ };
53
+ export type RemoveIdentityArgs = {
54
+ identityId: string;
55
+ };
56
+ export type AddRelationshipArgs = {
57
+ leftId: string;
58
+ rightId: string;
59
+ };
60
+ export type RemoveRelationshipArgs = {
61
+ relationshipId: string;
62
+ };
63
+ export type GetRelationshipArgs = {
64
+ relationshipId: string;
65
+ };
66
+ export type GetRelationshipsArgs = {
67
+ filter: FindRelationshipArgs;
68
+ };
69
+ export type UpdateRelationshipArgs = {
70
+ relationship: Omit<ContactRelationship, 'createdAt' | 'lastUpdatedAt'>;
71
+ };
72
+ export type AddContactTypeArgs = {
73
+ type: ContactTypeEnum;
74
+ name: string;
75
+ tenantId: string;
76
+ description?: string;
77
+ };
78
+ export type GetContactTypeArgs = {
79
+ contactTypeId: string;
80
+ };
81
+ export type GetContactTypesArgs = {
82
+ filter?: FindContactTypeArgs;
83
+ };
84
+ export type UpdateContactTypeArgs = {
85
+ contactType: Omit<ContactType, 'createdAt' | 'lastUpdatedAt'>;
86
+ };
87
+ export type RemoveContactTypeArgs = {
88
+ contactTypeId: string;
89
+ };
90
+ export type RequiredContext = IAgentContext<never>;
91
91
  //# sourceMappingURL=IContactManager.d.ts.map
@@ -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=IContactManager.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.contact-manager",
3
- "version": "0.18.1",
3
+ "version": "0.18.2-unstable.10+f2428c90",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,12 +14,12 @@
14
14
  "build:clean": "tsc --build --clean && tsc --build"
15
15
  },
16
16
  "dependencies": {
17
- "@sphereon/ssi-sdk.data-store": "0.18.1",
17
+ "@sphereon/ssi-sdk.data-store": "0.18.2-unstable.10+f2428c90",
18
18
  "cross-fetch": "^3.1.8",
19
19
  "typeorm": "^0.3.12"
20
20
  },
21
21
  "devDependencies": {
22
- "@sphereon/ssi-sdk.agent-config": "0.18.1",
22
+ "@sphereon/ssi-sdk.agent-config": "0.18.2-unstable.10+f2428c90",
23
23
  "@sphereon/ssi-sdk.data-store": "workspace:*",
24
24
  "@veramo/remote-client": "4.2.0",
25
25
  "@veramo/remote-server": "4.2.0"
@@ -45,5 +45,5 @@
45
45
  "OpenID",
46
46
  "Contact Manager"
47
47
  ],
48
- "gitHead": "661217d378e952a9eebfd38c5a0426c7c4f2a54e"
48
+ "gitHead": "f2428c90a2d35170a6c8e6c732ce74add79a4ffe"
49
49
  }