@robinmordasiewicz/f5xc-api-mcp 2.0.21-2601081732 → 2.0.21-2601090213
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/generator/tool-generator.d.ts +1 -2
- package/dist/generator/tool-generator.d.ts.map +1 -1
- package/dist/generator/tool-generator.js +1 -1
- package/dist/generator/tool-generator.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -2
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +1 -1
- package/dist/resources/handlers.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/configure-auth.d.ts +1 -1
- package/dist/tools/configure-auth.d.ts.map +1 -1
- package/dist/tools/configure-auth.js +1 -1
- package/dist/tools/configure-auth.js.map +1 -1
- package/dist/tools/discovery/execute.d.ts +1 -1
- package/dist/tools/discovery/execute.d.ts.map +1 -1
- package/dist/tools/discovery/execute.js +1 -2
- package/dist/tools/discovery/execute.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -1
- package/dist/auth/credential-manager.d.ts +0 -177
- package/dist/auth/credential-manager.d.ts.map +0 -1
- package/dist/auth/credential-manager.js +0 -417
- package/dist/auth/credential-manager.js.map +0 -1
- package/dist/auth/http-client.d.ts +0 -86
- package/dist/auth/http-client.d.ts.map +0 -1
- package/dist/auth/http-client.js +0 -257
- package/dist/auth/http-client.js.map +0 -1
- package/dist/auth/index.d.ts +0 -12
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -10
- package/dist/auth/index.js.map +0 -1
- package/dist/config/paths.d.ts +0 -36
- package/dist/config/paths.d.ts.map +0 -1
- package/dist/config/paths.js +0 -68
- package/dist/config/paths.js.map +0 -1
- package/dist/profile/index.d.ts +0 -8
- package/dist/profile/index.d.ts.map +0 -1
- package/dist/profile/index.js +0 -7
- package/dist/profile/index.js.map +0 -1
- package/dist/profile/manager.d.ts +0 -74
- package/dist/profile/manager.d.ts.map +0 -1
- package/dist/profile/manager.js +0 -326
- package/dist/profile/manager.js.map +0 -1
- package/dist/profile/types.d.ts +0 -53
- package/dist/profile/types.d.ts.map +0 -1
- package/dist/profile/types.js +0 -7
- package/dist/profile/types.js.map +0 -1
package/dist/profile/manager.js
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ProfileManager - XDG-compliant profile storage and management
|
|
3
|
-
*
|
|
4
|
-
* Profiles are stored in ~/.config/f5xc/profiles/ (XDG Base Directory compliant)
|
|
5
|
-
*/
|
|
6
|
-
import { promises as fs } from "fs";
|
|
7
|
-
import { join } from "path";
|
|
8
|
-
import YAML from "yaml";
|
|
9
|
-
import { paths } from "../config/paths.js";
|
|
10
|
-
/**
|
|
11
|
-
* Convert snake_case to camelCase
|
|
12
|
-
*/
|
|
13
|
-
function snakeToCamel(str) {
|
|
14
|
-
return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Convert object keys from snake_case to camelCase
|
|
18
|
-
*/
|
|
19
|
-
function convertKeysToCamelCase(obj) {
|
|
20
|
-
const result = {};
|
|
21
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
22
|
-
result[snakeToCamel(key)] = value;
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* ProfileManager handles profile CRUD operations with secure file storage
|
|
28
|
-
*/
|
|
29
|
-
export class ProfileManager {
|
|
30
|
-
config;
|
|
31
|
-
constructor() {
|
|
32
|
-
this.config = {
|
|
33
|
-
configDir: paths.configDir,
|
|
34
|
-
profilesDir: paths.profilesDir,
|
|
35
|
-
activeProfileFile: paths.activeProfile,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Ensure config directories exist
|
|
40
|
-
*/
|
|
41
|
-
async ensureDirectories() {
|
|
42
|
-
await fs.mkdir(this.config.profilesDir, {
|
|
43
|
-
recursive: true,
|
|
44
|
-
mode: 0o700,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get path to profile JSON file
|
|
49
|
-
*/
|
|
50
|
-
getProfilePath(name) {
|
|
51
|
-
return join(this.config.profilesDir, `${name}.json`);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Validate profile name (alphanumeric, dash, underscore only)
|
|
55
|
-
*/
|
|
56
|
-
isValidName(name) {
|
|
57
|
-
return /^[a-zA-Z0-9_-]+$/.test(name) && name.length > 0 && name.length <= 64;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Validate API URL format
|
|
61
|
-
*/
|
|
62
|
-
isValidUrl(url) {
|
|
63
|
-
try {
|
|
64
|
-
const parsed = new URL(url);
|
|
65
|
-
return parsed.protocol === "https:" || parsed.protocol === "http:";
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* List all saved profiles
|
|
73
|
-
*/
|
|
74
|
-
async list() {
|
|
75
|
-
await this.ensureDirectories();
|
|
76
|
-
try {
|
|
77
|
-
const files = await fs.readdir(this.config.profilesDir);
|
|
78
|
-
const profileNames = new Set();
|
|
79
|
-
// Collect unique profile names from filenames
|
|
80
|
-
for (const file of files) {
|
|
81
|
-
// Support both .json and .yaml/.yml extensions
|
|
82
|
-
let name = null;
|
|
83
|
-
if (file.endsWith(".json")) {
|
|
84
|
-
name = file.slice(0, -5);
|
|
85
|
-
}
|
|
86
|
-
else if (file.endsWith(".yaml")) {
|
|
87
|
-
name = file.slice(0, -5);
|
|
88
|
-
}
|
|
89
|
-
else if (file.endsWith(".yml")) {
|
|
90
|
-
name = file.slice(0, -4);
|
|
91
|
-
}
|
|
92
|
-
if (name) {
|
|
93
|
-
profileNames.add(name);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// Load profiles (get() handles file extension priority)
|
|
97
|
-
const profiles = [];
|
|
98
|
-
for (const name of profileNames) {
|
|
99
|
-
const profile = await this.get(name);
|
|
100
|
-
if (profile) {
|
|
101
|
-
profiles.push(profile);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return profiles.sort((a, b) => a.name.localeCompare(b.name));
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
return [];
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Get a profile by name
|
|
112
|
-
*/
|
|
113
|
-
async get(name) {
|
|
114
|
-
await this.ensureDirectories();
|
|
115
|
-
// Try different file extensions in order of preference
|
|
116
|
-
const extensions = [".json", ".yaml", ".yml"];
|
|
117
|
-
for (const ext of extensions) {
|
|
118
|
-
const path = join(this.config.profilesDir, `${name}${ext}`);
|
|
119
|
-
try {
|
|
120
|
-
const data = await fs.readFile(path, "utf-8");
|
|
121
|
-
let parsed;
|
|
122
|
-
if (ext === ".json") {
|
|
123
|
-
parsed = JSON.parse(data);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
// Parse YAML and convert snake_case to camelCase
|
|
127
|
-
parsed = YAML.parse(data);
|
|
128
|
-
parsed = convertKeysToCamelCase(parsed);
|
|
129
|
-
}
|
|
130
|
-
return parsed;
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
// Try next extension
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Save a profile (create or update)
|
|
141
|
-
*/
|
|
142
|
-
async save(profile) {
|
|
143
|
-
await this.ensureDirectories();
|
|
144
|
-
if (!this.isValidName(profile.name)) {
|
|
145
|
-
return {
|
|
146
|
-
success: false,
|
|
147
|
-
message: "Invalid profile name. Use alphanumeric characters, dashes, and underscores only (max 64 chars).",
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
if (!this.isValidUrl(profile.apiUrl)) {
|
|
151
|
-
return {
|
|
152
|
-
success: false,
|
|
153
|
-
message: "Invalid API URL. Must be a valid HTTP/HTTPS URL.",
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
// Require at least one form of authentication
|
|
157
|
-
if (!profile.apiToken && !profile.cert && !profile.p12Bundle) {
|
|
158
|
-
return {
|
|
159
|
-
success: false,
|
|
160
|
-
message: "Profile must have at least one authentication method (token, certificate, or P12 bundle).",
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
try {
|
|
164
|
-
const path = this.getProfilePath(profile.name);
|
|
165
|
-
const data = JSON.stringify(profile, null, 2);
|
|
166
|
-
// Write with secure permissions (owner read/write only)
|
|
167
|
-
await fs.writeFile(path, data, { mode: 0o600 });
|
|
168
|
-
return {
|
|
169
|
-
success: true,
|
|
170
|
-
message: `Profile '${profile.name}' saved successfully.`,
|
|
171
|
-
profile,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
return {
|
|
176
|
-
success: false,
|
|
177
|
-
message: `Failed to save profile: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Delete a profile by name
|
|
183
|
-
*/
|
|
184
|
-
async delete(name) {
|
|
185
|
-
await this.ensureDirectories();
|
|
186
|
-
// Check if profile exists
|
|
187
|
-
const existing = await this.get(name);
|
|
188
|
-
if (!existing) {
|
|
189
|
-
return {
|
|
190
|
-
success: false,
|
|
191
|
-
message: `Profile '${name}' not found.`,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
// Check if it's the active profile
|
|
195
|
-
const active = await this.getActive();
|
|
196
|
-
if (active === name) {
|
|
197
|
-
return {
|
|
198
|
-
success: false,
|
|
199
|
-
message: `Cannot delete active profile '${name}'. Switch to another profile first.`,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
try {
|
|
203
|
-
const path = this.getProfilePath(name);
|
|
204
|
-
await fs.unlink(path);
|
|
205
|
-
return {
|
|
206
|
-
success: true,
|
|
207
|
-
message: `Profile '${name}' deleted successfully.`,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
return {
|
|
212
|
-
success: false,
|
|
213
|
-
message: `Failed to delete profile: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Get the name of the active profile
|
|
219
|
-
*/
|
|
220
|
-
async getActive() {
|
|
221
|
-
try {
|
|
222
|
-
const name = await fs.readFile(this.config.activeProfileFile, "utf-8");
|
|
223
|
-
return name.trim() || null;
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
return null;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Clear the active profile (used for force delete)
|
|
231
|
-
*/
|
|
232
|
-
async clearActive() {
|
|
233
|
-
try {
|
|
234
|
-
await fs.unlink(this.config.activeProfileFile);
|
|
235
|
-
}
|
|
236
|
-
catch {
|
|
237
|
-
// Ignore if file doesn't exist
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Set the active profile
|
|
242
|
-
*/
|
|
243
|
-
async setActive(name) {
|
|
244
|
-
await this.ensureDirectories();
|
|
245
|
-
// Verify profile exists
|
|
246
|
-
const profile = await this.get(name);
|
|
247
|
-
if (!profile) {
|
|
248
|
-
return {
|
|
249
|
-
success: false,
|
|
250
|
-
message: `Profile '${name}' not found.`,
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
try {
|
|
254
|
-
await fs.writeFile(this.config.activeProfileFile, name, {
|
|
255
|
-
mode: 0o600,
|
|
256
|
-
});
|
|
257
|
-
return {
|
|
258
|
-
success: true,
|
|
259
|
-
message: `Switched to profile '${name}'.`,
|
|
260
|
-
profile,
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
catch (error) {
|
|
264
|
-
return {
|
|
265
|
-
success: false,
|
|
266
|
-
message: `Failed to set active profile: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Get the active profile (full profile data)
|
|
272
|
-
*/
|
|
273
|
-
async getActiveProfile() {
|
|
274
|
-
const name = await this.getActive();
|
|
275
|
-
if (!name) {
|
|
276
|
-
return null;
|
|
277
|
-
}
|
|
278
|
-
return this.get(name);
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Check if a profile exists
|
|
282
|
-
*/
|
|
283
|
-
async exists(name) {
|
|
284
|
-
const profile = await this.get(name);
|
|
285
|
-
return profile !== null;
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Mask sensitive fields for display
|
|
289
|
-
*/
|
|
290
|
-
maskProfile(profile) {
|
|
291
|
-
const masked = {
|
|
292
|
-
name: profile.name,
|
|
293
|
-
apiUrl: profile.apiUrl,
|
|
294
|
-
};
|
|
295
|
-
if (profile.apiToken) {
|
|
296
|
-
// Show only last 4 characters
|
|
297
|
-
const len = profile.apiToken.length;
|
|
298
|
-
masked.apiToken = len > 4 ? `****${profile.apiToken.slice(-4)}` : "****";
|
|
299
|
-
}
|
|
300
|
-
if (profile.p12Bundle) {
|
|
301
|
-
masked.p12Bundle = "[configured]";
|
|
302
|
-
}
|
|
303
|
-
if (profile.cert) {
|
|
304
|
-
masked.cert = "[configured]";
|
|
305
|
-
}
|
|
306
|
-
if (profile.key) {
|
|
307
|
-
masked.key = "[configured]";
|
|
308
|
-
}
|
|
309
|
-
if (profile.defaultNamespace) {
|
|
310
|
-
masked.defaultNamespace = profile.defaultNamespace;
|
|
311
|
-
}
|
|
312
|
-
return masked;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
// Singleton instance
|
|
316
|
-
let managerInstance = null;
|
|
317
|
-
/**
|
|
318
|
-
* Get the global ProfileManager instance
|
|
319
|
-
*/
|
|
320
|
-
export function getProfileManager() {
|
|
321
|
-
if (!managerInstance) {
|
|
322
|
-
managerInstance = new ProfileManager();
|
|
323
|
-
}
|
|
324
|
-
return managerInstance;
|
|
325
|
-
}
|
|
326
|
-
//# sourceMappingURL=manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/profile/manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C;;GAEG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,GAA4B;IAC1D,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAc;IACjB,MAAM,CAAgB;IAE9B;QACE,IAAI,CAAC,MAAM,GAAG;YACZ,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,WAAW,EAAE,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AC,QAAQ,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3E,CAAC;QAED,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,MAAM,CAAC,SAAS,GAAG,cAAc,CAAC;QACpC,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC;QAC/B,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,GAAG,cAAc,CAAC;QAC9B,CAAC;QAED,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACrD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,qBAAqB;AACrB,IAAI,eAAe,GAA0B,IAAI,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,eAAe,GAAG,IAAI,cAAc,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
package/dist/profile/types.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Profile types for F5 XC authentication and configuration
|
|
3
|
-
*
|
|
4
|
-
* Profiles are stored in ~/.config/f5xc/profiles/ (XDG Base Directory compliant)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Profile represents a saved API connection configuration
|
|
8
|
-
*/
|
|
9
|
-
export interface Profile {
|
|
10
|
-
/** Unique profile name */
|
|
11
|
-
name: string;
|
|
12
|
-
/** F5 XC API URL (e.g., https://tenant.console.ves.volterra.io) */
|
|
13
|
-
apiUrl: string;
|
|
14
|
-
/** API token for authentication */
|
|
15
|
-
apiToken?: string;
|
|
16
|
-
/** P12 bundle for certificate authentication */
|
|
17
|
-
p12Bundle?: string;
|
|
18
|
-
/** Certificate for mTLS authentication */
|
|
19
|
-
cert?: string;
|
|
20
|
-
/** Private key for mTLS authentication */
|
|
21
|
-
key?: string;
|
|
22
|
-
/** Default namespace for API operations */
|
|
23
|
-
defaultNamespace?: string;
|
|
24
|
-
/** Disable TLS certificate verification (staging/development only) */
|
|
25
|
-
tlsInsecure?: boolean;
|
|
26
|
-
/** Path to custom CA bundle for TLS verification */
|
|
27
|
-
caBundle?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Profile storage configuration
|
|
31
|
-
*/
|
|
32
|
-
export interface ProfileConfig {
|
|
33
|
-
/** Base directory for profile storage */
|
|
34
|
-
configDir: string;
|
|
35
|
-
/** Directory containing profile JSON files */
|
|
36
|
-
profilesDir: string;
|
|
37
|
-
/** File tracking active profile name */
|
|
38
|
-
activeProfileFile: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Result of profile operations
|
|
42
|
-
*/
|
|
43
|
-
export interface ProfileResult {
|
|
44
|
-
success: boolean;
|
|
45
|
-
message: string;
|
|
46
|
-
profile?: Profile;
|
|
47
|
-
profiles?: Profile[];
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Profile validation errors
|
|
51
|
-
*/
|
|
52
|
-
export type ProfileValidationError = "INVALID_NAME" | "INVALID_URL" | "MISSING_AUTH" | "PROFILE_EXISTS" | "PROFILE_NOT_FOUND" | "CANNOT_DELETE_ACTIVE";
|
|
53
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/profile/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,CAAC"}
|
package/dist/profile/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/profile/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|