@nmshd/runtime 7.0.0-alpha.12 → 7.0.0-alpha.14
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/buildInformation.js +5 -5
- package/dist/dataViews/DataViewExpander.d.ts.map +1 -1
- package/dist/dataViews/DataViewExpander.js +20 -38
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/dataViews/content/RequestItemDVOs.d.ts +0 -4
- package/dist/dataViews/content/RequestItemDVOs.d.ts.map +1 -1
- package/dist/dataViews/content/ResponseItemDVOs.d.ts +1 -5
- package/dist/dataViews/content/ResponseItemDVOs.d.ts.map +1 -1
- package/dist/extensibility/facades/transport/FilesFacade.d.ts +2 -6
- package/dist/extensibility/facades/transport/FilesFacade.d.ts.map +1 -1
- package/dist/extensibility/facades/transport/FilesFacade.js +2 -14
- package/dist/extensibility/facades/transport/FilesFacade.js.map +1 -1
- package/dist/extensibility/facades/transport/RelationshipTemplatesFacade.d.ts +2 -6
- package/dist/extensibility/facades/transport/RelationshipTemplatesFacade.d.ts.map +1 -1
- package/dist/extensibility/facades/transport/RelationshipTemplatesFacade.js +1 -13
- package/dist/extensibility/facades/transport/RelationshipTemplatesFacade.js.map +1 -1
- package/dist/extensibility/facades/transport/TokensFacade.d.ts +2 -4
- package/dist/extensibility/facades/transport/TokensFacade.d.ts.map +1 -1
- package/dist/extensibility/facades/transport/TokensFacade.js +2 -8
- package/dist/extensibility/facades/transport/TokensFacade.js.map +1 -1
- package/dist/modules/DeciderModule.d.ts.map +1 -1
- package/dist/modules/DeciderModule.js +0 -2
- package/dist/modules/DeciderModule.js.map +1 -1
- package/dist/modules/decide/RequestConfig.d.ts +2 -6
- package/dist/modules/decide/RequestConfig.d.ts.map +1 -1
- package/dist/modules/decide/RequestConfig.js.map +1 -1
- package/dist/modules/decide/ResponseConfig.d.ts +1 -5
- package/dist/modules/decide/ResponseConfig.d.ts.map +1 -1
- package/dist/modules/decide/ResponseConfig.js +0 -4
- package/dist/modules/decide/ResponseConfig.js.map +1 -1
- package/dist/useCases/common/RuntimeErrors.d.ts +0 -1
- package/dist/useCases/common/RuntimeErrors.d.ts.map +1 -1
- package/dist/useCases/common/RuntimeErrors.js +0 -3
- package/dist/useCases/common/RuntimeErrors.js.map +1 -1
- package/dist/useCases/common/Schemas.d.ts +0 -5
- package/dist/useCases/common/Schemas.d.ts.map +1 -1
- package/dist/useCases/common/Schemas.js +18 -515
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/common/index.d.ts +0 -1
- package/dist/useCases/common/index.d.ts.map +1 -1
- package/dist/useCases/common/index.js +0 -1
- package/dist/useCases/common/index.js.map +1 -1
- package/dist/useCases/consumption/attributes/CreateAndShareRelationshipAttribute.d.ts +0 -1
- package/dist/useCases/consumption/attributes/CreateAndShareRelationshipAttribute.d.ts.map +1 -1
- package/dist/useCases/consumption/attributes/CreateAndShareRelationshipAttribute.js.map +1 -1
- package/dist/useCases/consumption/attributes/ShareRepositoryAttribute.d.ts +0 -1
- package/dist/useCases/consumption/attributes/ShareRepositoryAttribute.d.ts.map +1 -1
- package/dist/useCases/consumption/attributes/ShareRepositoryAttribute.js.map +1 -1
- package/dist/useCases/transport/files/index.d.ts +0 -2
- package/dist/useCases/transport/files/index.d.ts.map +1 -1
- package/dist/useCases/transport/files/index.js +0 -2
- package/dist/useCases/transport/files/index.js.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/index.d.ts +0 -2
- package/dist/useCases/transport/relationshipTemplates/index.d.ts.map +1 -1
- package/dist/useCases/transport/relationshipTemplates/index.js +0 -2
- package/dist/useCases/transport/relationshipTemplates/index.js.map +1 -1
- package/dist/useCases/transport/tokens/index.d.ts +0 -1
- package/dist/useCases/transport/tokens/index.d.ts.map +1 -1
- package/dist/useCases/transport/tokens/index.js +0 -1
- package/dist/useCases/transport/tokens/index.js.map +1 -1
- package/package.json +5 -7
- package/dist/useCases/common/QRCode.d.ts +0 -10
- package/dist/useCases/common/QRCode.d.ts.map +0 -1
- package/dist/useCases/common/QRCode.js +0 -55
- package/dist/useCases/common/QRCode.js.map +0 -1
- package/dist/useCases/transport/files/CreateQRCodeForFile.d.ts +0 -19
- package/dist/useCases/transport/files/CreateQRCodeForFile.d.ts.map +0 -1
- package/dist/useCases/transport/files/CreateQRCodeForFile.js +0 -51
- package/dist/useCases/transport/files/CreateQRCodeForFile.js.map +0 -1
- package/dist/useCases/transport/files/CreateTokenQRCodeForFile.d.ts +0 -29
- package/dist/useCases/transport/files/CreateTokenQRCodeForFile.d.ts.map +0 -1
- package/dist/useCases/transport/files/CreateTokenQRCodeForFile.js +0 -67
- package/dist/useCases/transport/files/CreateTokenQRCodeForFile.js.map +0 -1
- package/dist/useCases/transport/relationshipTemplates/CreateQRCodeForOwnRelationshipTemplate.d.ts +0 -19
- package/dist/useCases/transport/relationshipTemplates/CreateQRCodeForOwnRelationshipTemplate.d.ts.map +0 -1
- package/dist/useCases/transport/relationshipTemplates/CreateQRCodeForOwnRelationshipTemplate.js +0 -54
- package/dist/useCases/transport/relationshipTemplates/CreateQRCodeForOwnRelationshipTemplate.js.map +0 -1
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.d.ts +0 -29
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.d.ts.map +0 -1
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.js +0 -79
- package/dist/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.js.map +0 -1
- package/dist/useCases/transport/tokens/GetQRCodeForToken.d.ts +0 -19
- package/dist/useCases/transport/tokens/GetQRCodeForToken.d.ts.map +0 -1
- package/dist/useCases/transport/tokens/GetQRCodeForToken.js +0 -51
- package/dist/useCases/transport/tokens/GetQRCodeForToken.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateTokenQRCodeForOwnRelationshipTemplate.d.ts","sourceRoot":"","sources":["../../../../src/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAA8D,8BAA8B,EAAoC,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEjL,OAAO,EACH,aAAa,EACb,qBAAqB,EAErB,4BAA4B,EAE5B,gBAAgB,EAChB,iCAAiC,EACjC,OAAO,EACV,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,sCAAsC;IACnD,UAAU,EAAE,4BAA4B,CAAC;IACzC,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,kBAAkB,CAAC,EAAE;QACjB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,IAAI,CAAC;KACxB,CAAC;CACL;AAED,cAAM,SAAU,SAAQ,iCAAiC,CAAC,sCAAsC,CAAC;gBAClE,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,MAAM,WAAW,uCAAuC;IACpD,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,sCAAuC,SAAQ,OAAO,CAAC,sCAAsC,EAAE,uCAAuC,CAAC;IAEpI,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,kBAAkB,EAAE,8BAA8B,EAClD,eAAe,EAAE,eAAe,EACjD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,sCAAsC,GAAG,OAAO,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC;CAyC7I"}
|
package/dist/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.CreateTokenQRCodeForOwnTemplateUseCase = void 0;
|
|
16
|
-
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
17
|
-
const core_types_1 = require("@nmshd/core-types");
|
|
18
|
-
const transport_1 = require("@nmshd/transport");
|
|
19
|
-
const typescript_ioc_1 = require("@nmshd/typescript-ioc");
|
|
20
|
-
const common_1 = require("../../common");
|
|
21
|
-
let Validator = class Validator extends common_1.TokenAndTemplateCreationValidator {
|
|
22
|
-
constructor(schemaRepository) {
|
|
23
|
-
super(schemaRepository.getSchema("CreateTokenQRCodeForOwnTemplateRequest"));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
Validator = __decorate([
|
|
27
|
-
__param(0, typescript_ioc_1.Inject),
|
|
28
|
-
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
-
], Validator);
|
|
30
|
-
let CreateTokenQRCodeForOwnTemplateUseCase = class CreateTokenQRCodeForOwnTemplateUseCase extends common_1.UseCase {
|
|
31
|
-
constructor(templateController, tokenController, validator) {
|
|
32
|
-
super(validator);
|
|
33
|
-
this.templateController = templateController;
|
|
34
|
-
this.tokenController = tokenController;
|
|
35
|
-
}
|
|
36
|
-
async executeInternal(request) {
|
|
37
|
-
const template = await this.templateController.getRelationshipTemplate(core_types_1.CoreId.from(request.templateId));
|
|
38
|
-
if (!template) {
|
|
39
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.RelationshipTemplate));
|
|
40
|
-
}
|
|
41
|
-
if (!template.isOwn) {
|
|
42
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.relationshipTemplates.cannotCreateTokenForPeerTemplate());
|
|
43
|
-
}
|
|
44
|
-
if (template.cache?.forIdentity && request.forIdentity !== template.cache.forIdentity.toString()) {
|
|
45
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.relationshipTemplates.personalizationMustBeInherited());
|
|
46
|
-
}
|
|
47
|
-
if (template.passwordProtection && !template.passwordProtection.matchesInputForNewPasswordProtection(request.passwordProtection)) {
|
|
48
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.relationshipTemplates.passwordProtectionMustBeInherited());
|
|
49
|
-
}
|
|
50
|
-
const passwordProtection = template.passwordProtection ? core_types_1.SharedPasswordProtection.from(template.passwordProtection) : undefined;
|
|
51
|
-
const tokenContent = transport_1.TokenContentRelationshipTemplate.from({
|
|
52
|
-
templateId: template.id,
|
|
53
|
-
secretKey: template.secretKey,
|
|
54
|
-
forIdentity: template.cache.forIdentity,
|
|
55
|
-
passwordProtection
|
|
56
|
-
});
|
|
57
|
-
const defaultTokenExpiry = template.cache?.expiresAt ?? core_types_1.CoreDate.utc().add({ days: 12 });
|
|
58
|
-
const tokenExpiry = request.expiresAt ? core_types_1.CoreDate.from(request.expiresAt) : defaultTokenExpiry;
|
|
59
|
-
const token = await this.tokenController.sendToken({
|
|
60
|
-
content: tokenContent,
|
|
61
|
-
expiresAt: tokenExpiry,
|
|
62
|
-
ephemeral: true,
|
|
63
|
-
forIdentity: request.forIdentity ? core_types_1.CoreAddress.from(request.forIdentity) : undefined,
|
|
64
|
-
passwordProtection: transport_1.PasswordProtectionCreationParameters.create(request.passwordProtection)
|
|
65
|
-
});
|
|
66
|
-
const qrCode = await common_1.QRCode.forTruncateable(token);
|
|
67
|
-
return ts_utils_1.Result.ok({ qrCodeBytes: qrCode.asBase64() });
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
exports.CreateTokenQRCodeForOwnTemplateUseCase = CreateTokenQRCodeForOwnTemplateUseCase;
|
|
71
|
-
exports.CreateTokenQRCodeForOwnTemplateUseCase = CreateTokenQRCodeForOwnTemplateUseCase = __decorate([
|
|
72
|
-
__param(0, typescript_ioc_1.Inject),
|
|
73
|
-
__param(1, typescript_ioc_1.Inject),
|
|
74
|
-
__param(2, typescript_ioc_1.Inject),
|
|
75
|
-
__metadata("design:paramtypes", [transport_1.RelationshipTemplateController,
|
|
76
|
-
transport_1.TokenController,
|
|
77
|
-
Validator])
|
|
78
|
-
], CreateTokenQRCodeForOwnTemplateUseCase);
|
|
79
|
-
//# sourceMappingURL=CreateTokenQRCodeForOwnRelationshipTemplate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateTokenQRCodeForOwnRelationshipTemplate.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationshipTemplates/CreateTokenQRCodeForOwnRelationshipTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,kDAA4F;AAC5F,gDAAiL;AACjL,0DAA+C;AAC/C,yCASsB;AAetB,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,0CAAyE;IAC7F,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAChF,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAMD,IAAa,sCAAsC,GAAnD,MAAa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CAA8B;QACjC,2BAAe;QACtC,SAAS;GAJvB,sCAAsC,CAkDlD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { TokenController } from "@nmshd/transport";
|
|
3
|
-
import { SchemaRepository, SchemaValidator, TokenIdString, UseCase } from "../../common";
|
|
4
|
-
export interface GetQRCodeForTokenRequest {
|
|
5
|
-
id: TokenIdString;
|
|
6
|
-
}
|
|
7
|
-
declare class Validator extends SchemaValidator<GetQRCodeForTokenRequest> {
|
|
8
|
-
constructor(schemaRepository: SchemaRepository);
|
|
9
|
-
}
|
|
10
|
-
export interface GetQRCodeForTokenResponse {
|
|
11
|
-
qrCodeBytes: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class GetQRCodeForTokenUseCase extends UseCase<GetQRCodeForTokenRequest, GetQRCodeForTokenResponse> {
|
|
14
|
-
private readonly tokenController;
|
|
15
|
-
constructor(tokenController: TokenController, validator: Validator);
|
|
16
|
-
protected executeInternal(request: GetQRCodeForTokenRequest): Promise<Result<GetQRCodeForTokenResponse>>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=GetQRCodeForToken.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetQRCodeForToken.d.ts","sourceRoot":"","sources":["../../../../src/useCases/transport/tokens/GetQRCodeForToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAS,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAyB,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEhH,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,aAAa,CAAC;CACrB;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,wBAAwB,CAAC;gBAClC,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,MAAM,WAAW,yBAAyB;IACtC,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAE1F,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe,EACjD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;CAUjH"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.GetQRCodeForTokenUseCase = void 0;
|
|
16
|
-
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
17
|
-
const core_types_1 = require("@nmshd/core-types");
|
|
18
|
-
const transport_1 = require("@nmshd/transport");
|
|
19
|
-
const typescript_ioc_1 = require("@nmshd/typescript-ioc");
|
|
20
|
-
const common_1 = require("../../common");
|
|
21
|
-
let Validator = class Validator extends common_1.SchemaValidator {
|
|
22
|
-
constructor(schemaRepository) {
|
|
23
|
-
super(schemaRepository.getSchema("GetQRCodeForTokenRequest"));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
Validator = __decorate([
|
|
27
|
-
__param(0, typescript_ioc_1.Inject),
|
|
28
|
-
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
|
-
], Validator);
|
|
30
|
-
let GetQRCodeForTokenUseCase = class GetQRCodeForTokenUseCase extends common_1.UseCase {
|
|
31
|
-
constructor(tokenController, validator) {
|
|
32
|
-
super(validator);
|
|
33
|
-
this.tokenController = tokenController;
|
|
34
|
-
}
|
|
35
|
-
async executeInternal(request) {
|
|
36
|
-
const token = await this.tokenController.getToken(core_types_1.CoreId.from(request.id));
|
|
37
|
-
if (!token) {
|
|
38
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.Token));
|
|
39
|
-
}
|
|
40
|
-
const qrCode = await common_1.QRCode.forTruncateable(token);
|
|
41
|
-
return ts_utils_1.Result.ok({ qrCodeBytes: qrCode.asBase64() });
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.GetQRCodeForTokenUseCase = GetQRCodeForTokenUseCase;
|
|
45
|
-
exports.GetQRCodeForTokenUseCase = GetQRCodeForTokenUseCase = __decorate([
|
|
46
|
-
__param(0, typescript_ioc_1.Inject),
|
|
47
|
-
__param(1, typescript_ioc_1.Inject),
|
|
48
|
-
__metadata("design:paramtypes", [transport_1.TokenController,
|
|
49
|
-
Validator])
|
|
50
|
-
], GetQRCodeForTokenUseCase);
|
|
51
|
-
//# sourceMappingURL=GetQRCodeForToken.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetQRCodeForToken.js","sourceRoot":"","sources":["../../../../src/useCases/transport/tokens/GetQRCodeForToken.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,kDA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