@wix/bex-utils 2.78.0 → 2.80.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 (75) hide show
  1. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/builders.impl.d.ts +22 -0
  2. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/builders.impl.js +275 -0
  3. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/builders.impl.js.map +1 -0
  4. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/http.impl.d.ts +50 -0
  5. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/http.impl.js +250 -0
  6. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/http.impl.js.map +1 -0
  7. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/meta.impl.d.ts +16 -0
  8. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/meta.impl.js +81 -0
  9. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/meta.impl.js.map +1 -0
  10. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/client/proto-generated.d.ts +7116 -0
  11. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/client/proto-generated.js +2 -0
  12. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/proto-generated.d.ts +3557 -0
  13. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/proto-generated.js +1 -0
  14. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/server/proto-generated.d.ts +7113 -0
  15. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/server/proto-generated.js +2 -0
  16. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/rpc.impl.d.ts +59 -0
  17. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/rpc.impl.js +109 -0
  18. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/rpc.impl.js.map +1 -0
  19. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/types.impl.d.ts +343 -0
  20. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/types.impl.js +42 -0
  21. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/types.impl.js.map +1 -0
  22. package/@wix/ambassador-dealer-v1-offer-event/build/es/builders.impl.d.ts +22 -0
  23. package/@wix/ambassador-dealer-v1-offer-event/build/es/builders.impl.js +239 -0
  24. package/@wix/ambassador-dealer-v1-offer-event/build/es/builders.impl.js.map +1 -0
  25. package/@wix/ambassador-dealer-v1-offer-event/build/es/http.impl.d.ts +50 -0
  26. package/@wix/ambassador-dealer-v1-offer-event/build/es/http.impl.js +244 -0
  27. package/@wix/ambassador-dealer-v1-offer-event/build/es/http.impl.js.map +1 -0
  28. package/@wix/ambassador-dealer-v1-offer-event/build/es/meta.impl.d.ts +16 -0
  29. package/@wix/ambassador-dealer-v1-offer-event/build/es/meta.impl.js +56 -0
  30. package/@wix/ambassador-dealer-v1-offer-event/build/es/meta.impl.js.map +1 -0
  31. package/@wix/ambassador-dealer-v1-offer-event/build/es/rpc.impl.d.ts +59 -0
  32. package/@wix/ambassador-dealer-v1-offer-event/build/es/rpc.impl.js +84 -0
  33. package/@wix/ambassador-dealer-v1-offer-event/build/es/rpc.impl.js.map +1 -0
  34. package/@wix/ambassador-dealer-v1-offer-event/build/es/types.impl.d.ts +343 -0
  35. package/@wix/ambassador-dealer-v1-offer-event/build/es/types.impl.js +39 -0
  36. package/@wix/ambassador-dealer-v1-offer-event/build/es/types.impl.js.map +1 -0
  37. package/@wix/ambassador-dealer-v1-offer-event/builders/package.json +7 -0
  38. package/@wix/ambassador-dealer-v1-offer-event/http/package.json +7 -0
  39. package/@wix/ambassador-dealer-v1-offer-event/meta/package.json +7 -0
  40. package/@wix/ambassador-dealer-v1-offer-event/package.json +52 -0
  41. package/@wix/ambassador-dealer-v1-offer-event/rpc/package.json +6 -0
  42. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/action_payload.proto +33 -0
  43. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/annotations.proto +451 -0
  44. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/api_errors.proto +142 -0
  45. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/callback.proto +163 -0
  46. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/context.proto +19 -0
  47. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/entity.proto +127 -0
  48. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/errors.proto +127 -0
  49. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/idempotency.proto +25 -0
  50. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/permissions.proto +46 -0
  51. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/sla.proto +24 -0
  52. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/subscription.proto +32 -0
  53. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/validations.proto +142 -0
  54. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/address.proto +148 -0
  55. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/bulk.proto +53 -0
  56. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/identification.proto +40 -0
  57. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/image.proto +8 -0
  58. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/media.proto +280 -0
  59. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/money.proto +32 -0
  60. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/pageurl.proto +32 -0
  61. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/paging.proto +121 -0
  62. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/query.proto +799 -0
  63. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/sorting.proto +36 -0
  64. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/spi.proto +85 -0
  65. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/tags.proto +55 -0
  66. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/wixlink.proto +203 -0
  67. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/dealerOfferEvents/api/v1/dealer-offer-events.proto +211 -0
  68. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/dealerOfferEvents/api/v1/event.proto +131 -0
  69. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/graphql/definitions.proto +13 -0
  70. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/http/field_mask.proto +46 -0
  71. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/sdk/definitions.proto +191 -0
  72. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/spi/definitions.proto +187 -0
  73. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/spi/http_error_status.proto +24 -0
  74. package/@wix/ambassador-dealer-v1-offer-event/types/package.json +7 -0
  75. package/package.json +4 -3
