@myrjfa/state 2.3.6 → 3.0.0

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.
Files changed (67) hide show
  1. package/dist/index.d.ts +11 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +11 -0
  4. package/dist/lib/actions/auth.d.ts.map +1 -1
  5. package/dist/lib/actions/auth.js +40 -15
  6. package/dist/lib/actions/chat.d.ts +1 -1
  7. package/dist/lib/actions/chat.d.ts.map +1 -1
  8. package/dist/lib/actions/fetcher.d.ts +2 -1
  9. package/dist/lib/actions/fetcher.d.ts.map +1 -1
  10. package/dist/lib/actions/fetcher.js +4 -3
  11. package/dist/lib/adminDashboardActions.d.ts +76 -0
  12. package/dist/lib/adminDashboardActions.d.ts.map +1 -1
  13. package/dist/lib/adminDashboardActions.js +53 -0
  14. package/dist/lib/analyticsActions.d.ts +18 -0
  15. package/dist/lib/analyticsActions.d.ts.map +1 -0
  16. package/dist/lib/analyticsActions.js +25 -0
  17. package/dist/lib/authorizationActions.d.ts +16 -0
  18. package/dist/lib/authorizationActions.d.ts.map +1 -1
  19. package/dist/lib/authorizationActions.js +10 -1
  20. package/dist/lib/b2bActions.d.ts +25 -0
  21. package/dist/lib/b2bActions.d.ts.map +1 -0
  22. package/dist/lib/b2bActions.js +8 -0
  23. package/dist/lib/brandActions.d.ts +16 -0
  24. package/dist/lib/brandActions.d.ts.map +1 -1
  25. package/dist/lib/brandActions.js +12 -1
  26. package/dist/lib/communityActions.d.ts +37 -0
  27. package/dist/lib/communityActions.d.ts.map +1 -0
  28. package/dist/lib/communityActions.js +35 -0
  29. package/dist/lib/companionActions.d.ts +11 -0
  30. package/dist/lib/companionActions.d.ts.map +1 -1
  31. package/dist/lib/companionActions.js +14 -0
  32. package/dist/lib/creatorMarketplaceActions.d.ts +25 -0
  33. package/dist/lib/creatorMarketplaceActions.d.ts.map +1 -0
  34. package/dist/lib/creatorMarketplaceActions.js +8 -0
  35. package/dist/lib/hooks/useContextualConversation.d.ts +1 -1
  36. package/dist/lib/hooks/useContextualConversation.d.ts.map +1 -1
  37. package/dist/lib/hostDashboardActions.d.ts.map +1 -1
  38. package/dist/lib/hostDashboardActions.js +16 -2
  39. package/dist/lib/itineraryActions.d.ts +7 -0
  40. package/dist/lib/itineraryActions.d.ts.map +1 -0
  41. package/dist/lib/itineraryActions.js +26 -0
  42. package/dist/lib/locationActions.d.ts +2 -1
  43. package/dist/lib/locationActions.d.ts.map +1 -1
  44. package/dist/lib/marketplaceContractActions.d.ts +25 -0
  45. package/dist/lib/marketplaceContractActions.d.ts.map +1 -0
  46. package/dist/lib/marketplaceContractActions.js +17 -0
  47. package/dist/lib/models/analytics.d.ts +33 -0
  48. package/dist/lib/models/analytics.d.ts.map +1 -0
  49. package/dist/lib/models/analytics.js +1 -0
  50. package/dist/lib/models/authorization.d.ts +5 -3
  51. package/dist/lib/models/authorization.d.ts.map +1 -1
  52. package/dist/lib/models/authorization.js +26 -2
  53. package/dist/lib/models/chat.d.ts +1 -1
  54. package/dist/lib/models/chat.d.ts.map +1 -1
  55. package/dist/lib/models/community.d.ts +255 -0
  56. package/dist/lib/models/community.d.ts.map +1 -0
  57. package/dist/lib/models/community.js +1 -0
  58. package/dist/lib/models/itinerary.d.ts +18 -0
  59. package/dist/lib/models/itinerary.d.ts.map +1 -0
  60. package/dist/lib/models/itinerary.js +1 -0
  61. package/dist/lib/models/marketplace.d.ts +245 -0
  62. package/dist/lib/models/marketplace.d.ts.map +1 -0
  63. package/dist/lib/models/marketplace.js +1 -0
  64. package/dist/lib/models/stay.d.ts +2 -2
  65. package/dist/lib/placeActions.d.ts +11 -0
  66. package/dist/lib/placeActions.d.ts.map +1 -1
  67. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { get, post } from "@myrjfa/state/dist/lib/actions/fetcher";
