@sphereon/ssi-sdk.issuance-branding 0.33.1-feature.vcdm2.tsup.32 → 0.33.1-next.3
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/agent/IssuanceBranding.d.ts +56 -0
- package/dist/agent/IssuanceBranding.d.ts.map +1 -0
- package/dist/agent/IssuanceBranding.js +288 -0
- package/dist/agent/IssuanceBranding.js.map +1 -0
- package/dist/index.d.ts +4 -148
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -1489
- package/dist/index.js.map +1 -1
- package/dist/{index.d.cts → ssi-sdk.issuance-branding.d.ts} +188 -152
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types/IIssuanceBranding.d.ts +92 -0
- package/dist/types/IIssuanceBranding.d.ts.map +1 -0
- package/dist/types/IIssuanceBranding.js +3 -0
- package/dist/types/IIssuanceBranding.js.map +1 -0
- package/package.json +13 -24
- package/dist/index.cjs +0 -1522
- package/dist/index.cjs.map +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IAgentPlugin } from '@veramo/core';
|
|
2
|
+
import { AbstractIssuanceBrandingStore } from '@sphereon/ssi-sdk.data-store';
|
|
3
|
+
import { IIssuanceBranding } from '../types/IIssuanceBranding';
|
|
4
|
+
export declare const issuanceBrandingMethods: Array<string>;
|
|
5
|
+
/**
|
|
6
|
+
* {@inheritDoc IIssuanceBranding}
|
|
7
|
+
*/
|
|
8
|
+
export declare class IssuanceBranding implements IAgentPlugin {
|
|
9
|
+
readonly schema: any;
|
|
10
|
+
readonly methods: IIssuanceBranding;
|
|
11
|
+
private readonly store;
|
|
12
|
+
constructor(options: {
|
|
13
|
+
store: AbstractIssuanceBrandingStore;
|
|
14
|
+
});
|
|
15
|
+
/** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */
|
|
16
|
+
private ibAddCredentialBranding;
|
|
17
|
+
/** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */
|
|
18
|
+
private ibGetCredentialBranding;
|
|
19
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */
|
|
20
|
+
private ibUpdateCredentialBranding;
|
|
21
|
+
/** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */
|
|
22
|
+
private ibRemoveCredentialBranding;
|
|
23
|
+
/** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */
|
|
24
|
+
private ibAddCredentialLocaleBranding;
|
|
25
|
+
/** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */
|
|
26
|
+
private ibGetCredentialLocaleBranding;
|
|
27
|
+
/** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */
|
|
28
|
+
private ibRemoveCredentialLocaleBranding;
|
|
29
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */
|
|
30
|
+
private ibUpdateCredentialLocaleBranding;
|
|
31
|
+
/** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */
|
|
32
|
+
private ibCredentialLocaleBrandingFrom;
|
|
33
|
+
/** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */
|
|
34
|
+
private ibAddIssuerBranding;
|
|
35
|
+
/** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */
|
|
36
|
+
private ibGetIssuerBranding;
|
|
37
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */
|
|
38
|
+
private ibUpdateIssuerBranding;
|
|
39
|
+
/** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */
|
|
40
|
+
private inRemoveIssuerBranding;
|
|
41
|
+
/** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */
|
|
42
|
+
private ibAddIssuerLocaleBranding;
|
|
43
|
+
/** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */
|
|
44
|
+
private ibAGetIssuerLocaleBranding;
|
|
45
|
+
/** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */
|
|
46
|
+
private ibRemoveIssuerLocaleBranding;
|
|
47
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */
|
|
48
|
+
private ibUpdateIssuerLocaleBranding;
|
|
49
|
+
/** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */
|
|
50
|
+
private ibIssuerLocaleBrandingFrom;
|
|
51
|
+
private setAdditionalImageAttributes;
|
|
52
|
+
private getAdditionalImageAttributes;
|
|
53
|
+
private extractBase64FromDataURI;
|
|
54
|
+
private getDataTypeFromDataURI;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=IssuanceBranding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IssuanceBranding.d.ts","sourceRoot":"","sources":["../../src/agent/IssuanceBranding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EACL,6BAA6B,EAe9B,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAIL,iBAAiB,EAelB,MAAM,4BAA4B,CAAA;AAKnC,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAmBjD,CAAA;AAQD;;GAEG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IACnD,QAAQ,CAAC,MAAM,MAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAmBlC;IAED,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;gBAEzC,OAAO,EAAE;QAAE,KAAK,EAAE,6BAA6B,CAAA;KAAE;IAI7D,8DAA8D;YAChD,uBAAuB;IAiBrC,8DAA8D;YAChD,uBAAuB;IAKrC,iEAAiE;YACnD,0BAA0B;IAKxC,iEAAiE;YACnD,0BAA0B;IAQxC,oEAAoE;YACtD,6BAA6B;IAgB3C,oEAAoE;YACtD,6BAA6B;IAK3C,uEAAuE;YACzD,gCAAgC;IAQ9C,uEAAuE;YACzD,gCAAgC;IAgB9C,qEAAqE;YACvD,8BAA8B;IAQ5C,0DAA0D;YAC5C,mBAAmB;IAejC,0DAA0D;YAC5C,mBAAmB;IAKjC,6DAA6D;YAC/C,sBAAsB;IAKpC,6DAA6D;YAC/C,sBAAsB;IAQpC,gEAAgE;YAClD,yBAAyB;IAevC,iEAAiE;YACnD,0BAA0B;IAKxC,mEAAmE;YACrD,4BAA4B;IAQ1C,mEAAmE;YACrD,4BAA4B;IAa1C,iEAAiE;YACnD,0BAA0B;YAM1B,4BAA4B;YAiC5B,4BAA4B;YAmC5B,wBAAwB;YAWxB,sBAAsB;CAUrC"}
|
|
@@ -0,0 +1,288 @@
|
|
|
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.IssuanceBranding = exports.issuanceBrandingMethods = void 0;
|
|
16
|
+
const ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
|
|
17
|
+
const index_1 = require("../index");
|
|
18
|
+
const debug_1 = __importDefault(require("debug"));
|
|
19
|
+
const debug = (0, debug_1.default)('sphereon:ssi-sdk:issuance-branding');
|
|
20
|
+
exports.issuanceBrandingMethods = [
|
|
21
|
+
'ibAddCredentialBranding',
|
|
22
|
+
'ibGetCredentialBranding',
|
|
23
|
+
'ibUpdateCredentialBranding',
|
|
24
|
+
'ibRemoveCredentialBranding',
|
|
25
|
+
'ibAddCredentialLocaleBranding',
|
|
26
|
+
'ibGetCredentialLocaleBranding',
|
|
27
|
+
'ibRemoveCredentialLocaleBranding',
|
|
28
|
+
'ibUpdateCredentialLocaleBranding',
|
|
29
|
+
'ibCredentialLocaleBrandingFrom',
|
|
30
|
+
'ibAddIssuerBranding',
|
|
31
|
+
'ibGetIssuerBranding',
|
|
32
|
+
'ibUpdateIssuerBranding',
|
|
33
|
+
'ibRemoveIssuerBranding',
|
|
34
|
+
'ibAddIssuerLocaleBranding',
|
|
35
|
+
'ibGetIssuerLocaleBranding',
|
|
36
|
+
'ibRemoveIssuerLocaleBranding',
|
|
37
|
+
'ibUpdateIssuerLocaleBranding',
|
|
38
|
+
'ibIssuerLocaleBrandingFrom',
|
|
39
|
+
];
|
|
40
|
+
const EMPTY_IMAGE_ATTRIBUTES = {
|
|
41
|
+
mediaType: undefined,
|
|
42
|
+
dataUri: undefined,
|
|
43
|
+
dimensions: undefined,
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* {@inheritDoc IIssuanceBranding}
|
|
47
|
+
*/
|
|
48
|
+
class IssuanceBranding {
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this.schema = index_1.schema.IIssuanceBranding;
|
|
51
|
+
this.methods = {
|
|
52
|
+
ibAddCredentialBranding: this.ibAddCredentialBranding.bind(this),
|
|
53
|
+
ibGetCredentialBranding: this.ibGetCredentialBranding.bind(this),
|
|
54
|
+
ibUpdateCredentialBranding: this.ibUpdateCredentialBranding.bind(this),
|
|
55
|
+
ibRemoveCredentialBranding: this.ibRemoveCredentialBranding.bind(this),
|
|
56
|
+
ibAddCredentialLocaleBranding: this.ibAddCredentialLocaleBranding.bind(this),
|
|
57
|
+
ibGetCredentialLocaleBranding: this.ibGetCredentialLocaleBranding.bind(this),
|
|
58
|
+
ibRemoveCredentialLocaleBranding: this.ibRemoveCredentialLocaleBranding.bind(this),
|
|
59
|
+
ibUpdateCredentialLocaleBranding: this.ibUpdateCredentialLocaleBranding.bind(this),
|
|
60
|
+
ibCredentialLocaleBrandingFrom: this.ibCredentialLocaleBrandingFrom.bind(this),
|
|
61
|
+
ibAddIssuerBranding: this.ibAddIssuerBranding.bind(this),
|
|
62
|
+
ibGetIssuerBranding: this.ibGetIssuerBranding.bind(this),
|
|
63
|
+
ibUpdateIssuerBranding: this.ibUpdateIssuerBranding.bind(this),
|
|
64
|
+
ibRemoveIssuerBranding: this.inRemoveIssuerBranding.bind(this),
|
|
65
|
+
ibAddIssuerLocaleBranding: this.ibAddIssuerLocaleBranding.bind(this),
|
|
66
|
+
ibGetIssuerLocaleBranding: this.ibAGetIssuerLocaleBranding.bind(this),
|
|
67
|
+
ibRemoveIssuerLocaleBranding: this.ibRemoveIssuerLocaleBranding.bind(this),
|
|
68
|
+
ibUpdateIssuerLocaleBranding: this.ibUpdateIssuerLocaleBranding.bind(this),
|
|
69
|
+
ibIssuerLocaleBrandingFrom: this.ibIssuerLocaleBrandingFrom.bind(this),
|
|
70
|
+
};
|
|
71
|
+
this.store = options.store;
|
|
72
|
+
}
|
|
73
|
+
/** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */
|
|
74
|
+
ibAddCredentialBranding(args, context) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
|
|
77
|
+
const credentialBranding = Object.assign(Object.assign({}, args), { localeBranding });
|
|
78
|
+
debug('Adding credential branding', credentialBranding);
|
|
79
|
+
return this.store.addCredentialBranding(credentialBranding);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */
|
|
83
|
+
ibGetCredentialBranding(args) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
debug('Getting credential branding', args);
|
|
86
|
+
return this.store.getCredentialBranding(args);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */
|
|
90
|
+
ibUpdateCredentialBranding(args, context) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
debug('Updating credential branding', args);
|
|
93
|
+
return this.store.updateCredentialBranding(args);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */
|
|
97
|
+
ibRemoveCredentialBranding(args, context) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
debug('Removing credential branding', args);
|
|
100
|
+
return this.store
|
|
101
|
+
.removeCredentialBranding(args)
|
|
102
|
+
.then(() => ({ result: true }))
|
|
103
|
+
.catch((error) => ({ result: false, error: error.message }));
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */
|
|
107
|
+
ibAddCredentialLocaleBranding(args, context) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
|
|
110
|
+
const addCredentialLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
|
|
111
|
+
debug('Adding credential locale branding', addCredentialLocaleBrandingArgs);
|
|
112
|
+
return this.store.addCredentialLocaleBranding(addCredentialLocaleBrandingArgs);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */
|
|
116
|
+
ibGetCredentialLocaleBranding(args) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
debug('Getting credential locale branding', args);
|
|
119
|
+
return this.store.getCredentialLocaleBranding(args);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */
|
|
123
|
+
ibRemoveCredentialLocaleBranding(args, context) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
debug('Removing credential locale branding', args);
|
|
126
|
+
return this.store
|
|
127
|
+
.removeCredentialLocaleBranding(args)
|
|
128
|
+
.then(() => ({ result: true }))
|
|
129
|
+
.catch((error) => ({ result: false, error: error.message }));
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */
|
|
133
|
+
ibUpdateCredentialLocaleBranding(args, context) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
const localeBranding = (yield this.setAdditionalImageAttributes(args.localeBranding));
|
|
136
|
+
const updateCredentialLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
|
|
137
|
+
debug('Updating credential locale branding', updateCredentialLocaleBrandingArgs);
|
|
138
|
+
return this.store.updateCredentialLocaleBranding(updateCredentialLocaleBrandingArgs);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */
|
|
142
|
+
ibCredentialLocaleBrandingFrom(args, context) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
debug('get credential locale branding from', args);
|
|
145
|
+
return this.setAdditionalImageAttributes(args.localeBranding);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */
|
|
149
|
+
ibAddIssuerBranding(args, context) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
|
|
152
|
+
const issuerBranding = Object.assign(Object.assign({}, args), { localeBranding });
|
|
153
|
+
debug('Adding issuer branding', issuerBranding);
|
|
154
|
+
return this.store.addIssuerBranding(issuerBranding);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */
|
|
158
|
+
ibGetIssuerBranding(args) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
debug('Getting issuer branding', args);
|
|
161
|
+
return this.store.getIssuerBranding(args);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */
|
|
165
|
+
ibUpdateIssuerBranding(args, context) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
debug('Updating issuer branding', args);
|
|
168
|
+
return this.store.updateIssuerBranding(args);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */
|
|
172
|
+
inRemoveIssuerBranding(args, context) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
debug('Removing issuer branding', args);
|
|
175
|
+
return this.store
|
|
176
|
+
.removeIssuerBranding(args)
|
|
177
|
+
.then(() => ({ result: true }))
|
|
178
|
+
.catch((error) => ({ result: false, error: error.message }));
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */
|
|
182
|
+
ibAddIssuerLocaleBranding(args, context) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
const localeBranding = yield Promise.all(args.localeBranding.map((localeBranding) => this.setAdditionalImageAttributes(localeBranding)));
|
|
185
|
+
const addIssuerLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
|
|
186
|
+
debug('Adding issuer locale branding', addIssuerLocaleBrandingArgs);
|
|
187
|
+
return this.store.addIssuerLocaleBranding(addIssuerLocaleBrandingArgs);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */
|
|
191
|
+
ibAGetIssuerLocaleBranding(args) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
debug('Getting issuer locale branding', args);
|
|
194
|
+
return this.store.getIssuerLocaleBranding(args);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */
|
|
198
|
+
ibRemoveIssuerLocaleBranding(args, context) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
debug('Removing issuer locale branding', args);
|
|
201
|
+
return this.store
|
|
202
|
+
.removeIssuerLocaleBranding(args)
|
|
203
|
+
.then(() => ({ result: true }))
|
|
204
|
+
.catch((error) => ({ result: false, error: error.message }));
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */
|
|
208
|
+
ibUpdateIssuerLocaleBranding(args, context) {
|
|
209
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
const localeBranding = (yield this.setAdditionalImageAttributes(args.localeBranding));
|
|
211
|
+
const updateIssuerLocaleBrandingArgs = Object.assign(Object.assign({}, args), { localeBranding });
|
|
212
|
+
debug('Updating issuer locale branding', updateIssuerLocaleBrandingArgs);
|
|
213
|
+
return this.store.updateIssuerLocaleBranding(updateIssuerLocaleBrandingArgs);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */
|
|
217
|
+
ibIssuerLocaleBrandingFrom(args, context) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
debug('get issuer locale branding from', args);
|
|
220
|
+
return this.setAdditionalImageAttributes(args.localeBranding);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// todo: We really should add a cache for urls. We now fetch the same images multiple times in case the logo/background image is the same for multiple locales.
|
|
224
|
+
setAdditionalImageAttributes(localeBranding) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
return Object.assign(Object.assign(Object.assign({}, localeBranding), (localeBranding.logo && {
|
|
227
|
+
logo: Object.assign(Object.assign({}, localeBranding.logo), (localeBranding.logo.uri
|
|
228
|
+
? Object.assign({}, (yield this.getAdditionalImageAttributes(localeBranding.logo))) : EMPTY_IMAGE_ATTRIBUTES)),
|
|
229
|
+
})), (localeBranding.background && {
|
|
230
|
+
background: Object.assign(Object.assign({}, localeBranding.background), (localeBranding.background.image && {
|
|
231
|
+
image: Object.assign(Object.assign({}, localeBranding.background.image), (localeBranding.background.image.uri
|
|
232
|
+
? Object.assign({}, (yield this.getAdditionalImageAttributes(localeBranding.background.image))) : EMPTY_IMAGE_ATTRIBUTES)),
|
|
233
|
+
})),
|
|
234
|
+
}));
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
getAdditionalImageAttributes(image) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
239
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
240
|
+
if (!image.uri) {
|
|
241
|
+
debug(`No image URI present, returning empty attributes`);
|
|
242
|
+
return EMPTY_IMAGE_ATTRIBUTES;
|
|
243
|
+
}
|
|
244
|
+
const data_uri_regex = /^data:image\/[^;]+;base64,/;
|
|
245
|
+
if (data_uri_regex.test(image.uri)) {
|
|
246
|
+
debug('Setting additional image properties for uri', image.uri);
|
|
247
|
+
const base64Content = yield this.extractBase64FromDataURI(image.uri);
|
|
248
|
+
const dimensions = (_a = image.dimensions) !== null && _a !== void 0 ? _a : (yield (0, ssi_sdk_core_1.getImageDimensions)(base64Content));
|
|
249
|
+
const mediaType = (_b = image.mediaType) !== null && _b !== void 0 ? _b : (yield this.getDataTypeFromDataURI(image.uri));
|
|
250
|
+
return {
|
|
251
|
+
mediaType,
|
|
252
|
+
dimensions,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
debug('Setting additional image properties for url', image.uri);
|
|
256
|
+
const resource = !image.dataUri ? yield (0, ssi_sdk_core_1.downloadImage)(image.uri) : undefined;
|
|
257
|
+
const dimensions = (_c = image.dimensions) !== null && _c !== void 0 ? _c : (yield (0, ssi_sdk_core_1.getImageDimensions)((_d = resource === null || resource === void 0 ? void 0 : resource.base64Content) !== null && _d !== void 0 ? _d : (yield this.extractBase64FromDataURI(image.dataUri))));
|
|
258
|
+
const mediaType = (_f = (_e = image.mediaType) !== null && _e !== void 0 ? _e : resource === null || resource === void 0 ? void 0 : resource.contentType) !== null && _f !== void 0 ? _f : ((resource === null || resource === void 0 ? void 0 : resource.base64Content) ? yield (0, ssi_sdk_core_1.getImageMediaType)(resource === null || resource === void 0 ? void 0 : resource.base64Content) : yield this.getDataTypeFromDataURI(image.uri));
|
|
259
|
+
return {
|
|
260
|
+
mediaType,
|
|
261
|
+
dataUri: (_g = image.dataUri) !== null && _g !== void 0 ? _g : `data:${mediaType};base64,${resource.base64Content}`,
|
|
262
|
+
dimensions,
|
|
263
|
+
};
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
extractBase64FromDataURI(uri) {
|
|
267
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
const data_uri_base64_regex = /^data:[^;]+;base64,([\w+/=-]+)$/i;
|
|
269
|
+
const matches = uri.match(data_uri_base64_regex);
|
|
270
|
+
if (!matches || matches.length <= 1) {
|
|
271
|
+
return Promise.reject(Error('invalid base64 uri'));
|
|
272
|
+
}
|
|
273
|
+
return matches[1];
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
getDataTypeFromDataURI(uri) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
const data_uri_data_type_regex = /^data:([^;]+);base64,([\w+/=-]+)$/i;
|
|
279
|
+
const matches = uri.match(data_uri_data_type_regex);
|
|
280
|
+
if (!matches || matches.length <= 1) {
|
|
281
|
+
return Promise.reject(Error('invalid base64 uri'));
|
|
282
|
+
}
|
|
283
|
+
return matches[1];
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
exports.IssuanceBranding = IssuanceBranding;
|
|
288
|
+
//# sourceMappingURL=IssuanceBranding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IssuanceBranding.js","sourceRoot":"","sources":["../../src/agent/IssuanceBranding.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,yDAA+H;AAkB/H,oCAAiC;AAqBjC,kDAAyB;AAEzB,MAAM,KAAK,GAAmB,IAAA,eAAK,EAAC,oCAAoC,CAAC,CAAA;AAE5D,QAAA,uBAAuB,GAAkB;IACpD,yBAAyB;IACzB,yBAAyB;IACzB,4BAA4B;IAC5B,4BAA4B;IAC5B,+BAA+B;IAC/B,+BAA+B;IAC/B,kCAAkC;IAClC,kCAAkC;IAClC,gCAAgC;IAChC,qBAAqB;IACrB,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,2BAA2B;IAC3B,2BAA2B;IAC3B,8BAA8B;IAC9B,8BAA8B;IAC9B,4BAA4B;CAC7B,CAAA;AAED,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;CACtB,CAAA;AAED;;GAEG;AACH,MAAa,gBAAgB;IAyB3B,YAAY,OAAiD;QAxBpD,WAAM,GAAG,cAAM,CAAC,iBAAiB,CAAA;QACjC,YAAO,GAAsB;YACpC,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;YAChE,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;YAChE,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC;YACtE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C,CAAC,CAAA;QACnB,CAAC;KAAA;CACF;AAhTD,4CAgTC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,152 +1,8 @@
|
|
|
1
|
-
import { IPluginMethodMap, IAgentContext, IAgentPlugin } from '@veramo/core';
|
|
2
|
-
import { IBasicCredentialLocaleBranding, ICredentialBranding, FindCredentialBrandingArgs, FindCredentialLocaleBrandingArgs, ICredentialLocaleBranding, ILocaleBranding, IBasicIssuerLocaleBranding, IIssuerBranding, FindIssuerBrandingArgs, FindIssuerLocaleBrandingArgs, IIssuerLocaleBranding, IBasicImageDimensions, AbstractIssuanceBrandingStore } from '@sphereon/ssi-sdk.data-store';
|
|
3
|
-
|
|
4
|
-
interface IIssuanceBranding extends IPluginMethodMap {
|
|
5
|
-
ibAddCredentialBranding(args: IAddCredentialBrandingArgs, context: IRequiredContext): Promise<ICredentialBranding>;
|
|
6
|
-
ibGetCredentialBranding(args: IGetCredentialBrandingArgs): Promise<Array<ICredentialBranding>>;
|
|
7
|
-
ibUpdateCredentialBranding(args: IUpdateCredentialBrandingArgs, context: IRequiredContext): Promise<ICredentialBranding>;
|
|
8
|
-
ibRemoveCredentialBranding(args: IRemoveCredentialBrandingArgs, context: IRequiredContext): Promise<IDeletionResult>;
|
|
9
|
-
ibAddCredentialLocaleBranding(args: IAddCredentialLocaleBrandingArgs, context: IRequiredContext): Promise<ICredentialBranding>;
|
|
10
|
-
ibGetCredentialLocaleBranding(args: IGetCredentialLocaleBrandingArgs): Promise<Array<ICredentialLocaleBranding>>;
|
|
11
|
-
ibRemoveCredentialLocaleBranding(args: IRemoveCredentialLocaleBrandingArgs, context: IRequiredContext): Promise<IDeletionResult>;
|
|
12
|
-
ibUpdateCredentialLocaleBranding(args: IUpdateCredentialLocaleBrandingArgs, context: IRequiredContext): Promise<ICredentialLocaleBranding>;
|
|
13
|
-
ibCredentialLocaleBrandingFrom(args: ICredentialBrandingFromArgs, context: IRequiredContext): Promise<IBasicCredentialLocaleBranding>;
|
|
14
|
-
ibAddIssuerBranding(args: IAddIssuerBrandingArgs, context: IRequiredContext): Promise<IIssuerBranding>;
|
|
15
|
-
ibGetIssuerBranding(args: IGetIssuerBrandingArgs): Promise<Array<IIssuerBranding>>;
|
|
16
|
-
ibUpdateIssuerBranding(args: IUpdateIssuerBrandingArgs, context: IRequiredContext): Promise<IIssuerBranding>;
|
|
17
|
-
ibRemoveIssuerBranding(args: IRemoveIssuerBrandingArgs, context: IRequiredContext): Promise<IDeletionResult>;
|
|
18
|
-
ibAddIssuerLocaleBranding(args: IAddIssuerLocaleBrandingArgs, context: IRequiredContext): Promise<IIssuerBranding>;
|
|
19
|
-
ibGetIssuerLocaleBranding(args: IGetIssuerLocaleBrandingArgs): Promise<Array<IIssuerLocaleBranding>>;
|
|
20
|
-
ibRemoveIssuerLocaleBranding(args: IRemoveIssuerLocaleBrandingArgs, context: IRequiredContext): Promise<IDeletionResult>;
|
|
21
|
-
ibUpdateIssuerLocaleBranding(args: IUpdateIssuerLocaleBrandingArgs, context: IRequiredContext): Promise<IIssuerLocaleBranding>;
|
|
22
|
-
ibIssuerLocaleBrandingFrom(args: IIssuerBrandingFromArgs, context: IRequiredContext): Promise<IBasicIssuerLocaleBranding>;
|
|
23
|
-
}
|
|
24
|
-
interface IGetCredentialBrandingArgs {
|
|
25
|
-
filter?: FindCredentialBrandingArgs;
|
|
26
|
-
}
|
|
27
|
-
interface IAdditionalImageAttributes {
|
|
28
|
-
mediaType?: string;
|
|
29
|
-
dataUri?: string;
|
|
30
|
-
dimensions: IBasicImageDimensions;
|
|
31
|
-
}
|
|
32
|
-
interface IUpdateCredentialBrandingArgs {
|
|
33
|
-
credentialBranding: Omit<ICredentialBranding, 'localeBranding' | 'createdAt' | 'lastUpdatedAt'>;
|
|
34
|
-
}
|
|
35
|
-
interface IRemoveCredentialBrandingArgs {
|
|
36
|
-
filter: FindCredentialBrandingArgs;
|
|
37
|
-
}
|
|
38
|
-
interface IUpdateIssuerBrandingArgs {
|
|
39
|
-
issuerBranding: Omit<IIssuerBranding, 'localeBranding' | 'createdAt' | 'lastUpdatedAt'>;
|
|
40
|
-
}
|
|
41
|
-
interface IRemoveIssuerBrandingArgs {
|
|
42
|
-
filter: FindIssuerBrandingArgs;
|
|
43
|
-
}
|
|
44
|
-
interface IAddIssuerBrandingArgs {
|
|
45
|
-
issuerCorrelationId: string;
|
|
46
|
-
localeBranding: Array<IBasicIssuerLocaleBranding>;
|
|
47
|
-
}
|
|
48
|
-
interface IGetIssuerBrandingArgs {
|
|
49
|
-
filter?: FindIssuerBrandingArgs;
|
|
50
|
-
}
|
|
51
|
-
interface IAddCredentialBrandingArgs {
|
|
52
|
-
issuerCorrelationId: string;
|
|
53
|
-
vcHash: string;
|
|
54
|
-
localeBranding: Array<IBasicCredentialLocaleBranding>;
|
|
55
|
-
}
|
|
56
|
-
interface IAddCredentialLocaleBrandingArgs {
|
|
57
|
-
credentialBrandingId: string;
|
|
58
|
-
localeBranding: Array<IBasicCredentialLocaleBranding>;
|
|
59
|
-
}
|
|
60
|
-
interface IAddIssuerLocaleBrandingArgs {
|
|
61
|
-
issuerBrandingId: string;
|
|
62
|
-
localeBranding: Array<IBasicIssuerLocaleBranding>;
|
|
63
|
-
}
|
|
64
|
-
interface IGetCredentialLocaleBrandingArgs {
|
|
65
|
-
filter?: FindCredentialLocaleBrandingArgs;
|
|
66
|
-
}
|
|
67
|
-
interface IGetIssuerLocaleBrandingArgs {
|
|
68
|
-
filter?: FindIssuerLocaleBrandingArgs;
|
|
69
|
-
}
|
|
70
|
-
interface IRemoveCredentialLocaleBrandingArgs {
|
|
71
|
-
filter: FindCredentialLocaleBrandingArgs;
|
|
72
|
-
}
|
|
73
|
-
interface IRemoveIssuerLocaleBrandingArgs {
|
|
74
|
-
filter: FindIssuerLocaleBrandingArgs;
|
|
75
|
-
}
|
|
76
|
-
interface IUpdateCredentialLocaleBrandingArgs {
|
|
77
|
-
localeBranding: Omit<ILocaleBranding, 'createdAt' | 'lastUpdatedAt'>;
|
|
78
|
-
}
|
|
79
|
-
interface IUpdateIssuerLocaleBrandingArgs {
|
|
80
|
-
localeBranding: Omit<ILocaleBranding, 'createdAt' | 'lastUpdatedAt'>;
|
|
81
|
-
}
|
|
82
|
-
interface ICredentialBrandingFromArgs {
|
|
83
|
-
localeBranding: IBasicCredentialLocaleBranding;
|
|
84
|
-
}
|
|
85
|
-
interface IIssuerBrandingFromArgs {
|
|
86
|
-
localeBranding: IBasicIssuerLocaleBranding;
|
|
87
|
-
}
|
|
88
|
-
interface IDeletionResult {
|
|
89
|
-
result: boolean;
|
|
90
|
-
error?: string;
|
|
91
|
-
}
|
|
92
|
-
type IRequiredContext = IAgentContext<never>;
|
|
93
|
-
|
|
94
|
-
declare const issuanceBrandingMethods: Array<string>;
|
|
95
|
-
/**
|
|
96
|
-
* {@inheritDoc IIssuanceBranding}
|
|
97
|
-
*/
|
|
98
|
-
declare class IssuanceBranding implements IAgentPlugin {
|
|
99
|
-
readonly schema: any;
|
|
100
|
-
readonly methods: IIssuanceBranding;
|
|
101
|
-
private readonly store;
|
|
102
|
-
constructor(options: {
|
|
103
|
-
store: AbstractIssuanceBrandingStore;
|
|
104
|
-
});
|
|
105
|
-
/** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */
|
|
106
|
-
private ibAddCredentialBranding;
|
|
107
|
-
/** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */
|
|
108
|
-
private ibGetCredentialBranding;
|
|
109
|
-
/** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */
|
|
110
|
-
private ibUpdateCredentialBranding;
|
|
111
|
-
/** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */
|
|
112
|
-
private ibRemoveCredentialBranding;
|
|
113
|
-
/** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */
|
|
114
|
-
private ibAddCredentialLocaleBranding;
|
|
115
|
-
/** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */
|
|
116
|
-
private ibGetCredentialLocaleBranding;
|
|
117
|
-
/** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */
|
|
118
|
-
private ibRemoveCredentialLocaleBranding;
|
|
119
|
-
/** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */
|
|
120
|
-
private ibUpdateCredentialLocaleBranding;
|
|
121
|
-
/** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */
|
|
122
|
-
private ibCredentialLocaleBrandingFrom;
|
|
123
|
-
/** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */
|
|
124
|
-
private ibAddIssuerBranding;
|
|
125
|
-
/** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */
|
|
126
|
-
private ibGetIssuerBranding;
|
|
127
|
-
/** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */
|
|
128
|
-
private ibUpdateIssuerBranding;
|
|
129
|
-
/** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */
|
|
130
|
-
private inRemoveIssuerBranding;
|
|
131
|
-
/** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */
|
|
132
|
-
private ibAddIssuerLocaleBranding;
|
|
133
|
-
/** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */
|
|
134
|
-
private ibAGetIssuerLocaleBranding;
|
|
135
|
-
/** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */
|
|
136
|
-
private ibRemoveIssuerLocaleBranding;
|
|
137
|
-
/** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */
|
|
138
|
-
private ibUpdateIssuerLocaleBranding;
|
|
139
|
-
/** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */
|
|
140
|
-
private ibIssuerLocaleBrandingFrom;
|
|
141
|
-
private setAdditionalImageAttributes;
|
|
142
|
-
private getAdditionalImageAttributes;
|
|
143
|
-
private extractBase64FromDataURI;
|
|
144
|
-
private getDataTypeFromDataURI;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
1
|
/**
|
|
148
2
|
* @public
|
|
149
3
|
*/
|
|
150
4
|
declare const schema: any;
|
|
151
|
-
|
|
152
|
-
export {
|
|
5
|
+
export { schema };
|
|
6
|
+
export { IssuanceBranding, issuanceBrandingMethods } from './agent/IssuanceBranding';
|
|
7
|
+
export * from './types/IIssuanceBranding';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AACpF,cAAc,2BAA2B,CAAA"}
|