@timardex/cluemart-shared 1.5.497 → 1.5.499
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/dist/{chunk-D3WH67C5.mjs → chunk-6WV7CECU.mjs} +2 -2
- package/dist/{chunk-WHHVPICK.mjs → chunk-EJSVR77W.mjs} +11 -9
- package/dist/chunk-EJSVR77W.mjs.map +1 -0
- package/dist/{chunk-O4ILKWFI.mjs → chunk-RO2IWCW2.mjs} +30 -20
- package/dist/chunk-RO2IWCW2.mjs.map +1 -0
- package/dist/formFields/index.cjs +96 -2
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +3 -3
- package/dist/{game-C6zLvmHU.d.mts → game-BR9xpQkt.d.mts} +19 -19
- package/dist/{game-B-YC4Am7.d.ts → game-Dn5SH8_0.d.ts} +19 -19
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/hooks/index.cjs +96 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.mjs +3 -3
- package/dist/index.cjs +38 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.mjs +38 -26
- package/dist/index.mjs.map +1 -1
- package/dist/{post-DFTmI0uz.d.mts → post-BBYcN5xv.d.mts} +1 -1
- package/dist/{post-CNm_rxZm.d.ts → post-CWZFxlP7.d.ts} +1 -1
- package/dist/types/index.cjs +29 -19
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs +38 -26
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-O4ILKWFI.mjs.map +0 -1
- package/dist/chunk-WHHVPICK.mjs.map +0 -1
- /package/dist/{chunk-D3WH67C5.mjs.map → chunk-6WV7CECU.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -961,61 +961,61 @@ interface PartnerType extends BaseResourceType {
|
|
|
961
961
|
|
|
962
962
|
declare const gameScreenIdentifierList: readonly [{
|
|
963
963
|
readonly clue: "Where your actions turn into a timeline.";
|
|
964
|
-
readonly id: "activities";
|
|
964
|
+
readonly id: "/profile/activities";
|
|
965
965
|
}, {
|
|
966
966
|
readonly clue: "Where conversations happen without speaking.";
|
|
967
|
-
readonly id: "chat";
|
|
967
|
+
readonly id: "/profile/chat";
|
|
968
968
|
}, {
|
|
969
969
|
readonly clue: "The place to redefine who you are.";
|
|
970
|
-
readonly id: "edit-profile";
|
|
970
|
+
readonly id: "/profile/edit-profile";
|
|
971
971
|
}, {
|
|
972
972
|
readonly clue: "A single moment worth showing up for.";
|
|
973
|
-
readonly id:
|
|
973
|
+
readonly id: RegExp;
|
|
974
974
|
}, {
|
|
975
975
|
readonly clue: "What’s happening around you, right now.";
|
|
976
|
-
readonly id: "events-near-me";
|
|
976
|
+
readonly id: "/events/events-near-me";
|
|
977
977
|
}, {
|
|
978
978
|
readonly clue: "A collection of things worth attending.";
|
|
979
|
-
readonly id: "events";
|
|
979
|
+
readonly id: "/events";
|
|
980
980
|
}, {
|
|
981
981
|
readonly clue: "What’s happening in a wider area—not just nearby.";
|
|
982
|
-
readonly id:
|
|
982
|
+
readonly id: RegExp;
|
|
983
983
|
}, {
|
|
984
984
|
readonly clue: "Where you go to find something specific.";
|
|
985
|
-
readonly id: "events/search";
|
|
985
|
+
readonly id: "/events/search";
|
|
986
986
|
}, {
|
|
987
987
|
readonly clue: "Where fun becomes a challenge.";
|
|
988
|
-
readonly id: "games";
|
|
988
|
+
readonly id: "/games";
|
|
989
989
|
}, {
|
|
990
990
|
readonly clue: "Your starting point for everything.";
|
|
991
|
-
readonly id: "
|
|
991
|
+
readonly id: "/";
|
|
992
992
|
}, {
|
|
993
993
|
readonly clue: "Where the app taps you on the shoulder.";
|
|
994
|
-
readonly id: "notifications";
|
|
994
|
+
readonly id: "/notifications";
|
|
995
995
|
}, {
|
|
996
996
|
readonly clue: "Where you fine-tune your experience.";
|
|
997
|
-
readonly id: "options";
|
|
997
|
+
readonly id: "/options";
|
|
998
998
|
}, {
|
|
999
999
|
readonly clue: "A single collaborator in the ecosystem.";
|
|
1000
|
-
readonly id:
|
|
1000
|
+
readonly id: RegExp;
|
|
1001
1001
|
}, {
|
|
1002
1002
|
readonly clue: "The network behind the scenes.";
|
|
1003
|
-
readonly id: "partners";
|
|
1003
|
+
readonly id: "/partners";
|
|
1004
1004
|
}, {
|
|
1005
1005
|
readonly clue: "Where you share something with everyone.";
|
|
1006
|
-
readonly id:
|
|
1006
|
+
readonly id: RegExp;
|
|
1007
1007
|
}, {
|
|
1008
1008
|
readonly clue: "Your identity, on display.";
|
|
1009
|
-
readonly id: "profile";
|
|
1009
|
+
readonly id: "/profile";
|
|
1010
1010
|
}, {
|
|
1011
1011
|
readonly clue: "One provider offering something valuable.";
|
|
1012
|
-
readonly id:
|
|
1012
|
+
readonly id: RegExp;
|
|
1013
1013
|
}, {
|
|
1014
1014
|
readonly clue: "A marketplace of providers.";
|
|
1015
|
-
readonly id: "vendors";
|
|
1015
|
+
readonly id: "/vendors";
|
|
1016
1016
|
}, {
|
|
1017
1017
|
readonly clue: "People who stopped by to see you.";
|
|
1018
|
-
readonly id: "visitors";
|
|
1018
|
+
readonly id: "/visitors";
|
|
1019
1019
|
}];
|
|
1020
1020
|
type GamePlacement = (typeof gameScreenIdentifierList)[number]["id"];
|
|
1021
1021
|
type GamePlacementClue = (typeof gameScreenIdentifierList)[number]["clue"];
|
package/dist/index.d.ts
CHANGED
|
@@ -961,61 +961,61 @@ interface PartnerType extends BaseResourceType {
|
|
|
961
961
|
|
|
962
962
|
declare const gameScreenIdentifierList: readonly [{
|
|
963
963
|
readonly clue: "Where your actions turn into a timeline.";
|
|
964
|
-
readonly id: "activities";
|
|
964
|
+
readonly id: "/profile/activities";
|
|
965
965
|
}, {
|
|
966
966
|
readonly clue: "Where conversations happen without speaking.";
|
|
967
|
-
readonly id: "chat";
|
|
967
|
+
readonly id: "/profile/chat";
|
|
968
968
|
}, {
|
|
969
969
|
readonly clue: "The place to redefine who you are.";
|
|
970
|
-
readonly id: "edit-profile";
|
|
970
|
+
readonly id: "/profile/edit-profile";
|
|
971
971
|
}, {
|
|
972
972
|
readonly clue: "A single moment worth showing up for.";
|
|
973
|
-
readonly id:
|
|
973
|
+
readonly id: RegExp;
|
|
974
974
|
}, {
|
|
975
975
|
readonly clue: "What’s happening around you, right now.";
|
|
976
|
-
readonly id: "events-near-me";
|
|
976
|
+
readonly id: "/events/events-near-me";
|
|
977
977
|
}, {
|
|
978
978
|
readonly clue: "A collection of things worth attending.";
|
|
979
|
-
readonly id: "events";
|
|
979
|
+
readonly id: "/events";
|
|
980
980
|
}, {
|
|
981
981
|
readonly clue: "What’s happening in a wider area—not just nearby.";
|
|
982
|
-
readonly id:
|
|
982
|
+
readonly id: RegExp;
|
|
983
983
|
}, {
|
|
984
984
|
readonly clue: "Where you go to find something specific.";
|
|
985
|
-
readonly id: "events/search";
|
|
985
|
+
readonly id: "/events/search";
|
|
986
986
|
}, {
|
|
987
987
|
readonly clue: "Where fun becomes a challenge.";
|
|
988
|
-
readonly id: "games";
|
|
988
|
+
readonly id: "/games";
|
|
989
989
|
}, {
|
|
990
990
|
readonly clue: "Your starting point for everything.";
|
|
991
|
-
readonly id: "
|
|
991
|
+
readonly id: "/";
|
|
992
992
|
}, {
|
|
993
993
|
readonly clue: "Where the app taps you on the shoulder.";
|
|
994
|
-
readonly id: "notifications";
|
|
994
|
+
readonly id: "/notifications";
|
|
995
995
|
}, {
|
|
996
996
|
readonly clue: "Where you fine-tune your experience.";
|
|
997
|
-
readonly id: "options";
|
|
997
|
+
readonly id: "/options";
|
|
998
998
|
}, {
|
|
999
999
|
readonly clue: "A single collaborator in the ecosystem.";
|
|
1000
|
-
readonly id:
|
|
1000
|
+
readonly id: RegExp;
|
|
1001
1001
|
}, {
|
|
1002
1002
|
readonly clue: "The network behind the scenes.";
|
|
1003
|
-
readonly id: "partners";
|
|
1003
|
+
readonly id: "/partners";
|
|
1004
1004
|
}, {
|
|
1005
1005
|
readonly clue: "Where you share something with everyone.";
|
|
1006
|
-
readonly id:
|
|
1006
|
+
readonly id: RegExp;
|
|
1007
1007
|
}, {
|
|
1008
1008
|
readonly clue: "Your identity, on display.";
|
|
1009
|
-
readonly id: "profile";
|
|
1009
|
+
readonly id: "/profile";
|
|
1010
1010
|
}, {
|
|
1011
1011
|
readonly clue: "One provider offering something valuable.";
|
|
1012
|
-
readonly id:
|
|
1012
|
+
readonly id: RegExp;
|
|
1013
1013
|
}, {
|
|
1014
1014
|
readonly clue: "A marketplace of providers.";
|
|
1015
|
-
readonly id: "vendors";
|
|
1015
|
+
readonly id: "/vendors";
|
|
1016
1016
|
}, {
|
|
1017
1017
|
readonly clue: "People who stopped by to see you.";
|
|
1018
|
-
readonly id: "visitors";
|
|
1018
|
+
readonly id: "/visitors";
|
|
1019
1019
|
}];
|
|
1020
1020
|
type GamePlacement = (typeof gameScreenIdentifierList)[number]["id"];
|
|
1021
1021
|
type GamePlacementClue = (typeof gameScreenIdentifierList)[number]["clue"];
|
package/dist/index.mjs
CHANGED
|
@@ -435,84 +435,95 @@ var priceUnits = [
|
|
|
435
435
|
|
|
436
436
|
// src/utils/dailyClueGame.ts
|
|
437
437
|
import dayjs from "dayjs";
|
|
438
|
+
import utc from "dayjs/plugin/utc";
|
|
438
439
|
|
|
439
440
|
// src/types/game.ts
|
|
441
|
+
var createRouteMatcher = (base, type) => {
|
|
442
|
+
switch (type) {
|
|
443
|
+
case "mongoId":
|
|
444
|
+
return new RegExp(`^\\/${base}\\/([a-f0-9]{24})$`);
|
|
445
|
+
case "slug":
|
|
446
|
+
return new RegExp(`^\\/${base}\\/[^/]+$`);
|
|
447
|
+
default:
|
|
448
|
+
return new RegExp(`^\\/${base}$`);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
440
451
|
var gameScreenIdentifierList = [
|
|
441
452
|
{
|
|
442
453
|
clue: "Where your actions turn into a timeline.",
|
|
443
|
-
id: "activities"
|
|
454
|
+
id: "/profile/activities"
|
|
444
455
|
},
|
|
445
456
|
{
|
|
446
457
|
clue: "Where conversations happen without speaking.",
|
|
447
|
-
id: "chat"
|
|
458
|
+
id: "/profile/chat"
|
|
448
459
|
},
|
|
449
460
|
{
|
|
450
461
|
clue: "The place to redefine who you are.",
|
|
451
|
-
id: "edit-profile"
|
|
462
|
+
id: "/profile/edit-profile"
|
|
452
463
|
},
|
|
453
464
|
{
|
|
454
465
|
clue: "A single moment worth showing up for.",
|
|
455
|
-
id: "
|
|
466
|
+
id: createRouteMatcher("events", "mongoId")
|
|
456
467
|
},
|
|
457
468
|
{
|
|
458
469
|
clue: "What\u2019s happening around you, right now.",
|
|
459
|
-
id: "events-near-me"
|
|
470
|
+
id: "/events/events-near-me"
|
|
460
471
|
},
|
|
461
472
|
{
|
|
462
473
|
clue: "A collection of things worth attending.",
|
|
463
|
-
id: "events"
|
|
474
|
+
id: "/events"
|
|
464
475
|
},
|
|
465
476
|
{
|
|
466
477
|
clue: "What\u2019s happening in a wider area\u2014not just nearby.",
|
|
467
|
-
id: "events/region"
|
|
478
|
+
id: createRouteMatcher("events/region", "slug")
|
|
468
479
|
},
|
|
469
480
|
{
|
|
470
481
|
clue: "Where you go to find something specific.",
|
|
471
|
-
id: "events/search"
|
|
482
|
+
id: "/events/search"
|
|
472
483
|
},
|
|
473
484
|
{
|
|
474
485
|
clue: "Where fun becomes a challenge.",
|
|
475
|
-
id: "games"
|
|
486
|
+
id: "/games"
|
|
476
487
|
},
|
|
477
488
|
{
|
|
478
489
|
clue: "Your starting point for everything.",
|
|
479
|
-
id: "
|
|
490
|
+
id: "/"
|
|
480
491
|
},
|
|
481
492
|
{
|
|
482
493
|
clue: "Where the app taps you on the shoulder.",
|
|
483
|
-
id: "notifications"
|
|
494
|
+
id: "/notifications"
|
|
484
495
|
},
|
|
485
496
|
{
|
|
486
497
|
clue: "Where you fine-tune your experience.",
|
|
487
|
-
id: "options"
|
|
498
|
+
id: "/options"
|
|
488
499
|
},
|
|
489
500
|
{
|
|
490
501
|
clue: "A single collaborator in the ecosystem.",
|
|
491
|
-
id: "
|
|
502
|
+
id: createRouteMatcher("partners", "mongoId")
|
|
492
503
|
},
|
|
493
504
|
{
|
|
494
505
|
clue: "The network behind the scenes.",
|
|
495
|
-
id: "partners"
|
|
506
|
+
id: "/partners"
|
|
496
507
|
},
|
|
497
508
|
{
|
|
498
509
|
clue: "Where you share something with everyone.",
|
|
499
|
-
id: "
|
|
510
|
+
id: createRouteMatcher("visitors/posts", "mongoId")
|
|
500
511
|
},
|
|
501
512
|
{
|
|
502
513
|
clue: "Your identity, on display.",
|
|
503
|
-
id: "profile"
|
|
514
|
+
id: "/profile"
|
|
504
515
|
},
|
|
505
516
|
{
|
|
506
517
|
clue: "One provider offering something valuable.",
|
|
507
|
-
id: "
|
|
518
|
+
id: createRouteMatcher("vendors", "mongoId")
|
|
508
519
|
},
|
|
509
520
|
{
|
|
510
521
|
clue: "A marketplace of providers.",
|
|
511
|
-
id: "vendors"
|
|
522
|
+
id: "/vendors"
|
|
512
523
|
},
|
|
513
524
|
{
|
|
514
525
|
clue: "People who stopped by to see you.",
|
|
515
|
-
id: "visitors"
|
|
526
|
+
id: "/visitors"
|
|
516
527
|
}
|
|
517
528
|
];
|
|
518
529
|
var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
|
|
@@ -530,6 +541,7 @@ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
|
|
|
530
541
|
})(EnumGameStatus || {});
|
|
531
542
|
|
|
532
543
|
// src/utils/dailyClueGame.ts
|
|
544
|
+
dayjs.extend(utc);
|
|
533
545
|
function createSeededRng(seed) {
|
|
534
546
|
let t = seed >>> 0;
|
|
535
547
|
return function random() {
|
|
@@ -558,18 +570,18 @@ function seededShuffle(array6, seed) {
|
|
|
558
570
|
return result;
|
|
559
571
|
}
|
|
560
572
|
function getDayIndex(startDate) {
|
|
561
|
-
return dayjs().startOf("day").diff(dayjs(startDate).startOf("day"), "day");
|
|
573
|
+
return dayjs().utc().startOf("day").diff(dayjs(startDate).utc().startOf("day"), "day");
|
|
562
574
|
}
|
|
563
575
|
function computeDailyClueState(dailyClue) {
|
|
564
576
|
const { startDate, endDate } = dailyClue.gameFields.gameDate;
|
|
565
577
|
const { shuffled, collected } = dailyClue.letterInfo;
|
|
578
|
+
const today = dayjs().utc().startOf("day");
|
|
579
|
+
const start = dayjs(startDate).utc().startOf("day");
|
|
580
|
+
const end = dayjs(endDate).utc().startOf("day");
|
|
566
581
|
const shuffledPlacements = seededShuffle(
|
|
567
582
|
gameScreenIdentifierList,
|
|
568
|
-
|
|
583
|
+
start.toISOString()
|
|
569
584
|
);
|
|
570
|
-
const today = dayjs().startOf("day");
|
|
571
|
-
const start = dayjs(startDate).startOf("day");
|
|
572
|
-
const end = dayjs(endDate).startOf("day");
|
|
573
585
|
if (today.isBefore(start)) {
|
|
574
586
|
return null;
|
|
575
587
|
}
|
|
@@ -607,11 +619,11 @@ import dayjs2 from "dayjs";
|
|
|
607
619
|
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
608
620
|
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
|
|
609
621
|
import timezone from "dayjs/plugin/timezone.js";
|
|
610
|
-
import
|
|
622
|
+
import utc2 from "dayjs/plugin/utc.js";
|
|
611
623
|
var dateFormat = "DD-MM-YYYY";
|
|
612
624
|
var timeFormat = "HH:mm";
|
|
613
625
|
dayjs2.extend(customParseFormat);
|
|
614
|
-
dayjs2.extend(
|
|
626
|
+
dayjs2.extend(utc2);
|
|
615
627
|
dayjs2.extend(timezone);
|
|
616
628
|
dayjs2.extend(isSameOrAfter);
|
|
617
629
|
var NZ_TZ = "Pacific/Auckland";
|