@dxos/protobuf-compiler 2.33.9-dev.6efa8ddf → 2.33.9-dev.8e92e630
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/src/generator/declaration-generator.d.ts +2 -2
- package/dist/src/generator/declaration-generator.d.ts.map +1 -1
- package/dist/src/generator/declaration-generator.js +6 -6
- package/dist/src/generator/declaration-generator.js.map +1 -1
- package/dist/src/generator/enum.d.ts +1 -2
- package/dist/src/generator/enum.d.ts.map +1 -1
- package/dist/src/generator/enum.js +1 -13
- package/dist/src/generator/enum.js.map +1 -1
- package/dist/src/generator/file-generator.d.ts.map +1 -1
- package/dist/src/generator/file-generator.js +1 -5
- package/dist/src/generator/file-generator.js.map +1 -1
- package/dist/src/generator/message.d.ts +2 -5
- package/dist/src/generator/message.d.ts.map +1 -1
- package/dist/src/generator/message.js +4 -13
- package/dist/src/generator/message.js.map +1 -1
- package/dist/src/generator/service.d.ts +2 -2
- package/dist/src/generator/service.d.ts.map +1 -1
- package/dist/src/generator/service.js +3 -11
- package/dist/src/generator/service.js.map +1 -1
- package/dist/test/proto/gen/dxos/test/another.d.ts +0 -4
- package/dist/test/proto/gen/dxos/test/another.d.ts.map +1 -1
- package/dist/test/proto/gen/dxos/test/any.d.ts +1 -5
- package/dist/test/proto/gen/dxos/test/any.d.ts.map +1 -1
- package/dist/test/proto/gen/dxos/test/extensions.d.ts +2 -14
- package/dist/test/proto/gen/dxos/test/extensions.d.ts.map +1 -1
- package/dist/test/proto/gen/dxos/test/testfoo.d.ts +2 -6
- package/dist/test/proto/gen/dxos/test/testfoo.d.ts.map +1 -1
- package/dist/test/proto/gen/dxos/test.d.ts +29 -106
- package/dist/test/proto/gen/dxos/test.d.ts.map +1 -1
- package/dist/test/proto/gen/dxos/test.js +0 -8
- package/dist/test/proto/gen/dxos/test.js.map +1 -1
- package/dist/test/proto/gen/google/protobuf.d.ts +82 -82
- package/dist/test/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/test/proto/gen/index.d.ts.map +1 -1
- package/dist/test/proto/gen/index.js +1 -1
- package/dist/test/proto/gen/index.js.map +1 -1
- package/dist/test/schema.test.js +1 -18
- package/dist/test/schema.test.js.map +1 -1
- package/dist/test/service.test.js +0 -1
- package/dist/test/service.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as protobufjs from 'protobufjs';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
|
-
import {
|
|
4
|
-
export declare function createDeclarations(types: protobufjs.ReflectionObject[],
|
|
3
|
+
import { SubstitutionsMap } from '../parser';
|
|
4
|
+
export declare function createDeclarations(types: protobufjs.ReflectionObject[], subs: SubstitutionsMap): Generator<ts.Statement>;
|
|
5
5
|
export declare const createTypeDictionary: (root: protobufjs.NamespaceBase) => ts.InterfaceDeclaration;
|
|
6
6
|
//# sourceMappingURL=declaration-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration-generator.d.ts","sourceRoot":"","sources":["../../../src/generator/declaration-generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAQ7C,wBAAkB,kBAAkB,CAAE,KAAK,EAAE,UAAU,CAAC,gBAAgB,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"declaration-generator.d.ts","sourceRoot":"","sources":["../../../src/generator/declaration-generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAQ7C,wBAAkB,kBAAkB,CAAE,KAAK,EAAE,UAAU,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,gBAAgB,GAAG,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAuB3H;AAeD,eAAO,MAAM,oBAAoB,SAAU,WAAW,aAAa,4BAclE,CAAC"}
|
|
@@ -35,23 +35,23 @@ const message_1 = require("./message");
|
|
|
35
35
|
const service_1 = require("./service");
|
|
36
36
|
const types_1 = require("./types");
|
|
37
37
|
const f = ts.factory;
|
|
38
|
-
function* createDeclarations(types,
|
|
38
|
+
function* createDeclarations(types, subs) {
|
|
39
39
|
for (const obj of types) {
|
|
40
40
|
if (obj instanceof protobufjs.Enum) {
|
|
41
|
-
yield (0, enum_1.createEnumDeclaration)(obj
|
|
41
|
+
yield (0, enum_1.createEnumDeclaration)(obj);
|
|
42
42
|
}
|
|
43
43
|
else if (obj instanceof protobufjs.Service) {
|
|
44
|
-
yield (0, service_1.createServiceDeclaration)(obj,
|
|
44
|
+
yield (0, service_1.createServiceDeclaration)(obj, subs);
|
|
45
45
|
}
|
|
46
46
|
else if (obj instanceof protobufjs.Type) {
|
|
47
|
-
yield (0, message_1.createMessageDeclaration)(obj,
|
|
48
|
-
const nested = Array.from(createDeclarations(obj.nestedArray,
|
|
47
|
+
yield (0, message_1.createMessageDeclaration)(obj, subs);
|
|
48
|
+
const nested = Array.from(createDeclarations(obj.nestedArray, subs));
|
|
49
49
|
if (nested.length > 0) {
|
|
50
50
|
yield f.createModuleDeclaration(undefined, [f.createToken(ts.SyntaxKind.ExportKeyword)], f.createIdentifier(obj.name), f.createModuleBlock(nested), ts.NodeFlags.Namespace);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
else if (obj instanceof protobufjs.Namespace) {
|
|
54
|
-
yield* createDeclarations(obj.nestedArray,
|
|
54
|
+
yield* createDeclarations(obj.nestedArray, subs);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration-generator.js","sourceRoot":"","sources":["../../../src/generator/declaration-generator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,uDAAyC;AACzC,+CAAiC;AAEjC,8CAA4D;AAE5D,iCAA+C;AAC/C,uCAAqD;AACrD,uCAAqD;AACrD,mCAA2C;AAE3C,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;AAErB,QAAgB,CAAC,CAAC,kBAAkB,CAAE,KAAoC,EAAE,
|
|
1
|
+
{"version":3,"file":"declaration-generator.js","sourceRoot":"","sources":["../../../src/generator/declaration-generator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,uDAAyC;AACzC,+CAAiC;AAEjC,8CAA4D;AAE5D,iCAA+C;AAC/C,uCAAqD;AACrD,uCAAqD;AACrD,mCAA2C;AAE3C,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;AAErB,QAAgB,CAAC,CAAC,kBAAkB,CAAE,KAAoC,EAAE,IAAsB;IAChG,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;QACvB,IAAI,GAAG,YAAY,UAAU,CAAC,IAAI,EAAE;YAClC,MAAM,IAAA,4BAAqB,EAAC,GAAG,CAAC,CAAC;SAClC;aAAM,IAAI,GAAG,YAAY,UAAU,CAAC,OAAO,EAAE;YAC5C,MAAM,IAAA,kCAAwB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC3C;aAAM,IAAI,GAAG,YAAY,UAAU,CAAC,IAAI,EAAE;YACzC,MAAM,IAAA,kCAAwB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAE1C,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;YACrE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;gBACrB,MAAM,CAAC,C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CAAC,CAAC,QAAQ,CAAC,CAAC;KACpD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,CACpC,SAAS,EACT,CAAC,CAAC,mBAAmB,CAAC,IAAA,wCAA2B,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EACjE,SAAS,EACT,IAAA,wBAAgB,EAAC,IAAI,CAAC,CACvB,CAAC,CACL,CAAC;AAdW,QAAA,oBAAoB,wBAc/B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as protobufjs from 'protobufjs';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
|
-
|
|
4
|
-
export declare const createEnumDeclaration: (type: protobufjs.Enum, ctx: GeneratorContext) => ts.EnumDeclaration;
|
|
3
|
+
export declare const createEnumDeclaration: (type: protobufjs.Enum) => ts.EnumDeclaration;
|
|
5
4
|
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/generator/enum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/generator/enum.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,eAAO,MAAM,qBAAqB,SAAU,WAAW,IAAI,uBAQ1D,CAAC"}
|
|
@@ -27,20 +27,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.createEnumDeclaration = void 0;
|
|
30
|
-
const path_1 = require("path");
|
|
31
30
|
const ts = __importStar(require("typescript"));
|
|
32
|
-
const doc_comment_1 = require("./doc-comment");
|
|
33
31
|
const f = ts.factory;
|
|
34
|
-
const createEnumDeclaration = (type,
|
|
35
|
-
const declaration = f.createEnumDeclaration(undefined, [f.createToken(ts.SyntaxKind.ExportKeyword)], type.name, Object.entries(type.values).map(([name, id]) => f.createEnumMember(name, f.createNumericLiteral(id))));
|
|
36
|
-
const commentSections = type.comment ? [type.comment] : [];
|
|
37
|
-
if (type.filename) {
|
|
38
|
-
commentSections.push(`Defined in:\n {@link file://./${(0, path_1.relative)((0, path_1.dirname)(ctx.outputFilename), type.filename)}}`);
|
|
39
|
-
}
|
|
40
|
-
if (commentSections.length === 0) {
|
|
41
|
-
return declaration;
|
|
42
|
-
}
|
|
43
|
-
return (0, doc_comment_1.attachDocComment)(declaration, commentSections.join('\n\n'));
|
|
44
|
-
};
|
|
32
|
+
const createEnumDeclaration = (type) => f.createEnumDeclaration(undefined, [f.createToken(ts.SyntaxKind.ExportKeyword)], type.name, Object.entries(type.values).map(([name, id]) => f.createEnumMember(name, f.createNumericLiteral(id))));
|
|
45
33
|
exports.createEnumDeclaration = createEnumDeclaration;
|
|
46
34
|
//# sourceMappingURL=enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/generator/enum.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/generator/enum.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAGF,+CAAiC;AAEjC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;AAEd,MAAM,qBAAqB,GAAG,CAAC,IAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,qBAAqB,CACrF,SAAS,EACT,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,EAC5C,IAAI,CAAC,IAAI,EACT,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAChE,IAAI,EACJ,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAC3B,CAAC,CACH,CAAC;AARW,QAAA,qBAAqB,yBAQhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-generator.d.ts","sourceRoot":"","sources":["../../../src/generator/file-generator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"file-generator.d.ts","sourceRoot":"","sources":["../../../src/generator/file-generator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAc7C,eAAO,MAAM,yBAAyB,UAAW,GAAG,gBAAgB,EAAE,iBAAiB,gBAAgB,UAAU,MAAM,aAAa,MAAM,uBAAuB,eAAe,GAAG,SAAS,mBAAmB,MAAM,EAAE,kBAkBtN,CAAC;AAEF,eAAO,MAAM,qBAAqB,wBAAyB,eAAe,GAAG,SAAS,QAAQ,GAAG,IAAI,cAAc,MAAM,cAAc,MAAM,EAAE,kBAqB9I,CAAC;AAWF,eAAO,MAAM,uBAAuB,cAAe,MAAM,WAGxD,CAAC"}
|
|
@@ -38,11 +38,7 @@ const f = ts.factory;
|
|
|
38
38
|
const createSubstitutionsImport = (substitutionsModule, context) => substitutionsModule && ts.factory.createImportDeclaration([], [], ts.factory.createImportClause(false, ts.factory.createIdentifier('substitutions'), undefined), ts.factory.createStringLiteral(substitutionsModule.importSpecifier(context)));
|
|
39
39
|
const createNamespaceSourceFile = (types, substitutions, outDir, namespace, substitutionsModule, otherNamespaces) => {
|
|
40
40
|
const outFile = (0, path_1.join)(outDir, (0, exports.getFileNameForNamespace)(namespace));
|
|
41
|
-
const
|
|
42
|
-
outputFilename: outFile,
|
|
43
|
-
subs: substitutions
|
|
44
|
-
};
|
|
45
|
-
const declarations = Array.from((0, declaration_generator_1.createDeclarations)(types, ctx));
|
|
41
|
+
const declarations = Array.from((0, declaration_generator_1.createDeclarations)(types, substitutions));
|
|
46
42
|
const substitutionsImport = substitutionsModule && createSubstitutionsImport(substitutionsModule, (0, path_1.dirname)(outFile));
|
|
47
43
|
const otherNamespaceImports = createNamespaceImports(otherNamespaces.filter(ns => ns !== namespace), outDir, (0, path_1.dirname)(outFile));
|
|
48
44
|
return ts.factory.createSourceFile([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-generator.js","sourceRoot":"","sources":["../../../src/generator/file-generator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,+BAAqC;AAErC,+CAAiC;AAEjC,0DAAoE;AACpE,8CAAoF;
|
|
1
|
+
{"version":3,"file":"file-generator.js","sourceRoot":"","sources":["../../../src/generator/file-generator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,+BAAqC;AAErC,+CAAiC;AAEjC,0DAAoE;AACpE,8CAAoF;AAEpF,mEAAmF;AACnF,uFAA+E;AAC/E,uCAAqD;AAErD,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;AAErB,MAAM,yBAAyB,GAAG,CAAC,mBAAoC,EAAE,OAAe,EAAE,EAAE,CAAC,mBAAmB,IAAI,EAAE,CAAC,OAAO,CAAC,uBAAuB,CACpJ,EAAE,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AC,gBAAgB,CAAC,IAAA,uCAA0B,EAAC,IAAA,oCAAuB,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAC5I,CAAC,CAAC,mBAAmB,CAAC,kCAAe,CAAC,mBAAmB,CAAC,IAAA,+BAAuB,EAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAC7H,CAAC,CAAC;AAEE,MAAM,uBAAuB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC3D,MAAM,IAAI,GAAG,IAAA,oCAAuB,EAAC,SAAS,CAAC,CAAC;IAChD,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;AAChC,CAAC,CAAC;AAHW,QAAA,uBAAuB,2BAGlC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,uBAAuB,CACxD,EAAE,EACF,EAAE,EACF,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,kBAAkB,CAAC;IACzD,CAAC,CAAC,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CACxE,CAAC,CAAC,EACH,CAAC,CAAC,mBAAmB,CAAC,+BAAY,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CACxD,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import * as protobufjs from 'protobufjs';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
* {@link file://./../configure.ts#l5}
|
|
6
|
-
*/
|
|
7
|
-
export declare const createMessageDeclaration: (type: protobufjs.Type, ctx: GeneratorContext) => ts.InterfaceDeclaration;
|
|
3
|
+
import { SubstitutionsMap } from '../parser';
|
|
4
|
+
export declare const createMessageDeclaration: (type: protobufjs.Type, subs: SubstitutionsMap) => ts.InterfaceDeclaration;
|
|
8
5
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/generator/message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/generator/message.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAM7C,eAAO,MAAM,wBAAwB,SAAU,WAAW,IAAI,QAAQ,gBAAgB,4BAyBrF,CAAC"}
|
|
@@ -27,29 +27,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.createMessageDeclaration = void 0;
|
|
30
|
-
const path_1 = require("path");
|
|
31
30
|
const ts = __importStar(require("typescript"));
|
|
32
31
|
const doc_comment_1 = require("./doc-comment");
|
|
33
32
|
const field_1 = require("./field");
|
|
34
33
|
const f = ts.factory;
|
|
35
|
-
|
|
36
|
-
* {@link file://./../configure.ts#l5}
|
|
37
|
-
*/
|
|
38
|
-
const createMessageDeclaration = (type, ctx) => {
|
|
34
|
+
const createMessageDeclaration = (type, subs) => {
|
|
39
35
|
const declaration = f.createInterfaceDeclaration(undefined, [f.createToken(ts.SyntaxKind.ExportKeyword)], type.name, undefined, undefined, type.fieldsArray.map(field => {
|
|
40
|
-
const
|
|
41
|
-
const signature = f.createPropertySignature(undefined, field.name.includes('.') ? f.createStringLiteral(field.name) : field.name, isRequired ? undefined : f.createToken(ts.SyntaxKind.QuestionToken), (0, field_1.getFieldType)(field, ctx.subs));
|
|
36
|
+
const signature = f.createPropertySignature(undefined, field.name.includes('.') ? f.createStringLiteral(field.name) : field.name, field.required ? undefined : f.createToken(ts.SyntaxKind.QuestionToken), (0, field_1.getFieldType)(field, subs));
|
|
42
37
|
const docComment = getFieldDocComment(field);
|
|
43
38
|
return docComment ? (0, doc_comment_1.attachDocComment)(signature, docComment) : signature;
|
|
44
39
|
}));
|
|
45
|
-
|
|
46
|
-
if (type.filename) {
|
|
47
|
-
commentSections.push(`Defined in:\n {@link file://./${(0, path_1.relative)((0, path_1.dirname)(ctx.outputFilename), type.filename)}}`);
|
|
48
|
-
}
|
|
49
|
-
if (commentSections.length === 0) {
|
|
40
|
+
if (!type.comment) {
|
|
50
41
|
return declaration;
|
|
51
42
|
}
|
|
52
|
-
return (0, doc_comment_1.attachDocComment)(declaration,
|
|
43
|
+
return (0, doc_comment_1.attachDocComment)(declaration, type.comment);
|
|
53
44
|
};
|
|
54
45
|
exports.createMessageDeclaration = createMessageDeclaration;
|
|
55
46
|
const getFieldDocComment = (field) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/generator/message.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/generator/message.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAGF,+CAAiC;AAGjC,+CAAiD;AACjD,mCAAuC;AAEvC,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;AAEd,MAAM,wBAAwB,GAAG,CAAC,IAAqB,EAAE,IAAsB,EAAE,EAAE;IACxF,MAAM,WAAW,GAAG,CAAC,CAAC,0BAA0B,CAC9C,SAAS,EACT,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,EAC5C,IAAI,CAAC,IAAI,EACT,SAAS,EACT,SAAS,EACT,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC3B,MA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CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACvI;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,SAAS,CAAC;KAClB;SAAM;QACL,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as protobufjs from 'protobufjs';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
|
-
import {
|
|
4
|
-
export declare const createServiceDeclaration: (type: protobufjs.Service,
|
|
3
|
+
import { SubstitutionsMap } from '../parser';
|
|
4
|
+
export declare const createServiceDeclaration: (type: protobufjs.Service, subs: SubstitutionsMap) => ts.InterfaceDeclaration;
|
|
5
5
|
export declare const createServicesDictionary: (root: protobufjs.NamespaceBase) => ts.InterfaceDeclaration;
|
|
6
6
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/generator/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/generator/service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAsC7C,eAAO,MAAM,wBAAwB,SAAU,WAAW,OAAO,QAAQ,gBAAgB,KAAG,GAAG,oBAsB9F,CAAC;AAaF,eAAO,MAAM,wBAAwB,SAAU,WAAW,aAAa,4BActE,CAAC"}
|
|
@@ -31,7 +31,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.createServicesDictionary = exports.createServiceDeclaration = void 0;
|
|
33
33
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
34
|
-
const path_1 = require("path");
|
|
35
34
|
const protobufjs = __importStar(require("protobufjs"));
|
|
36
35
|
const ts = __importStar(require("typescript"));
|
|
37
36
|
const namespaces_1 = require("../namespaces");
|
|
@@ -52,21 +51,14 @@ const createRpcMethodType = (method, service, subs) => {
|
|
|
52
51
|
const outputTypeMonad = method.responseStream ? f.createIdentifier('Stream') : f.createIdentifier('Promise');
|
|
53
52
|
return f.createFunctionTypeNode(undefined, [f.createParameterDeclaration(undefined, undefined, undefined, 'request', undefined, requestType)], f.createTypeReferenceNode(outputTypeMonad, [responseType]));
|
|
54
53
|
};
|
|
55
|
-
const createServiceDeclaration = (type,
|
|
54
|
+
const createServiceDeclaration = (type, subs) => {
|
|
56
55
|
const declaration = f.createInterfaceDeclaration(undefined, [f.createToken(ts.SyntaxKind.ExportKeyword)], type.name, undefined, undefined, type.methodsArray
|
|
57
56
|
.filter(m => !m.requestStream)
|
|
58
57
|
.map(method => {
|
|
59
|
-
const sig = f.createPropertySignature(undefined, mapRpcMethodName(method.name), undefined, createRpcMethodType(method, type,
|
|
58
|
+
const sig = f.createPropertySignature(undefined, mapRpcMethodName(method.name), undefined, createRpcMethodType(method, type, subs));
|
|
60
59
|
return method.comment ? (0, doc_comment_1.attachDocComment)(sig, method.comment) : sig;
|
|
61
60
|
}));
|
|
62
|
-
|
|
63
|
-
if (type.filename) {
|
|
64
|
-
commentSections.push(`Defined in:\n {@link file://./${(0, path_1.relative)((0, path_1.dirname)(ctx.outputFilename), type.filename)}}`);
|
|
65
|
-
}
|
|
66
|
-
if (commentSections.length === 0) {
|
|
67
|
-
return declaration;
|
|
68
|
-
}
|
|
69
|
-
return (0, doc_comment_1.attachDocComment)(declaration, commentSections.join('\n\n'));
|
|
61
|
+
return type.comment ? (0, doc_comment_1.attachDocComment)(declaration, type.comment) : declaration;
|
|
70
62
|
};
|
|
71
63
|
exports.createServiceDeclaration = createServiceDeclaration;
|
|
72
64
|
function* getServices(root) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/generator/service.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,8DAAiC;AACjC
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/generator/service.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,8DAAiC;AACjC,uDAAyC;AACzC,+CAAiC;AAEjC,8CAA4D;AAE5D,+CAAiD;AACjD,mCAAkD;AAElD,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;AAErB,MAAM,WAAW,GAAG,CAAC,MAAyB,EAAE,OAA2B,EAAE,IAAsB,EAA8B,EAAE;;IACjI,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,OAAO;QACL,IAAA,aAAK,EAAC,MAAA,MAAM,CAAC,mBAAmB,mCAAI,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC;QACtE,IAAA,aAAK,EAAC,MAAA,MAAM,CAAC,oBAAoB,mCAAI,MAAM,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC;KACzE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,MAAyB,EAAE,OAA2B,EAAE,IAAsB,EAAE,EAAE;IAC7G,IAAA,qBAAM,EAAC,CAAC,MAAM,CAAC,aAAa,EAAE,2CAA2C,CAAC,CAAC;IAE3E,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAEvE,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAg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
|
1
|
+
{"version":3,"file":"another.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/another.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,cAAc;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/any.ts"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"any.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/any.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,GAAG;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defined in:
|
|
3
|
-
* {@link file://./../../../extensions.proto}
|
|
4
|
-
*/
|
|
5
1
|
export interface OptionsObject {
|
|
6
|
-
field
|
|
2
|
+
field?: number;
|
|
7
3
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Defined in:
|
|
10
|
-
* {@link file://./../../../extensions.proto}
|
|
11
|
-
*/
|
|
12
4
|
export interface WithDefaultField {
|
|
13
5
|
/**
|
|
14
6
|
* Tag
|
|
@@ -17,12 +9,8 @@ export interface WithDefaultField {
|
|
|
17
9
|
* - (defaultValue) = "latest"
|
|
18
10
|
* - (optionsObj).field = 3
|
|
19
11
|
*/
|
|
20
|
-
tag
|
|
12
|
+
tag?: string;
|
|
21
13
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Defined in:
|
|
24
|
-
* {@link file://./../../../extensions.proto}
|
|
25
|
-
*/
|
|
26
14
|
export interface ContainingMessageWithExtensions {
|
|
27
15
|
str?: string;
|
|
28
16
|
msg?: WithDefaultField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/extensions.ts"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/extensions.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,gBAAgB;IAC7B;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,+BAA+B;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,gBAAgB,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testfoo.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/testfoo.ts"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"testfoo.d.ts","sourceRoot":"","sources":["../../../../../../test/proto/gen/dxos/test/testfoo.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,OAAO;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -2,104 +2,60 @@ import type { Stream } from "@dxos/codec-protobuf";
|
|
|
2
2
|
import substitutions from "../../substitutions";
|
|
3
3
|
import * as dxos_test_any from "./test/any";
|
|
4
4
|
import * as dxos_test_testfoo from "./test/testfoo";
|
|
5
|
-
/**
|
|
6
|
-
* Defined in:
|
|
7
|
-
* {@link file://./../../schema.proto}
|
|
8
|
-
*/
|
|
9
5
|
export interface Key {
|
|
10
6
|
data: Uint8Array;
|
|
11
7
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Defined in:
|
|
14
|
-
* {@link file://./../../schema.proto}
|
|
15
|
-
*/
|
|
16
8
|
export interface Any {
|
|
17
|
-
foo
|
|
9
|
+
foo?: string;
|
|
18
10
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Defined in:
|
|
21
|
-
* {@link file://./../../schema.proto}
|
|
22
|
-
*/
|
|
23
11
|
export interface Scalars {
|
|
24
|
-
doubleField
|
|
25
|
-
floatField
|
|
26
|
-
int32Field
|
|
27
|
-
int64Field
|
|
28
|
-
uint32Field
|
|
29
|
-
uint64Field
|
|
30
|
-
sint32Field
|
|
31
|
-
sint64Field
|
|
32
|
-
fixed32Field
|
|
33
|
-
fixed64Field
|
|
34
|
-
sfixed32Field
|
|
35
|
-
sfixed64Field
|
|
36
|
-
boolField
|
|
37
|
-
stringField
|
|
38
|
-
bytesField
|
|
12
|
+
doubleField?: number;
|
|
13
|
+
floatField?: number;
|
|
14
|
+
int32Field?: number;
|
|
15
|
+
int64Field?: string;
|
|
16
|
+
uint32Field?: number;
|
|
17
|
+
uint64Field?: string;
|
|
18
|
+
sint32Field?: number;
|
|
19
|
+
sint64Field?: string;
|
|
20
|
+
fixed32Field?: number;
|
|
21
|
+
fixed64Field?: string;
|
|
22
|
+
sfixed32Field?: number;
|
|
23
|
+
sfixed64Field?: string;
|
|
24
|
+
boolField?: boolean;
|
|
25
|
+
stringField?: string;
|
|
26
|
+
bytesField?: Uint8Array;
|
|
39
27
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Defined in:
|
|
42
|
-
* {@link file://./../../schema.proto}
|
|
43
|
-
*/
|
|
44
28
|
export interface ComplexFields {
|
|
45
29
|
repeatedField?: ReturnType<(typeof substitutions)["dxos.test.Key"]["decode"]>[];
|
|
46
30
|
requiredField: ReturnType<(typeof substitutions)["dxos.test.Key"]["decode"]>;
|
|
47
31
|
mappedField?: Partial<Record<string, ReturnType<(typeof substitutions)["dxos.test.Key"]["decode"]>>>;
|
|
48
|
-
inner
|
|
49
|
-
myAny
|
|
50
|
-
googleAny
|
|
51
|
-
importedAny
|
|
52
|
-
/**
|
|
53
|
-
* Options:
|
|
54
|
-
* - proto3_optional = true
|
|
55
|
-
*/
|
|
32
|
+
inner?: ComplexFields.Inner;
|
|
33
|
+
myAny?: Any;
|
|
34
|
+
googleAny?: ReturnType<(typeof substitutions)["google.protobuf.Any"]["decode"]>;
|
|
35
|
+
importedAny?: dxos_test_any.Any;
|
|
56
36
|
fooTest?: dxos_test_testfoo.TestFoo;
|
|
57
37
|
}
|
|
58
38
|
export declare namespace ComplexFields {
|
|
59
|
-
/**
|
|
60
|
-
* Defined in:
|
|
61
|
-
* {@link file://./../../schema.proto}
|
|
62
|
-
*/
|
|
63
39
|
interface Inner {
|
|
64
|
-
foo
|
|
65
|
-
bar
|
|
40
|
+
foo?: string;
|
|
41
|
+
bar?: ComplexFields.InnerEnum;
|
|
66
42
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Defined in:
|
|
69
|
-
* {@link file://./../../schema.proto}
|
|
70
|
-
*/
|
|
71
43
|
enum InnerEnum {
|
|
72
44
|
FOO = 1,
|
|
73
45
|
BAR = 2
|
|
74
46
|
}
|
|
75
47
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Defined in:
|
|
78
|
-
* {@link file://./../../schema.proto}
|
|
79
|
-
*/
|
|
80
48
|
export interface WithTimestamp {
|
|
81
|
-
timestamp
|
|
49
|
+
timestamp?: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
82
50
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Defined in:
|
|
85
|
-
* {@link file://./../../schema.proto}
|
|
86
|
-
*/
|
|
87
51
|
export interface Outer {
|
|
88
|
-
inner
|
|
52
|
+
inner?: ComplexFields.Inner;
|
|
89
53
|
}
|
|
90
54
|
export declare namespace Outer {
|
|
91
|
-
/**
|
|
92
|
-
* Defined in:
|
|
93
|
-
* {@link file://./../../schema.proto}
|
|
94
|
-
*/
|
|
95
55
|
interface Inner {
|
|
96
|
-
inner
|
|
56
|
+
inner?: ComplexFields.InnerEnum;
|
|
97
57
|
}
|
|
98
58
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Defined in:
|
|
101
|
-
* {@link file://./../../schema.proto}
|
|
102
|
-
*/
|
|
103
59
|
export declare enum TaskType {
|
|
104
60
|
IN_PROGRESS = 1,
|
|
105
61
|
COMPLETED = 2
|
|
@@ -107,20 +63,14 @@ export declare enum TaskType {
|
|
|
107
63
|
/**
|
|
108
64
|
* Task.
|
|
109
65
|
* Comments can be multiline.
|
|
110
|
-
*
|
|
111
|
-
* Defined in:
|
|
112
|
-
* {@link file://./../../schema.proto}
|
|
113
66
|
*/
|
|
114
67
|
export interface Task {
|
|
115
68
|
/**
|
|
116
69
|
* Task id
|
|
117
70
|
*/
|
|
118
|
-
id
|
|
71
|
+
id?: string;
|
|
119
72
|
/**
|
|
120
73
|
* Task title
|
|
121
|
-
*
|
|
122
|
-
* Options:
|
|
123
|
-
* - proto3_optional = true
|
|
124
74
|
*/
|
|
125
75
|
title?: string;
|
|
126
76
|
/**
|
|
@@ -129,38 +79,19 @@ export interface Task {
|
|
|
129
79
|
*/
|
|
130
80
|
key: ReturnType<(typeof substitutions)["dxos.test.Key"]["decode"]>;
|
|
131
81
|
type: TaskType;
|
|
132
|
-
/**
|
|
133
|
-
* Options:
|
|
134
|
-
* - proto3_optional = true
|
|
135
|
-
*/
|
|
136
82
|
googleAny?: ReturnType<(typeof substitutions)["google.protobuf.Any"]["decode"]>;
|
|
137
83
|
}
|
|
138
|
-
/**
|
|
139
|
-
* Defined in:
|
|
140
|
-
* {@link file://./../../schema.proto}
|
|
141
|
-
*/
|
|
142
84
|
export interface TaskList {
|
|
143
85
|
tasks?: Task[];
|
|
144
86
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Defined in:
|
|
147
|
-
* {@link file://./../../schema.proto}
|
|
148
|
-
*/
|
|
149
87
|
export interface SubstitutedByInterface {
|
|
150
|
-
foo
|
|
88
|
+
foo?: string;
|
|
151
89
|
}
|
|
152
|
-
/**
|
|
153
|
-
* Defined in:
|
|
154
|
-
* {@link file://./../../schema.proto}
|
|
155
|
-
*/
|
|
156
90
|
export interface TaskCount {
|
|
157
|
-
count
|
|
91
|
+
count?: number;
|
|
158
92
|
}
|
|
159
93
|
/**
|
|
160
94
|
* Test service definition.
|
|
161
|
-
*
|
|
162
|
-
* Defined in:
|
|
163
|
-
* {@link file://./../../schema.proto}
|
|
164
95
|
*/
|
|
165
96
|
export interface TestService {
|
|
166
97
|
/**
|
|
@@ -172,17 +103,9 @@ export interface TestService {
|
|
|
172
103
|
*/
|
|
173
104
|
subscribeTasks: (request: ReturnType<(typeof substitutions)["dxos.test.Key"]["decode"]>) => Stream<Task>;
|
|
174
105
|
}
|
|
175
|
-
/**
|
|
176
|
-
* Defined in:
|
|
177
|
-
* {@link file://./../../schema.proto}
|
|
178
|
-
*/
|
|
179
106
|
export interface WithEmptyField {
|
|
180
|
-
emptyField
|
|
107
|
+
emptyField?: void;
|
|
181
108
|
}
|
|
182
|
-
/**
|
|
183
|
-
* Defined in:
|
|
184
|
-
* {@link file://./../../schema.proto}
|
|
185
|
-
*/
|
|
186
109
|
export interface ServiceWithEmpty {
|
|
187
110
|
emptyRpc: (request: void) => Promise<void>;
|
|
188
111
|
emptyStreamRpc: (request: void) => Stream<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../../../test/proto/gen/dxos/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,aAAa,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,iBAAiB,MAAM,gBAAgB,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../../../test/proto/gen/dxos/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,aAAa,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,iBAAiB,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,UAAU,CAAC;CACpB;AACD,MAAM,WAA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S;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AACD;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACtD;;OAEG;IACH,cAAc,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;CAC5G;AACD,MAAM,WAAW,cAAc;IAC3B,UAAU,CAAC,EAAE,IAAI,CAAC;CACrB;AACD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,cAAc,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;CACnD"}
|
|
@@ -3,20 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TaskType = exports.ComplexFields = void 0;
|
|
4
4
|
var ComplexFields;
|
|
5
5
|
(function (ComplexFields) {
|
|
6
|
-
/**
|
|
7
|
-
* Defined in:
|
|
8
|
-
* {@link file://./../../schema.proto}
|
|
9
|
-
*/
|
|
10
6
|
let InnerEnum;
|
|
11
7
|
(function (InnerEnum) {
|
|
12
8
|
InnerEnum[InnerEnum["FOO"] = 1] = "FOO";
|
|
13
9
|
InnerEnum[InnerEnum["BAR"] = 2] = "BAR";
|
|
14
10
|
})(InnerEnum = ComplexFields.InnerEnum || (ComplexFields.InnerEnum = {}));
|
|
15
11
|
})(ComplexFields = exports.ComplexFields || (exports.ComplexFields = {}));
|
|
16
|
-
/**
|
|
17
|
-
* Defined in:
|
|
18
|
-
* {@link file://./../../schema.proto}
|
|
19
|
-
*/
|
|
20
12
|
var TaskType;
|
|
21
13
|
(function (TaskType) {
|
|
22
14
|
TaskType[TaskType["IN_PROGRESS"] = 1] = "IN_PROGRESS";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../../test/proto/gen/dxos/test.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../../test/proto/gen/dxos/test.ts"],"names":[],"mappings":";;;AAwCA,IAAiB,aAAa,CAS7B;AATD,WAAiB,aAAa;IAK1B,IAAY,SAGX;IAHD,WAAY,SAAS;QACjB,uCAAO,CAAA;QACP,uCAAO,CAAA;IACX,CAAC,EAHW,SAAS,GAAT,uBAAS,KAAT,uBAAS,QAGpB;AACL,CAAC,EATgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAS7B;AAYD,IAAY,QAGX;AAHD,WAAY,QAAQ;IAChB,qDAAe,CAAA;IACf,iDAAa,CAAA;AACjB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB"}
|