@timardex/cluemart-server-shared 1.0.179 → 1.0.201
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/{Chat-Ctmtatmi.d.mts → Chat-DYkhie3G.d.mts} +2 -4
- package/dist/{Chat-Ctmtatmi.d.ts → Chat-DYkhie3G.d.ts} +2 -4
- package/dist/{Relation-Dvgd2CFi.d.ts → Relation-6t3Gn4pM.d.ts} +1 -1
- package/dist/{Relation-BQhULTU-.d.mts → Relation-BjYghDE9.d.mts} +1 -1
- package/dist/{chunk-QHPLDTUG.mjs → chunk-HO2KMWIK.mjs} +78 -31
- package/dist/chunk-HO2KMWIK.mjs.map +1 -0
- package/dist/index.cjs +79 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -18
- package/dist/index.d.ts +4 -18
- package/dist/index.mjs +79 -32
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +77 -30
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +4 -13
- package/dist/mongoose/index.d.ts +4 -13
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +79 -32
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +4 -7
- package/dist/service/index.d.ts +4 -7
- package/dist/service/index.mjs +3 -3
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-QHPLDTUG.mjs.map +0 -1
|
@@ -52,13 +52,11 @@ interface GraphQLContext {
|
|
|
52
52
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
53
53
|
senderId: ObjectId;
|
|
54
54
|
};
|
|
55
|
-
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"
|
|
55
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
|
|
56
56
|
userId: ObjectId;
|
|
57
|
-
createdAt: Date;
|
|
58
57
|
};
|
|
59
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"
|
|
58
|
+
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
|
|
60
59
|
userId: ObjectId;
|
|
61
|
-
seenAt: Date;
|
|
62
60
|
};
|
|
63
61
|
type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
|
|
64
62
|
senderId: ObjectId;
|
|
@@ -52,13 +52,11 @@ interface GraphQLContext {
|
|
|
52
52
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
53
53
|
senderId: ObjectId;
|
|
54
54
|
};
|
|
55
|
-
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"
|
|
55
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
|
|
56
56
|
userId: ObjectId;
|
|
57
|
-
createdAt: Date;
|
|
58
57
|
};
|
|
59
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"
|
|
58
|
+
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
|
|
60
59
|
userId: ObjectId;
|
|
61
|
-
seenAt: Date;
|
|
62
60
|
};
|
|
63
61
|
type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
|
|
64
62
|
senderId: ObjectId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RelationDate, RelationType } from '@timardex/cluemart-shared';
|
|
2
2
|
import mongoose from 'mongoose';
|
|
3
|
-
import { O as ObjectId } from './Chat-
|
|
3
|
+
import { O as ObjectId } from './Chat-DYkhie3G.js';
|
|
4
4
|
|
|
5
5
|
declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<RelationDate, any, any, any, mongoose.Document<unknown, any, RelationDate, any, {}> & RelationDate & {
|
|
6
6
|
_id: mongoose.Types.ObjectId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RelationDate, RelationType } from '@timardex/cluemart-shared';
|
|
2
2
|
import mongoose from 'mongoose';
|
|
3
|
-
import { O as ObjectId } from './Chat-
|
|
3
|
+
import { O as ObjectId } from './Chat-DYkhie3G.mjs';
|
|
4
4
|
|
|
5
5
|
declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<RelationDate, any, any, any, mongoose.Document<unknown, any, RelationDate, any, {}> & RelationDate & {
|
|
6
6
|
_id: mongoose.Types.ObjectId;
|
|
@@ -7260,7 +7260,12 @@ var gameScreenIdentifierList = [
|
|
|
7260
7260
|
match: "/events/events-near-me"
|
|
7261
7261
|
},
|
|
7262
7262
|
{
|
|
7263
|
-
clue: "
|
|
7263
|
+
clue: "Where events appear as pins on a map.",
|
|
7264
|
+
id: "events-map",
|
|
7265
|
+
match: "/events/events-map"
|
|
7266
|
+
},
|
|
7267
|
+
{
|
|
7268
|
+
clue: "A collection of events worth attending.",
|
|
7264
7269
|
id: "events",
|
|
7265
7270
|
match: "/events"
|
|
7266
7271
|
},
|
|
@@ -7353,6 +7358,7 @@ function normalizeUrl(url) {
|
|
|
7353
7358
|
}
|
|
7354
7359
|
return url;
|
|
7355
7360
|
}
|
|
7361
|
+
var CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
|
|
7356
7362
|
var SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
7357
7363
|
var packagingTypes = [
|
|
7358
7364
|
"Biodegradable",
|
|
@@ -8758,7 +8764,6 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8758
8764
|
platform
|
|
8759
8765
|
preferredRegion
|
|
8760
8766
|
promoCodes
|
|
8761
|
-
refreshToken
|
|
8762
8767
|
role
|
|
8763
8768
|
school
|
|
8764
8769
|
termsAgreement {
|
|
@@ -9008,7 +9013,10 @@ var GET_EVENT_BY_PLACE_ID = gql`
|
|
|
9008
9013
|
${EVENT_LIST_ITEM}
|
|
9009
9014
|
`;
|
|
9010
9015
|
var GET_EVENTS_BY_REGION = gql`
|
|
9011
|
-
query getEventsByRegion(
|
|
9016
|
+
query getEventsByRegion(
|
|
9017
|
+
$region: String!
|
|
9018
|
+
$options: ResourcesByRegionOptions
|
|
9019
|
+
) {
|
|
9012
9020
|
eventsByRegion(region: $region, options: $options) {
|
|
9013
9021
|
...EventListItemFields
|
|
9014
9022
|
}
|
|
@@ -9016,7 +9024,7 @@ var GET_EVENTS_BY_REGION = gql`
|
|
|
9016
9024
|
${EVENT_LIST_ITEM}
|
|
9017
9025
|
`;
|
|
9018
9026
|
var SEARCH_EVENTS = gql`
|
|
9019
|
-
query searchEvents($region: String, $search: String
|
|
9027
|
+
query searchEvents($region: String, $search: String, $tags: [String]) {
|
|
9020
9028
|
eventsSearch(region: $region, search: $search, tags: $tags) {
|
|
9021
9029
|
...EventListItemFields
|
|
9022
9030
|
}
|
|
@@ -9240,8 +9248,11 @@ var GET_VENDOR = gql`
|
|
|
9240
9248
|
${VENDOR}
|
|
9241
9249
|
`;
|
|
9242
9250
|
var GET_VENDORS_BY_REGION = gql`
|
|
9243
|
-
query getVendorsByRegion(
|
|
9244
|
-
|
|
9251
|
+
query getVendorsByRegion(
|
|
9252
|
+
$region: String!
|
|
9253
|
+
$options: ResourcesByRegionOptions
|
|
9254
|
+
) {
|
|
9255
|
+
vendorsByRegion(region: $region, options: $options) {
|
|
9245
9256
|
...VendorFields
|
|
9246
9257
|
}
|
|
9247
9258
|
}
|
|
@@ -9637,8 +9648,11 @@ var GET_PARTNER = gql`
|
|
|
9637
9648
|
${PARTNER}
|
|
9638
9649
|
`;
|
|
9639
9650
|
var GET_PARTNERS_BY_REGION = gql`
|
|
9640
|
-
query getPartnersByRegion(
|
|
9641
|
-
|
|
9651
|
+
query getPartnersByRegion(
|
|
9652
|
+
$region: String!
|
|
9653
|
+
$options: ResourcesByRegionOptions
|
|
9654
|
+
) {
|
|
9655
|
+
partnersByRegion(region: $region, options: $options) {
|
|
9642
9656
|
...PartnerFields
|
|
9643
9657
|
}
|
|
9644
9658
|
}
|
|
@@ -9841,7 +9855,6 @@ var RELATION_FIELDS_FRAGMENT = gql`
|
|
|
9841
9855
|
fragment RelationFields on RelationType {
|
|
9842
9856
|
_id
|
|
9843
9857
|
active
|
|
9844
|
-
apiMessage
|
|
9845
9858
|
chatId
|
|
9846
9859
|
createdAt
|
|
9847
9860
|
lastUpdateBy
|
|
@@ -10857,7 +10870,7 @@ var emailOptionalSchema = create$6().nullable().notRequired().transform(
|
|
|
10857
10870
|
(value) => !value || create$6().email().isValidSync(value)
|
|
10858
10871
|
).label("Email");
|
|
10859
10872
|
var mobileRegex = /^02\d{7,9}$/;
|
|
10860
|
-
var landlineRegex = /^
|
|
10873
|
+
var landlineRegex = /^0[34679]\d{7}$/;
|
|
10861
10874
|
var mobilePhoneSchema = create$6().label("Mobile Phone").nullable().notRequired().test(
|
|
10862
10875
|
"mobile-phone",
|
|
10863
10876
|
"Mobile must start with 02 and be 9\u201311 digits",
|
|
@@ -11242,12 +11255,12 @@ var validateVerificationTokenSchema = create$3().shape({
|
|
|
11242
11255
|
email: emailRequiredSchema,
|
|
11243
11256
|
verificationToken: create$6().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
11244
11257
|
});
|
|
11245
|
-
var EnumAdShowOn = /* @__PURE__ */ ((
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
return
|
|
11258
|
+
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
11259
|
+
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
11260
|
+
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
11261
|
+
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
11262
|
+
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
11263
|
+
return EnumAdShowOn2;
|
|
11251
11264
|
})(EnumAdShowOn || {});
|
|
11252
11265
|
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
11253
11266
|
EnumAdStatus2["ACTIVE"] = "Active";
|
|
@@ -11266,15 +11279,15 @@ var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
|
11266
11279
|
return EnumAdStyle2;
|
|
11267
11280
|
})(EnumAdStyle || {});
|
|
11268
11281
|
var adResourceSchema = create$3({
|
|
11269
|
-
adDescription: create$6().
|
|
11270
|
-
adImage: create$6().
|
|
11271
|
-
adStyle: create$8().
|
|
11272
|
-
adTitle: create$6().
|
|
11273
|
-
adType: create$8().
|
|
11274
|
-
resourceId: create$6().
|
|
11275
|
-
resourceName: create$6().
|
|
11276
|
-
resourceRegion: create$6().
|
|
11277
|
-
resourceType: create$8().
|
|
11282
|
+
adDescription: create$6().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
|
|
11283
|
+
adImage: create$6().required("Ad image is required"),
|
|
11284
|
+
adStyle: create$8().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
11285
|
+
adTitle: create$6().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
|
|
11286
|
+
adType: create$8().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
11287
|
+
resourceId: create$6().required("Resource ID is required"),
|
|
11288
|
+
resourceName: create$6().required("Resource name is required"),
|
|
11289
|
+
resourceRegion: create$6().required("Resource region is required"),
|
|
11290
|
+
resourceType: create$8().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
|
|
11278
11291
|
});
|
|
11279
11292
|
var adSchema = create$3().shape({
|
|
11280
11293
|
active: create$7().required("Active status is required"),
|
|
@@ -11304,7 +11317,8 @@ var adSchema = create$3().shape({
|
|
|
11304
11317
|
if (!value) return false;
|
|
11305
11318
|
return value > /* @__PURE__ */ new Date();
|
|
11306
11319
|
}),
|
|
11307
|
-
|
|
11320
|
+
// Keep `start` optional (not null) when ACTIVE to match TS type `start?: Date`.
|
|
11321
|
+
otherwise: () => create$4().notRequired()
|
|
11308
11322
|
}),
|
|
11309
11323
|
targetRegion: create$2().of(create$6().required()).min(1, "At least one target region is required").required("Target region is required")
|
|
11310
11324
|
});
|
|
@@ -11432,6 +11446,31 @@ var contactUsSchema = create$3().shape({
|
|
|
11432
11446
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
11433
11447
|
message: create$6().label("Message").required("Message is required")
|
|
11434
11448
|
});
|
|
11449
|
+
var defaultValues8 = {
|
|
11450
|
+
active: true,
|
|
11451
|
+
// Use a future default so yup "future date" rules pass on first submit.
|
|
11452
|
+
end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3),
|
|
11453
|
+
resource: {
|
|
11454
|
+
adDescription: "",
|
|
11455
|
+
adImage: "",
|
|
11456
|
+
adStyle: "Bloom",
|
|
11457
|
+
adTitle: "",
|
|
11458
|
+
adType: "Sponsored",
|
|
11459
|
+
resourceId: "",
|
|
11460
|
+
resourceName: "",
|
|
11461
|
+
resourceRegion: "",
|
|
11462
|
+
resourceType: "event"
|
|
11463
|
+
/* EVENT */
|
|
11464
|
+
},
|
|
11465
|
+
showOn: [
|
|
11466
|
+
"Front_page"
|
|
11467
|
+
/* FRONT_PAGE */
|
|
11468
|
+
],
|
|
11469
|
+
// `start` is only required (and must be future) when status !== ACTIVE.
|
|
11470
|
+
start: void 0,
|
|
11471
|
+
status: "Active",
|
|
11472
|
+
targetRegion: []
|
|
11473
|
+
};
|
|
11435
11474
|
var schoolSchema = create$3().shape({
|
|
11436
11475
|
active: create$7().required("Active is required"),
|
|
11437
11476
|
contactDetails: contactDetailsSchema,
|
|
@@ -11493,8 +11532,9 @@ var badgeFiles = Object.fromEntries(
|
|
|
11493
11532
|
var logoIds = [
|
|
11494
11533
|
"googleMaps-logo-dark",
|
|
11495
11534
|
"googleMaps-logo-light",
|
|
11496
|
-
"logo",
|
|
11497
|
-
"logo-
|
|
11535
|
+
"logo-atr",
|
|
11536
|
+
"logo-dark",
|
|
11537
|
+
"logo"
|
|
11498
11538
|
];
|
|
11499
11539
|
var logoFiles = Object.fromEntries(
|
|
11500
11540
|
logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
@@ -11502,6 +11542,7 @@ var logoFiles = Object.fromEntries(
|
|
|
11502
11542
|
var otherImagesIds = [
|
|
11503
11543
|
"banner-horizontal",
|
|
11504
11544
|
"banner-vertical",
|
|
11545
|
+
"gazebo-top",
|
|
11505
11546
|
"qr-code",
|
|
11506
11547
|
"store-android",
|
|
11507
11548
|
"store-ios"
|
|
@@ -11529,7 +11570,7 @@ var otherImages = Object.fromEntries(
|
|
|
11529
11570
|
);
|
|
11530
11571
|
var RELATION_SHARE_INVITATION = "invitation";
|
|
11531
11572
|
var RELATION_SHARE_APPLICATION = "application";
|
|
11532
|
-
var SHARE_SITE_URL =
|
|
11573
|
+
var SHARE_SITE_URL = CLUEMART_MAIN_DOMAIN_URL;
|
|
11533
11574
|
var SHARE_CALENDAR_ICON = "\u{1F4C5}";
|
|
11534
11575
|
var SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;
|
|
11535
11576
|
var SHARE_CHECKMARK_ICON = "\u2705";
|
|
@@ -11869,6 +11910,7 @@ var refundPolicySchema = new MongooseSchema4(
|
|
|
11869
11910
|
);
|
|
11870
11911
|
var schema2 = new MongooseSchema4(
|
|
11871
11912
|
{
|
|
11913
|
+
active: { default: true, type: Boolean },
|
|
11872
11914
|
applicationDeadlineHours: { required: true, type: Number },
|
|
11873
11915
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
11874
11916
|
eventId: {
|
|
@@ -12310,7 +12352,11 @@ var schema5 = new MongooseSchema9(
|
|
|
12310
12352
|
type: String
|
|
12311
12353
|
},
|
|
12312
12354
|
token: { required: true, type: String },
|
|
12313
|
-
userId: {
|
|
12355
|
+
userId: {
|
|
12356
|
+
ref: "User",
|
|
12357
|
+
required: true,
|
|
12358
|
+
type: mongoose9.Schema.Types.ObjectId
|
|
12359
|
+
}
|
|
12314
12360
|
},
|
|
12315
12361
|
{ timestamps: true }
|
|
12316
12362
|
);
|
|
@@ -12653,6 +12699,7 @@ var AttributesSchema = new MongooseSchema14(
|
|
|
12653
12699
|
);
|
|
12654
12700
|
var schema10 = new MongooseSchema14(
|
|
12655
12701
|
{
|
|
12702
|
+
active: { default: true, type: Boolean },
|
|
12656
12703
|
compliance: {
|
|
12657
12704
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
12658
12705
|
liabilityInsurance: { default: false, required: false, type: Boolean }
|
|
@@ -13151,4 +13198,4 @@ react/cjs/react.development.js:
|
|
|
13151
13198
|
* LICENSE file in the root directory of this source tree.
|
|
13152
13199
|
*)
|
|
13153
13200
|
*/
|
|
13154
|
-
//# sourceMappingURL=chunk-
|
|
13201
|
+
//# sourceMappingURL=chunk-HO2KMWIK.mjs.map
|