@jskit-ai/google-rewarded-core 0.1.83 → 0.1.84
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.descriptor.mjs +9 -9
- package/package.json +1 -1
- package/src/server/providerConfigs/repository.js +1 -4
- package/src/server/rules/repository.js +1 -4
- package/src/server/service.js +7 -6
- package/src/server/unlockReceipts/repository.js +1 -4
- package/src/server/watchSessions/repository.js +1 -4
- package/test/service.test.js +7 -0
package/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/google-rewarded-core",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.84",
|
|
5
5
|
kind: "runtime",
|
|
6
6
|
description: "Google rewarded workflow runtime plus internal CRUD providers for rules, provider configs, watch sessions, and unlock receipts.",
|
|
7
7
|
dependsOn: [
|
|
@@ -128,14 +128,14 @@ export default Object.freeze({
|
|
|
128
128
|
mutations: {
|
|
129
129
|
dependencies: {
|
|
130
130
|
runtime: {
|
|
131
|
-
"@jskit-ai/auth-core": "0.1.
|
|
132
|
-
"@jskit-ai/crud-core": "0.1.
|
|
133
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
134
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
135
|
-
"@jskit-ai/json-rest-api-core": "0.1.
|
|
136
|
-
"@jskit-ai/kernel": "0.1.
|
|
137
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
138
|
-
"@jskit-ai/workspaces-core": "0.1.
|
|
131
|
+
"@jskit-ai/auth-core": "0.1.146",
|
|
132
|
+
"@jskit-ai/crud-core": "0.1.158",
|
|
133
|
+
"@jskit-ai/database-runtime": "0.1.147",
|
|
134
|
+
"@jskit-ai/http-runtime": "0.1.146",
|
|
135
|
+
"@jskit-ai/json-rest-api-core": "0.1.92",
|
|
136
|
+
"@jskit-ai/kernel": "0.1.147",
|
|
137
|
+
"@jskit-ai/resource-crud-core": "0.1.90",
|
|
138
|
+
"@jskit-ai/workspaces-core": "0.1.126"
|
|
139
139
|
},
|
|
140
140
|
dev: {}
|
|
141
141
|
},
|
package/package.json
CHANGED
package/src/server/service.js
CHANGED
|
@@ -393,7 +393,7 @@ function createService({
|
|
|
393
393
|
gateKey: state.gateKey,
|
|
394
394
|
providerConfigId: state.providerConfig?.id || null,
|
|
395
395
|
status: "started",
|
|
396
|
-
startedAt: new Date()
|
|
396
|
+
startedAt: new Date().toISOString()
|
|
397
397
|
},
|
|
398
398
|
{
|
|
399
399
|
context: options?.context || null,
|
|
@@ -456,14 +456,15 @@ function createService({
|
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
const now = new Date();
|
|
459
|
+
const nowIso = now.toISOString();
|
|
459
460
|
const unlockedUntil = addMinutes(now, Number(ruleRecord.unlockMinutes || 0));
|
|
460
461
|
|
|
461
462
|
const updatedSession = normalizeRecord(await googleRewardedWatchSessionsRepository.patchDocumentById(
|
|
462
463
|
sessionId,
|
|
463
464
|
{
|
|
464
465
|
status: "rewarded",
|
|
465
|
-
rewardedAt:
|
|
466
|
-
completedAt:
|
|
466
|
+
rewardedAt: nowIso,
|
|
467
|
+
completedAt: nowIso
|
|
467
468
|
},
|
|
468
469
|
{
|
|
469
470
|
context: options?.context || null,
|
|
@@ -476,8 +477,8 @@ function createService({
|
|
|
476
477
|
gateKey: normalizeGateKey(sessionRecord.gateKey),
|
|
477
478
|
providerConfigId: sessionRecord.providerConfigId || null,
|
|
478
479
|
watchSessionId: sessionId,
|
|
479
|
-
grantedAt:
|
|
480
|
-
unlockedUntil
|
|
480
|
+
grantedAt: nowIso,
|
|
481
|
+
unlockedUntil: unlockedUntil.toISOString()
|
|
481
482
|
},
|
|
482
483
|
{
|
|
483
484
|
context: options?.context || null,
|
|
@@ -525,7 +526,7 @@ function createService({
|
|
|
525
526
|
sessionId,
|
|
526
527
|
{
|
|
527
528
|
status: "closed",
|
|
528
|
-
closedAt: new Date()
|
|
529
|
+
closedAt: new Date().toISOString()
|
|
529
530
|
},
|
|
530
531
|
{
|
|
531
532
|
context: options?.context || null,
|
package/test/service.test.js
CHANGED
|
@@ -312,4 +312,11 @@ test("grantReward patches the watch session and creates an unlock receipt", asyn
|
|
|
312
312
|
assert.equal(watchSessionsRepository.calls.patches.length, 1);
|
|
313
313
|
assert.equal(watchSessionsRepository.calls.patches[0].recordId, "41");
|
|
314
314
|
assert.equal(watchSessionsRepository.calls.patches[0].patch.status, "rewarded");
|
|
315
|
+
assert.equal(typeof watchSessionsRepository.calls.patches[0].patch.rewardedAt, "string");
|
|
316
|
+
assert.equal(
|
|
317
|
+
watchSessionsRepository.calls.patches[0].patch.completedAt,
|
|
318
|
+
watchSessionsRepository.calls.patches[0].patch.rewardedAt
|
|
319
|
+
);
|
|
320
|
+
assert.equal(createdReceiptPayloads[0].grantedAt, watchSessionsRepository.calls.patches[0].patch.rewardedAt);
|
|
321
|
+
assert.equal(typeof createdReceiptPayloads[0].unlockedUntil, "string");
|
|
315
322
|
});
|