@automateinc/fleet-types 1.0.100 → 1.0.102
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/bin/fleet-types.mjs +6 -3
- package/package.json +1 -1
package/bin/fleet-types.mjs
CHANGED
|
@@ -50,7 +50,7 @@ async function generateTypes() {
|
|
|
50
50
|
|
|
51
51
|
const apiRoot = path.resolve(callerRoot, fleetApiPath);
|
|
52
52
|
const outputPath = path.resolve(callerRoot, fleetApiTypesPath);
|
|
53
|
-
const routerSourcePath = path.join(apiRoot, "src/
|
|
53
|
+
const routerSourcePath = path.join(apiRoot, "src/routers/trpc/index.ts");
|
|
54
54
|
const prismaTypesPath = path.join(apiRoot, "prisma/types.d.ts");
|
|
55
55
|
const executableExtension = process.platform === "win32" ? ".cmd" : "";
|
|
56
56
|
const apiTscPath = path.join(apiRoot, `node_modules/.bin/tsc${executableExtension}`);
|
|
@@ -92,7 +92,7 @@ async function generateTypes() {
|
|
|
92
92
|
);
|
|
93
93
|
await writeFile(
|
|
94
94
|
serviceProviderShimPath,
|
|
95
|
-
"export declare class ServiceProvider { static getEncryptionService(): { decodeId(encodedId: string, prefix: string): number }; }\n",
|
|
95
|
+
"export declare class ServiceProvider { static getAuthenticationService(): { login(email: string, password: string, tokenExpiry?: string): Promise<string> }; static getEncryptionService(): { decodeId(encodedId: string, prefix: string): number }; }\n",
|
|
96
96
|
);
|
|
97
97
|
await writeFile(
|
|
98
98
|
declarationTsconfigPath,
|
|
@@ -107,6 +107,7 @@ async function generateTypes() {
|
|
|
107
107
|
outDir: declarationOutputDirectory,
|
|
108
108
|
paths: {
|
|
109
109
|
"@/*": [path.join(apiRoot, "src/*")],
|
|
110
|
+
"@/providers": [serviceProviderShimPath],
|
|
110
111
|
"@/providers/service.provider": [serviceProviderShimPath],
|
|
111
112
|
},
|
|
112
113
|
tsBuildInfoFile: path.join(temporaryDirectory, "tsconfig.tsbuildinfo"),
|
|
@@ -132,7 +133,9 @@ async function generateTypes() {
|
|
|
132
133
|
throw new Error(`TypeScript declaration generation failed with exit code ${typeScriptResult.status}.`);
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
const emittedPath = path
|
|
136
|
+
const emittedPath = path
|
|
137
|
+
.join(declarationOutputDirectory, path.relative(path.join(apiRoot, "src"), routerSourcePath))
|
|
138
|
+
.replace(/\.ts$/, ".d.ts");
|
|
136
139
|
const emittedDeclaration = await readFile(emittedPath, "utf8");
|
|
137
140
|
const sourceFile = ts.createSourceFile(emittedPath, emittedDeclaration, ts.ScriptTarget.Latest, true);
|
|
138
141
|
const statements = sourceFile.statements.filter(
|
package/package.json
CHANGED