ad2app-lib 1.47.0 → 1.50.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/analytics/index.d.ts +76 -0
- package/dist/analytics/index.js +29 -0
- package/dist/types/I_Offer.d.ts +3 -1
- package/dist/types/I_Offer.js +2 -0
- package/dist/types/agency-campaigns.d.ts +427 -0
- package/dist/types/agency-campaigns.js +479 -0
- package/dist/types/agency-pots.d.ts +518 -0
- package/dist/types/agency-pots.js +393 -0
- package/dist/types/agency-threads.d.ts +87 -0
- package/dist/types/agency-threads.js +60 -0
- package/dist/types/agency.d.ts +2 -0
- package/dist/types/agency.js +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/package.json +1 -1
- package/src/analytics/index.test.ts +52 -1
- package/src/analytics/index.ts +62 -0
- package/src/types/I_Offer.ts +2 -0
- package/src/types/agency-campaigns.test.ts +85 -0
- package/src/types/agency-campaigns.ts +739 -0
- package/src/types/agency-pots.test.ts +255 -0
- package/src/types/agency-pots.ts +751 -0
- package/src/types/agency-threads.ts +103 -0
- package/src/types/agency.ts +2 -0
- package/src/types/index.ts +3 -0
|
@@ -106,6 +106,31 @@ export declare const EVENTS: {
|
|
|
106
106
|
readonly AGENCY_SPONSORSHIP_ENDED: "agency_sponsorship_ended";
|
|
107
107
|
readonly AGENCY_DISCOVER_SEARCHED: "agency_discover_searched";
|
|
108
108
|
readonly AGENCY_ACCESS_REQUESTED: "agency_access_requested";
|
|
109
|
+
readonly AGENCY_CAMPAIGN_CREATED: "agency_campaign_created";
|
|
110
|
+
readonly AGENCY_CAMPAIGN_CREATOR_INVITED: "agency_campaign_creator_invited";
|
|
111
|
+
readonly AGENCY_CAMPAIGN_JOINED: "agency_campaign_joined";
|
|
112
|
+
readonly AGENCY_CAMPAIGN_DECLINED: "agency_campaign_declined";
|
|
113
|
+
readonly AGENCY_CAMPAIGN_LEFT: "agency_campaign_left";
|
|
114
|
+
readonly AGENCY_CAMPAIGN_CREATOR_REMOVED: "agency_campaign_creator_removed";
|
|
115
|
+
readonly AGENCY_CAMPAIGN_OFFER_SENT: "agency_campaign_offer_sent";
|
|
116
|
+
readonly AGENCY_CAMPAIGN_OFFER_ACTED: "agency_campaign_offer_acted";
|
|
117
|
+
readonly AGENCY_CAMPAIGN_MATERIAL_UPLOADED: "agency_campaign_material_uploaded";
|
|
118
|
+
readonly AGENCY_CAMPAIGN_MATERIAL_REVIEWED: "agency_campaign_material_reviewed";
|
|
119
|
+
readonly AGENCY_CAMPAIGN_PUBLISHED: "agency_campaign_published";
|
|
120
|
+
readonly AGENCY_CAMPAIGN_MILESTONE_CONFIRMED: "agency_campaign_milestone_confirmed";
|
|
121
|
+
readonly AGENCY_THREAD_STARTED: "agency_thread_started";
|
|
122
|
+
readonly AGENCY_THREAD_MESSAGE_SENT: "agency_thread_message_sent";
|
|
123
|
+
readonly AGENCY_POT_APPLIED: "agency_pot_applied";
|
|
124
|
+
readonly AGENCY_POT_APPLICATION_DECIDED: "agency_pot_application_decided";
|
|
125
|
+
readonly AGENCY_POT_REFILLED: "agency_pot_refilled";
|
|
126
|
+
readonly AGENCY_POT_MOVED: "agency_pot_moved";
|
|
127
|
+
readonly AGENCY_POT_PUBLISH_TIME_CONFIRMED: "agency_pot_publish_time_confirmed";
|
|
128
|
+
readonly AGENCY_POT_PUBLISHED: "agency_pot_published";
|
|
129
|
+
readonly AGENCY_POT_BONUS_HELD: "agency_pot_bonus_held";
|
|
130
|
+
readonly AGENCY_POT_BONUS_DECIDED: "agency_pot_bonus_decided";
|
|
131
|
+
readonly AGENCY_POT_REMOVAL_DECIDED: "agency_pot_removal_decided";
|
|
132
|
+
readonly AGENCY_POT_EXPORTED: "agency_pot_exported";
|
|
133
|
+
readonly AGENCY_POT_FILE_UPLOADED: "agency_pot_file_uploaded";
|
|
109
134
|
};
|
|
110
135
|
export type EventName = (typeof EVENTS)[keyof typeof EVENTS];
|
|
111
136
|
/** Which email program a send belongs to (spec 120). Wire values — do not rename. */
|
|
@@ -253,6 +278,10 @@ export interface AgencyEventProperties {
|
|
|
253
278
|
*/
|
|
254
279
|
creator_user_id?: string;
|
|
255
280
|
}
|
|
281
|
+
/** A campaign-loop event: the agency event plus the campaign it concerns. */
|
|
282
|
+
export interface AgencyCampaignEventProperties extends AgencyEventProperties {
|
|
283
|
+
campaign_id: string;
|
|
284
|
+
}
|
|
256
285
|
export interface EventProperties {
|
|
257
286
|
[EVENTS.LANDING_CTA_CLICKED]: {
|
|
258
287
|
location: 'hero' | 'pricing' | 'final_cta' | 'nav' | 'ai_connector' | 'free_skills';
|
|
@@ -584,6 +613,53 @@ export interface EventProperties {
|
|
|
584
613
|
matched: boolean;
|
|
585
614
|
};
|
|
586
615
|
[EVENTS.AGENCY_ACCESS_REQUESTED]: AgencyEventProperties;
|
|
616
|
+
[EVENTS.AGENCY_CAMPAIGN_CREATED]: AgencyCampaignEventProperties;
|
|
617
|
+
[EVENTS.AGENCY_CAMPAIGN_CREATOR_INVITED]: AgencyCampaignEventProperties & {
|
|
618
|
+
with_access_request: boolean;
|
|
619
|
+
};
|
|
620
|
+
[EVENTS.AGENCY_CAMPAIGN_JOINED]: AgencyCampaignEventProperties;
|
|
621
|
+
[EVENTS.AGENCY_CAMPAIGN_DECLINED]: AgencyCampaignEventProperties;
|
|
622
|
+
[EVENTS.AGENCY_CAMPAIGN_LEFT]: AgencyCampaignEventProperties;
|
|
623
|
+
[EVENTS.AGENCY_CAMPAIGN_CREATOR_REMOVED]: AgencyCampaignEventProperties;
|
|
624
|
+
[EVENTS.AGENCY_CAMPAIGN_OFFER_SENT]: AgencyCampaignEventProperties;
|
|
625
|
+
[EVENTS.AGENCY_CAMPAIGN_OFFER_ACTED]: AgencyCampaignEventProperties & {
|
|
626
|
+
action: 'accept' | 'counter' | 'confirm' | 'reject';
|
|
627
|
+
};
|
|
628
|
+
[EVENTS.AGENCY_CAMPAIGN_MATERIAL_UPLOADED]: AgencyCampaignEventProperties & {
|
|
629
|
+
version: number;
|
|
630
|
+
};
|
|
631
|
+
[EVENTS.AGENCY_CAMPAIGN_MATERIAL_REVIEWED]: AgencyCampaignEventProperties & {
|
|
632
|
+
action: 'approve' | 'request_changes' | 'reject';
|
|
633
|
+
};
|
|
634
|
+
[EVENTS.AGENCY_CAMPAIGN_PUBLISHED]: AgencyCampaignEventProperties;
|
|
635
|
+
[EVENTS.AGENCY_CAMPAIGN_MILESTONE_CONFIRMED]: AgencyCampaignEventProperties;
|
|
636
|
+
[EVENTS.AGENCY_THREAD_STARTED]: AgencyEventProperties & {
|
|
637
|
+
thread_id: string;
|
|
638
|
+
};
|
|
639
|
+
[EVENTS.AGENCY_THREAD_MESSAGE_SENT]: AgencyEventProperties & {
|
|
640
|
+
thread_id: string;
|
|
641
|
+
};
|
|
642
|
+
[EVENTS.AGENCY_POT_APPLIED]: AgencyCampaignEventProperties;
|
|
643
|
+
[EVENTS.AGENCY_POT_APPLICATION_DECIDED]: AgencyCampaignEventProperties & {
|
|
644
|
+
action: 'accept' | 'decline';
|
|
645
|
+
};
|
|
646
|
+
[EVENTS.AGENCY_POT_REFILLED]: AgencyCampaignEventProperties;
|
|
647
|
+
[EVENTS.AGENCY_POT_MOVED]: AgencyCampaignEventProperties;
|
|
648
|
+
[EVENTS.AGENCY_POT_PUBLISH_TIME_CONFIRMED]: AgencyCampaignEventProperties;
|
|
649
|
+
[EVENTS.AGENCY_POT_PUBLISHED]: AgencyCampaignEventProperties;
|
|
650
|
+
[EVENTS.AGENCY_POT_BONUS_HELD]: AgencyCampaignEventProperties & {
|
|
651
|
+
reason: 'jump' | 'paid_delivery';
|
|
652
|
+
};
|
|
653
|
+
[EVENTS.AGENCY_POT_BONUS_DECIDED]: AgencyCampaignEventProperties & {
|
|
654
|
+
action: 'approve' | 'cap' | 'message';
|
|
655
|
+
};
|
|
656
|
+
[EVENTS.AGENCY_POT_REMOVAL_DECIDED]: AgencyCampaignEventProperties & {
|
|
657
|
+
decision: 'keep_base' | 'withhold_base';
|
|
658
|
+
};
|
|
659
|
+
[EVENTS.AGENCY_POT_EXPORTED]: AgencyCampaignEventProperties & {
|
|
660
|
+
format: 'csv' | 'xlsx' | 'report';
|
|
661
|
+
};
|
|
662
|
+
[EVENTS.AGENCY_POT_FILE_UPLOADED]: AgencyCampaignEventProperties;
|
|
587
663
|
}
|
|
588
664
|
/** Canonical person property keys (set via identify / $set). */
|
|
589
665
|
export declare const PERSON_PROPS: {
|
package/dist/analytics/index.js
CHANGED
|
@@ -177,6 +177,35 @@ exports.EVENTS = {
|
|
|
177
177
|
// creators an agency went looking for.
|
|
178
178
|
AGENCY_DISCOVER_SEARCHED: 'agency_discover_searched',
|
|
179
179
|
AGENCY_ACCESS_REQUESTED: 'agency_access_requested',
|
|
180
|
+
// The campaign loop (175 US7). Server-owned: each is captured in the act's
|
|
181
|
+
// own transaction path, under the ACTOR's distinct id.
|
|
182
|
+
AGENCY_CAMPAIGN_CREATED: 'agency_campaign_created',
|
|
183
|
+
AGENCY_CAMPAIGN_CREATOR_INVITED: 'agency_campaign_creator_invited',
|
|
184
|
+
AGENCY_CAMPAIGN_JOINED: 'agency_campaign_joined',
|
|
185
|
+
AGENCY_CAMPAIGN_DECLINED: 'agency_campaign_declined',
|
|
186
|
+
AGENCY_CAMPAIGN_LEFT: 'agency_campaign_left',
|
|
187
|
+
AGENCY_CAMPAIGN_CREATOR_REMOVED: 'agency_campaign_creator_removed',
|
|
188
|
+
AGENCY_CAMPAIGN_OFFER_SENT: 'agency_campaign_offer_sent',
|
|
189
|
+
AGENCY_CAMPAIGN_OFFER_ACTED: 'agency_campaign_offer_acted',
|
|
190
|
+
AGENCY_CAMPAIGN_MATERIAL_UPLOADED: 'agency_campaign_material_uploaded',
|
|
191
|
+
AGENCY_CAMPAIGN_MATERIAL_REVIEWED: 'agency_campaign_material_reviewed',
|
|
192
|
+
AGENCY_CAMPAIGN_PUBLISHED: 'agency_campaign_published',
|
|
193
|
+
AGENCY_CAMPAIGN_MILESTONE_CONFIRMED: 'agency_campaign_milestone_confirmed',
|
|
194
|
+
// Threads (175 US8). Never the message body: a conversation is not analytics.
|
|
195
|
+
AGENCY_THREAD_STARTED: 'agency_thread_started',
|
|
196
|
+
AGENCY_THREAD_MESSAGE_SENT: 'agency_thread_message_sent',
|
|
197
|
+
// Pot campaigns (175 US9). Never an amount: the pot's economics are the agency's.
|
|
198
|
+
AGENCY_POT_APPLIED: 'agency_pot_applied',
|
|
199
|
+
AGENCY_POT_APPLICATION_DECIDED: 'agency_pot_application_decided',
|
|
200
|
+
AGENCY_POT_REFILLED: 'agency_pot_refilled',
|
|
201
|
+
AGENCY_POT_MOVED: 'agency_pot_moved',
|
|
202
|
+
AGENCY_POT_PUBLISH_TIME_CONFIRMED: 'agency_pot_publish_time_confirmed',
|
|
203
|
+
AGENCY_POT_PUBLISHED: 'agency_pot_published',
|
|
204
|
+
AGENCY_POT_BONUS_HELD: 'agency_pot_bonus_held',
|
|
205
|
+
AGENCY_POT_BONUS_DECIDED: 'agency_pot_bonus_decided',
|
|
206
|
+
AGENCY_POT_REMOVAL_DECIDED: 'agency_pot_removal_decided',
|
|
207
|
+
AGENCY_POT_EXPORTED: 'agency_pot_exported',
|
|
208
|
+
AGENCY_POT_FILE_UPLOADED: 'agency_pot_file_uploaded',
|
|
180
209
|
};
|
|
181
210
|
/**
|
|
182
211
|
* Canonical email event property KEYS (spec 120 T001). Emitters and tests
|
package/dist/types/I_Offer.d.ts
CHANGED
|
@@ -21,7 +21,9 @@ export declare enum I_OfferStatus {
|
|
|
21
21
|
INFLUENCER_NEGOTIATED = "influencerNegotiated",
|
|
22
22
|
AGENCY_NEGOTIATED = "agencyNegotiated",
|
|
23
23
|
CONFIRMED = "confirmed",
|
|
24
|
-
ALTERNATIVE_SUGGESTED = "alternativeSuggested"
|
|
24
|
+
ALTERNATIVE_SUGGESTED = "alternativeSuggested",
|
|
25
|
+
/** The creator left the campaign before the offer was confirmed (spec 175 US7). Added, never renamed: Postgres enums only grow. */
|
|
26
|
+
WITHDRAWN = "withdrawn"
|
|
25
27
|
}
|
|
26
28
|
export declare class I_OfferGetDTO {
|
|
27
29
|
campaignId: string;
|
package/dist/types/I_Offer.js
CHANGED
|
@@ -34,6 +34,8 @@ var I_OfferStatus;
|
|
|
34
34
|
I_OfferStatus["AGENCY_NEGOTIATED"] = "agencyNegotiated";
|
|
35
35
|
I_OfferStatus["CONFIRMED"] = "confirmed";
|
|
36
36
|
I_OfferStatus["ALTERNATIVE_SUGGESTED"] = "alternativeSuggested";
|
|
37
|
+
/** The creator left the campaign before the offer was confirmed (spec 175 US7). Added, never renamed: Postgres enums only grow. */
|
|
38
|
+
I_OfferStatus["WITHDRAWN"] = "withdrawn";
|
|
37
39
|
})(I_OfferStatus || (exports.I_OfferStatus = I_OfferStatus = {}));
|
|
38
40
|
class I_GetOffersDTO {
|
|
39
41
|
}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { I_MediaStage } from './I_Media';
|
|
2
|
+
import { I_OfferStatus } from './I_Offer';
|
|
3
|
+
import { type I_AgencyGrantScope } from './agency';
|
|
4
|
+
import { PotFields, type I_AgencyPotView, type I_CampaignFile, type I_CreatorPotView, type I_DisclosureCheck } from './agency-pots';
|
|
5
|
+
/**
|
|
6
|
+
* The campaign loop (spec 175 US7) — an organization runs a campaign with the
|
|
7
|
+
* creators on its roster or in the directory.
|
|
8
|
+
*
|
|
9
|
+
* Two steps, never one (Jan, 2026-09-28):
|
|
10
|
+
*
|
|
11
|
+
* 1. MEMBERSHIP — the agency invites a creator; the creator joins or
|
|
12
|
+
* declines. Joining answers any access request folded into the
|
|
13
|
+
* invitation. No money is named here.
|
|
14
|
+
* 2. OFFER — once joined, the agency sends a rate. It is countered, accepted,
|
|
15
|
+
* confirmed or rejected; a creator who leaves withdraws it.
|
|
16
|
+
*
|
|
17
|
+
* The server owns every transition. Each view carries `availableActions`, and
|
|
18
|
+
* a screen renders exactly those acts — it never derives them from a status,
|
|
19
|
+
* so the two can never disagree.
|
|
20
|
+
*
|
|
21
|
+
* See specs/speckit/175-agency-roster/contracts/agency-api.md → US7.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* What a deliverable may be, per platform. A named list in one place, so a
|
|
25
|
+
* "placement" can never be free text that drifts per campaign.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CAMPAIGN_PLACEMENTS: {
|
|
28
|
+
readonly instagram: readonly ["reel", "post", "carousel", "stories", "collab_post"];
|
|
29
|
+
readonly tiktok: readonly ["video", "repost", "duet", "stories"];
|
|
30
|
+
readonly youtube: readonly ["video", "short", "integration", "community_post"];
|
|
31
|
+
readonly facebook: readonly ["post", "reel", "stories"];
|
|
32
|
+
readonly linkedin: readonly ["post", "article"];
|
|
33
|
+
};
|
|
34
|
+
export type CampaignPlatform = keyof typeof CAMPAIGN_PLACEMENTS;
|
|
35
|
+
export type CampaignPlacement = (typeof CAMPAIGN_PLACEMENTS)[CampaignPlatform][number];
|
|
36
|
+
export declare const CAMPAIGN_PLATFORMS: CampaignPlatform[];
|
|
37
|
+
export declare const isCampaignPlacement: (platform: string, placement: string) => boolean;
|
|
38
|
+
/** The creator's own setting. The agency reads it and can never set it. */
|
|
39
|
+
export declare const SETTLEMENT_FORMS: readonly ["invoice", "contract", "barter"];
|
|
40
|
+
export type SettlementForm = (typeof SETTLEMENT_FORMS)[number];
|
|
41
|
+
/**
|
|
42
|
+
* An offer campaign negotiates one price per creator (US7); a pot campaign pays
|
|
43
|
+
* from one pot on each creator's own terms (US9). Chosen at creation, fixed once
|
|
44
|
+
* the first creator is invited (FR-030).
|
|
45
|
+
*/
|
|
46
|
+
export declare const AGENCY_CAMPAIGN_KINDS: readonly ["offer", "pot"];
|
|
47
|
+
export type AgencyCampaignKind = (typeof AGENCY_CAMPAIGN_KINDS)[number];
|
|
48
|
+
export declare const AGENCY_CAMPAIGN_MEMBER_STATES: readonly ["invited", "joined", "declined", "left", "removed"];
|
|
49
|
+
export type AgencyCampaignMemberState = (typeof AGENCY_CAMPAIGN_MEMBER_STATES)[number];
|
|
50
|
+
/** The offer statuses the agency loop writes. `draft`, `deleted` and `alternativeSuggested` are legacy-only. */
|
|
51
|
+
export declare const AGENCY_OFFER_STATUSES: readonly [I_OfferStatus.SENT, I_OfferStatus.INFLUENCER_NEGOTIATED, I_OfferStatus.AGENCY_NEGOTIATED, I_OfferStatus.ACCEPTED, I_OfferStatus.CONFIRMED, I_OfferStatus.REJECTED, I_OfferStatus.WITHDRAWN];
|
|
52
|
+
export type AgencyOfferStatus = (typeof AGENCY_OFFER_STATUSES)[number];
|
|
53
|
+
export type CampaignSide = 'agency' | 'creator';
|
|
54
|
+
/**
|
|
55
|
+
* Every act on an offer, by either side. Which of them a given caller may take
|
|
56
|
+
* right now is the server's `availableActions`, never a client guess.
|
|
57
|
+
*
|
|
58
|
+
* agency: counter · confirm · reject
|
|
59
|
+
* creator: accept · counter · reject
|
|
60
|
+
*/
|
|
61
|
+
export declare const AGENCY_OFFER_ACTIONS: readonly ["accept", "counter", "confirm", "reject"];
|
|
62
|
+
export type AgencyOfferAction = (typeof AGENCY_OFFER_ACTIONS)[number];
|
|
63
|
+
/** The agency's acts on the latest material; the creator's only act is to upload. */
|
|
64
|
+
export declare const AGENCY_MATERIAL_ACTIONS: readonly ["approve", "request_changes", "reject"];
|
|
65
|
+
export type AgencyMaterialAction = (typeof AGENCY_MATERIAL_ACTIONS)[number];
|
|
66
|
+
/**
|
|
67
|
+
* The board's columns, in order (FR-024). A creator stands in exactly one.
|
|
68
|
+
* `declined`, `left`, `removed` and `rejected` are OFF the board: those rows
|
|
69
|
+
* stay in the list with their date (US7 scenario 9), never in a column.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AGENCY_CAMPAIGN_STEPS: readonly ["invited", "joined", "offer_sent", "negotiating", "confirmed", "material_in", "approved", "published"];
|
|
72
|
+
export type AgencyCampaignStep = (typeof AGENCY_CAMPAIGN_STEPS)[number];
|
|
73
|
+
export type AgencyCampaignOffBoard = 'declined' | 'left' | 'removed' | 'rejected';
|
|
74
|
+
export declare const AGENCY_MILESTONE_KINDS: readonly ["draft_due", "live_by", "custom"];
|
|
75
|
+
export type AgencyMilestoneKind = (typeof AGENCY_MILESTONE_KINDS)[number];
|
|
76
|
+
/** A milestone may wait on one rule: every ACTIVE offer at a status, or every active creator's latest material at a stage. */
|
|
77
|
+
export declare const AGENCY_MILESTONE_OFFER_RULES: readonly [I_OfferStatus.CONFIRMED];
|
|
78
|
+
export declare const AGENCY_MILESTONE_MEDIA_RULES: readonly [I_MediaStage.UPLOADED, I_MediaStage.ACCEPTED];
|
|
79
|
+
export declare const AGENCY_CAMPAIGN_EVENT_KINDS: readonly ["invited", "joined", "declined", "left", "removed", "offer_sent", "offer_countered", "offer_accepted", "offer_confirmed", "offer_rejected", "offer_withdrawn", "material_uploaded", "material_approved", "material_changes_asked", "material_rejected", "published", "milestone_confirmed", "pot_applied", "pot_application_withdrawn", "pot_accepted", "pot_declined", "pot_released", "pot_refilled", "pot_moved", "pot_deadline_moved", "pot_publish_time_set", "pot_publish_time_confirmed", "pot_publish_refused", "pot_published", "pot_counted", "pot_frozen", "pot_bonus_held", "pot_bonus_approved", "pot_bonus_capped", "pot_bonus_message", "pot_kept", "pot_broken", "pot_removal_decided", "caption_edited", "file_uploaded", "file_removed"];
|
|
80
|
+
export type AgencyCampaignEventKind = (typeof AGENCY_CAMPAIGN_EVENT_KINDS)[number];
|
|
81
|
+
/** Refusal codes the frontend owes its own copy for. */
|
|
82
|
+
export declare const AGENCY_CAMPAIGN_CODES: {
|
|
83
|
+
/** The transition is not open at this state, or not for this side. */
|
|
84
|
+
readonly TRANSITION_REFUSED: "agency-campaign-transition-refused";
|
|
85
|
+
/** A campaign sent to a creator must carry its brief text (FR-025). */
|
|
86
|
+
readonly BRIEF_REQUIRED: "agency-campaign-brief-required";
|
|
87
|
+
/** A deliverable on a platform the creator has not connected (FR-025). */
|
|
88
|
+
readonly PLATFORM_NOT_CONNECTED: "agency-campaign-platform-not-connected";
|
|
89
|
+
/** The creator is already on this campaign. */
|
|
90
|
+
readonly ALREADY_MEMBER: "agency-campaign-already-member";
|
|
91
|
+
/** The upload was confirmed but no stored file exists at its path (FR-029). */
|
|
92
|
+
readonly MATERIAL_NOT_STORED: "agency-campaign-material-not-stored";
|
|
93
|
+
/** A demo creator cannot be invited or mailed (spec 179). */
|
|
94
|
+
readonly DEMO_CREATOR: "agency-campaign-demo-creator";
|
|
95
|
+
};
|
|
96
|
+
export type AgencyCampaignCode = (typeof AGENCY_CAMPAIGN_CODES)[keyof typeof AGENCY_CAMPAIGN_CODES];
|
|
97
|
+
export interface I_CampaignDeliverable {
|
|
98
|
+
platform: CampaignPlatform;
|
|
99
|
+
placement: CampaignPlacement;
|
|
100
|
+
qty: number;
|
|
101
|
+
note?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface I_AgencyCampaignBrief {
|
|
104
|
+
/** The concept, in prose. May be empty only while the campaign is a draft. */
|
|
105
|
+
text: string;
|
|
106
|
+
deliverables: I_CampaignDeliverable[];
|
|
107
|
+
/** ISO dates, or null when not set. */
|
|
108
|
+
draftDueAt: string | null;
|
|
109
|
+
liveByAt: string | null;
|
|
110
|
+
/** Usage rights on the brand's profiles, in months. */
|
|
111
|
+
licenceMonths: number | null;
|
|
112
|
+
/** Paid promotion (whitelisting), in months. */
|
|
113
|
+
paidPromoMonths: number | null;
|
|
114
|
+
revisionRounds: number | null;
|
|
115
|
+
}
|
|
116
|
+
/** Money is integer minor units plus an ISO-4217 code; the legacy float `price` is never written. */
|
|
117
|
+
export interface I_Money {
|
|
118
|
+
minor: number;
|
|
119
|
+
currency: string;
|
|
120
|
+
}
|
|
121
|
+
export interface I_AgencyOfferView {
|
|
122
|
+
id: string;
|
|
123
|
+
status: AgencyOfferStatus;
|
|
124
|
+
/** The price on the table now: the latest one either side named. */
|
|
125
|
+
price: I_Money;
|
|
126
|
+
/** Whose move it is; null once the offer is settled. */
|
|
127
|
+
turn: CampaignSide | null;
|
|
128
|
+
/** The acts open to the CALLER'S side, right now. */
|
|
129
|
+
availableActions: AgencyOfferAction[];
|
|
130
|
+
sentAt: string;
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
}
|
|
133
|
+
export interface I_AgencyMaterial {
|
|
134
|
+
id: string;
|
|
135
|
+
fileName: string;
|
|
136
|
+
contentType: string;
|
|
137
|
+
sizeBytes: number | null;
|
|
138
|
+
stage: I_MediaStage;
|
|
139
|
+
uploadedAt: string;
|
|
140
|
+
/** The note sent with a change request or a rejection of THIS version. */
|
|
141
|
+
note: string | null;
|
|
142
|
+
/** The post's caption, uploaded with the material (US9, FR-032); the creator may edit it until publication. Optional: 1.49 backends omit it. */
|
|
143
|
+
caption?: string | null;
|
|
144
|
+
/** `checkDisclosure(caption)`, returned with every read (FR-040); null without a caption. Optional: 1.49 backends omit it. */
|
|
145
|
+
disclosure?: I_DisclosureCheck | null;
|
|
146
|
+
}
|
|
147
|
+
export interface I_AgencyMilestone {
|
|
148
|
+
id: string;
|
|
149
|
+
kind: AgencyMilestoneKind;
|
|
150
|
+
/** Only for `custom`; the others are named by i18n from `kind`. */
|
|
151
|
+
label: string | null;
|
|
152
|
+
dueAt: string | null;
|
|
153
|
+
/** Null = campaign-wide. */
|
|
154
|
+
creatorUserId: string | null;
|
|
155
|
+
offerRule: (typeof AGENCY_MILESTONE_OFFER_RULES)[number] | null;
|
|
156
|
+
mediaRule: (typeof AGENCY_MILESTONE_MEDIA_RULES)[number] | null;
|
|
157
|
+
readyToConfirm: boolean;
|
|
158
|
+
confirmedAt: string | null;
|
|
159
|
+
}
|
|
160
|
+
export interface I_AgencyCampaignEvent {
|
|
161
|
+
kind: AgencyCampaignEventKind;
|
|
162
|
+
side: CampaignSide;
|
|
163
|
+
/** Done by ad2app itself (the daily pot job), not by a person on that side. */
|
|
164
|
+
byAd2app?: true;
|
|
165
|
+
at: string;
|
|
166
|
+
price?: I_Money;
|
|
167
|
+
/** A pot act's amount: a refill, a move, a reserved guarantee, an accrued bonus. */
|
|
168
|
+
amount?: I_Money;
|
|
169
|
+
note?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface I_CampaignCreatorIdentity {
|
|
172
|
+
userId: string | null;
|
|
173
|
+
handle: string;
|
|
174
|
+
displayName?: string;
|
|
175
|
+
avatarUrl?: string;
|
|
176
|
+
}
|
|
177
|
+
/** One creator's row on the campaign screen (the list twin of the board). */
|
|
178
|
+
export interface I_AgencyCampaignMemberRow {
|
|
179
|
+
memberId: string;
|
|
180
|
+
creator: I_CampaignCreatorIdentity;
|
|
181
|
+
state: AgencyCampaignMemberState;
|
|
182
|
+
/** The board column, or the reason the row is off the board. */
|
|
183
|
+
step: AgencyCampaignStep | AgencyCampaignOffBoard;
|
|
184
|
+
/** When the row reached its current step. */
|
|
185
|
+
stepAt: string;
|
|
186
|
+
offer: I_AgencyOfferView | null;
|
|
187
|
+
latestMaterial: I_AgencyMaterial | null;
|
|
188
|
+
/** The agency's acts on `latestMaterial`. */
|
|
189
|
+
materialActions: AgencyMaterialAction[];
|
|
190
|
+
/** Read from the creator's own setting (FR-027); null when they have not set it. */
|
|
191
|
+
settlementForm: SettlementForm | null;
|
|
192
|
+
nextDeadline: {
|
|
193
|
+
at: string;
|
|
194
|
+
kind: AgencyMilestoneKind;
|
|
195
|
+
label: string | null;
|
|
196
|
+
} | null;
|
|
197
|
+
/** True when the agency may still remove them (no confirmed offer). */
|
|
198
|
+
removable: boolean;
|
|
199
|
+
/** True when the agency may send an offer now (joined, none sent yet). */
|
|
200
|
+
canSendOffer: boolean;
|
|
201
|
+
canMarkPublished: boolean;
|
|
202
|
+
/** Scopes a folded access request asked for, while the invitation is open. */
|
|
203
|
+
requestedScopes: I_AgencyGrantScope[];
|
|
204
|
+
}
|
|
205
|
+
export interface I_AgencyCampaignPipeline {
|
|
206
|
+
/** Creators per board column; off-board rows are not counted. */
|
|
207
|
+
steps: Record<AgencyCampaignStep, number>;
|
|
208
|
+
total: number;
|
|
209
|
+
}
|
|
210
|
+
export interface I_AgencyCampaignCard {
|
|
211
|
+
id: string;
|
|
212
|
+
name: string;
|
|
213
|
+
/** Absent from 1.49 backends: read as 'offer'. */
|
|
214
|
+
kind?: AgencyCampaignKind;
|
|
215
|
+
isDraft: boolean;
|
|
216
|
+
liveByAt: string | null;
|
|
217
|
+
draftDueAt: string | null;
|
|
218
|
+
pipeline: I_AgencyCampaignPipeline;
|
|
219
|
+
/** How many things on this campaign wait on the agency (the rail's definition). */
|
|
220
|
+
attention: number;
|
|
221
|
+
createdAt: string;
|
|
222
|
+
}
|
|
223
|
+
export interface I_AgencyCampaign {
|
|
224
|
+
id: string;
|
|
225
|
+
name: string;
|
|
226
|
+
/** Absent from 1.49 backends: read as 'offer'. */
|
|
227
|
+
kind?: AgencyCampaignKind;
|
|
228
|
+
/** Set on a pot campaign; the pot board itself is `GET /agency/campaigns/:id/pot/board`. */
|
|
229
|
+
pot?: I_AgencyPotView | null;
|
|
230
|
+
isDraft: boolean;
|
|
231
|
+
brief: I_AgencyCampaignBrief;
|
|
232
|
+
members: I_AgencyCampaignMemberRow[];
|
|
233
|
+
milestones: I_AgencyMilestone[];
|
|
234
|
+
pipeline: I_AgencyCampaignPipeline;
|
|
235
|
+
createdAt: string;
|
|
236
|
+
}
|
|
237
|
+
/** Opening one creator (FR-024): their course with dates, notes, files and milestones. */
|
|
238
|
+
export interface I_AgencyCampaignCreatorDetail {
|
|
239
|
+
row: I_AgencyCampaignMemberRow;
|
|
240
|
+
creatorBrief: string | null;
|
|
241
|
+
events: I_AgencyCampaignEvent[];
|
|
242
|
+
materials: I_AgencyMaterial[];
|
|
243
|
+
milestones: I_AgencyMilestone[];
|
|
244
|
+
}
|
|
245
|
+
/** `GET /agency/campaigns/attention` — what waits on the agency (FR-022, the rail). */
|
|
246
|
+
export interface I_AgencyCampaignAttention {
|
|
247
|
+
counterOffers: number;
|
|
248
|
+
materialsToReview: number;
|
|
249
|
+
milestonesReady: number;
|
|
250
|
+
/** US9: applications to answer, held bonuses to decide, and posts taken down after the bonus window. */
|
|
251
|
+
potDecisions?: number;
|
|
252
|
+
total: number;
|
|
253
|
+
}
|
|
254
|
+
/** `GET /agency/panel` (FR-022). */
|
|
255
|
+
export interface I_AgencyPanel {
|
|
256
|
+
/** Open milestones of running (non-draft) campaigns due today. */
|
|
257
|
+
dueToday: number;
|
|
258
|
+
/** Open milestones of running (non-draft) campaigns past their date. */
|
|
259
|
+
overdue: number;
|
|
260
|
+
/** The roster's own "needs attention" count, or null when it could not be read: shown as a dash, never 0. */
|
|
261
|
+
needsAttention: number | null;
|
|
262
|
+
deadlines: Array<{
|
|
263
|
+
campaignId: string;
|
|
264
|
+
campaignName: string;
|
|
265
|
+
milestoneId: string;
|
|
266
|
+
kind: AgencyMilestoneKind;
|
|
267
|
+
label: string | null;
|
|
268
|
+
dueAt: string;
|
|
269
|
+
creatorHandle: string | null;
|
|
270
|
+
confirmed: boolean;
|
|
271
|
+
}>;
|
|
272
|
+
campaigns: Array<{
|
|
273
|
+
id: string;
|
|
274
|
+
name: string;
|
|
275
|
+
pipeline: I_AgencyCampaignPipeline;
|
|
276
|
+
liveByAt: string | null;
|
|
277
|
+
}>;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* What a creator reads about ONE campaign they are on. Deliberately narrow
|
|
281
|
+
* (SC-014): their own membership, offer, brief, materials and deadlines — no
|
|
282
|
+
* other creator, no total, no average, no count of others.
|
|
283
|
+
*/
|
|
284
|
+
export interface I_CreatorCampaignView {
|
|
285
|
+
memberId: string;
|
|
286
|
+
state: AgencyCampaignMemberState;
|
|
287
|
+
organization: {
|
|
288
|
+
id: string;
|
|
289
|
+
name: string;
|
|
290
|
+
};
|
|
291
|
+
/** `kind` is absent from 1.49 backends: read as 'offer'. */
|
|
292
|
+
campaign: {
|
|
293
|
+
id: string;
|
|
294
|
+
name: string;
|
|
295
|
+
brief: I_AgencyCampaignBrief;
|
|
296
|
+
kind?: AgencyCampaignKind;
|
|
297
|
+
};
|
|
298
|
+
/** Set on a pot campaign: the creator's own terms, earnings and the two-valued availability, nothing pot-level (SC-016). */
|
|
299
|
+
pot?: I_CreatorPotView | null;
|
|
300
|
+
/** The agency's files for the campaign (FR-039): every one is for its creators; opened through a signed read. */
|
|
301
|
+
files?: I_CampaignFile[];
|
|
302
|
+
creatorBrief: string | null;
|
|
303
|
+
/** The access request folded into the invitation, while it is open. */
|
|
304
|
+
requestedScopes: I_AgencyGrantScope[];
|
|
305
|
+
offer: I_AgencyOfferView | null;
|
|
306
|
+
materials: I_AgencyMaterial[];
|
|
307
|
+
/** True when the creator may upload now (confirmed, and no version awaits review). */
|
|
308
|
+
canUpload: boolean;
|
|
309
|
+
/** True when the creator may leave (no confirmed offer). */
|
|
310
|
+
canLeave: boolean;
|
|
311
|
+
milestones: I_AgencyMilestone[];
|
|
312
|
+
invitedAt: string;
|
|
313
|
+
}
|
|
314
|
+
/** `GET /agency/campaign-invitations/mine` — pending invitations and live campaigns. */
|
|
315
|
+
export interface I_CreatorCampaigns {
|
|
316
|
+
items: I_CreatorCampaignView[];
|
|
317
|
+
/** The creator's turn, the creator's badge: invitations to answer, offers to answer, and materials to upload (a first version, or a new one after changes were asked or a version was rejected). */
|
|
318
|
+
waitingOnYou: number;
|
|
319
|
+
}
|
|
320
|
+
export interface I_MaterialUploadTicket {
|
|
321
|
+
/** Opaque; sent back on confirm. */
|
|
322
|
+
uploadId: string;
|
|
323
|
+
/** PUT the file's bytes here with `headers`. */
|
|
324
|
+
uploadUrl: string;
|
|
325
|
+
headers: Record<string, string>;
|
|
326
|
+
expiresAt: string;
|
|
327
|
+
}
|
|
328
|
+
export interface I_SignedRead {
|
|
329
|
+
url: string;
|
|
330
|
+
expiresAt: string;
|
|
331
|
+
}
|
|
332
|
+
/** The brief's fields, shared by create and update. All optional on the wire. The pot's fields ride along (US9). */
|
|
333
|
+
declare class AgencyCampaignBriefFields extends PotFields {
|
|
334
|
+
text?: string;
|
|
335
|
+
deliverables?: I_CampaignDeliverable[];
|
|
336
|
+
draftDueAt?: string | null;
|
|
337
|
+
liveByAt?: string | null;
|
|
338
|
+
licenceMonths?: number | null;
|
|
339
|
+
paidPromoMonths?: number | null;
|
|
340
|
+
revisionRounds?: number | null;
|
|
341
|
+
protected assignBrief(data?: Partial<AgencyCampaignBriefFields>): void;
|
|
342
|
+
}
|
|
343
|
+
export declare class CreateAgencyCampaignDto extends AgencyCampaignBriefFields {
|
|
344
|
+
name: string;
|
|
345
|
+
/** Absent = an offer campaign (US7). */
|
|
346
|
+
kind?: AgencyCampaignKind;
|
|
347
|
+
constructor(data?: Partial<CreateAgencyCampaignDto>);
|
|
348
|
+
}
|
|
349
|
+
export declare class UpdateAgencyCampaignDto extends AgencyCampaignBriefFields {
|
|
350
|
+
name?: string;
|
|
351
|
+
/** Setting false publishes the draft; the brief text must then be present (FR-025). */
|
|
352
|
+
isDraft?: boolean;
|
|
353
|
+
/** Switch offer ↔ pot; refused once the first creator is invited (FR-030). */
|
|
354
|
+
kind?: AgencyCampaignKind;
|
|
355
|
+
constructor(data?: Partial<UpdateAgencyCampaignDto>);
|
|
356
|
+
}
|
|
357
|
+
export declare class InviteCampaignCreatorDto {
|
|
358
|
+
/** A user id: a UUID or a Firebase uid. */
|
|
359
|
+
creatorUserId: string;
|
|
360
|
+
creatorBrief?: string;
|
|
361
|
+
/** The access request folded into the invitation when no grant covers them (FR-026). */
|
|
362
|
+
scopes?: I_AgencyGrantScope[];
|
|
363
|
+
constructor(data?: Partial<InviteCampaignCreatorDto>);
|
|
364
|
+
}
|
|
365
|
+
export declare class SendCampaignOfferDto {
|
|
366
|
+
priceMinor: number;
|
|
367
|
+
currency: string;
|
|
368
|
+
constructor(data?: Partial<SendCampaignOfferDto>);
|
|
369
|
+
}
|
|
370
|
+
/** One act on an offer. `counter` needs `priceMinor`; any act may carry a note. */
|
|
371
|
+
export declare class CampaignOfferActDto {
|
|
372
|
+
action: AgencyOfferAction;
|
|
373
|
+
/** A counter keeps the offer's currency; only the amount moves. */
|
|
374
|
+
priceMinor?: number;
|
|
375
|
+
note?: string;
|
|
376
|
+
constructor(data?: Partial<CampaignOfferActDto>);
|
|
377
|
+
}
|
|
378
|
+
/** One agency act on a material. `request_changes` requires the note. */
|
|
379
|
+
export declare class CampaignMaterialActDto {
|
|
380
|
+
action: AgencyMaterialAction;
|
|
381
|
+
note?: string;
|
|
382
|
+
constructor(data?: Partial<CampaignMaterialActDto>);
|
|
383
|
+
}
|
|
384
|
+
export declare class JoinCampaignDto {
|
|
385
|
+
/** A subset of what was asked; absent = everything asked. */
|
|
386
|
+
scopes?: I_AgencyGrantScope[];
|
|
387
|
+
constructor(data?: Partial<JoinCampaignDto>);
|
|
388
|
+
}
|
|
389
|
+
/** Material files: images and video only, at most 2 GB. */
|
|
390
|
+
export declare const MATERIAL_MAX_BYTES: number;
|
|
391
|
+
/**
|
|
392
|
+
* The photo formats a material may be. Raster only: no SVG or HTML, because a
|
|
393
|
+
* material is opened in the browser. Shared so the upload picker, the
|
|
394
|
+
* creator's own check and the API refuse exactly the same files.
|
|
395
|
+
*/
|
|
396
|
+
export declare const MATERIAL_IMAGE_TYPES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp", "image/heic", "image/heif", "image/avif"];
|
|
397
|
+
/** A material's content type: one of MATERIAL_IMAGE_TYPES, or any video. */
|
|
398
|
+
export declare const MATERIAL_CONTENT_TYPE: RegExp;
|
|
399
|
+
export declare class PrepareMaterialUploadDto {
|
|
400
|
+
fileName: string;
|
|
401
|
+
contentType: string;
|
|
402
|
+
sizeBytes: number;
|
|
403
|
+
constructor(data?: Partial<PrepareMaterialUploadDto>);
|
|
404
|
+
}
|
|
405
|
+
export declare class ConfirmMaterialUploadDto {
|
|
406
|
+
uploadId: string;
|
|
407
|
+
/** The post's caption, sent with the material on a pot campaign (FR-032). */
|
|
408
|
+
caption?: string;
|
|
409
|
+
constructor(data?: Partial<ConfirmMaterialUploadDto>);
|
|
410
|
+
}
|
|
411
|
+
export declare class CreateAgencyMilestoneDto {
|
|
412
|
+
kind: AgencyMilestoneKind;
|
|
413
|
+
/** Required for `custom`, ignored otherwise. */
|
|
414
|
+
label?: string;
|
|
415
|
+
dueAt?: string | null;
|
|
416
|
+
/** Absent = campaign-wide. */
|
|
417
|
+
creatorUserId?: string | null;
|
|
418
|
+
offerRule?: (typeof AGENCY_MILESTONE_OFFER_RULES)[number] | null;
|
|
419
|
+
mediaRule?: (typeof AGENCY_MILESTONE_MEDIA_RULES)[number] | null;
|
|
420
|
+
constructor(data?: Partial<CreateAgencyMilestoneDto>);
|
|
421
|
+
}
|
|
422
|
+
/** `PATCH /users/me/settlement-form` — the creator's own setting (FR-027). */
|
|
423
|
+
export declare class UpdateSettlementFormDto {
|
|
424
|
+
settlementForm: SettlementForm | null;
|
|
425
|
+
constructor(data?: Partial<UpdateSettlementFormDto>);
|
|
426
|
+
}
|
|
427
|
+
export {};
|