@jsonjoy.com/json-pack 1.4.0 → 1.5.0
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/README.md +0 -2
- package/lib/avro/types.d.ts +109 -0
- package/lib/avro/types.js +3 -0
- package/lib/avro/types.js.map +1 -0
- package/lib/msgpack/index.d.ts +3 -0
- package/lib/msgpack/index.js +7 -1
- package/lib/msgpack/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
High performance JSON serialization and deserialization library for JavaScript, Node.js, browser.
|
|
4
4
|
|
|
5
|
-
`json-pack` contains implementations of various JSON codecs into binary formats, such as MessagePack, CBOR and other formats.
|
|
6
|
-
|
|
7
5
|
## Supported Formats
|
|
8
6
|
|
|
9
7
|
This library implements the following serialization formats:
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export interface AvroBaseSchema {
|
|
2
|
+
type: string;
|
|
3
|
+
doc?: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface AvroNullSchema extends AvroBaseSchema {
|
|
7
|
+
type: 'null';
|
|
8
|
+
}
|
|
9
|
+
export interface AvroBooleanSchema extends AvroBaseSchema {
|
|
10
|
+
type: 'boolean';
|
|
11
|
+
}
|
|
12
|
+
export interface AvroIntSchema extends AvroBaseSchema {
|
|
13
|
+
type: 'int';
|
|
14
|
+
}
|
|
15
|
+
export interface AvroLongSchema extends AvroBaseSchema {
|
|
16
|
+
type: 'long';
|
|
17
|
+
}
|
|
18
|
+
export interface AvroFloatSchema extends AvroBaseSchema {
|
|
19
|
+
type: 'float';
|
|
20
|
+
}
|
|
21
|
+
export interface AvroDoubleSchema extends AvroBaseSchema {
|
|
22
|
+
type: 'double';
|
|
23
|
+
}
|
|
24
|
+
export interface AvroBytesSchema extends AvroBaseSchema {
|
|
25
|
+
type: 'bytes';
|
|
26
|
+
}
|
|
27
|
+
export interface AvroStringSchema extends AvroBaseSchema {
|
|
28
|
+
type: 'string';
|
|
29
|
+
}
|
|
30
|
+
export interface AvroRecordField {
|
|
31
|
+
name: string;
|
|
32
|
+
type: AvroSchema;
|
|
33
|
+
doc?: string;
|
|
34
|
+
default?: any;
|
|
35
|
+
order?: 'ascending' | 'descending' | 'ignore';
|
|
36
|
+
aliases?: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface AvroRecordSchema extends AvroBaseSchema {
|
|
39
|
+
type: 'record';
|
|
40
|
+
name: string;
|
|
41
|
+
namespace?: string;
|
|
42
|
+
fields: AvroRecordField[];
|
|
43
|
+
aliases?: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface AvroEnumSchema extends AvroBaseSchema {
|
|
46
|
+
type: 'enum';
|
|
47
|
+
name: string;
|
|
48
|
+
namespace?: string;
|
|
49
|
+
symbols: string[];
|
|
50
|
+
default?: string;
|
|
51
|
+
aliases?: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface AvroArraySchema extends AvroBaseSchema {
|
|
54
|
+
type: 'array';
|
|
55
|
+
items: AvroSchema;
|
|
56
|
+
}
|
|
57
|
+
export interface AvroMapSchema extends AvroBaseSchema {
|
|
58
|
+
type: 'map';
|
|
59
|
+
values: AvroSchema;
|
|
60
|
+
}
|
|
61
|
+
export interface AvroUnionSchema extends Array<AvroSchema> {
|
|
62
|
+
}
|
|
63
|
+
export interface AvroFixedSchema extends AvroBaseSchema {
|
|
64
|
+
type: 'fixed';
|
|
65
|
+
name: string;
|
|
66
|
+
namespace?: string;
|
|
67
|
+
size: number;
|
|
68
|
+
aliases?: string[];
|
|
69
|
+
}
|
|
70
|
+
export type AvroPrimitiveSchema = AvroNullSchema | AvroBooleanSchema | AvroIntSchema | AvroLongSchema | AvroFloatSchema | AvroDoubleSchema | AvroBytesSchema | AvroStringSchema;
|
|
71
|
+
export type AvroComplexSchema = AvroRecordSchema | AvroEnumSchema | AvroArraySchema | AvroMapSchema | AvroUnionSchema | AvroFixedSchema;
|
|
72
|
+
export type AvroSchema = AvroPrimitiveSchema | AvroComplexSchema | string;
|
|
73
|
+
export type AvroNamedSchema = AvroRecordSchema | AvroEnumSchema | AvroFixedSchema;
|
|
74
|
+
export interface AvroLogicalTypeSchema extends AvroBaseSchema {
|
|
75
|
+
logicalType: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AvroDecimalLogicalType extends AvroLogicalTypeSchema {
|
|
78
|
+
logicalType: 'decimal';
|
|
79
|
+
precision: number;
|
|
80
|
+
scale?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface AvroUuidLogicalType extends AvroStringSchema {
|
|
83
|
+
logicalType: 'uuid';
|
|
84
|
+
}
|
|
85
|
+
export interface AvroDateLogicalType extends AvroIntSchema {
|
|
86
|
+
logicalType: 'date';
|
|
87
|
+
}
|
|
88
|
+
export interface AvroTimeMillisLogicalType extends AvroIntSchema {
|
|
89
|
+
logicalType: 'time-millis';
|
|
90
|
+
}
|
|
91
|
+
export interface AvroTimeMicrosLogicalType extends AvroLongSchema {
|
|
92
|
+
logicalType: 'time-micros';
|
|
93
|
+
}
|
|
94
|
+
export interface AvroTimestampMillisLogicalType extends AvroLongSchema {
|
|
95
|
+
logicalType: 'timestamp-millis';
|
|
96
|
+
}
|
|
97
|
+
export interface AvroTimestampMicrosLogicalType extends AvroLongSchema {
|
|
98
|
+
logicalType: 'timestamp-micros';
|
|
99
|
+
}
|
|
100
|
+
export interface AvroLocalTimestampMillisLogicalType extends AvroLongSchema {
|
|
101
|
+
logicalType: 'local-timestamp-millis';
|
|
102
|
+
}
|
|
103
|
+
export interface AvroLocalTimestampMicrosLogicalType extends AvroLongSchema {
|
|
104
|
+
logicalType: 'local-timestamp-micros';
|
|
105
|
+
}
|
|
106
|
+
export interface AvroDurationLogicalType extends AvroFixedSchema {
|
|
107
|
+
logicalType: 'duration';
|
|
108
|
+
size: 12;
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/avro/types.ts"],"names":[],"mappings":""}
|
package/lib/msgpack/index.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ export * from './types';
|
|
|
2
2
|
export { MsgPackEncoderFast } from './MsgPackEncoderFast';
|
|
3
3
|
export { MsgPackEncoder } from './MsgPackEncoder';
|
|
4
4
|
export { MsgPackEncoderStable } from './MsgPackEncoderStable';
|
|
5
|
+
export { MsgPackDecoder } from './MsgPackDecoder';
|
|
5
6
|
export { MsgPackDecoderFast } from './MsgPackDecoderFast';
|
|
6
7
|
export { MsgPackToJsonConverter } from './MsgPackToJsonConverter';
|
|
7
8
|
export { JsonPackValue } from '../JsonPackValue';
|
|
8
9
|
export { JsonPackExtension } from '../JsonPackExtension';
|
|
10
|
+
export { MsgPackEncoder as MessagePackEncoder } from './MsgPackEncoder';
|
|
11
|
+
export { MsgPackDecoder as MessagePackDecoder } from './MsgPackDecoder';
|
package/lib/msgpack/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonPackExtension = exports.JsonPackValue = exports.MsgPackToJsonConverter = exports.MsgPackDecoderFast = exports.MsgPackEncoderStable = exports.MsgPackEncoder = exports.MsgPackEncoderFast = void 0;
|
|
3
|
+
exports.MessagePackDecoder = exports.MessagePackEncoder = exports.JsonPackExtension = exports.JsonPackValue = exports.MsgPackToJsonConverter = exports.MsgPackDecoderFast = exports.MsgPackDecoder = exports.MsgPackEncoderStable = exports.MsgPackEncoder = exports.MsgPackEncoderFast = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("./types"), exports);
|
|
6
6
|
var MsgPackEncoderFast_1 = require("./MsgPackEncoderFast");
|
|
@@ -9,6 +9,8 @@ var MsgPackEncoder_1 = require("./MsgPackEncoder");
|
|
|
9
9
|
Object.defineProperty(exports, "MsgPackEncoder", { enumerable: true, get: function () { return MsgPackEncoder_1.MsgPackEncoder; } });
|
|
10
10
|
var MsgPackEncoderStable_1 = require("./MsgPackEncoderStable");
|
|
11
11
|
Object.defineProperty(exports, "MsgPackEncoderStable", { enumerable: true, get: function () { return MsgPackEncoderStable_1.MsgPackEncoderStable; } });
|
|
12
|
+
var MsgPackDecoder_1 = require("./MsgPackDecoder");
|
|
13
|
+
Object.defineProperty(exports, "MsgPackDecoder", { enumerable: true, get: function () { return MsgPackDecoder_1.MsgPackDecoder; } });
|
|
12
14
|
var MsgPackDecoderFast_1 = require("./MsgPackDecoderFast");
|
|
13
15
|
Object.defineProperty(exports, "MsgPackDecoderFast", { enumerable: true, get: function () { return MsgPackDecoderFast_1.MsgPackDecoderFast; } });
|
|
14
16
|
var MsgPackToJsonConverter_1 = require("./MsgPackToJsonConverter");
|
|
@@ -17,4 +19,8 @@ var JsonPackValue_1 = require("../JsonPackValue");
|
|
|
17
19
|
Object.defineProperty(exports, "JsonPackValue", { enumerable: true, get: function () { return JsonPackValue_1.JsonPackValue; } });
|
|
18
20
|
var JsonPackExtension_1 = require("../JsonPackExtension");
|
|
19
21
|
Object.defineProperty(exports, "JsonPackExtension", { enumerable: true, get: function () { return JsonPackExtension_1.JsonPackExtension; } });
|
|
22
|
+
var MsgPackEncoder_2 = require("./MsgPackEncoder");
|
|
23
|
+
Object.defineProperty(exports, "MessagePackEncoder", { enumerable: true, get: function () { return MsgPackEncoder_2.MsgPackEncoder; } });
|
|
24
|
+
var MsgPackDecoder_2 = require("./MsgPackDecoder");
|
|
25
|
+
Object.defineProperty(exports, "MessagePackDecoder", { enumerable: true, get: function () { return MsgPackDecoder_2.MsgPackDecoder; } });
|
|
20
26
|
//# sourceMappingURL=index.js.map
|
package/lib/msgpack/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/msgpack/index.ts"],"names":[],"mappings":";;;;AA8BA,kDAAwB;AACxB,2DAAwD;AAAhD,wHAAA,kBAAkB,OAAA;AAC1B,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,+DAA4D;AAApD,4HAAA,oBAAoB,OAAA;AAC5B,2DAAwD;AAAhD,wHAAA,kBAAkB,OAAA;AAC1B,mEAAgE;AAAxD,gIAAA,sBAAsB,OAAA;AAC9B,kDAA+C;AAAvC,8GAAA,aAAa,OAAA;AACrB,0DAAuD;AAA/C,sHAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/msgpack/index.ts"],"names":[],"mappings":";;;;AA8BA,kDAAwB;AACxB,2DAAwD;AAAhD,wHAAA,kBAAkB,OAAA;AAC1B,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,+DAA4D;AAApD,4HAAA,oBAAoB,OAAA;AAC5B,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,2DAAwD;AAAhD,wHAAA,kBAAkB,OAAA;AAC1B,mEAAgE;AAAxD,gIAAA,sBAAsB,OAAA;AAC9B,kDAA+C;AAAvC,8GAAA,aAAa,OAAA;AACrB,0DAAuD;AAA/C,sHAAA,iBAAiB,OAAA;AAGzB,mDAAsE;AAA9D,oHAAA,cAAc,OAAsB;AAC5C,mDAAsE;AAA9D,oHAAA,cAAc,OAAsB"}
|