@wix/bex-utils 2.71.0 → 2.72.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.
Files changed (110) hide show
  1. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/builders.impl.d.ts +115 -0
  2. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/builders.impl.js +1340 -0
  3. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/builders.impl.js.map +1 -0
  4. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/http.impl.d.ts +29 -0
  5. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/http.impl.js +524 -0
  6. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/http.impl.js.map +1 -0
  7. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/meta.impl.d.ts +20 -0
  8. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/meta.impl.js +119 -0
  9. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/meta.impl.js.map +1 -0
  10. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/proto/client/proto-generated.d.ts +18874 -0
  11. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/proto/client/proto-generated.js +2 -0
  12. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/proto/proto-generated.d.ts +9468 -0
  13. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/proto/proto-generated.js +1 -0
  14. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/proto/server/proto-generated.d.ts +18788 -0
  15. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/proto/server/proto-generated.js +2 -0
  16. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/rpc.impl.d.ts +39 -0
  17. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/rpc.impl.js +113 -0
  18. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/rpc.impl.js.map +1 -0
  19. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/types.impl.d.ts +1248 -0
  20. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/types.impl.js +371 -0
  21. package/@wix/ambassador-dealer-v1-serving-offer/build/cjs/types.impl.js.map +1 -0
  22. package/@wix/ambassador-dealer-v1-serving-offer/build/es/builders.impl.d.ts +115 -0
  23. package/@wix/ambassador-dealer-v1-serving-offer/build/es/builders.impl.js +1209 -0
  24. package/@wix/ambassador-dealer-v1-serving-offer/build/es/builders.impl.js.map +1 -0
  25. package/@wix/ambassador-dealer-v1-serving-offer/build/es/http.impl.d.ts +29 -0
  26. package/@wix/ambassador-dealer-v1-serving-offer/build/es/http.impl.js +516 -0
  27. package/@wix/ambassador-dealer-v1-serving-offer/build/es/http.impl.js.map +1 -0
  28. package/@wix/ambassador-dealer-v1-serving-offer/build/es/meta.impl.d.ts +20 -0
  29. package/@wix/ambassador-dealer-v1-serving-offer/build/es/meta.impl.js +92 -0
  30. package/@wix/ambassador-dealer-v1-serving-offer/build/es/meta.impl.js.map +1 -0
  31. package/@wix/ambassador-dealer-v1-serving-offer/build/es/rpc.impl.d.ts +39 -0
  32. package/@wix/ambassador-dealer-v1-serving-offer/build/es/rpc.impl.js +86 -0
  33. package/@wix/ambassador-dealer-v1-serving-offer/build/es/rpc.impl.js.map +1 -0
  34. package/@wix/ambassador-dealer-v1-serving-offer/build/es/types.impl.d.ts +1248 -0
  35. package/@wix/ambassador-dealer-v1-serving-offer/build/es/types.impl.js +368 -0
  36. package/@wix/ambassador-dealer-v1-serving-offer/build/es/types.impl.js.map +1 -0
  37. package/@wix/ambassador-dealer-v1-serving-offer/builders/package.json +7 -0
  38. package/@wix/ambassador-dealer-v1-serving-offer/http/package.json +7 -0
  39. package/@wix/ambassador-dealer-v1-serving-offer/meta/package.json +7 -0
  40. package/@wix/ambassador-dealer-v1-serving-offer/package.json +52 -0
  41. package/@wix/ambassador-dealer-v1-serving-offer/rpc/package.json +6 -0
  42. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/abtest/v2/experiment_properties.proto +46 -0
  43. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/abtest/v2/experiment_results.proto +39 -0
  44. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/abtest/v2/experiment_support_kpis.proto +29 -0
  45. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/abtest/v2/experiments_properties_thin.proto +31 -0
  46. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/abtest/v2/wixab_service.proto +81 -0
  47. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/action_payload.proto +33 -0
  48. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/annotations.proto +451 -0
  49. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/api_errors.proto +142 -0
  50. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/callback.proto +163 -0
  51. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/context.proto +19 -0
  52. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/entity.proto +127 -0
  53. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/errors.proto +127 -0
  54. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/idempotency.proto +25 -0
  55. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/permissions.proto +46 -0
  56. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/sla.proto +24 -0
  57. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/subscription.proto +32 -0
  58. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/api/validations.proto +142 -0
  59. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/address.proto +148 -0
  60. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/bulk.proto +53 -0
  61. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/data/dataextensions/extended-fields.proto +20 -0
  62. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/data/dataextensions/update-extended-fields-messages.proto +15 -0
  63. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/data/errors.proto +435 -0
  64. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/identification.proto +40 -0
  65. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/image.proto +8 -0
  66. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/media.proto +280 -0
  67. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/money.proto +32 -0
  68. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/pageurl.proto +32 -0
  69. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/paging.proto +121 -0
  70. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/query.proto +812 -0
  71. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/sorting.proto +36 -0
  72. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/spi.proto +85 -0
  73. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/tags.proto +55 -0
  74. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/common/wixlink.proto +203 -0
  75. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/audiences.proto +226 -0
  76. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/campaigns.proto +270 -0
  77. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/frequency-caps.proto +74 -0
  78. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/localization-managers.proto +11 -0
  79. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/managers.proto +11 -0
  80. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/offer-test.proto +338 -0
  81. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/offer.proto +298 -0
  82. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/offers-service.proto +696 -0
  83. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/placements.proto +423 -0
  84. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/schemas-service.proto +142 -0
  85. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/targeting.proto +378 -0
  86. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/upstream/wix/common/paging.proto +126 -0
  87. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/upstream/wix/common/query.proto +840 -0
  88. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerBackoffice/api/v1/upstream/wix/common/sorting.proto +37 -0
  89. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerOffersServing/api/v1/dealer-offers-debug.proto +188 -0
  90. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerOffersServing/api/v1/dealer-offers-serving.proto +177 -0
  91. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerOffersServing/api/v1/offer.proto +87 -0
  92. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerPriority/api/v1/priority-service.proto +57 -0
  93. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/dealerPriority/api/v1/priority.proto +132 -0
  94. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/graphql/definitions.proto +13 -0
  95. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/http/field_mask.proto +46 -0
  96. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/optimization_test/v1/optimization_tester_service.proto +284 -0
  97. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/optimization_test/v1/test.proto +170 -0
  98. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/optimization_test/v1/upstream/wix/common/bulk.proto +56 -0
  99. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/optimization_test/v1/upstream/wix/common/paging.proto +121 -0
  100. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/optimization_test/v1/upstream/wix/common/query.proto +741 -0
  101. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/optimization_test/v1/upstream/wix/common/sorting.proto +26 -0
  102. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/targeting/v1/targeting.proto +406 -0
  103. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/targeting/v1/targeting_service.proto +247 -0
  104. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/variants_generator/v1/variant.proto +92 -0
  105. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/personalize/variants_generator/v1/variants_generator_service.proto +73 -0
  106. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/sdk/definitions.proto +191 -0
  107. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/spi/definitions.proto +187 -0
  108. package/@wix/ambassador-dealer-v1-serving-offer/src/main/proto/wix/spi/http_error_status.proto +24 -0
  109. package/@wix/ambassador-dealer-v1-serving-offer/types/package.json +7 -0
  110. package/package.json +5 -4
