@gapi/cli 1.8.168 → 1.8.170
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/bash/gql2ts/from-query/dist/subtype.d.ts +1 -1
- package/bash/gql2ts/from-schema/dist/index.d.ts +2 -2
- package/bash/gql2ts/index.js +0 -1
- package/bash/gql2ts/language-typescript/dist/index.d.ts +1 -1
- package/bash/gql2ts/util/dist/index.d.ts +11 -11
- package/bash/gql2ts/util/dist/parser.d.ts +1 -1
- package/bash/gql2ts/util/dist/schema.d.ts +3 -3
- package/bash/gql2ts/util/dist/util.d.ts +1 -1
- package/dist/core/helpers/index.d.ts +1 -1
- package/dist/core/helpers/index.js +10 -4
- package/dist/core/helpers/is-windows.js +2 -1
- package/dist/core/helpers/mkdirp.js +11 -11
- package/dist/core/services/args.service.js +3 -3
- package/dist/core/services/config.service.d.ts +1 -1
- package/dist/core/services/config.service.js +3 -3
- package/dist/core/services/environment.service.js +5 -5
- package/dist/core/services/exec.service.d.ts +0 -1
- package/dist/core/services/exec.service.js +4 -4
- package/dist/core/services/readline.service.d.ts +1 -2
- package/dist/core/services/readline.service.js +8 -7
- package/dist/core/services/root.service.js +8 -8
- package/dist/daemon-server/core/services/ipfs/external-importer-systemjs.d.ts +4 -4
- package/dist/daemon-server/core/services/ipfs-hash-map.service.js +9 -8
- package/dist/daemon-server/daemon.config.js +1 -1
- package/dist/main.js +5 -2
- package/dist/tasks/build.js +15 -15
- package/dist/tasks/cloud-code.js +3 -3
- package/dist/tasks/deploy.d.ts +1 -1
- package/dist/tasks/deploy.js +6 -5
- package/dist/tasks/generate/generate.js +10 -10
- package/dist/tasks/generate/runners/abstract.runner.js +3 -4
- package/dist/tasks/generate/runners/schematic.runner.js +1 -1
- package/dist/tasks/generate/ui/emojis.js +17 -17
- package/dist/tasks/generate/ui/index.js +6 -2
- package/dist/tasks/new.js +5 -5
- package/dist/tasks/plugin.js +12 -12
- package/dist/tasks/schema.js +17 -19
- package/dist/tasks/start.js +36 -33
- package/dist/tasks/test.js +5 -3
- package/package.json +13 -13
|
@@ -7,6 +7,6 @@ export interface ISubtypeMetadata {
|
|
|
7
7
|
export declare type SubtypeNamerAndDedupe = (
|
|
8
8
|
selection: FieldNode,
|
|
9
9
|
declaration: string,
|
|
10
|
-
generateSubTypeInterfaceName: GenerateSubTypeInterface
|
|
10
|
+
generateSubTypeInterfaceName: GenerateSubTypeInterface,
|
|
11
11
|
) => ISubtypeMetadata | null;
|
|
12
12
|
export declare const GenerateSubtypeCache: () => SubtypeNamerAndDedupe;
|
|
@@ -3,14 +3,14 @@ import { PossibleSchemaInput } from '@gql2ts/util';
|
|
|
3
3
|
export declare type SchemaToInterfaces = (
|
|
4
4
|
schema: PossibleSchemaInput,
|
|
5
5
|
options?: Partial<ISchemaToInterfaceOptions>,
|
|
6
|
-
formatters?: Partial<IFromQueryOptions
|
|
6
|
+
formatters?: Partial<IFromQueryOptions>,
|
|
7
7
|
) => string;
|
|
8
8
|
export declare const schemaToInterfaces: SchemaToInterfaces;
|
|
9
9
|
export declare type GenerateNamespace = (
|
|
10
10
|
namespace: string,
|
|
11
11
|
schema: PossibleSchemaInput,
|
|
12
12
|
options?: Partial<ISchemaToInterfaceOptions>,
|
|
13
|
-
overrides?: Partial<IFromQueryOptions
|
|
13
|
+
overrides?: Partial<IFromQueryOptions>,
|
|
14
14
|
) => string;
|
|
15
15
|
export declare const generateNamespace: GenerateNamespace;
|
|
16
16
|
export interface ISchemaToInterfaceOptions {
|
package/bash/gql2ts/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export declare const DEFAULT_TYPE_BUILDER: InterfaceAndTypeBuilder;
|
|
|
22
22
|
export declare const DEFAULT_TYPE_JOINER: TypeJoiner;
|
|
23
23
|
export declare const DEFAULT_TYPE_NAMER: WrapType;
|
|
24
24
|
export declare const interfaceExtendListToString: (
|
|
25
|
-
extensions: string[]
|
|
25
|
+
extensions: string[],
|
|
26
26
|
) => string;
|
|
27
27
|
export declare const ADD_INTERFACE_EXTENSIONS: InterfaceNameWithExtensions;
|
|
28
28
|
export declare const DEFAULT_NAME_FRAGMENT: WrapType;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { readFile,
|
|
1
|
+
export { readFile, safeJSONParse, writeToFile } from './fileIO';
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
buildDocumentation,
|
|
4
|
+
getDocTags,
|
|
5
|
+
IFieldDocumentation,
|
|
6
|
+
IJSDocTag,
|
|
7
|
+
} from './parser';
|
|
8
|
+
export {
|
|
9
|
+
isEnum,
|
|
5
10
|
isIntrospectionResult,
|
|
6
|
-
schemaFromInputs,
|
|
7
11
|
isList,
|
|
8
12
|
isNonNullable,
|
|
9
|
-
|
|
13
|
+
PossibleIntrospectionInputs,
|
|
14
|
+
PossibleSchemaInput,
|
|
15
|
+
schemaFromInputs,
|
|
10
16
|
} from './schema';
|
|
11
|
-
export {
|
|
12
|
-
getDocTags,
|
|
13
|
-
IJSDocTag,
|
|
14
|
-
buildDocumentation,
|
|
15
|
-
IFieldDocumentation,
|
|
16
|
-
} from './parser';
|
|
17
17
|
export { filterAndJoinArray } from './util';
|
|
@@ -18,7 +18,7 @@ export declare type BuildDocumentation = (
|
|
|
18
18
|
| GraphQLField<any, any>
|
|
19
19
|
| GraphQLInputField
|
|
20
20
|
| GraphQLEnumValue
|
|
21
|
-
| GraphQLArgument
|
|
21
|
+
| GraphQLArgument,
|
|
22
22
|
) => IFieldDocumentation;
|
|
23
23
|
export declare const getDocTags: null;
|
|
24
24
|
export declare const buildDocumentation: BuildDocumentation;
|
|
@@ -17,13 +17,13 @@ export declare type PossibleSchemaInput =
|
|
|
17
17
|
| string
|
|
18
18
|
| PossibleIntrospectionInputs;
|
|
19
19
|
export declare function isIntrospectionResult(
|
|
20
|
-
schema: PossibleIntrospectionInputs
|
|
20
|
+
schema: PossibleIntrospectionInputs,
|
|
21
21
|
): schema is IntrospectionQuery;
|
|
22
22
|
export declare const schemaFromInputs: (
|
|
23
|
-
schema: PossibleSchemaInput
|
|
23
|
+
schema: PossibleSchemaInput,
|
|
24
24
|
) => GraphQLSchema;
|
|
25
25
|
export declare function isNonNullable(
|
|
26
|
-
type: GraphQLType
|
|
26
|
+
type: GraphQLType,
|
|
27
27
|
): type is GraphQLNonNull<any>;
|
|
28
28
|
export declare function isList(type: GraphQLType): type is GraphQLList<any>;
|
|
29
29
|
export declare function isEnum(type: GraphQLType): type is GraphQLEnumType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Tasks = '--inspect' | '--iport' | '--ihost' | '--buildOnly=false' | '--minify=false' | '--start' | '--outDir' | '--outFile' | '--hmr' | '--public-url' | '--glob' | 'add' | '--lint' | 'clean' | 'restart' | 'list' | '--url' | '--folder' | '--pattern' | '--all' | '--link-name' | 'start' | 'status' | 'unlink' | 'link' | 'bootstrap' | '--dry-run' | '--force' | '--source-root' | '--language' | '--schematics-name' | '--method' | 'remove' | 'kill' | 'stop' | '--port' | '--bundle-modules' | '--disable-excluded-folders' | '--inspect-brk' | '--path' | '--pkg-name' | '--ncc-only' | '--pkg-only' | '--assets' | '--single-executable' | '--target=browser' | '--auto-install' | '--hmr-port' | '--cache-dir' | '--cache' | '--source-maps' | '--hmr-hostname' | '--scope-hoist';
|
|
2
2
|
export declare const includes: (i: Tasks) => boolean;
|
|
3
3
|
export declare const nextOrDefault: (i: Tasks, fb?: any, type?: (p: any) => any) => any;
|
|
4
4
|
export * from './is-windows';
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
exports.nextOrDefault = exports.includes = void 0;
|
|
14
|
-
|
|
15
|
-
exports.
|
|
18
|
+
const includes = (i) => process.argv.toString().includes(i);
|
|
19
|
+
exports.includes = includes;
|
|
20
|
+
const nextOrDefault = (i, fb = true, type = (p) => p) => {
|
|
16
21
|
if (process.argv.toString().includes(i)) {
|
|
17
22
|
const isNextArgumentPresent = process.argv[process.argv.indexOf(i) + 1];
|
|
18
23
|
if (!isNextArgumentPresent) {
|
|
@@ -25,4 +30,5 @@ exports.nextOrDefault = (i, fb = true, type = (p) => p) => {
|
|
|
25
30
|
}
|
|
26
31
|
return fb;
|
|
27
32
|
};
|
|
33
|
+
exports.nextOrDefault = nextOrDefault;
|
|
28
34
|
__exportStar(require("./is-windows"), exports);
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isWindows = void 0;
|
|
4
4
|
const os_1 = require("os");
|
|
5
|
-
|
|
5
|
+
const isWindows = () => (0, os_1.platform)() === 'win32';
|
|
6
|
+
exports.isWindows = isWindows;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.mkdirp = mkdirp;
|
|
4
|
+
exports.mkdirpSync = mkdirpSync;
|
|
5
|
+
/* eslint-disable */
|
|
4
6
|
const fs_1 = require("fs");
|
|
5
7
|
const path_1 = require("path");
|
|
6
8
|
const _0777 = parseInt('0777', 8);
|
|
@@ -22,15 +24,15 @@ function mkdirp(p, opts, f, made) {
|
|
|
22
24
|
function () {
|
|
23
25
|
//
|
|
24
26
|
};
|
|
25
|
-
p = path_1.resolve(p);
|
|
26
|
-
fs_1.mkdir(p, mode, function (er) {
|
|
27
|
+
p = (0, path_1.resolve)(p);
|
|
28
|
+
(0, fs_1.mkdir)(p, mode, function (er) {
|
|
27
29
|
if (!er) {
|
|
28
30
|
made = made || p;
|
|
29
31
|
return cb(null, made);
|
|
30
32
|
}
|
|
31
33
|
switch (er.code) {
|
|
32
34
|
case 'ENOENT':
|
|
33
|
-
mkdirp(path_1.dirname(p), opts, function (er, made) {
|
|
35
|
+
mkdirp((0, path_1.dirname)(p), opts, function (er, made) {
|
|
34
36
|
if (er)
|
|
35
37
|
cb(er, made);
|
|
36
38
|
else
|
|
@@ -41,7 +43,7 @@ function mkdirp(p, opts, f, made) {
|
|
|
41
43
|
// there already. If so, then hooray! If not, then something
|
|
42
44
|
// is borked.
|
|
43
45
|
default:
|
|
44
|
-
fs_1.stat(p, function (er2, stat) {
|
|
46
|
+
(0, fs_1.stat)(p, function (er2, stat) {
|
|
45
47
|
// if the stat fails, then that's super weird.
|
|
46
48
|
// let the original error be the failure reason.
|
|
47
49
|
if (er2 || !stat.isDirectory())
|
|
@@ -53,7 +55,6 @@ function mkdirp(p, opts, f, made) {
|
|
|
53
55
|
}
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
|
-
exports.mkdirp = mkdirp;
|
|
57
58
|
function mkdirpSync(p, opts, made) {
|
|
58
59
|
if (!opts || typeof opts !== 'object') {
|
|
59
60
|
opts = { mode: opts };
|
|
@@ -64,15 +65,15 @@ function mkdirpSync(p, opts, made) {
|
|
|
64
65
|
}
|
|
65
66
|
if (!made)
|
|
66
67
|
made = null;
|
|
67
|
-
p = path_1.resolve(p);
|
|
68
|
+
p = (0, path_1.resolve)(p);
|
|
68
69
|
try {
|
|
69
|
-
fs_1.mkdirSync(p, mode);
|
|
70
|
+
(0, fs_1.mkdirSync)(p, mode);
|
|
70
71
|
made = made || p;
|
|
71
72
|
}
|
|
72
73
|
catch (err0) {
|
|
73
74
|
switch (err0.code) {
|
|
74
75
|
case 'ENOENT':
|
|
75
|
-
made = mkdirpSync(path_1.dirname(p), opts, made);
|
|
76
|
+
made = mkdirpSync((0, path_1.dirname)(p), opts, made);
|
|
76
77
|
mkdirpSync(p, opts, made);
|
|
77
78
|
break;
|
|
78
79
|
// In the case of any other error, just see if there's a dir
|
|
@@ -81,7 +82,7 @@ function mkdirpSync(p, opts, made) {
|
|
|
81
82
|
default:
|
|
82
83
|
let stat;
|
|
83
84
|
try {
|
|
84
|
-
stat = fs_1.statSync(p);
|
|
85
|
+
stat = (0, fs_1.statSync)(p);
|
|
85
86
|
}
|
|
86
87
|
catch (err1) {
|
|
87
88
|
throw err0;
|
|
@@ -93,4 +94,3 @@ function mkdirpSync(p, opts, made) {
|
|
|
93
94
|
}
|
|
94
95
|
return made;
|
|
95
96
|
}
|
|
96
|
-
exports.mkdirpSync = mkdirpSync;
|
|
@@ -13,7 +13,7 @@ let ArgsService = class ArgsService {
|
|
|
13
13
|
this.args = args;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
ArgsService = __decorate([
|
|
17
|
-
core_1.Service()
|
|
18
|
-
], ArgsService);
|
|
19
16
|
exports.ArgsService = ArgsService;
|
|
17
|
+
exports.ArgsService = ArgsService = __decorate([
|
|
18
|
+
(0, core_1.Service)()
|
|
19
|
+
], ArgsService);
|
|
@@ -12,7 +12,7 @@ export declare class MainConfig {
|
|
|
12
12
|
NODE_ENV?: string;
|
|
13
13
|
GAPI_VERSION?: string;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type Platforms = 'server' | 'client';
|
|
16
16
|
export interface SchematicsConfig {
|
|
17
17
|
name: string;
|
|
18
18
|
dryRun: boolean;
|
|
@@ -75,7 +75,7 @@ let ConfigService = class ConfigService {
|
|
|
75
75
|
throw new Error(`You cannot define command '${command}' they are restricted!`);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
ConfigService = __decorate([
|
|
79
|
-
core_1.Service()
|
|
80
|
-
], ConfigService);
|
|
81
78
|
exports.ConfigService = ConfigService;
|
|
79
|
+
exports.ConfigService = ConfigService = __decorate([
|
|
80
|
+
(0, core_1.Service)()
|
|
81
|
+
], ConfigService);
|
|
@@ -17,16 +17,16 @@ let EnvironmentVariableService = class EnvironmentVariableService {
|
|
|
17
17
|
conf.forEach((key) => {
|
|
18
18
|
count++;
|
|
19
19
|
if (conf.length === count) {
|
|
20
|
-
buildedEnvironments += `${helpers_1.isWindows() ? 'set' : 'export'} ${key}=${config[key]}`;
|
|
20
|
+
buildedEnvironments += `${(0, helpers_1.isWindows)() ? 'set' : 'export'} ${key}=${config[key]}`;
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
buildedEnvironments += `${helpers_1.isWindows() ? 'set' : 'export'} ${key}=${config[key]} && `;
|
|
23
|
+
buildedEnvironments += `${(0, helpers_1.isWindows)() ? 'set' : 'export'} ${key}=${config[key]} && `;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
return buildedEnvironments;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
EnvironmentVariableService = __decorate([
|
|
30
|
-
core_1.Service()
|
|
31
|
-
], EnvironmentVariableService);
|
|
32
29
|
exports.EnvironmentVariableService = EnvironmentVariableService;
|
|
30
|
+
exports.EnvironmentVariableService = EnvironmentVariableService = __decorate([
|
|
31
|
+
(0, core_1.Service)()
|
|
32
|
+
], EnvironmentVariableService);
|
|
@@ -12,7 +12,7 @@ const shelljs_1 = require("shelljs");
|
|
|
12
12
|
let ExecService = class ExecService {
|
|
13
13
|
call(command, options) {
|
|
14
14
|
return new Promise((resolve, reject) => {
|
|
15
|
-
shelljs_1.exec(command, options, (code, stdout, stderr) => {
|
|
15
|
+
(0, shelljs_1.exec)(command, options, (code, stdout, stderr) => {
|
|
16
16
|
if (code !== 0) {
|
|
17
17
|
reject(stderr);
|
|
18
18
|
}
|
|
@@ -21,7 +21,7 @@ let ExecService = class ExecService {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
ExecService = __decorate([
|
|
25
|
-
core_1.Service()
|
|
26
|
-
], ExecService);
|
|
27
24
|
exports.ExecService = ExecService;
|
|
25
|
+
exports.ExecService = ExecService = __decorate([
|
|
26
|
+
(0, core_1.Service)()
|
|
27
|
+
], ExecService);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { ReadLine } from 'readline';
|
|
3
2
|
export declare class ReadlineService {
|
|
4
3
|
readline: ReadLine;
|
|
5
4
|
private createReadlineInterface;
|
|
6
5
|
clearScreenDown(): Promise<boolean>;
|
|
7
|
-
createQuestion
|
|
6
|
+
createQuestion(question: string, task: Function): Promise<unknown>;
|
|
8
7
|
}
|
|
@@ -20,16 +20,17 @@ const core_1 = require("@rxdi/core");
|
|
|
20
20
|
const readline_1 = require("readline");
|
|
21
21
|
let ReadlineService = class ReadlineService {
|
|
22
22
|
createReadlineInterface() {
|
|
23
|
-
return readline_1.createInterface({
|
|
23
|
+
return (0, readline_1.createInterface)({
|
|
24
24
|
input: process.stdin,
|
|
25
25
|
output: process.stdout,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
clearScreenDown() {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
return readline_1.clearScreenDown(process.stdin);
|
|
30
|
+
return (0, readline_1.clearScreenDown)(process.stdin);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
33
34
|
createQuestion(question, task) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
36
|
return new Promise((resolve) => {
|
|
@@ -39,16 +40,16 @@ let ReadlineService = class ReadlineService {
|
|
|
39
40
|
task(answer);
|
|
40
41
|
}
|
|
41
42
|
catch (e) {
|
|
42
|
-
console.error('Missing question internal library error!');
|
|
43
|
+
console.error('Missing question internal library error!', e);
|
|
43
44
|
}
|
|
44
45
|
this.readline.close();
|
|
45
|
-
resolve();
|
|
46
|
+
resolve(true);
|
|
46
47
|
});
|
|
47
48
|
});
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
|
-
ReadlineService = __decorate([
|
|
52
|
-
core_1.Service()
|
|
53
|
-
], ReadlineService);
|
|
54
52
|
exports.ReadlineService = ReadlineService;
|
|
53
|
+
exports.ReadlineService = ReadlineService = __decorate([
|
|
54
|
+
(0, core_1.Service)()
|
|
55
|
+
], ReadlineService);
|
|
@@ -77,7 +77,7 @@ let RootService = class RootService {
|
|
|
77
77
|
.toString()
|
|
78
78
|
.replace(/[, ]+/g, ' ')
|
|
79
79
|
.trim();
|
|
80
|
-
resolve(shelljs_1.exec(finalCommand));
|
|
80
|
+
resolve((0, shelljs_1.exec)(finalCommand));
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
83
|
if (customCommand.includes('gql')) {
|
|
@@ -98,7 +98,7 @@ let RootService = class RootService {
|
|
|
98
98
|
.catch((e) => console.error(e));
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
|
-
resolve(shelljs_1.exec(customCommand));
|
|
101
|
+
resolve((0, shelljs_1.exec)(customCommand));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return true;
|
|
@@ -131,9 +131,9 @@ let RootService = class RootService {
|
|
|
131
131
|
return yield this.testTask.run();
|
|
132
132
|
}
|
|
133
133
|
if (argsService.args[2] === 'schema') {
|
|
134
|
-
const introspectionEndpoint = helpers_1.nextOrDefault('--url', '');
|
|
135
|
-
const introspectionFolder = helpers_1.nextOrDefault('--folder', '');
|
|
136
|
-
const pattern = helpers_1.nextOrDefault('--pattern', '');
|
|
134
|
+
const introspectionEndpoint = (0, helpers_1.nextOrDefault)('--url', '');
|
|
135
|
+
const introspectionFolder = (0, helpers_1.nextOrDefault)('--folder', '');
|
|
136
|
+
const pattern = (0, helpers_1.nextOrDefault)('--pattern', '');
|
|
137
137
|
return yield this.schemaTask.run(introspectionEndpoint, introspectionFolder, pattern);
|
|
138
138
|
}
|
|
139
139
|
if (argsService.args[2] === 'deploy') {
|
|
@@ -163,7 +163,7 @@ let RootService = class RootService {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
RootService = __decorate([
|
|
167
|
-
core_1.Service()
|
|
168
|
-
], RootService);
|
|
169
166
|
exports.RootService = RootService;
|
|
167
|
+
exports.RootService = RootService = __decorate([
|
|
168
|
+
(0, core_1.Service)()
|
|
169
|
+
], RootService);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ModuleFormat = 'esm' | 'cjs' | 'amd' | 'global' | 'register';
|
|
2
2
|
export interface MetaConfig {
|
|
3
3
|
/**
|
|
4
4
|
* Sets in what format the module is loaded.
|
|
@@ -93,15 +93,15 @@ export interface PackageConfig {
|
|
|
93
93
|
*/
|
|
94
94
|
meta?: ConfigMeta;
|
|
95
95
|
}
|
|
96
|
-
export
|
|
96
|
+
export type ConfigMeta = PackageList<MetaConfig>;
|
|
97
97
|
export interface ModulesList {
|
|
98
98
|
[bundleName: string]: string[];
|
|
99
99
|
}
|
|
100
100
|
export interface PackageList<T> {
|
|
101
101
|
[packageName: string]: T;
|
|
102
102
|
}
|
|
103
|
-
export
|
|
104
|
-
export
|
|
103
|
+
export type ConfigMap = PackageList<string | PackageList<string>>;
|
|
104
|
+
export type Transpiler = 'plugin-traceur' | 'plugin-babel' | 'plugin-typescript' | 'traceur' | 'babel' | 'typescript' | false;
|
|
105
105
|
export interface TraceurOptions {
|
|
106
106
|
properTailCalls?: boolean;
|
|
107
107
|
symbols?: boolean;
|
|
@@ -16,7 +16,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.IpfsHashMapService = void 0;
|
|
19
|
-
/* eslint-disable @typescript-eslint/class-name-casing */
|
|
20
19
|
const core_1 = require("@rxdi/core");
|
|
21
20
|
const fs_1 = require("fs");
|
|
22
21
|
const util_1 = require("util");
|
|
@@ -27,16 +26,18 @@ let IpfsHashMapService = class IpfsHashMapService {
|
|
|
27
26
|
}
|
|
28
27
|
writeHashMapToFile() {
|
|
29
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
yield util_1.promisify(fs_1.writeFile)(daemon_config_1.IPFS_HASHED_MODULES_MAP, JSON.stringify(this.hashMap, null, 4), { encoding: 'utf8' });
|
|
29
|
+
yield (0, util_1.promisify)(fs_1.writeFile)(daemon_config_1.IPFS_HASHED_MODULES_MAP, JSON.stringify(this.hashMap, null, 4), { encoding: 'utf8' });
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
32
|
readHashMap() {
|
|
34
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
if (yield util_1.promisify(fs_1.exists)(daemon_config_1.IPFS_HASHED_MODULES_MAP)) {
|
|
36
|
-
this.hashMap = JSON.parse(yield util_1.promisify(fs_1.readFile)(daemon_config_1.IPFS_HASHED_MODULES_MAP, {
|
|
34
|
+
if (yield (0, util_1.promisify)(fs_1.exists)(daemon_config_1.IPFS_HASHED_MODULES_MAP)) {
|
|
35
|
+
this.hashMap = JSON.parse(yield (0, util_1.promisify)(fs_1.readFile)(daemon_config_1.IPFS_HASHED_MODULES_MAP, {
|
|
36
|
+
encoding: 'utf8',
|
|
37
|
+
}));
|
|
37
38
|
}
|
|
38
39
|
else {
|
|
39
|
-
yield util_1.promisify(fs_1.writeFile)(daemon_config_1.IPFS_HASHED_MODULES_MAP, JSON.stringify([], null, 4), { encoding: 'utf8' });
|
|
40
|
+
yield (0, util_1.promisify)(fs_1.writeFile)(daemon_config_1.IPFS_HASHED_MODULES_MAP, JSON.stringify([], null, 4), { encoding: 'utf8' });
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
}
|
|
@@ -47,7 +48,7 @@ let IpfsHashMapService = class IpfsHashMapService {
|
|
|
47
48
|
this.hashMap = this.hashMap.filter((m) => m.hash !== hash);
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
IpfsHashMapService = __decorate([
|
|
51
|
-
core_1.Injectable()
|
|
52
|
-
], IpfsHashMapService);
|
|
53
51
|
exports.IpfsHashMapService = IpfsHashMapService;
|
|
52
|
+
exports.IpfsHashMapService = IpfsHashMapService = __decorate([
|
|
53
|
+
(0, core_1.Injectable)()
|
|
54
|
+
], IpfsHashMapService);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IPFS_HASHED_MODULES_MAP = exports.IPFS_HASHED_MODULES = exports.GAPI_DAEMON_CACHE_FOLDER = exports.GAPI_DAEMON_HTTP_PLUGINS_FOLDER = exports.GAPI_DAEMON_IPFS_PLUGINS_FOLDER = exports.GAPI_DAEMON_PLUGINS_FOLDER = exports.GAPI_DAEMON_PROCESS_LIST_FOLDER = exports.GAPI_DAEMON_FOLDER = exports.GAPI_MAIN_FOLDER = void 0;
|
|
4
4
|
const os_1 = require("os");
|
|
5
|
-
exports.GAPI_MAIN_FOLDER = `${os_1.homedir()}/.gapi`;
|
|
5
|
+
exports.GAPI_MAIN_FOLDER = `${(0, os_1.homedir)()}/.gapi`;
|
|
6
6
|
exports.GAPI_DAEMON_FOLDER = `${exports.GAPI_MAIN_FOLDER}/daemon`;
|
|
7
7
|
exports.GAPI_DAEMON_PROCESS_LIST_FOLDER = `${exports.GAPI_DAEMON_FOLDER}/process-list`;
|
|
8
8
|
exports.GAPI_DAEMON_PLUGINS_FOLDER = `${exports.GAPI_DAEMON_FOLDER}/plugins`;
|
package/dist/main.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
4
5
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
6
|
const core_1 = require("@rxdi/core");
|
|
6
7
|
const yamljs_1 = require("yamljs");
|
|
@@ -14,9 +15,11 @@ const argsService = core_1.Container.get(args_service_1.ArgsService);
|
|
|
14
15
|
const configService = core_1.Container.get(config_service_1.ConfigService);
|
|
15
16
|
let config = {};
|
|
16
17
|
try {
|
|
17
|
-
config = yamljs_1.load('gapi-cli.conf.yml');
|
|
18
|
+
config = (0, yamljs_1.load)('gapi-cli.conf.yml');
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
console.error(e);
|
|
18
22
|
}
|
|
19
|
-
catch (e) { }
|
|
20
23
|
configService.setCustomConfig(config);
|
|
21
24
|
argsService.setArguments(process.argv);
|
|
22
25
|
rootService
|
package/dist/tasks/build.js
CHANGED
|
@@ -35,21 +35,21 @@ let BuildTask = class BuildTask {
|
|
|
35
35
|
const customPath = process.argv[4]
|
|
36
36
|
? process.argv[4].split('--path=')[1]
|
|
37
37
|
: null;
|
|
38
|
-
const customPathExists = yield util_1.promisify(fs_1.exists)(`${cwd}/${customPath}`);
|
|
38
|
+
const customPathExists = yield (0, util_1.promisify)(fs_1.exists)(`${cwd}/${customPath}`);
|
|
39
39
|
const filePath = customPathExists
|
|
40
40
|
? `${cwd}/${customPath}`
|
|
41
41
|
: `${cwd}/src/main.ts`;
|
|
42
|
-
const globPaths = helpers_1.nextOrDefault('--glob', '')
|
|
42
|
+
const globPaths = (0, helpers_1.nextOrDefault)('--glob', '')
|
|
43
43
|
.split(',')
|
|
44
44
|
.filter((i) => !!i)
|
|
45
45
|
.map((f) => `.${f}`);
|
|
46
|
-
if (helpers_1.includes('--ncc-only')) {
|
|
46
|
+
if ((0, helpers_1.includes)('--ncc-only')) {
|
|
47
47
|
return this.compileToSingleJS(filePath);
|
|
48
48
|
}
|
|
49
|
-
if (helpers_1.includes('--pkg-only')) {
|
|
49
|
+
if ((0, helpers_1.includes)('--pkg-only')) {
|
|
50
50
|
return this.compileToSingleJS(filePath);
|
|
51
51
|
}
|
|
52
|
-
if (helpers_1.includes('--single-executable')) {
|
|
52
|
+
if ((0, helpers_1.includes)('--single-executable')) {
|
|
53
53
|
if (!(yield this.isTsConfigPresent())) {
|
|
54
54
|
yield this.writeTsConfig();
|
|
55
55
|
}
|
|
@@ -68,12 +68,12 @@ let BuildTask = class BuildTask {
|
|
|
68
68
|
}
|
|
69
69
|
compilePKG() {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
let packageName = helpers_1.nextOrDefault('--pkg-name', 'api');
|
|
72
|
-
if (yield util_1.promisify(fs_1.exists)('./package.json')) {
|
|
71
|
+
let packageName = (0, helpers_1.nextOrDefault)('--pkg-name', 'api');
|
|
72
|
+
if (yield (0, util_1.promisify)(fs_1.exists)('./package.json')) {
|
|
73
73
|
packageName =
|
|
74
|
-
JSON.parse(yield util_1.promisify(fs_1.readFile)('./package.json', { encoding: 'utf-8' })).name || packageName;
|
|
74
|
+
JSON.parse(yield (0, util_1.promisify)(fs_1.readFile)('./package.json', { encoding: 'utf-8' })).name || packageName;
|
|
75
75
|
}
|
|
76
|
-
yield util_1.promisify(fs_1.writeFile)('./dist/package.json', JSON.stringify({
|
|
76
|
+
yield (0, util_1.promisify)(fs_1.writeFile)('./dist/package.json', JSON.stringify({
|
|
77
77
|
name: packageName,
|
|
78
78
|
bin: './index.js',
|
|
79
79
|
pkg: {
|
|
@@ -82,7 +82,7 @@ let BuildTask = class BuildTask {
|
|
|
82
82
|
'./protos/**/*',
|
|
83
83
|
'./protos.json',
|
|
84
84
|
'./operations.json',
|
|
85
|
-
...helpers_1.nextOrDefault('--assets', '')
|
|
85
|
+
...(0, helpers_1.nextOrDefault)('--assets', '')
|
|
86
86
|
.split(',')
|
|
87
87
|
.filter((v) => v),
|
|
88
88
|
],
|
|
@@ -92,11 +92,11 @@ let BuildTask = class BuildTask {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
isTsConfigPresent() {
|
|
95
|
-
return util_1.promisify(fs_1.exists)('./tsconfig.json');
|
|
95
|
+
return (0, util_1.promisify)(fs_1.exists)('./tsconfig.json');
|
|
96
96
|
}
|
|
97
97
|
writeTsConfig() {
|
|
98
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
yield util_1.promisify(fs_1.writeFile)('./tsconfig.json', JSON.stringify({
|
|
99
|
+
yield (0, util_1.promisify)(fs_1.writeFile)('./tsconfig.json', JSON.stringify({
|
|
100
100
|
compilerOptions: {
|
|
101
101
|
module: 'commonjs',
|
|
102
102
|
target: 'es6',
|
|
@@ -133,7 +133,7 @@ let BuildTask = class BuildTask {
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
|
-
BuildTask = __decorate([
|
|
137
|
-
core_1.Service()
|
|
138
|
-
], BuildTask);
|
|
139
136
|
exports.BuildTask = BuildTask;
|
|
137
|
+
exports.BuildTask = BuildTask = __decorate([
|
|
138
|
+
(0, core_1.Service)()
|
|
139
|
+
], BuildTask);
|
package/dist/tasks/cloud-code.js
CHANGED
|
@@ -33,7 +33,7 @@ let CloudCodeTask = class CloudCodeTask {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
CloudCodeTask = __decorate([
|
|
37
|
-
core_1.Service()
|
|
38
|
-
], CloudCodeTask);
|
|
39
36
|
exports.CloudCodeTask = CloudCodeTask;
|
|
37
|
+
exports.CloudCodeTask = CloudCodeTask = __decorate([
|
|
38
|
+
(0, core_1.Service)()
|
|
39
|
+
], CloudCodeTask);
|
package/dist/tasks/deploy.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const QuestionsType: {
|
|
|
3
3
|
password: "password";
|
|
4
4
|
project: "project";
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type QuestionsType = keyof typeof QuestionsType;
|
|
7
7
|
export interface Questions {
|
|
8
8
|
passwordQuestion(): void;
|
|
9
9
|
projectQuestion(): void;
|
package/dist/tasks/deploy.js
CHANGED
|
@@ -16,10 +16,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.DeployTask = exports.QuestionsType = void 0;
|
|
19
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
20
19
|
const core_1 = require("@rxdi/core");
|
|
21
20
|
const readline_service_1 = require("../core/services/readline.service");
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
22
22
|
const chalk = require('chalk');
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
23
24
|
const Spinner = require('cli-spinner').Spinner;
|
|
24
25
|
function strEnum(o) {
|
|
25
26
|
return o.reduce((res, key) => {
|
|
@@ -46,7 +47,7 @@ let DeployTask = class DeployTask {
|
|
|
46
47
|
console.log('Deploy Success!');
|
|
47
48
|
}
|
|
48
49
|
catch (e) {
|
|
49
|
-
console.log('Deploy Error!');
|
|
50
|
+
console.log('Deploy Error!', e);
|
|
50
51
|
}
|
|
51
52
|
process.exit(0);
|
|
52
53
|
});
|
|
@@ -90,7 +91,7 @@ let DeployTask = class DeployTask {
|
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
|
-
DeployTask = __decorate([
|
|
94
|
-
core_1.Service()
|
|
95
|
-
], DeployTask);
|
|
96
94
|
exports.DeployTask = DeployTask;
|
|
95
|
+
exports.DeployTask = DeployTask = __decorate([
|
|
96
|
+
(0, core_1.Service)()
|
|
97
|
+
], DeployTask);
|