@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,77 @@
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 { Business } from "./Business";
6
+ import { BusinessLink } from "./BusinessLink";
7
+ import { User } from "./User";
8
+ import { AuthTokens } from "./AuthTokens";
9
+ // @generated message type with reflection information, may provide speed optimized methods
10
+ class ProfileSyncOutResponse$Type extends MessageType {
11
+ constructor() {
12
+ super("com.merabills.storefront.ProfileSyncOutResponse", [
13
+ { no: 1, name: "authTokens", kind: "message", T: () => AuthTokens },
14
+ { no: 2, name: "user", kind: "message", T: () => User },
15
+ { no: 3, name: "businessLinks", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => BusinessLink },
16
+ { no: 4, name: "businesses", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Business }
17
+ ]);
18
+ }
19
+ create(value) {
20
+ const message = globalThis.Object.create((this.messagePrototype));
21
+ message.businessLinks = [];
22
+ message.businesses = [];
23
+ if (value !== undefined)
24
+ reflectionMergePartial(this, message, value);
25
+ return message;
26
+ }
27
+ internalBinaryRead(reader, length, options, target) {
28
+ let message = target ?? this.create(), end = reader.pos + length;
29
+ while (reader.pos < end) {
30
+ let [fieldNo, wireType] = reader.tag();
31
+ switch (fieldNo) {
32
+ case /* optional com.merabills.storefront.AuthTokens authTokens */ 1:
33
+ message.authTokens = AuthTokens.internalBinaryRead(reader, reader.uint32(), options, message.authTokens);
34
+ break;
35
+ case /* com.merabills.storefront.User user */ 2:
36
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
37
+ break;
38
+ case /* repeated com.merabills.storefront.BusinessLink businessLinks */ 3:
39
+ message.businessLinks.push(BusinessLink.internalBinaryRead(reader, reader.uint32(), options));
40
+ break;
41
+ case /* repeated com.merabills.storefront.Business businesses */ 4:
42
+ message.businesses.push(Business.internalBinaryRead(reader, reader.uint32(), options));
43
+ break;
44
+ default:
45
+ let u = options.readUnknownField;
46
+ if (u === "throw")
47
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
48
+ let d = reader.skip(wireType);
49
+ if (u !== false)
50
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
51
+ }
52
+ }
53
+ return message;
54
+ }
55
+ internalBinaryWrite(message, writer, options) {
56
+ /* optional com.merabills.storefront.AuthTokens authTokens = 1; */
57
+ if (message.authTokens)
58
+ AuthTokens.internalBinaryWrite(message.authTokens, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
59
+ /* com.merabills.storefront.User user = 2; */
60
+ if (message.user)
61
+ User.internalBinaryWrite(message.user, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
62
+ /* repeated com.merabills.storefront.BusinessLink businessLinks = 3; */
63
+ for (let i = 0; i < message.businessLinks.length; i++)
64
+ BusinessLink.internalBinaryWrite(message.businessLinks[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
65
+ /* repeated com.merabills.storefront.Business businesses = 4; */
66
+ for (let i = 0; i < message.businesses.length; i++)
67
+ Business.internalBinaryWrite(message.businesses[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
68
+ let u = options.writeUnknownFields;
69
+ if (u !== false)
70
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
71
+ return writer;
72
+ }
73
+ }
74
+ /**
75
+ * @generated MessageType for protobuf message com.merabills.storefront.ProfileSyncOutResponse
76
+ */
77
+ export const ProfileSyncOutResponse = new ProfileSyncOutResponse$Type();
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The packages reserved for the charge and summary lines of a shopping list; not catalog packages,
3
+ * so a client must label them itself. Each value is the low part of the actual 64 bit package id:
4
+ * id = (Constants.PACKAGE_ENTITY_TYPE_ID << Constants.ENTITY_TYPE_BIT_SHIFT) | value (BigInt math).
5
+ *
6
+ * @generated from protobuf enum com.merabills.storefront.ReservedPackage
7
+ */
8
+ export declare enum ReservedPackage {
9
+ /**
10
+ * The total of the shopping list. Present only in a list a merchant has laid out for display;
11
+ * a storefront should prefer ShoppingList.totalAmountBeforeDiscount.
12
+ *
13
+ * @generated from protobuf enum value: TOTAL_PACKAGE = 0;
14
+ */
15
+ TOTAL_PACKAGE = 0,
16
+ /**
17
+ * The discount applied to the whole shopping list
18
+ *
19
+ * @generated from protobuf enum value: DISCOUNT_PACKAGE = 1;
20
+ */
21
+ DISCOUNT_PACKAGE = 1,
22
+ /**
23
+ * The delivery charge, added when ShoppingList.autoAddDeliveryCharge is true
24
+ *
25
+ * @generated from protobuf enum value: DELIVERY_CHARGE_PACKAGE = 2;
26
+ */
27
+ DELIVERY_CHARGE_PACKAGE = 2,
28
+ /**
29
+ * The service charge, added when ShoppingList.autoAddServiceCharge is true
30
+ *
31
+ * @generated from protobuf enum value: SERVICE_CHARGE_PACKAGE = 3;
32
+ */
33
+ SERVICE_CHARGE_PACKAGE = 3
34
+ }
@@ -0,0 +1,39 @@
1
+ // @ts-nocheck
2
+ // @generated by protobuf-ts 2.11.1 with parameter long_type_bigint
3
+ // @generated from protobuf file "ReservedPackage.proto" (package "com.merabills.storefront", syntax proto3)
4
+ // tslint:disable
5
+ /**
6
+ * The packages reserved for the charge and summary lines of a shopping list; not catalog packages,
7
+ * so a client must label them itself. Each value is the low part of the actual 64 bit package id:
8
+ * id = (Constants.PACKAGE_ENTITY_TYPE_ID << Constants.ENTITY_TYPE_BIT_SHIFT) | value (BigInt math).
9
+ *
10
+ * @generated from protobuf enum com.merabills.storefront.ReservedPackage
11
+ */
12
+ export var ReservedPackage;
13
+ (function (ReservedPackage) {
14
+ /**
15
+ * The total of the shopping list. Present only in a list a merchant has laid out for display;
16
+ * a storefront should prefer ShoppingList.totalAmountBeforeDiscount.
17
+ *
18
+ * @generated from protobuf enum value: TOTAL_PACKAGE = 0;
19
+ */
20
+ ReservedPackage[ReservedPackage["TOTAL_PACKAGE"] = 0] = "TOTAL_PACKAGE";
21
+ /**
22
+ * The discount applied to the whole shopping list
23
+ *
24
+ * @generated from protobuf enum value: DISCOUNT_PACKAGE = 1;
25
+ */
26
+ ReservedPackage[ReservedPackage["DISCOUNT_PACKAGE"] = 1] = "DISCOUNT_PACKAGE";
27
+ /**
28
+ * The delivery charge, added when ShoppingList.autoAddDeliveryCharge is true
29
+ *
30
+ * @generated from protobuf enum value: DELIVERY_CHARGE_PACKAGE = 2;
31
+ */
32
+ ReservedPackage[ReservedPackage["DELIVERY_CHARGE_PACKAGE"] = 2] = "DELIVERY_CHARGE_PACKAGE";
33
+ /**
34
+ * The service charge, added when ShoppingList.autoAddServiceCharge is true
35
+ *
36
+ * @generated from protobuf enum value: SERVICE_CHARGE_PACKAGE = 3;
37
+ */
38
+ ReservedPackage[ReservedPackage["SERVICE_CHARGE_PACKAGE"] = 3] = "SERVICE_CHARGE_PACKAGE";
39
+ })(ReservedPackage || (ReservedPackage = {}));
@@ -0,0 +1,71 @@
1
+ /**
2
+ * What an entity linked to a business may do with it - the role of a BusinessLink. Values are
3
+ * computed ids ((groupId << 6) | roleId), not ordinals, and must never change; a client can recover
4
+ * the group with (role >> 6) but not the rights, which are not on the wire.
5
+ *
6
+ * @generated from protobuf enum com.merabills.storefront.Role
7
+ */
8
+ export declare enum Role {
9
+ /**
10
+ * Owner group. Only a user can be in one of these roles.
11
+ *
12
+ * Can do anything, and is the entity that is billed
13
+ *
14
+ * @generated from protobuf enum value: PRIMARY_OWNER = 0;
15
+ */
16
+ PRIMARY_OWNER = 0,
17
+ /**
18
+ * Can do anything except remove the primary owner
19
+ *
20
+ * @generated from protobuf enum value: OWNER = 8;
21
+ */
22
+ OWNER = 8,
23
+ /**
24
+ * Employee group. Only a user can be in one of these roles.
25
+ *
26
+ * @generated from protobuf enum value: MANAGER = 96;
27
+ */
28
+ MANAGER = 96,
29
+ /**
30
+ * @generated from protobuf enum value: AGENT = 104;
31
+ */
32
+ AGENT = 104,
33
+ /**
34
+ * @generated from protobuf enum value: STAFF = 112;
35
+ */
36
+ STAFF = 112,
37
+ /**
38
+ * Vendor group. A user or a business can be in this role.
39
+ *
40
+ * @generated from protobuf enum value: VENDOR = 160;
41
+ */
42
+ VENDOR = 160,
43
+ /**
44
+ * Customer group. A user or a business can be in this role, and this is the role a storefront
45
+ * customer has.
46
+ *
47
+ * @generated from protobuf enum value: CUSTOMER = 224;
48
+ */
49
+ CUSTOMER = 224,
50
+ /**
51
+ * Partner group. An entity in one of these roles has no party id.
52
+ *
53
+ * @generated from protobuf enum value: ACCOUNTANT = 272;
54
+ */
55
+ ACCOUNTANT = 272,
56
+ /**
57
+ * @generated from protobuf enum value: AUDITOR = 280;
58
+ */
59
+ AUDITOR = 280,
60
+ /**
61
+ * @generated from protobuf enum value: MENTOR = 304;
62
+ */
63
+ MENTOR = 304,
64
+ /**
65
+ * No rights at all to the business. Also what Java returns for an id it does not recognise, so a
66
+ * client that receives this should treat the link as unusable rather than as an error.
67
+ *
68
+ * @generated from protobuf enum value: NONE = 4095;
69
+ */
70
+ NONE = 4095
71
+ }
@@ -0,0 +1,76 @@
1
+ // @ts-nocheck
2
+ // @generated by protobuf-ts 2.11.1 with parameter long_type_bigint
3
+ // @generated from protobuf file "Role.proto" (package "com.merabills.storefront", syntax proto3)
4
+ // tslint:disable
5
+ /**
6
+ * What an entity linked to a business may do with it - the role of a BusinessLink. Values are
7
+ * computed ids ((groupId << 6) | roleId), not ordinals, and must never change; a client can recover
8
+ * the group with (role >> 6) but not the rights, which are not on the wire.
9
+ *
10
+ * @generated from protobuf enum com.merabills.storefront.Role
11
+ */
12
+ export var Role;
13
+ (function (Role) {
14
+ /**
15
+ * Owner group. Only a user can be in one of these roles.
16
+ *
17
+ * Can do anything, and is the entity that is billed
18
+ *
19
+ * @generated from protobuf enum value: PRIMARY_OWNER = 0;
20
+ */
21
+ Role[Role["PRIMARY_OWNER"] = 0] = "PRIMARY_OWNER";
22
+ /**
23
+ * Can do anything except remove the primary owner
24
+ *
25
+ * @generated from protobuf enum value: OWNER = 8;
26
+ */
27
+ Role[Role["OWNER"] = 8] = "OWNER";
28
+ /**
29
+ * Employee group. Only a user can be in one of these roles.
30
+ *
31
+ * @generated from protobuf enum value: MANAGER = 96;
32
+ */
33
+ Role[Role["MANAGER"] = 96] = "MANAGER";
34
+ /**
35
+ * @generated from protobuf enum value: AGENT = 104;
36
+ */
37
+ Role[Role["AGENT"] = 104] = "AGENT";
38
+ /**
39
+ * @generated from protobuf enum value: STAFF = 112;
40
+ */
41
+ Role[Role["STAFF"] = 112] = "STAFF";
42
+ /**
43
+ * Vendor group. A user or a business can be in this role.
44
+ *
45
+ * @generated from protobuf enum value: VENDOR = 160;
46
+ */
47
+ Role[Role["VENDOR"] = 160] = "VENDOR";
48
+ /**
49
+ * Customer group. A user or a business can be in this role, and this is the role a storefront
50
+ * customer has.
51
+ *
52
+ * @generated from protobuf enum value: CUSTOMER = 224;
53
+ */
54
+ Role[Role["CUSTOMER"] = 224] = "CUSTOMER";
55
+ /**
56
+ * Partner group. An entity in one of these roles has no party id.
57
+ *
58
+ * @generated from protobuf enum value: ACCOUNTANT = 272;
59
+ */
60
+ Role[Role["ACCOUNTANT"] = 272] = "ACCOUNTANT";
61
+ /**
62
+ * @generated from protobuf enum value: AUDITOR = 280;
63
+ */
64
+ Role[Role["AUDITOR"] = 280] = "AUDITOR";
65
+ /**
66
+ * @generated from protobuf enum value: MENTOR = 304;
67
+ */
68
+ Role[Role["MENTOR"] = 304] = "MENTOR";
69
+ /**
70
+ * No rights at all to the business. Also what Java returns for an id it does not recognise, so a
71
+ * client that receives this should treat the link as unusable rather than as an error.
72
+ *
73
+ * @generated from protobuf enum value: NONE = 4095;
74
+ */
75
+ Role[Role["NONE"] = 4095] = "NONE";
76
+ })(Role || (Role = {}));
@@ -0,0 +1,85 @@
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 { Address } from "./Address";
8
+ import { ShoppingList } from "./ShoppingList";
9
+ import { FulfillmentMode } from "./FulfillmentMode";
10
+ import { OrderStatus } from "./OrderStatus";
11
+ /**
12
+ * The payload of a SALES_ORDER message: an order placed by a customer.
13
+ * Excluded: serviceStationNumber, dueDate.
14
+ *
15
+ * @generated from protobuf message com.merabills.storefront.SalesOrderPayload
16
+ */
17
+ export interface SalesOrderPayload {
18
+ /**
19
+ * @generated from protobuf field: com.merabills.storefront.OrderStatus status = 1
20
+ */
21
+ status: OrderStatus;
22
+ /**
23
+ * @generated from protobuf field: com.merabills.storefront.FulfillmentMode fulfillmentMode = 2
24
+ */
25
+ fulfillmentMode: FulfillmentMode;
26
+ /**
27
+ * What was ordered
28
+ *
29
+ * @generated from protobuf field: com.merabills.storefront.ShoppingList shoppingList = 3
30
+ */
31
+ shoppingList?: ShoppingList;
32
+ /**
33
+ * Total of the shopping list, multiplied by Constants.AMOUNT_FACTOR
34
+ *
35
+ * @generated from protobuf field: int64 shoppingListTotal = 4
36
+ */
37
+ shoppingListTotal: bigint;
38
+ /**
39
+ * Number of items in the shopping list
40
+ *
41
+ * @generated from protobuf field: int32 shoppingListCount = 5
42
+ */
43
+ shoppingListCount: number;
44
+ /**
45
+ * Id of the delivery address, in User.addresses of the customer. 0 means no address.
46
+ *
47
+ * @generated from protobuf field: int64 deliveryAddressId = 6
48
+ */
49
+ deliveryAddressId: bigint;
50
+ /**
51
+ * If present, takes precedence over delivery address id
52
+ *
53
+ * @generated from protobuf field: com.merabills.storefront.Address deliveryAddress = 7
54
+ */
55
+ deliveryAddress?: Address;
56
+ /**
57
+ * Time this order was created, in milliseconds since Jan 1, 1970 00:00:00 UTC
58
+ *
59
+ * @generated from protobuf field: int64 creationDate = 8
60
+ */
61
+ creationDate: bigint;
62
+ /**
63
+ * Note from the customer (at most Constants.SALES_ORDER_NOTE_MAX_LENGTH)
64
+ *
65
+ * @generated from protobuf field: optional string note = 9
66
+ */
67
+ note?: string;
68
+ /**
69
+ * Payment received towards this order so far. Can only be set by an operator of the business.
70
+ *
71
+ * @generated from protobuf field: optional int64 paymentReceived = 10
72
+ */
73
+ paymentReceived?: bigint;
74
+ }
75
+ declare class SalesOrderPayload$Type extends MessageType<SalesOrderPayload> {
76
+ constructor();
77
+ create(value?: PartialMessage<SalesOrderPayload>): SalesOrderPayload;
78
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SalesOrderPayload): SalesOrderPayload;
79
+ internalBinaryWrite(message: SalesOrderPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
80
+ }
81
+ /**
82
+ * @generated MessageType for protobuf message com.merabills.storefront.SalesOrderPayload
83
+ */
84
+ export declare const SalesOrderPayload: SalesOrderPayload$Type;
85
+ export {};
@@ -0,0 +1,123 @@
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 { Address } from "./Address";
6
+ import { ShoppingList } from "./ShoppingList";
7
+ import { FulfillmentMode } from "./FulfillmentMode";
8
+ import { OrderStatus } from "./OrderStatus";
9
+ // @generated message type with reflection information, may provide speed optimized methods
10
+ class SalesOrderPayload$Type extends MessageType {
11
+ constructor() {
12
+ super("com.merabills.storefront.SalesOrderPayload", [
13
+ { no: 1, name: "status", kind: "enum", T: () => ["com.merabills.storefront.OrderStatus", OrderStatus] },
14
+ { no: 2, name: "fulfillmentMode", kind: "enum", T: () => ["com.merabills.storefront.FulfillmentMode", FulfillmentMode] },
15
+ { no: 3, name: "shoppingList", kind: "message", T: () => ShoppingList },
16
+ { no: 4, name: "shoppingListTotal", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
17
+ { no: 5, name: "shoppingListCount", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
18
+ { no: 6, name: "deliveryAddressId", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
19
+ { no: 7, name: "deliveryAddress", kind: "message", T: () => Address },
20
+ { no: 8, name: "creationDate", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
21
+ { no: 9, name: "note", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
22
+ { no: 10, name: "paymentReceived", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
23
+ ]);
24
+ }
25
+ create(value) {
26
+ const message = globalThis.Object.create((this.messagePrototype));
27
+ message.status = 0;
28
+ message.fulfillmentMode = 0;
29
+ message.shoppingListTotal = 0n;
30
+ message.shoppingListCount = 0;
31
+ message.deliveryAddressId = 0n;
32
+ message.creationDate = 0n;
33
+ if (value !== undefined)
34
+ reflectionMergePartial(this, message, value);
35
+ return message;
36
+ }
37
+ internalBinaryRead(reader, length, options, target) {
38
+ let message = target ?? this.create(), end = reader.pos + length;
39
+ while (reader.pos < end) {
40
+ let [fieldNo, wireType] = reader.tag();
41
+ switch (fieldNo) {
42
+ case /* com.merabills.storefront.OrderStatus status */ 1:
43
+ message.status = reader.int32();
44
+ break;
45
+ case /* com.merabills.storefront.FulfillmentMode fulfillmentMode */ 2:
46
+ message.fulfillmentMode = reader.int32();
47
+ break;
48
+ case /* com.merabills.storefront.ShoppingList shoppingList */ 3:
49
+ message.shoppingList = ShoppingList.internalBinaryRead(reader, reader.uint32(), options, message.shoppingList);
50
+ break;
51
+ case /* int64 shoppingListTotal */ 4:
52
+ message.shoppingListTotal = reader.int64().toBigInt();
53
+ break;
54
+ case /* int32 shoppingListCount */ 5:
55
+ message.shoppingListCount = reader.int32();
56
+ break;
57
+ case /* int64 deliveryAddressId */ 6:
58
+ message.deliveryAddressId = reader.int64().toBigInt();
59
+ break;
60
+ case /* com.merabills.storefront.Address deliveryAddress */ 7:
61
+ message.deliveryAddress = Address.internalBinaryRead(reader, reader.uint32(), options, message.deliveryAddress);
62
+ break;
63
+ case /* int64 creationDate */ 8:
64
+ message.creationDate = reader.int64().toBigInt();
65
+ break;
66
+ case /* optional string note */ 9:
67
+ message.note = reader.string();
68
+ break;
69
+ case /* optional int64 paymentReceived */ 10:
70
+ message.paymentReceived = reader.int64().toBigInt();
71
+ break;
72
+ default:
73
+ let u = options.readUnknownField;
74
+ if (u === "throw")
75
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
76
+ let d = reader.skip(wireType);
77
+ if (u !== false)
78
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
79
+ }
80
+ }
81
+ return message;
82
+ }
83
+ internalBinaryWrite(message, writer, options) {
84
+ /* com.merabills.storefront.OrderStatus status = 1; */
85
+ if (message.status !== 0)
86
+ writer.tag(1, WireType.Varint).int32(message.status);
87
+ /* com.merabills.storefront.FulfillmentMode fulfillmentMode = 2; */
88
+ if (message.fulfillmentMode !== 0)
89
+ writer.tag(2, WireType.Varint).int32(message.fulfillmentMode);
90
+ /* com.merabills.storefront.ShoppingList shoppingList = 3; */
91
+ if (message.shoppingList)
92
+ ShoppingList.internalBinaryWrite(message.shoppingList, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
93
+ /* int64 shoppingListTotal = 4; */
94
+ if (message.shoppingListTotal !== 0n)
95
+ writer.tag(4, WireType.Varint).int64(message.shoppingListTotal);
96
+ /* int32 shoppingListCount = 5; */
97
+ if (message.shoppingListCount !== 0)
98
+ writer.tag(5, WireType.Varint).int32(message.shoppingListCount);
99
+ /* int64 deliveryAddressId = 6; */
100
+ if (message.deliveryAddressId !== 0n)
101
+ writer.tag(6, WireType.Varint).int64(message.deliveryAddressId);
102
+ /* com.merabills.storefront.Address deliveryAddress = 7; */
103
+ if (message.deliveryAddress)
104
+ Address.internalBinaryWrite(message.deliveryAddress, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
105
+ /* int64 creationDate = 8; */
106
+ if (message.creationDate !== 0n)
107
+ writer.tag(8, WireType.Varint).int64(message.creationDate);
108
+ /* optional string note = 9; */
109
+ if (message.note !== undefined)
110
+ writer.tag(9, WireType.LengthDelimited).string(message.note);
111
+ /* optional int64 paymentReceived = 10; */
112
+ if (message.paymentReceived !== undefined)
113
+ writer.tag(10, WireType.Varint).int64(message.paymentReceived);
114
+ let u = options.writeUnknownFields;
115
+ if (u !== false)
116
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
117
+ return writer;
118
+ }
119
+ }
120
+ /**
121
+ * @generated MessageType for protobuf message com.merabills.storefront.SalesOrderPayload
122
+ */
123
+ export const SalesOrderPayload = new SalesOrderPayload$Type();
@@ -0,0 +1,99 @@
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 { ShoppingListItem } from "./ShoppingListItem";
8
+ /**
9
+ * A list of packages being bought - a customer's shopping cart, or the contents of an order.
10
+ * Excluded: transactionTime.
11
+ * Not included because it is derived: totalAmount (= totalAmountBeforeDiscount - discount), totalTax,
12
+ * itemCount (= existingItemCount + deletedItemCount), isSaved.
13
+ *
14
+ * @generated from protobuf message com.merabills.storefront.ShoppingList
15
+ */
16
+ export interface ShoppingList {
17
+ /**
18
+ * True once the customer is done editing this list, after which the business may edit it.
19
+ * Only a final list can have deleted items. This flag is never unset.
20
+ *
21
+ * @generated from protobuf field: bool isFinal = 1
22
+ */
23
+ isFinal: boolean;
24
+ /**
25
+ * True when the delivery charge is carried as an item of its own, with the package id
26
+ * ReservedPackage.DELIVERY_CHARGE_PACKAGE, rather than being added to the total
27
+ *
28
+ * @generated from protobuf field: bool autoAddDeliveryCharge = 2
29
+ */
30
+ autoAddDeliveryCharge: boolean;
31
+ /**
32
+ * The same, for ReservedPackage.SERVICE_CHARGE_PACKAGE
33
+ *
34
+ * @generated from protobuf field: bool autoAddServiceCharge = 3
35
+ */
36
+ autoAddServiceCharge: boolean;
37
+ /**
38
+ * Id of the inventory location the items are drawn from. 0 is the default location.
39
+ *
40
+ * @generated from protobuf field: int32 inventoryLocationId = 4
41
+ */
42
+ inventoryLocationId: number;
43
+ /**
44
+ * Id of the PriceList the prices came from. A cart with none yet uses the id built from
45
+ * Constants.DEFAULT_SALE_PRICE_LIST.
46
+ *
47
+ * @generated from protobuf field: int64 priceListId = 5
48
+ */
49
+ priceListId: bigint;
50
+ /**
51
+ * Sum of the final prices of the existing items x Constants.AMOUNT_FACTOR. Authoritative - do not
52
+ * recompute; display it minus discount rather than summing items yourself.
53
+ *
54
+ * @generated from protobuf field: int64 totalAmountBeforeDiscount = 6
55
+ */
56
+ totalAmountBeforeDiscount: bigint;
57
+ /**
58
+ * Discount on the whole list, multiplied by Constants.AMOUNT_FACTOR
59
+ *
60
+ * @generated from protobuf field: int64 discount = 7
61
+ */
62
+ discount: bigint;
63
+ /**
64
+ * Number of existing items - set even when the items themselves are not sent
65
+ *
66
+ * @generated from protobuf field: int32 existingItemCount = 8
67
+ */
68
+ existingItemCount: number;
69
+ /**
70
+ * Number of deleted items - set even when the items themselves are not sent
71
+ *
72
+ * @generated from protobuf field: int32 deletedItemCount = 9
73
+ */
74
+ deletedItemCount: number;
75
+ /**
76
+ * The items in this list (this list and the deleted items below hold at most
77
+ * Constants.SHOPPING_LIST_MAX_ITEMS items in all)
78
+ *
79
+ * @generated from protobuf field: repeated com.merabills.storefront.ShoppingListItem existingItems = 10
80
+ */
81
+ existingItems: ShoppingListItem[];
82
+ /**
83
+ * Items that were in this list when it was made final, and have since been deleted or replaced
84
+ *
85
+ * @generated from protobuf field: repeated com.merabills.storefront.ShoppingListItem deletedItems = 11
86
+ */
87
+ deletedItems: ShoppingListItem[];
88
+ }
89
+ declare class ShoppingList$Type extends MessageType<ShoppingList> {
90
+ constructor();
91
+ create(value?: PartialMessage<ShoppingList>): ShoppingList;
92
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ShoppingList): ShoppingList;
93
+ internalBinaryWrite(message: ShoppingList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
94
+ }
95
+ /**
96
+ * @generated MessageType for protobuf message com.merabills.storefront.ShoppingList
97
+ */
98
+ export declare const ShoppingList: ShoppingList$Type;
99
+ export {};