@maximus_code/grpc-generator 0.0.1-dev.8 → 0.0.1-dev.9
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/cjs/src/main.js +0 -1
- package/dist/cjs/src/main.js.map +1 -1
- package/dist/cjs/src/template/_decorator.hbs +1 -0
- package/dist/cjs/src/template/_import.hbs +1 -0
- package/dist/cjs/src/template/_property.hbs +1 -0
- package/dist/cjs/src/template/dto/class.hbs +11 -0
- package/dist/cjs/src/template/enum.hbs +5 -0
- package/dist/cjs/src/template/index.hbs +5 -0
- package/dist/cjs/src/template/proto/class.hbs +15 -0
- package/dist/cjs/src/template/proto/enum.hbs +9 -0
- package/dist/cjs/src/template/proto/index.hbs +3 -0
- package/dist/cjs/src/template/swagger/class.hbs +17 -0
- package/dist/cjs/src/template/typeorm/class.hbs +17 -0
- package/dist/cjs/src/utils/loadConfig.js +2 -5
- package/dist/cjs/src/utils/loadConfig.js.map +1 -1
- package/dist/cjs/tsconfig.build-cjs.tsbuildinfo +1 -1
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/output/dto/ExampleEnum.js +10 -0
- package/dist/esm/output/dto/ExampleEnum.js.map +1 -0
- package/dist/esm/output/dto/Paddle.js +7 -0
- package/dist/esm/output/dto/Paddle.js.map +1 -0
- package/dist/esm/output/dto/PaddleClient.js +7 -0
- package/dist/esm/output/dto/PaddleClient.js.map +1 -0
- package/dist/esm/output/dto/PaddleClientData.js +7 -0
- package/dist/esm/output/dto/PaddleClientData.js.map +1 -0
- package/dist/esm/output/dto/PlanStatusEnum.js +11 -0
- package/dist/esm/output/dto/PlanStatusEnum.js.map +1 -0
- package/dist/esm/output/dto/Subscription.js +7 -0
- package/dist/esm/output/dto/Subscription.js.map +1 -0
- package/dist/esm/output/dto/SystemEnum.js +8 -0
- package/dist/esm/output/dto/SystemEnum.js.map +1 -0
- package/dist/esm/output/dto/index.js +24 -0
- package/dist/esm/output/dto/index.js.map +1 -0
- package/dist/esm/output/swagger/ExampleEnum.js +10 -0
- package/dist/esm/output/swagger/ExampleEnum.js.map +1 -0
- package/dist/esm/output/swagger/Paddle.js +23 -0
- package/dist/esm/output/swagger/Paddle.js.map +1 -0
- package/dist/esm/output/swagger/PaddleClient.js +7 -0
- package/dist/esm/output/swagger/PaddleClient.js.map +1 -0
- package/dist/esm/output/swagger/PaddleClientData.js +7 -0
- package/dist/esm/output/swagger/PaddleClientData.js.map +1 -0
- package/dist/esm/output/swagger/PlanStatusEnum.js +11 -0
- package/dist/esm/output/swagger/PlanStatusEnum.js.map +1 -0
- package/dist/esm/output/swagger/Subscription.js +7 -0
- package/dist/esm/output/swagger/Subscription.js.map +1 -0
- package/dist/esm/output/swagger/SystemEnum.js +8 -0
- package/dist/esm/output/swagger/SystemEnum.js.map +1 -0
- package/dist/esm/output/swagger/index.js +24 -0
- package/dist/esm/output/swagger/index.js.map +1 -0
- package/dist/esm/output/typeorm/ExampleEnum.js +10 -0
- package/dist/esm/output/typeorm/ExampleEnum.js.map +1 -0
- package/dist/esm/output/typeorm/Paddle.js +50 -0
- package/dist/esm/output/typeorm/Paddle.js.map +1 -0
- package/dist/esm/output/typeorm/PaddleClient.js +30 -0
- package/dist/esm/output/typeorm/PaddleClient.js.map +1 -0
- package/dist/esm/output/typeorm/PaddleClientData.js +45 -0
- package/dist/esm/output/typeorm/PaddleClientData.js.map +1 -0
- package/dist/esm/output/typeorm/PlanStatusEnum.js +11 -0
- package/dist/esm/output/typeorm/PlanStatusEnum.js.map +1 -0
- package/dist/esm/output/typeorm/Subscription.js +43 -0
- package/dist/esm/output/typeorm/Subscription.js.map +1 -0
- package/dist/esm/output/typeorm/SystemEnum.js +8 -0
- package/dist/esm/output/typeorm/SystemEnum.js.map +1 -0
- package/dist/esm/output/typeorm/index.js +24 -0
- package/dist/esm/output/typeorm/index.js.map +1 -0
- package/dist/esm/src/IGeneratorConfig.js +3 -0
- package/dist/esm/src/IGeneratorConfig.js.map +1 -0
- package/dist/esm/src/cli.js +15 -0
- package/dist/esm/src/cli.js.map +1 -0
- package/dist/esm/src/index.js +24 -0
- package/dist/esm/src/index.js.map +1 -0
- package/dist/esm/src/main.js +94 -0
- package/dist/esm/src/main.js.map +1 -0
- package/dist/esm/src/project.js +9 -0
- package/dist/esm/src/project.js.map +1 -0
- package/dist/esm/src/reader/index.js +20 -0
- package/dist/esm/src/reader/index.js.map +1 -0
- package/dist/esm/src/reader/readSchema.js +16 -0
- package/dist/esm/src/reader/readSchema.js.map +1 -0
- package/dist/esm/src/template/_decorator.hbs +1 -0
- package/dist/esm/src/template/_import.hbs +1 -0
- package/dist/esm/src/template/_property.hbs +1 -0
- package/dist/esm/src/template/dto/class.hbs +11 -0
- package/dist/esm/src/template/enum.hbs +5 -0
- package/dist/esm/src/template/index.hbs +5 -0
- package/dist/esm/src/template/proto/class.hbs +15 -0
- package/dist/esm/src/template/proto/enum.hbs +9 -0
- package/dist/esm/src/template/proto/index.hbs +3 -0
- package/dist/esm/src/template/swagger/class.hbs +17 -0
- package/dist/esm/src/template/typeorm/class.hbs +17 -0
- package/dist/esm/src/utils/loadConfig.js +50 -0
- package/dist/esm/src/utils/loadConfig.js.map +1 -0
- package/dist/esm/test/model/ExampleEnum.js +10 -0
- package/dist/esm/test/model/ExampleEnum.js.map +1 -0
- package/dist/esm/test/model/entity/PaddleClient.js +33 -0
- package/dist/esm/test/model/entity/PaddleClient.js.map +1 -0
- package/dist/esm/test/model/entity/Subscription.js +46 -0
- package/dist/esm/test/model/entity/Subscription.js.map +1 -0
- package/dist/esm/test/model/entity/index.js +19 -0
- package/dist/esm/test/model/entity/index.js.map +1 -0
- package/dist/esm/test/model/types/Paddle.js +54 -0
- package/dist/esm/test/model/types/Paddle.js.map +1 -0
- package/dist/esm/test/model/types/PaddleClientData.js +45 -0
- package/dist/esm/test/model/types/PaddleClientData.js.map +1 -0
- package/dist/esm/test/model/types/PlanStatusEnum.js +11 -0
- package/dist/esm/test/model/types/PlanStatusEnum.js.map +1 -0
- package/dist/esm/test/model/types/SystemEnum.js +8 -0
- package/dist/esm/test/model/types/SystemEnum.js.map +1 -0
- package/dist/esm/test/model/types/index.js +20 -0
- package/dist/esm/test/model/types/index.js.map +1 -0
- package/dist/esm/tsconfig.build-esm.tsbuildinfo +1 -0
- package/dist/types/tsconfig.build-types.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaddleClientData.js","sourceRoot":"","sources":["../../../../output/typeorm/PaddleClientData.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiC;AAEjC,MAAa,gBAAgB;CAqB5B;AArBD,4CAqBC;AAnBG;IADC,IAAA,gBAAM,GAAE;;4CACE;AAGX;IADC,IAAA,gBAAM,GAAE;;+CACK;AAGd;IADC,IAAA,gBAAM,GAAE;;8CACI;AAGb;IADC,IAAA,gBAAM,GAAE;;qDACW;AAGpB;IADC,IAAA,gBAAM,GAAE;;mDACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;mDACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;mDACS"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlanStatusEnum = void 0;
|
|
4
|
+
var PlanStatusEnum;
|
|
5
|
+
(function (PlanStatusEnum) {
|
|
6
|
+
PlanStatusEnum["NONE"] = "NONE";
|
|
7
|
+
PlanStatusEnum["ACTIVE"] = "ACTIVE";
|
|
8
|
+
PlanStatusEnum["CANCELED"] = "CANCELED";
|
|
9
|
+
PlanStatusEnum["EXPIRED"] = "EXPIRED";
|
|
10
|
+
})(PlanStatusEnum || (exports.PlanStatusEnum = PlanStatusEnum = {}));
|
|
11
|
+
//# sourceMappingURL=PlanStatusEnum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanStatusEnum.js","sourceRoot":"","sources":["../../../../output/typeorm/PlanStatusEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,qCAAmB,CAAA;AACrB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Subscription = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _1 = require(".");
|
|
15
|
+
class Subscription {
|
|
16
|
+
}
|
|
17
|
+
exports.Subscription = Subscription;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.ObjectIdColumn)(),
|
|
20
|
+
__metadata("design:type", typeorm_1.ObjectId)
|
|
21
|
+
], Subscription.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'varchar', unique: true }),
|
|
24
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Subscription.prototype, "userId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({
|
|
29
|
+
type: 'enum',
|
|
30
|
+
enum: _1.PlanStatusEnum,
|
|
31
|
+
default: _1.PlanStatusEnum.NONE,
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Subscription.prototype, "status", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
37
|
+
__metadata("design:type", Date)
|
|
38
|
+
], Subscription.prototype, "endDate", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
41
|
+
__metadata("design:type", _1.Paddle)
|
|
42
|
+
], Subscription.prototype, "data", void 0);
|
|
43
|
+
//# sourceMappingURL=Subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../output/typeorm/Subscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkE;AAClE,wBAA2C;AAE3C,MAAa,YAAY;CAoBxB;AApBD,oCAoBC;AAlBG;IADC,IAAA,wBAAc,GAAE;8BACb,kBAAQ;wCAAC;AAIb;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;4CACT;AAOf;IALC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,iBAAc;QACpB,OAAO,EAAE,iBAAc,CAAC,IAAI;KAC/B,CAAC;;4CACqB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAClB,IAAI;6CAAC;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACrB,SAAM;0CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SystemEnum = void 0;
|
|
4
|
+
var SystemEnum;
|
|
5
|
+
(function (SystemEnum) {
|
|
6
|
+
SystemEnum["PADDLE"] = "PADDLE";
|
|
7
|
+
})(SystemEnum || (exports.SystemEnum = SystemEnum = {}));
|
|
8
|
+
//# sourceMappingURL=SystemEnum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemEnum.js","sourceRoot":"","sources":["../../../../output/typeorm/SystemEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,+BAAiB,CAAA;AACnB,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PaddleClient"), exports);
|
|
18
|
+
__exportStar(require("./Subscription"), exports);
|
|
19
|
+
__exportStar(require("./Paddle"), exports);
|
|
20
|
+
__exportStar(require("./PaddleClientData"), exports);
|
|
21
|
+
__exportStar(require("./ExampleEnum"), exports);
|
|
22
|
+
__exportStar(require("./PlanStatusEnum"), exports);
|
|
23
|
+
__exportStar(require("./SystemEnum"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../output/typeorm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,qDAAmC;AACnC,gDAA8B;AAC9B,mDAAiC;AACjC,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IGeneratorConfig.js","sourceRoot":"","sources":["../../../src/IGeneratorConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const main_1 = require("./main");
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
if (args.length === 0) {
|
|
7
|
+
console.error('Usage: grpc-generator <config.yml>');
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
const configPath = args[0];
|
|
11
|
+
(0, main_1.main)(configPath).catch((err) => {
|
|
12
|
+
console.error('[grpc-generator] Error:', err);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/cli.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAE9B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACpB,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAE3B,IAAA,WAAI,EAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC3B,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./utils"), exports);
|
|
19
|
+
__exportStar(require("./lib"), exports);
|
|
20
|
+
__exportStar(require("./reader"), exports);
|
|
21
|
+
__exportStar(require("./project"), exports);
|
|
22
|
+
__exportStar(require("./main"), exports);
|
|
23
|
+
__exportStar(require("./IGeneratorConfig"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB;AACxB,wCAAsB;AACtB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,qDAAmC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.main = void 0;
|
|
37
|
+
const reader_1 = require("./reader");
|
|
38
|
+
const utils_1 = require("./utils");
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const fs_1 = require("fs");
|
|
41
|
+
const lib_1 = require("./lib");
|
|
42
|
+
const types_1 = require("./types");
|
|
43
|
+
const loadConfig_1 = require("./utils/loadConfig");
|
|
44
|
+
const render = (templatePath, data) => (0, utils_1.renderTemplate)(path.join(__dirname, 'template', templatePath), data);
|
|
45
|
+
const main = async (configPath) => {
|
|
46
|
+
const config = (0, loadConfig_1.loadConfig)(configPath);
|
|
47
|
+
const schema = (0, reader_1.readSchema)(config);
|
|
48
|
+
await generate(schema, types_1.GenerateTypeEnum.DTO);
|
|
49
|
+
await generate(schema, types_1.GenerateTypeEnum.SWAGGER);
|
|
50
|
+
await generate(schema, types_1.GenerateTypeEnum.TYPEORM);
|
|
51
|
+
await protoGenerate(schema);
|
|
52
|
+
};
|
|
53
|
+
exports.main = main;
|
|
54
|
+
const generate = async (schema, type) => {
|
|
55
|
+
const index = [];
|
|
56
|
+
const dir = `./output/${type}`;
|
|
57
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
58
|
+
for (const model of schema.classes) {
|
|
59
|
+
index.push(model.name);
|
|
60
|
+
const content = render(`${type}/class.hbs`, {
|
|
61
|
+
...model,
|
|
62
|
+
...(await (0, lib_1.cleanImports)(model, type)),
|
|
63
|
+
});
|
|
64
|
+
(0, fs_1.writeFileSync)(`${dir}/${model.name}.ts`, content);
|
|
65
|
+
}
|
|
66
|
+
for (const e of schema.enums) {
|
|
67
|
+
index.push(e.name);
|
|
68
|
+
const content = render('enum.hbs', e);
|
|
69
|
+
(0, fs_1.writeFileSync)(`${dir}/${e.name}.ts`, content);
|
|
70
|
+
}
|
|
71
|
+
(0, fs_1.writeFileSync)(`${dir}/index.ts`, render('index.hbs', { classes: index }));
|
|
72
|
+
};
|
|
73
|
+
const protoGenerate = async (schema) => {
|
|
74
|
+
const dir = `./output/proto`;
|
|
75
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true });
|
|
76
|
+
for (const model of schema.classes) {
|
|
77
|
+
const content = render(`proto/class.hbs`, {
|
|
78
|
+
name: 'defaultService',
|
|
79
|
+
message: {
|
|
80
|
+
...model,
|
|
81
|
+
...(await (0, lib_1.cleanImports)(model, types_1.GenerateTypeEnum.PROTO)),
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
(0, fs_1.writeFileSync)(`${dir}/${model.name}.proto`, content);
|
|
85
|
+
}
|
|
86
|
+
for (const e of schema.enums) {
|
|
87
|
+
const content = render('proto/enum.hbs', {
|
|
88
|
+
name: 'defaultService',
|
|
89
|
+
enum: e,
|
|
90
|
+
});
|
|
91
|
+
(0, fs_1.writeFileSync)(`${dir}/${e.name}.proto`, content);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/main.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createProject = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const createProject = () => new ts_morph_1.Project({
|
|
6
|
+
skipAddingFilesFromTsConfig: true,
|
|
7
|
+
});
|
|
8
|
+
exports.createProject = createProject;
|
|
9
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/project.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAE5B,MAAM,aAAa,GAAG,GAAG,EAAE,CAC9B,IAAI,kBAAO,CAAC;IAER,2BAA2B,EAAE,IAAI;CACpC,CAAC,CAAC;AAJM,QAAA,aAAa,iBAInB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./readClass"), exports);
|
|
18
|
+
__exportStar(require("./readEnum"), exports);
|
|
19
|
+
__exportStar(require("./readSchema"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/reader/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,6CAA2B;AAC3B,+CAA6B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readSchema = void 0;
|
|
4
|
+
const project_1 = require("../project");
|
|
5
|
+
const readEnum_1 = require("./readEnum");
|
|
6
|
+
const readClass_1 = require("./readClass");
|
|
7
|
+
const readSchema = (config) => {
|
|
8
|
+
const project = (0, project_1.createProject)();
|
|
9
|
+
project.addSourceFilesAtPaths(config.source);
|
|
10
|
+
return {
|
|
11
|
+
enums: (0, readEnum_1.readEnums)(project),
|
|
12
|
+
classes: (0, readClass_1.readClass)(project),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.readSchema = readSchema;
|
|
16
|
+
//# sourceMappingURL=readSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readSchema.js","sourceRoot":"","sources":["../../../../src/reader/readSchema.ts"],"names":[],"mappings":";;;AAAA,wCAA2C;AAC3C,yCAAuC;AACvC,2CAAwC;AAKjC,MAAM,UAAU,GAAG,CAAC,MAAwB,EAAW,EAAE;IAC5D,MAAM,OAAO,GAAY,IAAA,uBAAa,GAAE,CAAC;IACzC,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAE7C,OAAO;QACH,KAAK,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC;QACzB,OAAO,EAAE,IAAA,qBAAS,EAAC,OAAO,CAAC;KAC9B,CAAC;AACN,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@{{this.name}}({{#each this.arguments}}{{{this}}}{{#unless @last}}, {{/unless}}{{/each}})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { {{#each names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}} } from '{{from}}';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{name}}{{#if options.optional}}?{{/if}}: {{{type}}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package {{#if name}}{{name}}{{else}}defaultService{{/if}};
|
|
4
|
+
{{#each message.imports}}
|
|
5
|
+
|
|
6
|
+
{{#each names}}
|
|
7
|
+
include './{{this}}'
|
|
8
|
+
{{/each}}
|
|
9
|
+
{{/each}}
|
|
10
|
+
|
|
11
|
+
message {{message.name}} {
|
|
12
|
+
{{#each message.properties}}
|
|
13
|
+
{{protoType this.type}} {{this.name}} = {{add @index 1}};
|
|
14
|
+
{{/each}}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{#each imports}}
|
|
2
|
+
{{template "_import" items=this path=@key}}
|
|
3
|
+
{{else}}
|
|
4
|
+
{{!-- This renders only if 'imports' is empty or null --}}
|
|
5
|
+
{{/each}}
|
|
6
|
+
|
|
7
|
+
export class {{name}} {
|
|
8
|
+
{{#each properties}}
|
|
9
|
+
{{#each decorators}}
|
|
10
|
+
{{template "_decorator" this}}
|
|
11
|
+
{{/each}}
|
|
12
|
+
{{template "_property" this}}
|
|
13
|
+
{{#unless @last}}
|
|
14
|
+
|
|
15
|
+
{{/unless}}
|
|
16
|
+
{{/each}}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{#each imports}}
|
|
2
|
+
{{template "_import" items=this path=@key}}
|
|
3
|
+
{{else}}
|
|
4
|
+
{{!-- This renders only if 'imports' is empty or null --}}
|
|
5
|
+
{{/each}}
|
|
6
|
+
|
|
7
|
+
export class {{name}} {
|
|
8
|
+
{{#each properties}}
|
|
9
|
+
{{#each decorators}}
|
|
10
|
+
{{template "_decorator" this}}
|
|
11
|
+
{{/each}}
|
|
12
|
+
{{template "_property" this}}
|
|
13
|
+
{{#unless @last}}
|
|
14
|
+
|
|
15
|
+
{{/unless}}
|
|
16
|
+
{{/each}}
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loadConfig = void 0;
|
|
37
|
+
const path = __importStar(require("node:path"));
|
|
38
|
+
const fs = __importStar(require("node:fs"));
|
|
39
|
+
const yaml_1 = require("yaml");
|
|
40
|
+
const loadConfig = (configPath) => {
|
|
41
|
+
const abs = path.isAbsolute(configPath)
|
|
42
|
+
? configPath
|
|
43
|
+
: path.join(process.cwd(), configPath);
|
|
44
|
+
if (!fs.existsSync(abs)) {
|
|
45
|
+
throw new Error(`Config file not found at path: ${abs}`);
|
|
46
|
+
}
|
|
47
|
+
return (0, yaml_1.parse)(fs.readFileSync(abs, 'utf8'));
|
|
48
|
+
};
|
|
49
|
+
exports.loadConfig = loadConfig;
|
|
50
|
+
//# sourceMappingURL=loadConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../../../src/utils/loadConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAkC;AAClC,4CAA8B;AAC9B,+BAA6B;AAEtB,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAoB,EAAE;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QACnC,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;IAE3C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,IAAA,YAAK,EAAC,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExampleEnum = void 0;
|
|
4
|
+
var ExampleEnum;
|
|
5
|
+
(function (ExampleEnum) {
|
|
6
|
+
ExampleEnum["OPTION_A"] = "OptionA";
|
|
7
|
+
ExampleEnum["OPTION_B"] = "OptionB";
|
|
8
|
+
ExampleEnum["OPTION_C"] = "OptionC";
|
|
9
|
+
})(ExampleEnum || (exports.ExampleEnum = ExampleEnum = {}));
|
|
10
|
+
//# sourceMappingURL=ExampleEnum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleEnum.js","sourceRoot":"","sources":["../../../../test/model/ExampleEnum.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,mCAAoB,CAAA;IACpB,mCAAoB,CAAA;IACpB,mCAAoB,CAAA;AACxB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PaddleClient = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
let PaddleClient = class PaddleClient {
|
|
16
|
+
};
|
|
17
|
+
exports.PaddleClient = PaddleClient;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.ObjectIdColumn)(),
|
|
20
|
+
__metadata("design:type", typeorm_1.ObjectId)
|
|
21
|
+
], PaddleClient.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)(),
|
|
24
|
+
__metadata("design:type", types_1.PaddleClientData)
|
|
25
|
+
], PaddleClient.prototype, "data", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'string' }),
|
|
28
|
+
__metadata("design:type", typeorm_1.ObjectId)
|
|
29
|
+
], PaddleClient.prototype, "userId", void 0);
|
|
30
|
+
exports.PaddleClient = PaddleClient = __decorate([
|
|
31
|
+
(0, typeorm_1.Entity)()
|
|
32
|
+
], PaddleClient);
|
|
33
|
+
//# sourceMappingURL=PaddleClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaddleClient.js","sourceRoot":"","sources":["../../../../../test/model/entity/PaddleClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmE;AACnE,oCAA4C;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAY;CASxB,CAAA;AATY,oCAAY;AAErB;IADC,IAAA,wBAAc,GAAE;8BACb,kBAAQ;wCAAC;AAGb;IADC,IAAA,gBAAM,GAAE;8BACH,wBAAgB;0CAAC;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;8BACnB,kBAAQ;4CAAC;uBARR,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CASxB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Subscription = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
let Subscription = class Subscription {
|
|
16
|
+
};
|
|
17
|
+
exports.Subscription = Subscription;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.ObjectIdColumn)(),
|
|
20
|
+
__metadata("design:type", typeorm_1.ObjectId)
|
|
21
|
+
], Subscription.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'varchar', unique: true }),
|
|
24
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Subscription.prototype, "userId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({
|
|
29
|
+
type: 'enum',
|
|
30
|
+
enum: types_1.PlanStatusEnum,
|
|
31
|
+
default: types_1.PlanStatusEnum.NONE,
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Subscription.prototype, "status", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
37
|
+
__metadata("design:type", Date)
|
|
38
|
+
], Subscription.prototype, "endDate", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
41
|
+
__metadata("design:type", types_1.Paddle)
|
|
42
|
+
], Subscription.prototype, "data", void 0);
|
|
43
|
+
exports.Subscription = Subscription = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)()
|
|
45
|
+
], Subscription);
|
|
46
|
+
//# sourceMappingURL=Subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../../test/model/entity/Subscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0E;AAC1E,oCAAkD;AAG3C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAoBxB,CAAA;AApBY,oCAAY;AAErB;IADC,IAAA,wBAAc,GAAE;8BACb,kBAAQ;wCAAC;AAIb;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;4CACT;AAOf;IALC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAc;QACpB,OAAO,EAAE,sBAAc,CAAC,IAAI;KAC/B,CAAC;;4CACqB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAClB,IAAI;6CAAQ;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACrB,cAAM;0CAAC;uBAnBJ,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAoBxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Subscription"), exports);
|
|
18
|
+
__exportStar(require("./PaddleClient"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../test/model/entity/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,iDAA+B"}
|