@timardex/cluemart-shared 2.3.20 → 2.4.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.
- package/dist/{ad-8hhGHx6J.d.mts → ad-BSyVGv8q.d.mts} +16 -23
- package/dist/{ad-6lcjOj3X.d.ts → ad-DRI2CIzV.d.ts} +16 -23
- package/dist/{chunk-ZZXSAQM6.mjs → chunk-2RHUGVV3.mjs} +114 -122
- package/dist/chunk-2RHUGVV3.mjs.map +1 -0
- package/dist/{chunk-HKTBJOB7.mjs → chunk-J72IMZ6E.mjs} +13 -1
- package/dist/chunk-J72IMZ6E.mjs.map +1 -0
- package/dist/{chunk-PBW5K54C.mjs → chunk-LEAXY4DI.mjs} +2 -2
- package/dist/{chunk-KMS64DE2.mjs → chunk-LHKJJ7SO.mjs} +2 -2
- package/dist/{chunk-5AAYX364.mjs → chunk-WWAHS5R2.mjs} +1 -10
- package/dist/chunk-WWAHS5R2.mjs.map +1 -0
- package/dist/{chunk-DV3K3JDE.mjs → chunk-ZECVZFK3.mjs} +7 -6
- package/dist/chunk-ZECVZFK3.mjs.map +1 -0
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +4 -4
- package/dist/graphql/index.cjs +122 -129
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +21 -4
- package/dist/graphql/index.d.ts +21 -4
- package/dist/graphql/index.mjs +7 -5
- package/dist/hooks/index.cjs +25 -51
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +6 -6
- package/dist/index.cjs +141 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +50 -25
- package/dist/index.d.ts +50 -25
- package/dist/index.mjs +122 -127
- package/dist/index.mjs.map +1 -1
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.mjs +2 -2
- package/dist/types/index.cjs +0 -10
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -3
- package/dist/utils/index.cjs +19 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +16 -1
- package/dist/utils/index.d.ts +16 -1
- package/dist/utils/index.mjs +11 -3
- package/package.json +1 -1
- package/dist/chunk-5AAYX364.mjs.map +0 -1
- package/dist/chunk-DV3K3JDE.mjs.map +0 -1
- package/dist/chunk-HKTBJOB7.mjs.map +0 -1
- package/dist/chunk-ZZXSAQM6.mjs.map +0 -1
- /package/dist/{chunk-PBW5K54C.mjs.map → chunk-LEAXY4DI.mjs.map} +0 -0
- /package/dist/{chunk-KMS64DE2.mjs.map → chunk-LHKJJ7SO.mjs.map} +0 -0
|
@@ -137,7 +137,6 @@ type RefreshImpersonationMutationResponse = MutationResponse<RefreshTokenPayload
|
|
|
137
137
|
declare enum EnumAdShowOn {
|
|
138
138
|
EVENTS_PAGE = "Events_page",
|
|
139
139
|
FRONT_PAGE = "Front_page",
|
|
140
|
-
MARKET_SEARCH = "Market_search",
|
|
141
140
|
PARTNERS_PAGE = "Partners_page",
|
|
142
141
|
VENDORS_PAGE = "Vendors_page"
|
|
143
142
|
}
|
|
@@ -176,19 +175,11 @@ declare enum EnumAdPaymentStatus {
|
|
|
176
175
|
FAILED = "failed",
|
|
177
176
|
CANCELLED = "cancelled"
|
|
178
177
|
}
|
|
179
|
-
declare enum EnumAdEntitlementSource {
|
|
180
|
-
PRO_PLUS = "pro_plus",
|
|
181
|
-
ADMIN = "admin",
|
|
182
|
-
ORGANIZER = "organizer",
|
|
183
|
-
PARTNER = "partner"
|
|
184
|
-
}
|
|
185
178
|
declare enum EnumAdApprovalStatus {
|
|
186
179
|
PENDING = "pending",
|
|
187
180
|
APPROVED = "approved",
|
|
188
181
|
REJECTED = "rejected"
|
|
189
182
|
}
|
|
190
|
-
type AdPlacement = EnumAdShowOn.FRONT_PAGE | EnumAdShowOn.MARKET_SEARCH;
|
|
191
|
-
type AdDailyPriceKey = "front_page_day" | "market_search_day";
|
|
192
183
|
type AdResource = {
|
|
193
184
|
adDescription: string;
|
|
194
185
|
adImage: string;
|
|
@@ -215,13 +206,10 @@ type CreateAdFormData = CreateFormData<AdFormData>;
|
|
|
215
206
|
type CreateAdFormState = CreateFormData<AdFormState>;
|
|
216
207
|
interface AdType extends AdFormData {
|
|
217
208
|
_id: string;
|
|
218
|
-
adminManaged?: boolean;
|
|
219
209
|
approvalStatus?: EnumAdApprovalStatus;
|
|
220
210
|
bookingIds?: string[];
|
|
221
211
|
bookingKind?: EnumAdBookingSlotKind;
|
|
222
|
-
clicks?: number;
|
|
223
212
|
createdAt: Date;
|
|
224
|
-
impressions?: number;
|
|
225
213
|
paymentStatus?: EnumAdPaymentStatus;
|
|
226
214
|
start: Date;
|
|
227
215
|
updatedAt: Date | null;
|
|
@@ -232,15 +220,13 @@ type AdBookingType = {
|
|
|
232
220
|
approvalStatus: EnumAdApprovalStatus;
|
|
233
221
|
checkoutAttemptId?: string | null;
|
|
234
222
|
currency?: string | null;
|
|
235
|
-
dayKey:
|
|
236
|
-
entitlementClaimKey?: string | null;
|
|
237
|
-
entitlementSource?: EnumAdEntitlementSource | null;
|
|
223
|
+
dayKey: Date;
|
|
238
224
|
expiresAt?: Date | null;
|
|
239
|
-
placement:
|
|
225
|
+
placement: EnumAdShowOn;
|
|
240
226
|
purchaseKey?: string | null;
|
|
241
227
|
region: string;
|
|
242
228
|
resource: AdResource;
|
|
243
|
-
slotKind: EnumAdBookingSlotKind;
|
|
229
|
+
slotKind: EnumAdBookingSlotKind.PAID;
|
|
244
230
|
slotNumber: number;
|
|
245
231
|
state: EnumAdBookingState;
|
|
246
232
|
stripeCheckoutSessionId?: string | null;
|
|
@@ -252,17 +238,24 @@ type AdDailyPriceType = {
|
|
|
252
238
|
_id: string;
|
|
253
239
|
active: boolean;
|
|
254
240
|
currency: "nzd";
|
|
255
|
-
key:
|
|
241
|
+
key: EnumAdShowOn;
|
|
256
242
|
revision: number;
|
|
257
243
|
unitAmount: number;
|
|
258
244
|
};
|
|
259
245
|
type AdSettingsType = {
|
|
260
246
|
_id: "default";
|
|
261
247
|
approvalRequired: boolean;
|
|
262
|
-
minAppearancesPerHour: number;
|
|
263
|
-
paidSlotsPerPlacement: number;
|
|
264
|
-
reservedSlotsPerPlacement: number;
|
|
265
|
-
rotationSeconds: number;
|
|
266
248
|
};
|
|
249
|
+
interface AdMetricsType {
|
|
250
|
+
_id: string;
|
|
251
|
+
adId: string;
|
|
252
|
+
clicks: number;
|
|
253
|
+
createdAt: Date;
|
|
254
|
+
date: Date;
|
|
255
|
+
impressions: number;
|
|
256
|
+
placement: EnumAdShowOn;
|
|
257
|
+
platform: EnumAdPlatform;
|
|
258
|
+
updatedAt: Date | null;
|
|
259
|
+
}
|
|
267
260
|
|
|
268
|
-
export { type
|
|
261
|
+
export { type AuthMutationResponse as A, type CreateAdFormData as B, type CreateLoginFormData as C, EnumAdApprovalStatus as D, EnumAdPlatform as E, EnumAdBookingSlotKind as F, EnumAdBookingState as G, EnumAdPaymentStatus as H, EnumAdStatus as I, EnumAdStyle as J, EnumAdType as K, EnumVerificationType as L, type LoginFormData as M, type MarketingMaterialRequestInputType as N, type PosterInputType as O, type PartnerType as P, type RefreshTokenPayloadType as Q, type RefreshImpersonationMutationResponse as R, type StartImpersonationMutationResponse as S, type RegisterFormData as T, type RequestPasswordResetFormData as U, type ResetPasswordFormData as V, type SchoolCampaignType as W, type SchoolRegisteredUserType as X, type StartImpersonationPayloadType as Y, type ValidateVerificationTokenFormData as Z, type RefreshTokenMutationResponse as a, type AdType as b, EnumAdShowOn as c, type AppSettingsType as d, type SchoolType as e, type SchoolReturnType as f, type CreateRegisterFormData as g, type CreateRequestPasswordResetFormData as h, type CreateValidateVerificationTokenFormData as i, type CreateResetPasswordFormData as j, type PartnerFormData as k, type AdFormData as l, type CreateAdFormState as m, type CreatePartnerFormData as n, type AppSettingsFormData as o, type CreateAppSettingsFormData as p, type SchoolFormData as q, type CreateSchoolFormData as r, type AdBookingType as s, type AdDailyPriceType as t, type AdFormState as u, type AdMetricsType as v, type AdResource as w, type AdSettingsFormData as x, type AdSettingsType as y, type AuthPayloadType as z };
|
|
@@ -137,7 +137,6 @@ type RefreshImpersonationMutationResponse = MutationResponse<RefreshTokenPayload
|
|
|
137
137
|
declare enum EnumAdShowOn {
|
|
138
138
|
EVENTS_PAGE = "Events_page",
|
|
139
139
|
FRONT_PAGE = "Front_page",
|
|
140
|
-
MARKET_SEARCH = "Market_search",
|
|
141
140
|
PARTNERS_PAGE = "Partners_page",
|
|
142
141
|
VENDORS_PAGE = "Vendors_page"
|
|
143
142
|
}
|
|
@@ -176,19 +175,11 @@ declare enum EnumAdPaymentStatus {
|
|
|
176
175
|
FAILED = "failed",
|
|
177
176
|
CANCELLED = "cancelled"
|
|
178
177
|
}
|
|
179
|
-
declare enum EnumAdEntitlementSource {
|
|
180
|
-
PRO_PLUS = "pro_plus",
|
|
181
|
-
ADMIN = "admin",
|
|
182
|
-
ORGANIZER = "organizer",
|
|
183
|
-
PARTNER = "partner"
|
|
184
|
-
}
|
|
185
178
|
declare enum EnumAdApprovalStatus {
|
|
186
179
|
PENDING = "pending",
|
|
187
180
|
APPROVED = "approved",
|
|
188
181
|
REJECTED = "rejected"
|
|
189
182
|
}
|
|
190
|
-
type AdPlacement = EnumAdShowOn.FRONT_PAGE | EnumAdShowOn.MARKET_SEARCH;
|
|
191
|
-
type AdDailyPriceKey = "front_page_day" | "market_search_day";
|
|
192
183
|
type AdResource = {
|
|
193
184
|
adDescription: string;
|
|
194
185
|
adImage: string;
|
|
@@ -215,13 +206,10 @@ type CreateAdFormData = CreateFormData<AdFormData>;
|
|
|
215
206
|
type CreateAdFormState = CreateFormData<AdFormState>;
|
|
216
207
|
interface AdType extends AdFormData {
|
|
217
208
|
_id: string;
|
|
218
|
-
adminManaged?: boolean;
|
|
219
209
|
approvalStatus?: EnumAdApprovalStatus;
|
|
220
210
|
bookingIds?: string[];
|
|
221
211
|
bookingKind?: EnumAdBookingSlotKind;
|
|
222
|
-
clicks?: number;
|
|
223
212
|
createdAt: Date;
|
|
224
|
-
impressions?: number;
|
|
225
213
|
paymentStatus?: EnumAdPaymentStatus;
|
|
226
214
|
start: Date;
|
|
227
215
|
updatedAt: Date | null;
|
|
@@ -232,15 +220,13 @@ type AdBookingType = {
|
|
|
232
220
|
approvalStatus: EnumAdApprovalStatus;
|
|
233
221
|
checkoutAttemptId?: string | null;
|
|
234
222
|
currency?: string | null;
|
|
235
|
-
dayKey:
|
|
236
|
-
entitlementClaimKey?: string | null;
|
|
237
|
-
entitlementSource?: EnumAdEntitlementSource | null;
|
|
223
|
+
dayKey: Date;
|
|
238
224
|
expiresAt?: Date | null;
|
|
239
|
-
placement:
|
|
225
|
+
placement: EnumAdShowOn;
|
|
240
226
|
purchaseKey?: string | null;
|
|
241
227
|
region: string;
|
|
242
228
|
resource: AdResource;
|
|
243
|
-
slotKind: EnumAdBookingSlotKind;
|
|
229
|
+
slotKind: EnumAdBookingSlotKind.PAID;
|
|
244
230
|
slotNumber: number;
|
|
245
231
|
state: EnumAdBookingState;
|
|
246
232
|
stripeCheckoutSessionId?: string | null;
|
|
@@ -252,17 +238,24 @@ type AdDailyPriceType = {
|
|
|
252
238
|
_id: string;
|
|
253
239
|
active: boolean;
|
|
254
240
|
currency: "nzd";
|
|
255
|
-
key:
|
|
241
|
+
key: EnumAdShowOn;
|
|
256
242
|
revision: number;
|
|
257
243
|
unitAmount: number;
|
|
258
244
|
};
|
|
259
245
|
type AdSettingsType = {
|
|
260
246
|
_id: "default";
|
|
261
247
|
approvalRequired: boolean;
|
|
262
|
-
minAppearancesPerHour: number;
|
|
263
|
-
paidSlotsPerPlacement: number;
|
|
264
|
-
reservedSlotsPerPlacement: number;
|
|
265
|
-
rotationSeconds: number;
|
|
266
248
|
};
|
|
249
|
+
interface AdMetricsType {
|
|
250
|
+
_id: string;
|
|
251
|
+
adId: string;
|
|
252
|
+
clicks: number;
|
|
253
|
+
createdAt: Date;
|
|
254
|
+
date: Date;
|
|
255
|
+
impressions: number;
|
|
256
|
+
placement: EnumAdShowOn;
|
|
257
|
+
platform: EnumAdPlatform;
|
|
258
|
+
updatedAt: Date | null;
|
|
259
|
+
}
|
|
267
260
|
|
|
268
|
-
export { type
|
|
261
|
+
export { type AuthMutationResponse as A, type CreateAdFormData as B, type CreateLoginFormData as C, EnumAdApprovalStatus as D, EnumAdPlatform as E, EnumAdBookingSlotKind as F, EnumAdBookingState as G, EnumAdPaymentStatus as H, EnumAdStatus as I, EnumAdStyle as J, EnumAdType as K, EnumVerificationType as L, type LoginFormData as M, type MarketingMaterialRequestInputType as N, type PosterInputType as O, type PartnerType as P, type RefreshTokenPayloadType as Q, type RefreshImpersonationMutationResponse as R, type StartImpersonationMutationResponse as S, type RegisterFormData as T, type RequestPasswordResetFormData as U, type ResetPasswordFormData as V, type SchoolCampaignType as W, type SchoolRegisteredUserType as X, type StartImpersonationPayloadType as Y, type ValidateVerificationTokenFormData as Z, type RefreshTokenMutationResponse as a, type AdType as b, EnumAdShowOn as c, type AppSettingsType as d, type SchoolType as e, type SchoolReturnType as f, type CreateRegisterFormData as g, type CreateRequestPasswordResetFormData as h, type CreateValidateVerificationTokenFormData as i, type CreateResetPasswordFormData as j, type PartnerFormData as k, type AdFormData as l, type CreateAdFormState as m, type CreatePartnerFormData as n, type AppSettingsFormData as o, type CreateAppSettingsFormData as p, type SchoolFormData as q, type CreateSchoolFormData as r, type AdBookingType as s, type AdDailyPriceType as t, type AdFormState as u, type AdMetricsType as v, type AdResource as w, type AdSettingsFormData as x, type AdSettingsType as y, type AuthPayloadType as z };
|
|
@@ -2210,10 +2210,8 @@ var AD_FIELDS_FRAGMENT = gql20`
|
|
|
2210
2210
|
fragment AdFields on AdType {
|
|
2211
2211
|
_id
|
|
2212
2212
|
active
|
|
2213
|
-
clicks
|
|
2214
2213
|
createdAt
|
|
2215
2214
|
end
|
|
2216
|
-
impressions
|
|
2217
2215
|
resource {
|
|
2218
2216
|
adDescription
|
|
2219
2217
|
adImage
|
|
@@ -2294,83 +2292,8 @@ var DELETE_AD_MUTATION = gql21`
|
|
|
2294
2292
|
}
|
|
2295
2293
|
`;
|
|
2296
2294
|
|
|
2297
|
-
// src/graphql/
|
|
2298
|
-
|
|
2299
|
-
const [createAd, { loading, error }] = useMutation11(CREATE_AD_MUTATION, {
|
|
2300
|
-
awaitRefetchQueries: true,
|
|
2301
|
-
refetchQueries: [{ query: GET_ADS }]
|
|
2302
|
-
});
|
|
2303
|
-
return {
|
|
2304
|
-
createAd,
|
|
2305
|
-
error,
|
|
2306
|
-
loading
|
|
2307
|
-
};
|
|
2308
|
-
};
|
|
2309
|
-
var useUpdateAd = () => {
|
|
2310
|
-
const [updateAd, { loading, error }] = useMutation11(UPDATE_AD_MUTATION, {
|
|
2311
|
-
awaitRefetchQueries: true,
|
|
2312
|
-
refetchQueries: [{ query: GET_ADS }]
|
|
2313
|
-
});
|
|
2314
|
-
return {
|
|
2315
|
-
error,
|
|
2316
|
-
loading,
|
|
2317
|
-
updateAd
|
|
2318
|
-
};
|
|
2319
|
-
};
|
|
2320
|
-
var useDeleteAd = () => {
|
|
2321
|
-
const [deleteAd, { loading, error }] = useMutation11(DELETE_AD_MUTATION, {
|
|
2322
|
-
awaitRefetchQueries: true,
|
|
2323
|
-
refetchQueries: [{ query: GET_ADS }]
|
|
2324
|
-
});
|
|
2325
|
-
return {
|
|
2326
|
-
deleteAd,
|
|
2327
|
-
error,
|
|
2328
|
-
loading
|
|
2329
|
-
};
|
|
2330
|
-
};
|
|
2331
|
-
|
|
2332
|
-
// src/graphql/hooks/ad/hooksQuery.ts
|
|
2333
|
-
import { useQuery as useQuery6 } from "@apollo/client";
|
|
2334
|
-
var useGetAds = () => {
|
|
2335
|
-
const { data, loading, error, refetch } = useQuery6(
|
|
2336
|
-
GET_ADS,
|
|
2337
|
-
{
|
|
2338
|
-
fetchPolicy: "no-cache"
|
|
2339
|
-
}
|
|
2340
|
-
);
|
|
2341
|
-
return {
|
|
2342
|
-
ads: data?.ads || [],
|
|
2343
|
-
error,
|
|
2344
|
-
loading,
|
|
2345
|
-
refetch
|
|
2346
|
-
};
|
|
2347
|
-
};
|
|
2348
|
-
var useGetAd = (_id) => {
|
|
2349
|
-
const { data, loading, error, refetch } = useQuery6(GET_AD, {
|
|
2350
|
-
fetchPolicy: "no-cache",
|
|
2351
|
-
skip: !_id || _id === "",
|
|
2352
|
-
variables: { _id }
|
|
2353
|
-
});
|
|
2354
|
-
return {
|
|
2355
|
-
ad: data?.ad,
|
|
2356
|
-
error,
|
|
2357
|
-
loading,
|
|
2358
|
-
refetch
|
|
2359
|
-
};
|
|
2360
|
-
};
|
|
2361
|
-
var useGetAdsByRegion = (region, platform, showOn) => {
|
|
2362
|
-
const { data, loading, error, refetch } = useQuery6(GET_ADS_BY_REGION, {
|
|
2363
|
-
fetchPolicy: "no-cache",
|
|
2364
|
-
skip: !region || region === "",
|
|
2365
|
-
variables: { platform, region, showOn }
|
|
2366
|
-
});
|
|
2367
|
-
return {
|
|
2368
|
-
adsByRegion: data?.adsByRegion || [],
|
|
2369
|
-
error,
|
|
2370
|
-
loading,
|
|
2371
|
-
refetch
|
|
2372
|
-
};
|
|
2373
|
-
};
|
|
2295
|
+
// src/graphql/mutations/adBooking.ts
|
|
2296
|
+
import { gql as gql23 } from "@apollo/client";
|
|
2374
2297
|
|
|
2375
2298
|
// src/graphql/queries/adBooking.ts
|
|
2376
2299
|
import { gql as gql22 } from "@apollo/client";
|
|
@@ -2400,20 +2323,6 @@ var AD_BOOKING_FIELDS_FRAGMENT = gql22`
|
|
|
2400
2323
|
unitAmount
|
|
2401
2324
|
}
|
|
2402
2325
|
`;
|
|
2403
|
-
var GET_AD_DAY_AVAILABILITY = gql22`
|
|
2404
|
-
query getAdDayAvailability(
|
|
2405
|
-
$region: String!
|
|
2406
|
-
$dayKey: String!
|
|
2407
|
-
$placement: AdShowOnEnum!
|
|
2408
|
-
) {
|
|
2409
|
-
adDayAvailability(region: $region, dayKey: $dayKey, placement: $placement) {
|
|
2410
|
-
currency
|
|
2411
|
-
paidAvailable
|
|
2412
|
-
reservedAvailable
|
|
2413
|
-
unitAmount
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
`;
|
|
2417
2326
|
var GET_MY_AD_BOOKINGS = gql22`
|
|
2418
2327
|
query getMyAdBookings {
|
|
2419
2328
|
myAdBookings {
|
|
@@ -2453,16 +2362,11 @@ var GET_AD_SETTINGS = gql22`
|
|
|
2453
2362
|
query getAdSettings {
|
|
2454
2363
|
adSettings {
|
|
2455
2364
|
approvalRequired
|
|
2456
|
-
minAppearancesPerHour
|
|
2457
|
-
paidSlotsPerPlacement
|
|
2458
|
-
reservedSlotsPerPlacement
|
|
2459
|
-
rotationSeconds
|
|
2460
2365
|
}
|
|
2461
2366
|
}
|
|
2462
2367
|
`;
|
|
2463
2368
|
|
|
2464
2369
|
// src/graphql/mutations/adBooking.ts
|
|
2465
|
-
import { gql as gql23 } from "@apollo/client";
|
|
2466
2370
|
var CREATE_AD_CHECKOUT_MUTATION = gql23`
|
|
2467
2371
|
mutation createAdCheckout($input: CreateAdCheckoutInputGraphQLType!) {
|
|
2468
2372
|
createAdCheckout(input: $input) {
|
|
@@ -2475,17 +2379,6 @@ var CREATE_AD_CHECKOUT_MUTATION = gql23`
|
|
|
2475
2379
|
}
|
|
2476
2380
|
}
|
|
2477
2381
|
`;
|
|
2478
|
-
var CLAIM_RESERVED_AD_DAY_MUTATION = gql23`
|
|
2479
|
-
mutation claimReservedAdDay($input: ClaimReservedAdDayInputType!) {
|
|
2480
|
-
claimReservedAdDay(input: $input) {
|
|
2481
|
-
data {
|
|
2482
|
-
...AdBookingFields
|
|
2483
|
-
}
|
|
2484
|
-
message
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
${AD_BOOKING_FIELDS_FRAGMENT}
|
|
2488
|
-
`;
|
|
2489
2382
|
var APPROVE_AD_BOOKING_MUTATION = gql23`
|
|
2490
2383
|
mutation approveAdBooking($bookingId: ID!, $approved: Boolean!) {
|
|
2491
2384
|
approveAdBooking(bookingId: $bookingId, approved: $approved) {
|
|
@@ -2516,10 +2409,6 @@ var UPDATE_AD_SETTINGS_MUTATION = gql23`
|
|
|
2516
2409
|
updateAdSettings(input: $input) {
|
|
2517
2410
|
data {
|
|
2518
2411
|
approvalRequired
|
|
2519
|
-
minAppearancesPerHour
|
|
2520
|
-
paidSlotsPerPlacement
|
|
2521
|
-
reservedSlotsPerPlacement
|
|
2522
|
-
rotationSeconds
|
|
2523
2412
|
}
|
|
2524
2413
|
message
|
|
2525
2414
|
}
|
|
@@ -2533,6 +2422,108 @@ var RECORD_AD_IMPRESSION_MUTATION = gql23`
|
|
|
2533
2422
|
}
|
|
2534
2423
|
}
|
|
2535
2424
|
`;
|
|
2425
|
+
var RECORD_AD_CLICK_MUTATION = gql23`
|
|
2426
|
+
mutation recordAdClick($input: RecordAdClickInputGraphQLType!) {
|
|
2427
|
+
recordAdClick(input: $input) {
|
|
2428
|
+
data
|
|
2429
|
+
message
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
`;
|
|
2433
|
+
|
|
2434
|
+
// src/graphql/hooks/ad/hooksMutation.ts
|
|
2435
|
+
var useCreateAd = () => {
|
|
2436
|
+
const [createAd, { loading, error }] = useMutation11(CREATE_AD_MUTATION, {
|
|
2437
|
+
awaitRefetchQueries: true,
|
|
2438
|
+
refetchQueries: [{ query: GET_ADS }]
|
|
2439
|
+
});
|
|
2440
|
+
return {
|
|
2441
|
+
createAd,
|
|
2442
|
+
error,
|
|
2443
|
+
loading
|
|
2444
|
+
};
|
|
2445
|
+
};
|
|
2446
|
+
var useUpdateAd = () => {
|
|
2447
|
+
const [updateAd, { loading, error }] = useMutation11(UPDATE_AD_MUTATION, {
|
|
2448
|
+
awaitRefetchQueries: true,
|
|
2449
|
+
refetchQueries: [{ query: GET_ADS }]
|
|
2450
|
+
});
|
|
2451
|
+
return {
|
|
2452
|
+
error,
|
|
2453
|
+
loading,
|
|
2454
|
+
updateAd
|
|
2455
|
+
};
|
|
2456
|
+
};
|
|
2457
|
+
var useDeleteAd = () => {
|
|
2458
|
+
const [deleteAd, { loading, error }] = useMutation11(DELETE_AD_MUTATION, {
|
|
2459
|
+
awaitRefetchQueries: true,
|
|
2460
|
+
refetchQueries: [{ query: GET_ADS }]
|
|
2461
|
+
});
|
|
2462
|
+
return {
|
|
2463
|
+
deleteAd,
|
|
2464
|
+
error,
|
|
2465
|
+
loading
|
|
2466
|
+
};
|
|
2467
|
+
};
|
|
2468
|
+
var useRecordAdImpression = () => {
|
|
2469
|
+
const [recordAdImpression, { loading, error }] = useMutation11(RECORD_AD_IMPRESSION_MUTATION);
|
|
2470
|
+
return {
|
|
2471
|
+
error,
|
|
2472
|
+
loading,
|
|
2473
|
+
recordAdImpression
|
|
2474
|
+
};
|
|
2475
|
+
};
|
|
2476
|
+
var useRecordAdClick = () => {
|
|
2477
|
+
const [recordAdClick, { loading, error }] = useMutation11(RECORD_AD_CLICK_MUTATION);
|
|
2478
|
+
return {
|
|
2479
|
+
error,
|
|
2480
|
+
loading,
|
|
2481
|
+
recordAdClick
|
|
2482
|
+
};
|
|
2483
|
+
};
|
|
2484
|
+
|
|
2485
|
+
// src/graphql/hooks/ad/hooksQuery.ts
|
|
2486
|
+
import { useQuery as useQuery6 } from "@apollo/client";
|
|
2487
|
+
var useGetAds = () => {
|
|
2488
|
+
const { data, loading, error, refetch } = useQuery6(
|
|
2489
|
+
GET_ADS,
|
|
2490
|
+
{
|
|
2491
|
+
fetchPolicy: "no-cache"
|
|
2492
|
+
}
|
|
2493
|
+
);
|
|
2494
|
+
return {
|
|
2495
|
+
ads: data?.ads || [],
|
|
2496
|
+
error,
|
|
2497
|
+
loading,
|
|
2498
|
+
refetch
|
|
2499
|
+
};
|
|
2500
|
+
};
|
|
2501
|
+
var useGetAd = (_id) => {
|
|
2502
|
+
const { data, loading, error, refetch } = useQuery6(GET_AD, {
|
|
2503
|
+
fetchPolicy: "no-cache",
|
|
2504
|
+
skip: !_id || _id === "",
|
|
2505
|
+
variables: { _id }
|
|
2506
|
+
});
|
|
2507
|
+
return {
|
|
2508
|
+
ad: data?.ad,
|
|
2509
|
+
error,
|
|
2510
|
+
loading,
|
|
2511
|
+
refetch
|
|
2512
|
+
};
|
|
2513
|
+
};
|
|
2514
|
+
var useGetAdsByRegion = (region, platform, showOn) => {
|
|
2515
|
+
const { data, loading, error, refetch } = useQuery6(GET_ADS_BY_REGION, {
|
|
2516
|
+
fetchPolicy: "no-cache",
|
|
2517
|
+
skip: !region || region === "",
|
|
2518
|
+
variables: { platform, region, showOn }
|
|
2519
|
+
});
|
|
2520
|
+
return {
|
|
2521
|
+
adsByRegion: data?.adsByRegion || [],
|
|
2522
|
+
error,
|
|
2523
|
+
loading,
|
|
2524
|
+
refetch
|
|
2525
|
+
};
|
|
2526
|
+
};
|
|
2536
2527
|
|
|
2537
2528
|
// src/graphql/hooks/resourceActivities/hooksMutation.ts
|
|
2538
2529
|
import { useMutation as useMutation12 } from "@apollo/client";
|
|
@@ -4333,25 +4324,26 @@ export {
|
|
|
4333
4324
|
useAddUserPresentResource,
|
|
4334
4325
|
useRemoveUserPresentResource,
|
|
4335
4326
|
useSelectStandardPackage,
|
|
4336
|
-
useCreateAd,
|
|
4337
|
-
useUpdateAd,
|
|
4338
|
-
useDeleteAd,
|
|
4339
|
-
useGetAds,
|
|
4340
|
-
useGetAd,
|
|
4341
|
-
useGetAdsByRegion,
|
|
4342
4327
|
AD_BOOKING_FIELDS_FRAGMENT,
|
|
4343
|
-
GET_AD_DAY_AVAILABILITY,
|
|
4344
4328
|
GET_MY_AD_BOOKINGS,
|
|
4345
4329
|
GET_AD_BOOKING,
|
|
4346
4330
|
GET_PENDING_AD_BOOKINGS,
|
|
4347
4331
|
GET_AD_DAILY_PRICES,
|
|
4348
4332
|
GET_AD_SETTINGS,
|
|
4349
4333
|
CREATE_AD_CHECKOUT_MUTATION,
|
|
4350
|
-
CLAIM_RESERVED_AD_DAY_MUTATION,
|
|
4351
4334
|
APPROVE_AD_BOOKING_MUTATION,
|
|
4352
4335
|
UPDATE_AD_DAILY_PRICE_MUTATION,
|
|
4353
4336
|
UPDATE_AD_SETTINGS_MUTATION,
|
|
4354
4337
|
RECORD_AD_IMPRESSION_MUTATION,
|
|
4338
|
+
RECORD_AD_CLICK_MUTATION,
|
|
4339
|
+
useCreateAd,
|
|
4340
|
+
useUpdateAd,
|
|
4341
|
+
useDeleteAd,
|
|
4342
|
+
useRecordAdImpression,
|
|
4343
|
+
useRecordAdClick,
|
|
4344
|
+
useGetAds,
|
|
4345
|
+
useGetAd,
|
|
4346
|
+
useGetAdsByRegion,
|
|
4355
4347
|
useCreateResourceActivity,
|
|
4356
4348
|
useGetResourceActivity,
|
|
4357
4349
|
useCreateCheckoutSession,
|
|
@@ -4407,4 +4399,4 @@ export {
|
|
|
4407
4399
|
useGetCoupon,
|
|
4408
4400
|
usePaginatedList
|
|
4409
4401
|
};
|
|
4410
|
-
//# sourceMappingURL=chunk-
|
|
4402
|
+
//# sourceMappingURL=chunk-2RHUGVV3.mjs.map
|