@tsed/cli-plugin-passport 5.3.1 → 6.0.0-alpha.2

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.
@@ -3,7 +3,6 @@ import { Module, OnAdd, ProjectPackageJson } from "@tsed/cli-core";
3
3
  import { Inject } from "@tsed/di";
4
4
  import { PassportGenerateHook } from "./hooks/PassportGenerateHook.js";
5
5
  let CliPluginPassportModule = class CliPluginPassportModule {
6
- packageJson;
7
6
  install() {
8
7
  this.packageJson.addDependencies({
9
8
  "@tsed/passport": this.packageJson.dependencies["@tsed/common"],
@@ -1 +1 @@
1
- {"version":3,"file":"CliPluginPassportModule.js","sourceRoot":"","sources":["../../src/CliPluginPassportModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AAK3D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAElC,WAAW,CAAqB;IAGhC,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC;YAC/B,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC;YAC/D,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAClC,iBAAiB,EAAE,QAAQ;SAC5B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAdC;IAAC,MAAM,EAAE;8BACI,kBAAkB;4DAAC;AAEhC;IAAC,KAAK,CAAC,2BAA2B,CAAC;;;;sDAUlC;AAdU,uBAAuB;IAHnC,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;KAChC,CAAC;GACW,uBAAuB,CAenC;SAfY,uBAAuB"}
1
+ {"version":3,"file":"CliPluginPassportModule.js","sourceRoot":"","sources":["../../src/CliPluginPassportModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AAK9D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAKlC,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC;YAC/B,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC;YAC/D,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAClC,iBAAiB,EAAE,QAAQ;SAC5B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAdC;IAAC,MAAM,EAAE;8BACI,kBAAkB;4DAAC;AAEhC;IAAC,KAAK,CAAC,2BAA2B,CAAC;;;;sDAUlC;AAdU,uBAAuB;IAHnC,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;KAChC,CAAC;GACW,uBAAuB,CAenC;SAfY,uBAAuB"}
@@ -7,11 +7,6 @@ import { paramCase } from "change-case";
7
7
  import { PassportClient } from "../services/PassportClient.js";
8
8
  import { TEMPLATE_DIR } from "../utils/templateDir.js";
9
9
  let PassportGenerateHook = PassportGenerateHook_1 = class PassportGenerateHook {
10
- providersInfoService;
11
- projectPackageJson;
12
- srcRenderService;
13
- passportClient;
14
- packages;
15
10
  constructor(providersInfoService) {
16
11
  this.providersInfoService = providersInfoService;
17
12
  providersInfoService.add({
@@ -1 +1 @@
1
- {"version":3,"file":"PassportGenerateHook.js","sourceRoot":"","sources":["../../../src/hooks/PassportGenerateHook.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAqB,oBAAoB,EAAC,MAAM,WAAW,CAAC;AACnE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AAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC;CACF,CAAA;AA9FC;IAAC,MAAM,EAAE;8BACW,kBAAkB;gEAAC;AAEvC;IAAC,MAAM,EAAE;8BACS,kBAAkB;8DAAC;AAErC;IAAC,MAAM,EAAE;8BACO,cAAc;4DAAC;AAgBzB;IADL,QAAQ,CAAC,UAAU,CAAC;;;;4DA4BpB;AAED;IAAC,MAAM,CAAC,UAAU,CAAC;;;;0DAqBlB;AA1EU,oBAAoB;IADhC,UAAU,EAAE;qCAa+B,oBAAoB;GAZnD,oBAAoB,CA+FhC;SA/FY,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAEpC,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAErE,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAEvC,eAAe,uBAAuB,CAAC"}
@@ -2,7 +2,6 @@ import { __decorate, __metadata } from "tslib";
2
2
  import { CliHttpClient, Inject, Injectable } from "@tsed/cli-core";
3
3
  const HOST = "http://www.passportjs.org/packages";
4
4
  let PassportClient = class PassportClient {
5
- httpClient;
6
5
  async getPackages() {
7
6
  const result = await this.httpClient.get(`${HOST}/-/all.json`, {});
8
7
  return Object.values(result).filter((o) => {
@@ -1 +1 @@
1
- {"version":3,"file":"PassportClient.js","sourceRoot":"","sources":["../../../src/services/PassportClient.ts"],"names":[],"m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CACF,CAAA;AAVC;IAAC,MAAM,CAAC,aAAa,CAAC;8BACV,aAAa;kDAAC;AAFf,cAAc;IAD1B,UAAU,EAAE;GACA,cAAc,CAW1B;SAXY,cAAc"}
@@ -1,5 +1,3 @@
1
- import {getTemplateDirectory} from "@tsed/cli-core";
2
- import path from "node:path";
3
- import {fileURLToPath} from "node:url";
4
-
5
- export const TEMPLATE_DIR = getTemplateDirectory(path.dirname(fileURLToPath(import.meta.url)));
1
+ import { getTemplateDirectory } from "@tsed/cli-core";
2
+ export const TEMPLATE_DIR = getTemplateDirectory(import.meta.dirname);
3
+ //# sourceMappingURL=templateDir.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../../src/utils/templateDir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../../src/utils/templateDir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { GenerateCmdContext, ProvidersInfoService } from "@tsed/cli";
2
2
  import { ProjectPackageJson, SrcRendererService, Tasks } from "@tsed/cli-core";
3
- import { PassportClient } from "../services/PassportClient";
3
+ import { PassportClient } from "../services/PassportClient.js";
4
4
  export interface PassportGenerateOptions extends GenerateCmdContext {
5
5
  passportPackage: string;
6
6
  }
@@ -1,5 +1,5 @@
1
- import { CliPluginPassportModule } from "./CliPluginPassportModule";
2
- export * from "./hooks/PassportGenerateHook";
3
- export * from "./services/PassportClient";
4
- export * from "./utils/templateDir";
1
+ import { CliPluginPassportModule } from "./CliPluginPassportModule.js";
2
+ export * from "./hooks/PassportGenerateHook.js";
3
+ export * from "./services/PassportClient.js";
4
+ export * from "./utils/templateDir.js";
5
5
  export default CliPluginPassportModule;
package/package.json CHANGED
@@ -1,38 +1,37 @@
1
1
  {
2
2
  "name": "@tsed/cli-plugin-passport",
3
- "version": "5.3.1",
4
3
  "description": "Ts.ED CLI plugin. Add Passport.js support",
4
+ "version": "6.0.0-alpha.2",
5
+ "type": "module",
6
+ "main": "./lib/esm/index.js",
5
7
  "source": "./src/index.ts",
6
- "main": "./lib/cjs/index.js",
7
8
  "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
- "types": "./lib/types/index.d.ts",
11
- "import": "./lib/esm/index.js",
12
- "require": "./lib/cjs/index.js",
13
- "default": "./lib/esm/index.js"
11
+ ".": {
12
+ "types": "./lib/types/index.d.ts",
13
+ "import": "./lib/esm/index.js",
14
+ "default": "./lib/esm/index.js"
15
+ }
14
16
  },
15
17
  "scripts": {
16
18
  "build": "yarn build:ts",
17
- "build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json && cp scripts/templateDir.esm.js lib/esm/utils/templateDir.js",
18
- "lint": "eslint '**/*.{ts,js}'",
19
- "lint:fix": "eslint '**/*.{ts,js}' --fix",
20
- "test": "cross-env NODE_ENV=test yarn jest --max-workers=2 --passWithNoTests && jest-coverage-thresholds-bumper"
19
+ "build:ts": "tsc --build tsconfig.json",
20
+ "test": "vitest run",
21
+ "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
21
22
  },
22
23
  "dependencies": {
23
24
  "change-case": "^4.1.2",
24
25
  "tslib": "2.3.1"
25
26
  },
26
27
  "devDependencies": {
27
- "@tsed/cli": "5.3.1",
28
- "@tsed/cli-core": "5.3.1",
29
- "@tsed/eslint": "5.3.1",
30
- "@tsed/jest-config": "5.3.1",
31
- "@tsed/typescript": "5.3.1",
28
+ "@tsed/cli": "6.0.0-alpha.2",
29
+ "@tsed/cli-core": "6.0.0-alpha.2",
30
+ "@tsed/typescript": "6.0.0-alpha.2",
32
31
  "@types/change-case": "^2.3.1",
33
32
  "cross-env": "7.0.3",
34
- "eslint": "8.22.0",
35
- "jest": "29.5.0"
33
+ "typescript": "4.9.5",
34
+ "vitest": "2.1.1"
36
35
  },
37
36
  "peerDependencies": {},
38
37
  "repository": "https://github.com/tsedio/tsed-cli",
@@ -41,5 +40,8 @@
41
40
  },
42
41
  "homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli-plugin-passport",
43
42
  "author": "Romain Lenzotti",
44
- "license": "MIT"
43
+ "license": "MIT",
44
+ "publishConfig": {
45
+ "tag": "alpha"
46
+ }
45
47
  }
@@ -1,5 +1,6 @@
1
- import {getTemplateDirectory} from "@tsed/cli-core";
2
1
  import path from "node:path";
3
2
  import {fileURLToPath} from "node:url";
4
3
 
4
+ import {getTemplateDirectory} from "@tsed/cli-core";
5
+
5
6
  export const TEMPLATE_DIR = getTemplateDirectory(path.dirname(fileURLToPath(import.meta.url)));
@@ -0,0 +1,21 @@
1
+ // @ts-ignore
2
+ import {presets} from "@tsed/vitest/presets";
3
+ import {defineConfig} from "vitest/config";
4
+
5
+ export default defineConfig(
6
+ {
7
+ ...presets,
8
+ test: {
9
+ ...presets.test,
10
+ coverage: {
11
+ ...presets.test.coverage,
12
+ thresholds: {
13
+ statements: 0,
14
+ branches: 0,
15
+ functions: 0,
16
+ lines: 0
17
+ }
18
+ }
19
+ }
20
+ }
21
+ );
package/.eslintignore DELETED
@@ -1,13 +0,0 @@
1
- node_modules
2
- docs
3
- docs-references
4
- lib
5
- dist
6
- coverage
7
- .nyc_output
8
- *-lock.json
9
- *.lock
10
- benchmarks.*
11
- **/generated
12
-
13
- **/*.js
package/.eslintrc.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require("@tsed/eslint/node.js");
package/jest.config.js DELETED
@@ -1,14 +0,0 @@
1
- // For a detailed explanation regarding each configuration property, visit:
2
- // https://jestjs.io/docs/en/configuration.html
3
-
4
- module.exports = {
5
- ...require("@tsed/jest-config"),
6
- coverageThreshold: {
7
- global: {
8
- statements: 0,
9
- branches: 0,
10
- functions: 0,
11
- lines: 0
12
- }
13
- }
14
- };
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CliPluginPassportModule = void 0;
4
- const tslib_1 = require("tslib");
5
- const cli_core_1 = require("@tsed/cli-core");
6
- const di_1 = require("@tsed/di");
7
- const PassportGenerateHook_1 = require("./hooks/PassportGenerateHook");
8
- let CliPluginPassportModule = class CliPluginPassportModule {
9
- packageJson;
10
- install() {
11
- this.packageJson.addDependencies({
12
- "@tsed/passport": this.packageJson.dependencies["@tsed/common"],
13
- passport: "latest"
14
- });
15
- this.packageJson.addDevDependencies({
16
- "@types/passport": "latest"
17
- });
18
- }
19
- };
20
- tslib_1.__decorate([
21
- (0, di_1.Inject)(),
22
- tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
23
- ], CliPluginPassportModule.prototype, "packageJson", void 0);
24
- tslib_1.__decorate([
25
- (0, cli_core_1.OnAdd)("@tsed/cli-plugin-passport"),
26
- tslib_1.__metadata("design:type", Function),
27
- tslib_1.__metadata("design:paramtypes", []),
28
- tslib_1.__metadata("design:returntype", void 0)
29
- ], CliPluginPassportModule.prototype, "install", null);
30
- CliPluginPassportModule = tslib_1.__decorate([
31
- (0, cli_core_1.Module)({
32
- imports: [PassportGenerateHook_1.PassportGenerateHook]
33
- })
34
- ], CliPluginPassportModule);
35
- exports.CliPluginPassportModule = CliPluginPassportModule;
36
- //# sourceMappingURL=CliPluginPassportModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CliPluginPassportModule.js","sourceRoot":"","sources":["../../src/CliPluginPassportModule.ts"],"names":[],"mappings":";;;;AAAA,6CAAiE;AACjE,iCAAgC;AAChC,uEAAkE;AAK3D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAElC,WAAW,CAAqB;IAGhC,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC;YAC/B,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC;YAC/D,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAClC,iBAAiB,EAAE,QAAQ;SAC5B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAdC;IAAC,IAAA,WAAM,GAAE;sCACI,6BAAkB;4DAAC;AAEhC;IAAC,IAAA,gBAAK,EAAC,2BAA2B,CAAC;;;;sDAUlC;AAdU,uBAAuB;IAHnC,IAAA,iBAAM,EAAC;QACN,OAAO,EAAE,CAAC,2CAAoB,CAAC;KAChC,CAAC;GACW,uBAAuB,CAenC;AAfY,0DAAuB"}
@@ -1,113 +0,0 @@
1
- "use strict";
2
- var PassportGenerateHook_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PassportGenerateHook = void 0;
5
- const tslib_1 = require("tslib");
6
- const cli_1 = require("@tsed/cli");
7
- const cli_core_1 = require("@tsed/cli-core");
8
- const di_1 = require("@tsed/di");
9
- const change_case_1 = require("change-case");
10
- const PassportClient_1 = require("../services/PassportClient");
11
- const templateDir_1 = require("../utils/templateDir");
12
- let PassportGenerateHook = PassportGenerateHook_1 = class PassportGenerateHook {
13
- providersInfoService;
14
- projectPackageJson;
15
- srcRenderService;
16
- passportClient;
17
- packages;
18
- constructor(providersInfoService) {
19
- this.providersInfoService = providersInfoService;
20
- providersInfoService.add({
21
- name: "Protocol",
22
- value: "protocol",
23
- model: "{{symbolName}}.protocol"
24
- }, PassportGenerateHook_1);
25
- }
26
- async onGeneratePrompt() {
27
- this.packages = await this.passportClient.getPackages();
28
- const list = this.packages.map((item) => {
29
- return {
30
- name: `${item.name} - ${item.description}`,
31
- value: item.name
32
- };
33
- });
34
- return [
35
- {
36
- type: "autocomplete",
37
- name: "passportPackage",
38
- message: "Which passport package ?",
39
- when(state) {
40
- return ["protocol"].includes(state.type);
41
- },
42
- source: (state, keyword) => {
43
- if (keyword) {
44
- return list.filter((item) => item.name.toLowerCase().includes(keyword.toLowerCase()));
45
- }
46
- return list;
47
- }
48
- }
49
- ];
50
- }
51
- onGenerateExec(ctx) {
52
- if (this.providersInfoService.isMyProvider(ctx.type, PassportGenerateHook_1)) {
53
- ctx = this.mapOptions(ctx);
54
- const { passportPackage, symbolPath } = ctx;
55
- this.projectPackageJson.addDependency(ctx.passportPackage, this.getPassportPackageVersion(passportPackage));
56
- return [
57
- {
58
- title: `Generate ${ctx.type} file to '${symbolPath}.ts'`,
59
- task: () => this.srcRenderService.render(this.getTemplate(passportPackage), ctx, {
60
- output: `${symbolPath}.ts`,
61
- templateDir: templateDir_1.TEMPLATE_DIR
62
- })
63
- }
64
- ];
65
- }
66
- return [];
67
- }
68
- mapOptions(options) {
69
- return {
70
- ...options,
71
- protocolName: (0, change_case_1.paramCase)(options.name),
72
- passportPackage: options.passportPackage
73
- };
74
- }
75
- getTemplate(passportPackage) {
76
- const template = `${passportPackage}.protocol.hbs`;
77
- return this.srcRenderService.templateExists(template, { templateDir: templateDir_1.TEMPLATE_DIR }) ? template : "generic.protocol.hbs";
78
- }
79
- getPassportPackageVersion(passportPackage) {
80
- const passportPkgDetails = this.packages.find((pkg) => pkg.name === passportPackage);
81
- return passportPkgDetails ? passportPkgDetails["dist-tags"]?.latest : undefined;
82
- }
83
- };
84
- tslib_1.__decorate([
85
- (0, cli_core_1.Inject)(),
86
- tslib_1.__metadata("design:type", cli_core_1.ProjectPackageJson)
87
- ], PassportGenerateHook.prototype, "projectPackageJson", void 0);
88
- tslib_1.__decorate([
89
- (0, cli_core_1.Inject)(),
90
- tslib_1.__metadata("design:type", cli_core_1.SrcRendererService)
91
- ], PassportGenerateHook.prototype, "srcRenderService", void 0);
92
- tslib_1.__decorate([
93
- (0, cli_core_1.Inject)(),
94
- tslib_1.__metadata("design:type", PassportClient_1.PassportClient)
95
- ], PassportGenerateHook.prototype, "passportClient", void 0);
96
- tslib_1.__decorate([
97
- (0, cli_core_1.OnPrompt)("generate"),
98
- tslib_1.__metadata("design:type", Function),
99
- tslib_1.__metadata("design:paramtypes", []),
100
- tslib_1.__metadata("design:returntype", Promise)
101
- ], PassportGenerateHook.prototype, "onGeneratePrompt", null);
102
- tslib_1.__decorate([
103
- (0, cli_core_1.OnExec)("generate"),
104
- tslib_1.__metadata("design:type", Function),
105
- tslib_1.__metadata("design:paramtypes", [Object]),
106
- tslib_1.__metadata("design:returntype", Array)
107
- ], PassportGenerateHook.prototype, "onGenerateExec", null);
108
- PassportGenerateHook = PassportGenerateHook_1 = tslib_1.__decorate([
109
- (0, di_1.Injectable)(),
110
- tslib_1.__metadata("design:paramtypes", [cli_1.ProvidersInfoService])
111
- ], PassportGenerateHook);
112
- exports.PassportGenerateHook = PassportGenerateHook;
113
- //# sourceMappingURL=PassportGenerateHook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PassportGenerateHook.js","sourceRoot":"","sources":["../../../src/hooks/PassportGenerateHook.ts"],"names":[],"mappings":";;;;;AAAA,mCAAmE;AACnE,6CAAuG;AACvG,iCAAoC;AACpC,6CAAsC;AACtC,+DAA0D;AAC1D,sDAAkD;AAO3C,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAYX;IAVpB,kBAAkB,CAAqB;IAGvC,gBAAgB,CAAqB;IAGrC,cAAc,CAAiB;IAE/B,QAAQ,CAAQ;IAEhB,YAAoB,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;QAC5D,oBAAoB,CAAC,GAAG,CACtB;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,yBAAyB;SACjC,EACD,sBAAoB,CACrB,CAAC;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,gBAAgB;QACpB,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;QAExD,M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A1EU,oBAAoB;IADhC,IAAA,eAAU,GAAE;6CAa+B,0BAAoB;GAZnD,oBAAoB,CA+FhC;AA/FY,oDAAoB"}
package/lib/cjs/index.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const CliPluginPassportModule_1 = require("./CliPluginPassportModule");
5
- tslib_1.__exportStar(require("./hooks/PassportGenerateHook"), exports);
6
- tslib_1.__exportStar(require("./services/PassportClient"), exports);
7
- tslib_1.__exportStar(require("./utils/templateDir"), exports);
8
- exports.default = CliPluginPassportModule_1.CliPluginPassportModule;
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAElE,uEAA6C;AAC7C,oEAA0C;AAC1C,8DAAoC;AAEpC,kBAAe,iDAAuB,CAAC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PassportClient = void 0;
4
- const tslib_1 = require("tslib");
5
- const cli_core_1 = require("@tsed/cli-core");
6
- const HOST = "http://www.passportjs.org/packages";
7
- let PassportClient = class PassportClient {
8
- httpClient;
9
- async getPackages() {
10
- const result = await this.httpClient.get(`${HOST}/-/all.json`, {});
11
- return Object.values(result).filter((o) => {
12
- return o.name && o.name.startsWith("passport-");
13
- });
14
- }
15
- };
16
- tslib_1.__decorate([
17
- (0, cli_core_1.Inject)(cli_core_1.CliHttpClient),
18
- tslib_1.__metadata("design:type", cli_core_1.CliHttpClient)
19
- ], PassportClient.prototype, "httpClient", void 0);
20
- PassportClient = tslib_1.__decorate([
21
- (0, cli_core_1.Injectable)()
22
- ], PassportClient);
23
- exports.PassportClient = PassportClient;
24
- //# sourceMappingURL=PassportClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PassportClient.js","sourceRoot":"","sources":["../../../src/services/PassportClient.ts"],"names":[],"mappings":";;;;AAAA,6CAAiE;AAEjE,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAG3C,IAAM,cAAc,GAApB,MAAM,cAAc;IAEzB,UAAU,CAAgB;IAE1B,KAAK,CAAC,WAAW;QACf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAM,GAAG,IAAI,aAAa,EAAE,EAAE,CAAC,CAAC;QAExE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE;YAC7C,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAVC;IAAC,IAAA,iBAAM,EAAC,wBAAa,CAAC;sCACV,wBAAa;kDAAC;AAFf,cAAc;IAD1B,IAAA,qBAAU,GAAE;GACA,cAAc,CAW1B;AAXY,wCAAc"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TEMPLATE_DIR = void 0;
4
- const cli_core_1 = require("@tsed/cli-core");
5
- exports.TEMPLATE_DIR = (0, cli_core_1.getTemplateDirectory)(__dirname);
6
- //# sourceMappingURL=templateDir.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateDir.js","sourceRoot":"","sources":["../../../src/utils/templateDir.ts"],"names":[],"mappings":";;;AAAA,6CAAoD;AAEvC,QAAA,YAAY,GAAG,IAAA,+BAAoB,EAAC,SAAS,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }