@timardex/cluemart-shared 2.5.0 → 2.5.1
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-DRI2CIzV.d.ts → ad-C7GbDyUi.d.ts} +1 -1
- package/dist/{ad-BSyVGv8q.d.mts → ad-DB9gvcJW.d.mts} +1 -1
- package/dist/{chunk-L4NHGGT7.mjs → chunk-H6HM2FOZ.mjs} +2 -2
- package/dist/{chunk-DEK7NF3O.mjs → chunk-NEOBS55J.mjs} +1 -1
- package/dist/{chunk-2RHUGVV3.mjs → chunk-WOBG6I4T.mjs} +175 -12
- package/dist/chunk-WOBG6I4T.mjs.map +1 -0
- package/dist/chunk-YCUKTVVA.mjs +69 -0
- package/dist/chunk-YCUKTVVA.mjs.map +1 -0
- package/dist/formFields/index.mjs +3 -3
- package/dist/graphql/index.cjs +193 -13
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +46 -3
- package/dist/graphql/index.d.ts +46 -3
- package/dist/graphql/index.mjs +8 -2
- package/dist/hooks/index.cjs +23 -13
- 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 +4 -4
- package/dist/index.cjs +209 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.mjs +196 -9
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.cjs +34 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +17 -1
- package/dist/utils/index.d.ts +17 -1
- package/dist/utils/index.mjs +15 -3
- package/package.json +1 -1
- package/dist/chunk-2RHUGVV3.mjs.map +0 -1
- package/dist/chunk-7DQBUZXY.mjs +0 -41
- package/dist/chunk-7DQBUZXY.mjs.map +0 -1
- /package/dist/{chunk-L4NHGGT7.mjs.map → chunk-H6HM2FOZ.mjs.map} +0 -0
- /package/dist/{chunk-DEK7NF3O.mjs.map → chunk-NEOBS55J.mjs.map} +0 -0
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as LocationType, r as VendorFormData, s as CreateVendorFormData, t as VendorInfoFormData, u as CreateVendorInfoFormData, v as UnregisteredVendorFormData, w as CreateUnregisteredVendorFormData, x as EventFormData, y as CreateEventFormData, z as EventInfoFormData, A as CreateEventInfoFormData, B as BaseResourceTypeFormData, D as PostFormData, H as CreatePostFormData, I as CouponDefaultsFormData, J as CreateCouponFormData } from '../global-EGbrTMk6.mjs';
|
|
2
2
|
import { e as UserFormData, C as CreateUserFormData } from '../user-Znc91Cw5.mjs';
|
|
3
|
-
import { C as CreateLoginFormData, g as CreateRegisterFormData, h as CreateRequestPasswordResetFormData, i as CreateValidateVerificationTokenFormData, j as CreateResetPasswordFormData, k as PartnerFormData, l as AdFormData, m as CreateAdFormState, n as CreatePartnerFormData, o as AppSettingsFormData, p as CreateAppSettingsFormData, q as SchoolFormData, r as CreateSchoolFormData } from '../ad-
|
|
3
|
+
import { C as CreateLoginFormData, g as CreateRegisterFormData, h as CreateRequestPasswordResetFormData, i as CreateValidateVerificationTokenFormData, j as CreateResetPasswordFormData, k as PartnerFormData, l as AdFormData, m as CreateAdFormState, n as CreatePartnerFormData, o as AppSettingsFormData, p as CreateAppSettingsFormData, q as SchoolFormData, r as CreateSchoolFormData } from '../ad-DB9gvcJW.mjs';
|
|
4
4
|
import { a as AffiliateFormData, A as AffiliateType, C as CreateAffiliateFormData } from '../affiliate-DJhVZJ2h.mjs';
|
|
5
5
|
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-BDJutwcx.mjs';
|
|
6
6
|
import 'react-hook-form';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as LocationType, r as VendorFormData, s as CreateVendorFormData, t as VendorInfoFormData, u as CreateVendorInfoFormData, v as UnregisteredVendorFormData, w as CreateUnregisteredVendorFormData, x as EventFormData, y as CreateEventFormData, z as EventInfoFormData, A as CreateEventInfoFormData, B as BaseResourceTypeFormData, D as PostFormData, H as CreatePostFormData, I as CouponDefaultsFormData, J as CreateCouponFormData } from '../global-LtQJ2t6c.js';
|
|
2
2
|
import { e as UserFormData, C as CreateUserFormData } from '../user-GnrqZmZP.js';
|
|
3
|
-
import { C as CreateLoginFormData, g as CreateRegisterFormData, h as CreateRequestPasswordResetFormData, i as CreateValidateVerificationTokenFormData, j as CreateResetPasswordFormData, k as PartnerFormData, l as AdFormData, m as CreateAdFormState, n as CreatePartnerFormData, o as AppSettingsFormData, p as CreateAppSettingsFormData, q as SchoolFormData, r as CreateSchoolFormData } from '../ad-
|
|
3
|
+
import { C as CreateLoginFormData, g as CreateRegisterFormData, h as CreateRequestPasswordResetFormData, i as CreateValidateVerificationTokenFormData, j as CreateResetPasswordFormData, k as PartnerFormData, l as AdFormData, m as CreateAdFormState, n as CreatePartnerFormData, o as AppSettingsFormData, p as CreateAppSettingsFormData, q as SchoolFormData, r as CreateSchoolFormData } from '../ad-C7GbDyUi.js';
|
|
4
4
|
import { a as AffiliateFormData, A as AffiliateType, C as CreateAffiliateFormData } from '../affiliate-DuDoOxK_.js';
|
|
5
5
|
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-6b5g9DV-.js';
|
|
6
6
|
import 'react-hook-form';
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -2,12 +2,12 @@ import "../chunk-CQ26N3W6.mjs";
|
|
|
2
2
|
import "../chunk-VA5YN2K3.mjs";
|
|
3
3
|
import "../chunk-VPANTTZI.mjs";
|
|
4
4
|
import "../chunk-DWO35OY4.mjs";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-H6HM2FOZ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
8
8
|
isValidIrdNumber,
|
|
9
9
|
normalizeUrl
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-NEOBS55J.mjs";
|
|
11
11
|
import "../chunk-RE4NZPYY.mjs";
|
|
12
12
|
import {
|
|
13
13
|
dateFormat,
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
} from "../chunk-WWAHS5R2.mjs";
|
|
25
25
|
import "../chunk-RAYUJODN.mjs";
|
|
26
26
|
import "../chunk-DQ7ZHIXW.mjs";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-WOBG6I4T.mjs";
|
|
28
28
|
import "../chunk-TKSBCN3N.mjs";
|
|
29
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-YCUKTVVA.mjs";
|
|
30
30
|
import {
|
|
31
31
|
EnumEventDateStatus,
|
|
32
32
|
EnumEventType,
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,8 @@ __export(index_exports, {
|
|
|
34
34
|
ADMIN_APP_ROLES: () => ADMIN_APP_ROLES,
|
|
35
35
|
ADMIN_DASHBOARD_CONTEXTS: () => ADMIN_DASHBOARD_CONTEXTS,
|
|
36
36
|
AD_BOOKING_FIELDS_FRAGMENT: () => AD_BOOKING_FIELDS_FRAGMENT,
|
|
37
|
+
AD_METRIC_IMPRESSION_RETRY_DELAY_MS: () => AD_METRIC_IMPRESSION_RETRY_DELAY_MS,
|
|
38
|
+
AD_METRIC_ROTATION_INTERVAL_MS: () => AD_METRIC_ROTATION_INTERVAL_MS,
|
|
37
39
|
AFFILIATE_PARTICIPANT_TYPE_LABELS: () => AFFILIATE_PARTICIPANT_TYPE_LABELS,
|
|
38
40
|
AFFILIATE_REWARDS: () => AFFILIATE_REWARDS,
|
|
39
41
|
ANDROID_URL: () => ANDROID_URL,
|
|
@@ -97,6 +99,7 @@ __export(index_exports, {
|
|
|
97
99
|
FUTURE_EVENT_DATE_STATUSES: () => FUTURE_EVENT_DATE_STATUSES,
|
|
98
100
|
GET_AD_BOOKING: () => GET_AD_BOOKING,
|
|
99
101
|
GET_AD_DAILY_PRICES: () => GET_AD_DAILY_PRICES,
|
|
102
|
+
GET_AD_METRIC_TOTALS: () => GET_AD_METRIC_TOTALS,
|
|
100
103
|
GET_AD_SETTINGS: () => GET_AD_SETTINGS,
|
|
101
104
|
GET_EVENT: () => GET_EVENT,
|
|
102
105
|
GET_EVENTS: () => GET_EVENTS,
|
|
@@ -190,6 +193,7 @@ __export(index_exports, {
|
|
|
190
193
|
badges: () => badges,
|
|
191
194
|
bankAccountDetailsFields: () => bankAccountDetailsFields,
|
|
192
195
|
billingCatalogDefinitionMatches: () => billingCatalogDefinitionMatches,
|
|
196
|
+
buildAdMetricSlotKey: () => buildAdMetricSlotKey,
|
|
193
197
|
buildApplicationShareDescription: () => buildApplicationShareDescription,
|
|
194
198
|
buildCalendarSheetContentData: () => buildCalendarSheetContentData,
|
|
195
199
|
buildInvitationShareDescription: () => buildInvitationShareDescription,
|
|
@@ -262,6 +266,9 @@ __export(index_exports, {
|
|
|
262
266
|
futureTimePeriods: () => futureTimePeriods,
|
|
263
267
|
gameScreenIdentifierList: () => gameScreenIdentifierList,
|
|
264
268
|
gameTypeToDisplayName: () => gameTypeToDisplayName,
|
|
269
|
+
generateAdClickId: () => generateAdClickId,
|
|
270
|
+
getAdMetricRotationIndex: () => getAdMetricRotationIndex,
|
|
271
|
+
getAdMetricRotationSlot: () => getAdMetricRotationSlot,
|
|
265
272
|
getAllowedEventDateStatuses: () => getAllowedEventDateStatuses,
|
|
266
273
|
getBillingCatalogKeyForSelection: () => getBillingCatalogKeyForSelection,
|
|
267
274
|
getCurrentAndFutureDates: () => getCurrentAndFutureDates,
|
|
@@ -376,6 +383,7 @@ __export(index_exports, {
|
|
|
376
383
|
truncateText: () => truncateText,
|
|
377
384
|
updateSingleDateTimeStatus: () => updateSingleDateTimeStatus,
|
|
378
385
|
useActivateVendorClaim: () => useActivateVendorClaim,
|
|
386
|
+
useAdMetricsReporter: () => useAdMetricsReporter,
|
|
379
387
|
useAddParticipantToChat: () => useAddParticipantToChat,
|
|
380
388
|
useAddUserFavouriteResource: () => useAddUserFavouriteResource,
|
|
381
389
|
useAddUserGoingResource: () => useAddUserGoingResource,
|
|
@@ -426,6 +434,7 @@ __export(index_exports, {
|
|
|
426
434
|
useDeleteVendor: () => useDeleteVendor,
|
|
427
435
|
useEndImpersonation: () => useEndImpersonation,
|
|
428
436
|
useGetAd: () => useGetAd,
|
|
437
|
+
useGetAdMetricTotals: () => useGetAdMetricTotals,
|
|
429
438
|
useGetAds: () => useGetAds,
|
|
430
439
|
useGetAdsByRegion: () => useGetAdsByRegion,
|
|
431
440
|
useGetAffiliate: () => useGetAffiliate,
|
|
@@ -3433,6 +3442,28 @@ function isTransientNetworkError(err) {
|
|
|
3433
3442
|
return TRANSIENT_NETWORK_PATTERNS.some((pattern) => pattern.test(message));
|
|
3434
3443
|
}
|
|
3435
3444
|
|
|
3445
|
+
// src/utils/adMetrics.ts
|
|
3446
|
+
var AD_METRIC_ROTATION_INTERVAL_MS = 8e3;
|
|
3447
|
+
var AD_METRIC_IMPRESSION_RETRY_DELAY_MS = 1e3;
|
|
3448
|
+
function getAdMetricRotationSlot(epochMilliseconds) {
|
|
3449
|
+
return Math.floor(epochMilliseconds / AD_METRIC_ROTATION_INTERVAL_MS);
|
|
3450
|
+
}
|
|
3451
|
+
function getAdMetricRotationIndex(epochMilliseconds, count) {
|
|
3452
|
+
if (count <= 0) return 0;
|
|
3453
|
+
return getAdMetricRotationSlot(epochMilliseconds) % count;
|
|
3454
|
+
}
|
|
3455
|
+
function buildAdMetricSlotKey(adId, placement, slot) {
|
|
3456
|
+
return `${adId}:${placement}:${slot}`;
|
|
3457
|
+
}
|
|
3458
|
+
function generateAdClickId() {
|
|
3459
|
+
const cryptoApi = globalThis.crypto;
|
|
3460
|
+
if (typeof cryptoApi?.randomUUID === "function") {
|
|
3461
|
+
return cryptoApi.randomUUID();
|
|
3462
|
+
}
|
|
3463
|
+
const randomPart = Math.random().toString(36).slice(2) || "0";
|
|
3464
|
+
return `click-${Date.now()}-${randomPart}`;
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3436
3467
|
// src/utils/billingCatalog/index.ts
|
|
3437
3468
|
var BILLING_CATALOG_KEYS = [
|
|
3438
3469
|
"pro_vendor_monthly",
|
|
@@ -7798,6 +7829,7 @@ var useGetUsersByPromoCode = (promoCode, options) => {
|
|
|
7798
7829
|
|
|
7799
7830
|
// src/graphql/hooks/ad/hooksMutation.ts
|
|
7800
7831
|
var import_client48 = require("@apollo/client");
|
|
7832
|
+
var import_react = require("react");
|
|
7801
7833
|
|
|
7802
7834
|
// src/graphql/mutations/ad.ts
|
|
7803
7835
|
var import_client45 = require("@apollo/client");
|
|
@@ -7963,6 +7995,15 @@ var GET_AD_SETTINGS = import_client46.gql`
|
|
|
7963
7995
|
}
|
|
7964
7996
|
}
|
|
7965
7997
|
`;
|
|
7998
|
+
var GET_AD_METRIC_TOTALS = import_client46.gql`
|
|
7999
|
+
query getAdMetricTotals($filter: AdMetricTotalsFilterInputGraphQLType) {
|
|
8000
|
+
adMetricTotals(filter: $filter) {
|
|
8001
|
+
adId
|
|
8002
|
+
clicks
|
|
8003
|
+
impressions
|
|
8004
|
+
}
|
|
8005
|
+
}
|
|
8006
|
+
`;
|
|
7966
8007
|
|
|
7967
8008
|
// src/graphql/mutations/adBooking.ts
|
|
7968
8009
|
var CREATE_AD_CHECKOUT_MUTATION = import_client47.gql`
|
|
@@ -8079,14 +8120,147 @@ var useRecordAdClick = () => {
|
|
|
8079
8120
|
recordAdClick
|
|
8080
8121
|
};
|
|
8081
8122
|
};
|
|
8123
|
+
var defaultAdMetricErrorHandler = (message, error) => {
|
|
8124
|
+
console.error(message, error);
|
|
8125
|
+
};
|
|
8126
|
+
var useAdMetricsReporter = (input, onError = defaultAdMetricErrorHandler) => {
|
|
8127
|
+
const { recordAdImpression } = useRecordAdImpression();
|
|
8128
|
+
const { recordAdClick } = useRecordAdClick();
|
|
8129
|
+
const reportedSlotRef = (0, import_react.useRef)({
|
|
8130
|
+
keys: /* @__PURE__ */ new Set(),
|
|
8131
|
+
slot: -1
|
|
8132
|
+
});
|
|
8133
|
+
const inFlightRef = (0, import_react.useRef)(false);
|
|
8134
|
+
const disposedRef = (0, import_react.useRef)(false);
|
|
8135
|
+
const safeOnError = (0, import_react.useCallback)(
|
|
8136
|
+
(message, error) => {
|
|
8137
|
+
try {
|
|
8138
|
+
onError(message, error);
|
|
8139
|
+
} catch {
|
|
8140
|
+
}
|
|
8141
|
+
},
|
|
8142
|
+
[onError]
|
|
8143
|
+
);
|
|
8144
|
+
(0, import_react.useEffect)(() => {
|
|
8145
|
+
disposedRef.current = false;
|
|
8146
|
+
return () => {
|
|
8147
|
+
disposedRef.current = true;
|
|
8148
|
+
};
|
|
8149
|
+
}, []);
|
|
8150
|
+
const reportImpression = (0, import_react.useCallback)(
|
|
8151
|
+
async (opts) => {
|
|
8152
|
+
if (inFlightRef.current || disposedRef.current) return false;
|
|
8153
|
+
const now = opts?.nowMs ?? Date.now();
|
|
8154
|
+
const slot = getAdMetricRotationSlot(now);
|
|
8155
|
+
const key = buildAdMetricSlotKey(input.adId, input.placement, slot);
|
|
8156
|
+
const reported = reportedSlotRef.current;
|
|
8157
|
+
if (reported.slot !== slot) {
|
|
8158
|
+
reported.slot = slot;
|
|
8159
|
+
reported.keys.clear();
|
|
8160
|
+
}
|
|
8161
|
+
if (reported.keys.has(key)) return false;
|
|
8162
|
+
inFlightRef.current = true;
|
|
8163
|
+
try {
|
|
8164
|
+
const result = await recordAdImpression({
|
|
8165
|
+
variables: {
|
|
8166
|
+
input: {
|
|
8167
|
+
adId: input.adId,
|
|
8168
|
+
placement: input.placement,
|
|
8169
|
+
platform: input.platform,
|
|
8170
|
+
region: input.region
|
|
8171
|
+
}
|
|
8172
|
+
}
|
|
8173
|
+
});
|
|
8174
|
+
if (result.data?.recordAdImpression?.data !== true) {
|
|
8175
|
+
return false;
|
|
8176
|
+
}
|
|
8177
|
+
reported.keys.add(key);
|
|
8178
|
+
return true;
|
|
8179
|
+
} catch (error) {
|
|
8180
|
+
safeOnError(
|
|
8181
|
+
"Ad impression report failed; retrying within the rotation.",
|
|
8182
|
+
error
|
|
8183
|
+
);
|
|
8184
|
+
if (!disposedRef.current && getAdMetricRotationSlot(Date.now()) === slot) {
|
|
8185
|
+
await new Promise(
|
|
8186
|
+
(resolve) => setTimeout(resolve, AD_METRIC_IMPRESSION_RETRY_DELAY_MS)
|
|
8187
|
+
);
|
|
8188
|
+
if (!disposedRef.current && getAdMetricRotationSlot(Date.now()) === slot) {
|
|
8189
|
+
try {
|
|
8190
|
+
const retryResult = await recordAdImpression({
|
|
8191
|
+
variables: {
|
|
8192
|
+
input: {
|
|
8193
|
+
adId: input.adId,
|
|
8194
|
+
placement: input.placement,
|
|
8195
|
+
platform: input.platform,
|
|
8196
|
+
region: input.region
|
|
8197
|
+
}
|
|
8198
|
+
}
|
|
8199
|
+
});
|
|
8200
|
+
if (retryResult.data?.recordAdImpression?.data !== true) {
|
|
8201
|
+
return false;
|
|
8202
|
+
}
|
|
8203
|
+
reported.keys.add(key);
|
|
8204
|
+
return true;
|
|
8205
|
+
} catch (retryError) {
|
|
8206
|
+
safeOnError("Ad impression retry failed.", retryError);
|
|
8207
|
+
}
|
|
8208
|
+
}
|
|
8209
|
+
}
|
|
8210
|
+
return false;
|
|
8211
|
+
} finally {
|
|
8212
|
+
inFlightRef.current = false;
|
|
8213
|
+
}
|
|
8214
|
+
},
|
|
8215
|
+
[
|
|
8216
|
+
input.adId,
|
|
8217
|
+
input.placement,
|
|
8218
|
+
input.platform,
|
|
8219
|
+
input.region,
|
|
8220
|
+
safeOnError,
|
|
8221
|
+
recordAdImpression
|
|
8222
|
+
]
|
|
8223
|
+
);
|
|
8224
|
+
const reportClick = (0, import_react.useCallback)(
|
|
8225
|
+
(adIdOverride) => {
|
|
8226
|
+
try {
|
|
8227
|
+
void recordAdClick({
|
|
8228
|
+
variables: {
|
|
8229
|
+
input: {
|
|
8230
|
+
adId: adIdOverride ?? input.adId,
|
|
8231
|
+
clickId: generateAdClickId(),
|
|
8232
|
+
placement: input.placement,
|
|
8233
|
+
platform: input.platform,
|
|
8234
|
+
region: input.region
|
|
8235
|
+
}
|
|
8236
|
+
}
|
|
8237
|
+
}).catch((error) => {
|
|
8238
|
+
safeOnError("Ad click report failed.", error);
|
|
8239
|
+
});
|
|
8240
|
+
} catch (error) {
|
|
8241
|
+
safeOnError("Ad click report failed.", error);
|
|
8242
|
+
}
|
|
8243
|
+
},
|
|
8244
|
+
[
|
|
8245
|
+
input.adId,
|
|
8246
|
+
input.placement,
|
|
8247
|
+
input.platform,
|
|
8248
|
+
input.region,
|
|
8249
|
+
safeOnError,
|
|
8250
|
+
recordAdClick
|
|
8251
|
+
]
|
|
8252
|
+
);
|
|
8253
|
+
return { reportClick, reportImpression };
|
|
8254
|
+
};
|
|
8082
8255
|
|
|
8083
8256
|
// src/graphql/hooks/ad/hooksQuery.ts
|
|
8084
8257
|
var import_client49 = require("@apollo/client");
|
|
8085
|
-
var useGetAds = () => {
|
|
8258
|
+
var useGetAds = (skip = false) => {
|
|
8086
8259
|
const { data, loading, error, refetch } = (0, import_client49.useQuery)(
|
|
8087
8260
|
GET_ADS,
|
|
8088
8261
|
{
|
|
8089
|
-
fetchPolicy: "no-cache"
|
|
8262
|
+
fetchPolicy: "no-cache",
|
|
8263
|
+
skip
|
|
8090
8264
|
}
|
|
8091
8265
|
);
|
|
8092
8266
|
return {
|
|
@@ -8122,6 +8296,19 @@ var useGetAdsByRegion = (region, platform, showOn) => {
|
|
|
8122
8296
|
refetch
|
|
8123
8297
|
};
|
|
8124
8298
|
};
|
|
8299
|
+
var useGetAdMetricTotals = (filter, skip = false) => {
|
|
8300
|
+
const { data, loading, error, refetch } = (0, import_client49.useQuery)(GET_AD_METRIC_TOTALS, {
|
|
8301
|
+
fetchPolicy: "no-cache",
|
|
8302
|
+
skip,
|
|
8303
|
+
variables: filter ? { filter } : void 0
|
|
8304
|
+
});
|
|
8305
|
+
return {
|
|
8306
|
+
adMetricTotals: data?.adMetricTotals || [],
|
|
8307
|
+
error,
|
|
8308
|
+
loading,
|
|
8309
|
+
refetch
|
|
8310
|
+
};
|
|
8311
|
+
};
|
|
8125
8312
|
|
|
8126
8313
|
// src/graphql/hooks/resourceActivities/hooksMutation.ts
|
|
8127
8314
|
var import_client51 = require("@apollo/client");
|
|
@@ -9736,7 +9923,7 @@ var useGetCoupon = (_id) => {
|
|
|
9736
9923
|
|
|
9737
9924
|
// src/graphql/hooks/usePaginatedList.ts
|
|
9738
9925
|
var import_client88 = require("@apollo/client");
|
|
9739
|
-
var
|
|
9926
|
+
var import_react2 = require("react");
|
|
9740
9927
|
function usePaginatedList({
|
|
9741
9928
|
document,
|
|
9742
9929
|
getItems,
|
|
@@ -9750,12 +9937,12 @@ function usePaginatedList({
|
|
|
9750
9937
|
`usePaginatedList: pageSize must be a positive integer, received ${String(pageSize)}.`
|
|
9751
9938
|
);
|
|
9752
9939
|
}
|
|
9753
|
-
const [offset, setOffset] = (0,
|
|
9754
|
-
const [items, setItems] = (0,
|
|
9755
|
-
const [hasMore, setHasMore] = (0,
|
|
9756
|
-
const [hasSettled, setHasSettled] = (0,
|
|
9940
|
+
const [offset, setOffset] = (0, import_react2.useState)(0);
|
|
9941
|
+
const [items, setItems] = (0, import_react2.useState)([]);
|
|
9942
|
+
const [hasMore, setHasMore] = (0, import_react2.useState)(!skip);
|
|
9943
|
+
const [hasSettled, setHasSettled] = (0, import_react2.useState)(false);
|
|
9757
9944
|
const variablesKey = JSON.stringify(variables ?? null);
|
|
9758
|
-
(0,
|
|
9945
|
+
(0, import_react2.useEffect)(() => {
|
|
9759
9946
|
setItems([]);
|
|
9760
9947
|
setHasMore(!skip);
|
|
9761
9948
|
setHasSettled(false);
|
|
@@ -9766,14 +9953,14 @@ function usePaginatedList({
|
|
|
9766
9953
|
skip,
|
|
9767
9954
|
variables: { ...variables, options: { limit: pageSize + 1, offset } }
|
|
9768
9955
|
});
|
|
9769
|
-
const refetchRef = (0,
|
|
9956
|
+
const refetchRef = (0, import_react2.useRef)(refetch);
|
|
9770
9957
|
refetchRef.current = refetch;
|
|
9771
|
-
const variablesRef = (0,
|
|
9958
|
+
const variablesRef = (0, import_react2.useRef)(variables);
|
|
9772
9959
|
variablesRef.current = variables;
|
|
9773
9960
|
const rawPage = getItems(data);
|
|
9774
9961
|
const page = rawPage.length > pageSize ? rawPage.slice(0, pageSize) : rawPage;
|
|
9775
9962
|
const hasMorePage = rawPage.length > pageSize;
|
|
9776
|
-
(0,
|
|
9963
|
+
(0, import_react2.useEffect)(() => {
|
|
9777
9964
|
if (loading || skip || error) {
|
|
9778
9965
|
return;
|
|
9779
9966
|
}
|
|
@@ -9789,7 +9976,7 @@ function usePaginatedList({
|
|
|
9789
9976
|
setHasSettled(true);
|
|
9790
9977
|
setHasMore(hasMorePage);
|
|
9791
9978
|
}, [loading, skip, error, page, hasMorePage, hasSettled, pageSize, getId]);
|
|
9792
|
-
const loadMore = (0,
|
|
9979
|
+
const loadMore = (0, import_react2.useCallback)(() => {
|
|
9793
9980
|
if (loading || skip) {
|
|
9794
9981
|
return;
|
|
9795
9982
|
}
|
|
@@ -9805,7 +9992,7 @@ function usePaginatedList({
|
|
|
9805
9992
|
}
|
|
9806
9993
|
setOffset(offset + pageSize);
|
|
9807
9994
|
}, [loading, skip, error, hasSettled, hasMore, offset, pageSize]);
|
|
9808
|
-
const refresh = (0,
|
|
9995
|
+
const refresh = (0, import_react2.useCallback)(() => {
|
|
9809
9996
|
setItems([]);
|
|
9810
9997
|
setHasMore(!skip);
|
|
9811
9998
|
setHasSettled(false);
|
|
@@ -10388,6 +10575,8 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10388
10575
|
ADMIN_APP_ROLES,
|
|
10389
10576
|
ADMIN_DASHBOARD_CONTEXTS,
|
|
10390
10577
|
AD_BOOKING_FIELDS_FRAGMENT,
|
|
10578
|
+
AD_METRIC_IMPRESSION_RETRY_DELAY_MS,
|
|
10579
|
+
AD_METRIC_ROTATION_INTERVAL_MS,
|
|
10391
10580
|
AFFILIATE_PARTICIPANT_TYPE_LABELS,
|
|
10392
10581
|
AFFILIATE_REWARDS,
|
|
10393
10582
|
ANDROID_URL,
|
|
@@ -10451,6 +10640,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10451
10640
|
FUTURE_EVENT_DATE_STATUSES,
|
|
10452
10641
|
GET_AD_BOOKING,
|
|
10453
10642
|
GET_AD_DAILY_PRICES,
|
|
10643
|
+
GET_AD_METRIC_TOTALS,
|
|
10454
10644
|
GET_AD_SETTINGS,
|
|
10455
10645
|
GET_EVENT,
|
|
10456
10646
|
GET_EVENTS,
|
|
@@ -10544,6 +10734,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10544
10734
|
badges,
|
|
10545
10735
|
bankAccountDetailsFields,
|
|
10546
10736
|
billingCatalogDefinitionMatches,
|
|
10737
|
+
buildAdMetricSlotKey,
|
|
10547
10738
|
buildApplicationShareDescription,
|
|
10548
10739
|
buildCalendarSheetContentData,
|
|
10549
10740
|
buildInvitationShareDescription,
|
|
@@ -10616,6 +10807,9 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10616
10807
|
futureTimePeriods,
|
|
10617
10808
|
gameScreenIdentifierList,
|
|
10618
10809
|
gameTypeToDisplayName,
|
|
10810
|
+
generateAdClickId,
|
|
10811
|
+
getAdMetricRotationIndex,
|
|
10812
|
+
getAdMetricRotationSlot,
|
|
10619
10813
|
getAllowedEventDateStatuses,
|
|
10620
10814
|
getBillingCatalogKeyForSelection,
|
|
10621
10815
|
getCurrentAndFutureDates,
|
|
@@ -10730,6 +10924,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10730
10924
|
truncateText,
|
|
10731
10925
|
updateSingleDateTimeStatus,
|
|
10732
10926
|
useActivateVendorClaim,
|
|
10927
|
+
useAdMetricsReporter,
|
|
10733
10928
|
useAddParticipantToChat,
|
|
10734
10929
|
useAddUserFavouriteResource,
|
|
10735
10930
|
useAddUserGoingResource,
|
|
@@ -10780,6 +10975,7 @@ function canAccessAdminPath(roles, pathname) {
|
|
|
10780
10975
|
useDeleteVendor,
|
|
10781
10976
|
useEndImpersonation,
|
|
10782
10977
|
useGetAd,
|
|
10978
|
+
useGetAdMetricTotals,
|
|
10783
10979
|
useGetAds,
|
|
10784
10980
|
useGetAdsByRegion,
|
|
10785
10981
|
useGetAffiliate,
|