@wrcb/cb-common 1.0.896 → 1.0.897
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/build/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './types/predictionType';
|
|
|
58
58
|
export * from './types/mercadoProfissional';
|
|
59
59
|
export * from './types/trabalhoHomeOffice';
|
|
60
60
|
export * from './types/crm';
|
|
61
|
+
export * from './types/companion';
|
|
61
62
|
export * from './events/subjects';
|
|
62
63
|
export * from './events/baseListener';
|
|
63
64
|
export * from './events/basePublisher';
|
package/build/index.js
CHANGED
|
@@ -86,6 +86,7 @@ __exportStar(require("./types/mercadoProfissional"), exports);
|
|
|
86
86
|
__exportStar(require("./types/trabalhoHomeOffice"), exports);
|
|
87
87
|
// crm — núcleo multi-tenant (pipeline configurável + agente de IA)
|
|
88
88
|
__exportStar(require("./types/crm"), exports);
|
|
89
|
+
__exportStar(require("./types/companion"), exports);
|
|
89
90
|
__exportStar(require("./events/subjects"), exports);
|
|
90
91
|
__exportStar(require("./events/baseListener"), exports);
|
|
91
92
|
__exportStar(require("./events/basePublisher"), exports);
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { UserCategory } from './userCategory';
|
|
2
|
+
/** Uma pessoa do perfil. Influencer solo tem uma; casal, duas. */
|
|
3
|
+
export interface CompanionPerson {
|
|
4
|
+
name: string;
|
|
5
|
+
age: number;
|
|
6
|
+
/** Como a pessoa se identifica, em português: "mulher", "mulher trans"… */
|
|
7
|
+
gender: string;
|
|
8
|
+
/** O corpo, o rosto e o estilo, em português — como ela mesma diria. */
|
|
9
|
+
physical: string;
|
|
10
|
+
/**
|
|
11
|
+
* A mesma descrição, em inglês e em termos visuais, para os modelos de
|
|
12
|
+
* imagem. Fica separada porque o que soa bem na conversa ("morena de
|
|
13
|
+
* sorriso fácil") não é o que fixa o rosto entre uma foto e outra.
|
|
14
|
+
*/
|
|
15
|
+
visualPrompt: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CompanionProfile {
|
|
18
|
+
/** Identificador estável: nome de arquivo das imagens e chave do cadastro. */
|
|
19
|
+
slug: string;
|
|
20
|
+
/** Female, Male, Trans ou Couple. */
|
|
21
|
+
category: UserCategory;
|
|
22
|
+
people: CompanionPerson[];
|
|
23
|
+
city: string;
|
|
24
|
+
state: string;
|
|
25
|
+
occupation: string;
|
|
26
|
+
personality: string;
|
|
27
|
+
hobbies: string[];
|
|
28
|
+
/** Como escreve: gírias, ritmo, emojis, apelidos. */
|
|
29
|
+
speakingStyle: string;
|
|
30
|
+
/** Do que gosta entre quatro paredes. Vai para o prompt, não para o card. */
|
|
31
|
+
turnOns: string;
|
|
32
|
+
/** A linha curta do card. */
|
|
33
|
+
headline: string;
|
|
34
|
+
/** Duas ou três frases, na primeira pessoa. */
|
|
35
|
+
bio: string;
|
|
36
|
+
/** Preenchidos quando as imagens são geradas. */
|
|
37
|
+
avatarUrl: string | null;
|
|
38
|
+
/** A folha de personagem (fundo verde, frente e perfis, rosto e cabelo). */
|
|
39
|
+
sheetUrl: string | null;
|
|
40
|
+
/** O usuário vendedor que publica os posts dela na vitrine. */
|
|
41
|
+
sellerId: string | null;
|
|
42
|
+
}
|
|
43
|
+
/** O card público. Nunca leva o `systemPrompt` nem o `turnOns`. */
|
|
44
|
+
export interface CompanionCard {
|
|
45
|
+
agentId: string;
|
|
46
|
+
slug: string;
|
|
47
|
+
/** "Lia" ou, no casal, "Lia & Duda". */
|
|
48
|
+
name: string;
|
|
49
|
+
category: UserCategory;
|
|
50
|
+
ages: number[];
|
|
51
|
+
city: string;
|
|
52
|
+
state: string;
|
|
53
|
+
occupation: string;
|
|
54
|
+
hobbies: string[];
|
|
55
|
+
headline: string;
|
|
56
|
+
bio: string;
|
|
57
|
+
avatarUrl: string | null;
|
|
58
|
+
sellerId: string | null;
|
|
59
|
+
online: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare enum CompanionChatSender {
|
|
62
|
+
Visitor = "Visitor",
|
|
63
|
+
Companion = "Companion"
|
|
64
|
+
}
|
|
65
|
+
export interface CompanionChatMessage {
|
|
66
|
+
id: string;
|
|
67
|
+
sender: CompanionChatSender;
|
|
68
|
+
text: string;
|
|
69
|
+
/** ISO 8601. */
|
|
70
|
+
createdAt: string;
|
|
71
|
+
/**
|
|
72
|
+
* Card de pack dentro da conversa: a oferta (fotos borradas, preço) ou, já
|
|
73
|
+
* comprado, as fotos liberadas. `undefined` em mensagem comum.
|
|
74
|
+
*/
|
|
75
|
+
pack?: CompanionChatPack;
|
|
76
|
+
}
|
|
77
|
+
/** Um pack de fotos exclusivas, como o chat mostra. */
|
|
78
|
+
export interface CompanionChatPack {
|
|
79
|
+
packId: string;
|
|
80
|
+
title: string;
|
|
81
|
+
description: string;
|
|
82
|
+
/** Em centavos, cobrado do saldo de créditos de quem compra. */
|
|
83
|
+
priceCents: number;
|
|
84
|
+
imageCount: number;
|
|
85
|
+
/** Capa borrada: é o que aparece antes da compra. */
|
|
86
|
+
coverUrl: string;
|
|
87
|
+
/** As fotos. Só vem preenchido para quem comprou. */
|
|
88
|
+
imageUrls: string[] | null;
|
|
89
|
+
}
|
|
90
|
+
/** Uma linha da lista de conversas do visitante. */
|
|
91
|
+
export interface CompanionChatSummary {
|
|
92
|
+
chatId: string;
|
|
93
|
+
agentId: string;
|
|
94
|
+
name: string;
|
|
95
|
+
avatarUrl: string | null;
|
|
96
|
+
online: boolean;
|
|
97
|
+
lastMessage: CompanionChatMessage | null;
|
|
98
|
+
unread: number;
|
|
99
|
+
}
|
|
100
|
+
export interface CompanionChatThread {
|
|
101
|
+
/** `null` enquanto o visitante não mandou a primeira mensagem. */
|
|
102
|
+
chatId: string | null;
|
|
103
|
+
agentId: string;
|
|
104
|
+
messages: CompanionChatMessage[];
|
|
105
|
+
/** A influencer está escrevendo agora. */
|
|
106
|
+
typing: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Quantas mensagens o visitante sem conta ainda pode mandar antes de
|
|
109
|
+
* precisar se cadastrar. `null` para quem já está logado.
|
|
110
|
+
*/
|
|
111
|
+
freeMessagesLeft: number | null;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Erros das rotas do chat. São códigos, não frases: quem traduz é o site.
|
|
115
|
+
* - SignupRequired: o visitante sem conta esgotou as mensagens grátis.
|
|
116
|
+
* - CompanionOffline: tentou abrir conversa nova com quem está offline.
|
|
117
|
+
* - CompanionNotFound: o agente não existe ou não é uma influencer.
|
|
118
|
+
* - ChatNotFound: não há conversa com esse agente para esse visitante.
|
|
119
|
+
* - LoginRequired: comprar pack exige conta.
|
|
120
|
+
* - PackNotFound: o pack não existe ou não é dessa influencer.
|
|
121
|
+
* - InsufficientBalance: o saldo de créditos não cobre o pack.
|
|
122
|
+
*/
|
|
123
|
+
export type CompanionChatError = 'SignupRequired' | 'CompanionOffline' | 'CompanionNotFound' | 'ChatNotFound' | 'LoginRequired' | 'PackNotFound' | 'InsufficientBalance';
|
|
124
|
+
export interface CompanionMediaPost {
|
|
125
|
+
/** Legenda, na voz da influencer. */
|
|
126
|
+
caption: string;
|
|
127
|
+
/** Cena, em inglês, como foi pedida ao gerador de imagens. */
|
|
128
|
+
scene: string;
|
|
129
|
+
/** Post aberto (vitrine) ou só para assinantes. */
|
|
130
|
+
isFree: boolean;
|
|
131
|
+
/** `null` enquanto não foi gerado (ou se o gerador recusou). */
|
|
132
|
+
imageUrl: string | null;
|
|
133
|
+
/** Miniatura borrada que a vitrine mostra no lugar do post fechado. */
|
|
134
|
+
thumbnailUrl: string | null;
|
|
135
|
+
}
|
|
136
|
+
/** Um pack no manifesto: o ensaio exclusivo vendido no chat. */
|
|
137
|
+
export interface CompanionMediaPack {
|
|
138
|
+
/** Estável dentro da influencer ("ensaio-1"): é a chave de compra. */
|
|
139
|
+
packKey: string;
|
|
140
|
+
title: string;
|
|
141
|
+
description: string;
|
|
142
|
+
priceCents: number;
|
|
143
|
+
scenes: string[];
|
|
144
|
+
/** Uma por cena; `null` enquanto não gerada (ou recusada). */
|
|
145
|
+
imageUrls: (string | null)[];
|
|
146
|
+
coverUrl: string | null;
|
|
147
|
+
}
|
|
148
|
+
export interface CompanionMediaEntry {
|
|
149
|
+
slug: string;
|
|
150
|
+
avatarScene: string;
|
|
151
|
+
sheetUrl: string | null;
|
|
152
|
+
avatarUrl: string | null;
|
|
153
|
+
posts: CompanionMediaPost[];
|
|
154
|
+
/** Ausente nos manifestos gerados antes dos packs existirem. */
|
|
155
|
+
packs?: CompanionMediaPack[];
|
|
156
|
+
}
|
|
157
|
+
export type CompanionMediaManifest = Record<string, CompanionMediaEntry>;
|
|
158
|
+
/**
|
|
159
|
+
* O que o cadastro das vendedoras (cb-auth) precisa saber de cada influencer.
|
|
160
|
+
* Exportado pelo cb-crm, que é onde a ficha mora, para nenhum serviço
|
|
161
|
+
* importar o código do outro.
|
|
162
|
+
*/
|
|
163
|
+
export interface CompanionDirectoryEntry {
|
|
164
|
+
slug: string;
|
|
165
|
+
name: string;
|
|
166
|
+
category: UserCategory;
|
|
167
|
+
ages: number[];
|
|
168
|
+
city: string;
|
|
169
|
+
state: string;
|
|
170
|
+
headline: string;
|
|
171
|
+
bio: string;
|
|
172
|
+
avatarUrl: string | null;
|
|
173
|
+
}
|
|
174
|
+
/** O que o cadastro das vendedoras devolve: slug → id do usuário vendedor. */
|
|
175
|
+
export type CompanionSellerMap = Record<string, string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompanionChatSender = void 0;
|
|
4
|
+
var CompanionChatSender;
|
|
5
|
+
(function (CompanionChatSender) {
|
|
6
|
+
CompanionChatSender["Visitor"] = "Visitor";
|
|
7
|
+
CompanionChatSender["Companion"] = "Companion";
|
|
8
|
+
})(CompanionChatSender || (exports.CompanionChatSender = CompanionChatSender = {}));
|
|
@@ -19,4 +19,8 @@ var TransactionOperation;
|
|
|
19
19
|
TransactionOperation["GiftReceived"] = "GiftReceived";
|
|
20
20
|
TransactionOperation["Bet"] = "Bet";
|
|
21
21
|
TransactionOperation["Gain"] = "Gain";
|
|
22
|
+
// Conteúdo avulso comprado com o saldo (pack de fotos no chat das
|
|
23
|
+
// influencers de IA): o débito de quem compra e o crédito de quem vende.
|
|
24
|
+
TransactionOperation["ContentPurchased"] = "ContentPurchased";
|
|
25
|
+
TransactionOperation["ContentSold"] = "ContentSold";
|
|
22
26
|
})(TransactionOperation || (exports.TransactionOperation = TransactionOperation = {}));
|