@explorins/pers-shared 2.1.8 → 2.1.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.
- package/README.md +62 -13
- package/dist/cjs/dto/auth.dto.d.ts +2 -6
- package/dist/cjs/dto/auth.dto.d.ts.map +1 -1
- package/dist/cjs/dto/auth.dto.js +17 -23
- package/dist/cjs/dto/auth.dto.js.map +1 -1
- package/dist/cjs/dto/purchase/purchase.dto.d.ts +1 -1
- package/dist/cjs/dto/purchase/purchase.dto.d.ts.map +1 -1
- package/dist/cjs/dto/purchase/purchase.dto.js +1 -1
- package/dist/cjs/dto/purchase/purchase.dto.js.map +1 -1
- package/dist/cjs/enum/index.d.ts +1 -0
- package/dist/cjs/enum/index.d.ts.map +1 -1
- package/dist/cjs/enum/index.js +1 -0
- package/dist/cjs/enum/index.js.map +1 -1
- package/dist/cjs/interfaces/token-transaction-input-data.interface.d.ts +10 -2
- package/dist/cjs/interfaces/token-transaction-input-data.interface.d.ts.map +1 -1
- package/dist/cjs/value-objects/token-transaction-input.vo.d.ts +2 -3
- package/dist/cjs/value-objects/token-transaction-input.vo.d.ts.map +1 -1
- package/dist/cjs/value-objects/token-transaction-input.vo.js +12 -20
- package/dist/cjs/value-objects/token-transaction-input.vo.js.map +1 -1
- package/dist/esm/dto/auth.dto.d.ts +2 -6
- package/dist/esm/dto/auth.dto.d.ts.map +1 -1
- package/dist/esm/dto/auth.dto.js +14 -18
- package/dist/esm/dto/auth.dto.js.map +1 -1
- package/dist/esm/dto/purchase/purchase.dto.d.ts +1 -1
- package/dist/esm/dto/purchase/purchase.dto.d.ts.map +1 -1
- package/dist/esm/dto/purchase/purchase.dto.js +1 -1
- package/dist/esm/dto/purchase/purchase.dto.js.map +1 -1
- package/dist/esm/enum/index.d.ts +1 -0
- package/dist/esm/enum/index.d.ts.map +1 -1
- package/dist/esm/enum/index.js +1 -0
- package/dist/esm/enum/index.js.map +1 -1
- package/dist/esm/interfaces/token-transaction-input-data.interface.d.ts +10 -2
- package/dist/esm/interfaces/token-transaction-input-data.interface.d.ts.map +1 -1
- package/dist/esm/value-objects/token-transaction-input.vo.d.ts +2 -3
- package/dist/esm/value-objects/token-transaction-input.vo.d.ts.map +1 -1
- package/dist/esm/value-objects/token-transaction-input.vo.js +10 -18
- package/dist/esm/value-objects/token-transaction-input.vo.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,11 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
Pure data contracts for frontends, third-party integrations, and API consumers.
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
## 📊 **Bundle Size** ⚡
|
|
8
|
+
- **Browser Bundle**: **0.44 KB** (0.30 KB gzipped)
|
|
9
|
+
- **Full Bundle**: **0.67 KB** (0.38 KB gzipped)
|
|
10
|
+
- **CommonJS**: **1.53 KB** (0.72 KB gzipped)
|
|
11
|
+
- **Package Size**: 1.2 MB (includes all TypeScript definitions)
|
|
12
|
+
- **Runtime Impact**: < 1 KB with tree shaking
|
|
13
|
+
|
|
14
|
+
## 📋 **Contents**
|
|
15
|
+
- **DTOs** - Complete API data transfer objects with validation
|
|
16
|
+
- **Interfaces** - TypeScript contracts for authentication, users, campaigns, transactions
|
|
17
|
+
- **Types & Enums** - Authentication types, error codes, transaction statuses
|
|
18
|
+
- **Value Objects** - Immutable data structures (`Address`, `StructuredError`)
|
|
19
|
+
- **Error Classes** - Structured domain errors (`AuthenticationRequiredError`, etc.)
|
|
12
20
|
|
|
13
21
|
## 🚨 **Critical Build Configuration**
|
|
14
22
|
|
|
@@ -36,16 +44,57 @@ Pure data contracts for frontends, third-party integrations, and API consumers.
|
|
|
36
44
|
npm install @explorins/pers-shared
|
|
37
45
|
```
|
|
38
46
|
|
|
47
|
+
### **Backend/Node.js**
|
|
39
48
|
```typescript
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
import {
|
|
50
|
+
UserDTO,
|
|
51
|
+
TransactionStatus,
|
|
52
|
+
AuthenticationRequiredError,
|
|
53
|
+
PasskeysAuthRequestDTO
|
|
54
|
+
} from '@explorins/pers-shared';
|
|
55
|
+
|
|
56
|
+
// Type-safe API requests
|
|
57
|
+
const authRequest: PasskeysAuthRequestDTO = {
|
|
58
|
+
authToken: "external_provider_jwt_token"
|
|
59
|
+
};
|
|
42
60
|
|
|
43
|
-
//
|
|
44
|
-
|
|
61
|
+
// Structured error handling
|
|
62
|
+
try {
|
|
63
|
+
const user = await authenticate(authRequest);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
if (error instanceof AuthenticationRequiredError) {
|
|
66
|
+
console.error('Authentication failed:', error.code);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
45
69
|
```
|
|
46
70
|
|
|
47
|
-
|
|
71
|
+
### **Frontend/Browser (Ultra-Light)**
|
|
72
|
+
```typescript
|
|
73
|
+
// Browser-optimized import - Tree-shaken to 0.44 KB!
|
|
74
|
+
import { UserDTO, CampaignDTO, Address } from '@explorins/pers-shared/browser';
|
|
75
|
+
|
|
76
|
+
// React example with full type safety
|
|
77
|
+
interface UserBalanceProps {
|
|
78
|
+
user: UserTokenBalancesDTO;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const UserBalance: React.FC<UserBalanceProps> = ({ user }) => (
|
|
82
|
+
<div>
|
|
83
|
+
<h2>{user.email}</h2>
|
|
84
|
+
<p>Wallet: {user.walletAddress?.getValue()}</p>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 🔧 **Build System & Performance**
|
|
90
|
+
|
|
91
|
+
- **Dual Builds**: CommonJS (Node.js) + ESM (browsers) with automatic selection
|
|
92
|
+
- **Exceptional Tree Shaking**: 99.9%+ elimination (1.2 MB package → 0.44 KB runtime)
|
|
93
|
+
- **Zero Runtime**: Pure type definitions with no execution overhead
|
|
94
|
+
- **Framework Agnostic**: React, Vue, Angular, vanilla JS, Node.js
|
|
48
95
|
|
|
49
|
-
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
96
|
+
## 🎯 **Key Benefits**
|
|
97
|
+
- **Type Safety**: Catch API integration errors at compile time
|
|
98
|
+
- **Developer Experience**: Full IntelliSense and auto-completion
|
|
99
|
+
- **Performance**: Exceptional tree-shaking (1.2 MB → 0.44 KB runtime)
|
|
100
|
+
- **Reliability**: Contracts match exact PERS API specifications
|
|
@@ -6,14 +6,10 @@ export declare class PasskeysAuthRequestDTO {
|
|
|
6
6
|
export declare class RefreshTokenRequestDTO {
|
|
7
7
|
refreshToken: string;
|
|
8
8
|
}
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class SessionAuthResponseDTO {
|
|
10
10
|
accessToken: string;
|
|
11
11
|
refreshToken: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class UserAuthResponseDTO extends AuthResponseDTO {
|
|
14
|
-
user: UserDTO;
|
|
15
|
-
}
|
|
16
|
-
export declare class AdminLoginResponseDTO extends AuthResponseDTO {
|
|
17
12
|
admin?: AdminDTO;
|
|
13
|
+
user?: UserDTO;
|
|
18
14
|
}
|
|
19
15
|
//# sourceMappingURL=auth.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,sBAAsB;IAQ/B,SAAS,EAAE,MAAM,CAAM;CAC1B;AAkBD,qBAAa,sBAAsB;IAK/B,YAAY,EAAE,MAAM,CAAM;CAC7B;AAED,qBAAa,
|
|
1
|
+
{"version":3,"file":"auth.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,sBAAsB;IAQ/B,SAAS,EAAE,MAAM,CAAM;CAC1B;AAkBD,qBAAa,sBAAsB;IAK/B,YAAY,EAAE,MAAM,CAAM;CAC7B;AAED,qBAAa,sBAAsB;IAM/B,WAAW,EAAE,MAAM,CAAM;IAMzB,YAAY,EAAE,MAAM,CAAM;IAM1B,KAAK,CAAC,EAAE,QAAQ,CAAC;IAMjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
package/dist/cjs/dto/auth.dto.js
CHANGED
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.SessionAuthResponseDTO = exports.RefreshTokenRequestDTO = exports.PasskeysAuthRequestDTO = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const user_dto_1 = require("./user.dto");
|
|
@@ -54,43 +54,37 @@ __decorate([
|
|
|
54
54
|
}),
|
|
55
55
|
__metadata("design:type", String)
|
|
56
56
|
], RefreshTokenRequestDTO.prototype, "refreshToken", void 0);
|
|
57
|
-
class
|
|
57
|
+
class SessionAuthResponseDTO {
|
|
58
58
|
accessToken = '';
|
|
59
59
|
refreshToken = '';
|
|
60
|
+
admin;
|
|
61
|
+
user;
|
|
60
62
|
}
|
|
61
|
-
exports.
|
|
63
|
+
exports.SessionAuthResponseDTO = SessionAuthResponseDTO;
|
|
62
64
|
__decorate([
|
|
63
65
|
(0, swagger_1.ApiProperty)({
|
|
64
66
|
description: 'JWT access token this token is used to authenticate the user, by default it expires in 15 minutes, and it should be sent in the Authorization header as Bearer token.',
|
|
65
67
|
}),
|
|
66
68
|
__metadata("design:type", String)
|
|
67
|
-
],
|
|
69
|
+
], SessionAuthResponseDTO.prototype, "accessToken", void 0);
|
|
68
70
|
__decorate([
|
|
69
71
|
(0, swagger_1.ApiProperty)({
|
|
70
72
|
description: 'JWT refresh token this token is used to get a new access token when the current one expires. It is valid for 1 day.',
|
|
71
73
|
}),
|
|
72
74
|
__metadata("design:type", String)
|
|
73
|
-
],
|
|
74
|
-
class UserAuthResponseDTO extends AuthResponseDTO {
|
|
75
|
-
user;
|
|
76
|
-
}
|
|
77
|
-
exports.UserAuthResponseDTO = UserAuthResponseDTO;
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, swagger_1.ApiProperty)({
|
|
80
|
-
description: 'User',
|
|
81
|
-
type: () => user_dto_1.UserDTO
|
|
82
|
-
}),
|
|
83
|
-
__metadata("design:type", user_dto_1.UserDTO)
|
|
84
|
-
], UserAuthResponseDTO.prototype, "user", void 0);
|
|
85
|
-
class AdminLoginResponseDTO extends AuthResponseDTO {
|
|
86
|
-
admin;
|
|
87
|
-
}
|
|
88
|
-
exports.AdminLoginResponseDTO = AdminLoginResponseDTO;
|
|
75
|
+
], SessionAuthResponseDTO.prototype, "refreshToken", void 0);
|
|
89
76
|
__decorate([
|
|
90
|
-
(0, swagger_1.
|
|
91
|
-
description: 'Admin',
|
|
77
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
78
|
+
description: 'Admin (present if admin authentication)',
|
|
92
79
|
type: () => admin_dto_1.AdminDTO
|
|
93
80
|
}),
|
|
94
81
|
__metadata("design:type", admin_dto_1.AdminDTO)
|
|
95
|
-
],
|
|
82
|
+
], SessionAuthResponseDTO.prototype, "admin", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
85
|
+
description: 'User (present if user authentication)',
|
|
86
|
+
type: () => user_dto_1.UserDTO
|
|
87
|
+
}),
|
|
88
|
+
__metadata("design:type", user_dto_1.UserDTO)
|
|
89
|
+
], SessionAuthResponseDTO.prototype, "user", void 0);
|
|
96
90
|
//# sourceMappingURL=auth.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.dto.js","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"auth.dto.js","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAAuD;AACvD,yCAAqC;AACrC,2CAAuC;AAEvC,MAAa,sBAAsB;IAQ/B,SAAS,GAAW,EAAE,CAAC;CAC1B;AATD,wDASC;AADG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,qEAAqE;QAClF,OAAO,EAAE,yCAAyC;QAClD,IAAI,EAAE,MAAM;KACf,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yDACY;AAG3B;;;;;;;;;;;;;;IAcI;AAEJ,MAAa,sBAAsB;IAK/B,YAAY,GAAW,EAAE,CAAC;CAC7B;AAND,wDAMC;AADG;IAJC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,sJAAsJ;KAClK,CAAC;;4DACwB;AAG9B,MAAa,sBAAsB;IAM/B,WAAW,GAAW,EAAE,CAAC;IAMzB,YAAY,GAAW,EAAE,CAAC;IAM1B,KAAK,CAAY;IAMjB,IAAI,CAAW;CAClB;AAzBD,wDAyBC;AAnBG;IALC,IAAA,qBAAW,EACR;QACI,WAAW,EAAE,uKAAuK;KACvL,CACJ;;2DACwB;AAMzB;IAJC,IAAA,qBAAW,EACR;QACI,WAAW,EAAE,qHAAqH;KACrI,CAAC;;4DACoB;AAM1B;IAJC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAQ;KACvB,CAAC;8BACM,oBAAQ;qDAAC;AAMjB;IAJC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,uCAAuC;QACpD,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAO;KACtB,CAAC;8BACK,kBAAO;oDAAC"}
|
|
@@ -2,7 +2,7 @@ import { PurchaseTokenDTO } from "./purchaseToken.dto";
|
|
|
2
2
|
import { UserDTO } from "../user.dto";
|
|
3
3
|
import { BusinessDTO } from "../business/business.dto";
|
|
4
4
|
import { DonationTypeDTO } from "./donationType.dto";
|
|
5
|
-
import { PurchaseStatus, PurchaseCurrency } from "enum/purchase";
|
|
5
|
+
import { PurchaseStatus, PurchaseCurrency } from "../../enum/purchase";
|
|
6
6
|
export declare class PurchaseDTO {
|
|
7
7
|
id: string;
|
|
8
8
|
stripePaymentIntentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase.dto.d.ts","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"purchase.dto.d.ts","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,qBAAa,WAAW;IAKpB,EAAE,EAAE,MAAM,CAAM;IAKhB,qBAAqB,EAAE,MAAM,CAAM;IAKnC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAQ;IAKrC,MAAM,EAAE,MAAM,CAAK;IAOnB,QAAQ,mBAAwB;IAKhC,QAAQ,EAAE,MAAM,CAAK;IAMrB,aAAa,CAAC,EAAE,gBAAgB,CAAC;IAKjC,IAAI,CAAC,EAAE,OAAO,CAAC;IAKf,QAAQ,CAAC,EAAE,WAAW,CAAA;IAKtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAKhC,YAAY,CAAC,EAAE,eAAe,CAAC;IAG/B,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,SAAS,CAAC,EAAE,IAAI,CAAA;CACnB"}
|
|
@@ -15,7 +15,7 @@ const purchaseToken_dto_1 = require("./purchaseToken.dto");
|
|
|
15
15
|
const user_dto_1 = require("../user.dto");
|
|
16
16
|
const business_dto_1 = require("../business/business.dto");
|
|
17
17
|
const donationType_dto_1 = require("./donationType.dto");
|
|
18
|
-
const purchase_1 = require("enum/purchase");
|
|
18
|
+
const purchase_1 = require("../../enum/purchase");
|
|
19
19
|
class PurchaseDTO {
|
|
20
20
|
id = '';
|
|
21
21
|
stripePaymentIntentId = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase.dto.js","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,2DAAuD;AACvD,0CAAsC;AACtC,2DAAuD;AACvD,yDAAqD;AAErD,
|
|
1
|
+
{"version":3,"file":"purchase.dto.js","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,2DAAuD;AACvD,0CAAsC;AACtC,2DAAuD;AACvD,yDAAqD;AAErD,kDAAuE;AAGvE,MAAa,WAAW;IAKpB,EAAE,GAAW,EAAE,CAAC;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AAe,EAAE,CACnC;8BACc,kCAAe;iDAAC;AAG/B;IADC,IAAA,6BAAmB,EAAC,EAAC,WAAW,EAAE,aAAa,EAAC,CAAC;8BACtC,IAAI;8CAAA;AAGhB;IADC,IAAA,6BAAmB,EAAC,EAAC,WAAW,EAAE,aAAa,EAAC,CAAC;8BACtC,IAAI;8CAAA"}
|
package/dist/cjs/enum/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
package/dist/cjs/enum/index.js
CHANGED
|
@@ -33,4 +33,5 @@ __exportStar(require("./signing-account-status.enum"), exports);
|
|
|
33
33
|
__exportStar(require("./crypto.enum"), exports);
|
|
34
34
|
__exportStar(require("./wallet.enum"), exports);
|
|
35
35
|
__exportStar(require("./sort-order.enum"), exports);
|
|
36
|
+
__exportStar(require("./purchase"), exports);
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAwC;AACxC,0DAAwC;AACxC,0DAAwC;AACxC,4DAA0C;AAC1C,0EAAwD;AACxD,sDAAoC;AACpC,oDAAkC;AAClC,4DAA0C;AAC1C,+DAA6C;AAC7C,6DAA2C;AAC3C,oDAAkC;AAClC,qDAAmC;AACnC,yDAAuC;AACvC,iEAA+C;AAC/C,kEAAgD;AAChD,gEAA8C;AAC9C,gDAA8B;AAC9B,gDAA8B;AAC9B,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAwC;AACxC,0DAAwC;AACxC,0DAAwC;AACxC,4DAA0C;AAC1C,0EAAwD;AACxD,sDAAoC;AACpC,oDAAkC;AAClC,4DAA0C;AAC1C,+DAA6C;AAC7C,6DAA2C;AAC3C,oDAAkC;AAClC,qDAAmC;AACnC,yDAAuC;AACvC,iEAA+C;AAC/C,kEAAgD;AAChD,gEAA8C;AAC9C,gDAA8B;AAC9B,gDAA8B;AAC9B,oDAAkC;AAClC,6CAA2B"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { ContractAbi } from "web3";
|
|
2
2
|
import { Web3TransactionType } from "../enum/transaction-type.enum";
|
|
3
3
|
import { Address, NativeTokenType } from "..";
|
|
4
|
+
import { AccountOwnerType } from "../enum/owner-type.enum";
|
|
5
|
+
export interface TxParticipants {
|
|
6
|
+
senderAddress: Address;
|
|
7
|
+
senderOwnerType: AccountOwnerType | null;
|
|
8
|
+
senderId: string | null;
|
|
9
|
+
recipientAddress: Address | null;
|
|
10
|
+
recipientOwnerType: AccountOwnerType | null;
|
|
11
|
+
recipientId: string | null;
|
|
12
|
+
}
|
|
4
13
|
export interface ITokenTransactionInputData {
|
|
5
14
|
transactionId: string | null;
|
|
6
15
|
chainId: number;
|
|
7
16
|
smartContractAddress: Address;
|
|
8
17
|
contractAbi: ContractAbi;
|
|
9
18
|
contractTokenId: string | null;
|
|
10
|
-
|
|
11
|
-
recipientAddress: Address | null;
|
|
19
|
+
txParticipants: TxParticipants;
|
|
12
20
|
amount: number;
|
|
13
21
|
type: Web3TransactionType;
|
|
14
22
|
tokenType: NativeTokenType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-transaction-input-data.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/token-transaction-input-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"token-transaction-input-data.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/token-transaction-input-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,WAAW,cAAc;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,0BAA0B;IACvC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,eAAe,CAAC;IAG3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { ContractAbi } from 'web3';
|
|
2
2
|
import { Web3TransactionType } from '../enum/transaction-type.enum';
|
|
3
3
|
import { Address } from './address.value-object';
|
|
4
|
-
import { ITokenTransactionInputData } from '../interfaces/token-transaction-input-data.interface';
|
|
4
|
+
import { ITokenTransactionInputData, TxParticipants } from '../interfaces/token-transaction-input-data.interface';
|
|
5
5
|
import { NativeTokenType } from '../types/native-token.type';
|
|
6
6
|
export declare class TokenTransactionInputDataVo implements ITokenTransactionInputData {
|
|
7
7
|
transactionId: string | null;
|
|
8
8
|
readonly chainId: number;
|
|
9
9
|
readonly smartContractAddress: Address;
|
|
10
10
|
readonly contractAbi: ContractAbi;
|
|
11
|
+
readonly txParticipants: TxParticipants;
|
|
11
12
|
/**
|
|
12
13
|
* Represents the token ID for ERC1155 or other standards.
|
|
13
14
|
* For ERC721 minting operations, this field should contain the unique token URI.
|
|
14
15
|
*/
|
|
15
16
|
contractTokenId: string | null;
|
|
16
|
-
readonly senderAddress: Address;
|
|
17
|
-
readonly recipientAddress: Address | null;
|
|
18
17
|
readonly amount: number;
|
|
19
18
|
readonly type: Web3TransactionType;
|
|
20
19
|
readonly tokenType: NativeTokenType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-transaction-input.vo.d.ts","sourceRoot":"","sources":["../../../src/value-objects/token-transaction-input.vo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"token-transaction-input.vo.d.ts","sourceRoot":"","sources":["../../../src/value-objects/token-transaction-input.vo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,qBAAa,2BAA4B,YAAW,0BAA0B;IAG5E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,SAEgB,OAAO,EAAE,MAAM,CAAC;IAEhC,SAIgB,oBAAoB,EAAE,OAAO,CAAC;IAE9C,SACgB,WAAW,EAAE,WAAW,CAAC;IAGzC,SAGgB,cAAc,EAAE,cAAc,CAAC;IAC/C;;;OAGG;IAGI,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,SAEgB,MAAM,EAAE,MAAM,CAAC;IAE/B,SAEgB,IAAI,EAAE,mBAAmB,CAAC;IAC1C,SACgB,SAAS,EAAE,eAAe,CAAC;IAI3C,SAEgB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElC,SAEgB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1C,SAEgB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3C,SAEgB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElD,SAEgB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAE3C,IAAI,EAAE,0BAA0B;CA8B7C"}
|
|
@@ -19,13 +19,13 @@ class TokenTransactionInputDataVo {
|
|
|
19
19
|
chainId;
|
|
20
20
|
smartContractAddress;
|
|
21
21
|
contractAbi;
|
|
22
|
+
// @IsObject()
|
|
23
|
+
txParticipants;
|
|
22
24
|
/**
|
|
23
25
|
* Represents the token ID for ERC1155 or other standards.
|
|
24
26
|
* For ERC721 minting operations, this field should contain the unique token URI.
|
|
25
27
|
*/
|
|
26
28
|
contractTokenId;
|
|
27
|
-
senderAddress;
|
|
28
|
-
recipientAddress;
|
|
29
29
|
amount;
|
|
30
30
|
type; // Using the enum value for validation
|
|
31
31
|
tokenType; // Using the type for type declaration
|
|
@@ -42,8 +42,7 @@ class TokenTransactionInputDataVo {
|
|
|
42
42
|
this.smartContractAddress = data.smartContractAddress; // Assumes data.smartContractAddress is already an Address instance
|
|
43
43
|
this.contractAbi = data.contractAbi;
|
|
44
44
|
this.contractTokenId = data.contractTokenId;
|
|
45
|
-
this.
|
|
46
|
-
this.recipientAddress = data.recipientAddress; // Assumes data.recipientAddress is already an Address instance (or null)
|
|
45
|
+
this.txParticipants = data.txParticipants;
|
|
47
46
|
this.amount = data.amount;
|
|
48
47
|
this.type = data.type;
|
|
49
48
|
this.tokenType = data.tokenType;
|
|
@@ -57,10 +56,10 @@ class TokenTransactionInputDataVo {
|
|
|
57
56
|
if (this.amount <= 0 && this.type) {
|
|
58
57
|
throw new Error('Transaction amount must be positive for this transaction type.');
|
|
59
58
|
}
|
|
60
|
-
if (!this.senderAddress) {
|
|
59
|
+
if (!this.txParticipants.senderAddress) {
|
|
61
60
|
throw new Error('Sender address is required.');
|
|
62
61
|
}
|
|
63
|
-
if (this.type !== transaction_type_enum_1.Web3TransactionType.BURN && !this.recipientAddress) {
|
|
62
|
+
if (this.type !== transaction_type_enum_1.Web3TransactionType.BURN && !this.txParticipants.recipientAddress) {
|
|
64
63
|
throw new Error('Recipient address is required for this transaction type.');
|
|
65
64
|
}
|
|
66
65
|
}
|
|
@@ -90,24 +89,17 @@ __decorate([
|
|
|
90
89
|
__metadata("design:type", Object)
|
|
91
90
|
], TokenTransactionInputDataVo.prototype, "contractAbi", void 0);
|
|
92
91
|
__decorate([
|
|
93
|
-
(0, class_validator_1.IsString)(),
|
|
94
|
-
(0, class_validator_1.IsOptional)(),
|
|
95
|
-
__metadata("design:type", Object)
|
|
96
|
-
], TokenTransactionInputDataVo.prototype, "contractTokenId", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
(0, class_validator_1.IsObject)(),
|
|
99
92
|
(0, class_validator_1.IsNotEmpty)(),
|
|
100
|
-
(0, class_validator_1.ValidateNested)()
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
(0, class_validator_1.ValidateNested)()
|
|
94
|
+
// @Type(() => TxParticipants)
|
|
95
|
+
,
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], TokenTransactionInputDataVo.prototype, "txParticipants", void 0);
|
|
104
98
|
__decorate([
|
|
105
|
-
(0, class_validator_1.
|
|
99
|
+
(0, class_validator_1.IsString)(),
|
|
106
100
|
(0, class_validator_1.IsOptional)(),
|
|
107
|
-
(0, class_validator_1.ValidateNested)(),
|
|
108
|
-
(0, class_transformer_1.Type)(() => address_value_object_1.Address),
|
|
109
101
|
__metadata("design:type", Object)
|
|
110
|
-
], TokenTransactionInputDataVo.prototype, "
|
|
102
|
+
], TokenTransactionInputDataVo.prototype, "contractTokenId", void 0);
|
|
111
103
|
__decorate([
|
|
112
104
|
(0, class_validator_1.IsNumber)(),
|
|
113
105
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-transaction-input.vo.js","sourceRoot":"","sources":["../../../src/value-objects/token-transaction-input.vo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+G;AAC/G,yDAAyC;AAEzC,yEAAoE;AACpE,iEAAiD;
|
|
1
|
+
{"version":3,"file":"token-transaction-input.vo.js","sourceRoot":"","sources":["../../../src/value-objects/token-transaction-input.vo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+G;AAC/G,yDAAyC;AAEzC,yEAAoE;AACpE,iEAAiD;AAKjD,MAAa,2BAA2B;IAGtC,aAAa,CAAgB;IAIb,OAAO,CAAS;IAMhB,oBAAoB,CAAU;IAG9B,WAAW,CAAc;IAEzC,cAAc;IAIE,cAAc,CAAiB;IAC/C;;;OAGG;IAGI,eAAe,CAAgB;IAItB,MAAM,CAAS;IAIf,IAAI,CAAsB,CAAA,sCAAsC;IAEhE,SAAS,CAAkB,CAAC,sCAAsC;IAClF,8CAA8C;IAE9C,2DAA2D;IAG3C,QAAQ,CAAU;IAIlB,gBAAgB,CAAU;IAI1B,iBAAiB,CAAU;IAI3B,wBAAwB,CAAU;IAIlC,gBAAgB,CAAuB;IAEvD,YAAY,IAAgC;QAE1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC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
|
+
export declare class SessionAuthResponseDTO {
|
|
10
10
|
accessToken: string;
|
|
11
11
|
refreshToken: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class UserAuthResponseDTO extends AuthResponseDTO {
|
|
14
|
-
user: UserDTO;
|
|
15
|
-
}
|
|
16
|
-
export declare class AdminLoginResponseDTO extends AuthResponseDTO {
|
|
17
12
|
admin?: AdminDTO;
|
|
13
|
+
user?: UserDTO;
|
|
18
14
|
}
|
|
19
15
|
//# sourceMappingURL=auth.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,sBAAsB;IAQ/B,SAAS,EAAE,MAAM,CAAM;CAC1B;AAkBD,qBAAa,sBAAsB;IAK/B,YAAY,EAAE,MAAM,CAAM;CAC7B;AAED,qBAAa,
|
|
1
|
+
{"version":3,"file":"auth.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,sBAAsB;IAQ/B,SAAS,EAAE,MAAM,CAAM;CAC1B;AAkBD,qBAAa,sBAAsB;IAK/B,YAAY,EAAE,MAAM,CAAM;CAC7B;AAED,qBAAa,sBAAsB;IAM/B,WAAW,EAAE,MAAM,CAAM;IAMzB,YAAY,EAAE,MAAM,CAAM;IAM1B,KAAK,CAAC,EAAE,QAAQ,CAAC;IAMjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
package/dist/esm/dto/auth.dto.js
CHANGED
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { ApiProperty } from "@nestjs/swagger";
|
|
7
|
+
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
8
8
|
import { IsNotEmpty, IsString } from "class-validator";
|
|
9
9
|
import { UserDTO } from "./user.dto";
|
|
10
10
|
import { AdminDTO } from "./admin.dto";
|
|
@@ -44,36 +44,32 @@ __decorate([
|
|
|
44
44
|
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRJZCI6IjEiLCJpYXQiOjE2MjYxNzUwNzksImV4cCI6MTYyNjE3NTI3OX0.5w8A6t7b5lBx8D3FmLwJQgJ9z1D9c9Vz7A3f7BvzH2A'
|
|
45
45
|
})
|
|
46
46
|
], RefreshTokenRequestDTO.prototype, "refreshToken", void 0);
|
|
47
|
-
export class
|
|
47
|
+
export class SessionAuthResponseDTO {
|
|
48
48
|
accessToken = '';
|
|
49
49
|
refreshToken = '';
|
|
50
|
+
admin;
|
|
51
|
+
user;
|
|
50
52
|
}
|
|
51
53
|
__decorate([
|
|
52
54
|
ApiProperty({
|
|
53
55
|
description: 'JWT access token this token is used to authenticate the user, by default it expires in 15 minutes, and it should be sent in the Authorization header as Bearer token.',
|
|
54
56
|
})
|
|
55
|
-
],
|
|
57
|
+
], SessionAuthResponseDTO.prototype, "accessToken", void 0);
|
|
56
58
|
__decorate([
|
|
57
59
|
ApiProperty({
|
|
58
60
|
description: 'JWT refresh token this token is used to get a new access token when the current one expires. It is valid for 1 day.',
|
|
59
61
|
})
|
|
60
|
-
],
|
|
61
|
-
export class UserAuthResponseDTO extends AuthResponseDTO {
|
|
62
|
-
user;
|
|
63
|
-
}
|
|
62
|
+
], SessionAuthResponseDTO.prototype, "refreshToken", void 0);
|
|
64
63
|
__decorate([
|
|
65
|
-
|
|
66
|
-
description: '
|
|
67
|
-
type: () =>
|
|
64
|
+
ApiPropertyOptional({
|
|
65
|
+
description: 'Admin (present if admin authentication)',
|
|
66
|
+
type: () => AdminDTO
|
|
68
67
|
})
|
|
69
|
-
],
|
|
70
|
-
export class AdminLoginResponseDTO extends AuthResponseDTO {
|
|
71
|
-
admin;
|
|
72
|
-
}
|
|
68
|
+
], SessionAuthResponseDTO.prototype, "admin", void 0);
|
|
73
69
|
__decorate([
|
|
74
|
-
|
|
75
|
-
description: '
|
|
76
|
-
type: () =>
|
|
70
|
+
ApiPropertyOptional({
|
|
71
|
+
description: 'User (present if user authentication)',
|
|
72
|
+
type: () => UserDTO
|
|
77
73
|
})
|
|
78
|
-
],
|
|
74
|
+
], SessionAuthResponseDTO.prototype, "user", void 0);
|
|
79
75
|
//# sourceMappingURL=auth.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.dto.js","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.dto.js","sourceRoot":"","sources":["../../../src/dto/auth.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,sBAAsB;IAQ/B,SAAS,GAAW,EAAE,CAAC;CAC1B;AADG;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,qEAAqE;QAClF,OAAO,EAAE,yCAAyC;QAClD,IAAI,EAAE,MAAM;KACf,CAAC;IACD,UAAU,EAAE;IACZ,QAAQ,EAAE;yDACY;AAG3B;;;;;;;;;;;;;;IAcI;AAEJ,MAAM,OAAO,sBAAsB;IAK/B,YAAY,GAAW,EAAE,CAAC;CAC7B;AADG;IAJC,WAAW,CAAC;QACT,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,sJAAsJ;KAClK,CAAC;4DACwB;AAG9B,MAAM,OAAO,sBAAsB;IAM/B,WAAW,GAAW,EAAE,CAAC;IAMzB,YAAY,GAAW,EAAE,CAAC;IAM1B,KAAK,CAAY;IAMjB,IAAI,CAAW;CAClB;AAnBG;IALC,WAAW,CACR;QACI,WAAW,EAAE,uKAAuK;KACvL,CACJ;2DACwB;AAMzB;IAJC,WAAW,CACR;QACI,WAAW,EAAE,qHAAqH;KACrI,CAAC;4DACoB;AAM1B;IAJC,mBAAmB,CAAC;QACjB,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ;KACvB,CAAC;qDACe;AAMjB;IAJC,mBAAmB,CAAC;QACjB,WAAW,EAAE,uCAAuC;QACpD,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO;KACtB,CAAC;oDACa"}
|
|
@@ -2,7 +2,7 @@ import { PurchaseTokenDTO } from "./purchaseToken.dto";
|
|
|
2
2
|
import { UserDTO } from "../user.dto";
|
|
3
3
|
import { BusinessDTO } from "../business/business.dto";
|
|
4
4
|
import { DonationTypeDTO } from "./donationType.dto";
|
|
5
|
-
import { PurchaseStatus, PurchaseCurrency } from "enum/purchase";
|
|
5
|
+
import { PurchaseStatus, PurchaseCurrency } from "../../enum/purchase";
|
|
6
6
|
export declare class PurchaseDTO {
|
|
7
7
|
id: string;
|
|
8
8
|
stripePaymentIntentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase.dto.d.ts","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"purchase.dto.d.ts","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,qBAAa,WAAW;IAKpB,EAAE,EAAE,MAAM,CAAM;IAKhB,qBAAqB,EAAE,MAAM,CAAM;IAKnC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAQ;IAKrC,MAAM,EAAE,MAAM,CAAK;IAOnB,QAAQ,mBAAwB;IAKhC,QAAQ,EAAE,MAAM,CAAK;IAMrB,aAAa,CAAC,EAAE,gBAAgB,CAAC;IAKjC,IAAI,CAAC,EAAE,OAAO,CAAC;IAKf,QAAQ,CAAC,EAAE,WAAW,CAAA;IAKtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAKhC,YAAY,CAAC,EAAE,eAAe,CAAC;IAG/B,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,SAAS,CAAC,EAAE,IAAI,CAAA;CACnB"}
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
8
|
-
import { PurchaseCurrency } from "enum/purchase";
|
|
8
|
+
import { PurchaseCurrency } from "../../enum/purchase";
|
|
9
9
|
export class PurchaseDTO {
|
|
10
10
|
id = '';
|
|
11
11
|
stripePaymentIntentId = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purchase.dto.js","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAMnE,OAAO,EAAkB,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"purchase.dto.js","sourceRoot":"","sources":["../../../../src/dto/purchase/purchase.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAMnE,OAAO,EAAkB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,MAAM,OAAO,WAAW;IAKpB,EAAE,GAAW,EAAE,CAAC;IAKhB,qBAAqB,GAAW,EAAE,CAAC;IAKnC,MAAM,GAA0B,IAAI,CAAC;IAKrC,MAAM,GAAW,CAAC,CAAC;IAOnB,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC;IAKhC,QAAQ,GAAW,CAAC,CAAC;IAMrB,aAAa,CAAoB;IAKjC,IAAI,CAAW;IAKf,QAAQ,CAAc;IAKtB,sBAAsB,CAAU;IAKhC,YAAY,CAAmB;IAG/B,SAAS,CAAO;IAGhB,SAAS,CAAO;CACnB;AA5DG;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,aAAa,EAAE,CACjC;uCACe;AAKhB;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAC9C;0DACkC;AAKnC;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,iBAAiB,EAAE,CACrC;2CACoC;AAKrC;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAC5C;2CACkB;AAOnB;IALC,WAAW,CACR,EAAE,WAAW,EAAE,UAAU;QACzB,IAAI,EAAE,gBAAgB;KACzB,CACA;6CAC+B;AAKhC;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,gCAAgC,EAAE,CACpD;6CACoB;AAMrB;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,gBAAgB,EAAE,CACpC;kDACgC;AAKjC;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,MAAM,EAAE,CAC1B;yCACc;AAKf;IAHC,WAAW,CACR,EAAE,WAAW,EAAE,UAAU,EAAE,CAC9B;6CACqB;AAKtB;IAHC,mBAAmB,CAChB,EAAE,WAAW,EAAE,0BAA0B,EAAC,CAC7C;2DAC+B;AAKhC;IAHC,mBAAmB,CAChB,EAAE,WAAW,EAAE,eAAe,EAAE,CACnC;iDAC8B;AAG/B;IADC,mBAAmB,CAAC,EAAC,WAAW,EAAE,aAAa,EAAC,CAAC;8CAClC;AAGhB;IADC,mBAAmB,CAAC,EAAC,WAAW,EAAE,aAAa,EAAC,CAAC;8CAClC"}
|
package/dist/esm/enum/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
package/dist/esm/enum/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { ContractAbi } from "web3";
|
|
2
2
|
import { Web3TransactionType } from "../enum/transaction-type.enum";
|
|
3
3
|
import { Address, NativeTokenType } from "..";
|
|
4
|
+
import { AccountOwnerType } from "../enum/owner-type.enum";
|
|
5
|
+
export interface TxParticipants {
|
|
6
|
+
senderAddress: Address;
|
|
7
|
+
senderOwnerType: AccountOwnerType | null;
|
|
8
|
+
senderId: string | null;
|
|
9
|
+
recipientAddress: Address | null;
|
|
10
|
+
recipientOwnerType: AccountOwnerType | null;
|
|
11
|
+
recipientId: string | null;
|
|
12
|
+
}
|
|
4
13
|
export interface ITokenTransactionInputData {
|
|
5
14
|
transactionId: string | null;
|
|
6
15
|
chainId: number;
|
|
7
16
|
smartContractAddress: Address;
|
|
8
17
|
contractAbi: ContractAbi;
|
|
9
18
|
contractTokenId: string | null;
|
|
10
|
-
|
|
11
|
-
recipientAddress: Address | null;
|
|
19
|
+
txParticipants: TxParticipants;
|
|
12
20
|
amount: number;
|
|
13
21
|
type: Web3TransactionType;
|
|
14
22
|
tokenType: NativeTokenType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-transaction-input-data.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/token-transaction-input-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"token-transaction-input-data.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/token-transaction-input-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,WAAW,cAAc;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,0BAA0B;IACvC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,eAAe,CAAC;IAG3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type { ContractAbi } from 'web3';
|
|
2
2
|
import { Web3TransactionType } from '../enum/transaction-type.enum';
|
|
3
3
|
import { Address } from './address.value-object';
|
|
4
|
-
import { ITokenTransactionInputData } from '../interfaces/token-transaction-input-data.interface';
|
|
4
|
+
import { ITokenTransactionInputData, TxParticipants } from '../interfaces/token-transaction-input-data.interface';
|
|
5
5
|
import { NativeTokenType } from '../types/native-token.type';
|
|
6
6
|
export declare class TokenTransactionInputDataVo implements ITokenTransactionInputData {
|
|
7
7
|
transactionId: string | null;
|
|
8
8
|
readonly chainId: number;
|
|
9
9
|
readonly smartContractAddress: Address;
|
|
10
10
|
readonly contractAbi: ContractAbi;
|
|
11
|
+
readonly txParticipants: TxParticipants;
|
|
11
12
|
/**
|
|
12
13
|
* Represents the token ID for ERC1155 or other standards.
|
|
13
14
|
* For ERC721 minting operations, this field should contain the unique token URI.
|
|
14
15
|
*/
|
|
15
16
|
contractTokenId: string | null;
|
|
16
|
-
readonly senderAddress: Address;
|
|
17
|
-
readonly recipientAddress: Address | null;
|
|
18
17
|
readonly amount: number;
|
|
19
18
|
readonly type: Web3TransactionType;
|
|
20
19
|
readonly tokenType: NativeTokenType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-transaction-input.vo.d.ts","sourceRoot":"","sources":["../../../src/value-objects/token-transaction-input.vo.ts"],"names":[],"mappings":"AA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EAAE,GAAG,CAAC,CAAC;gBAE3C,IAAI,EAAE,0BAA0B;CA8B7C"}
|
|
@@ -13,13 +13,13 @@ export class TokenTransactionInputDataVo {
|
|
|
13
13
|
chainId;
|
|
14
14
|
smartContractAddress;
|
|
15
15
|
contractAbi;
|
|
16
|
+
// @IsObject()
|
|
17
|
+
txParticipants;
|
|
16
18
|
/**
|
|
17
19
|
* Represents the token ID for ERC1155 or other standards.
|
|
18
20
|
* For ERC721 minting operations, this field should contain the unique token URI.
|
|
19
21
|
*/
|
|
20
22
|
contractTokenId;
|
|
21
|
-
senderAddress;
|
|
22
|
-
recipientAddress;
|
|
23
23
|
amount;
|
|
24
24
|
type; // Using the enum value for validation
|
|
25
25
|
tokenType; // Using the type for type declaration
|
|
@@ -36,8 +36,7 @@ export class TokenTransactionInputDataVo {
|
|
|
36
36
|
this.smartContractAddress = data.smartContractAddress; // Assumes data.smartContractAddress is already an Address instance
|
|
37
37
|
this.contractAbi = data.contractAbi;
|
|
38
38
|
this.contractTokenId = data.contractTokenId;
|
|
39
|
-
this.
|
|
40
|
-
this.recipientAddress = data.recipientAddress; // Assumes data.recipientAddress is already an Address instance (or null)
|
|
39
|
+
this.txParticipants = data.txParticipants;
|
|
41
40
|
this.amount = data.amount;
|
|
42
41
|
this.type = data.type;
|
|
43
42
|
this.tokenType = data.tokenType;
|
|
@@ -51,10 +50,10 @@ export class TokenTransactionInputDataVo {
|
|
|
51
50
|
if (this.amount <= 0 && this.type) {
|
|
52
51
|
throw new Error('Transaction amount must be positive for this transaction type.');
|
|
53
52
|
}
|
|
54
|
-
if (!this.senderAddress) {
|
|
53
|
+
if (!this.txParticipants.senderAddress) {
|
|
55
54
|
throw new Error('Sender address is required.');
|
|
56
55
|
}
|
|
57
|
-
if (this.type !== Web3TransactionType.BURN && !this.recipientAddress) {
|
|
56
|
+
if (this.type !== Web3TransactionType.BURN && !this.txParticipants.recipientAddress) {
|
|
58
57
|
throw new Error('Recipient address is required for this transaction type.');
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -76,22 +75,15 @@ __decorate([
|
|
|
76
75
|
__decorate([
|
|
77
76
|
IsNotEmpty() // ContractAbi is complex; basic presence check.
|
|
78
77
|
], TokenTransactionInputDataVo.prototype, "contractAbi", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
IsNotEmpty(),
|
|
80
|
+
ValidateNested()
|
|
81
|
+
// @Type(() => TxParticipants)
|
|
82
|
+
], TokenTransactionInputDataVo.prototype, "txParticipants", void 0);
|
|
79
83
|
__decorate([
|
|
80
84
|
IsString(),
|
|
81
85
|
IsOptional()
|
|
82
86
|
], TokenTransactionInputDataVo.prototype, "contractTokenId", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
IsObject(),
|
|
85
|
-
IsNotEmpty(),
|
|
86
|
-
ValidateNested(),
|
|
87
|
-
Type(() => Address)
|
|
88
|
-
], TokenTransactionInputDataVo.prototype, "senderAddress", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
IsObject(),
|
|
91
|
-
IsOptional(),
|
|
92
|
-
ValidateNested(),
|
|
93
|
-
Type(() => Address)
|
|
94
|
-
], TokenTransactionInputDataVo.prototype, "recipientAddress", void 0);
|
|
95
87
|
__decorate([
|
|
96
88
|
IsNumber(),
|
|
97
89
|
IsNotEmpty()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-transaction-input.vo.js","sourceRoot":"","sources":["../../../src/value-objects/token-transaction-input.vo.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3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