@myrjfa/state 3.0.8 → 3.0.9
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/lib/actions/application.d.ts +5 -3
- package/dist/lib/actions/application.d.ts.map +1 -1
- package/dist/lib/actions/application.js +45 -2
- package/dist/lib/actions/auth.d.ts +18 -3
- package/dist/lib/actions/auth.d.ts.map +1 -1
- package/dist/lib/actions/auth.js +22 -0
- package/dist/lib/actions/blog.d.ts.map +1 -1
- package/dist/lib/actions/blog.js +3 -2
- package/dist/lib/actions/booking.d.ts +29 -1
- package/dist/lib/actions/booking.d.ts.map +1 -1
- package/dist/lib/actions/booking.js +186 -0
- package/dist/lib/actions/brand.d.ts +7 -0
- package/dist/lib/actions/brand.d.ts.map +1 -1
- package/dist/lib/actions/brand.js +4 -0
- package/dist/lib/actions/chat.d.ts +3 -0
- package/dist/lib/actions/chat.d.ts.map +1 -1
- package/dist/lib/actions/chat.js +40 -1
- package/dist/lib/actions/community.d.ts +2 -1
- package/dist/lib/actions/community.d.ts.map +1 -1
- package/dist/lib/actions/community.js +10 -4
- package/dist/lib/actions/companion.d.ts +13 -7
- package/dist/lib/actions/companion.d.ts.map +1 -1
- package/dist/lib/actions/companion.js +6 -4
- package/dist/lib/actions/companionUpload.d.ts +2 -1
- package/dist/lib/actions/companionUpload.d.ts.map +1 -1
- package/dist/lib/actions/companionUpload.js +2 -1
- package/dist/lib/actions/event.d.ts +1 -1
- package/dist/lib/actions/event.d.ts.map +1 -1
- package/dist/lib/actions/event.js +5 -2
- package/dist/lib/actions/fetcher.d.ts +7 -1
- package/dist/lib/actions/fetcher.d.ts.map +1 -1
- package/dist/lib/actions/fetcher.js +56 -11
- package/dist/lib/actions/guide.js +1 -0
- package/dist/lib/actions/homeBanner.d.ts +8 -0
- package/dist/lib/actions/homeBanner.d.ts.map +1 -0
- package/dist/lib/actions/homeBanner.js +33 -0
- package/dist/lib/actions/hostDashboard.d.ts +1 -11
- package/dist/lib/actions/hostDashboard.d.ts.map +1 -1
- package/dist/lib/actions/hostDashboard.js +1 -146
- package/dist/lib/actions/itinerary.d.ts +1 -1
- package/dist/lib/actions/itinerary.d.ts.map +1 -1
- package/dist/lib/actions/itinerary.js +2 -2
- package/dist/lib/actions/listingInterest.d.ts +2 -5
- package/dist/lib/actions/listingInterest.d.ts.map +1 -1
- package/dist/lib/actions/listingInterest.js +18 -3
- package/dist/lib/actions/location.d.ts +4 -0
- package/dist/lib/actions/location.d.ts.map +1 -1
- package/dist/lib/actions/location.js +10 -6
- package/dist/lib/actions/marketplaceContract.d.ts.map +1 -1
- package/dist/lib/actions/marketplaceContract.js +3 -2
- package/dist/lib/actions/nativeTransport.d.ts +25 -0
- package/dist/lib/actions/nativeTransport.d.ts.map +1 -0
- package/dist/lib/actions/nativeTransport.js +50 -0
- package/dist/lib/actions/notification.d.ts +3 -3
- package/dist/lib/actions/package.d.ts +5 -3
- package/dist/lib/actions/package.d.ts.map +1 -1
- package/dist/lib/actions/package.js +11 -6
- package/dist/lib/actions/profile.d.ts +5 -0
- package/dist/lib/actions/profile.d.ts.map +1 -1
- package/dist/lib/actions/profile.js +12 -0
- package/dist/lib/actions/review.d.ts +7 -0
- package/dist/lib/actions/review.d.ts.map +1 -1
- package/dist/lib/actions/review.js +64 -31
- package/dist/lib/actions/serverActions.native.d.ts +4 -0
- package/dist/lib/actions/serverActions.native.d.ts.map +1 -0
- package/dist/lib/actions/serverActions.native.js +5 -0
- package/dist/lib/actions/socket.d.ts.map +1 -1
- package/dist/lib/actions/socket.js +6 -5
- package/dist/lib/actions/stay.d.ts +14 -1
- package/dist/lib/actions/stay.d.ts.map +1 -1
- package/dist/lib/actions/stay.js +29 -2
- package/dist/lib/actions/store.d.ts +1 -0
- package/dist/lib/actions/store.d.ts.map +1 -1
- package/dist/lib/actions/store.js +9 -0
- package/dist/lib/actions/user.d.ts +2 -0
- package/dist/lib/actions/user.d.ts.map +1 -1
- package/dist/lib/actions/user.js +5 -0
- package/dist/lib/data/catalogueLocations.d.ts +3 -0
- package/dist/lib/data/catalogueLocations.d.ts.map +1 -0
- package/dist/lib/data/catalogueLocations.js +21 -0
- package/dist/lib/data/skills.d.ts +5 -0
- package/dist/lib/data/skills.d.ts.map +1 -0
- package/dist/lib/data/skills.js +97 -0
- package/dist/lib/forms/application.d.ts +4 -0
- package/dist/lib/forms/application.d.ts.map +1 -0
- package/dist/lib/forms/application.js +17 -0
- package/dist/lib/forms/packageEnquiry.d.ts +4 -0
- package/dist/lib/forms/packageEnquiry.d.ts.map +1 -0
- package/dist/lib/forms/packageEnquiry.js +12 -0
- package/dist/lib/forms/review.d.ts +6 -0
- package/dist/lib/forms/review.d.ts.map +1 -0
- package/dist/lib/forms/review.js +20 -0
- package/dist/lib/models/application.d.ts +21 -0
- package/dist/lib/models/application.d.ts.map +1 -1
- package/dist/lib/models/authorization.d.ts +1 -1
- package/dist/lib/models/authorization.d.ts.map +1 -1
- package/dist/lib/models/authorization.js +2 -0
- package/dist/lib/models/booking.d.ts +3 -0
- package/dist/lib/models/booking.d.ts.map +1 -1
- package/dist/lib/models/chat.d.ts +8 -0
- package/dist/lib/models/chat.d.ts.map +1 -1
- package/dist/lib/models/chat.js +10 -0
- package/dist/lib/models/community.d.ts +2 -0
- package/dist/lib/models/community.d.ts.map +1 -1
- package/dist/lib/models/community.js +2 -1
- package/dist/lib/models/companion.d.ts +42 -0
- package/dist/lib/models/companion.d.ts.map +1 -1
- package/dist/lib/models/discount.d.ts +8 -8
- package/dist/lib/models/enquiry.d.ts +13 -0
- package/dist/lib/models/enquiry.d.ts.map +1 -1
- package/dist/lib/models/homeBanner.d.ts +17 -0
- package/dist/lib/models/homeBanner.d.ts.map +1 -0
- package/dist/lib/models/homeBanner.js +1 -0
- package/dist/lib/models/interest.d.ts +42 -0
- package/dist/lib/models/interest.d.ts.map +1 -0
- package/dist/lib/models/interest.js +1 -0
- package/dist/lib/models/location.d.ts +1 -0
- package/dist/lib/models/location.d.ts.map +1 -1
- package/dist/lib/models/notifications.d.ts +2 -2
- package/dist/lib/models/opportunities/freelance.d.ts +37 -4
- package/dist/lib/models/opportunities/freelance.d.ts.map +1 -1
- package/dist/lib/models/opportunities/internship.d.ts +37 -4
- package/dist/lib/models/opportunities/internship.d.ts.map +1 -1
- package/dist/lib/models/opportunities/job.d.ts +37 -4
- package/dist/lib/models/opportunities/job.d.ts.map +1 -1
- package/dist/lib/models/opportunities/opportunity.d.ts +38 -5
- package/dist/lib/models/opportunities/opportunity.d.ts.map +1 -1
- package/dist/lib/models/opportunities/opportunity.js +1 -1
- package/dist/lib/models/opportunities/volunteerJob.d.ts +37 -4
- package/dist/lib/models/opportunities/volunteerJob.d.ts.map +1 -1
- package/dist/lib/models/pricing.d.ts +2 -0
- package/dist/lib/models/pricing.d.ts.map +1 -1
- package/dist/lib/models/pricing.js +4 -0
- package/dist/lib/models/props.d.ts +4 -43
- package/dist/lib/models/props.d.ts.map +1 -1
- package/dist/lib/models/props.js +3 -121
- package/dist/lib/models/question.d.ts +14 -0
- package/dist/lib/models/question.d.ts.map +1 -0
- package/dist/lib/models/question.js +6 -0
- package/dist/lib/models/review.d.ts +13 -1
- package/dist/lib/models/review.d.ts.map +1 -1
- package/dist/lib/models/review.js +4 -0
- package/dist/lib/models/tile.d.ts +7 -1
- package/dist/lib/models/tile.d.ts.map +1 -1
- package/dist/lib/models/travelPackage.d.ts +37 -4
- package/dist/lib/models/travelPackage.d.ts.map +1 -1
- package/dist/lib/models/travelPackage.js +1 -1
- package/dist/lib/models/user.d.ts +25 -2
- package/dist/lib/models/user.d.ts.map +1 -1
- package/dist/lib/models/user.js +1 -0
- package/dist/lib/userAtom.d.ts +30 -5
- package/dist/lib/userAtom.d.ts.map +1 -1
- package/dist/lib/utils/entityTiles.d.ts.map +1 -1
- package/dist/lib/utils/entityTiles.js +3 -2
- package/dist/lib/utils/htmlDescription.d.ts +3 -0
- package/dist/lib/utils/htmlDescription.d.ts.map +1 -0
- package/dist/lib/utils/htmlDescription.js +7 -0
- package/dist/lib/utils/htmlDescription.native.d.ts +3 -0
- package/dist/lib/utils/htmlDescription.native.d.ts.map +1 -0
- package/dist/lib/utils/htmlDescription.native.js +7 -0
- package/dist/lib/utils/text.d.ts +3 -1
- package/dist/lib/utils/text.d.ts.map +1 -1
- package/dist/lib/utils/text.js +5 -6
- package/dist/lib/utils/uploadFile.d.ts +9 -0
- package/dist/lib/utils/uploadFile.d.ts.map +1 -0
- package/dist/lib/utils/uploadFile.js +9 -0
- package/dist/lib/utils/uploadTasks.d.ts.map +1 -1
- package/dist/lib/utils/uploadTasks.js +9 -1
- package/package.json +1 -1
|
@@ -41,4 +41,11 @@ export declare function deleteReview(id: string): Promise<{
|
|
|
41
41
|
message?: string;
|
|
42
42
|
error?: string;
|
|
43
43
|
}>;
|
|
44
|
+
/** Exhaustive target-scoped owner read; malformed/changing pages are not absence. */
|
|
45
|
+
export declare function getReviewOwnerForTarget(slug: string, type: reviewTargetType, actorId: string): Promise<{
|
|
46
|
+
success: boolean;
|
|
47
|
+
review: Review | null;
|
|
48
|
+
entityId: string | null;
|
|
49
|
+
error?: string;
|
|
50
|
+
}>;
|
|
44
51
|
//# sourceMappingURL=review.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,MAAM,EACN,cAAc,EACd,gBAAgB,EACnB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,MAAM,EACN,cAAc,EACd,gBAAgB,EACnB,MAAM,kBAAkB,CAAC;AAM1B,wBAAsB,cAAc,CAChC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,gBAAgB,EACtB,OAAO,GAAE;IACL,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAA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M,CAAA;CAAE,CAAC,CAUxF;AAED,wBAAsB,YAAY,CAC9B,EAAE,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAQjE;AAED,qFAAqF;AACrF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,OAAO,EAAC,OAAO,CAAC;IAAA,MAAM,EAAC,MAAM,GAAC,IAAI,CAAC;IAAA,QAAQ,EAAC,MAAM,GAAC,IAAI,CAAC;IAAA,KAAK,CAAC,EAAC,MAAM,CAAA;CAAC,CAAC,CAgErL"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { del, get, patch, post } from "./fetcher";
|
|
2
|
+
import { reviewRequestBody } from "../forms/review";
|
|
3
|
+
import { getNativeTransport } from "./nativeTransport";
|
|
2
4
|
import { runUploadTask } from "../utils/uploadTasks";
|
|
3
5
|
export async function getReviewsById(id, type, options = {}) {
|
|
4
6
|
try {
|
|
@@ -43,25 +45,8 @@ export async function getRatingById(ids, type) {
|
|
|
43
45
|
}
|
|
44
46
|
export async function addReview(id, type, formData) {
|
|
45
47
|
try {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const formBody = new FormData();
|
|
49
|
-
formBody.append("reviewee", id);
|
|
50
|
-
formBody.append("revieweeType", type);
|
|
51
|
-
formBody.append("rating", formData.rating.toString());
|
|
52
|
-
formBody.append("comment", formData.comment || "");
|
|
53
|
-
formData.images.forEach((image) => formBody.append("images", image));
|
|
54
|
-
body = formBody;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
body = {
|
|
58
|
-
reviewee: id,
|
|
59
|
-
revieweeType: type,
|
|
60
|
-
rating: formData.rating,
|
|
61
|
-
comment: formData.comment,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const data = await runUploadTask({ title: "Review", href: typeof window === "undefined" ? undefined : window.location.pathname, operation: ({ progress }) => post("/reviews/", body, true, { onUploadProgress: progress }) });
|
|
48
|
+
const body = reviewRequestBody(formData, { id, type });
|
|
49
|
+
const data = await runUploadTask({ title: "Review", retrySafe: getNativeTransport() ? false : undefined, href: typeof window === "undefined" || !window.location ? undefined : window.location.pathname, operation: ({ progress }) => post("/reviews/", body, true, { onUploadProgress: progress }) });
|
|
65
50
|
return { success: true, review: data.data, message: data.message };
|
|
66
51
|
}
|
|
67
52
|
catch (error) {
|
|
@@ -71,18 +56,10 @@ export async function addReview(id, type, formData) {
|
|
|
71
56
|
}
|
|
72
57
|
export async function editReview(id, formData) {
|
|
73
58
|
try {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
formBody.append("comment", formData.comment || "");
|
|
79
|
-
formData.images.forEach((image) => formBody.append("images", image));
|
|
80
|
-
body = formBody;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
body = { rating: formData.rating, comment: formData.comment };
|
|
84
|
-
}
|
|
85
|
-
const data = await runUploadTask({ title: "Review update", href: typeof window === "undefined" ? undefined : window.location.pathname, operation: ({ progress }) => patch(`/reviews/${encodeURIComponent(id)}`, body, { onUploadProgress: progress }) });
|
|
59
|
+
if (getNativeTransport() && formData.images?.length)
|
|
60
|
+
throw new Error("Review photos cannot be changed by the current service. Update the rating and comment only.");
|
|
61
|
+
const body = reviewRequestBody(formData);
|
|
62
|
+
const data = await runUploadTask({ title: "Review update", retrySafe: getNativeTransport() ? false : undefined, href: typeof window === "undefined" || !window.location ? undefined : window.location.pathname, operation: ({ progress }) => patch(`/reviews/${encodeURIComponent(id)}`, body, { onUploadProgress: progress }) });
|
|
86
63
|
return { success: true, review: data.data, message: data.message };
|
|
87
64
|
}
|
|
88
65
|
catch (error) {
|
|
@@ -100,3 +77,59 @@ export async function deleteReview(id) {
|
|
|
100
77
|
return { success: false, error: error.message };
|
|
101
78
|
}
|
|
102
79
|
}
|
|
80
|
+
/** Exhaustive target-scoped owner read; malformed/changing pages are not absence. */
|
|
81
|
+
export async function getReviewOwnerForTarget(slug, type, actorId) {
|
|
82
|
+
try {
|
|
83
|
+
let page = 1, entityId = null, own = null;
|
|
84
|
+
let expectedTotal = null;
|
|
85
|
+
const seen = new Set();
|
|
86
|
+
while (true) {
|
|
87
|
+
const result = await getReviewsById(slug, type, {
|
|
88
|
+
page,
|
|
89
|
+
limit: 20,
|
|
90
|
+
});
|
|
91
|
+
if (!result.success)
|
|
92
|
+
throw new Error(result.error);
|
|
93
|
+
if (!Array.isArray(result.reviews) ||
|
|
94
|
+
typeof result.hasMore !== "boolean" ||
|
|
95
|
+
!Number.isSafeInteger(result.totalCount) ||
|
|
96
|
+
result.totalCount < 0)
|
|
97
|
+
throw new Error("Reviews could not be read.");
|
|
98
|
+
if (expectedTotal !== null && expectedTotal !== result.totalCount)
|
|
99
|
+
throw new Error("Reviews changed while reading. Refresh before submitting.");
|
|
100
|
+
expectedTotal = result.totalCount;
|
|
101
|
+
let added = 0;
|
|
102
|
+
for (const row of result.reviews) {
|
|
103
|
+
if (!row?._id ||
|
|
104
|
+
!row.reviewee ||
|
|
105
|
+
row.revieweeType !== type ||
|
|
106
|
+
!row.reviewer ||
|
|
107
|
+
!row.reviewerType)
|
|
108
|
+
throw new Error("Review identity could not be confirmed.");
|
|
109
|
+
if (entityId && row.reviewee !== entityId)
|
|
110
|
+
throw new Error("Conflicting review targets were returned.");
|
|
111
|
+
entityId = row.reviewee;
|
|
112
|
+
if (!seen.has(row._id)) {
|
|
113
|
+
seen.add(row._id);
|
|
114
|
+
added++;
|
|
115
|
+
}
|
|
116
|
+
if (row.reviewer === actorId && row.reviewerType === "User") {
|
|
117
|
+
if (own && own._id !== row._id)
|
|
118
|
+
throw new Error("More than one current review was returned. Contact support before changing it.");
|
|
119
|
+
own = row;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (!result.hasMore) {
|
|
123
|
+
if (seen.size !== expectedTotal)
|
|
124
|
+
throw new Error("The complete review collection could not be confirmed. Retry before submitting.");
|
|
125
|
+
return { success: true, review: own, entityId };
|
|
126
|
+
}
|
|
127
|
+
if (!added)
|
|
128
|
+
throw new Error("Review pages could not advance. Retry the read before posting.");
|
|
129
|
+
page++;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
return { success: false, review: null, entityId: null, error: error instanceof Error ? error.message : "Reviews could not load." };
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverActions.native.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/serverActions.native.ts"],"names":[],"mappings":"AAEA,wBAAsB,eAAe,oBAAiB;AACtD,wBAAsB,OAAO,2BAAkE;AAC/F,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAgE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Metro selects this file instead of Next.js server actions. */
|
|
2
|
+
import { getNativeTransport } from "./nativeTransport";
|
|
3
|
+
export async function getCookieHeader() { return ""; }
|
|
4
|
+
export async function getRole() { return getNativeTransport()?.accessToken() ? "user" : null; }
|
|
5
|
+
export async function getAccountType() { return getNativeTransport()?.accessToken() ? "user" : null; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAajD,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAA6B,CAAC;AAClF,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,OAAO,CAAwB,CAAC;AAE5E,eAAO,MAAM,SAAS,QAAO,MAW5B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,qBAGtC,0BAA0B,KAAG,MAAM,GAAG,IAYxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAG5B,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { io } from "socket.io-client";
|
|
2
2
|
import { atom } from "jotai";
|
|
3
|
+
import { getNativeTransport } from "./nativeTransport";
|
|
3
4
|
const configuredSocketUrl = process.env.NEXT_PUBLIC_BACKEND_URL || process.env.NEXT_PUBLIC_API_URL;
|
|
4
5
|
// Socket.IO is served from the backend origin, while REST configuration may
|
|
5
6
|
// include the API version path. Normalise either supported public variable so
|
|
@@ -10,9 +11,11 @@ export const socketAtom = atom(null);
|
|
|
10
11
|
export const isConnectedAtom = atom(false);
|
|
11
12
|
export const getSocket = () => {
|
|
12
13
|
if (!socket) {
|
|
13
|
-
|
|
14
|
+
const native = getNativeTransport();
|
|
15
|
+
socket = io(native?.apiUrl.replace(/\/api\/v1\/?$/, "") || SOCKET_URL, {
|
|
14
16
|
autoConnect: false,
|
|
15
|
-
withCredentials:
|
|
17
|
+
withCredentials: !native,
|
|
18
|
+
...(native ? { auth: (callback) => callback({ token: getNativeTransport()?.accessToken() || null }) } : {}),
|
|
16
19
|
transports: ["websocket", "polling"],
|
|
17
20
|
});
|
|
18
21
|
}
|
|
@@ -33,8 +36,6 @@ export const createNotificationSocket = ({ userId, hostId, }) => {
|
|
|
33
36
|
});
|
|
34
37
|
};
|
|
35
38
|
export const disconnectSocket = () => {
|
|
36
|
-
|
|
37
|
-
socket.disconnect();
|
|
38
|
-
}
|
|
39
|
+
socket?.disconnect();
|
|
39
40
|
socket = null;
|
|
40
41
|
};
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import type { StayRoom } from '../models/stay';
|
|
2
|
+
import type { TileProps } from '../models/tile';
|
|
3
|
+
/** Public list summaries may include cheapestRoom; details expose the actual rooms. */
|
|
4
|
+
export declare function getStayStartingRoom(stay: {
|
|
5
|
+
cheapestRoom?: StayRoom | null;
|
|
6
|
+
rooms?: StayRoom[];
|
|
7
|
+
}): StayRoom | undefined;
|
|
8
|
+
export declare function fetchStays(params?: Record<string, string>, signal?: AbortSignal): Promise<any>;
|
|
9
|
+
/** The website filters the complete public stay set before pagination. */
|
|
10
|
+
export declare function getStayTiles(params?: Record<string, string>, signal?: AbortSignal): Promise<{
|
|
11
|
+
success: boolean;
|
|
12
|
+
tiles: TileProps[];
|
|
13
|
+
error?: string;
|
|
14
|
+
}>;
|
|
2
15
|
export declare function fetchStayBySlug(slug: string): Promise<{
|
|
3
16
|
success: boolean;
|
|
4
17
|
stay: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stay.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/stay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stay.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/stay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;CAAE,GAAG,QAAQ,GAAG,SAAS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EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAOD"}
|
package/dist/lib/actions/stay.js
CHANGED
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
import { runUploadTask } from "../utils/uploadTasks";
|
|
2
2
|
import { get, post, patch, del } from "./fetcher";
|
|
3
|
+
/** Public list summaries may include cheapestRoom; details expose the actual rooms. */
|
|
4
|
+
export function getStayStartingRoom(stay) {
|
|
5
|
+
if (stay.cheapestRoom && Number.isFinite(stay.cheapestRoom.pricePerNight))
|
|
6
|
+
return stay.cheapestRoom;
|
|
7
|
+
return stay.rooms?.filter(room => room.isAvailable && room.status !== 'inactive' && Number.isFinite(room.pricePerNight)).reduce((best, room) => !best || room.pricePerNight < best.pricePerNight ? room : best, undefined);
|
|
8
|
+
}
|
|
3
9
|
// ─── Public ───────────────────────────────────────────────────────────────────
|
|
4
|
-
export async function fetchStays(params = {}) {
|
|
10
|
+
export async function fetchStays(params = {}, signal) {
|
|
5
11
|
try {
|
|
6
12
|
const qs = new URLSearchParams(params).toString();
|
|
7
|
-
const data = await get(`/stays?${qs}
|
|
13
|
+
const data = await get(`/stays?${qs}`, true, { signal });
|
|
8
14
|
return { success: true, ...data.data };
|
|
9
15
|
}
|
|
10
16
|
catch (err) {
|
|
11
17
|
return { success: false, error: err.message, stays: [] };
|
|
12
18
|
}
|
|
13
19
|
}
|
|
20
|
+
/** The website filters the complete public stay set before pagination. */
|
|
21
|
+
export async function getStayTiles(params = {}, signal) {
|
|
22
|
+
try {
|
|
23
|
+
const tiles = [];
|
|
24
|
+
let totalPages = 1;
|
|
25
|
+
for (let page = 1; page <= totalPages; page++) {
|
|
26
|
+
const response = await get(`/stays?${new URLSearchParams({ ...params, page: String(page), limit: "100" })}`, true, { signal });
|
|
27
|
+
if (!Number.isInteger(response.data.totalPages) || response.data.totalPages < 0)
|
|
28
|
+
throw new Error("Invalid stay pagination response");
|
|
29
|
+
totalPages = response.data.totalPages;
|
|
30
|
+
for (const stay of response.data.stays) {
|
|
31
|
+
const room = getStayStartingRoom(stay);
|
|
32
|
+
tiles.push({ slug: stay.slug || "", title: stay.title, description: stay.shortDescription || stay.description || "", image: stay.images?.[0] || "", location: [stay.city, stay.state].filter(Boolean).join(", "), price: room?.pricePerNight, currency: room?.currency, rating: stay.rating, sponsored: stay.sponsored, trendingScore: stay.trendingScore, updatedAt: stay.updatedAt, tileType: "stays", propertyType: stay.propertyType, amenities: stay.amenities, instantBook: stay.instantBook, petsAllowed: stay.petsAllowed, cancellationPolicy: stay.cancellationPolicy });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return { success: true, tiles };
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
return { success: false, tiles: [], error: error.message };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
14
41
|
export async function fetchStayBySlug(slug) {
|
|
15
42
|
try {
|
|
16
43
|
const data = await get(`/stays/${slug}`);
|
|
@@ -5,6 +5,7 @@ type Result<T> = {
|
|
|
5
5
|
message?: string;
|
|
6
6
|
error?: string;
|
|
7
7
|
};
|
|
8
|
+
export declare function getTravellerStoreOrders(): Promise<Result<StoreOrder[]>>;
|
|
8
9
|
export declare function getStoreProducts(sort?: string): Promise<Result<StoreProduct[]>>;
|
|
9
10
|
export declare function getStoreProductBySlug(slug: string): Promise<Result<StoreProduct | null>>;
|
|
10
11
|
export declare function createStoreOrder(payload: CreateStoreOrderInput): Promise<Result<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvF,KAAK,MAAM,CAAC,CAAC,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK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;CAAE,CAAC;AAEjF,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAG7E;AAED,wBAAsB,gBAAgB,CAAC,IAAI,SAAa,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAazF;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAO9F;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAAC,CAO1M;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAO7L;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAO1F"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { get, post } from "./fetcher";
|
|
2
|
+
export async function getTravellerStoreOrders() {
|
|
3
|
+
try {
|
|
4
|
+
const response = await get("/store/orders/me");
|
|
5
|
+
return { success: true, data: response.data };
|
|
6
|
+
}
|
|
7
|
+
catch (error) {
|
|
8
|
+
return { success: false, data: [], error: error.message };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
2
11
|
export async function getStoreProducts(sort = "featured") {
|
|
3
12
|
try {
|
|
4
13
|
const endpoint = (page) => `/store?limit=100&page=${page}&sort=${encodeURIComponent(sort)}`;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { UserRole } from "../models/props";
|
|
2
2
|
import type { User } from "../models/user";
|
|
3
|
+
/** Strict session read for native restoration: outages must not look signed out. */
|
|
4
|
+
export declare function getTravellerSessionUser(): Promise<User>;
|
|
3
5
|
export declare function getCurrentUser(): Promise<User | null>;
|
|
4
6
|
export declare function getUserDetails(query: string, role: UserRole | string): Promise<{
|
|
5
7
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/user.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAe3D;AACD,wBAAsB,cAAc,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,QAAQ,GAAG,MAAM,GACxB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBrG;AAED,eAAO,MAAM,OAAO;wBAEU,MAAM,QAAQ,MAAM;eAED,MAAM;cAAQ,GAAG;;;;;0BAQlC,MAAM,QAAQ,MAAM;eAEH,MAAM;cAAQ,GAAG;;;;;;;6BA4B/B,MAAM,QAAQ,MAAM;mBAEoB,OAAO;oBAAc,OAAO;;CAOtG,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,WAAW,uBAAiB,CAAC;AAE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AO;;CAOtG,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,WAAW,uBAAiB,CAAC;AAE1C,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,CAAC,CAiB5O"}
|
package/dist/lib/actions/user.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { get, post } from "./fetcher";
|
|
2
2
|
import { getAccountType } from "./serverActions";
|
|
3
3
|
const BASE_PATH = "/users";
|
|
4
|
+
/** Strict session read for native restoration: outages must not look signed out. */
|
|
5
|
+
export async function getTravellerSessionUser() {
|
|
6
|
+
const response = await get("/users/me");
|
|
7
|
+
return response.data;
|
|
8
|
+
}
|
|
4
9
|
export async function getCurrentUser() {
|
|
5
10
|
try {
|
|
6
11
|
const accountType = await getAccountType();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogueLocations.d.ts","sourceRoot":"","sources":["../../../src/lib/data/catalogueLocations.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAmB5C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Exact legacy website catalogue city suggestions; distinct from the richer destination directory. */
|
|
2
|
+
export const WEBSITE_DISCOVERY_CITIES = [
|
|
3
|
+
"Manali", "Shimla", "Spiti Valley", "Kasol", "Mcleod Ganj", "Dharamshala", "Dalhousie", "Kullu", "Kinnaur",
|
|
4
|
+
"Rishikesh", "Haridwar", "Nainital", "Mussoorie", "Dehradun", "Auli", "Lansdowne", "Ranikhet", "Jim Corbett", "Chopta",
|
|
5
|
+
"Darjeeling", "Kalimpong", "Gangtok", "Pelling", "Lachung",
|
|
6
|
+
"Shillong", "Cherrapunji", "Mawlynnong", "Tawang", "Ziro",
|
|
7
|
+
"Srinagar", "Gulmarg", "Pahalgam", "Sonamarg", "Vaishno Devi",
|
|
8
|
+
"Ladakh", "Leh", "Nubra Valley", "Pangong Lake", "Tso Moriri", "Zanskar Valley",
|
|
9
|
+
"Jaipur", "Udaipur", "Jodhpur", "Jaisalmer", "Pushkar", "Ajmer", "Bikaner", "Mount Abu", "Ranthambore", "Bundi", "Chittorgarh",
|
|
10
|
+
"Goa", "Panaji", "Calangute", "Arambol", "Palolem",
|
|
11
|
+
"Munnar", "Alleppey", "Varkala", "Kochi", "Wayanad", "Thekkady", "Kozhikode", "Kovalam", "Kannur", "Vagamon",
|
|
12
|
+
"Ooty", "Kodaikanal", "Chennai", "Madurai", "Coimbatore", "Pondicherry", "Rameswaram", "Kanyakumari", "Mahabalipuram", "Yercaud",
|
|
13
|
+
"Coorg", "Mysore", "Bangalore", "Hampi", "Badami", "Chikmagalur", "Dandeli", "Mangalore", "Udupi", "Gokarna", "Sakleshpur", "Nagarhole",
|
|
14
|
+
"Mumbai", "Pune", "Mahabaleshwar", "Lonavala", "Alibaug", "Aurangabad", "Nagpur", "Nashik", "Shirdi", "Kolhapur", "Matheran", "Tadoba",
|
|
15
|
+
"Ahmedabad", "Surat", "Rann of Kutch", "Dwarka", "Somnath", "Gir", "Vadodara", "Rajkot", "Mandvi", "Saputara",
|
|
16
|
+
"Varanasi", "Agra", "Lucknow", "Prayagraj", "Mathura", "Vrindavan", "Ayodhya", "Kanpur",
|
|
17
|
+
"Delhi", "Kolkata", "Hyderabad", "Chandigarh", "Amritsar", "Bhubaneswar", "Patna",
|
|
18
|
+
"Andaman Islands", "Havelock Island", "Lakshadweep", "Puri", "Vizag", "Tirupati",
|
|
19
|
+
"Khajuraho", "Bhopal", "Indore", "Ujjain", "Orchha", "Pachmarhi", "Bandhavgarh", "Kanha",
|
|
20
|
+
"Kaziranga", "Guwahati", "Majuli", "Imphal", "Kohima", "Shillong",
|
|
21
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../src/lib/data/skills.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,eAAO,MAAM,aAAa;;GA+FzB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Existing website suggestions; custom application skills remain supported. */
|
|
2
|
+
export const skillsOptions = [
|
|
3
|
+
{ title: "Graphic Design" },
|
|
4
|
+
{ title: "Branding" },
|
|
5
|
+
{ title: "UI/UX" },
|
|
6
|
+
{ title: "Motion Graphics" },
|
|
7
|
+
{ title: "Video Editing" },
|
|
8
|
+
{ title: "Photography" },
|
|
9
|
+
{ title: "Illustration" },
|
|
10
|
+
{ title: "Copywriting" },
|
|
11
|
+
{ title: "Content Writing" },
|
|
12
|
+
{ title: "Social Media" },
|
|
13
|
+
{ title: "SEO" },
|
|
14
|
+
{ title: "UX Research" },
|
|
15
|
+
{ title: "AR Design" },
|
|
16
|
+
{ title: "3D Modeling" },
|
|
17
|
+
{ title: "Typography" },
|
|
18
|
+
{ title: "Email Marketing" },
|
|
19
|
+
{ title: "Influencer Marketing" },
|
|
20
|
+
{ title: "Growth Hacking" },
|
|
21
|
+
{ title: "No-Code Development" },
|
|
22
|
+
{ title: "Art Direction" },
|
|
23
|
+
{ title: "Web Development" },
|
|
24
|
+
{ title: "E-commerce" },
|
|
25
|
+
{ title: "Podcasting" },
|
|
26
|
+
{ title: "Data Visualization" },
|
|
27
|
+
{ title: "Advertising" },
|
|
28
|
+
{ title: "Web Animation" },
|
|
29
|
+
{ title: "Music Production" },
|
|
30
|
+
{ title: "NFT Strategy" },
|
|
31
|
+
{ title: "AI Content Creation" },
|
|
32
|
+
{ title: "Innovator" },
|
|
33
|
+
{ title: "Writer" },
|
|
34
|
+
{ title: "Content Creator" },
|
|
35
|
+
{ title: "Photographer" },
|
|
36
|
+
{ title: "Videographer" },
|
|
37
|
+
{ title: "Musician" },
|
|
38
|
+
{ title: "Comedian" },
|
|
39
|
+
{ title: "Architect" },
|
|
40
|
+
{ title: "Interior Design" },
|
|
41
|
+
{ title: "Event Management" },
|
|
42
|
+
{ title: "Community Engagement" },
|
|
43
|
+
{ title: "Chef" },
|
|
44
|
+
{ title: "Teacher" },
|
|
45
|
+
{ title: "Wildlife Conservation" },
|
|
46
|
+
{ title: "Hospitality Management" },
|
|
47
|
+
{ title: "Web Designer" },
|
|
48
|
+
{ title: "Digital Marketing" },
|
|
49
|
+
{ title: "Sales" },
|
|
50
|
+
{ title: "Business Development" },
|
|
51
|
+
{ title: "Public Relations" },
|
|
52
|
+
{ title: "HR" },
|
|
53
|
+
{ title: "Supply Chain" },
|
|
54
|
+
{ title: "Operations" },
|
|
55
|
+
{ title: "Farming" },
|
|
56
|
+
{ title: "Tour Guide" },
|
|
57
|
+
{ title: "Gardening" },
|
|
58
|
+
{ title: "Bartending" },
|
|
59
|
+
{ title: "Kitchen Help" },
|
|
60
|
+
{ title: "Pottery" },
|
|
61
|
+
{ title: "Jewelry Design" },
|
|
62
|
+
{ title: "Scientist" },
|
|
63
|
+
{ title: "Language Teaching" },
|
|
64
|
+
{ title: "Artist" },
|
|
65
|
+
{ title: "Grant Writing" },
|
|
66
|
+
{ title: "Waste Management" },
|
|
67
|
+
{ title: "Experience Design" },
|
|
68
|
+
{ title: "Wall Art" },
|
|
69
|
+
{ title: "Upcycling" },
|
|
70
|
+
{ title: "Party Promotion" },
|
|
71
|
+
{ title: "Crafting" },
|
|
72
|
+
{ title: "Social Media Management" },
|
|
73
|
+
{ title: "Community Management" },
|
|
74
|
+
{ title: "Creative Writing" },
|
|
75
|
+
{ title: "Blogging" },
|
|
76
|
+
{ title: "Scriptwriting" },
|
|
77
|
+
{ title: "Voiceover" },
|
|
78
|
+
{ title: "Animation" },
|
|
79
|
+
{ title: "Photo Editing" },
|
|
80
|
+
{ title: "Sound Design" },
|
|
81
|
+
{ title: "Live Streaming" },
|
|
82
|
+
{ title: "Wireframing" },
|
|
83
|
+
{ title: "Prototyping" },
|
|
84
|
+
{ title: "Visual Design" },
|
|
85
|
+
{ title: "Campaign Strategy" },
|
|
86
|
+
{ title: "Marketing Strategy" },
|
|
87
|
+
{ title: "Content Strategy" },
|
|
88
|
+
{ title: "Creative Strategy" },
|
|
89
|
+
{ title: "Digital Illustration" },
|
|
90
|
+
{ title: "Color Grading" },
|
|
91
|
+
{ title: "Editing" },
|
|
92
|
+
{ title: "Subtitling" },
|
|
93
|
+
{ title: "Voice Editing" },
|
|
94
|
+
{ title: "Photography Styling" },
|
|
95
|
+
{ title: "Property Management" },
|
|
96
|
+
{ title: "Decoration" },
|
|
97
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ApplicationInput } from "../models/application";
|
|
2
|
+
/** The existing multipart endpoints strip sentinel values around skills. */
|
|
3
|
+
export declare function applicationFormData(input: ApplicationInput, editing?: boolean): FormData;
|
|
4
|
+
//# sourceMappingURL=application.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../src/lib/forms/application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,4EAA4E;AAC5E,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,gBAAgB,EACvB,OAAO,UAAQ,GACd,QAAQ,CAYV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { appendUploadFile } from "../utils/uploadFile";
|
|
2
|
+
/** The existing multipart endpoints strip sentinel values around skills. */
|
|
3
|
+
export function applicationFormData(input, editing = false) {
|
|
4
|
+
const body = new FormData();
|
|
5
|
+
body.append("opportunityId", input.opportunityId);
|
|
6
|
+
body.append("skills", "start");
|
|
7
|
+
input.skills.forEach((skill) => body.append("skills", skill));
|
|
8
|
+
body.append("skills", "end");
|
|
9
|
+
body.append("fromDate", input.fromDate);
|
|
10
|
+
body.append("toDate", input.toDate);
|
|
11
|
+
body.append("helpAnswer", input.helpAnswer);
|
|
12
|
+
if (input.resume)
|
|
13
|
+
appendUploadFile(body, "resume", input.resume);
|
|
14
|
+
if (editing)
|
|
15
|
+
body.append("status", "pending");
|
|
16
|
+
return body;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageEnquiry.d.ts","sourceRoot":"","sources":["../../../src/lib/forms/packageEnquiry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,yEAAyE;AACzE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,QAAQ,CAS3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The create route uses multer.none and JSON-encoded activity names. */
|
|
2
|
+
export function packageEnquiryFormData(input) {
|
|
3
|
+
const body = new FormData();
|
|
4
|
+
body.append("packageId", input.packageId);
|
|
5
|
+
body.append("males", String(input.males));
|
|
6
|
+
body.append("females", String(input.females));
|
|
7
|
+
body.append("message", input.message);
|
|
8
|
+
if (input.desiredStartDate)
|
|
9
|
+
body.append("desiredStartDate", input.desiredStartDate);
|
|
10
|
+
body.append("selectedActivities", JSON.stringify(input.selectedActivities));
|
|
11
|
+
return body;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReviewFormData, reviewTargetType } from "../models/review";
|
|
2
|
+
export declare function reviewRequestBody(input: ReviewFormData, target?: {
|
|
3
|
+
id: string;
|
|
4
|
+
type: reviewTargetType;
|
|
5
|
+
}): FormData | Record<string, unknown>;
|
|
6
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/lib/forms/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,MAAM,CAAC,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC9C,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmBpC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { appendUploadFile } from "../utils/uploadFile";
|
|
2
|
+
export function reviewRequestBody(input, target) {
|
|
3
|
+
const images = input.images?.filter((image) => typeof image !== "string") || [];
|
|
4
|
+
if (images.length) {
|
|
5
|
+
const body = new FormData();
|
|
6
|
+
if (target) {
|
|
7
|
+
body.append("reviewee", target.id);
|
|
8
|
+
body.append("revieweeType", target.type);
|
|
9
|
+
}
|
|
10
|
+
body.append("rating", String(input.rating));
|
|
11
|
+
body.append("comment", input.comment || "");
|
|
12
|
+
images.forEach((image) => appendUploadFile(body, "images", image));
|
|
13
|
+
return body;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...(target ? { reviewee: target.id, revieweeType: target.type } : {}),
|
|
17
|
+
rating: input.rating,
|
|
18
|
+
comment: input.comment,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -21,6 +21,27 @@ export interface Application {
|
|
|
21
21
|
tripEndDate: string;
|
|
22
22
|
createdAt: string;
|
|
23
23
|
updatedAt: string;
|
|
24
|
+
isDeleted?: boolean;
|
|
25
|
+
membershipAccessSnapshot?: {
|
|
26
|
+
requiredTier?: string;
|
|
27
|
+
currentTier?: string;
|
|
28
|
+
requirementStatus?: string;
|
|
29
|
+
passUsed?: boolean;
|
|
30
|
+
benefitKey?: string;
|
|
31
|
+
lifetimeLimit?: number;
|
|
32
|
+
};
|
|
24
33
|
}
|
|
34
|
+
/** Common traveller form supported by every opportunity category. */
|
|
35
|
+
export interface ApplicationInput {
|
|
36
|
+
opportunityId: string;
|
|
37
|
+
skills: string[];
|
|
38
|
+
fromDate: string;
|
|
39
|
+
toDate: string;
|
|
40
|
+
helpAnswer: string;
|
|
41
|
+
resume?: import('../utils/uploadFile').UploadFile;
|
|
42
|
+
}
|
|
43
|
+
export type ApplicationSummary = Pick<Application, '_id' | 'status' | 'tripStartDate' | 'tripEndDate' | 'opportunityId' | 'opportunityType' | 'hostId' | 'opportunityTitle'> & {
|
|
44
|
+
isDeleted?: boolean;
|
|
45
|
+
};
|
|
25
46
|
export declare const mockApplications: Application[];
|
|
26
47
|
//# sourceMappingURL=application.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../src/lib/models/application.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElG,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,WAAW,GAAG,gBAAgB,CAAC;IACtF,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAA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C;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3K;AAED,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,qBAAqB,EAAE,UAAU,CAAC;CACrD;AACD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,eAAe,GAAG,iBAAiB,GAAG,QAAQ,GAAG,kBAAkB,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvM,eAAO,MAAM,gBAAgB,EAAE,WAAW,EAiIzC,CAAC"}
|
|
@@ -110,7 +110,7 @@ export declare function canAccessListingEditor(actor: PermissionAwareActor | nul
|
|
|
110
110
|
export declare function canAccessOpportunityApplicationReview(actor: PermissionAwareActor | null | undefined): boolean;
|
|
111
111
|
export declare function canManageOpportunityApplicationReview(actor: PermissionAwareActor | null | undefined): boolean;
|
|
112
112
|
export declare function getOpportunityApplicationApprovalStatus(actor: PermissionAwareActor | null | undefined): "adminApproved" | "approved";
|
|
113
|
-
export declare function getAdminDashboardRoutePermissions(pathname: string): readonly ["listings.moderate"] | readonly ["content.moderate"] | readonly ["payouts.read", "payouts.record"] | readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"] | readonly ["verification.read", "verification.manage", "users.manage", "hosts.manage", "staff.manage"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly ["itinerary_orders.read.all", "itinerary_orders.fulfill", "itinerary_orders.refunds.manage"] | readonly [];
|
|
113
|
+
export declare function getAdminDashboardRoutePermissions(pathname: string): readonly ["listings.moderate"] | readonly ["content.moderate"] | readonly ["payouts.read", "payouts.record"] | readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"] | readonly ["verification.read", "verification.manage", "users.manage", "hosts.manage", "staff.manage"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly ["platform.settings.manage"] | readonly ["itinerary_orders.read.all", "itinerary_orders.fulfill", "itinerary_orders.refunds.manage"] | readonly [];
|
|
114
114
|
export declare function hasAdminDashboardRouteAccess(actor: PermissionAwareActor | null | undefined, pathname: string): boolean;
|
|
115
115
|
export declare function getHostDashboardRoutePermissions(pathname: string): readonly ["listings.moderate"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly [] | readonly ["listings.create"];
|
|
116
116
|
export declare function hasHostDashboardRouteAccess(actor: PermissionAwareActor | null | undefined, pathname: string): boolean;
|