@nanas-home/hub-common 0.45.1015 → 0.46.1024
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/{W3RS2ZEN.js → IDKCXMP4.js} +70 -20
- package/dist/eslint/index.js +2 -0
- package/dist/eslint/rules/require-draggable-attr.js +50 -0
- package/dist/index.css +1 -1
- package/dist/node-utils/index.d.ts +4 -3
- package/dist/node-utils/index.js +17 -7
- package/dist/{textValidation-DNnxQBiu.d.ts → textValidation-CRDf_0bC.d.ts} +138 -29
- package/dist/web/index.d.ts +38 -8
- package/dist/web/index.js +360 -229
- package/dist/web/index.jsx +385 -203
- package/package.json +9 -9
|
@@ -100,6 +100,7 @@ var apiRouteParam = {
|
|
|
100
100
|
bookingUuid: ":bookingUuid",
|
|
101
101
|
bookingAddonUuid: ":bookingAddonUuid",
|
|
102
102
|
userMembershipUuid: ":userMembershipUuid",
|
|
103
|
+
bugReportUuid: ":bugReportUuid",
|
|
103
104
|
linkUuid: ":linkUuid",
|
|
104
105
|
linkType: ":linkType",
|
|
105
106
|
// Stripe
|
|
@@ -120,6 +121,12 @@ var apiRoute = {
|
|
|
120
121
|
swagger: { name: "AuthToken", description: "Endpoints for creating an API token" }
|
|
121
122
|
}
|
|
122
123
|
},
|
|
124
|
+
bugReport: {
|
|
125
|
+
prefix: "/bug-report",
|
|
126
|
+
getAllForUser: "/user",
|
|
127
|
+
submit: "/user",
|
|
128
|
+
swagger: { name: "BugReports", description: "Endpoints for Users to submit BugReports" }
|
|
129
|
+
},
|
|
123
130
|
version: "/version"
|
|
124
131
|
},
|
|
125
132
|
admin: {
|
|
@@ -153,6 +160,11 @@ var apiRoute = {
|
|
|
153
160
|
removeHost: `/remove-host/${apiRouteParam.bookingUuid}`,
|
|
154
161
|
swagger: { name: "Bookings", description: "Endpoints for managing bookings" }
|
|
155
162
|
},
|
|
163
|
+
bugReport: {
|
|
164
|
+
prefix: "/admin/bug-report",
|
|
165
|
+
getForUser: `/user/${apiRouteParam.userUuid}`,
|
|
166
|
+
swagger: { name: "BugReports", description: "Endpoints for managing BugReports" }
|
|
167
|
+
},
|
|
156
168
|
invoice: {
|
|
157
169
|
prefix: "/invoice",
|
|
158
170
|
getByUserId: `/user/${apiRouteParam.userUuid}`,
|
|
@@ -238,24 +250,6 @@ var apiRoute = {
|
|
|
238
250
|
removeToBooking: `/${apiRouteParam.bookingAddonUuid}`,
|
|
239
251
|
swagger: { name: "BookingAddons", description: "Endpoints for User to manage their Booking Addons" }
|
|
240
252
|
},
|
|
241
|
-
stripe: {
|
|
242
|
-
invoice: {
|
|
243
|
-
prefix: "/invoice",
|
|
244
|
-
getByForUser: `/user`,
|
|
245
|
-
getByBookingId: `/booking/${apiRouteParam.bookingUuid}`,
|
|
246
|
-
getByBookingAddonId: `/booking-addon/${apiRouteParam.bookingAddonUuid}`,
|
|
247
|
-
swagger: { name: "Invoices", description: "Endpoints for User to view the Invoices they have been issued" }
|
|
248
|
-
},
|
|
249
|
-
paymentMethod: {
|
|
250
|
-
prefix: "/payment-method",
|
|
251
|
-
getByForUser: `/user`,
|
|
252
|
-
prepareCreateForUser: `/user/setup`,
|
|
253
|
-
setDefaultPaymentMethod: `/default/${apiRouteParam.stripeId}`,
|
|
254
|
-
createForUser: `/user`,
|
|
255
|
-
deleteForUser: `/${apiRouteParam.stripeId}`,
|
|
256
|
-
swagger: { name: "PaymentMethods", description: "Endpoints for User to view their Payment Methods" }
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
253
|
membership: {
|
|
260
254
|
prefix: "/membership",
|
|
261
255
|
getAll: "",
|
|
@@ -278,6 +272,24 @@ var apiRoute = {
|
|
|
278
272
|
getProfileById: `/${apiRouteParam.userUuid}/profile.png`,
|
|
279
273
|
swagger: { name: "Profile", description: "Endpoints for User to manage their Profile" }
|
|
280
274
|
},
|
|
275
|
+
stripe: {
|
|
276
|
+
invoice: {
|
|
277
|
+
prefix: "/invoice",
|
|
278
|
+
getByForUser: `/user`,
|
|
279
|
+
getByBookingId: `/booking/${apiRouteParam.bookingUuid}`,
|
|
280
|
+
getByBookingAddonId: `/booking-addon/${apiRouteParam.bookingAddonUuid}`,
|
|
281
|
+
swagger: { name: "Invoices", description: "Endpoints for User to view the Invoices they have been issued" }
|
|
282
|
+
},
|
|
283
|
+
paymentMethod: {
|
|
284
|
+
prefix: "/payment-method",
|
|
285
|
+
getByForUser: `/user`,
|
|
286
|
+
prepareCreateForUser: `/user/setup`,
|
|
287
|
+
setDefaultPaymentMethod: `/default/${apiRouteParam.stripeId}`,
|
|
288
|
+
createForUser: `/user`,
|
|
289
|
+
deleteForUser: `/${apiRouteParam.stripeId}`,
|
|
290
|
+
swagger: { name: "PaymentMethods", description: "Endpoints for User to view their Payment Methods" }
|
|
291
|
+
}
|
|
292
|
+
},
|
|
281
293
|
upload: {
|
|
282
294
|
prefix: "/upload",
|
|
283
295
|
image: "/image",
|
|
@@ -293,6 +305,11 @@ var apiRoute = {
|
|
|
293
305
|
cancel: `/${apiRouteParam.userMembershipUuid}/cancel`,
|
|
294
306
|
bookingDays: "/booking-days",
|
|
295
307
|
swagger: { name: "UserMembership", description: "Endpoints for User to get info about their Memberships" }
|
|
308
|
+
},
|
|
309
|
+
register: {
|
|
310
|
+
prefix: "/register",
|
|
311
|
+
signUpForUser: "/user",
|
|
312
|
+
swagger: { name: "Registration", description: "Endpoints for Users to register" }
|
|
296
313
|
}
|
|
297
314
|
}
|
|
298
315
|
};
|
|
@@ -347,6 +364,18 @@ var BookingStatusType = /* @__PURE__ */ ((BookingStatusType2) => {
|
|
|
347
364
|
return BookingStatusType2;
|
|
348
365
|
})(BookingStatusType || {});
|
|
349
366
|
|
|
367
|
+
// src/contracts/generated/enum/bugReportStatusType.ts
|
|
368
|
+
var BugReportStatusType = /* @__PURE__ */ ((BugReportStatusType2) => {
|
|
369
|
+
BugReportStatusType2[BugReportStatusType2["Pending"] = 0] = "Pending";
|
|
370
|
+
BugReportStatusType2[BugReportStatusType2["Closed"] = 1] = "Closed";
|
|
371
|
+
BugReportStatusType2[BugReportStatusType2["Fixed"] = 2] = "Fixed";
|
|
372
|
+
BugReportStatusType2[BugReportStatusType2["InDevelopment"] = 3] = "InDevelopment";
|
|
373
|
+
BugReportStatusType2[BugReportStatusType2["Testing"] = 4] = "Testing";
|
|
374
|
+
BugReportStatusType2[BugReportStatusType2["Planned"] = 5] = "Planned";
|
|
375
|
+
BugReportStatusType2[BugReportStatusType2["WontFix"] = 6] = "WontFix";
|
|
376
|
+
return BugReportStatusType2;
|
|
377
|
+
})(BugReportStatusType || {});
|
|
378
|
+
|
|
350
379
|
// src/contracts/generated/enum/commentLinkType.ts
|
|
351
380
|
var CommentLinkType = /* @__PURE__ */ ((CommentLinkType2) => {
|
|
352
381
|
CommentLinkType2[CommentLinkType2["Unknown"] = 0] = "Unknown";
|
|
@@ -422,6 +451,7 @@ var PermissionType = /* @__PURE__ */ ((PermissionType2) => {
|
|
|
422
451
|
PermissionType2[PermissionType2["UserManage"] = 21] = "UserManage";
|
|
423
452
|
PermissionType2[PermissionType2["UserDelete"] = 22] = "UserDelete";
|
|
424
453
|
PermissionType2[PermissionType2["ActivitiesView"] = 30] = "ActivitiesView";
|
|
454
|
+
PermissionType2[PermissionType2["StripeView"] = 31] = "StripeView";
|
|
425
455
|
PermissionType2[PermissionType2["UserPermissionView"] = 40] = "UserPermissionView";
|
|
426
456
|
PermissionType2[PermissionType2["UserPermissionManage"] = 41] = "UserPermissionManage";
|
|
427
457
|
PermissionType2[PermissionType2["UserPermissionDelete"] = 42] = "UserPermissionDelete";
|
|
@@ -455,6 +485,9 @@ var PermissionType = /* @__PURE__ */ ((PermissionType2) => {
|
|
|
455
485
|
PermissionType2[PermissionType2["InvoiceView"] = 200] = "InvoiceView";
|
|
456
486
|
PermissionType2[PermissionType2["InvoiceManage"] = 201] = "InvoiceManage";
|
|
457
487
|
PermissionType2[PermissionType2["InvoiceDelete"] = 202] = "InvoiceDelete";
|
|
488
|
+
PermissionType2[PermissionType2["BugReportView"] = 210] = "BugReportView";
|
|
489
|
+
PermissionType2[PermissionType2["BugReportManage"] = 211] = "BugReportManage";
|
|
490
|
+
PermissionType2[PermissionType2["BugReportDelete"] = 212] = "BugReportDelete";
|
|
458
491
|
return PermissionType2;
|
|
459
492
|
})(PermissionType || {});
|
|
460
493
|
|
|
@@ -518,6 +551,14 @@ var SearchableColumnType = /* @__PURE__ */ ((SearchableColumnType2) => {
|
|
|
518
551
|
return SearchableColumnType2;
|
|
519
552
|
})(SearchableColumnType || {});
|
|
520
553
|
|
|
554
|
+
// src/contracts/generated/enum/tempLinkType.ts
|
|
555
|
+
var TempLinkType = /* @__PURE__ */ ((TempLinkType2) => {
|
|
556
|
+
TempLinkType2[TempLinkType2["Unknown"] = 0] = "Unknown";
|
|
557
|
+
TempLinkType2[TempLinkType2["PasswordReset"] = 1] = "PasswordReset";
|
|
558
|
+
TempLinkType2[TempLinkType2["EmailConfirmation"] = 2] = "EmailConfirmation";
|
|
559
|
+
return TempLinkType2;
|
|
560
|
+
})(TempLinkType || {});
|
|
561
|
+
|
|
521
562
|
// src/contracts/generated/enum/uploadLinkType.ts
|
|
522
563
|
var UploadLinkType = /* @__PURE__ */ ((UploadLinkType2) => {
|
|
523
564
|
UploadLinkType2[UploadLinkType2["Unknown"] = 0] = "Unknown";
|
|
@@ -664,6 +705,13 @@ var BookingAddonRestriction = {
|
|
|
664
705
|
quantity: { min: 0, max: 1e3 }
|
|
665
706
|
};
|
|
666
707
|
|
|
708
|
+
// src/contracts/generated/restrictions/bugReportRestriction.ts
|
|
709
|
+
var BugReportRestriction = {
|
|
710
|
+
comment: { maxLength: 1e3 },
|
|
711
|
+
metadata: { maxLength: 1e3 },
|
|
712
|
+
logs: { maxLength: 5e3 }
|
|
713
|
+
};
|
|
714
|
+
|
|
667
715
|
// src/contracts/generated/restrictions/commentRestriction.ts
|
|
668
716
|
var CommentRestriction = {
|
|
669
717
|
name: { maxLength: 80 },
|
|
@@ -764,6 +812,7 @@ var searchColumns = {
|
|
|
764
812
|
user: [{ "property": "types", "type": 1 }, { "property": "firstName", "type": 2 }, { "property": "lastName", "type": 2 }, { "property": "email", "type": 2 }, { "property": "hubspotId", "type": 2 }, { "property": "flags", "type": 1 }, { "property": "dateCreated", "type": 5 }],
|
|
765
813
|
upload: [{ "property": "linkUuid", "type": 2 }, { "property": "linkType", "type": 2 }, { "property": "type", "type": 2 }, { "property": "fileName", "type": 2 }, { "property": "blobType", "type": 2 }, { "property": "sizeInKb", "type": 2 }, { "property": "dateCreated", "type": 5 }],
|
|
766
814
|
booking: [{ "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }, { "property": "status", "type": 2 }, { "property": "notes", "type": 2 }],
|
|
815
|
+
bugReport: [{ "property": "status", "type": 0 }, { "property": "comment", "type": 2 }, { "property": "metadata", "type": 2 }, { "property": "logs", "type": 2 }],
|
|
767
816
|
question: [{ "property": "forTypes", "type": 1 }, { "property": "transKey", "type": 2 }, { "property": "fallback", "type": 2 }, { "property": "category", "type": 2 }, { "property": "type", "type": 0 }, { "property": "sortOrder", "type": 3 }, { "property": "visible", "type": 4 }, { "property": "notes", "type": 2 }]
|
|
768
817
|
};
|
|
769
818
|
|
|
@@ -931,12 +980,13 @@ ${(log.optionalParams ?? []).join("\n\r")}`;
|
|
|
931
980
|
logFunc(`${dateString}: ${messageString}`, logStyle);
|
|
932
981
|
};
|
|
933
982
|
_track = (type, groups) => (message, ...optionalParams) => {
|
|
983
|
+
const localOptionalParams = (optionalParams?.length ?? 0) < 1 ? void 0 : optionalParams.map((op) => JSON.stringify(op));
|
|
934
984
|
const log = {
|
|
935
985
|
type,
|
|
936
986
|
groups,
|
|
937
987
|
message,
|
|
938
988
|
date: /* @__PURE__ */ new Date(),
|
|
939
|
-
optionalParams:
|
|
989
|
+
optionalParams: localOptionalParams
|
|
940
990
|
};
|
|
941
991
|
this.logs = this.logs.filter((t) => t.date > this._latestLogDate);
|
|
942
992
|
this.logs.push(log);
|
|
@@ -1753,4 +1803,4 @@ var shouldBeYoutubeUrl = (value) => {
|
|
|
1753
1803
|
};
|
|
1754
1804
|
};
|
|
1755
1805
|
|
|
1756
|
-
export { APP_TYPE_TOKEN, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, BOT_PATH_TOKEN, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DependencyInjectionContainer, DrivingRouteRestriction, InvoiceRestriction, InvoiceStatusType, LogService, MembershipBillingCycleType, MembershipRestriction, MembershipStatus, MembershipType, MouseButton, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG_TOKEN, SearchableColumnType, StripeRestriction, TranslationService, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiRoute, apiRouteParam, arrayContains, arrayOfNLength, capitalizeFirstLetter, changeMonth, colourPalette, convertToDate, convertToFullDateSelection, createToken, cyrb53, dateDiffInDays, debounceLeading, defaultSiteColour, fakePromise, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getActiveUserMembership, getAgeInYears, getAllPetQuestionForType, getAppType, getArrFromEnum, getBotPath, getCalendarDropdownDisplayValue, getCalendarDropdownForDateOfBirthDisplayValue, getCommonConfig, getDayClassObject, getDayElements, getDayHeadingElements, getImageParams, getLog, getMimeTypeFromExtension, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getSiteColour, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, hubspotQuestionsExport, isBefore, isDateAfterStart, isDateBeforeEnd, isDateDisabledByDisabledDays, isDateEnabledByEnabledDays, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, maxValue, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, minValue, monthTranslationKeyOrder, multiValidation, nameof, nanasFonts, noValidation, notNull, onlyUnique, portalGlyphLength, promiseFromValue, randomIntFromRange, randomItemFromArray, rootContainer, rootDependencyInjectionSetup, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setContainerTokenLazy, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, showSecondCalendar, socialLinks, timeout, tryParseNumber, uploadsThatNeedEncryption, urlRef, uuidv4, validUuidChars, validateForEach, webAppTypes, weekdayTranslationKeyOrder };
|
|
1806
|
+
export { APP_TYPE_TOKEN, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, BOT_PATH_TOKEN, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, BugReportRestriction, BugReportStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DependencyInjectionContainer, DrivingRouteRestriction, InvoiceRestriction, InvoiceStatusType, LogService, MembershipBillingCycleType, MembershipRestriction, MembershipStatus, MembershipType, MouseButton, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG_TOKEN, SearchableColumnType, StripeRestriction, TempLinkType, TranslationService, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiRoute, apiRouteParam, arrayContains, arrayOfNLength, capitalizeFirstLetter, changeMonth, colourPalette, convertToDate, convertToFullDateSelection, createToken, cyrb53, dateDiffInDays, debounceLeading, defaultSiteColour, fakePromise, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getActiveUserMembership, getAgeInYears, getAllPetQuestionForType, getAppType, getArrFromEnum, getBotPath, getCalendarDropdownDisplayValue, getCalendarDropdownForDateOfBirthDisplayValue, getCommonConfig, getDayClassObject, getDayElements, getDayHeadingElements, getImageParams, getLog, getMimeTypeFromExtension, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getSiteColour, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, hubspotQuestionsExport, isBefore, isDateAfterStart, isDateBeforeEnd, isDateDisabledByDisabledDays, isDateEnabledByEnabledDays, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, maxValue, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, minValue, monthTranslationKeyOrder, multiValidation, nameof, nanasFonts, noValidation, notNull, onlyUnique, portalGlyphLength, promiseFromValue, randomIntFromRange, randomItemFromArray, rootContainer, rootDependencyInjectionSetup, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setContainerTokenLazy, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, showSecondCalendar, socialLinks, timeout, tryParseNumber, uploadsThatNeedEncryption, urlRef, uuidv4, validUuidChars, validateForEach, webAppTypes, weekdayTranslationKeyOrder };
|
package/dist/eslint/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import requireDebugMarker from './rules/require-debug-marker.js';
|
|
2
|
+
import requireDraggableAttr from './rules/require-draggable-attr.js';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
rules: {
|
|
5
6
|
'require-debug-marker': requireDebugMarker,
|
|
7
|
+
'require-draggable-attr': requireDraggableAttr,
|
|
6
8
|
},
|
|
7
9
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
meta: {
|
|
3
|
+
type: 'problem',
|
|
4
|
+
docs: {
|
|
5
|
+
description: 'Ensure draggable attribute is defined on <img> and <a> elements',
|
|
6
|
+
},
|
|
7
|
+
schema: [],
|
|
8
|
+
messages: {
|
|
9
|
+
missingDraggable: "The '{{tag}}' element must have a 'draggable' attribute defined.",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
create(context) {
|
|
14
|
+
return {
|
|
15
|
+
JSXOpeningElement(node) {
|
|
16
|
+
const filename = context.filename;
|
|
17
|
+
if (filename.endsWith('.ts')) return {};
|
|
18
|
+
if (filename.endsWith('.meta.tsx')) return {};
|
|
19
|
+
|
|
20
|
+
const tagName = node.name.name;
|
|
21
|
+
|
|
22
|
+
// Only check <img> and <a>
|
|
23
|
+
if (tagName !== 'img' && tagName !== 'a') return;
|
|
24
|
+
|
|
25
|
+
const draggableAttr = node.attributes.find(
|
|
26
|
+
(attr) => attr.type === 'JSXAttribute' && attr.name && attr.name.name === 'draggable',
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// Missing attribute entirely
|
|
30
|
+
if (!draggableAttr) {
|
|
31
|
+
context.report({
|
|
32
|
+
node,
|
|
33
|
+
messageId: 'missingDraggable',
|
|
34
|
+
data: { tag: tagName },
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Attribute exists but has no value: <img draggable>
|
|
40
|
+
if (!draggableAttr.value) {
|
|
41
|
+
context.report({
|
|
42
|
+
node,
|
|
43
|
+
messageId: 'missingDraggable',
|
|
44
|
+
data: { tag: tagName },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
};
|