protobuf-platform 1.2.758 → 1.2.760

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.758",
3
+ "version": "1.2.760",
4
4
  "description": "Protobuf structures",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+ const assert = require('node:assert/strict');
3
+ const { game, gRPC: grpc } = require('..');
4
+ const M = game.messages;
5
+ async function main() {
6
+ const identity = new M.HistoricalCasinoIdentity();
7
+ for (const [k,v] of Object.entries({SourceActionId:'9007199254740993',UserId:'7',Action:'bet',TransactionId:'tx',SessionId:'session',RoundId:'round',GameUuid:'uuid',Currency:'USD'})) identity['set'+k](v);
8
+ const req = new M.HistoricalCasinoIdentityRequest();
9
+ req.setCustomer('fixture'); req.setEnvironment('localhost'); req.addIdentities(identity);
10
+ assert.deepEqual(M.HistoricalCasinoIdentityRequest.deserializeBinary(req.serializeBinary()).toObject(), req.toObject());
11
+ const result = new M.HistoricalCasinoIdentityResult();
12
+ result.setIdentity(identity); result.setPrIntId('42'); result.setSlugAbsenceProven(true); result.setCurrencyScale(0); result.setSourceService('game'); result.setProvenance('game_legacy_ordering_v1'); result.setEvidenceSha256('a'.repeat(64));
13
+ const decoded = M.HistoricalCasinoIdentityResult.deserializeBinary(result.serializeBinary());
14
+ assert.equal(decoded.hasPrSlug(),false); assert.equal(decoded.hasCurrencyScale(),true); assert.equal(decoded.getCurrencyScale(),0); assert.equal(decoded.getSlugAbsenceProven(),true);
15
+ result.setPrSlug(''); assert.equal(M.HistoricalCasinoIdentityResult.deserializeBinary(result.serializeBinary()).hasPrSlug(),true);
16
+ const server = new grpc.Server();
17
+ server.addService(game.service.GameService,{getHistoricalCasinoIdentityEvidence:(call,cb)=>{
18
+ assert.deepEqual(call.request.toObject(),req.toObject());
19
+ const response = new M.HistoricalCasinoIdentityResponse(); response.setCustomer('fixture'); response.setEnvironment('localhost'); response.addResults(result); cb(null,response);
20
+ }});
21
+ const port = await new Promise((res,rej)=>server.bindAsync('127.0.0.1:0',grpc.ServerCredentials.createInsecure(),(e,p)=>e?rej(e):res(p)));
22
+ const client = new game.service.GameClient('127.0.0.1:'+port,grpc.credentials.createInsecure());
23
+ try { const response=await new Promise((res,rej)=>client.getHistoricalCasinoIdentityEvidence(req,{deadline:Date.now()+3000},(e,v)=>e?rej(e):res(v))); assert.deepEqual(response.getResultsList()[0].toObject(),result.toObject()); }
24
+ finally {client.close();await new Promise(r=>server.tryShutdown(r));}
25
+ console.log('PASS historical Casino identity wire + real gRPC');
26
+ }
27
+ main().catch(e=>{console.error(e);process.exitCode=1;});
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+ const assert = require('node:assert/strict');
3
+ const { execFileSync } = require('node:child_process');
4
+ const { createRequire } = require('node:module');
5
+ const vm = require('node:vm');
6
+ const path = require('node:path');
7
+ const fresh = require('../user/user_pb');
8
+ const root = path.resolve(__dirname, '..');
9
+ const baseline = process.argv[2] || 'HEAD^';
10
+ const oldCode = execFileSync('git', ['show', `${baseline}:user/user_pb.js`], {
11
+ cwd: root, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024,
12
+ });
13
+ const oldModule = { exports: {} };
14
+ vm.runInNewContext(oldCode, {
15
+ require: createRequire(path.join(root, 'user/user_pb.js')),
16
+ module: oldModule, exports: oldModule.exports,
17
+ });
18
+ const old = oldModule.exports;
19
+ const request = new fresh.FinalizeResponsibleGamingDepositReservationRequest();
20
+ request.setUserId(462);
21
+ request.setOperationKey('fixture-operation');
22
+ request.setOutcome(1);
23
+ request.setAttemptCreatedAt('2026-09-03T20:21:25.000Z');
24
+ request.setRequireDurableRelease(true);
25
+ const decoded = fresh.FinalizeResponsibleGamingDepositReservationRequest.deserializeBinary(request.serializeBinary());
26
+ assert.equal(decoded.getAttemptCreatedAt(), '2026-09-03T20:21:25.000Z');
27
+ assert.equal(decoded.getRequireDurableRelease(), true);
28
+ const legacy = old.FinalizeResponsibleGamingDepositReservationRequest.deserializeBinary(request.serializeBinary());
29
+ assert.equal(legacy.getUserId(), 462);
30
+ assert.equal(legacy.getOperationKey(), 'fixture-operation');
31
+ const oldRequest = new old.FinalizeResponsibleGamingDepositReservationRequest();
32
+ oldRequest.setUserId(465);
33
+ const newReader = fresh.FinalizeResponsibleGamingDepositReservationRequest.deserializeBinary(oldRequest.serializeBinary());
34
+ assert.equal(newReader.getRequireDurableRelease(), false);
35
+ assert.equal(newReader.hasAttemptCreatedAt(), false);
36
+ const response = new fresh.FinalizeResponsibleGamingDepositReservationResponse();
37
+ response.setReleaseResolution('not_required');
38
+ assert.equal(fresh.FinalizeResponsibleGamingDepositReservationResponse.deserializeBinary(response.serializeBinary()).getReleaseResolution(), 'not_required');
39
+ assert.equal(new fresh.FinalizeResponsibleGamingDepositReservationResponse().hasReleaseResolution(), false);
40
+ assert.equal(old.FinalizeResponsibleGamingDepositReservationResponse.deserializeBinary(response.serializeBinary()).getStatus(), 0);
41
+ console.log('RG_DURABLE_RELEASE_WIRE_COMPATIBILITY PASS');
package/user/user.proto CHANGED
@@ -2664,6 +2664,9 @@ message FinalizeResponsibleGamingDepositReservationRequest {
2664
2664
  optional string finalized_at = 6;
2665
2665
  // Canonical decimal minor units. Preferred when set. Field 5 stays for safe legacy amounts.
2666
2666
  optional string actual_amount_minor_exact = 7;
2667
+ // Payment-owned immutable attempt creation time; used only for durable RELEASE proof.
2668
+ optional string attempt_created_at = 8;
2669
+ optional bool require_durable_release = 9;
2667
2670
  }
