rapida-partner 3.1.0 → 3.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapida-partner",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "index.ts",
6
6
  "files": [
@@ -60,6 +60,26 @@ interface IMarketplace {
60
60
  // produtos (productId, price, isActive). Quando presente, o preço de venda
61
61
  // vem daqui e o backend calcula o valor do pedido; sem ele, usa product.price.
62
62
  productSellingSettingsEndpoint?: string;
63
+ // Workspace do vendedor (dono dos dados). A loja só lê produtos, preços e
64
+ // estoque desse workspace e grava nele as movimentações de estoque.
65
+ sellerWorkspaceId?: string;
66
+ // Identidade da loja como chamador confiável do vendedor (RFC 7523). O
67
+ // vendedor declara a mesma loja em IBackend.trustedCallers.
68
+ sellerServiceAuth?: ISellerServiceAuth;
69
+ // Campos fixos da saída de estoque gravada no vendedor a cada venda aprovada
70
+ // (ex.: stockOutType, hasSerialNumber, responsibleId da pessoa padrão).
71
+ stockOutDefaults?: Record<string, string | number | boolean>;
72
+ }
73
+
74
+ export interface ISellerServiceAuth {
75
+ // Valor da claim "iss"; deve bater com ITrustedCaller.issuer no vendedor.
76
+ issuer: string;
77
+ // Valor da claim "aud"; deve bater com ITrustedCaller.audience no vendedor.
78
+ audience: string;
79
+ // Chave privada RSA (PEM) com que a loja assina o token de serviço.
80
+ privateKey: string;
81
+ // "kid" publicado no JWKS da loja; padrão "store-key".
82
+ keyId?: string;
63
83
  }
64
84
 
65
85
  interface IService {
@@ -23,7 +23,10 @@ export interface IProject {
23
23
  description: string;
24
24
  businessPlan?: IBusinessPLan;
25
25
  businessRules?: IBusinessRule[];
26
- skeleton: "backoffice" | "marketplace" | "landingPage" | "socialNetwork" | "service" | "aiAgent";
26
+ // "ecommerce": loja de um único vendedor (o dono dos dados da instância).
27
+ // "marketplace": vários vendedores; enquanto a camada multivendedor não existe,
28
+ // o rapida-code-generator gera para os dois o mesmo núcleo de loja.
29
+ skeleton: "backoffice" | "ecommerce" | "marketplace" | "landingPage" | "socialNetwork" | "service" | "aiAgent";
27
30
  // Idiomas em que os textos TTranslatable (label, placeholder, tooltip, title)
28
31
  // são declarados. Sem languages, o projeto é monolíngue em defaultLanguage.
29
32
  languages?: TLanguage[];
@@ -105,7 +105,22 @@
105
105
  "stockInEndpoint": { "type": "string" },
106
106
  "stockOutEndpoint": { "type": "string" },
107
107
  "productBaseUrl": { "type": "string" },
108
- "productSellingSettingsEndpoint": { "type": "string" }
108
+ "productSellingSettingsEndpoint": { "type": "string" },
109
+ "sellerWorkspaceId": { "type": "string" },
110
+ "sellerServiceAuth": {
111
+ "type": "object",
112
+ "properties": {
113
+ "issuer": { "type": "string" },
114
+ "audience": { "type": "string" },
115
+ "privateKey": { "type": "string" },
116
+ "keyId": { "type": "string" }
117
+ },
118
+ "required": ["issuer", "audience", "privateKey"]
119
+ },
120
+ "stockOutDefaults": {
121
+ "type": "object",
122
+ "additionalProperties": { "type": ["string", "number", "boolean"] }
123
+ }
109
124
  },
110
125
  "required": ["paymentGateways", "productsAutocomplete", "stockInEndpoint", "stockOutEndpoint", "productBaseUrl"]
111
126
  },
@@ -16,6 +16,7 @@
16
16
  "type": "string",
17
17
  "enum": [
18
18
  "backoffice",
19
+ "ecommerce",
19
20
  "marketplace",
20
21
  "landingPage",
21
22
  "socialNetwork",