protobuf-platform 1.2.720 → 1.2.721

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobuf-platform",
3
- "version": "1.2.720",
3
+ "version": "1.2.721",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+ const assert = require('node:assert/strict');
3
+ const M = require('../user/user_pb');
4
+ const T = M.PrecisionRgAdmissionResponse;
5
+ const absent = T.deserializeBinary(new T().serializeBinary());
6
+ assert.equal(absent.hasCanonicalReceiptJson(), false);
7
+ assert.equal(absent.getCanonicalReceiptJson(), '');
8
+ const response = new T();
9
+ response.setCurrentGeneration('9007199254740993');
10
+ response.setAdmissionReceiptId('initial-receipt');
11
+ response.setCanonicalReceiptJson('');
12
+ assert.equal(T.deserializeBinary(response.serializeBinary()).hasCanonicalReceiptJson(), true);
13
+ const packet = { protocolVersion: 2, version: 1, state: 'RESERVED', decision: { allowed: true, evaluatedAt: '2026-11-03T00:00:00.000Z', details: { time_deltas_seconds: {} } } };
14
+ const exact = JSON.stringify(packet);
15
+ response.setCanonicalReceiptJson(exact);
16
+ const decoded = T.deserializeBinary(response.serializeBinary());
17
+ assert.equal(decoded.getCanonicalReceiptJson(), exact);
18
+ assert.equal(decoded.getCurrentGeneration(), '9007199254740993');
19
+ assert.equal(decoded.getAdmissionReceiptId(), 'initial-receipt');
20
+ decoded.clearCanonicalReceiptJson();
21
+ assert.equal(T.deserializeBinary(decoded.serializeBinary()).hasCanonicalReceiptJson(), false);
22
+ console.log('PASS: canonical RG receipt optional presence and lossless JSON wire value; existing fields unchanged');
23
+ const fs = require('node:fs');
24
+ const vm = require('node:vm');
25
+ const { execFileSync } = require('node:child_process');
26
+ const baseline = '7e5f089e5a223061058ad607b7809b89bd3f1282';
27
+ const readOld = (file) => execFileSync('git', ['show', `${baseline}:${file}`], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
28
+ const source = fs.readFileSync(require('node:path').join(__dirname, '../user/user.proto'), 'utf8');
29
+ assert.equal(source.replace(' // Exact persisted initial SQL-v2 receipt; absent when no initial receipt exists.\n optional string canonical_receipt_json = 9;\n', ''), readOld('user/user.proto'));
30
+ const sandbox = { exports: {}, require, console };
31
+ vm.runInNewContext(readOld('user/user_pb.js'), sandbox);
32
+ const Old = sandbox.exports.PrecisionRgAdmissionResponse;
33
+ const oldReadsNew = Old.deserializeBinary(response.serializeBinary());
34
+ assert.equal(oldReadsNew.getAdmissionReceiptId(), 'initial-receipt');
35
+ assert.equal(oldReadsNew.getCurrentGeneration(), '9007199254740993');
36
+ assert.equal(T.deserializeBinary(oldReadsNew.serializeBinary()).hasCanonicalReceiptJson(), false);
37
+ assert.equal(T.deserializeBinary(new Old().serializeBinary()).hasCanonicalReceiptJson(), false);
38
+ console.log('PASS: previous released reader interoperability; old reserialization loses optional tag as expected; only approved source addition');
package/user/user.proto CHANGED
@@ -2691,6 +2691,8 @@ message PrecisionRgAdmissionResponse {
2691
2691
  string release_receipt_id = 6;
2692
2692
  string commit_receipt_id = 7;
2693
2693
  EvaluateResponsibleGamingDecisionResponse decision = 8;
2694
+ // Exact persisted initial SQL-v2 receipt; absent when no initial receipt exists.
2695
+ optional string canonical_receipt_json = 9;
2694
2696
  }
2695
2697
 
2696
2698
  message ImportPlayerInvitationsRequest {
package/user/user_pb.js CHANGED
@@ -107763,7 +107763,8 @@ proto.user.PrecisionRgAdmissionResponse.toObject = function(includeInstance, msg
107763
107763
  admissionReceiptId: jspb.Message.getFieldWithDefault(msg, 5, ""),
107764
107764
  releaseReceiptId: jspb.Message.getFieldWithDefault(msg, 6, ""),
107765
107765
  commitReceiptId: jspb.Message.getFieldWithDefault(msg, 7, ""),
107766
- decision: (f = msg.getDecision()) && proto.user.EvaluateResponsibleGamingDecisionResponse.toObject(includeInstance, f)
107766
+ decision: (f = msg.getDecision()) && proto.user.EvaluateResponsibleGamingDecisionResponse.toObject(includeInstance, f),
107767
+ canonicalReceiptJson: jspb.Message.getFieldWithDefault(msg, 9, "")
107767
107768
  };
107768
107769
 
107769
107770
  if (includeInstance) {
@@ -107834,6 +107835,10 @@ proto.user.PrecisionRgAdmissionResponse.deserializeBinaryFromReader = function(m
107834
107835
  reader.readMessage(value,proto.user.EvaluateResponsibleGamingDecisionResponse.deserializeBinaryFromReader);
107835
107836
  msg.setDecision(value);
107836
107837
  break;
107838
+ case 9:
107839
+ var value = /** @type {string} */ (reader.readString());
107840
+ msg.setCanonicalReceiptJson(value);
107841
+ break;
107837
107842
  default:
107838
107843
  reader.skipField();
107839
107844
  break;
@@ -107921,6 +107926,13 @@ proto.user.PrecisionRgAdmissionResponse.serializeBinaryToWriter = function(messa
107921
107926
  proto.user.EvaluateResponsibleGamingDecisionResponse.serializeBinaryToWriter
107922
107927
  );
107923
107928
  }
107929
+ f = /** @type {string} */ (jspb.Message.getField(message, 9));
107930
+ if (f != null) {
107931
+ writer.writeString(
107932
+ 9,
107933
+ f
107934
+ );
107935
+ }
107924
107936
  };
107925
107937
 
107926
107938
 
@@ -108106,6 +108118,42 @@ proto.user.PrecisionRgAdmissionResponse.prototype.hasDecision = function() {
108106
108118
  };
108107
108119
 
108108
108120
 
108121
+ /**
108122
+ * optional string canonical_receipt_json = 9;
108123
+ * @return {string}
108124
+ */
108125
+ proto.user.PrecisionRgAdmissionResponse.prototype.getCanonicalReceiptJson = function() {
108126
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
108127
+ };
108128
+
108129
+
108130
+ /**
108131
+ * @param {string} value
108132
+ * @return {!proto.user.PrecisionRgAdmissionResponse} returns this
108133
+ */
108134
+ proto.user.PrecisionRgAdmissionResponse.prototype.setCanonicalReceiptJson = function(value) {
108135
+ return jspb.Message.setField(this, 9, value);
108136
+ };
108137
+
108138
+
108139
+ /**
108140
+ * Clears the field making it undefined.
108141
+ * @return {!proto.user.PrecisionRgAdmissionResponse} returns this
108142
+ */
108143
+ proto.user.PrecisionRgAdmissionResponse.prototype.clearCanonicalReceiptJson = function() {
108144
+ return jspb.Message.setField(this, 9, undefined);
108145
+ };
108146
+
108147
+
108148
+ /**
108149
+ * Returns whether this field is set.
108150
+ * @return {boolean}
108151
+ */
108152
+ proto.user.PrecisionRgAdmissionResponse.prototype.hasCanonicalReceiptJson = function() {
108153
+ return jspb.Message.getField(this, 9) != null;
108154
+ };
108155
+
108156
+
108109
108157
 
108110
108158
 
108111
108159