@happyvertical/smrt-ads 0.51.32 → 0.51.33
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/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/collections/AdDeliveryTierCollection.d.ts +42 -0
- package/dist/collections/AdDeliveryTierCollection.d.ts.map +1 -0
- package/dist/collections/AdEventCollection.d.ts +119 -0
- package/dist/collections/AdEventCollection.d.ts.map +1 -0
- package/dist/collections/AdFormatCollection.d.ts +38 -0
- package/dist/collections/AdFormatCollection.d.ts.map +1 -0
- package/dist/collections/AdGroupCollection.d.ts +100 -0
- package/dist/collections/AdGroupCollection.d.ts.map +1 -0
- package/dist/collections/AdVariationCollection.d.ts +93 -0
- package/dist/collections/AdVariationCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +10 -0
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/index.d.ts +12 -885
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/models/AdDeliveryTier.d.ts +66 -0
- package/dist/models/AdDeliveryTier.d.ts.map +1 -0
- package/dist/models/AdEvent.d.ts +105 -0
- package/dist/models/AdEvent.d.ts.map +1 -0
- package/dist/models/AdFormat.d.ts +62 -0
- package/dist/models/AdFormat.d.ts.map +1 -0
- package/dist/models/AdGroup.d.ts +153 -0
- package/dist/models/AdGroup.d.ts.map +1 -0
- package/dist/models/AdVariation.d.ts +117 -0
- package/dist/models/AdVariation.d.ts.map +1 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +4 -4
- package/dist/types/index.d.ts +46 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__smrt-register__.d.ts","sourceRoot":"","sources":["../src/__smrt-register__.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdDeliveryTierCollection - Collection manager for AdDeliveryTier objects
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
6
|
+
import { AdDeliveryTier } from '../models/AdDeliveryTier.js';
|
|
7
|
+
import { PricingModel } from '../types/index.js';
|
|
8
|
+
export declare class AdDeliveryTierCollection extends SmrtCollection<AdDeliveryTier> {
|
|
9
|
+
static readonly _itemClass: typeof AdDeliveryTier;
|
|
10
|
+
/**
|
|
11
|
+
* Find tiers ordered by priority (ascending, lower = higher priority)
|
|
12
|
+
*
|
|
13
|
+
* @returns Array of tiers ordered by priority
|
|
14
|
+
*/
|
|
15
|
+
findByPriority(): Promise<AdDeliveryTier[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Find tiers by pricing model
|
|
18
|
+
*
|
|
19
|
+
* @param pricingModel - Pricing model to filter by
|
|
20
|
+
* @returns Array of matching tiers
|
|
21
|
+
*/
|
|
22
|
+
findByPricingModel(pricingModel: PricingModel): Promise<AdDeliveryTier[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the highest priority tier
|
|
25
|
+
*
|
|
26
|
+
* @returns Highest priority tier or null
|
|
27
|
+
*/
|
|
28
|
+
getHighestPriority(): Promise<AdDeliveryTier | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Find fixed pricing tiers
|
|
31
|
+
*/
|
|
32
|
+
findFixedPricing(): Promise<AdDeliveryTier[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Find CPM-based tiers
|
|
35
|
+
*/
|
|
36
|
+
findCPM(): Promise<AdDeliveryTier[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Find performance-based tiers (CPC, CPA)
|
|
39
|
+
*/
|
|
40
|
+
findPerformanceBased(): Promise<AdDeliveryTier[]>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=AdDeliveryTierCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdDeliveryTierCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AdDeliveryTierCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,wBAAyB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,UAAU,wBAAkB;IAE5C;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAMjD;;;;;OAKG;IACG,kBAAkB,CACtB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC;IAO5B;;;;OAIG;IACG,kBAAkB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAQ1D;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAInD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAI1C;;OAEG;IACG,oBAAoB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;CAKxD"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdEventCollection - Collection manager for AdEvent objects
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
6
|
+
import { AdEvent } from '../models/AdEvent.js';
|
|
7
|
+
import { AdEventType } from '../types/index.js';
|
|
8
|
+
export declare class AdEventCollection extends SmrtCollection<AdEvent> {
|
|
9
|
+
static readonly _itemClass: typeof AdEvent;
|
|
10
|
+
/**
|
|
11
|
+
* Find events by variation
|
|
12
|
+
*
|
|
13
|
+
* @param variationId - Variation ID
|
|
14
|
+
* @returns Array of events
|
|
15
|
+
*/
|
|
16
|
+
findByVariation(variationId: string): Promise<AdEvent[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Find events by zone
|
|
19
|
+
*
|
|
20
|
+
* @param zoneId - Zone ID
|
|
21
|
+
* @returns Array of events
|
|
22
|
+
*/
|
|
23
|
+
findByZone(zoneId: string): Promise<AdEvent[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Find events by site
|
|
26
|
+
*
|
|
27
|
+
* @param siteId - Site ID
|
|
28
|
+
* @returns Array of events
|
|
29
|
+
*/
|
|
30
|
+
findBySite(siteId: string): Promise<AdEvent[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Find events in date range
|
|
33
|
+
*
|
|
34
|
+
* @param start - Start date
|
|
35
|
+
* @param end - End date
|
|
36
|
+
* @returns Array of events
|
|
37
|
+
*/
|
|
38
|
+
findByDateRange(start: Date, end: Date): Promise<AdEvent[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Find events by type
|
|
41
|
+
*
|
|
42
|
+
* @param eventType - Event type
|
|
43
|
+
* @returns Array of events
|
|
44
|
+
*/
|
|
45
|
+
findByType(eventType: AdEventType): Promise<AdEvent[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Count events by type for a variation
|
|
48
|
+
*
|
|
49
|
+
* @param variationId - Variation ID
|
|
50
|
+
* @param eventType - Event type
|
|
51
|
+
* @returns Count of events
|
|
52
|
+
*/
|
|
53
|
+
countByType(variationId: string, eventType: AdEventType): Promise<number>;
|
|
54
|
+
/**
|
|
55
|
+
* Count impressions for a variation
|
|
56
|
+
*/
|
|
57
|
+
countImpressions(variationId: string): Promise<number>;
|
|
58
|
+
/**
|
|
59
|
+
* Count clicks for a variation
|
|
60
|
+
*/
|
|
61
|
+
countClicks(variationId: string): Promise<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Count conversions for a variation
|
|
64
|
+
*/
|
|
65
|
+
countConversions(variationId: string): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* Find all impressions
|
|
68
|
+
*/
|
|
69
|
+
findImpressions(): Promise<AdEvent[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Find all clicks
|
|
72
|
+
*/
|
|
73
|
+
findClicks(): Promise<AdEvent[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Find all conversions
|
|
76
|
+
*/
|
|
77
|
+
findConversions(): Promise<AdEvent[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Get aggregate stats for a variation
|
|
80
|
+
*
|
|
81
|
+
* @param variationId - Variation ID
|
|
82
|
+
* @returns Stats object with impressions, clicks, conversions, CTR
|
|
83
|
+
*/
|
|
84
|
+
getVariationStats(variationId: string): Promise<{
|
|
85
|
+
impressions: number;
|
|
86
|
+
clicks: number;
|
|
87
|
+
conversions: number;
|
|
88
|
+
ctr: number;
|
|
89
|
+
conversionRate: number;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Find ad events belonging to a specific tenant
|
|
93
|
+
*
|
|
94
|
+
* @param tenantId - Tenant ID to filter by
|
|
95
|
+
* @returns Array of ad events for the tenant
|
|
96
|
+
*/
|
|
97
|
+
findByTenant(tenantId: string): Promise<AdEvent[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Find global ad events (no tenant association).
|
|
100
|
+
*
|
|
101
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
102
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
103
|
+
* flagged as an isolation violation). (#1600)
|
|
104
|
+
*
|
|
105
|
+
* @returns Array of global ad events
|
|
106
|
+
*/
|
|
107
|
+
findGlobal(): Promise<AdEvent[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Find ad events for a tenant including global (shared) events.
|
|
110
|
+
*
|
|
111
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
112
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
113
|
+
*
|
|
114
|
+
* @param tenantId - Tenant ID to include
|
|
115
|
+
* @returns Array of tenant-specific and global ad events
|
|
116
|
+
*/
|
|
117
|
+
findWithGlobals(tenantId: string): Promise<AdEvent[]>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=AdEventCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdEventCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AdEventCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,UAAU,iBAAW;IAErC;;;;;OAKG;IACG,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO9D;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAOpD;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAOpD;;;;;;OAMG;IACG,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAUjE;;;;;OAKG;IACG,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO5D;;;;;;OAMG;IACG,WAAW,CACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,MAAM,CAAC;IAOlB;;OAEG;IACG,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5D;;OAEG;IACG,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD;;OAEG;IACG,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5D;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAI3C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAItC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAI3C;;;;;OAKG;IACG,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;QACpD,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,GAAG,EAAE,MAAM,CAAC;QACZ,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IAkBF;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIxD;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAItC;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAG5D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdFormatCollection - Collection manager for AdFormat objects
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
6
|
+
import { AdFormat } from '../models/AdFormat.js';
|
|
7
|
+
import { AdFormatType } from '../types/index.js';
|
|
8
|
+
export declare class AdFormatCollection extends SmrtCollection<AdFormat> {
|
|
9
|
+
static readonly _itemClass: typeof AdFormat;
|
|
10
|
+
/**
|
|
11
|
+
* Find format by dimensions
|
|
12
|
+
*
|
|
13
|
+
* @param width - Width in pixels
|
|
14
|
+
* @param height - Height in pixels
|
|
15
|
+
* @returns Matching format or null
|
|
16
|
+
*/
|
|
17
|
+
findByDimensions(width: number, height: number): Promise<AdFormat | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Find formats by type
|
|
20
|
+
*
|
|
21
|
+
* @param formatType - Format type (banner, native, video)
|
|
22
|
+
* @returns Array of matching formats
|
|
23
|
+
*/
|
|
24
|
+
findByType(formatType: AdFormatType): Promise<AdFormat[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Find all banner formats
|
|
27
|
+
*/
|
|
28
|
+
findBanners(): Promise<AdFormat[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Find all native formats
|
|
31
|
+
*/
|
|
32
|
+
findNative(): Promise<AdFormat[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Find all video formats
|
|
35
|
+
*/
|
|
36
|
+
findVideo(): Promise<AdFormat[]>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=AdFormatCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdFormatCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AdFormatCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;IAEtC;;;;;;OAMG;IACG,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAQ3B;;;;;OAKG;IACG,UAAU,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAO/D;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIxC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIvC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAGvC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdGroupCollection - Collection manager for AdGroup objects
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
6
|
+
import { AdGroup } from '../models/AdGroup.js';
|
|
7
|
+
import { AdGroupStatus } from '../types/index.js';
|
|
8
|
+
export declare class AdGroupCollection extends SmrtCollection<AdGroup> {
|
|
9
|
+
static readonly _itemClass: typeof AdGroup;
|
|
10
|
+
/**
|
|
11
|
+
* Find ad groups by contract
|
|
12
|
+
*
|
|
13
|
+
* @param contractId - Contract ID
|
|
14
|
+
* @returns Array of ad groups
|
|
15
|
+
*/
|
|
16
|
+
findByContract(contractId: string): Promise<AdGroup[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Find ad groups by tier
|
|
19
|
+
*
|
|
20
|
+
* @param tierId - Delivery tier ID
|
|
21
|
+
* @returns Array of ad groups
|
|
22
|
+
*/
|
|
23
|
+
findByTier(tierId: string): Promise<AdGroup[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Find ad groups by status
|
|
26
|
+
*
|
|
27
|
+
* @param status - Ad group status
|
|
28
|
+
* @returns Array of ad groups
|
|
29
|
+
*/
|
|
30
|
+
findByStatus(status: AdGroupStatus): Promise<AdGroup[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Find currently active ad groups
|
|
33
|
+
* (status=active, started, not ended)
|
|
34
|
+
*
|
|
35
|
+
* @returns Array of active ad groups
|
|
36
|
+
*/
|
|
37
|
+
findActive(): Promise<AdGroup[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Find ad groups by vertical slug
|
|
40
|
+
*
|
|
41
|
+
* @param verticalSlug - Tag slug from smrt-tags
|
|
42
|
+
* @returns Array of ad groups
|
|
43
|
+
*/
|
|
44
|
+
findByVertical(verticalSlug: string): Promise<AdGroup[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Find ad groups that can serve to a specific zone
|
|
47
|
+
*
|
|
48
|
+
* @param zoneId - Zone ID to check
|
|
49
|
+
* @returns Array of ad groups containing zone
|
|
50
|
+
*/
|
|
51
|
+
findByZone(zoneId: string): Promise<AdGroup[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Find ad groups eligible to serve for a zone
|
|
54
|
+
* (active, has zone, within date range)
|
|
55
|
+
*
|
|
56
|
+
* @param zoneId - Zone ID to check
|
|
57
|
+
* @returns Array of eligible ad groups
|
|
58
|
+
*/
|
|
59
|
+
findEligibleForZone(zoneId: string): Promise<AdGroup[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Find all draft ad groups
|
|
62
|
+
*/
|
|
63
|
+
findDrafts(): Promise<AdGroup[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Find all paused ad groups
|
|
66
|
+
*/
|
|
67
|
+
findPaused(): Promise<AdGroup[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Find all completed ad groups
|
|
70
|
+
*/
|
|
71
|
+
findCompleted(): Promise<AdGroup[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Find ad groups belonging to a specific tenant
|
|
74
|
+
*
|
|
75
|
+
* @param tenantId - Tenant ID to filter by
|
|
76
|
+
* @returns Array of ad groups for the tenant
|
|
77
|
+
*/
|
|
78
|
+
findByTenant(tenantId: string): Promise<AdGroup[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Find global ad groups (no tenant association).
|
|
81
|
+
*
|
|
82
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
83
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
84
|
+
* flagged as an isolation violation). (#1600)
|
|
85
|
+
*
|
|
86
|
+
* @returns Array of global ad groups
|
|
87
|
+
*/
|
|
88
|
+
findGlobal(): Promise<AdGroup[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Find ad groups for a tenant including global (shared) ad groups.
|
|
91
|
+
*
|
|
92
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
93
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
94
|
+
*
|
|
95
|
+
* @param tenantId - Tenant ID to include
|
|
96
|
+
* @returns Array of tenant-specific and global ad groups
|
|
97
|
+
*/
|
|
98
|
+
findWithGlobals(tenantId: string): Promise<AdGroup[]>;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=AdGroupCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdGroupCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AdGroupCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,UAAU,iBAAW;IAErC;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO5D;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAOpD;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO7D;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAWtC;;;;;OAKG;IACG,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO9D;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAQpD;;;;;;OAMG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAK7D;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAItC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAItC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAQzC;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIxD;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAItC;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAG5D"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdVariationCollection - Collection manager for AdVariation objects
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
6
|
+
import { AdVariation } from '../models/AdVariation.js';
|
|
7
|
+
import { AdVariationStatus } from '../types/index.js';
|
|
8
|
+
export declare class AdVariationCollection extends SmrtCollection<AdVariation> {
|
|
9
|
+
static readonly _itemClass: typeof AdVariation;
|
|
10
|
+
/**
|
|
11
|
+
* Find variations by ad group
|
|
12
|
+
*
|
|
13
|
+
* @param groupId - Ad group ID
|
|
14
|
+
* @returns Array of variations
|
|
15
|
+
*/
|
|
16
|
+
findByGroup(groupId: string): Promise<AdVariation[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Find variations by format
|
|
19
|
+
*
|
|
20
|
+
* @param formatId - Ad format ID
|
|
21
|
+
* @returns Array of variations
|
|
22
|
+
*/
|
|
23
|
+
findByFormat(formatId: string): Promise<AdVariation[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Find active variations for a group
|
|
26
|
+
*
|
|
27
|
+
* @param groupId - Ad group ID
|
|
28
|
+
* @returns Array of active variations
|
|
29
|
+
*/
|
|
30
|
+
findActiveByGroup(groupId: string): Promise<AdVariation[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Select a variation using weighted random selection
|
|
33
|
+
* Higher weight = more likely to be selected
|
|
34
|
+
*
|
|
35
|
+
* @param groupId - Ad group ID
|
|
36
|
+
* @returns Selected variation or null if none available
|
|
37
|
+
*/
|
|
38
|
+
selectByWeight(groupId: string): Promise<AdVariation | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Find variations by status
|
|
41
|
+
*
|
|
42
|
+
* @param status - Variation status
|
|
43
|
+
* @returns Array of variations
|
|
44
|
+
*/
|
|
45
|
+
findByStatus(status: AdVariationStatus): Promise<AdVariation[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Find all active variations
|
|
48
|
+
*/
|
|
49
|
+
findActive(): Promise<AdVariation[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Find all draft variations
|
|
52
|
+
*/
|
|
53
|
+
findDrafts(): Promise<AdVariation[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Find all paused variations
|
|
56
|
+
*/
|
|
57
|
+
findPaused(): Promise<AdVariation[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Find top performing variations by CTR
|
|
60
|
+
*
|
|
61
|
+
* @param limit - Maximum number to return
|
|
62
|
+
* @returns Array of variations sorted by CTR descending
|
|
63
|
+
*/
|
|
64
|
+
findTopPerformers(limit?: number): Promise<AdVariation[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Find ad variations belonging to a specific tenant
|
|
67
|
+
*
|
|
68
|
+
* @param tenantId - Tenant ID to filter by
|
|
69
|
+
* @returns Array of ad variations for the tenant
|
|
70
|
+
*/
|
|
71
|
+
findByTenant(tenantId: string): Promise<AdVariation[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Find global ad variations (no tenant association).
|
|
74
|
+
*
|
|
75
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
76
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
77
|
+
* flagged as an isolation violation). (#1600)
|
|
78
|
+
*
|
|
79
|
+
* @returns Array of global ad variations
|
|
80
|
+
*/
|
|
81
|
+
findGlobal(): Promise<AdVariation[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Find ad variations for a tenant including global (shared) variations.
|
|
84
|
+
*
|
|
85
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
86
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
87
|
+
*
|
|
88
|
+
* @param tenantId - Tenant ID to include
|
|
89
|
+
* @returns Array of tenant-specific and global ad variations
|
|
90
|
+
*/
|
|
91
|
+
findWithGlobals(tenantId: string): Promise<AdVariation[]>;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=AdVariationCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdVariationCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AdVariationCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACpE,MAAM,CAAC,QAAQ,CAAC,UAAU,qBAAe;IAEzC;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAO1D;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAO5D;;;;;OAKG;IACG,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAUhE;;;;;;OAMG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAsBlE;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAOrE;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI1C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI1C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI1C;;;;;OAKG;IACG,iBAAiB,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAenE;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAI5D;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI1C;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAOhE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection exports for smrt-ads
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export { AdDeliveryTierCollection } from './AdDeliveryTierCollection.js';
|
|
6
|
+
export { AdEventCollection } from './AdEventCollection.js';
|
|
7
|
+
export { AdFormatCollection } from './AdFormatCollection.js';
|
|
8
|
+
export { AdGroupCollection } from './AdGroupCollection.js';
|
|
9
|
+
export { AdVariationCollection } from './AdVariationCollection.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|