@peabody-soft/mbs-model-ts 1.0.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 (212) hide show
  1. package/LICENCE +661 -0
  2. package/dist/Address.d.ts +33 -0
  3. package/dist/Address.js +97 -0
  4. package/dist/Attachment.d.ts +16 -0
  5. package/dist/Attachment.js +49 -0
  6. package/dist/AttachmentBaseUrl.d.ts +11 -0
  7. package/dist/AttachmentBaseUrl.js +41 -0
  8. package/dist/AuthTokens.d.ts +13 -0
  9. package/dist/AuthTokens.js +30 -0
  10. package/dist/Business.d.ts +44 -0
  11. package/dist/Business.js +87 -0
  12. package/dist/BusinessIdentifier.d.ts +8 -0
  13. package/dist/BusinessIdentifier.js +14 -0
  14. package/dist/BusinessLink.d.ts +21 -0
  15. package/dist/BusinessLink.js +61 -0
  16. package/dist/BusinessProfile.d.ts +11 -0
  17. package/dist/BusinessProfile.js +27 -0
  18. package/dist/CartEditor.d.ts +59 -0
  19. package/dist/CartEditor.js +324 -0
  20. package/dist/Catalog.d.ts +28 -0
  21. package/dist/Catalog.js +115 -0
  22. package/dist/Constants.d.ts +10 -0
  23. package/dist/Constants.js +43 -0
  24. package/dist/ContainerNames.d.ts +2 -0
  25. package/dist/ContainerNames.js +21 -0
  26. package/dist/Database.d.ts +15 -0
  27. package/dist/Database.js +1 -0
  28. package/dist/Entity.d.ts +27 -0
  29. package/dist/Entity.js +69 -0
  30. package/dist/Enums.d.ts +16 -0
  31. package/dist/Enums.js +18 -0
  32. package/dist/Exceptions.d.ts +4 -0
  33. package/dist/Exceptions.js +8 -0
  34. package/dist/GeneralSettings.d.ts +46 -0
  35. package/dist/GeneralSettings.js +99 -0
  36. package/dist/HttpStatusCodes.d.ts +2 -0
  37. package/dist/HttpStatusCodes.js +34 -0
  38. package/dist/Ids.d.ts +17 -0
  39. package/dist/Ids.js +78 -0
  40. package/dist/Item.d.ts +12 -0
  41. package/dist/Item.js +30 -0
  42. package/dist/LatLong.d.ts +7 -0
  43. package/dist/LatLong.js +17 -0
  44. package/dist/LiveData.d.ts +30 -0
  45. package/dist/LiveData.js +76 -0
  46. package/dist/Measures.d.ts +20 -0
  47. package/dist/Measures.js +34 -0
  48. package/dist/Message.d.ts +16 -0
  49. package/dist/Message.js +32 -0
  50. package/dist/MockDatabase.d.ts +19 -0
  51. package/dist/MockDatabase.js +73 -0
  52. package/dist/Model.d.ts +63 -0
  53. package/dist/Model.js +629 -0
  54. package/dist/Order.d.ts +31 -0
  55. package/dist/Order.js +70 -0
  56. package/dist/Package.d.ts +25 -0
  57. package/dist/Package.js +52 -0
  58. package/dist/PackageIdentifier.d.ts +8 -0
  59. package/dist/PackageIdentifier.js +14 -0
  60. package/dist/PaymentMethodDetail.d.ts +8 -0
  61. package/dist/PaymentMethodDetail.js +17 -0
  62. package/dist/Photo.d.ts +11 -0
  63. package/dist/Photo.js +29 -0
  64. package/dist/Price.d.ts +17 -0
  65. package/dist/Price.js +52 -0
  66. package/dist/PriceList.d.ts +3 -0
  67. package/dist/PriceList.js +5 -0
  68. package/dist/Product.d.ts +33 -0
  69. package/dist/Product.js +84 -0
  70. package/dist/ProductCategory.d.ts +10 -0
  71. package/dist/ProductCategory.js +18 -0
  72. package/dist/Profile.d.ts +20 -0
  73. package/dist/Profile.js +55 -0
  74. package/dist/ProtoMap.d.ts +71 -0
  75. package/dist/ProtoMap.js +1126 -0
  76. package/dist/Routes.d.ts +7 -0
  77. package/dist/Routes.js +12 -0
  78. package/dist/Service.d.ts +16 -0
  79. package/dist/Service.js +1 -0
  80. package/dist/ServiceExceptions.d.ts +40 -0
  81. package/dist/ServiceExceptions.js +84 -0
  82. package/dist/ServiceProxy.d.ts +25 -0
  83. package/dist/ServiceProxy.js +117 -0
  84. package/dist/ShoppingList.d.ts +64 -0
  85. package/dist/ShoppingList.js +188 -0
  86. package/dist/SyncCache.d.ts +28 -0
  87. package/dist/SyncCache.js +137 -0
  88. package/dist/SyncKeys.d.ts +5 -0
  89. package/dist/SyncKeys.js +41 -0
  90. package/dist/SyncState.d.ts +8 -0
  91. package/dist/SyncState.js +30 -0
  92. package/dist/Tax.d.ts +10 -0
  93. package/dist/Tax.js +30 -0
  94. package/dist/UserProfile.d.ts +16 -0
  95. package/dist/UserProfile.js +40 -0
  96. package/dist/WorkingDays.d.ts +33 -0
  97. package/dist/WorkingDays.js +121 -0
  98. package/dist/generated/Address.d.ts +77 -0
  99. package/dist/generated/Address.js +110 -0
  100. package/dist/generated/AddressList.d.ts +39 -0
  101. package/dist/generated/AddressList.js +60 -0
  102. package/dist/generated/AddressType.d.ts +15 -0
  103. package/dist/generated/AddressType.js +20 -0
  104. package/dist/generated/Attachment.d.ts +66 -0
  105. package/dist/generated/Attachment.js +89 -0
  106. package/dist/generated/AttachmentType.d.ts +154 -0
  107. package/dist/generated/AttachmentType.js +159 -0
  108. package/dist/generated/AuthTokens.d.ts +56 -0
  109. package/dist/generated/AuthTokens.js +74 -0
  110. package/dist/generated/AuthenticationMethod.d.ts +24 -0
  111. package/dist/generated/AuthenticationMethod.js +29 -0
  112. package/dist/generated/Business.d.ts +54 -0
  113. package/dist/generated/Business.js +75 -0
  114. package/dist/generated/BusinessIdentifier.d.ts +36 -0
  115. package/dist/generated/BusinessIdentifier.js +60 -0
  116. package/dist/generated/BusinessIdentifierType.d.ts +49 -0
  117. package/dist/generated/BusinessIdentifierType.js +54 -0
  118. package/dist/generated/BusinessLink.d.ts +76 -0
  119. package/dist/generated/BusinessLink.js +99 -0
  120. package/dist/generated/BusinessSyncInRequest.d.ts +42 -0
  121. package/dist/generated/BusinessSyncInRequest.js +60 -0
  122. package/dist/generated/BusinessSyncInResponse.d.ts +42 -0
  123. package/dist/generated/BusinessSyncInResponse.js +60 -0
  124. package/dist/generated/BusinessSyncOutRequest.d.ts +82 -0
  125. package/dist/generated/BusinessSyncOutRequest.js +107 -0
  126. package/dist/generated/BusinessSyncOutResponse.d.ts +106 -0
  127. package/dist/generated/BusinessSyncOutResponse.js +139 -0
  128. package/dist/generated/Configuration.d.ts +48 -0
  129. package/dist/generated/Configuration.js +63 -0
  130. package/dist/generated/Constants.d.ts +474 -0
  131. package/dist/generated/Constants.js +479 -0
  132. package/dist/generated/CreateUserRequest.d.ts +37 -0
  133. package/dist/generated/CreateUserRequest.js +59 -0
  134. package/dist/generated/DimensionUnit.d.ts +28 -0
  135. package/dist/generated/DimensionUnit.js +33 -0
  136. package/dist/generated/Dimensions.d.ts +41 -0
  137. package/dist/generated/Dimensions.js +76 -0
  138. package/dist/generated/Entity.d.ts +62 -0
  139. package/dist/generated/Entity.js +83 -0
  140. package/dist/generated/FulfillmentMode.d.ts +32 -0
  141. package/dist/generated/FulfillmentMode.js +37 -0
  142. package/dist/generated/GeneralSettings.d.ts +141 -0
  143. package/dist/generated/GeneralSettings.js +186 -0
  144. package/dist/generated/Item.d.ts +54 -0
  145. package/dist/generated/Item.js +82 -0
  146. package/dist/generated/LatLong.d.ts +36 -0
  147. package/dist/generated/LatLong.js +59 -0
  148. package/dist/generated/Message.d.ts +80 -0
  149. package/dist/generated/Message.js +114 -0
  150. package/dist/generated/MessageType.d.ts +34 -0
  151. package/dist/generated/MessageType.js +39 -0
  152. package/dist/generated/OrderStatus.d.ts +50 -0
  153. package/dist/generated/OrderStatus.js +55 -0
  154. package/dist/generated/Package.d.ts +63 -0
  155. package/dist/generated/Package.js +92 -0
  156. package/dist/generated/PackageIdentifier.d.ts +36 -0
  157. package/dist/generated/PackageIdentifier.js +60 -0
  158. package/dist/generated/PackageIdentifierType.d.ts +49 -0
  159. package/dist/generated/PackageIdentifierType.js +54 -0
  160. package/dist/generated/PartyPreferencesPayload.d.ts +41 -0
  161. package/dist/generated/PartyPreferencesPayload.js +60 -0
  162. package/dist/generated/PaymentMethod.d.ts +20 -0
  163. package/dist/generated/PaymentMethod.js +25 -0
  164. package/dist/generated/PaymentMethodDetail.d.ts +37 -0
  165. package/dist/generated/PaymentMethodDetail.js +59 -0
  166. package/dist/generated/Price.d.ts +52 -0
  167. package/dist/generated/Price.js +75 -0
  168. package/dist/generated/PriceList.d.ts +34 -0
  169. package/dist/generated/PriceList.js +51 -0
  170. package/dist/generated/Product.d.ts +77 -0
  171. package/dist/generated/Product.js +106 -0
  172. package/dist/generated/ProductCategory.d.ts +32 -0
  173. package/dist/generated/ProductCategory.js +51 -0
  174. package/dist/generated/ProductType.d.ts +42 -0
  175. package/dist/generated/ProductType.js +47 -0
  176. package/dist/generated/ProfileSyncOutRequest.d.ts +51 -0
  177. package/dist/generated/ProfileSyncOutRequest.js +75 -0
  178. package/dist/generated/ProfileSyncOutResponse.d.ts +56 -0
  179. package/dist/generated/ProfileSyncOutResponse.js +77 -0
  180. package/dist/generated/ReservedPackage.d.ts +34 -0
  181. package/dist/generated/ReservedPackage.js +39 -0
  182. package/dist/generated/Role.d.ts +71 -0
  183. package/dist/generated/Role.js +76 -0
  184. package/dist/generated/SalesOrderPayload.d.ts +85 -0
  185. package/dist/generated/SalesOrderPayload.js +123 -0
  186. package/dist/generated/ShoppingList.d.ts +99 -0
  187. package/dist/generated/ShoppingList.js +132 -0
  188. package/dist/generated/ShoppingListItem.d.ts +102 -0
  189. package/dist/generated/ShoppingListItem.js +139 -0
  190. package/dist/generated/TaskStatus.d.ts +20 -0
  191. package/dist/generated/TaskStatus.js +25 -0
  192. package/dist/generated/Tax.d.ts +37 -0
  193. package/dist/generated/Tax.js +60 -0
  194. package/dist/generated/TaxType.d.ts +25 -0
  195. package/dist/generated/TaxType.js +30 -0
  196. package/dist/generated/UrlAndToken.d.ts +54 -0
  197. package/dist/generated/UrlAndToken.js +67 -0
  198. package/dist/generated/User.d.ts +63 -0
  199. package/dist/generated/User.js +89 -0
  200. package/dist/generated/Weight.d.ts +33 -0
  201. package/dist/generated/Weight.js +60 -0
  202. package/dist/generated/WeightUnit.d.ts +28 -0
  203. package/dist/generated/WeightUnit.js +33 -0
  204. package/dist/generated/WorkingDays.d.ts +42 -0
  205. package/dist/generated/WorkingDays.js +68 -0
  206. package/dist/generated/WorkingHours.d.ts +33 -0
  207. package/dist/generated/WorkingHours.js +52 -0
  208. package/dist/generated/WorkingHoursRange.d.ts +42 -0
  209. package/dist/generated/WorkingHoursRange.js +59 -0
  210. package/dist/index.d.ts +48 -0
  211. package/dist/index.js +60 -0
  212. package/package.json +55 -0