2668
2671
  message FinalizeResponsibleGamingDepositReservationResponse {
2669
2672
  string reservation_id = 1;
@@ -2676,6 +2679,8 @@ message FinalizeResponsibleGamingDepositReservationResponse {
2676
2679
  optional string policy_id = 8;
2677
2680
  optional string requested_amount_minor_exact = 9;
2678
2681
  optional string committed_amount_minor_exact = 10;
2682
+ // released, already_released or not_required; absent on legacy implementations.
2683
+ optional string release_resolution = 11;
2679
2684
  }
2680
2685
  message ReserveResponsibleGamingLossExposureRequest {
2681
2686
  int32 user_id = 1;
package/user/user_pb.js CHANGED
@@ -107002,7 +107002,9 @@ proto.user.FinalizeResponsibleGamingDepositReservationRequest.toObject = functio
107002
107002
  outcome: jspb.Message.getFieldWithDefault(msg, 4, 0),
107003
107003
  actualAmountMinor: jspb.Message.getFieldWithDefault(msg, 5, 0),
107004
107004
  finalizedAt: jspb.Message.getFieldWithDefault(msg, 6, ""),
107005
- actualAmountMinorExact: jspb.Message.getFieldWithDefault(msg, 7, "")
107005
+ actualAmountMinorExact: jspb.Message.getFieldWithDefault(msg, 7, ""),
107006
+ attemptCreatedAt: jspb.Message.getFieldWithDefault(msg, 8, ""),
107007
+ requireDurableRelease: jspb.Message.getBooleanFieldWithDefault(msg, 9, false)
107006
107008
  };
107007
107009
 
107008
107010
  if (includeInstance) {
@@ -107067,6 +107069,14 @@ proto.user.FinalizeResponsibleGamingDepositReservationRequest.deserializeBinaryF
107067
107069
  var value = /** @type {string} */ (reader.readString());
107068
107070
  msg.setActualAmountMinorExact(value);
107069
107071
  break;
107072
+ case 8:
107073
+ var value = /** @type {string} */ (reader.readString());
107074
+ msg.setAttemptCreatedAt(value);
107075
+ break;
107076
+ case 9:
107077
+ var value = /** @type {boolean} */ (reader.readBool());
107078
+ msg.setRequireDurableRelease(value);
107079
+ break;
107070
107080
  default:
107071
107081
  reader.skipField();
107072
107082
  break;
@@ -107145,6 +107155,20 @@ proto.user.FinalizeResponsibleGamingDepositReservationRequest.serializeBinaryToW
107145
107155
  f
107146
107156
  );
107147
107157
  }
