exposure-keys 1.3.0 → 1.3.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.
package/ExposureKeys.js CHANGED
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.riskCount = exports.loadSignature = exports.loadKeys = exports.loadZip = void 0;
13
- const export_1 = require("../proto/export");
14
13
  const jszip_1 = require("jszip");
14
+ const export_1 = require("../proto/export");
15
15
  function isZip(fileContent) {
16
16
  // eslint-disable-next-line no-magic-numbers
17
17
  const zipHeader = [0x50, 0x4b];
@@ -23,7 +23,7 @@ function loadZip(fileContent) {
23
23
  if (!isZip(fileContent)) {
24
24
  throw new Error('The file you are trying to load is not a zip file.');
25
25
  }
26
- const unzippedData = yield jszip_1.loadAsync(fileContent);
26
+ const unzippedData = yield (0, jszip_1.loadAsync)(fileContent);
27
27
  const keyData = yield ((_a = unzippedData.file('export.bin')) === null || _a === void 0 ? void 0 : _a.async('nodebuffer'));
28
28
  const signatureData = yield ((_b = unzippedData.file('export.sig')) === null || _b === void 0 ? void 0 : _b.async('nodebuffer'));
29
29
  if (!keyData) {
@@ -1 +1 @@
1
- {"version":3,"file":"ExposureKeys.js","sourceRoot":"","sources":["../src/ExposureKeys.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA6E;AAC7E,iCAAgC;AAEhC,SAAS,KAAK,CAAC,WAAmB;IAChC,4CAA4C;IAC5C,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,SAAsB,OAAO,CAAC,WAAmB;;;QAC/C,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC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CAAC,CAAC;SAC7D;QAED,OAAO,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAC,CAAC;;CAClD;AAlBD,0BAkBC;AAED,SAAgB,QAAQ,CAAC,WAAmB;IAC1C,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;KACvF;IAED,MAAM,YAAY,GAAG,kBAAkB,CAAC;IACxC,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAEnD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,YAAY,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,OAAO,mCAA0B,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC;AAdD,4BAcC;AAED,SAAgB,aAAa,CAAC,WAAmB;IAC/C,OAAO,yBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC9C,CAAC;AAFD,sCAEC;AAED,SAAgB,SAAS,CACvB,0BAAsD,EACtD,qBAA6B;IAE7B,OAAO,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAC3C,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,qBAAqB,IAAI,GAAG,CAAC,qBAAqB,KAAK,qBAAqB,CACxF,CAAC,MAAM,CAAC;AACX,CAAC;AAPD,8BAOC"}
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # exposure-keys [![Build Status](https://github.com/ffflorian/exposure-keys/workflows/Build/badge.svg)](https://github.com/ffflorian/exposure-keys/actions/) [![npm version](https://img.shields.io/npm/v/exposure-keys.svg?style=flat)](https://www.npmjs.com/package/exposure-keys)
1
+ # exposure-keys [![npm version](https://img.shields.io/npm/v/exposure-keys.svg?style=flat)](https://www.npmjs.com/package/exposure-keys)
2
2
 
3
3
  A library to load Temporary Exposure Keys (TEK). For more information on the format see https://developers.google.com/android/exposure-notifications/exposure-key-file-format.
4
4
 
package/index.js CHANGED
@@ -1,7 +1,11 @@
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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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];
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
package/package.json CHANGED
@@ -1,43 +1,14 @@
1
1
  {
2
2
  "author": "Florian Imdahl <git@ffflorian.de>",
3
- "bin": {
4
- "my-cli": "cli.js"
5
- },
6
3
  "dependencies": {
7
- "jszip": "3.5.0",
8
- "protobufjs": "6.10.1"
4
+ "jszip": "3.10.1",
5
+ "protobufjs": "7.2.1"
9
6
  },
10
7
  "description": "Temporary Exposure Keys (TEK) library",
11
8
  "devDependencies": {
12
- "@ffflorian/eslint-config": "0.6.2",
13
- "@ffflorian/prettier-config": "0.1.2",
14
- "@ffflorian/semantic-release-config": "0.4.0",
15
- "@semantic-release/changelog": "5.0.1",
16
- "@semantic-release/git": "9.0.0",
17
- "@types/jasmine": "3.5.14",
18
- "@types/node": "~14",
19
- "@typescript-eslint/eslint-plugin": "4.0.0",
20
- "@typescript-eslint/parser": "3.10.1",
21
- "babel-eslint": "10.1.0",
22
- "eslint": "7.8.1",
23
- "eslint-config-prettier": "6.11.0",
24
- "eslint-plugin-import": "2.22.0",
25
- "eslint-plugin-jasmine": "4.1.1",
26
- "eslint-plugin-jsdoc": "30.3.1",
27
- "eslint-plugin-no-unsanitized": "3.1.2",
28
- "eslint-plugin-prettier": "3.1.4",
29
- "eslint-plugin-simple-import-sort": "5.0.3",
30
- "eslint-plugin-sort-keys-fix": "1.1.1",
31
- "eslint-plugin-typescript-sort-keys": "1.3.0",
32
- "husky": "4.2.5",
33
- "jasmine": "3.6.1",
34
- "lint-staged": "10.2.13",
35
- "prettier": "2.1.1",
36
- "publish-flat": "1.4.1",
37
- "rimraf": "3.0.2",
38
- "semantic-release": "17.1.1",
39
- "ts-node": "9.0.0",
40
- "typescript": "4.0.2"
9
+ "protobufjs-cli": "1.1.1",
10
+ "rimraf": "4.1.2",
11
+ "typescript": "4.9.5"
41
12
  },
42
13
  "engines": {
43
14
  "node": ">= 10.9"
@@ -65,49 +36,23 @@
65
36
  "covid-19",
66
37
  "typescript"
67
38
  ],
68
- "husky": {
69
- "hooks": {
70
- "pre-commit": "lint-staged"
71
- }
72
- },
73
39
  "license": "GPL-3.0",
74
- "lint-staged": {
75
- "*.{json,md,yml}": [
76
- "prettier --write"
77
- ],
78
- "spec/**/*.ts": [
79
- "eslint --config .eslintrc.spec.json --fix"
80
- ],
81
- "src/**/*.ts": [
82
- "eslint --fix"
83
- ]
84
- },
85
40
  "main": "index.js",
86
41
  "name": "exposure-keys",
87
- "prettier": "@ffflorian/prettier-config",
88
- "release": {
89
- "extends": "@ffflorian/semantic-release-config"
42
+ "publishConfig": {
43
+ "directory": "flattened"
90
44
  },
91
- "repository": "https://github.com/ffflorian/exposure-keys.git",
45
+ "repository": "https://github.com/ffflorian/node-packages/tree/main/packages/exposure-keys",
92
46
  "scripts": {
93
47
  "build": "yarn build:proto && yarn build:ts",
94
48
  "build:proto": "pbjs --t static-module -w commonjs -o proto/export.js proto/export.proto && pbts --out proto/export.d.ts --no-comments proto/export.js",
95
49
  "build:ts": "tsc",
96
50
  "clean": "rimraf dist",
97
51
  "dist": "yarn clean && yarn build",
98
- "fix": "yarn fix:other && yarn fix:ts",
99
- "fix:other": "yarn prettier --write",
100
- "fix:ts": "yarn lint:ts --fix",
101
- "flatten": "publish-flat -o flattened",
102
- "lint": "yarn lint:ts && yarn lint:ts:spec && yarn lint:other",
103
- "lint:other": "yarn prettier --list-different",
104
- "lint:ts": "eslint --ignore-path .gitignore --ext .ts src/",
105
- "lint:ts:spec": "eslint --ignore-path .gitignore --ext .ts --config .eslintrc.spec.json spec/",
106
- "postversion": "node ../node_modules/publish-flat/cli-copy.js -i package.json -o ../package.json version",
107
- "prettier": "prettier \"*.{json,md,yml}\"",
108
- "release": "semantic-release",
52
+ "flatten": "node ../publish-flat/dist/cli.js -o flattened",
53
+ "postversion": "node ../publish-flat/dist/cli-copy.js -o flattened/package.json version",
109
54
  "start": "ts-node src/cli.ts",
110
- "test": "ts-node -P tsconfig.jasmine.json node_modules/.bin/jasmine"
55
+ "test": "ts-node -P tsconfig.jasmine.json ../../node_modules/.bin/jasmine"
111
56
  },
112
- "version": "1.3.0"
57
+ "version": "1.3.2"
113
58
  }
package/proto/export.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as $protobuf from "protobufjs";
2
+ import Long = require("long");
2
3
  export interface ITemporaryExposureKeyExport {
3
4
  startTimestamp?: (number|Long|null);
4
5
  endTimestamp?: (number|Long|null);
@@ -29,6 +30,7 @@ export class TemporaryExposureKeyExport implements ITemporaryExposureKeyExport {
29
30
  public static fromObject(object: { [k: string]: any }): TemporaryExposureKeyExport;
30
31
  public static toObject(message: TemporaryExposureKeyExport, options?: $protobuf.IConversionOptions): { [k: string]: any };
31
32
  public toJSON(): { [k: string]: any };
33
+ public static getTypeUrl(typeUrlPrefix?: string): string;
32
34
  }
33
35
 
34
36
  export interface ISignatureInfo {
@@ -51,6 +53,7 @@ export class SignatureInfo implements ISignatureInfo {
51
53
  public static fromObject(object: { [k: string]: any }): SignatureInfo;
52
54
  public static toObject(message: SignatureInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };
53
55
  public toJSON(): { [k: string]: any };
56
+ public static getTypeUrl(typeUrlPrefix?: string): string;
54
57
  }
55
58
 
56
59
  export interface ITemporaryExposureKey {
@@ -79,6 +82,7 @@ export class TemporaryExposureKey implements ITemporaryExposureKey {
79
82
  public static fromObject(object: { [k: string]: any }): TemporaryExposureKey;
80
83
  public static toObject(message: TemporaryExposureKey, options?: $protobuf.IConversionOptions): { [k: string]: any };
81
84
  public toJSON(): { [k: string]: any };
85
+ public static getTypeUrl(typeUrlPrefix?: string): string;
82
86
  }
83
87
 
84
88
  export namespace TemporaryExposureKey {
@@ -109,6 +113,7 @@ export class TEKSignatureList implements ITEKSignatureList {
109
113
  public static fromObject(object: { [k: string]: any }): TEKSignatureList;
110
114
  public static toObject(message: TEKSignatureList, options?: $protobuf.IConversionOptions): { [k: string]: any };
111
115
  public toJSON(): { [k: string]: any };
116
+ public static getTypeUrl(typeUrlPrefix?: string): string;
112
117
  }
113
118
 
114
119
  export interface ITEKSignature {
@@ -133,4 +138,5 @@ export class TEKSignature implements ITEKSignature {
133
138
  public static fromObject(object: { [k: string]: any }): TEKSignature;
134
139
  public static toObject(message: TEKSignature, options?: $protobuf.IConversionOptions): { [k: string]: any };
135
140
  public toJSON(): { [k: string]: any };
141
+ public static getTypeUrl(typeUrlPrefix?: string): string;
136
142
  }
package/proto/export.js CHANGED
@@ -184,36 +184,44 @@ $root.TemporaryExposureKeyExport = (function() {
184
184
  while (reader.pos < end) {
185
185
  var tag = reader.uint32();
186
186
  switch (tag >>> 3) {
187
- case 1:
188
- message.startTimestamp = reader.fixed64();
189
- break;
190
- case 2:
191
- message.endTimestamp = reader.fixed64();
192
- break;
193
- case 3:
194
- message.region = reader.string();
195
- break;
196
- case 4:
197
- message.batchNum = reader.int32();
198
- break;
199
- case 5:
200
- message.batchSize = reader.int32();
201
- break;
202
- case 6:
203
- if (!(message.signatureInfos && message.signatureInfos.length))
204
- message.signatureInfos = [];
205
- message.signatureInfos.push($root.SignatureInfo.decode(reader, reader.uint32()));
206
- break;
207
- case 7:
208
- if (!(message.keys && message.keys.length))
209
- message.keys = [];
210
- message.keys.push($root.TemporaryExposureKey.decode(reader, reader.uint32()));
211
- break;
212
- case 8:
213
- if (!(message.revisedKeys && message.revisedKeys.length))
214
- message.revisedKeys = [];
215
- message.revisedKeys.push($root.TemporaryExposureKey.decode(reader, reader.uint32()));
216
- break;
187
+ case 1: {
188
+ message.startTimestamp = reader.fixed64();
189
+ break;
190
+ }
191
+ case 2: {
192
+ message.endTimestamp = reader.fixed64();
193
+ break;
194
+ }
195
+ case 3: {
196
+ message.region = reader.string();
197
+ break;
198
+ }
199
+ case 4: {
200
+ message.batchNum = reader.int32();
201
+ break;
202
+ }
203
+ case 5: {
204
+ message.batchSize = reader.int32();
205
+ break;
206
+ }
207
+ case 6: {
208
+ if (!(message.signatureInfos && message.signatureInfos.length))
209
+ message.signatureInfos = [];
210
+ message.signatureInfos.push($root.SignatureInfo.decode(reader, reader.uint32()));
211
+ break;
212
+ }
213
+ case 7: {
214
+ if (!(message.keys && message.keys.length))
215
+ message.keys = [];
216
+ message.keys.push($root.TemporaryExposureKey.decode(reader, reader.uint32()));
217
+ break;
218
+ }
219
+ case 8: {
220
+ if (!(message.revisedKeys && message.revisedKeys.length))
221
+ message.revisedKeys = [];
222
+ message.revisedKeys.push($root.TemporaryExposureKey.decode(reader, reader.uint32()));
223
+ break;
224
+ }
217
225
  default:
218
226
  reader.skipType(tag & 7);
219
227
  break;
@@ -441,6 +449,21 @@ $root.TemporaryExposureKeyExport = (function() {
441
449
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
442
450
  };
443
451
 
452
+ /**
453
+ * Gets the default type url for TemporaryExposureKeyExport
454
+ * @function getTypeUrl
455
+ * @memberof TemporaryExposureKeyExport
456
+ * @static
457
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
458
+ * @returns {string} The default type url
459
+ */
460
+ TemporaryExposureKeyExport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
461
+ if (typeUrlPrefix === undefined) {
462
+ typeUrlPrefix = "type.googleapis.com";
463
+ }
464
+ return typeUrlPrefix + "/TemporaryExposureKeyExport";
465
+ };
466
+
444
467
  return TemporaryExposureKeyExport;
445
468
  })();
446
469
 
@@ -558,15 +581,18 @@ $root.SignatureInfo = (function() {
558
581
  while (reader.pos < end) {
559
582
  var tag = reader.uint32();
560
583
  switch (tag >>> 3) {
561
- case 3:
562
- message.verificationKeyVersion = reader.string();
563
- break;
564
- case 4:
565
- message.verificationKeyId = reader.string();
566
- break;
567
- case 5:
568
- message.signatureAlgorithm = reader.string();
569
- break;
584
+ case 3: {
585
+ message.verificationKeyVersion = reader.string();
586
+ break;
587
+ }
588
+ case 4: {
589
+ message.verificationKeyId = reader.string();
590
+ break;
591
+ }
592
+ case 5: {
593
+ message.signatureAlgorithm = reader.string();
594
+ break;
595
+ }
570
596
  default:
571
597
  reader.skipType(tag & 7);
572
598
  break;
@@ -673,6 +699,21 @@ $root.SignatureInfo = (function() {
673
699
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
674
700
  };
675
701
 
702
+ /**
703
+ * Gets the default type url for SignatureInfo
704
+ * @function getTypeUrl
705
+ * @memberof SignatureInfo
706
+ * @static
707
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
708
+ * @returns {string} The default type url
709
+ */
710
+ SignatureInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
711
+ if (typeUrlPrefix === undefined) {
712
+ typeUrlPrefix = "type.googleapis.com";
713
+ }
714
+ return typeUrlPrefix + "/SignatureInfo";
715
+ };
716
+
676
717
  return SignatureInfo;
677
718
  })();
678
719
 
@@ -823,24 +864,30 @@ $root.TemporaryExposureKey = (function() {
823
864
  while (reader.pos < end) {
824
865
  var tag = reader.uint32();
825
866
  switch (tag >>> 3) {
826
- case 1:
827
- message.keyData = reader.bytes();
828
- break;
829
- case 2:
830
- message.transmissionRiskLevel = reader.int32();
831
- break;
832
- case 3:
833
- message.rollingStartIntervalNumber = reader.int32();
834
- break;
835
- case 4:
836
- message.rollingPeriod = reader.int32();
837
- break;
838
- case 5:
839
- message.reportType = reader.int32();
840
- break;
841
- case 6:
842
- message.daysSinceOnsetOfSymptoms = reader.sint32();
843
- break;
867
+ case 1: {
868
+ message.keyData = reader.bytes();
869
+ break;
870
+ }
871
+ case 2: {
872
+ message.transmissionRiskLevel = reader.int32();
873
+ break;
874
+ }
875
+ case 3: {
876
+ message.rollingStartIntervalNumber = reader.int32();
877
+ break;
878
+ }
879
+ case 4: {
880
+ message.rollingPeriod = reader.int32();
881
+ break;
882
+ }
883
+ case 5: {
884
+ message.reportType = reader.int32();
885
+ break;
886
+ }
887
+ case 6: {
888
+ message.daysSinceOnsetOfSymptoms = reader.sint32();
889
+ break;
890
+ }
844
891
  default:
845
892
  reader.skipType(tag & 7);
846
893
  break;
@@ -921,7 +968,7 @@ $root.TemporaryExposureKey = (function() {
921
968
  if (object.keyData != null)
922
969
  if (typeof object.keyData === "string")
923
970
  $util.base64.decode(object.keyData, message.keyData = $util.newBuffer($util.base64.length(object.keyData)), 0);
924
- else if (object.keyData.length)
971
+ else if (object.keyData.length >= 0)
925
972
  message.keyData = object.keyData;
926
973
  if (object.transmissionRiskLevel != null)
927
974
  message.transmissionRiskLevel = object.transmissionRiskLevel | 0;
@@ -930,6 +977,12 @@ $root.TemporaryExposureKey = (function() {
930
977
  if (object.rollingPeriod != null)
931
978
  message.rollingPeriod = object.rollingPeriod | 0;
932
979
  switch (object.reportType) {
980
+ default:
981
+ if (typeof object.reportType === "number") {
982
+ message.reportType = object.reportType;
983
+ break;
984
+ }
985
+ break;
933
986
  case "UNKNOWN":
934
987
  case 0:
935
988
  message.reportType = 0;
@@ -996,7 +1049,7 @@ $root.TemporaryExposureKey = (function() {
996
1049
  if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod"))
997
1050
  object.rollingPeriod = message.rollingPeriod;
998
1051
  if (message.reportType != null && message.hasOwnProperty("reportType"))
999
- object.reportType = options.enums === String ? $root.TemporaryExposureKey.ReportType[message.reportType] : message.reportType;
1052
+ object.reportType = options.enums === String ? $root.TemporaryExposureKey.ReportType[message.reportType] === undefined ? message.reportType : $root.TemporaryExposureKey.ReportType[message.reportType] : message.reportType;
1000
1053
  if (message.daysSinceOnsetOfSymptoms != null && message.hasOwnProperty("daysSinceOnsetOfSymptoms"))
1001
1054
  object.daysSinceOnsetOfSymptoms = message.daysSinceOnsetOfSymptoms;
1002
1055
  return object;
@@ -1013,6 +1066,21 @@ $root.TemporaryExposureKey = (function() {
1013
1066
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1014
1067
  };
1015
1068
 
1069
+ /**
1070
+ * Gets the default type url for TemporaryExposureKey
1071
+ * @function getTypeUrl
1072
+ * @memberof TemporaryExposureKey
1073
+ * @static
1074
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1075
+ * @returns {string} The default type url
1076
+ */
1077
+ TemporaryExposureKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1078
+ if (typeUrlPrefix === undefined) {
1079
+ typeUrlPrefix = "type.googleapis.com";
1080
+ }
1081
+ return typeUrlPrefix + "/TemporaryExposureKey";
1082
+ };
1083
+
1016
1084
  /**
1017
1085
  * ReportType enum.
1018
1086
  * @name TemporaryExposureKey.ReportType
@@ -1132,11 +1200,12 @@ $root.TEKSignatureList = (function() {
1132
1200
  while (reader.pos < end) {
1133
1201
  var tag = reader.uint32();
1134
1202
  switch (tag >>> 3) {
1135
- case 1:
1136
- if (!(message.signatures && message.signatures.length))
1137
- message.signatures = [];
1138
- message.signatures.push($root.TEKSignature.decode(reader, reader.uint32()));
1139
- break;
1203
+ case 1: {
1204
+ if (!(message.signatures && message.signatures.length))
1205
+ message.signatures = [];
1206
+ message.signatures.push($root.TEKSignature.decode(reader, reader.uint32()));
1207
+ break;
1208
+ }
1140
1209
  default:
1141
1210
  reader.skipType(tag & 7);
1142
1211
  break;
@@ -1243,6 +1312,21 @@ $root.TEKSignatureList = (function() {
1243
1312
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1244
1313
  };
1245
1314
 
1315
+ /**
1316
+ * Gets the default type url for TEKSignatureList
1317
+ * @function getTypeUrl
1318
+ * @memberof TEKSignatureList
1319
+ * @static
1320
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1321
+ * @returns {string} The default type url
1322
+ */
1323
+ TEKSignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1324
+ if (typeUrlPrefix === undefined) {
1325
+ typeUrlPrefix = "type.googleapis.com";
1326
+ }
1327
+ return typeUrlPrefix + "/TEKSignatureList";
1328
+ };
1329
+
1246
1330
  return TEKSignatureList;
1247
1331
  })();
1248
1332
 
@@ -1371,18 +1455,22 @@ $root.TEKSignature = (function() {
1371
1455
  while (reader.pos < end) {
1372
1456
  var tag = reader.uint32();
1373
1457
  switch (tag >>> 3) {
1374
- case 1:
1375
- message.signatureInfo = $root.SignatureInfo.decode(reader, reader.uint32());
1376
- break;
1377
- case 2:
1378
- message.batchNum = reader.int32();
1379
- break;
1380
- case 3:
1381
- message.batchSize = reader.int32();
1382
- break;
1383
- case 4:
1384
- message.signature = reader.bytes();
1385
- break;
1458
+ case 1: {
1459
+ message.signatureInfo = $root.SignatureInfo.decode(reader, reader.uint32());
1460
+ break;
1461
+ }
1462
+ case 2: {
1463
+ message.batchNum = reader.int32();
1464
+ break;
1465
+ }
1466
+ case 3: {
1467
+ message.batchSize = reader.int32();
1468
+ break;
1469
+ }
1470
+ case 4: {
1471
+ message.signature = reader.bytes();
1472
+ break;
1473
+ }
1386
1474
  default:
1387
1475
  reader.skipType(tag & 7);
1388
1476
  break;
@@ -1459,7 +1547,7 @@ $root.TEKSignature = (function() {
1459
1547
  if (object.signature != null)
1460
1548
  if (typeof object.signature === "string")
1461
1549
  $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
1462
- else if (object.signature.length)
1550
+ else if (object.signature.length >= 0)
1463
1551
  message.signature = object.signature;
1464
1552
  return message;
1465
1553
  };
@@ -1511,6 +1599,21 @@ $root.TEKSignature = (function() {
1511
1599
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1512
1600
  };
1513
1601
 
1602
+ /**
1603
+ * Gets the default type url for TEKSignature
1604
+ * @function getTypeUrl
1605
+ * @memberof TEKSignature
1606
+ * @static
1607
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1608
+ * @returns {string} The default type url
1609
+ */
1610
+ TEKSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1611
+ if (typeUrlPrefix === undefined) {
1612
+ typeUrlPrefix = "type.googleapis.com";
1613
+ }
1614
+ return typeUrlPrefix + "/TEKSignature";
1615
+ };
1616
+
1514
1617
  return TEKSignature;
1515
1618
  })();
1516
1619
 
package/CHANGELOG.md DELETED
@@ -1,27 +0,0 @@
1
- # [1.2.0](https://github.com/ffflorian/exposure-keys/compare/v1.1.0...v1.2.0) (2020-07-01)
2
-
3
-
4
- ### Features
5
-
6
- * Add riskCount ([afd3d10](https://github.com/ffflorian/exposure-keys/commit/afd3d10))
7
-
8
- # [1.1.0](https://github.com/ffflorian/exposure-keys/compare/v1.0.1...v1.1.0) (2020-07-01)
9
-
10
-
11
- ### Features
12
-
13
- * Check if loaded file is a zip file ([b25ea9f](https://github.com/ffflorian/exposure-keys/commit/b25ea9f))
14
-
15
- ## [1.0.1](https://github.com/ffflorian/exposure-keys/compare/v1.0.0...v1.0.1) (2020-07-01)
16
-
17
-
18
- ### Bug Fixes
19
-
20
- * Publish package ([786aebc](https://github.com/ffflorian/exposure-keys/commit/786aebc))
21
-
22
- # 1.0.0 (2020-07-01)
23
-
24
-
25
- ### Features
26
-
27
- * Initial version ([1a23380](https://github.com/ffflorian/exposure-keys/commit/1a23380))