@@ -0,0 +1,34 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ import { Item } from "./Item";
8
+ /**
9
+ * A named list of prices; has no parent, so its own Item.parentItemId is 0. Contains nothing - its
10
+ * prices are the Price entities whose Item.parentItemId is this price list's id.
11
+ * Excluded: isPurchasePriceList - a purchase price list is never sent, so the flag would always be
12
+ * false.
13
+ *
14
+ * @generated from protobuf message com.merabills.storefront.PriceList
15
+ */
16
+ export interface PriceList {
17
+ /**
18
+ * Base class - carries the Entity of this price list
19
+ *
20
+ * @generated from protobuf field: com.merabills.storefront.Item item = 1
21
+ */
22
+ item?: Item;
23
+ }
24
+ declare class PriceList$Type extends MessageType<PriceList> {
25
+ constructor();
26
+ create(value?: PartialMessage<PriceList>): PriceList;
27
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PriceList): PriceList;
28
+ internalBinaryWrite(message: PriceList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
29
+ }
30
+ /**
31
+ * @generated MessageType for protobuf message com.merabills.storefront.PriceList
32
+ */
33
+ export declare const PriceList: PriceList$Type;
34
+ export {};
@@ -0,0 +1,51 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ import { Item } from "./Item";
6
+ // @generated message type with reflection information, may provide speed optimized methods
7
+ class PriceList$Type extends MessageType {
8
+ constructor() {
9
+ super("com.merabills.storefront.PriceList", [
10
+ { no: 1, name: "item", kind: "message", T: () => Item }
11
+ ]);
12
+ }
13
+ create(value) {
14
+ const message = globalThis.Object.create((this.messagePrototype));
15
+ if (value !== undefined)
16
+ reflectionMergePartial(this, message, value);
17
+ return message;
18
+ }
19
+ internalBinaryRead(reader, length, options, target) {
20
+ let message = target ?? this.create(), end = reader.pos + length;
21
+ while (reader.pos < end) {
22
+ let [fieldNo, wireType] = reader.tag();
23
+ switch (fieldNo) {
24
+ case /* com.merabills.storefront.Item item */ 1:
25
+ message.item = Item.internalBinaryRead(reader, reader.uint32(), options, message.item);
26
+ break;
27
+ default:
28
+ let u = options.readUnknownField;
29
+ if (u === "throw")
30
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
31
+ let d = reader.skip(wireType);
32
+ if (u !== false)
33
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
34
+ }
35
+ }
36
+ return message;
37
+ }
38
+ internalBinaryWrite(message, writer, options) {
39
+ /* com.merabills.storefront.Item item = 1; */
40
+ if (message.item)
41
+ Item.internalBinaryWrite(message.item, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
42
+ let u = options.writeUnknownFields;
43
+ if (u !== false)
44
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
45
+ return writer;
46
+ }
47
+ }
48
+ /**
49
+ * @generated MessageType for protobuf message com.merabills.storefront.PriceList
50
+ */
51
+ export const PriceList = new PriceList$Type();
@@ -0,0 +1,77 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ import { Tax } from "./Tax";
8
+ import { Address } from "./Address";
9
+ import { ProductType } from "./ProductType";
10
+ import { Item } from "./Item";
11
+ /**
12
+ * A product (goods, service, raw material or fixed asset) in the catalog of a business. Belongs to
13
+ * at most one category (Item.parentItemId, 0 = none); its packages and photos are found the same
14
+ * way, by parentItemId / owningEntityId.
15
+ * Excluded: isDraft, forOfflineSaleOnly, isStockKeepingEnabled, isExpiryTrackingEnabled,
16
+ * storeProperties, defaultExpiry, classifications, all Translations fields.
17
+ *
18
+ * @generated from protobuf message com.merabills.storefront.Product
19
+ */
20
+ export interface Product {
21
+ /**
22
+ * Base class - carries the Entity of this product
23
+ *
24
+ * @generated from protobuf field: com.merabills.storefront.Item item = 1
25
+ */
26
+ item?: Item;
27
+ /**
28
+ * @generated from protobuf field: com.merabills.storefront.ProductType productType = 2
29
+ */
30
+ productType: ProductType;
31
+ /**
32
+ * At most Constants.PRODUCT_BRAND_MAX_LENGTH
33
+ *
34
+ * @generated from protobuf field: optional string brand = 3
35
+ */
36
+ brand?: string;
37
+ /**
38
+ * Absent means true: this product is manufactured by the business that sells it
39
+ *
40
+ * @generated from protobuf field: optional bool isManufacturedByBusiness = 4
41
+ */
42
+ isManufacturedByBusiness?: boolean;
43
+ /**
44
+ * At most Constants.PRODUCT_MANUFACTURER_MAX_LENGTH
45
+ *
46
+ * @generated from protobuf field: optional string manufacturer = 5
47
+ */
48
+ manufacturer?: string;
49
+ /**
50
+ * @generated from protobuf field: com.merabills.storefront.Address manufacturerAddress = 6
51
+ */
52
+ manufacturerAddress?: Address;
53
+ /**
54
+ * Taxes that apply to this product (at most Constants.MAX_TAXES)
55
+ *
56
+ * @generated from protobuf field: repeated com.merabills.storefront.Tax taxes = 7
57
+ */
58
+ taxes: Tax[];
59
+ /**
60
+ * One line bullet points about this product (at most Constants.PRODUCT_MAX_FEATURES, each at
61
+ * most Constants.PRODUCT_FEATURE_MAX_LENGTH)
62
+ *
63
+ * @generated from protobuf field: repeated string features = 8
64
+ */
65
+ features: string[];
66
+ }
67
+ declare class Product$Type extends MessageType<Product> {
68
+ constructor();
69
+ create(value?: PartialMessage<Product>): Product;
70
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Product): Product;
71
+ internalBinaryWrite(message: Product, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
72
+ }
73
+ /**
74
+ * @generated MessageType for protobuf message com.merabills.storefront.Product
75
+ */
76
+ export declare const Product: Product$Type;
77
+ export {};
@@ -0,0 +1,106 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ import { Tax } from "./Tax";
6
+ import { Address } from "./Address";
7
+ import { ProductType } from "./ProductType";
8
+ import { Item } from "./Item";
9
+ // @generated message type with reflection information, may provide speed optimized methods
10
+ class Product$Type extends MessageType {
11
+ constructor() {
12
+ super("com.merabills.storefront.Product", [
13
+ { no: 1, name: "item", kind: "message", T: () => Item },
14
+ { no: 2, name: "productType", kind: "enum", T: () => ["com.merabills.storefront.ProductType", ProductType] },
15
+ { no: 3, name: "brand", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
16
+ { no: 4, name: "isManufacturedByBusiness", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
17
+ { no: 5, name: "manufacturer", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
18
+ { no: 6, name: "manufacturerAddress", kind: "message", T: () => Address },
19
+ { no: 7, name: "taxes", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Tax },
20
+ { no: 8, name: "features", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
21
+ ]);
22
+ }
23
+ create(value) {
24
+ const message = globalThis.Object.create((this.messagePrototype));
25
+ message.productType = 0;
26
+ message.taxes = [];
27
+ message.features = [];
28
+ if (value !== undefined)
29
+ reflectionMergePartial(this, message, value);
30
+ return message;
31
+ }
32
+ internalBinaryRead(reader, length, options, target) {
33
+ let message = target ?? this.create(), end = reader.pos + length;
34
+ while (reader.pos < end) {
35
+ let [fieldNo, wireType] = reader.tag();
36
+ switch (fieldNo) {
37
+ case /* com.merabills.storefront.Item item */ 1:
38
+ message.item = Item.internalBinaryRead(reader, reader.uint32(), options, message.item);
39
+ break;
40
+ case /* com.merabills.storefront.ProductType productType */ 2:
41
+ message.productType = reader.int32();
42
+ break;
43
+ case /* optional string brand */ 3:
44
+ message.brand = reader.string();
45
+ break;
46
+ case /* optional bool isManufacturedByBusiness */ 4:
47
+ message.isManufacturedByBusiness = reader.bool();
48
+ break;
49
+ case /* optional string manufacturer */ 5:
50
+ message.manufacturer = reader.string();
51
+ break;
52
+ case /* com.merabills.storefront.Address manufacturerAddress */ 6:
53
+ message.manufacturerAddress = Address.internalBinaryRead(reader, reader.uint32(), options, message.manufacturerAddress);
54
+ break;
55
+ case /* repeated com.merabills.storefront.Tax taxes */ 7:
56
+ message.taxes.push(Tax.internalBinaryRead(reader, reader.uint32(), options));
57
+ break;
58
+ case /* repeated string features */ 8:
59
+ message.features.push(reader.string());
60
+ break;
61
+ default:
62
+ let u = options.readUnknownField;
63
+ if (u === "throw")
64
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
65
+ let d = reader.skip(wireType);
66
+ if (u !== false)
67
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
68
+ }
69
+ }
70
+ return message;
71
+ }
72
+ internalBinaryWrite(message, writer, options) {
73
+ /* com.merabills.storefront.Item item = 1; */
74
+ if (message.item)
75
+ Item.internalBinaryWrite(message.item, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
76
+ /* com.merabills.storefront.ProductType productType = 2; */
77
+ if (message.productType !== 0)
78
+ writer.tag(2, WireType.Varint).int32(message.productType);
79
+ /* optional string brand = 3; */
80
+ if (message.brand !== undefined)
81
+ writer.tag(3, WireType.LengthDelimited).string(message.brand);
82
+ /* optional bool isManufacturedByBusiness = 4; */
83
+ if (message.isManufacturedByBusiness !== undefined)
84
+ writer.tag(4, WireType.Varint).bool(message.isManufacturedByBusiness);
85
+ /* optional string manufacturer = 5; */
86
+ if (message.manufacturer !== undefined)
87
+ writer.tag(5, WireType.LengthDelimited).string(message.manufacturer);
88
+ /* com.merabills.storefront.Address manufacturerAddress = 6; */
89
+ if (message.manufacturerAddress)
90
+ Address.internalBinaryWrite(message.manufacturerAddress, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
91
+ /* repeated com.merabills.storefront.Tax taxes = 7; */
92
+ for (let i = 0; i < message.taxes.length; i++)
93
+ Tax.internalBinaryWrite(message.taxes[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
94
+ /* repeated string features = 8; */
95
+ for (let i = 0; i < message.features.length; i++)
96
+ writer.tag(8, WireType.LengthDelimited).string(message.features[i]);
97
+ let u = options.writeUnknownFields;
98
+ if (u !== false)
99
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
100
+ return writer;
101
+ }
102
+ }
103
+ /**
104
+ * @generated MessageType for protobuf message com.merabills.storefront.Product
105
+ */
106
+ export const Product = new Product$Type();
@@ -0,0 +1,32 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ import { Item } from "./Item";
8
+ /**
9
+ * A category that groups products of a catalog; its name is always set. Contains nothing - its
10
+ * products are those whose Item.parentItemId is this category's id (0 = none).
11
+ *
12
+ * @generated from protobuf message com.merabills.storefront.ProductCategory
13
+ */
14
+ export interface ProductCategory {
15
+ /**
16
+ * Base class - carries the Entity of this category
17
+ *
18
+ * @generated from protobuf field: com.merabills.storefront.Item item = 1
19
+ */
20
+ item?: Item;
21
+ }
22
+ declare class ProductCategory$Type extends MessageType<ProductCategory> {
23
+ constructor();
24
+ create(value?: PartialMessage<ProductCategory>): ProductCategory;
25
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProductCategory): ProductCategory;
26
+ internalBinaryWrite(message: ProductCategory, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
27
+ }
28
+ /**
29
+ * @generated MessageType for protobuf message com.merabills.storefront.ProductCategory
30
+ */
31
+ export declare const ProductCategory: ProductCategory$Type;
32
+ export {};
@@ -0,0 +1,51 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ import { Item } from "./Item";
6
+ // @generated message type with reflection information, may provide speed optimized methods
7
+ class ProductCategory$Type extends MessageType {
8
+ constructor() {
9
+ super("com.merabills.storefront.ProductCategory", [
10
+ { no: 1, name: "item", kind: "message", T: () => Item }
11
+ ]);
12
+ }
13
+ create(value) {
14
+ const message = globalThis.Object.create((this.messagePrototype));
15
+ if (value !== undefined)
16
+ reflectionMergePartial(this, message, value);
17
+ return message;
18
+ }
19
+ internalBinaryRead(reader, length, options, target) {
20
+ let message = target ?? this.create(), end = reader.pos + length;
21
+ while (reader.pos < end) {
22
+ let [fieldNo, wireType] = reader.tag();
23
+ switch (fieldNo) {
24
+ case /* com.merabills.storefront.Item item */ 1:
25
+ message.item = Item.internalBinaryRead(reader, reader.uint32(), options, message.item);
26
+ break;
27
+ default:
28
+ let u = options.readUnknownField;
29
+ if (u === "throw")
30
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
31
+ let d = reader.skip(wireType);
32
+ if (u !== false)
33
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
34
+ }
35
+ }
36
+ return message;
37
+ }
38
+ internalBinaryWrite(message, writer, options) {
39
+ /* com.merabills.storefront.Item item = 1; */
40
+ if (message.item)
41
+ Item.internalBinaryWrite(message.item, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
42
+ let u = options.writeUnknownFields;
43
+ if (u !== false)
44
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
45
+ return writer;
46
+ }
47
+ }
48
+ /**
49
+ * @generated MessageType for protobuf message com.merabills.storefront.ProductCategory
50
+ */
51
+ export const ProductCategory = new ProductCategory$Type();
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The kind of product. Values match the type ids of the corresponding Java enum entries, which are
3
+ * bit flags, and must never be changed.
4
+ *
5
+ * @generated from protobuf enum com.merabills.storefront.ProductType
6
+ */
7
+ export declare enum ProductType {
8
+ /**
9
+ * @generated from protobuf enum value: UNSPECIFIED_PRODUCT_TYPE = 0;
10
+ */
11
+ UNSPECIFIED_PRODUCT_TYPE = 0,
12
+ /**
13
+ * Tangible, sold and purchased
14
+ *
15
+ * @generated from protobuf enum value: GOODS = 1;
16
+ */
17
+ GOODS = 1,
18
+ /**
19
+ * Intangible, sold
20
+ *
21
+ * @generated from protobuf enum value: SERVICE_SOLD = 2;
22
+ */
23
+ SERVICE_SOLD = 2,
24
+ /**
25
+ * Tangible, purchased
26
+ *
27
+ * @generated from protobuf enum value: RAW_MATERIAL = 4;
28
+ */
29
+ RAW_MATERIAL = 4,
30
+ /**
31
+ * Intangible, purchased
32
+ *
33
+ * @generated from protobuf enum value: SERVICE_PURCHASED = 8;
34
+ */
35
+ SERVICE_PURCHASED = 8,
36
+ /**
37
+ * Tangible, purchased
38
+ *
39
+ * @generated from protobuf enum value: FIXED_ASSET = 16;
40
+ */
41
+ FIXED_ASSET = 16
42
+ }
@@ -0,0 +1,47 @@
1
+ // @ts-nocheck
2
+ // @generated by protobuf-ts 2.11.1 with parameter long_type_bigint
3
+ // @generated from protobuf file "ProductType.proto" (package "com.merabills.storefront", syntax proto3)
4
+ // tslint:disable
5
+ /**
6
+ * The kind of product. Values match the type ids of the corresponding Java enum entries, which are
7
+ * bit flags, and must never be changed.
8
+ *
9
+ * @generated from protobuf enum com.merabills.storefront.ProductType
10
+ */
11
+ export var ProductType;
12
+ (function (ProductType) {
13
+ /**
14
+ * @generated from protobuf enum value: UNSPECIFIED_PRODUCT_TYPE = 0;
15
+ */
16
+ ProductType[ProductType["UNSPECIFIED_PRODUCT_TYPE"] = 0] = "UNSPECIFIED_PRODUCT_TYPE";
17
+ /**
18
+ * Tangible, sold and purchased
19
+ *
20
+ * @generated from protobuf enum value: GOODS = 1;
21
+ */
22
+ ProductType[ProductType["GOODS"] = 1] = "GOODS";
23
+ /**
24
+ * Intangible, sold
25
+ *
26
+ * @generated from protobuf enum value: SERVICE_SOLD = 2;
27
+ */
28
+ ProductType[ProductType["SERVICE_SOLD"] = 2] = "SERVICE_SOLD";
29
+ /**
30
+ * Tangible, purchased
31
+ *
32
+ * @generated from protobuf enum value: RAW_MATERIAL = 4;
33
+ */
34
+ ProductType[ProductType["RAW_MATERIAL"] = 4] = "RAW_MATERIAL";
35
+ /**
36
+ * Intangible, purchased
37
+ *
38
+ * @generated from protobuf enum value: SERVICE_PURCHASED = 8;
39
+ */
40
+ ProductType[ProductType["SERVICE_PURCHASED"] = 8] = "SERVICE_PURCHASED";
41
+ /**
42
+ * Tangible, purchased
43
+ *
44
+ * @generated from protobuf enum value: FIXED_ASSET = 16;
45
+ */
46
+ ProductType[ProductType["FIXED_ASSET"] = 16] = "FIXED_ASSET";
47
+ })(ProductType || (ProductType = {}));
@@ -0,0 +1,51 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ /**
8
+ * Signs an existing user in: returns the caller (from the AuthTokens of the authorization header),
9
+ * the businesses they are linked to, and those businesses. Incremental and bounded: each cursor is
10
+ * the highest Entity.updateNumber of that type already synced (0 asks for everything), and a
11
+ * response of Constants.SYNC_OUT_LIMIT entities means call again with the updated cursors.
12
+ *
13
+ * @generated from protobuf message com.merabills.storefront.ProfileSyncOutRequest
14
+ */
15
+ export interface ProfileSyncOutRequest {
16
+ /**
17
+ * Cursor for the caller's own User entity (Constants.USER_ENTITY_TYPE_ID).
18
+ *
19
+ * @generated from protobuf field: int64 userUpdateNumber = 1
20
+ */
21
+ userUpdateNumber: bigint;
22
+ /**
23
+ * Cursor for the Business entities the caller is linked to (Constants.BUSINESS_ENTITY_TYPE_ID).
24
+ *
25
+ * @generated from protobuf field: int64 businessUpdateNumber = 2
26
+ */
27
+ businessUpdateNumber: bigint;
28
+ /**
29
+ * Cursor for the caller's BusinessLink entities (Constants.BUSINESS_LINK_ENTITY_TYPE_ID).
30
+ *
31
+ * @generated from protobuf field: int64 businessLinkUpdateNumber = 3
32
+ */
33
+ businessLinkUpdateNumber: bigint;
34
+ /**
35
+ * The business to join as a customer, if the caller is not already linked to it. 0 means none.
36
+ *
37
+ * @generated from protobuf field: int64 joinBusinessId = 4
38
+ */
39
+ joinBusinessId: bigint;
40
+ }
41
+ declare class ProfileSyncOutRequest$Type extends MessageType<ProfileSyncOutRequest> {
42
+ constructor();
43
+ create(value?: PartialMessage<ProfileSyncOutRequest>): ProfileSyncOutRequest;
44
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProfileSyncOutRequest): ProfileSyncOutRequest;
45
+ internalBinaryWrite(message: ProfileSyncOutRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
46
+ }
47
+ /**
48
+ * @generated MessageType for protobuf message com.merabills.storefront.ProfileSyncOutRequest
49
+ */
50
+ export declare const ProfileSyncOutRequest: ProfileSyncOutRequest$Type;
51
+ export {};
@@ -0,0 +1,75 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ // @generated message type with reflection information, may provide speed optimized methods
6
+ class ProfileSyncOutRequest$Type extends MessageType {
7
+ constructor() {
8
+ super("com.merabills.storefront.ProfileSyncOutRequest", [
9
+ { no: 1, name: "userUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
10
+ { no: 2, name: "businessUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
11
+ { no: 3, name: "businessLinkUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
12
+ { no: 4, name: "joinBusinessId", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
13
+ ]);
14
+ }
15
+ create(value) {
16
+ const message = globalThis.Object.create((this.messagePrototype));
17
+ message.userUpdateNumber = 0n;
18
+ message.businessUpdateNumber = 0n;
19
+ message.businessLinkUpdateNumber = 0n;
20
+ message.joinBusinessId = 0n;
21
+ if (value !== undefined)
22
+ reflectionMergePartial(this, message, value);
23
+ return message;
24
+ }
25
+ internalBinaryRead(reader, length, options, target) {
26
+ let message = target ?? this.create(), end = reader.pos + length;
27
+ while (reader.pos < end) {
28
+ let [fieldNo, wireType] = reader.tag();
29
+ switch (fieldNo) {
30
+ case /* int64 userUpdateNumber */ 1:
31
+ message.userUpdateNumber = reader.int64().toBigInt();
32
+ break;
33
+ case /* int64 businessUpdateNumber */ 2:
34
+ message.businessUpdateNumber = reader.int64().toBigInt();
35
+ break;
36
+ case /* int64 businessLinkUpdateNumber */ 3:
37
+ message.businessLinkUpdateNumber = reader.int64().toBigInt();
38
+ break;
39
+ case /* int64 joinBusinessId */ 4:
40
+ message.joinBusinessId = reader.int64().toBigInt();
41
+ break;
42
+ default:
43
+ let u = options.readUnknownField;
44
+ if (u === "throw")
45
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
46
+ let d = reader.skip(wireType);
47
+ if (u !== false)
48
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
49
+ }
50
+ }
51
+ return message;
52
+ }
53
+ internalBinaryWrite(message, writer, options) {
54
+ /* int64 userUpdateNumber = 1; */
55
+ if (message.userUpdateNumber !== 0n)
56
+ writer.tag(1, WireType.Varint).int64(message.userUpdateNumber);
57
+ /* int64 businessUpdateNumber = 2; */
58
+ if (message.businessUpdateNumber !== 0n)
59
+ writer.tag(2, WireType.Varint).int64(message.businessUpdateNumber);
60
+ /* int64 businessLinkUpdateNumber = 3; */
61
+ if (message.businessLinkUpdateNumber !== 0n)
62
+ writer.tag(3, WireType.Varint).int64(message.businessLinkUpdateNumber);
63
+ /* int64 joinBusinessId = 4; */
64
+ if (message.joinBusinessId !== 0n)
65
+ writer.tag(4, WireType.Varint).int64(message.joinBusinessId);
66
+ let u = options.writeUnknownFields;
67
+ if (u !== false)
68
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
69
+ return writer;
70
+ }
71
+ }
72
+ /**
73
+ * @generated MessageType for protobuf message com.merabills.storefront.ProfileSyncOutRequest
74
+ */
75
+ export const ProfileSyncOutRequest = new ProfileSyncOutRequest$Type();
@@ -0,0 +1,56 @@
1
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
2
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
3
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
4
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
5
+ import type { PartialMessage } from "@protobuf-ts/runtime";
6
+ import { MessageType } from "@protobuf-ts/runtime";
7
+ import { Business } from "./Business";
8
+ import { BusinessLink } from "./BusinessLink";
9
+ import { User } from "./User";
10
+ import { AuthTokens } from "./AuthTokens";
11
+ /**
12
+ * The answer to a ProfileSyncOutRequest: who the caller is, the businesses they are linked to, and
13
+ * those businesses. Nothing is nested - match BusinessLink.businessId against Business.entity.id.
14
+ * Every field is absent/empty unless that type has changed; a tombstone (updateNumber's update-type
15
+ * bits = Constants.UPDATE_TYPE_DELETED) means the entity, and what it owned, was deleted.
16
+ *
17
+ * @generated from protobuf message com.merabills.storefront.ProfileSyncOutResponse
18
+ */
19
+ export interface ProfileSyncOutResponse {
20
+ /**
21
+ * The tokens to send with the next request, when the server has renewed one of them. Absent means
22
+ * what the client already holds still works - never a signal to drop the tokens it has.
23
+ *
24
+ * @generated from protobuf field: optional com.merabills.storefront.AuthTokens authTokens = 1
25
+ */
26
+ authTokens?: AuthTokens;
27
+ /**
28
+ * The caller. Absent unless their own profile has changed.
29
+ *
30
+ * @generated from protobuf field: com.merabills.storefront.User user = 2
31
+ */
32
+ user?: User;
33
+ /**
34
+ * The businesses the caller is linked to, and the token for each. Empty unless a link has changed.
35
+ *
36
+ * @generated from protobuf field: repeated com.merabills.storefront.BusinessLink businessLinks = 3
37
+ */
38
+ businessLinks: BusinessLink[];
39
+ /**
40
+ * The businesses those links name. Empty unless a business has changed.
41
+ *
42
+ * @generated from protobuf field: repeated com.merabills.storefront.Business businesses = 4
43
+ */
44
+ businesses: Business[];
45
+ }
46
+ declare class ProfileSyncOutResponse$Type extends MessageType<ProfileSyncOutResponse> {
47
+ constructor();
48
+ create(value?: PartialMessage<ProfileSyncOutResponse>): ProfileSyncOutResponse;
49
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProfileSyncOutResponse): ProfileSyncOutResponse;
50
+ internalBinaryWrite(message: ProfileSyncOutResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
51
+ }
52
+ /**
53
+ * @generated MessageType for protobuf message com.merabills.storefront.ProfileSyncOutResponse
54
+ */
55
+ export declare const ProfileSyncOutResponse: ProfileSyncOutResponse$Type;
56
+ export {};