rapida-partner 3.3.0 → 3.5.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/package.json +1 -1
- package/src/interfaces/project-backend.interface.ts +6 -0
- package/src/interfaces/project.interface.ts +15 -1
- package/src/interfaces/referral-curation.interface.ts +95 -0
- package/src/interfaces/referral-source.interface.ts +81 -0
- package/src/interfaces/scheduled-job.interface.ts +19 -0
- package/src/schemas/backend.ref.json +8 -0
- package/src/schemas/project.schema.json +25 -1
- package/src/schemas/referral-curation.ref.json +257 -0
- package/src/schemas/referral-source-integration.ref.json +143 -0
- package/src/schemas/scheduled-job.ref.json +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IFormAutocomplete } from "./form-autocomplete.interface";
|
|
2
2
|
import type { IList } from "./list.interface";
|
|
3
3
|
import type { ITrustedCaller } from "./trusted-caller.interface";
|
|
4
|
+
import type { IReferralSourceIntegration } from "./referral-source.interface";
|
|
5
|
+
import type { IScheduledJob } from "./scheduled-job.interface";
|
|
4
6
|
|
|
5
7
|
interface IDatabase {
|
|
6
8
|
provider:
|
|
@@ -111,6 +113,10 @@ export interface IBackend {
|
|
|
111
113
|
email?: IEmail;
|
|
112
114
|
marketplace?: IMarketplace;
|
|
113
115
|
service?: IService;
|
|
116
|
+
// Só para skeleton "referralCommerce": uma entrada por fonte de afiliado.
|
|
117
|
+
referralSources?: IReferralSourceIntegration[];
|
|
118
|
+
// Frequência dos jobs agendados que o skeleton/funcionalidade gera.
|
|
119
|
+
scheduledJobs?: IScheduledJob[];
|
|
114
120
|
mercadoPagoIntegration?: {
|
|
115
121
|
publicKey?: string;
|
|
116
122
|
accessToken?: string;
|
|
@@ -17,6 +17,7 @@ import type { IProjectRepositories } from "./project-repositories.interface";
|
|
|
17
17
|
import type { IStyle } from "./project-style.interface";
|
|
18
18
|
import type { TTranslatable } from "./translatable.interface";
|
|
19
19
|
import type { IProjectStore } from "./store-settings.interface";
|
|
20
|
+
import type { IReferralCuration } from "./referral-curation.interface";
|
|
20
21
|
|
|
21
22
|
export interface IProject {
|
|
22
23
|
id: string;
|
|
@@ -27,7 +28,18 @@ export interface IProject {
|
|
|
27
28
|
// "ecommerce": loja de um único vendedor (o dono dos dados da instância).
|
|
28
29
|
// "marketplace": vários vendedores; enquanto a camada multivendedor não existe,
|
|
29
30
|
// o rapida-code-generator gera para os dois o mesmo núcleo de loja.
|
|
30
|
-
|
|
31
|
+
// "referralCommerce": vitrine sem venda própria; cada produto leva por link de
|
|
32
|
+
// afiliado para o anúncio na fonte de origem (IBackend.referralSources), com
|
|
33
|
+
// a curadoria de IProject.referralCuration. Requer suporte no gerador.
|
|
34
|
+
skeleton:
|
|
35
|
+
| "backoffice"
|
|
36
|
+
| "ecommerce"
|
|
37
|
+
| "marketplace"
|
|
38
|
+
| "referralCommerce"
|
|
39
|
+
| "landingPage"
|
|
40
|
+
| "socialNetwork"
|
|
41
|
+
| "service"
|
|
42
|
+
| "aiAgent";
|
|
31
43
|
// Idiomas em que os textos TTranslatable (label, placeholder, tooltip, title)
|
|
32
44
|
// são declarados. Sem languages, o projeto é monolíngue em defaultLanguage.
|
|
33
45
|
languages?: TLanguage[];
|
|
@@ -83,6 +95,8 @@ export interface IProject {
|
|
|
83
95
|
// Só para skeleton "ecommerce"/"marketplace": funcionalidades opcionais
|
|
84
96
|
// geradas e valores iniciais da configuração da loja.
|
|
85
97
|
store?: IProjectStore;
|
|
98
|
+
// Só para skeleton "referralCommerce": filtros e desempate dos produtos exibidos.
|
|
99
|
+
referralCuration?: IReferralCuration;
|
|
86
100
|
}
|
|
87
101
|
|
|
88
102
|
export interface IFrontend {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { TReferralSource } from "./referral-source.interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Critério de desempate quando o mesmo produto (mesmo GTIN/EAN) passa pelos
|
|
5
|
+
* filtros em mais de uma fonte. Aplicados na ordem da lista; uma fonte sem o
|
|
6
|
+
* dado do critério (prazo ou comissão) perde aquele desempate.
|
|
7
|
+
*
|
|
8
|
+
* Hoje nenhuma API de afiliado informa prazo de entrega por item: "fastestDelivery"
|
|
9
|
+
* só decide quando a fonte declara `IReferralSourceIntegration.defaultDeliveryDays`.
|
|
10
|
+
*/
|
|
11
|
+
export type TReferralTieBreaker = "fastestDelivery" | "highestCommission" | "lowestPrice";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Filtros de `IReferralCuration` cujo dado nem toda fonte informa:
|
|
15
|
+
* - "ratingCount": `minRatingCount`;
|
|
16
|
+
* - "rating": `minNormalizedRating`;
|
|
17
|
+
* - "freeShipping": `freeShippingOnly`.
|
|
18
|
+
* O desconto sobre o preço médio fica fora: sem histórico não há o que comparar.
|
|
19
|
+
*/
|
|
20
|
+
export type TReferralCriterion = "ratingCount" | "rating" | "freeShipping";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* O que fazer com um anúncio quando a fonte não informa o dado de um critério:
|
|
24
|
+
* - "reject": reprova o anúncio (padrão);
|
|
25
|
+
* - "skip": ignora só esse critério para o anúncio, que a vitrine marca como
|
|
26
|
+
* não verificado nesse ponto.
|
|
27
|
+
*/
|
|
28
|
+
export type TReferralMissingDataPolicy = "reject" | "skip";
|
|
29
|
+
|
|
30
|
+
export type TReferralMissingDataRules = Partial<Record<TReferralCriterion, TReferralMissingDataPolicy>>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Exceção de uma fonte às regras de dado ausente. Vale só para os critérios
|
|
34
|
+
* listados; os demais seguem `IReferralCuration.missingData`.
|
|
35
|
+
*/
|
|
36
|
+
export interface IReferralSourceCurationOverride {
|
|
37
|
+
missingData?: TReferralMissingDataRules;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* O que buscar nas fontes. O job de captura pesquisa cada termo em cada fonte
|
|
42
|
+
* configurada, restrito às categorias da fonte quando declaradas.
|
|
43
|
+
*/
|
|
44
|
+
export interface IReferralSearch {
|
|
45
|
+
// Termos de busca (ex.: "blu-ray", "box dvd"). Ao menos um.
|
|
46
|
+
keywords: string[];
|
|
47
|
+
// Ids nativos de categoria de cada fonte, para restringir a busca.
|
|
48
|
+
categories?: Partial<Record<TReferralSource, string[]>>;
|
|
49
|
+
// Máximo de anúncios lidos por termo em cada fonte. Padrão do gerador se omitido.
|
|
50
|
+
maxListingsPerQuery?: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Base do "preço médio" com que o preço atual é comparado.
|
|
55
|
+
*
|
|
56
|
+
* "sourceHistory": média dos preços do próprio anúncio, na mesma fonte, nos
|
|
57
|
+
* últimos `windowDays` dias, com um preço por dia (o último capturado no dia).
|
|
58
|
+
* O dia corrente fica fora da média, para o preço de hoje não puxar a base.
|
|
59
|
+
* Os preços vêm do job de captura (`IBackend.scheduledJobs`, id
|
|
60
|
+
* "referralPriceSnapshot"). Enquanto o anúncio tiver menos de `minSnapshots`
|
|
61
|
+
* dias com captura na janela, ele não é exibido.
|
|
62
|
+
*/
|
|
63
|
+
export interface IReferralPriceBaseline {
|
|
64
|
+
kind: "sourceHistory";
|
|
65
|
+
windowDays: number;
|
|
66
|
+
// Mínimo de dias distintos com captura na janela (não de capturas).
|
|
67
|
+
minSnapshots?: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Regras de curadoria dos produtos exibidos no skeleton "referralCommerce"
|
|
72
|
+
* (`IProject.referralCuration`). São regras do produto, iguais em todo ambiente;
|
|
73
|
+
* credenciais das fontes ficam em `IBackend.referralSources`.
|
|
74
|
+
*
|
|
75
|
+
* Identidade de produto entre fontes: só GTIN/EAN normalizado (forma GTIN-14,
|
|
76
|
+
* dígito verificador válido). Anúncio sem GTIN válido não é descartado: concorre
|
|
77
|
+
* sozinho, sem entrar no desempate com as outras fontes.
|
|
78
|
+
*/
|
|
79
|
+
export interface IReferralCuration {
|
|
80
|
+
// Mínimo de avaliações, inclusivo (">200 avaliações" = 201).
|
|
81
|
+
minRatingCount: number;
|
|
82
|
+
// Nota mínima normalizada em 0..1, inclusiva: 0.9 = 4.5/5 = 9/10.
|
|
83
|
+
minNormalizedRating: number;
|
|
84
|
+
// Desconto mínimo (0..1) do preço atual em relação a `priceBaseline`: 0.1 = 10% abaixo.
|
|
85
|
+
minDiscountFromBaseline: number;
|
|
86
|
+
priceBaseline: IReferralPriceBaseline;
|
|
87
|
+
// Só exibe anúncios com frete grátis.
|
|
88
|
+
freeShippingOnly: boolean;
|
|
89
|
+
tieBreakers: TReferralTieBreaker[];
|
|
90
|
+
search: IReferralSearch;
|
|
91
|
+
// Política para dado ausente, por critério. Critério omitido = "reject".
|
|
92
|
+
missingData?: TReferralMissingDataRules;
|
|
93
|
+
// Exceções por fonte, que prevalecem sobre `missingData` nos critérios listados.
|
|
94
|
+
sourceOverrides?: Partial<Record<TReferralSource, IReferralSourceCurationOverride>>;
|
|
95
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fontes de produto do skeleton "referralCommerce": a loja não vende, só leva
|
|
3
|
+
* o comprador por link de afiliado para o anúncio na fonte de origem.
|
|
4
|
+
*
|
|
5
|
+
* "mercadoLivre" é o catálogo/programa de afiliados do Mercado Livre — não
|
|
6
|
+
* confundir com "mercadoPago" de `IPaymentGateway`, que é gateway de pagamento.
|
|
7
|
+
*/
|
|
8
|
+
export type TReferralSource = "shopee" | "amazon" | "mercadoLivre";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Campos comuns da integração com o programa de afiliados de uma fonte.
|
|
12
|
+
*/
|
|
13
|
+
interface IReferralSourceIntegrationBase {
|
|
14
|
+
// Comissão (0..1) assumida quando a API não informa a comissão por item
|
|
15
|
+
// (ex.: tabela por categoria). Usada pelo desempate "highestCommission";
|
|
16
|
+
// sem ela e sem dado por item, a fonte perde esse desempate.
|
|
17
|
+
defaultCommissionRate?: number;
|
|
18
|
+
// Prazo de entrega (dias) assumido para os anúncios da fonte. Nenhuma API de
|
|
19
|
+
// afiliado informa prazo por item hoje; sem este valor, a fonte perde o
|
|
20
|
+
// desempate "fastestDelivery". Prazo real por CEP está fora do escopo.
|
|
21
|
+
defaultDeliveryDays?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Shopee Afiliados (Open API). AppID e Secret ficam na página Open API do painel
|
|
26
|
+
* de afiliado. A API devolve o link de oferta já atribuído à conta dona do AppID,
|
|
27
|
+
* por isso `affiliateTag` é opcional e hoje não é usado pelo gerador. O uso como
|
|
28
|
+
* sub-id do link depende de confirmar a API com conta real.
|
|
29
|
+
*/
|
|
30
|
+
export interface IShopeeReferralIntegration extends IReferralSourceIntegrationBase {
|
|
31
|
+
source: "shopee";
|
|
32
|
+
credentials: {
|
|
33
|
+
appId: string;
|
|
34
|
+
secret: string;
|
|
35
|
+
};
|
|
36
|
+
affiliateTag?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Amazon Associates (Creators API). Credenciais do Associates Central; a API só
|
|
41
|
+
* é liberada depois de vendas qualificadas no marketplace.
|
|
42
|
+
*/
|
|
43
|
+
export interface IAmazonReferralIntegration extends IReferralSourceIntegrationBase {
|
|
44
|
+
source: "amazon";
|
|
45
|
+
credentials: {
|
|
46
|
+
credentialId: string;
|
|
47
|
+
credentialSecret: string;
|
|
48
|
+
// Versão da credencial; define o endereço de emissão do token. Padrão do gerador se omitida.
|
|
49
|
+
version?: string;
|
|
50
|
+
// Marketplace alvo (ex.: "www.amazon.com.br"). Padrão do gerador se omitido.
|
|
51
|
+
marketplace?: string;
|
|
52
|
+
};
|
|
53
|
+
// Tag de associado (partnerTag) anexada a todo link.
|
|
54
|
+
affiliateTag: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Mercado Livre: aplicação no portal de desenvolvedores (clientId/clientSecret)
|
|
59
|
+
* para o catálogo e programa de afiliados para a comissão do link.
|
|
60
|
+
*/
|
|
61
|
+
export interface IMercadoLivreReferralIntegration extends IReferralSourceIntegrationBase {
|
|
62
|
+
source: "mercadoLivre";
|
|
63
|
+
credentials: {
|
|
64
|
+
clientId: string;
|
|
65
|
+
clientSecret: string;
|
|
66
|
+
// Ferramenta de afiliado (parâmetro matt_tool do link).
|
|
67
|
+
mattTool?: string;
|
|
68
|
+
};
|
|
69
|
+
// Identificador de afiliado (parâmetro matt_word do link).
|
|
70
|
+
affiliateTag: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Integração com o programa de afiliados de uma fonte, por ambiente
|
|
75
|
+
* (`IBackend.referralSources`). Uma entrada por fonte; as chaves de
|
|
76
|
+
* `credentials` são as que cada programa usa.
|
|
77
|
+
*/
|
|
78
|
+
export type IReferralSourceIntegration =
|
|
79
|
+
| IShopeeReferralIntegration
|
|
80
|
+
| IAmazonReferralIntegration
|
|
81
|
+
| IMercadoLivreReferralIntegration;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ids dos jobs que o próprio skeleton/funcionalidade gera:
|
|
3
|
+
* - "referralPriceSnapshot": captura de preços dos anúncios do skeleton
|
|
4
|
+
* "referralCommerce" (base de `IReferralPriceBaseline`). Respeite o limite
|
|
5
|
+
* de requisições das APIs de afiliado ao escolher a frequência.
|
|
6
|
+
*/
|
|
7
|
+
export type TScheduledJobId = "referralPriceSnapshot";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Job agendado do backend gerado (`IBackend.scheduledJobs`), por ambiente.
|
|
11
|
+
* O projeto só ajusta a frequência de um job que o gerador já cria.
|
|
12
|
+
*/
|
|
13
|
+
export interface IScheduledJob {
|
|
14
|
+
id: TScheduledJobId;
|
|
15
|
+
// Expressão cron de 5 campos (ex.: "0 */6 * * *").
|
|
16
|
+
cron: string;
|
|
17
|
+
// Fuso IANA do agendador (ex.: "America/Sao_Paulo"); padrão do servidor se omitido.
|
|
18
|
+
timezone?: string;
|
|
19
|
+
}
|
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
"type": "array",
|
|
45
45
|
"items": { "$ref": "trusted-caller.ref.json" }
|
|
46
46
|
},
|
|
47
|
+
"referralSources": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "$ref": "referral-source-integration.ref.json" }
|
|
50
|
+
},
|
|
51
|
+
"scheduledJobs": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": { "$ref": "scheduled-job.ref.json" }
|
|
54
|
+
},
|
|
47
55
|
"storage": {
|
|
48
56
|
"type": "object",
|
|
49
57
|
"properties": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"backoffice",
|
|
19
19
|
"ecommerce",
|
|
20
20
|
"marketplace",
|
|
21
|
+
"referralCommerce",
|
|
21
22
|
"landingPage",
|
|
22
23
|
"socialNetwork",
|
|
23
24
|
"service",
|
|
@@ -202,7 +203,30 @@
|
|
|
202
203
|
},
|
|
203
204
|
"store": {
|
|
204
205
|
"$ref": "project-store.ref.json"
|
|
206
|
+
},
|
|
207
|
+
"referralCuration": {
|
|
208
|
+
"$ref": "referral-curation.ref.json"
|
|
205
209
|
}
|
|
206
210
|
},
|
|
207
|
-
"required": ["id", "title", "description", "skeleton"]
|
|
211
|
+
"required": ["id", "title", "description", "skeleton"],
|
|
212
|
+
"if": {
|
|
213
|
+
"properties": { "skeleton": { "const": "referralCommerce" } },
|
|
214
|
+
"required": ["skeleton"]
|
|
215
|
+
},
|
|
216
|
+
"then": {
|
|
217
|
+
"required": ["referralCuration", "backend"],
|
|
218
|
+
"properties": {
|
|
219
|
+
"backend": {
|
|
220
|
+
"type": "array",
|
|
221
|
+
"minItems": 1,
|
|
222
|
+
"items": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"required": ["referralSources"],
|
|
225
|
+
"properties": {
|
|
226
|
+
"referralSources": { "type": "array", "minItems": 1 }
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
208
232
|
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "referral-curation.ref.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"minRatingCount": {
|
|
7
|
+
"type": "integer",
|
|
8
|
+
"minimum": 0
|
|
9
|
+
},
|
|
10
|
+
"minNormalizedRating": {
|
|
11
|
+
"type": "number",
|
|
12
|
+
"minimum": 0,
|
|
13
|
+
"maximum": 1
|
|
14
|
+
},
|
|
15
|
+
"minDiscountFromBaseline": {
|
|
16
|
+
"type": "number",
|
|
17
|
+
"minimum": 0,
|
|
18
|
+
"maximum": 1
|
|
19
|
+
},
|
|
20
|
+
"priceBaseline": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"kind": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"enum": [
|
|
26
|
+
"sourceHistory"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"windowDays": {
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"minimum": 1
|
|
32
|
+
},
|
|
33
|
+
"minSnapshots": {
|
|
34
|
+
"type": "integer",
|
|
35
|
+
"minimum": 1
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": [
|
|
39
|
+
"kind",
|
|
40
|
+
"windowDays"
|
|
41
|
+
],
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
},
|
|
44
|
+
"freeShippingOnly": {
|
|
45
|
+
"type": "boolean"
|
|
46
|
+
},
|
|
47
|
+
"tieBreakers": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"fastestDelivery",
|
|
53
|
+
"highestCommission",
|
|
54
|
+
"lowestPrice"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"uniqueItems": true
|
|
58
|
+
},
|
|
59
|
+
"search": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"keywords": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"minLength": 1
|
|
67
|
+
},
|
|
68
|
+
"minItems": 1,
|
|
69
|
+
"uniqueItems": true
|
|
70
|
+
},
|
|
71
|
+
"categories": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"shopee": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"minLength": 1
|
|
79
|
+
},
|
|
80
|
+
"minItems": 1,
|
|
81
|
+
"uniqueItems": true
|
|
82
|
+
},
|
|
83
|
+
"amazon": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"minLength": 1
|
|
88
|
+
},
|
|
89
|
+
"minItems": 1,
|
|
90
|
+
"uniqueItems": true
|
|
91
|
+
},
|
|
92
|
+
"mercadoLivre": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"items": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1
|
|
97
|
+
},
|
|
98
|
+
"minItems": 1,
|
|
99
|
+
"uniqueItems": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": false
|
|
103
|
+
},
|
|
104
|
+
"maxListingsPerQuery": {
|
|
105
|
+
"type": "integer",
|
|
106
|
+
"minimum": 1
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"required": [
|
|
110
|
+
"keywords"
|
|
111
|
+
],
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
},
|
|
114
|
+
"missingData": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"properties": {
|
|
117
|
+
"ratingCount": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"enum": [
|
|
120
|
+
"reject",
|
|
121
|
+
"skip"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"rating": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"enum": [
|
|
127
|
+
"reject",
|
|
128
|
+
"skip"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"freeShipping": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"enum": [
|
|
134
|
+
"reject",
|
|
135
|
+
"skip"
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"additionalProperties": false
|
|
140
|
+
},
|
|
141
|
+
"sourceOverrides": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"properties": {
|
|
144
|
+
"shopee": {
|
|
145
|
+
"type": "object",
|
|
146
|
+
"properties": {
|
|
147
|
+
"missingData": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"properties": {
|
|
150
|
+
"ratingCount": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"enum": [
|
|
153
|
+
"reject",
|
|
154
|
+
"skip"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"rating": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"enum": [
|
|
160
|
+
"reject",
|
|
161
|
+
"skip"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"freeShipping": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"enum": [
|
|
167
|
+
"reject",
|
|
168
|
+
"skip"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"additionalProperties": false
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"additionalProperties": false
|
|
176
|
+
},
|
|
177
|
+
"amazon": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"missingData": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"properties": {
|
|
183
|
+
"ratingCount": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"enum": [
|
|
186
|
+
"reject",
|
|
187
|
+
"skip"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"rating": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"enum": [
|
|
193
|
+
"reject",
|
|
194
|
+
"skip"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
"freeShipping": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"enum": [
|
|
200
|
+
"reject",
|
|
201
|
+
"skip"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"additionalProperties": false
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"additionalProperties": false
|
|
209
|
+
},
|
|
210
|
+
"mercadoLivre": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {
|
|
213
|
+
"missingData": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"properties": {
|
|
216
|
+
"ratingCount": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"enum": [
|
|
219
|
+
"reject",
|
|
220
|
+
"skip"
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"rating": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"enum": [
|
|
226
|
+
"reject",
|
|
227
|
+
"skip"
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"freeShipping": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"enum": [
|
|
233
|
+
"reject",
|
|
234
|
+
"skip"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"additionalProperties": false
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"additionalProperties": false
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"additionalProperties": false
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"required": [
|
|
248
|
+
"minRatingCount",
|
|
249
|
+
"minNormalizedRating",
|
|
250
|
+
"minDiscountFromBaseline",
|
|
251
|
+
"priceBaseline",
|
|
252
|
+
"freeShippingOnly",
|
|
253
|
+
"tieBreakers",
|
|
254
|
+
"search"
|
|
255
|
+
],
|
|
256
|
+
"additionalProperties": false
|
|
257
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "referral-source-integration.ref.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"oneOf": [
|
|
5
|
+
{
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"source": {
|
|
9
|
+
"const": "shopee"
|
|
10
|
+
},
|
|
11
|
+
"credentials": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"appId": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"secret": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"appId",
|
|
23
|
+
"secret"
|
|
24
|
+
],
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
},
|
|
27
|
+
"affiliateTag": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1
|
|
30
|
+
},
|
|
31
|
+
"defaultCommissionRate": {
|
|
32
|
+
"type": "number",
|
|
33
|
+
"minimum": 0,
|
|
34
|
+
"maximum": 1
|
|
35
|
+
},
|
|
36
|
+
"defaultDeliveryDays": {
|
|
37
|
+
"type": "integer",
|
|
38
|
+
"minimum": 0
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": [
|
|
42
|
+
"source",
|
|
43
|
+
"credentials"
|
|
44
|
+
],
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"source": {
|
|
51
|
+
"const": "amazon"
|
|
52
|
+
},
|
|
53
|
+
"credentials": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"properties": {
|
|
56
|
+
"credentialId": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"credentialSecret": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"version": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"marketplace": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": [
|
|
70
|
+
"credentialId",
|
|
71
|
+
"credentialSecret"
|
|
72
|
+
],
|
|
73
|
+
"additionalProperties": false
|
|
74
|
+
},
|
|
75
|
+
"affiliateTag": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"minLength": 1
|
|
78
|
+
},
|
|
79
|
+
"defaultCommissionRate": {
|
|
80
|
+
"type": "number",
|
|
81
|
+
"minimum": 0,
|
|
82
|
+
"maximum": 1
|
|
83
|
+
},
|
|
84
|
+
"defaultDeliveryDays": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": [
|
|
90
|
+
"source",
|
|
91
|
+
"credentials",
|
|
92
|
+
"affiliateTag"
|
|
93
|
+
],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "object",
|
|
98
|
+
"properties": {
|
|
99
|
+
"source": {
|
|
100
|
+
"const": "mercadoLivre"
|
|
101
|
+
},
|
|
102
|
+
"credentials": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"properties": {
|
|
105
|
+
"clientId": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"clientSecret": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
"mattTool": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"required": [
|
|
116
|
+
"clientId",
|
|
117
|
+
"clientSecret"
|
|
118
|
+
],
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
},
|
|
121
|
+
"affiliateTag": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"minLength": 1
|
|
124
|
+
},
|
|
125
|
+
"defaultCommissionRate": {
|
|
126
|
+
"type": "number",
|
|
127
|
+
"minimum": 0,
|
|
128
|
+
"maximum": 1
|
|
129
|
+
},
|
|
130
|
+
"defaultDeliveryDays": {
|
|
131
|
+
"type": "integer",
|
|
132
|
+
"minimum": 0
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": [
|
|
136
|
+
"source",
|
|
137
|
+
"credentials",
|
|
138
|
+
"affiliateTag"
|
|
139
|
+
],
|
|
140
|
+
"additionalProperties": false
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "scheduled-job.ref.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": { "type": "string", "enum": ["referralPriceSnapshot"] },
|
|
7
|
+
"cron": { "type": "string", "minLength": 1 },
|
|
8
|
+
"timezone": { "type": "string" }
|
|
9
|
+
},
|
|
10
|
+
"required": ["id", "cron"],
|
|
11
|
+
"additionalProperties": false
|
|
12
|
+
}
|