@@ -0,0 +1,696 @@
1
+ syntax = "proto3";
2
+
3
+ package wix.dealerBackoffice.api.v1;
4
+
5
+ import "google/api/annotations.proto";
6
+ import "google/protobuf/wrappers.proto";
7
+ import "google/protobuf/struct.proto";
8
+ import "wix/api/callback.proto";
9
+
10
+ import "wix/api/annotations.proto";
11
+ import "wix/api/validations.proto";
12
+ import "wix/api/permissions.proto";
13
+ import "wix/api/sla.proto";
14
+ import "wix/api/api_errors.proto";
15
+ import "wix/api/entity.proto";
16
+ import "wix/common/query.proto";
17
+ import "wix/common/paging.proto";
18
+
19
+ import "wix/dealerBackoffice/api/v1/offer.proto";
20
+ import "wix/personalize/targeting/v1/targeting.proto";
21
+
22
+ option java_package = "com.wix.dealerBackoffice.api.v1";
23
+
24
+ // Endpoint responsible for managing key dealer entites — offers.
25
+ service OfferService {
26
+ option (wix.api.service_entity).message = "wix.dealerBackoffice.api.v1.Offer";
27
+ option (wix.api.service_maturity) = ALPHA;
28
+ option (wix.api.service_exposure) = INTERNAL;
29
+
30
+ // Get single offer
31
+ // GrpcStatus.NOT_FOUND is thrown if requested offer is not found in DB
32
+ rpc GetOffer (GetOfferRequest) returns (GetOfferResponse) {
33
+ option (google.api.http).get = "/v1/dealer/backoffice/offers/{offer_id}";
34
+ option (wix.api.required) = "GetOfferRequest.offer_id";
35
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.READ_OFFER";
36
+ option (wix.api.crud) = {
37
+ method: GET_ITEM
38
+ get_options: {
39
+ id_field: "offer_id",
40
+ item_field: "offer"
41
+ }
42
+ };
43
+ }
44
+
45
+ // Get bulk offers
46
+ // No exceptions are thrown if some/all offers were not found.
47
+ // Worst case scenario (no offers are found by provided offerId list) — you get empty offers array.
48
+ rpc GetOffersBulk (GetOffersBulkRequest) returns (GetOffersBulkResponse) {
49
+ option (google.api.http) = {
50
+ post: "/v1/dealer/backoffice/offers/bulk"
51
+ additional_bindings: {
52
+ get: "/v1/dealer/backoffice/offers/bulk"
53
+ }
54
+ };
55
+ option (wix.api.required) = "GetOffersBulkRequest.offer_ids";
56
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.READ_OFFER";
57
+ }
58
+
59
+ // Query offers by status/campaign/placement/audience.
60
+ rpc QueryOffers (QueryOffersRequest) returns (QueryOffersResponse) {
61
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/query";
62
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.READ_OFFER";
63
+ }
64
+
65
+ rpc CreateOffer (CreateOfferRequest) returns (CreateOfferResponse) {
66
+ option (google.api.http).post = "/v1/dealer/backoffice/offers";
67
+ option (wix.api.required) = "CreateOfferRequest.offer.name";
68
+ option (wix.api.required) = "CreateOfferRequest.offer.asset";
69
+ option (wix.api.required) = "CreateOfferRequest.offer.placement_id";
70
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.CREATE_OFFER";
71
+ option (wix.api.crud) = {
72
+ method: CREATE
73
+ create_options: {
74
+ item_field: "offer"
75
+ }
76
+ };
77
+ option (wix.api.callback) = {
78
+ event_type: CREATED
79
+ };
80
+
81
+ option (wix.api.error) = {
82
+ http_code: NOT_FOUND
83
+ application_code: "OFFER_PLACEMENT_NOT_FOUND"
84
+ };
85
+
86
+ option (wix.api.error) = {
87
+ http_code: NOT_FOUND
88
+ application_code: "OFFER_CAMPAIAGN_NOT_FOUND"
89
+ };
90
+
91
+ option (wix.api.error) = {
92
+ http_code: FAILED_PRECONDITION
93
+ application_code: "PLACEMENT_SLUG_EMPTY"
94
+ };
95
+
96
+ option (wix.api.error) = {
97
+ http_code: INTERNAL
98
+ application_code: "TRANSLATOR_API_ERROR"
99
+ };
100
+
101
+ option (wix.api.error) = {
102
+ http_code: FAILED_PRECONDITION
103
+ application_code: "PLACEMENT_SCHEMA_MISSING"
104
+ };
105
+
106
+ option (wix.api.error) = {
107
+ http_code: INVALID_ARGUMENT
108
+ application_code: "LOCALIZED_CONTENT_ENGLISH_LANGUAGE_MISSING"
109
+ };
110
+
111
+ option (wix.api.error) = {
112
+ http_code: INVALID_ARGUMENT
113
+ application_code: "LOCALIZED_CONTENT_NON_ENGLISH_LANGUAGES"
114
+ };
115
+
116
+ option (wix.api.error) = {
117
+ http_code: ALREADY_EXISTS
118
+ application_code: "OFFER_SLUG_ALREADY_EXISTS"
119
+ };
120
+
121
+ option (wix.api.error) = {
122
+ http_code: FAILED_PRECONDITION
123
+ application_code: "OFFER_SLUG_EMPTY"
124
+ };
125
+
126
+ option (wix.api.error) = {
127
+ http_code: NOT_FOUND
128
+ application_code: "UNDER_OFFER_NOT_FOUND"
129
+ };
130
+
131
+ option (wix.api.error) = {
132
+ http_code: FAILED_PRECONDITION
133
+ application_code: "UNDER_OFFER_ILLEGAL"
134
+ };
135
+
136
+ option (wix.api.error) = {
137
+ http_code: FAILED_PRECONDITION
138
+ application_code: "OFFER_CREATIVE_READ_ONLY"
139
+ };
140
+ }
141
+
142
+ rpc DeleteOffer(DeleteOfferRequest) returns (DeleteOfferResponse) {
143
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
144
+ option (google.api.http).delete = "/v1/dealer/backoffice/offers/{offer_id}";
145
+ option (wix.api.required) = "DeleteOfferRequest.offer_id";
146
+ }
147
+
148
+ // Full offer update. Fields that are not set will be overwritten with empty values
149
+ rpc UpdateOffer (UpdateOfferRequest) returns (UpdateOfferResponse) {
150
+ option (google.api.http).put = "/v1/dealer/backoffice/offers";
151
+ option (wix.api.required) = "UpdateOfferRequest.offer.guid";
152
+ option (wix.api.required) = "UpdateOfferRequest.offer.name";
153
+ option (wix.api.required) = "UpdateOfferRequest.offer.asset";
154
+ option (wix.api.required) = "UpdateOfferRequest.offer.placement_id";
155
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
156
+ option (wix.api.callback) = {
157
+ event_type: UPDATED
158
+ };
159
+
160
+ option (wix.api.error) = {
161
+ http_code: INTERNAL
162
+ application_code: "TRANSLATOR_API_ERROR"
163
+ };
164
+
165
+ option (wix.api.error) = {
166
+ http_code: FAILED_PRECONDITION
167
+ application_code: "PLACEMENT_SLUG_EMPTY"
168
+ };
169
+
170
+ option (wix.api.error) = {
171
+ http_code: FAILED_PRECONDITION
172
+ application_code: "CREATE_ASSET_AB_TEST_ON_LIVE_OFFER"
173
+ };
174
+
175
+ option (wix.api.error) = {
176
+ http_code: FAILED_PRECONDITION
177
+ application_code: "OFFER_CAMPAIGN_UPDATE"
178
+ };
179
+
180
+ option (wix.api.error) = {
181
+ http_code: FAILED_PRECONDITION
182
+ application_code: "OFFER_PLACEMENT_UPDATE"
183
+ };
184
+
185
+ option (wix.api.error) = {
186
+ http_code: FAILED_PRECONDITION
187
+ application_code: "OFFER_MERGE_ASSET_AB_TEST_WITH_UPDATE"
188
+ };
189
+
190
+ option (wix.api.error) = {
191
+ http_code: FAILED_PRECONDITION
192
+ application_code: "MUTATE_ARCHIVED_OFFER"
193
+ };
194
+
195
+ option (wix.api.error) = {
196
+ http_code: FAILED_PRECONDITION
197
+ application_code: "PLACEMENT_SCHEMA_MISSING"
198
+ };
199
+
200
+ option (wix.api.error) = {
201
+ http_code: FAILED_PRECONDITION
202
+ application_code: "LOCALIZED_CONTENT_ENGLISH_LANGUAGE_MISSING"
203
+ };
204
+
205
+ option (wix.api.error) = {
206
+ http_code: FAILED_PRECONDITION
207
+ application_code: "LOCALIZED_CONTENT_NON_ENGLISH_LANGUAGES"
208
+ };
209
+
210
+ option (wix.api.error) = {
211
+ http_code: FAILED_PRECONDITION
212
+ application_code: "OFFER_SLUG_EMPTY"
213
+ };
214
+
215
+ option (wix.api.error) = {
216
+ http_code: FAILED_PRECONDITION
217
+ application_code: "OFFER_CREATIVE_READ_ONLY"
218
+ };
219
+ }
220
+
221
+ // Update offer frequencyCapsConfig. Fields that are not set will be overwritten with empty values
222
+ rpc SetFrequencyCaps (SetFrequencyCapsRequest) returns (SetFrequencyCapsResponse) {
223
+ option (google.api.http).put = "/v1/dealer/backoffice/offers/{offer_id}/frequency-caps";
224
+ option (wix.api.required) = "SetFrequencyCapsRequest.offer_id";
225
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
226
+ }
227
+
228
+ // Update offer slug
229
+ rpc UpdateSlug (UpdateSlugRequest) returns (UpdateSlugResponse) {
230
+ option (google.api.http).put = "/v1/dealer/backoffice/offers/{offer_id}/update-slug";
231
+ option (wix.api.required) = "UpdateSlugRequest.offer_id";
232
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
233
+ }
234
+
235
+ // Connect offer to campaign and put last in priority
236
+ rpc ConnectCampaign (ConnectCampaignRequest) returns (ConnectCampaignResponse) {
237
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/connect-campaign";
238
+ option (wix.api.required) = "ConnectCampaignRequest.offer_id";
239
+ option (wix.api.required) = "ConnectCampaignRequest.campaign_id";
240
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
241
+
242
+
243
+ option (wix.api.error) = {
244
+ http_code: NOT_FOUND
245
+ application_code: "OFFER_CAMPAIAGN_NOT_FOUND"
246
+ };
247
+ }
248
+
249
+ // Disconnect offer from campaign and put last in priority
250
+ rpc DisconnectCampaign (DisconnectCampaignRequest) returns (DisconnectCampaignResponse) {
251
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/disconnect-campaign";
252
+ option (wix.api.required) = "DisconnectCampaignRequest.offer_id";
253
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
254
+
255
+
256
+ option (wix.api.error) = {
257
+ http_code: FAILED_PRECONDITION
258
+ application_code: "OFFER_NOT_CONNECTED_TO_CAMPAIGN"
259
+ };
260
+ }
261
+
262
+ // Make offer LIVE
263
+ rpc ActivateOffer (StatusOfferRequest) returns (StatusOfferResponse) {
264
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/activate";
265
+ option (wix.api.required) = "StatusOfferRequest.offer_id";
266
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
267
+
268
+ option (wix.api.error) = {
269
+ http_code: FAILED_PRECONDITION
270
+ application_code: "MUTATE_ARCHIVED_OFFER"
271
+ };
272
+
273
+ option (wix.api.error) = {
274
+ http_code: FAILED_PRECONDITION
275
+ application_code: "ACTIVATE_OFFER_WITHOUT_BRAND_FILTER"
276
+ };
277
+
278
+ option (wix.api.error) = {
279
+ http_code: FAILED_PRECONDITION
280
+ application_code: "ACTIVATE_OFFER_WITHOUT_ASSET"
281
+ };
282
+ }
283
+
284
+ // Make offer PAUSED
285
+ rpc DeactivateOffer (StatusOfferRequest) returns (StatusOfferResponse) {
286
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/deactivate";
287
+ option (wix.api.required) = "StatusOfferRequest.offer_id";
288
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
289
+
290
+
291
+ option (wix.api.error) = {
292
+ http_code: FAILED_PRECONDITION
293
+ application_code: "MUTATE_ARCHIVED_OFFER"
294
+ };
295
+
296
+ option (wix.api.error) = {
297
+ http_code: FAILED_PRECONDITION
298
+ application_code: "PAUSE_LIVE_OFFER_ASSET_AB_TEST"
299
+ };
300
+ }
301
+
302
+ // Make offer ARCHIVED. Warning there's no way to unarchive an offer once it's archived.
303
+ rpc ArchiveOffer (StatusOfferRequest) returns (StatusOfferResponse) {
304
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/archive";
305
+ option (wix.api.required) = "StatusOfferRequest.offer_id";
306
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
307
+ option (wix.api.callback) = {
308
+ event_type: ACTION
309
+ payload: "wix.dealerBackoffice.api.v1.OfferOperationEvent"
310
+ };
311
+ }
312
+
313
+ rpc CopyOffers (CopyOffersRequest) returns (CopyOffersResponse) {
314
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/copy-offers";
315
+ option (wix.api.required) = "CopyOffersRequest.copy_offers_params";
316
+ option (wix.api.required) = "CopyOffersRequest.target_placement_id";
317
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.COPY_OFFERS";
318
+ option (wix.api.sla).response_time_ms = 30000;
319
+
320
+ option (wix.api.error) = {
321
+ http_code: INVALID_ARGUMENT
322
+ application_code: "MISSING_REQUIRED_FIELDS"
323
+ };
324
+
325
+ option (wix.api.error) = {
326
+ http_code: FAILED_PRECONDITION
327
+ application_code: "SAME_SOURCE_AND_TARGET_PLACEMENT"
328
+ };
329
+
330
+ }
331
+
332
+ // Make offer IN_REVIEW.
333
+ rpc SubmitOfferForReview (StatusOfferRequest) returns (StatusOfferResponse) {
334
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/review";
335
+ option (wix.api.required) = "StatusOfferRequest.offer_id";
336
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
337
+
338
+ option (wix.api.error) = {
339
+ http_code: FAILED_PRECONDITION
340
+ application_code: "NOT_PAUSED_OFFER_IN_REVIEW"
341
+ };
342
+ }
343
+
344
+ rpc RestoreOffer (StatusOfferRequest) returns (StatusOfferResponse) {
345
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/restore";
346
+ option (wix.api.required) = "StatusOfferRequest.offer_id";
347
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
348
+ }
349
+
350
+ // Change priorities of given offer ids. All offers must belong to same placement.
351
+ rpc PrioritizeOffers (PrioritizeOffersRequest) returns (PrioritizeOffersResponse) {
352
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/prioritize";
353
+ option (wix.api.required) = "PrioritizeOffersRequest.offer_ids";
354
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
355
+ option (wix.api.error) = {
356
+ http_code: FAILED_PRECONDITION
357
+ application_code: "OFFER_IN_MORE_THEN_ONE_PLACEMENT"
358
+ };
359
+
360
+ option (wix.api.error) = {
361
+ http_code: FAILED_PRECONDITION
362
+ application_code: "PRIORITIZE_ARCHIVED_OFFERS"
363
+ };
364
+ }
365
+
366
+ // Convert A/B test asset offer to regular single asset offer
367
+ rpc MergeAssetAbTest (MergeAssetAbTestRequest) returns (MergeAssetAbTestResponse) {
368
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/merge-asset-abtest";
369
+ option (wix.api.required) = "MergeAssetAbTestRequest.offer_id";
370
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
371
+ option (wix.api.error) = {
372
+ http_code: FAILED_PRECONDITION
373
+ application_code: "MERGE_OFFER_ASSET_WITHOUT_AB_TEST"
374
+ };
375
+ }
376
+
377
+ // Send offer to translations
378
+ //flynt-disable required-annotation-breaking-change
379
+ rpc SendOfferToTranslation (SendOfferToTranslationRequest) returns (SendOfferToTranslationResponse) {
380
+ option (google.api.http).post = "/v1/dealer/backoffice/offers/{offer_id}/send-to-translation";
381
+ option (wix.api.required) = "SendOfferToTranslationRequest.offer_id";
382
+ option (wix.api.required) = "SendOfferToTranslationRequest.languages";
383
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
384
+
385
+ option (wix.api.error) = {
386
+ http_code: FAILED_PRECONDITION
387
+ application_code: "OFFER_TRANSLATION_PLACEMENT_NOT_TRANSLATABLE"
388
+ };
389
+
390
+ option (wix.api.error) = {
391
+ http_code: FAILED_PRECONDITION
392
+ application_code: "OFFER_TRANSLATION_ENGLISH_TRANSLATION_DOES_NOT_EXIST"
393
+ };
394
+
395
+
396
+ option (wix.api.error) = {
397
+ http_code: FAILED_PRECONDITION
398
+ application_code: "OFFER_TRANSLATION_ENGLISH_TRANSLATION_REQUESTED"
399
+ };
400
+
401
+ option (wix.api.error) = {
402
+ http_code: FAILED_PRECONDITION
403
+ application_code: "OFFER_CREATIVE_READ_ONLY"
404
+ };
405
+ }
406
+
407
+ // List all offers owners ids
408
+ rpc ListOffersOwnersIds (ListOfferOwnersIdsRequest) returns (ListOfferOwnersIdsResponse) {
409
+ option (google.api.http).get = "/v1/dealer/backoffice/offers/owners";
410
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.READ_OFFER";
411
+ };
412
+
413
+ // Update offer creative - updates offer's asset.localizedContent only - does not update other asset fields
414
+ rpc UpdateCreative (UpdateCreativeRequest) returns (UpdateCreativeResponse) {
415
+ option (google.api.http).put = "/v1/dealer/backoffice/offers/{offer_id}/update-creative";
416
+ option (wix.api.required) = "UpdateCreativeRequest.offer_id";
417
+ option (wix.api.required) = "UpdateCreativeRequest.creative";
418
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
419
+ }
420
+
421
+ // Migrate function to run internal migrations on offers
422
+ rpc Migrate (MigrateRequest) returns (MigrateResponse) {
423
+ option (wix.api.required) = "MigrateRequest.offer_id";
424
+ option (wix.api.permission).name = "DEALER_BACKOFFICE.UPDATE_OFFER";
425
+ }
426
+ }
427
+
428
+ message SendOfferToTranslationRequest {
429
+ string offer_id = 1 [(wix.api.format) = GUID];
430
+ repeated string languages = 2 [(wix.api.format) = LANGUAGE_TAG];
431
+ repeated string localization_managers_ids = 3 [(wix.api.format) = GUID];
432
+ string notes = 4;
433
+ }
434
+
435
+ message SendOfferToTranslationResponse {
436
+ }
437
+
438
+ message GetOfferRequest {
439
+ string offer_id = 1 [(wix.api.format) = GUID];
440
+ }
441
+
442
+ message GetOffersBulkRequest {
443
+ repeated string offer_ids = 1 [(wix.api.format) = GUID];
444
+ }
445
+
446
+ message GetOffersBulkResponse {
447
+ repeated Offer offers = 1;
448
+ }
449
+
450
+ message GetOfferResponse {
451
+ Offer offer = 1;
452
+ }
453
+
454
+ message CreateOfferRequest {
455
+ Offer offer = 1;
456
+
457
+ // Optional = default will be to priotize last in placement or if campaign id is passed then last in campaign
458
+ CreateOfferPriorityOverrides priority_overrides = 2;
459
+ }
460
+
461
+ message CreateOfferPriorityOverrides {
462
+ oneof priority_override {
463
+ UnderOffer under_offer = 1;
464
+ }
465
+
466
+ message UnderOffer {
467
+ string offer_id = 1 [(wix.api.format) = GUID];
468
+ }
469
+ }
470
+
471
+ message CreateOfferResponse {
472
+ Offer offer = 1;
473
+ }
474
+
475
+ message UpdateOfferRequest {
476
+ Offer offer = 1;
477
+ }
478
+
479
+ message UpdateOfferResponse {
480
+ Offer offer = 1;
481
+ }
482
+
483
+ message UpdateSlugRequest {
484
+ google.protobuf.StringValue offer_id = 1 [(wix.api.format) = GUID, (wix.api.readOnly) = true];
485
+ google.protobuf.StringValue slug = 2 [(wix.api.minLength) = 1];
486
+ }
487
+
488
+ message UpdateSlugResponse {
489
+ }
490
+
491
+
492
+ // Supported queries:
493
+ //
494
+ // filter:
495
+ // query: { filter: { guid: '<uuid>'}}
496
+ // query: { filter: { status: 'ACTIVE'}}
497
+ // query: { filter: { placementId: '<uuid>'}}
498
+ // query: { filter: { placementId: '<uuid>', status: 'DRAFT'}}
499
+ // query: { filter: { campaignId: '<uuid>'}}
500
+ // query: { filter: { campaignId: '<uuid>', status: 'ACTIVE'}}
501
+ // query: { filter: { audienceIds: { $hasSome: ['<uuid>']}}}
502
+ // query: { filter: { createdBy: '<uuid>'}
503
+ // query: { filter: { createdBy: { $in: ['<uuid>', '<uuid>']}}}
504
+ // query: { filter: { updatedBy: '<uuid>'}
505
+ // query: { filter: { updatedBy: { $in: ['<uuid>', '<uuid>']}}}
506
+ // query: { filter: { managersIds: { $hasSome: ['<uuid>']}}}
507
+ // query: { filter: { name: 'exact name' }}
508
+ // query: { filter: { name: { $contains: '<string>'}}}
509
+ // query: { filter: { placementName: 'exact name' }}
510
+ // query: { filter: { placementName: { $contains: '<string>'}}}
511
+ // query: { filter: { placementId: { $in: ['<uuid>']}}}
512
+ // query: { filter: { status: { $in: ['<uuid>']}}}
513
+ // query: { filter: { languages: { $hasSome: ['<uuid>']}}}
514
+ // query: { filter: { inABTest: '<boolean'>}
515
+ // query: { filter: { inABTest: true}
516
+ // query: { filter: { $or: [{ createdBy: '<uuid>' }, { updatedBy: '<uuid>' }, { managersIds: { $hasSome: ['<uuid>', '<uuid>'] }}]}}
517
+ /** query: { filter: {
518
+ $and: [
519
+ {
520
+ $or: [{ status: OfferStatus.LIVE }, { audienceIds: { $hasSome: ['<uuid>'] } }],
521
+ },
522
+ { createdBy: { $in: ['<uuid>', '<uuid>'] } },
523
+ { placementId: '<uuid>' },
524
+ {
525
+ $or: [
526
+ { campaignId: '<uuid>' },
527
+ { managersIds: { $hasSome: ['<uuid>', '<uuid>'] } },
528
+ ],
529
+ },
530
+ ],
531
+ },
532
+ **/
533
+ //
534
+ // fields masks:
535
+ // query: { fieldsets: ["relationsOnly"] } — return offer objects projections with only guid, campaignId, placementId props set
536
+ //
537
+ // By default (no 'fieldsets" provided) full offer objects are returned
538
+ //
539
+ // paging:
540
+ // query: { paging: { limit: '<int>', offset: '<int>' }}
541
+ //
542
+ // sort:
543
+ // query: { sort: [ { fieldName: string, order: 'ASC' | 'DESC' } ] }
544
+ // query: { sort: [ { fieldName: 'dateUpdated', order: 'ASC' } ] }
545
+ //
546
+
547
+ message QueryOffersRequest {
548
+ wix.common.Query query = 1;
549
+ }
550
+
551
+ // List of offers returned from query with paging metadata
552
+ message QueryOffersResponse {
553
+ repeated Offer offers = 1;
554
+ wix.common.PagingMetadata paging_metadata = 2;
555
+ }
556
+
557
+
558
+ message CopyOffersRequest {
559
+ string target_placement_id = 1 [(wix.api.format) = GUID];
560
+ CopyOffersParams copy_offers_params = 2;
561
+ }
562
+
563
+ message CopyOffersResponse {
564
+ repeated FailedOfferCopy failed = 1;
565
+ int32 successful = 2;
566
+ }
567
+
568
+
569
+ // Connect an offer to a campagin (and optionally modify offer priority)
570
+ message ConnectCampaignRequest {
571
+ string offer_id = 1 [(wix.api.format) = GUID];
572
+ string campaign_id = 2 [(wix.api.format) = GUID];
573
+
574
+ // when true priority of an offer in campaign wont change
575
+ // if false or null then offer will become last in campaign
576
+ google.protobuf.BoolValue keep_priority = 3;
577
+ }
578
+
579
+ message ConnectCampaignResponse {
580
+ }
581
+
582
+ // Disconnect an offer from a campagin (and optionally modify offer priority)
583
+ message DisconnectCampaignRequest {
584
+ string offer_id = 1 [(wix.api.format) = GUID];
585
+
586
+ // when true priority of offer in campaign wont change if false or null then offer will be after last offer in campaign
587
+ google.protobuf.BoolValue keep_priority = 3;
588
+ }
589
+
590
+ message DisconnectCampaignResponse {
591
+ }
592
+
593
+ // Merge a/b test assets to one
594
+ message MergeAssetAbTestRequest {
595
+ string offer_id = 1 [(wix.api.format) = GUID];
596
+
597
+ // Which asset should be the one - A or B
598
+ AbTestWinner winner = 2;
599
+
600
+ enum AbTestWinner {
601
+ UNKNOWN = 0;
602
+ A = 1;
603
+ B = 2;
604
+ }
605
+ }
606
+
607
+ message MergeAssetAbTestResponse {
608
+ }
609
+
610
+ // Request to prioritize offers that belong to the same placement.
611
+ // Can contain a subset of the offers and it will keep rest of order in placement
612
+ message PrioritizeOffersRequest {
613
+ repeated string offer_ids = 1 [(wix.api.format) = GUID, (wix.api.minSize) = 2];
614
+ }
615
+
616
+ message PrioritizeOffersResponse {
617
+ }
618
+
619
+ // Which offer's status to update
620
+ message StatusOfferRequest {
621
+ string offer_id = 1 [(wix.api.format) = GUID];
622
+ }
623
+
624
+ // Current offer calculated status after status update action
625
+ message StatusOfferResponse {
626
+ Offer.Status status = 1 [(wix.api.readOnly) = true];
627
+ }
628
+
629
+ // Update offer frequency caps
630
+ message SetFrequencyCapsRequest {
631
+ string offer_id = 1 [(wix.api.format) = GUID];
632
+ Offer.FrequencyCapsConfig frequency_caps_config = 2;
633
+ }
634
+
635
+ message SetFrequencyCapsResponse {
636
+ Offer offer = 1;
637
+ }
638
+
639
+ message ListOfferOwnersIdsRequest {
640
+ }
641
+
642
+ message ListOfferOwnersIdsResponse {
643
+ repeated string owner_ids = 1 [(wix.api.format) = GUID];
644
+ }
645
+
646
+ message CopyOffersParams {
647
+ oneof copy_params {
648
+ string source_placement_id = 1 [(wix.api.format) = GUID];
649
+ OffersToCopy offers = 2;
650
+ }
651
+ }
652
+
653
+ message OffersToCopy {
654
+ repeated string offers_ids = 1 [(wix.api.format) = GUID, (wix.api.maxSize) = 500];
655
+ }
656
+
657
+ message FailedOfferCopy {
658
+ string offer_id = 1 [(wix.api.format) = GUID];
659
+ }
660
+
661
+ message DeleteOfferRequest {
662
+ google.protobuf.StringValue offer_id = 1 [(wix.api.format) = GUID, (wix.api.readOnly) = true];
663
+ }
664
+ message DeleteOfferResponse {}
665
+
666
+ message UpdateCreativeRequest {
667
+ google.protobuf.StringValue offer_id = 1 [(wix.api.format) = GUID];
668
+ // the creative Struct field is matching the offers asset.localizedContent english content
669
+ google.protobuf.Struct creative = 2;
670
+ }
671
+
672
+ message UpdateCreativeResponse {
673
+ Offer offer = 1;
674
+ }
675
+
676
+ message MigrateRequest {
677
+ // offer id to migrate targeting
678
+ string offer_id = 1 [(wix.api.format) = GUID, (wix.api.readOnly) = true];
679
+
680
+ // migrate type -
681
+ MigrateType migrate_type = 2;
682
+
683
+ enum MigrateType {
684
+ UNKNOWN = 0;
685
+ // TARGETING_V1_MIGRATION - migrate targeting from v1 to v2
686
+ TARGETING_V1_MIGRATION = 1;
687
+ // DYNAMIC_PARAMS_MIGRATION - migrate dynamic params to contain bi level
688
+ DYNAMIC_PARAMS_MIGRATION = 2;
689
+ }
690
+
691
+ // Struct payload for migration
692
+ google.protobuf.Struct payload = 3;
693
+ }
694
+
695
+ message MigrateResponse {
696
+ }