@@ -0,0 +1,131 @@
1
+ syntax = "proto3";
2
+
3
+ package wix.dealerOfferEvents.api.v1;
4
+
5
+ import "google/api/annotations.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+ import "google/protobuf/field_mask.proto";
8
+ import "google/protobuf/wrappers.proto";
9
+ import "google/protobuf/struct.proto";
10
+ import "wix/api/entity.proto";
11
+ import "wix/api/annotations.proto";
12
+ import "wix/api/validations.proto";
13
+
14
+ option java_package = "com.wix.dealerOfferEvents.api.v1";
15
+
16
+ message OfferEvent {
17
+ option (wix.api.entity).fqdn = "wix.dealer.v1.offer_event";
18
+
19
+ // unique guid
20
+ string offer_id = 1 [(wix.api.format) = GUID];
21
+
22
+ // the direct user recieved the offer - returned only for AGENT_MARK summary/query
23
+ // OPTIONAL - NOT RECOMMENDED to pass in report event.
24
+ google.protobuf.StringValue user_id = 2 [(wix.api.format) = GUID];
25
+
26
+ // the target account context recieved the offer
27
+ // OPTIONAL - NOT RECOMMENDED to pass in report event.
28
+ google.protobuf.StringValue target_account_id = 3 [(wix.api.format) = GUID];
29
+
30
+ // returned only for AGENT_MARK summary/query
31
+ // OPTIONAL - NOT RECOMMENDED to pass in report event.
32
+ google.protobuf.StringValue logged_in_account_id = 4 [(wix.api.format) = GUID];
33
+
34
+ // the site context recieved the offer
35
+ // OPTIONAL - NOT RECOMMENDED to pass in report event.
36
+ google.protobuf.StringValue site_id = 5 [(wix.api.format) = GUID];
37
+
38
+ // returned only for AGENT_MARK summary/query
39
+ google.protobuf.StringValue event_id = 6 [(wix.api.format) = GUID, (wix.api.readOnly) = true];
40
+
41
+ // creation timestamp
42
+ google.protobuf.Timestamp created_at = 7 [(wix.api.readOnly) = true];
43
+
44
+ // for some of the event types a payload should be passed
45
+ // for example if u pass MAIN_CTA_CLICK then main_cta_click payload should also be passed with target_url
46
+ EventType type = 8;
47
+
48
+ oneof payload {
49
+ // a payload when event type is AGENT_MARK
50
+ AgentMarkedPayload agent_mark = 9;
51
+
52
+ // a payload when event type is MAIN_CTA_CLICK
53
+ // currently will not be returned as part of summary response
54
+ CTAClickPayload main_cta_click = 17;
55
+
56
+ // a payload when event type is SECONDARY_CTA_CLICK
57
+ // currently will not be returned as part of summary response
58
+ CTAClickPayload secondary_cta_click = 18;
59
+
60
+ }
61
+
62
+ // currently will not be returned as part of summary/query response
63
+ google.protobuf.StringValue real_estate_id = 11;
64
+
65
+ reserved 10, 12, 20;
66
+
67
+ // URL of a web page which is initial cause/source of the event (if available)
68
+ // if left blank and grpc endpoint is exposed over http rest - taken from HTTP referrer header
69
+ // currently will not be returned as part of summary response - not supported for AGENT_MARK
70
+ google.protobuf.StringValue http_referrer = 13;
71
+
72
+ // Some external asset guid. Can be the banner/LB campaign creative guid, but isn't specific to LB/banner assets.
73
+ // currently will not be returned as part of summary response - not supported for AGENT_MARK
74
+ google.protobuf.StringValue asset_id = 14 [(wix.api.format) = GUID];
75
+
76
+ // For placements that are used in multiple platforms simultaneously, pass the information of where this interaction happened.
77
+ // standard platforms for bi: BUSINESS_MANAGER, EDITORX, EDITORX, ADI, OWNER_APP
78
+ PlatformEnum platform = 15;
79
+
80
+ enum PlatformEnum {
81
+ UNKNOWN = 0;
82
+ BUSINESS_MANAGER = 1;
83
+ EDITORX = 2;
84
+ EDITOR = 3;
85
+ ADI = 4;
86
+ OWNER_APP = 5;
87
+ BRANDED_APP = 6;
88
+ DEV_CENTER = 7;
89
+ }
90
+
91
+ }
92
+
93
+ message CTAClickPayload {
94
+ // destination url of the cta if available (i.e. CTA href etc.)
95
+ // in some cases Cta is not url - therfore a simple string can be passed
96
+ google.protobuf.StringValue target_url = 1;
97
+ }
98
+
99
+ message AgentMarkedPayload {
100
+ // id of related agent
101
+ google.protobuf.StringValue agent_id = 1 [(wix.api.format) = GUID];
102
+
103
+ // Offer status
104
+ AgentOfferStatusEnum status = 2;
105
+
106
+ enum AgentOfferStatusEnum {
107
+ NOT_STARTED = 0;
108
+ SUGGESTED = 1;
109
+ REJECTED = 2;
110
+ REQUESTED = 3;
111
+ ALREADY_COMPLETED = 4;
112
+ NOT_RELEVANT = 5;
113
+ PAUSED = 6;
114
+ }
115
+ }
116
+
117
+ enum EventType {
118
+ UNKNOWN = 0;
119
+ VIEW = 1;
120
+
121
+ MAIN_CTA_CLICK = 3;
122
+ SECONDARY_CTA_CLICK = 4;
123
+ AGENT_MARK = 5;
124
+
125
+ reserved 6, 2;
126
+
127
+ SKIP = 7;
128
+ UNSKIP = 8;
129
+ CLOSE = 9;
130
+ SHOW_LATER = 10;
131
+ }
@@ -0,0 +1,13 @@
1
+ syntax = "proto2";
2
+
3
+ package wix.graphql;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ option java_multiple_files = true;
8
+ option java_outer_classname = "GraphqlProto";
9
+ option java_package = "com.wix.graphql";
10
+
11
+ extend google.protobuf.FileOptions {
12
+ optional string namespace = 66000;
13
+ }
@@ -0,0 +1,46 @@
1
+ syntax = "proto2";
2
+
3
+ package wix.http;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ option java_multiple_files = true;
8
+ option java_outer_classname = "FieldmaskProto";
9
+ option java_package = "com.wix.http";
10
+
11
+ /*
12
+ When (most commonly) update endpoint accepts FieldMask object, from REST client perspective it is redundant and can be
13
+ inferred from the actual JSON payload that was sent. This field annotation will tell the framework to use the JSON body
14
+ and automatically construct the fieldmask. E.g.
15
+ ```
16
+ import "wix/http/field_mask.proto";
17
+
18
+ rpc UpdateProduct (UpdateProductRequest) returns (UpdateProductResponse) {
19
+ option (google.api.http) = {
20
+ PATCH: "/v1/products/{product.id}
21
+ };
22
+ option (wix.http.infer_fieldmask) = {
23
+ from: "product"
24
+ fieldmask: "mask"
25
+ };
26
+ }
27
+
28
+ message UpdateProductRequest {
29
+ Product product = 1;
30
+ google.protobuf.FieldMask mask = 2;
31
+ }
32
+ ```
33
+ */
34
+ extend google.protobuf.FieldOptions {
35
+ optional string infer_fieldmask_from = 50901 [deprecated=true];
36
+ }
37
+
38
+ extend google.protobuf.MethodOptions {
39
+ optional InferFieldmask infer_fieldmask = 50902;
40
+ }
41
+
42
+ message InferFieldmask {
43
+ required string from = 1; // ref to field on which we want to infer
44
+ required string fieldmask = 2; // ref to actual fieldmask member
45
+ optional bool snake_case_comma_separated_mask = 3; // recase comma-separated field mask to snake_case (legacy behavior)
46
+ }
@@ -0,0 +1,191 @@
1
+ syntax = "proto2";
2
+
3
+ package wix.sdk;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ option java_multiple_files = true;
8
+ option java_outer_classname = "DefinitionsProto";
9
+ option java_package = "com.wix.sdk";
10
+
11
+
12
+ /**
13
+ logic of signature generation:
14
+ ==============================
15
+
16
+ 1) `id` (path-param) should be the first argument.
17
+ 2) if there are more identifiers (path-params), a parent object called `identifiers` containing those will be the first argument.
18
+ 3) first payload member will be the second argument unless overridden via proto option. in case of override, args will be taken from override option value in-order.
19
+ 4) rest of arguments (if exist) will follow under the `options` parent.
20
+
21
+ internal logic for `identifiers` field:
22
+ take all path-params, merge with all `unique` fields, distinct.
23
+ if you have total args > 1 -> put all in `identifiers` parent.
24
+ otherwise - use single (usually id) arg as is and make it the first param.
25
+
26
+ `sdk.signature.params` cannot control neither `options` (last param) nor `id`/`identifiers` (first param) as those are needed by convention in Velo.
27
+
28
+
29
+ Examples:
30
+ =========
31
+
32
+ // Example-1: Default behavior, single identifier:
33
+ message GetProductRequest {
34
+ option (.wix.api.unique) = {field: "id"}; //not needed, automatically assumed
35
+ string id = 1;
36
+ string product_family = 2;
37
+ bool include_pii = 3;
38
+ }
39
+ rpc GetProduct (GetProductRequest) returns (GetProductResponse) {
40
+ option (google.api.http) = {
41
+ get = "/v1/products/{id}"
42
+ };
43
+ // ...
44
+ }
45
+ // Resulted signature: getProduct(id: string, productFamily: string, options: {includePii: boolean}) Product {...}
46
+ {
47
+ sdkSignatures: [
48
+ {
49
+ args: [
50
+ {
51
+ field: {
52
+ path: "id" <-- field name in proto request message
53
+ }
54
+ },
55
+ {
56
+ field: {
57
+ path: "productFamily" <-- field name in proto request message
58
+ }
59
+ },
60
+ parent: {
61
+ name: "options"
62
+ fields: [
63
+ {
64
+ path: "includePii" <-- field name in proto request message
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ }
72
+
73
+ // Example-2: Default behavior, multiple identifiers:
74
+ message GetProductRequest {
75
+ option (.wix.api.unique) = {
76
+ field: "catalogId"
77
+ field: "productId"
78
+ };
79
+ string catalogId = 1;
80
+ string productId = 2;
81
+ string product_family = 3;
82
+ bool include_pii = 4;
83
+ }
84
+ rpc GetProduct (GetProductRequest) returns (GetProductResponse) {
85
+ option (google.api.http) = {
86
+ get = "/v1/catalog/{catalogId}/products/{productId}"
87
+ };
88
+ // ...
89
+ }
90
+ // Resulted signature: getProduct(identifiers: {catalogId: string, productId: string}, productFamily: string, options: {includePii: boolean}) Product {...}
91
+ // schema response:
92
+ {
93
+ sdkSignatures: [
94
+ {
95
+ args: [
96
+ {
97
+ parent: {
98
+ name: "identifiers"
99
+ fields: [
100
+ {
101
+ path: "catalogId" <-- field name in proto request message
102
+ },
103
+ {
104
+ path: "productId" <-- field name in proto request message
105
+ },
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ field: {
111
+ path: "productFamily" <-- field name in proto request message
112
+ }
113
+ },
114
+ parent: {
115
+ name: "options"
116
+ fields: [
117
+ {
118
+ path: "includePii" <-- field name in proto request message
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ }
124
+ ]
125
+ }
126
+
127
+ // Example-3: Using override option, multiple identifiers:
128
+ message GetProductRequest {
129
+ option (.wix.api.unique) = {
130
+ field: "catalogId"
131
+ field: "productId"
132
+ };
133
+ string catalogId = 1;
134
+ string productId = 2;
135
+ string product_family = 3;
136
+ bool include_pii = 4;
137
+ }
138
+ rpc GetProduct (GetProductRequest) returns (GetProductResponse) {
139
+ option (google.api.http) = {
140
+ get = "/v1/catalog/{catalogId}/products/{productId}"
141
+ };
142
+ option (.wix.sdk.signature) = {
143
+ params = "include_pii" // the rest will be auto wired to options arg
144
+ };
145
+ // ...
146
+ }
147
+ // Resulted signature: getProduct(identifiers: {catalogId: string, productId: string}, includePii: boolean, options: {productFamily: string}) Product {...}
148
+ // schema response:
149
+ {
150
+ sdkSignatures: [
151
+ {
152
+ args: [
153
+ {
154
+ parent: {
155
+ name: "identifiers"
156
+ fields: [
157
+ {
158
+ path: "catalogId" <-- field name in proto request message
159
+ },
160
+ {
161
+ path: "productId" <-- field name in proto request message
162
+ }
163
+ ]
164
+ }
165
+ },
166
+ {
167
+ field: {
168
+ path: "includePii" <-- field name in proto request message
169
+ }
170
+ },
171
+ parent: {
172
+ name: "options"
173
+ fields: [
174
+ {
175
+ path: "productFamily" <-- field name in proto request message
176
+ }
177
+ ]
178
+ }
179
+ ]
180
+ }
181
+ ]
182
+ }
183
+ **/
184
+
185
+ extend google.protobuf.MethodOptions {
186
+ repeated Signature signature = 60100;
187
+ }
188
+
189
+ message Signature {
190
+ repeated string params = 1;
191
+ }
@@ -0,0 +1,187 @@
1
+ syntax = "proto2";
2
+
3
+ package wix.spi;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+ import "wix/spi/http_error_status.proto";
7
+
8
+ option java_multiple_files = true;
9
+ option java_outer_classname = "DefinitionsProto";
10
+ option java_package = "com.wix.spi";
11
+
12
+ /**
13
+ Example SPI proto files:
14
+
15
+ syntax = "proto3";
16
+
17
+ package com.wixpress.ecom.couponsSpi;
18
+
19
+ // this service is bla bla bla...
20
+ //
21
+ // changelog:
22
+ // revision 2: added couponGenerated event
23
+ service CouponsProvider {
24
+ // since this is an SPI interface definition, the FQDN of the service_entity must start with `wix.interfaces.*`
25
+ option (.wix.spi.service) = {
26
+ fqdn: "wix.interfaces.ecom.v1.coupons_provider" // must be `wix.interfaces.*` for entities that define SPI
27
+ spi_identifier: "com.wixpress.appservice.api.ComponentType.AUTOMATION_TRIGGER"
28
+ config_message: "com.wixpresss.ecom.CouponsProviderConfig"
29
+ host_service: "com.wixpress.ecom.couponsSpi.CouponsSpiHost"
30
+ business_manager_url: "/ecom/coupons" // used to provide deep-link to biz-mgr to finish configuration after code publish in Velo
31
+ };
32
+
33
+ // The provider has to send this event when a coupon is generated on the provider system.
34
+ // When the coupon code will be used by a user during checkout,
35
+ // wix-ecom will call the provider in order to calculate the effect of the coupon on the cart
36
+ option (.wix.spi.event) = {
37
+ method_name: "CouponGenerated" // Name of the method on the SPI-Host service that needs to be called. Together with `host_service` annotation above, you can get the full FQN
38
+ };
39
+
40
+ // called when the system has to calculate how a coupon affects a given cart
41
+ rpc CalculateCart (CalculateCartRequest) returns (CalculateCartResponse) {
42
+ option (google.api.http) = {
43
+ post: "/calculate-cart"
44
+ };
45
+ option (.wix.spi.error) = {
46
+ name: "CouponNotSupportedError"
47
+ http_code: INVALID_ARGUMENT
48
+ application_code: "COUPON_TYPE_NOT_SUPPORTED"
49
+ data: "com.wixpress.ecom.couponsSpi.TypeNotSupportedError"
50
+ };
51
+ }
52
+
53
+ // called when a coupon is applied during checkout and has to be reserved until the checkout is completed
54
+ // redeem will later be called using the reservation_code returned by this method
55
+ rpc Reserve (ReserveCouponRequest) returns (ReserveCouponResponse) {
56
+ option (google.api.http) = {
57
+ post: "/reserve"
58
+ };
59
+ }
60
+
61
+ // called after a successful transaction that used a coupon was made, in order to notify the coupons provider
62
+ // that the coupon was redeemed.
63
+ // sends the reservation_code that the was returned by reserve method
64
+ rpc Redeem (RedeemCouponRequest) returns (RedeemCouponResponse) {
65
+ option (google.api.http) = {
66
+ post: "/redeem"
67
+ };
68
+ }
69
+
70
+ // called in order to extend coupon expiration date
71
+ // this method was added later than other methods and therefore needs to be toggled in config_message
72
+ rpc ExtendCoupon (ExtendCouponRequest) returns (ExtendCouponResponse) {
73
+ option (google.api.http) ={
74
+ post: "/extend-coupon"
75
+ };
76
+ option (.wix.spi.feature_toggle) = "toggle_extend_coupon_enabled";
77
+ }
78
+ }
79
+
80
+ message CouponsProviderConfig {
81
+ string base_uri = 1 [(.wix.spi.base_uri) = true]; // the base URI where all the methods are deployed. E.g. "https://golden-coupons.com/wix-provider"
82
+ repeated string supported_coupon_types = 2; // specific field related to this SPI
83
+ bool toggle_extend_coupon_enabled = 3; // feature toggle initialized with default value = false. should be true if implemented by spi provider
84
+ }
85
+
86
+ message TypeNotSupportedError {
87
+ string type = 1; The received type that is not supported by the service
88
+ }
89
+
90
+ // =========== another file, standard proto, no SPI annotation ================
91
+
92
+ service CouponsSpiHost {
93
+ // we cannot use the same service_entity as the SPI definition, because it is only interface definition. Here we need concrete FQDN
94
+ option (.wix.api.service_entity).message = "com.wixpress.ecom.couponsProviderGateway";
95
+
96
+ // The provider has to send this event when a coupon is generated on the provider system.
97
+ // When the coupon code will be used by a user during checkout,
98
+ // wix-ecom will call the provider in order to calculate the effect of the coupon on the cart
99
+ rpc CouponGenerated (CouponGeneratedRequest) returns (CouponGeneratedResponse) {
100
+ option (google.api.http) = {
101
+ post: "/v1/coupon-generated"
102
+ };
103
+ }
104
+
105
+ // The following 3 methods are an implementation of the SPI interface
106
+
107
+ rpc CalculateCart (CalculateCartRequest) returns (CalculateCartResponse) {
108
+ option (google.api.http) = {
109
+ post: "/calculate-cart"
110
+ };
111
+ }
112
+
113
+ rpc Reserve (ReserveCouponRequest) returns (ReserveCouponResponse) {
114
+ option (google.api.http) = {
115
+ post: "/reserve"
116
+ };
117
+ }
118
+
119
+ rpc Redeem (RedeemCouponRequest) returns (RedeemCouponResponse) {
120
+ option (google.api.http) ={
121
+ post: "/redeem"
122
+ };
123
+ }
124
+
125
+ rpc ExtendCoupon (ExtendCouponRequest) returns (RedeemCouponResponse) {
126
+ option (google.api.http) ={
127
+ post: "/extend-coupon"
128
+ };
129
+ }
130
+
131
+ }
132
+
133
+ message CouponsProviderGateway {
134
+ option (.wix.api.entity) = {
135
+ fqdn: "wix.gateways.ecom.v1.coupons_provider_gateway"
136
+ implements: "wix.intefaces.ecom.v1.coupons_provider"
137
+ };
138
+ }
139
+ **/
140
+
141
+ extend google.protobuf.ServiceOptions {
142
+ optional Service service = 65000;
143
+ repeated Event event = 65001; // spi event is essentially an endpoint that will get requests from spi implementor
144
+ }
145
+
146
+ extend google.protobuf.FieldOptions {
147
+ optional bool base_uri = 65020; // holds the base URI of the implementing service for this spi. (can be https://... | grpc://... | velo:///...)
148
+ }
149
+
150
+ extend google.protobuf.MethodOptions {
151
+ repeated Error error = 65040; // errors that can be thrown by the method
152
+ optional string feature_toggle = 65041; // name of the controlling feature toggle boolean field as it appears in the config message
153
+ }
154
+
155
+ message Service {
156
+ required string spi_identifier = 1; // string representation of dev-center's catalog [ComponentType](https://github.com/wix-private/devcenter/blob/master/app-service/app-service-api/src/main/proto/components_catalog/components_catalog_type.proto)
157
+ required string config_message = 2; // FQN ref to message with config details
158
+ optional string host_service = 3; // FQN ref to proto service of SPI host that implements endpoints that the provider needs to call
159
+ optional string business_manager_url = 4; // relative deeplink to business-manager page where the user needs to continue configuration of current spi
160
+ optional string fqdn = 5; // may be used to define an FQDN directly on SPI service without having a main entity. must start with `wix.interfaces.*`
161
+ optional string app_id = 6; // SPI Host's App Id
162
+ repeated ServiceAppendix appendix_files = 7; // declare external configuration info
163
+ }
164
+
165
+ message ServiceAppendix {
166
+ enum Type {
167
+ UNKNOWN_APPENDIX_TYPE = 0;
168
+ AUTO_VELO = 1 [deprecated = true]; // auto velo configuration
169
+ DOCS_CONF = 2; // wix docs configuration: `documentation.yaml`
170
+ MULTILINGUAL = 3; // wix multilingual configuration
171
+ SEARCH = 4; // nile search configuration
172
+ AUTO_SDK = 5; // auto sdk configuration
173
+ }
174
+ required Type type = 1; // appendix type
175
+ required string path = 2; // absolute from module root
176
+ }
177
+
178
+ message Error {
179
+ required string name = 1; // name that can be used by SDKs to generate error class
180
+ required HttpStatusCode http_code = 2; // HTTP status code that will be returned with this type of error
181
+ required string application_code = 3; // a constant string in the format of ALL_CAPS that describes the specific error type
182
+ optional string data = 4; // FQN of a message that describes structured data that should be provided in the error body
183
+ }
184
+
185
+ message Event {
186
+ required string method_name = 1; // name of the implemented method in SPI host service. Together with `host_service` annotation above, you can get the full FQN
187
+ }
@@ -0,0 +1,24 @@
1
+ syntax = "proto3";
2
+
3
+ package wix.spi;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ option java_package = "com.wix.spi";
8
+
9
+ enum HttpStatusCode {
10
+ UNKNOWN_ERROR = 0; // Should not be used
11
+ UNAUTHENTICATED = 1; // 401 - thrown when the request signature could be validated
12
+ INVALID_ARGUMENT = 3; // 400 - thrown when one of the properties has unexpected value or type
13
+ // 500 - thrown when something happened that is the result of server bug, network issue, DB issue,
14
+ // or anything that is not affected by the request itself, and is not the fault of the client in any way.
15
+ INTERNAL = 5;
16
+ RESOURCE_EXHAUSTED = 7; // 429 - The client has sent too many requests in a given amount of time (rate limit)
17
+ CANCELED = 8; // 499 - Request cancelled by the client
18
+
19
+ NOT_FOUND = 4; // 404 - thrown when the resource requested could not be found
20
+ ALREADY_EXISTS = 9; //409 - Can't recreate same resource or concurrency conflict
21
+ // 428 - request cannot be executed in current system state
22
+ // such as deleting a non-empty folder or paying with no funds
23
+ FAILED_PRECONDITION = 10;
24
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "private": true,
3
+ "main": "../build/cjs/types.impl",
4
+ "types": "../build/cjs/types.impl.d.ts",
5
+ "sideEffects": false,
6
+ "module": "../build/es/types.impl"
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/bex-utils",
3
- "version": "2.78.0",
3
+ "version": "2.80.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Kobi",
@@ -36,7 +36,7 @@
36
36
  "@formatjs/intl-relativetimeformat": "^4.5.16",
37
37
  "@sentry/browser": "5.30.0",
38
38
  "@sentry/types": "5.30.0",
39
- "@wix/metro-common-builders": "^1.0.1737",
39
+ "@wix/metro-common-builders": "^1.0.0",
40
40
  "@wix/metro-runtime": "^1.2055.0",
41
41
  "callsite": "^1.0.0",
42
42
  "i18next": "^19.9.2",
@@ -52,6 +52,7 @@
52
52
  "@types/react-native": "^0.73.0",
53
53
  "@wix/ambassador-app-settings-v1-settings": "^1.0.0",
54
54
  "@wix/ambassador-data-extensions-v1-data-extension-schema": "^1.0.93",
55
+ "@wix/ambassador-dealer-v1-offer-event": "^1.0.85",
55
56
  "@wix/ambassador-dealer-v1-serving-offer": "^1.0.132",
56
57
  "@wix/ambassador-devcenter-app-market-listing-v1-market-listing": "^1.0.70",
57
58
  "@wix/ambassador-fedinfra-exportservice-v1-export-async-job": "^1.0.174",
@@ -153,5 +154,5 @@
153
154
  "wallaby": {
154
155
  "autoDetect": true
155
156
  },
156
- "falconPackageHash": "c3cb930eb3c96d7ae99ab9f514c7265ce761777fc95884baeb36a795"
157
+ "falconPackageHash": "37704cd720ff68acd644b21d09f7f0c9d727c123bf37a8d9546aee32"
157
158
  }