107158
+ f = /** @type {string} */ (jspb.Message.getField(message, 8));
107159
+ if (f != null) {
107160
+ writer.writeString(
107161
+ 8,
107162
+ f
107163
+ );
107164
+ }
107165
+ f = /** @type {boolean} */ (jspb.Message.getField(message, 9));
107166
+ if (f != null) {
107167
+ writer.writeBool(
107168
+ 9,
107169
+ f
107170
+ );
107171
+ }
107148
107172
  };
107149
107173
 
107150
107174
 
@@ -107346,6 +107370,78 @@ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.hasActua
107346
107370
  };
107347
107371
 
107348
107372
 
107373
+ /**
107374
+ * optional string attempt_created_at = 8;
107375
+ * @return {string}
107376
+ */
107377
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.getAttemptCreatedAt = function() {
107378
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
107379
+ };
107380
+
107381
+
107382
+ /**
107383
+ * @param {string} value
107384
+ * @return {!proto.user.FinalizeResponsibleGamingDepositReservationRequest} returns this
107385
+ */
107386
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.setAttemptCreatedAt = function(value) {
107387
+ return jspb.Message.setField(this, 8, value);
107388
+ };
107389
+
107390
+
107391
+ /**
107392
+ * Clears the field making it undefined.
107393
+ * @return {!proto.user.FinalizeResponsibleGamingDepositReservationRequest} returns this
107394
+ */
107395
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.clearAttemptCreatedAt = function() {
107396
+ return jspb.Message.setField(this, 8, undefined);
107397
+ };
107398
+
107399
+
107400
+ /**
107401
+ * Returns whether this field is set.
107402
+ * @return {boolean}
107403
+ */
107404
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.hasAttemptCreatedAt = function() {
107405
+ return jspb.Message.getField(this, 8) != null;
107406
+ };
107407
+
107408
+
107409
+ /**
107410
+ * optional bool require_durable_release = 9;
107411
+ * @return {boolean}
107412
+ */
107413
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.getRequireDurableRelease = function() {
107414
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false));
107415
+ };
107416
+
107417
+
107418
+ /**
107419
+ * @param {boolean} value
107420
+ * @return {!proto.user.FinalizeResponsibleGamingDepositReservationRequest} returns this
107421
+ */
107422
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.setRequireDurableRelease = function(value) {
107423
+ return jspb.Message.setField(this, 9, value);
107424
+ };
107425
+
107426
+
107427
+ /**
107428
+ * Clears the field making it undefined.
107429
+ * @return {!proto.user.FinalizeResponsibleGamingDepositReservationRequest} returns this
107430
+ */
107431
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.clearRequireDurableRelease = function() {
107432
+ return jspb.Message.setField(this, 9, undefined);
107433
+ };
107434
+
107435
+
107436
+ /**
107437
+ * Returns whether this field is set.
107438
+ * @return {boolean}
107439
+ */
107440
+ proto.user.FinalizeResponsibleGamingDepositReservationRequest.prototype.hasRequireDurableRelease = function() {
107441
+ return jspb.Message.getField(this, 9) != null;
107442
+ };
107443
+
107444
+
107349
107445
 