1
+ import { get, post, put } from "@myrjfa/state/dist/lib/actions/fetcher";
2
2
  export async function fetchBrandPage(slug) {
3
3
  try {
4
4
  const data = await get(`/brands/${slug}`);
@@ -26,3 +26,14 @@ export async function activateAdPlacement(slug, payload) {
26
26
  return { success: false, error: err.message };
27
27
  }
28
28
  }
29
+ export async function getCreatorPlacementReviewQueue() {
30
+ const data = await get("/ads/creator-placements/review-queue", true);
31
+ return data.data || [];
32
+ }
33
+ export async function reviewCreatorPlacement(placementId, decision, reason) {
34
+ const data = await put(`/ads/creator-placements/${placementId}/review`, {
35
+ decision,
36
+ reason,
37
+ });
38
+ return data.data;
39
+ }
@@ -0,0 +1,37 @@
1
+ import type { CommunityComment, CommunityContent, CommunityEntitySearchKind, CommunityEntitySearchPage, CommunityModerationQueue, CommunityPlaceContentPage, CommunityPreferences, CommunitySearchPage, CommunityVideoPosterUpload, ContentPage, CreateCommunityContentInput, FeedPage } from "./models/community";
2
+ export declare const getCommunityFeed: (mode?: "for_you" | "following", cursor?: string, sessionId?: string) => Promise<FeedPage>;
3
+ export declare const getCommunityContent: (slug: string, authenticated?: boolean) => Promise<CommunityContent>;
4
+ export declare const getAuthorCommunityContent: (actorType: "user" | "host", username: string, cursor?: string) => Promise<ContentPage>;
5
+ export declare const getPlaceCommunityContent: (slugPath: string, cursor?: string) => Promise<CommunityPlaceContentPage>;
6
+ export declare const searchCommunityContent: (query: string, cursor?: string) => Promise<CommunitySearchPage>;
7
+ export declare const searchCommunityEntities: (type: CommunityEntitySearchKind, query?: string, limit?: number) => Promise<CommunityEntitySearchPage>;
8
+ export declare const createCommunityContent: (input: CreateCommunityContentInput) => Promise<CommunityContent>;
9
+ export declare const uploadCommunityAssets: (files: File[], videoPosters?: CommunityVideoPosterUpload[]) => Promise<import("./models/community").CommunityMedia[]>;
10
+ export declare const updateCommunityContent: (id: string, input: Partial<CreateCommunityContentInput>) => Promise<CommunityContent>;
11
+ export declare const deleteCommunityContent: (id: string) => Promise<unknown>;
12
+ export declare const setCommunityReaction: (contentId: string, kind: "like" | "bookmark", enabled: boolean) => Promise<{
13
+ enabled: boolean;
14
+ }>;
15
+ export declare const getCommunityComments: (contentId: string) => Promise<CommunityComment[]>;
16
+ export declare const addCommunityComment: (contentId: string, body: string, parentId?: string) => Promise<CommunityComment>;
17
+ export declare const deleteCommunityComment: (commentId: string) => Promise<{
18
+ deleted: number;
19
+ }>;
20
+ export declare const followCommunityTarget: (targetId: string, targetModel: "User" | "HostProfile" | "Brand", enabled: boolean, attribution?: {
21
+ sourceContentId?: string;
22
+ impressionId?: string;
23
+ notificationsMuted?: boolean;
24
+ }) => Promise<{
25
+ following: boolean;
26
+ }>;
27
+ export declare const getCommunityFollowState: (targetId: string, targetModel: "User" | "HostProfile" | "Brand") => Promise<{
28
+ following: boolean;
29
+ }>;
30
+ export declare const saveCommunityPreferences: (input: Partial<CommunityPreferences>) => Promise<CommunityPreferences>;
31
+ export declare const getCommunityPreferences: () => Promise<CommunityPreferences>;
32
+ export declare const reportCommunityContent: (contentId: string, reason: string) => Promise<unknown>;
33
+ export declare const getCommunityModerationQueue: (limit?: number) => Promise<CommunityModerationQueue>;
34
+ export declare const moderateCommunityContent: (contentId: string, moderationState: "approved" | "rejected" | "hidden", reason?: string) => Promise<CommunityContent>;
35
+ export declare const moderateCommunityComment: (commentId: string, moderationState: "approved" | "rejected" | "hidden", reason?: string) => Promise<CommunityComment>;
36
+ export declare const recordCommunityShare: (contentId: string) => Promise<unknown>;
37
+ //# sourceMappingURL=communityActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communityActions.d.ts","sourceRoot":"","sources":["../../src/lib/communityActions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnT,eAAO,MAAM,gBAAgB,GAAU,OAAM,SAAS,GAAG,WAAuB,EAAE,SAAS,M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E,cAAc;IAAE,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE;eAAsC,OAAO;EAAoF,CAAC;AAChW,eAAO,MAAM,uBAAuB,GAAU,UAAU,MAAM,EAAE,aAAa,MAAM,GAAG,aAAa,GAAG,OAAO;eAAsC,OAAO;EAA2D,CAAC;AACtN,eAAO,MAAM,wBAAwB,GAAU,OAAO,OAAO,CAAC,oBAAoB,CAAC,kCAAsF,CAAC;AAC1K,eAAO,MAAM,uBAAuB,qCAAyF,CAAC;AAC9H,eAAO,MAAM,sBAAsB,GAAU,WAAW,MAAM,EAAE,QAAQ,MAAM,qBAA+F,CAAC;AAC9K,eAAO,MAAM,2BAA2B,GAAU,cAAU,sCAAmI,CAAC;AAChM,eAAO,MAAM,wBAAwB,GAAU,WAAW,MAAM,EAAE,iBAAiB,UAAU,GAAG,UAAU,GAAG,QAAQ,EAAE,eAAW,8BAA4H,CAAC;AAC/P,eAAO,MAAM,wBAAwB,GAAU,WAAW,MAAM,EAAE,iBAAiB,UAAU,GAAG,UAAU,GAAG,QAAQ,EAAE,eAAW,8BAA6H,CAAC;AAChQ,eAAO,MAAM,oBAAoB,GAAU,WAAW,MAAM,qBAAsF,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { del, get, patch, post, put } from "./actions/fetcher";
2
+ export const getCommunityFeed = async (mode = "for_you", cursor, sessionId) => (await get(`/community/feed?mode=${mode}${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""}${sessionId ? `&sessionId=${encodeURIComponent(sessionId)}` : ""}`)).data;
3
+ export const getCommunityContent = async (slug, authenticated = true) => (await get(`/community/content/${encodeURIComponent(slug)}`, authenticated)).data;
4
+ export const getAuthorCommunityContent = async (actorType, username, cursor) => (await get(`/community/authors/${actorType}/${encodeURIComponent(username)}/content${cursor ? `?cursor=${encodeURIComponent(cursor)}` : ""}`)).data;
5
+ export const getPlaceCommunityContent = async (slugPath, cursor) => (await get(`/community/places/content?slugPath=${encodeURIComponent(slugPath)}${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""}`)).data;
6
+ export const searchCommunityContent = async (query, cursor) => (await get(`/community/search?q=${encodeURIComponent(query)}${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""}`)).data;
7
+ export const searchCommunityEntities = async (type, query = "", limit = 12) => (await get(`/community/entities?type=${type}&q=${encodeURIComponent(query)}&limit=${Math.max(1, Math.min(limit, 20))}`)).data;
8
+ export const createCommunityContent = async (input) => (await post("/community/content", input)).data;
9
+ export const uploadCommunityAssets = async (files, videoPosters = []) => {
10
+ const form = new FormData();
11
+ files.slice(0, 10).forEach((file) => form.append("portfolio", file));
12
+ const validPosters = videoPosters
13
+ .filter(({ assetIndex }) => Number.isInteger(assetIndex) && assetIndex >= 0 && assetIndex < Math.min(files.length, 10))
14
+ .slice(0, 10);
15
+ if (validPosters.length) {
16
+ form.append("videoPosterIndexes", JSON.stringify(validPosters.map(({ assetIndex }) => assetIndex)));
17
+ validPosters.forEach(({ file }) => form.append("videoPoster", file));
18
+ }
19
+ return (await post("/community/assets", form)).data;
20
+ };
21
+ export const updateCommunityContent = async (id, input) => (await patch(`/community/content/${id}`, input)).data;
22
+ export const deleteCommunityContent = async (id) => (await del(`/community/content/${id}`)).data;
23
+ export const setCommunityReaction = async (contentId, kind, enabled) => (await put(`/community/content/${contentId}/${kind}`, { enabled })).data;
24
+ export const getCommunityComments = async (contentId) => (await get(`/community/content/${contentId}/comments`)).data;
25
+ export const addCommunityComment = async (contentId, body, parentId) => (await post(`/community/content/${contentId}/comments`, { body, parentId })).data;
26
+ export const deleteCommunityComment = async (commentId) => (await del(`/community/comments/${commentId}`)).data;
27
+ export const followCommunityTarget = async (targetId, targetModel, enabled, attribution) => (await put("/community/follows", { targetId, targetModel, enabled, ...attribution })).data;
28
+ export const getCommunityFollowState = async (targetId, targetModel) => (await get(`/community/follows/${targetModel}/${targetId}`)).data;
29
+ export const saveCommunityPreferences = async (input) => (await put("/community/preferences", input)).data;
30
+ export const getCommunityPreferences = async () => (await get("/community/preferences")).data;
31
+ export const reportCommunityContent = async (contentId, reason) => (await post(`/community/content/${contentId}/report`, { reason })).data;
32
+ export const getCommunityModerationQueue = async (limit = 40) => (await get(`/community/moderation/queue?limit=${Math.max(1, Math.min(limit, 100))}`)).data;
33
+ export const moderateCommunityContent = async (contentId, moderationState, reason = "") => (await put(`/community/moderation/content/${contentId}`, { moderationState, reason })).data;
34
+ export const moderateCommunityComment = async (commentId, moderationState, reason = "") => (await put(`/community/moderation/comments/${commentId}`, { moderationState, reason })).data;
35
+ export const recordCommunityShare = async (contentId) => (await post(`/community/content/${contentId}/share`, {})).data;
@@ -25,6 +25,17 @@ export declare function createTravelPlan(planData: any): Promise<{
25
25
  plan: any;
26
26
  error?: undefined;
27
27
  }>;
28
+ export declare function createTravelPlanFromItinerary(itineraryId: string, inviteCount: number): Promise<{
29
+ success: boolean;
30
+ error: any;
31
+ plan?: undefined;
32
+ message?: undefined;
33
+ } | {
34
+ success: boolean;
35
+ plan: any;
36
+ message: any;
37
+ error?: undefined;
38
+ }>;
28
39
  export declare function getTravelPlans(filters?: Record<string, string>): Promise<{
29
40
  success: boolean;
30
41
  error: any;
@@ -1 +1 @@
1
- {"version":3,"file":"companionActions.d.ts","sourceRoot":"","sources":["../../src/lib/companionActions.ts"],"names":[],"mappings":"AAyCA,wBAAsB,kBAAkB;;;;;;;;GAQvC;AAED,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,GAAG;;;;;;;;GAWzD;AAID,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,GAAG;;;;;;;;GAWnD;AAED,wBAAsB,cAAc,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;;;;;;;;;;GASxE;AAED,wBAAsB,aAAa,CAAC,EAAE,EAAE,MAAM;;;;;;;;GAQ7C;AAED,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,M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AM;;;;;;;;;;GAYpB;AAED,wBAAsB,cAAc,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;;;;;;;;;;GASxE;AAED,wBAAsB,aAAa,CAAC,EAAE,EAAE,MAAM;;;;;;;;GAQ7C;AAED,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG;;;;;;;;GAW/D;AAED,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM;;;;;;;;GAQhD;AAED,wBAAsB,cAAc,CAAC,EAAE,EAAE,MAAM;;;;;;;;GAQ9C;AAED,wBAAsB,gBAAgB;;;;;;;;GAQrC;AAED,wBAAsB,iBAAiB;;;;;;;;GAQtC;AAID,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;;;;;;;;GAWrE;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM;;;;;;;;GAQnD;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,GAAG,UAAU;;;;;;GAYhC;AAID,wBAAsB,aAAa,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;;;;;;;;GASvE;AAED,wBAAsB,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;;;;;;;;GAW5E;AAED,wBAAsB,iBAAiB;;;;;;;;GAQtC;AAED,wBAAsB,aAAa,CACjC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GAAG,MAAM;;;;;;;;;;GAgBxB;AAID,wBAAsB,YAAY;;;;;;;;GAQjC;AAID,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM;;;;;;;;GAW5D"}
@@ -70,6 +70,20 @@ export async function createTravelPlan(planData) {
70
70
  return { success: false, error: "Failed to create travel plan" };
71
71
  }
72
72
  }
73
+ export async function createTravelPlanFromItinerary(itineraryId, inviteCount) {
74
+ try {
75
+ const data = await authFetch(`/plans/from-itinerary/${encodeURIComponent(itineraryId)}`, {
76
+ method: "POST",
77
+ body: JSON.stringify({ inviteCount }),
78
+ });
79
+ if (data.statusCode >= 400)
80
+ return { success: false, error: data.message };
81
+ return { success: true, plan: data.data, message: data.message };
82
+ }
83
+ catch {
84
+ return { success: false, error: "We could not post this trip. Please try again." };
85
+ }
86
+ }
73
87
  export async function getTravelPlans(filters = {}) {
74
88
  try {
75
89
  const query = new URLSearchParams(filters).toString();
@@ -0,0 +1,25 @@
1
+ import type { CreatorBrief, CreatorInvitation, CreatorProfile, OwnedCreatorProfile } from "./models/marketplace";
2
+ export interface OwnedCreatorBrand {
3
+ _id: string;
4
+ name: string;
5
+ slug: string;
6
+ logo?: string;
7
+ }
8
+ export declare const getOwnedCreatorBrands: () => Promise<OwnedCreatorBrand[]>;
9
+ export declare const getOwnedCreatorProfile: () => Promise<OwnedCreatorProfile>;
10
+ export declare const searchCreators: (filters?: {
11
+ service?: string;
12
+ area?: string;
13
+ availability?: string;
14
+ }) => Promise<CreatorProfile[]>;
15
+ export declare const saveCreatorProfile: (input: Partial<CreatorProfile>) => Promise<CreatorProfile>;
16
+ export declare const inviteCreator: (input: {
17
+ brandId: string;
18
+ creatorProfileId: string;
19
+ opportunityId?: string;
20
+ message?: string;
21
+ brief: CreatorBrief;
22
+ }) => Promise<unknown>;
23
+ export declare const getCreatorInvitations: () => Promise<CreatorInvitation[]>;
24
+ export declare const actOnCreatorInvitation: (invitationId: string, action: "accept" | "decline" | "withdraw") => Promise<CreatorInvitation>;
25
+ //# sourceMappingURL=creatorMarketplaceActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"creatorMarketplaceActions.d.ts","sourceRoot":"","sources":["../../src/lib/creatorMarketplaceActions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEjH,MAAM,WAAW,iBAAiB;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;AAC7F,eAAO,MAAM,qBAAqB,oCAA6F,CAAC;AAChI,eAAO,MAAM,sBAAsB,oCAA8F,CAAC;AAClI,eAAO,MAAM,cAAc,GAAU,UAAS;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,8BAAkH,CAAC;AAChO,eAAO,MAAM,kBAAkB,GAAU,OAAO,OAAO,CAAC,cAAc,CAAC,4BAAsF,CAAC;AAC9J,eAAO,MAAM,aAAa,GAAU,OAAO;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,qBAAoF,CAAC;AAC5O,eAAO,MAAM,qBAAqB,oCAAkG,CAAC;AACrI,eAAO,MAAM,sBAAsB,GAAU,cAAc,MAAM,EAAE,QAAQ,QAAQ,GAAG,SAAS,GAAG,UAAU,+BAAsH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { get, patch, post, put } from "./actions/fetcher";
2
+ export const getOwnedCreatorBrands = async () => (await get("/creator-marketplace/brands")).data;
3
+ export const getOwnedCreatorProfile = async () => (await get("/creator-marketplace/profile")).data;
4
+ export const searchCreators = async (filters = {}) => (await get(`/creator-marketplace/creators?${new URLSearchParams(filters)}`)).data;
5
+ export const saveCreatorProfile = async (input) => (await put("/creator-marketplace/profile", input)).data;
6
+ export const inviteCreator = async (input) => (await post("/creator-marketplace/invitations", input)).data;
7
+ export const getCreatorInvitations = async () => (await get("/creator-marketplace/invitations")).data;
8
+ export const actOnCreatorInvitation = async (invitationId, action) => (await patch(`/creator-marketplace/invitations/${invitationId}/${action}`, {})).data;
@@ -2,7 +2,7 @@ import type { ChatActorModel, Conversation } from "../models/chat";
2
2
  export interface ContextualConversationInput {
3
3
  participantId?: string | null;
4
4
  participantModel: ChatActorModel;
5
- contextType?: "direct" | "booking" | "listing" | "companionMatch";
5
+ contextType?: "direct" | "booking" | "listing" | "companionMatch" | "communityPost";
6
6
  contextId?: string | null;
7
7
  contextModel?: string | null;
8
8
  enabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useContextualConversation.d.ts","sourceRoot":"","sources":["../../../src/lib/hooks/useContextualConversation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,2BAA2B;IACxC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,cAAc,CAAC;IACjC,WAAW,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,gBAAgB,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,yBAAyB,CAAC,EACtC,aAAa,EACb,gBAAgB,EAChB,WAAsB,EACtB,SAAS,EACT,YAAY,EACZ,OAAc,GACjB,EAAE,2BAA2B;;;;EAoE7B"}
1
+ {"version":3,"file":"useContextualConversation.d.ts","sourceRoot":"","sources":["../../../src/lib/hooks/useContextualConversation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,2BAA2B;IACxC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAg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sB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;GAOlE;AAED,wBAAsB,aAAa;;;;;;;;;;GAwDlC;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,gBAOvD;AAED,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE;;;;;;;;GASlE;AAED,wBAAsB,8BAA8B,CAClD,EAAE,EAAE,MAAM,EACV,kBAAkB,EAAE,MAAM;;;;;;;;GAU3B"}
@@ -12,14 +12,20 @@ function resolvePaymentStatus(record) {
12
12
  return "pending";
13
13
  }
14
14
  function normalizeGenericBooking(booking) {
15
+ const rawHostId = booking.hostId || booking.operatorId || booking.entityId?.host || booking.entityId?.hostId || booking.host;
16
+ const hostId = typeof rawHostId === "object" ? (rawHostId?._id || "") : (rawHostId || "");
15
17
  return {
16
18
  ...booking,
19
+ hostId: hostId || booking.hostId,
17
20
  paymentStatus: resolvePaymentStatus(booking),
18
21
  };
19
22
  }
20
23
  function normalizeStayBooking(booking) {
24
+ const rawHostId = booking.hostId || booking.stayId?.host || booking.stayId?.hostId || booking.entityId?.host || booking.host;
25
+ const hostId = typeof rawHostId === "object" ? (rawHostId?._id || "") : (rawHostId || "");
21
26
  return {
22
27
  ...booking,
28
+ hostId: hostId || booking.hostId,
23
29
  entityId: booking.entityId || booking.stayId,
24
30
  entityType: "Stay",
25
31
  startDate: booking.startDate || booking.checkIn,
@@ -32,8 +38,11 @@ function normalizeStayBooking(booking) {
32
38
  };
33
39
  }
34
40
  function normalizeEventBooking(booking) {
41
+ const rawHostId = booking.hostId || booking.eventId?.host || booking.eventId?.hostId || booking.entityId?.host || booking.host;
42
+ const hostId = typeof rawHostId === "object" ? (rawHostId?._id || "") : (rawHostId || "");
35
43
  return {
36
44
  ...booking,
45
+ hostId: hostId || booking.hostId,
37
46
  entityId: booking.entityId || booking.eventId,
38
47
  entityType: "Event",
39
48
  startDate: booking.startDate || booking.eventDate,
@@ -45,12 +54,17 @@ function normalizeEventBooking(booking) {
45
54
  };
46
55
  }
47
56
  function normalizePackageEnquiry(enquiry) {
57
+ const rawHostId = enquiry.operatorId || enquiry.hostId || enquiry.packageId?.host || enquiry.packageId?.hostId;
58
+ const hostId = typeof rawHostId === "object" ? (rawHostId?._id || "") : (rawHostId || "");
48
59
  return {
49
60
  ...enquiry,
61
+ hostId: hostId || enquiry.operatorId,
62
+ operatorId: hostId || enquiry.operatorId,
50
63
  entityId: {
51
- _id: enquiry.packageId,
64
+ _id: enquiry.packageId?._id || enquiry.packageId,
52
65
  title: enquiry.packageTitle,
53
66
  slug: enquiry.packageSlug,
67
+ host: hostId || enquiry.operatorId,
54
68
  },
55
69
  entityType: "TravelPackage",
56
70
  bookingKind: "package_enquiry",
@@ -59,7 +73,7 @@ function normalizePackageEnquiry(enquiry) {
59
73
  endDate: undefined,
60
74
  numberOfPeople: (Number(enquiry.males) || 0) + (Number(enquiry.females) || 0) || 1,
61
75
  totalPrice: enquiry.totalPrice || 0,
62
- currency: "INR",
76
+ currency: enquiry.currency || "INR",
63
77
  paymentStatus: "not_applicable",
64
78
  bookingCode: enquiry.bookingCode,
65
79
  status: enquiry.status === "denied" ? "cancelled" : enquiry.status,
@@ -0,0 +1,7 @@
1
+ import type { ItinerarySummary } from "./models/itinerary";
2
+ export declare function getTrendingItineraries(limit?: number): Promise<{
3
+ success: boolean;
4
+ itineraries: ItinerarySummary[];
5
+ error?: string;
6
+ }>;
7
+ //# sourceMappingURL=itineraryActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itineraryActions.d.ts","sourceRoot":"","sources":["../../src/lib/itineraryActions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D,wBAAsB,sBAAsB,CAAC,KAAK,SAAI,GAAG,OAAO,CAAC;IAC/D,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAsBD"}
@@ -0,0 +1,26 @@
1
+ "use server";
2
+ const API_BASE = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000/api/v1";
3
+ export async function getTrendingItineraries(limit = 6) {
4
+ try {
5
+ const boundedLimit = Math.min(12, Math.max(1, Math.trunc(limit)));
6
+ const response = await fetch(`${API_BASE}/itinerary/trending?limit=${boundedLimit}`, {
7
+ cache: "no-store",
8
+ });
9
+ const payload = await response.json().catch(() => ({}));
10
+ if (!response.ok) {
11
+ return {
12
+ success: false,
13
+ itineraries: [],
14
+ error: payload.message || "Trending itineraries are unavailable right now",
15
+ };
16
+ }
17
+ return { success: true, itineraries: payload.data ?? [] };
18
+ }
19
+ catch {
20
+ return {
21
+ success: false,
22
+ itineraries: [],
23
+ error: "Trending itineraries are unavailable right now",
24
+ };
25
+ }
26
+ }
@@ -1,3 +1,4 @@
1
+ import type { ItinerarySummary } from "./models/itinerary";
1
2
  export interface LocationAncestor {
2
3
  _id: string;
3
4
  name: string;
@@ -91,7 +92,7 @@ export declare function searchLocations(q: string, opts?: {
91
92
  total: number;
92
93
  }>;
93
94
  export declare function fetchLocationItineraries(id: string, page?: number): Promise<{
94
- itineraries: any[];
95
+ itineraries: ItinerarySummary[];
95
96
  total: number;
96
97
  }>;
97
98
  export declare function fetchThreads(locationId: string, opts?: {
@@ -1 +1 @@
1
- {"version":3,"file":"locationActions.d.ts","sourceRoot":"","sources":["../../src/lib/locationActions.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,O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MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAOrE;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACzF,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAOvE;AAED,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAO/C"}
@@ -0,0 +1,25 @@
1
+ import type { MarketplaceContract, MarketplacePayment } from "./models/marketplace";
2
+ export declare const getMarketplaceContracts: () => Promise<MarketplaceContract[]>;
3
+ export declare const getMarketplaceContract: (contractSlug: string) => Promise<MarketplaceContract>;
4
+ export declare const createMarketplaceContract: (input: unknown) => Promise<MarketplaceContract>;
5
+ export declare const actOnMarketplaceContract: (contractId: string, action: "propose" | "accept" | "cancel", input?: unknown) => Promise<MarketplaceContract>;
6
+ export declare const actOnMarketplaceMilestone: (contractId: string, milestoneId: string, action: "submit" | "request_revision" | "approve", input?: unknown) => Promise<MarketplaceContract>;
7
+ export declare const openMarketplaceDispute: (contractId: string, input: {
8
+ milestoneId?: string;
9
+ reason: string;
10
+ }) => Promise<unknown>;
11
+ export declare const issueMarketplaceInvoice: (contractId: string, input: {
12
+ milestoneIds: string[];
13
+ dueAt?: string;
14
+ notes?: string;
15
+ }) => Promise<MarketplaceContract>;
16
+ export declare const getMarketplacePayment: (contractId: string, milestoneId: string) => Promise<MarketplacePayment | null>;
17
+ export declare const createMarketplacePaymentOrder: (contractId: string, milestoneId: string) => Promise<MarketplacePayment>;
18
+ export declare const verifyMarketplacePayment: (contractId: string, milestoneId: string, input: {
19
+ razorpay_order_id: string;
20
+ razorpay_payment_id: string;
21
+ razorpay_signature: string;
22
+ }) => Promise<MarketplacePayment>;
23
+ export declare const releaseMarketplacePayment: (contractId: string, milestoneId: string) => Promise<MarketplacePayment>;
24
+ export declare const getMarketplaceInvoiceDownloadUrl: (contractId: string, invoiceId: string) => string;
25
+ //# sourceMappingURL=marketplaceContractActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplaceContractActions.d.ts","sourceRoot":"","sources":["../../src/lib/marketplaceContractActions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGpF,eAAO,MAAM,uBAAuB,sCAA0F,CAAC;AAC/H,eAAO,MAAM,sBAAsB,GAAU,cAAc,MAAM,iCAAkH,CAAC;AACpL,eAAO,MAAM,yBAAyB,GAAU,OAAO,OAAO,iCAAuF,CAAC;AACtJ,eAAO,MAAM,wBAAwB,GAAU,YAAY,MAAM,EAAE,QAAQ,SAAS,GAAG,QAAQ,GAAG,QAAQ,EAAE,QAAO,OAAY,iCAAuH,CAAC;AACvP,eAAO,MAAM,yBAAyB,GAAU,YAAY,MAAM,EAAE,aAAa,MAAM,EAAE,QAAQ,QAAQ,GAAG,kBAAkB,GAAG,SAAS,EAAE,QAAO,OAAY,iCAAiJ,CAAC;AACjT,eAAO,MAAM,sBAAsB,GAAU,YAAY,MAAM,EAAE,OAAO;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,qBAAkG,CAAC;AACnN,eAAO,MAAM,uBAAuB,GAAU,YAAY,MAAM,EAAE,OAAO;IAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,iCAA8G,CAAC;AAClP,eAAO,MAAM,qBAAqB,GAAU,YAAY,MAAM,EAAE,aAAa,MAAM,uCAAoI,CAAC;AACxN,eAAO,MAAM,6BAA6B,GAAU,YAAY,MAAM,EAAE,aAAa,MAAM,gCAAyI,CAAC;AACrO,eAAO,MAAM,wBAAwB,GAAU,YAAY,MAAM,EAAE,aAAa,MAAM,EAAE,OAAO;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,gCAA6I,CAAC;AACnU,eAAO,MAAM,yBAAyB,GAAU,YAAY,MAAM,EAAE,aAAa,MAAM,gCAA2I,CAAC;AACnO,eAAO,MAAM,gCAAgC,GAAI,YAAY,MAAM,EAAE,WAAW,MAAM,WAGrF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { get, post } from "./actions/fetcher";
2
+ const withIdempotency = async (path, body) => post(path, body, true, { headers: { "Idempotency-Key": crypto.randomUUID() } });
3
+ export const getMarketplaceContracts = async () => (await get("/marketplace-contracts")).data;
4
+ export const getMarketplaceContract = async (contractSlug) => (await get(`/marketplace-contracts/${encodeURIComponent(contractSlug)}`)).data;
5
+ export const createMarketplaceContract = async (input) => (await withIdempotency("/marketplace-contracts", input)).data;
6
+ export const actOnMarketplaceContract = async (contractId, action, input = {}) => (await withIdempotency(`/marketplace-contracts/${contractId}/actions/${action}`, input)).data;
7
+ export const actOnMarketplaceMilestone = async (contractId, milestoneId, action, input = {}) => (await withIdempotency(`/marketplace-contracts/${contractId}/milestones/${milestoneId}/actions/${action}`, input)).data;
8
+ export const openMarketplaceDispute = async (contractId, input) => (await withIdempotency(`/marketplace-contracts/${contractId}/disputes`, input)).data;
9
+ export const issueMarketplaceInvoice = async (contractId, input) => (await withIdempotency(`/marketplace-contracts/${contractId}/invoices`, input)).data;
10
+ export const getMarketplacePayment = async (contractId, milestoneId) => (await get(`/marketplace-contracts/${contractId}/milestones/${milestoneId}/payment`)).data;
11
+ export const createMarketplacePaymentOrder = async (contractId, milestoneId) => (await withIdempotency(`/marketplace-contracts/${contractId}/milestones/${milestoneId}/payment/order`, {})).data;
12
+ export const verifyMarketplacePayment = async (contractId, milestoneId, input) => (await withIdempotency(`/marketplace-contracts/${contractId}/milestones/${milestoneId}/payment/verify`, input)).data;
13
+ export const releaseMarketplacePayment = async (contractId, milestoneId) => (await withIdempotency(`/marketplace-contracts/${contractId}/milestones/${milestoneId}/payment/release`, {})).data;
14
+ export const getMarketplaceInvoiceDownloadUrl = (contractId, invoiceId) => {
15
+ const baseUrl = String(process.env.NEXT_PUBLIC_API_URL || "").replace(/\/$/, "");
16
+ return `${baseUrl}/marketplace-contracts/${encodeURIComponent(contractId)}/invoices/${encodeURIComponent(invoiceId)}/download`;
17
+ };
@@ -0,0 +1,33 @@
1
+ export type CommunityAnalyticsEventType = "impression" | "visible_duration" | "video_watch" | "video_complete" | "video_replay" | "like" | "comment" | "share" | "bookmark" | "wishlist_add" | "click" | "follow" | "report" | "hide" | "booking" | "application" | "marketplace_lead" | "ad_conversion";
2
+ export interface CommunityAnalyticsEvent {
3
+ eventId: string;
4
+ eventType: CommunityAnalyticsEventType;
5
+ contentId?: string;
6
+ authorId?: string;
7
+ brandId?: string;
8
+ campaignId?: string;
9
+ placementId?: string;
10
+ sourceContentId?: string;
11
+ impressionId?: string;
12
+ rankingSessionId?: string;
13
+ durationMs?: number;
14
+ completionRate?: number;
15
+ occurredAt?: string;
16
+ metadata?: Record<string, string | number | boolean>;
17
+ }
18
+ export interface AnalyticsInsights {
19
+ scopeType: string;
20
+ scopeId: string;
21
+ rows: Array<{
22
+ day: string;
23
+ counts: Record<string, number>;
24
+ durationMs: number;
25
+ watchTimeMs: number;
26
+ }>;
27
+ totals: {
28
+ counts: Record<string, number>;
29
+ durationMs: number;
30
+ watchTimeMs: number;
31
+ };
32
+ }
33
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/lib/models/analytics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG,YAAY,GAAG,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,GAAG,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,kBAAkB,GAAG,eAAe,CAAC;AACzS,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,2BAA2B,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACtD;AACD,MAAM,WAAW,iBAAiB;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  export declare const AUTHORIZATION_ROLES: readonly ["user", "host", "hr", "sales", "developer", "customer_support", "admin"];
2
2
  export type AuthorizationRole = (typeof AUTHORIZATION_ROLES)[number] | string;
3
- export declare const AUTHORIZATION_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.create", "listings.update.own", "listings.delete.own", "listings.moderate", "content.moderate", "opportunities.applications.read", "opportunities.membership_requirements.approve", "bookings.read.own", "bookings.read.host", "bookings.read.all", "bookings.manage.host", "bookings.manage.all", "pricing.read", "pricing.manage.own", "pricing.manage.platform", "discounts.read", "discounts.manage.own", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.own", "rewards.read.all", "rewards.manage", "rewards.adjust", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read", "database.collections.read"];
3
+ export declare const AUTHORIZATION_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.create", "listings.update.own", "listings.delete.own", "listings.moderate", "content.moderate", "creator.skills.verify", "marketplace.read.all", "marketplace.manage", "marketplace.disputes.manage", "marketplace.payments.manage", "analytics.read.all", "opportunities.applications.read", "opportunities.membership_requirements.approve", "bookings.read.own", "bookings.read.host", "bookings.read.all", "bookings.manage.host", "bookings.manage.all", "pricing.read", "pricing.manage.own", "pricing.manage.platform", "discounts.read", "discounts.manage.own", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.own", "rewards.read.all", "rewards.manage", "rewards.adjust", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read", "database.collections.read"];
4
4
  export type AuthorizationPermission = (typeof AUTHORIZATION_PERMISSIONS)[number] | string;
5
5
  export type BaseAccountType = "user" | "host";
6
6
  export type AccountType = BaseAccountType | "staff";
@@ -12,15 +12,17 @@ export type PermissionAwareActor = {
12
12
  baseAccountType?: BaseAccountType | string | null;
13
13
  staffProfileId?: string | null;
14
14
  };
15
- export declare const STAFF_DASHBOARD_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.create", "listings.moderate", "content.moderate", "opportunities.applications.read", "bookings.read.all", "bookings.manage.all", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read", "database.collections.read"];
15
+ export declare const STAFF_DASHBOARD_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage", "users.read", "users.manage", "hosts.read", "hosts.manage", "staff.read", "staff.manage", "listings.read", "listings.create", "listings.moderate", "content.moderate", "creator.skills.verify", "marketplace.read.all", "marketplace.manage", "marketplace.disputes.manage", "marketplace.payments.manage", "analytics.read.all", "opportunities.applications.read", "bookings.read.all", "bookings.manage.all", "payouts.read", "payouts.record", "platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage", "verification.read", "verification.manage", "support.contacts.read", "audit.read", "developer.diagnostics.read", "database.collections.read"];
16
16
  export declare const LISTING_MODERATION_DASHBOARD_PERMISSIONS: readonly ["listings.moderate"];
17
17
  export declare const CONTENT_MODERATION_DASHBOARD_PERMISSIONS: readonly ["content.moderate"];
18
18
  export declare const MODERATION_DASHBOARD_PERMISSIONS: readonly ["listings.moderate", "content.moderate"];
19
19
  export declare const PAYOUT_DASHBOARD_PERMISSIONS: readonly ["payouts.read", "payouts.record"];
20
20
  export declare const PLATFORM_DASHBOARD_PERMISSIONS: readonly ["platform.settings.read", "platform.settings.manage", "discounts.manage.platform", "partner_programs.read", "partner_programs.manage", "rewards.read.all", "rewards.manage", "memberships.read.all", "memberships.manage", "host_performance.read.all", "host_performance.manage"];
21
21
  export declare const AUTHORIZATION_DASHBOARD_PERMISSIONS: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"];
22
+ export declare const ID_APPROVAL_DASHBOARD_PERMISSIONS: readonly ["verification.read", "verification.manage", "users.manage", "hosts.manage", "staff.manage", "opportunities.applications.read"];
22
23
  export declare const ADMIN_ROUTE_PERMISSION_GROUPS: {
23
24
  readonly applications: readonly ["opportunities.applications.read"];
25
+ readonly idApproval: readonly ["verification.read", "verification.manage", "users.manage", "hosts.manage", "staff.manage", "opportunities.applications.read"];
24
26
  readonly authorization: readonly ["roles.read", "roles.manage", "permissions.read", "permissions.manage"];
25
27
  readonly listingModeration: readonly ["listings.moderate"];
26
28
  readonly contentModeration: readonly ["content.moderate"];
@@ -106,7 +108,7 @@ export declare function canCreateListingForHost(actor: PermissionAwareActor | nu
106
108
  export declare function canAccessListingEditor(actor: PermissionAwareActor | null | undefined): boolean;
107
109
  export declare function canAccessOpportunityApplicationReview(actor: PermissionAwareActor | null | undefined): boolean;
108
110
  export declare function getOpportunityApplicationApprovalStatus(actor: PermissionAwareActor | null | undefined): "adminApproved" | "approved";
109
- 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 ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly [];
111
+ 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", "opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly [];
110
112
  export declare function hasAdminDashboardRouteAccess(actor: PermissionAwareActor | null | undefined, pathname: string): boolean;
111
113
  export declare function getHostDashboardRoutePermissions(pathname: string): readonly ["listings.moderate"] | readonly ["opportunities.applications.read"] | readonly ["bookings.read.all", "bookings.manage.all"] | readonly [] | readonly ["listings.create"];
112
114
  export declare function hasHostDashboardRouteAccess(actor: PermissionAwareActor | null | undefined, pathname: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../../src/lib/models/authorization.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,oFAQtB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE9E,eAAO,MAAM,yBAAyB,+jCAkD5B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE1F,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,OAAO,CAAC;AAEpD,MAAM,M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AOjB;AAED,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,sLAyBhE;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,EAC9C,QAAQ,EAAE,MAAM,WAKjB"}
@@ -24,6 +24,12 @@ export const AUTHORIZATION_PERMISSIONS = [
24
24
  "listings.delete.own",
25
25
  "listings.moderate",
26
26
  "content.moderate",
27
+ "creator.skills.verify",
28
+ "marketplace.read.all",
29
+ "marketplace.manage",
30
+ "marketplace.disputes.manage",
31
+ "marketplace.payments.manage",
32
+ "analytics.read.all",
27
33
  "opportunities.applications.read",
28
34
  "opportunities.membership_requirements.approve",
29
35
  "bookings.read.own",
@@ -73,6 +79,12 @@ export const STAFF_DASHBOARD_PERMISSIONS = [
73
79
  "listings.create",
74
80
  "listings.moderate",
75
81
  "content.moderate",
82
+ "creator.skills.verify",
83
+ "marketplace.read.all",
84
+ "marketplace.manage",
85
+ "marketplace.disputes.manage",
86
+ "marketplace.payments.manage",
87
+ "analytics.read.all",
76
88
  "opportunities.applications.read",
77
89
  "bookings.read.all",
78
90
  "bookings.manage.all",
@@ -125,8 +137,17 @@ export const AUTHORIZATION_DASHBOARD_PERMISSIONS = [
125
137
  "permissions.read",
126
138
  "permissions.manage",
127
139
  ];
140
+ export const ID_APPROVAL_DASHBOARD_PERMISSIONS = [
141
+ "verification.read",
142
+ "verification.manage",
143
+ "users.manage",
144
+ "hosts.manage",
145
+ "staff.manage",
146
+ "opportunities.applications.read",
147
+ ];
128
148
  export const ADMIN_ROUTE_PERMISSION_GROUPS = {
129
149
  applications: ["opportunities.applications.read"],
150
+ idApproval: ID_APPROVAL_DASHBOARD_PERMISSIONS,
130
151
  authorization: AUTHORIZATION_DASHBOARD_PERMISSIONS,
131
152
  listingModeration: LISTING_MODERATION_DASHBOARD_PERMISSIONS,
132
153
  contentModeration: CONTENT_MODERATION_DASHBOARD_PERMISSIONS,
@@ -232,8 +253,11 @@ export function getAdminDashboardRoutePermissions(pathname) {
232
253
  const path = String(pathname || "").toLowerCase();
233
254
  if (path.includes("/registrations"))
234
255
  return ADMIN_ROUTE_PERMISSION_GROUPS.registrations;
235
- if (path.startsWith("/dashboard/staff/applications")) {
236
- return ADMIN_ROUTE_PERMISSION_GROUPS.applications;
256
+ if (path.startsWith("/dashboard/staff/id-approval") ||
257
+ path.startsWith("/dashboard/admin/id-approval") ||
258
+ path.startsWith("/dashboard/staff/verifications") ||
259
+ path.startsWith("/dashboard/staff/applications")) {
260
+ return ADMIN_ROUTE_PERMISSION_GROUPS.idApproval;
237
261
  }
238
262
  if (path.startsWith("/dashboard/staff/authorization") || path.startsWith("/dashboard/admin/authorization")) {
239
263
  return ADMIN_ROUTE_PERMISSION_GROUPS.authorization;
@@ -59,7 +59,7 @@ export interface Conversation {
59
59
  joinApprovalRequired: boolean;
60
60
  };
61
61
  context?: {
62
- type: "direct" | "booking" | "listing" | "companionMatch";
62
+ type: "direct" | "booking" | "listing" | "companionMatch" | "communityPost" | "brandPartnership" | "creatorEngagement" | "marketplaceContract";
63
63
  entityId?: string | null;
64
64
  entityModel?: string;
65
65
  label?: string;