107350
107446
 
107351
107447
 
@@ -107387,7 +107483,8 @@ proto.user.FinalizeResponsibleGamingDepositReservationResponse.toObject = functi
107387
107483
  operationKey: jspb.Message.getFieldWithDefault(msg, 7, ""),
107388
107484
  policyId: jspb.Message.getFieldWithDefault(msg, 8, ""),
107389
107485
  requestedAmountMinorExact: jspb.Message.getFieldWithDefault(msg, 9, ""),
107390
- committedAmountMinorExact: jspb.Message.getFieldWithDefault(msg, 10, "")
107486
+ committedAmountMinorExact: jspb.Message.getFieldWithDefault(msg, 10, ""),
107487
+ releaseResolution: jspb.Message.getFieldWithDefault(msg, 11, "")
107391
107488
  };
107392
107489
 
107393
107490
  if (includeInstance) {
@@ -107464,6 +107561,10 @@ proto.user.FinalizeResponsibleGamingDepositReservationResponse.deserializeBinary
107464
107561
  var value = /** @type {string} */ (reader.readString());
107465
107562
  msg.setCommittedAmountMinorExact(value);
107466
107563
  break;
107564
+ case 11:
107565
+ var value = /** @type {string} */ (reader.readString());
107566
+ msg.setReleaseResolution(value);
107567
+ break;
107467
107568
  default:
107468
107569
  reader.skipField();
107469
107570
  break;
@@ -107563,6 +107664,13 @@ proto.user.FinalizeResponsibleGamingDepositReservationResponse.serializeBinaryTo
107563
107664
  f
107564
107665
  );
107565
107666
  }
107667
+ f = /** @type {string} */ (jspb.Message.getField(message, 11));
107668
+ if (f != null) {
107669
+ writer.writeString(
107670
+ 11,
107671
+ f
107672
+ );
107673
+ }
107566
107674
  };
107567
107675
 
107568
107676
 
@@ -107872,6 +107980,42 @@ proto.user.FinalizeResponsibleGamingDepositReservationResponse.prototype.hasComm
107872
107980
  };
107873
107981
 
107874
107982
 
107983
+ /**
107984
+ * optional string release_resolution = 11;
107985
+ * @return {string}
107986
+ */
107987
+ proto.user.FinalizeResponsibleGamingDepositReservationResponse.prototype.getReleaseResolution = function() {
107988
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, ""));
107989
+ };
107990
+
107991
+
107992
+ /**
107993
+ * @param {string} value
107994
+ * @return {!proto.user.FinalizeResponsibleGamingDepositReservationResponse} returns this
107995
+ */
107996
+ proto.user.FinalizeResponsibleGamingDepositReservationResponse.prototype.setReleaseResolution = function(value) {
107997
+ return jspb.Message.setField(this, 11, value);
107998
+ };
107999
+
108000
+
108001
+ /**
108002
+ * Clears the field making it undefined.
108003
+ * @return {!proto.user.FinalizeResponsibleGamingDepositReservationResponse} returns this
108004
+ */
108005
+ proto.user.FinalizeResponsibleGamingDepositReservationResponse.prototype.clearReleaseResolution = function() {
108006
+ return jspb.Message.setField(this, 11, undefined);
108007
+ };
108008
+
108009
+
108010
+ /**
108011
+ * Returns whether this field is set.
108012
+ * @return {boolean}
108013
+ */
108014
+ proto.user.FinalizeResponsibleGamingDepositReservationResponse.prototype.hasReleaseResolution = function() {
108015
+ return jspb.Message.getField(this, 11) != null;
108016
+ };
108017
+
108018
+
107875
108019
 
107876
108020
 
107877
108021