@peabody-soft/mbs-model-ts 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CartEditor.d.ts +10 -5
- package/dist/CartEditor.js +232 -125
- package/dist/Catalog.js +26 -18
- package/dist/Enums.d.ts +1 -1
- package/dist/Enums.js +2 -1
- package/dist/GeneralSettings.d.ts +4 -2
- package/dist/GeneralSettings.js +18 -7
- package/dist/Ids.d.ts +2 -0
- package/dist/Ids.js +10 -0
- package/dist/Message.js +3 -2
- package/dist/Model.d.ts +5 -0
- package/dist/Model.js +263 -50
- package/dist/Package.js +2 -2
- package/dist/Price.js +6 -2
- package/dist/Product.d.ts +5 -3
- package/dist/Product.js +30 -18
- package/dist/Profile.d.ts +1 -0
- package/dist/Profile.js +91 -4
- package/dist/ProtoMap.d.ts +15 -8
- package/dist/ProtoMap.js +267 -140
- package/dist/ShoppingList.d.ts +30 -1
- package/dist/ShoppingList.js +345 -35
- package/dist/SyncCache.d.ts +9 -0
- package/dist/SyncCache.js +93 -30
- package/dist/SyncState.js +1 -1
- package/dist/Tax.d.ts +12 -4
- package/dist/Tax.js +33 -4
- package/dist/TaxHelper.d.ts +12 -0
- package/dist/TaxHelper.js +93 -0
- package/dist/TaxType.d.ts +7 -0
- package/dist/TaxType.js +32 -0
- package/dist/WorkingDays.d.ts +3 -2
- package/dist/WorkingDays.js +16 -12
- package/dist/generated/AttachmentType.d.ts +19 -1
- package/dist/generated/AttachmentType.js +18 -0
- package/dist/generated/AuthTokens.d.ts +3 -1
- package/dist/generated/BusinessLink.d.ts +4 -1
- package/dist/generated/BusinessSyncInRequest.d.ts +11 -3
- package/dist/generated/BusinessSyncInResponse.d.ts +5 -4
- package/dist/generated/BusinessSyncOutRequest.d.ts +37 -10
- package/dist/generated/BusinessSyncOutRequest.js +42 -29
- package/dist/generated/BusinessSyncOutResponse.d.ts +14 -1
- package/dist/generated/Configuration.d.ts +2 -1
- package/dist/generated/CreateUserRequest.d.ts +8 -2
- package/dist/generated/Entity.d.ts +7 -3
- package/dist/generated/GeneralSettings.d.ts +14 -4
- package/dist/generated/GeneralSettings.js +9 -1
- package/dist/generated/Message.d.ts +4 -2
- package/dist/generated/Product.d.ts +10 -1
- package/dist/generated/Product.js +9 -1
- package/dist/generated/ProfileSyncOutRequest.d.ts +17 -1
- package/dist/generated/ProfileSyncOutResponse.d.ts +8 -3
- package/dist/generated/SalesOrderPayload.d.ts +7 -2
- package/dist/generated/ShoppingList.d.ts +6 -3
- package/dist/generated/ShoppingListItem.d.ts +21 -6
- package/dist/generated/Tax.d.ts +4 -4
- package/dist/generated/Tax.js +7 -8
- package/dist/generated/WorkingDays.d.ts +9 -1
- package/dist/generated/WorkingDays.js +12 -4
- package/dist/generated/WorkingHoursRange.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/package.json +55 -55
- package/dist/generated/TaxType.d.ts +0 -25
- package/dist/generated/TaxType.js +0 -30
|
@@ -7,16 +7,24 @@ import { MessageType } from "@protobuf-ts/runtime";
|
|
|
7
7
|
import { Message } from "./Message";
|
|
8
8
|
/**
|
|
9
9
|
* Pushes the business entities a customer has changed - their shopping cart and the orders placed
|
|
10
|
-
* from it - to one business database
|
|
10
|
+
* from it - to one business database. The request names no business: the link token in the
|
|
11
|
+
* AuthTokens of the authorization header does, as a link names exactly one.
|
|
12
|
+
* Not implemented yet: the route (shopBusinessSyncIn) answers 501, and what is said here and in the
|
|
13
|
+
* BusinessSyncInResponse is the contract that it is to meet, and not behaviour that the server has.
|
|
14
|
+
* ProtoMap.fromProto accepts the paymentReceived of an order, and the senderId and status of a message,
|
|
15
|
+
* as they are sent, so, sync in has to enforce who may set each of them when it is written.
|
|
11
16
|
* An entity being synced in carries the id it already has, or Constants.ENTITY_ID_NULL if the
|
|
12
17
|
* caller is creating it and the server is to assign one; incoming update numbers are the caller's
|
|
13
|
-
* own and are replaced by the server, which returns the new ones in the
|
|
18
|
+
* own and are replaced by the server, which returns the messages bearing the new ones in the
|
|
19
|
+
* BusinessSyncInResponse.
|
|
14
20
|
*
|
|
15
21
|
* @generated from protobuf message com.merabills.storefront.BusinessSyncInRequest
|
|
16
22
|
*/
|
|
17
23
|
export interface BusinessSyncInRequest {
|
|
18
24
|
/**
|
|
19
|
-
* Client-side cursor for the customer's orders and shopping cart (Constants.MESSAGE_ENTITY_TYPE_ID)
|
|
25
|
+
* Client-side cursor for the customer's orders and shopping cart (Constants.MESSAGE_ENTITY_TYPE_ID):
|
|
26
|
+
* how far the client's sync outs of them have got, which is not moved by a push. The answer to a push
|
|
27
|
+
* is only the messages that were pushed, so, it does not depend on this.
|
|
20
28
|
*
|
|
21
29
|
* @generated from protobuf field: int64 messageUpdateNumber = 1
|
|
22
30
|
*/
|
|
@@ -7,10 +7,11 @@ import { MessageType } from "@protobuf-ts/runtime";
|
|
|
7
7
|
import { Message } from "./Message";
|
|
8
8
|
import { AuthTokens } from "./AuthTokens";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Not implemented yet (the route answers 501): this is the contract that it is to meet.
|
|
11
|
+
* The answer to a BusinessSyncInRequest: the messages the server now holds for what was pushed,
|
|
12
|
+
* which bear the update numbers it assigned, and any tokens it renewed. A push is not a read, so, do
|
|
13
|
+
* not move the message cursor with these update numbers: a change somebody else made, with an update
|
|
14
|
+
* number below them, would then never be sent. The next sync out returns what was pushed as well.
|
|
14
15
|
*
|
|
15
16
|
* @generated from protobuf message com.merabills.storefront.BusinessSyncInResponse
|
|
16
17
|
*/
|
|
@@ -10,54 +10,81 @@ import { MessageType } from "@protobuf-ts/runtime";
|
|
|
10
10
|
* Entity.updateNumber of that type already synced (0 asks for everything), and a response of
|
|
11
11
|
* Constants.SYNC_OUT_LIMIT entities means call again with the updated cursors. The caller and the
|
|
12
12
|
* business's link token are in the AuthTokens of the authorization header, not in this message.
|
|
13
|
+
* The call fails with 404 (NotFoundException) when the business does not exist, has been deleted,
|
|
14
|
+
* or does not allow customers to join it, whoever the caller is - see BusinessSyncOutResponse.
|
|
15
|
+
* Whether it has turned online shopping on is not a refusal: that is for the client to decide.
|
|
13
16
|
*
|
|
14
17
|
* @generated from protobuf message com.merabills.storefront.BusinessSyncOutRequest
|
|
15
18
|
*/
|
|
16
19
|
export interface BusinessSyncOutRequest {
|
|
17
20
|
/**
|
|
18
|
-
* The business to sync out,
|
|
19
|
-
*
|
|
21
|
+
* The business to sync out, named one way or the other, and one of the two is required. A client that
|
|
22
|
+
* does not yet hold the Business names it by its businessId, and one that does names it by the entity id
|
|
23
|
+
* it read there (Business.entity.id), which is what every later read is to use. The pages of one read are
|
|
24
|
+
* that read, and go on naming the business the way its first request did.
|
|
20
25
|
*
|
|
21
|
-
* @generated from protobuf
|
|
26
|
+
* @generated from protobuf oneof: business
|
|
22
27
|
*/
|
|
23
|
-
|
|
28
|
+
business: {
|
|
29
|
+
oneofKind: "businessId";
|
|
30
|
+
/**
|
|
31
|
+
* Its unique, lower case, url friendly id (Constants.BUSINESS_ID_MIN_LENGTH to
|
|
32
|
+
* Constants.BUSINESS_ID_MAX_LENGTH). One that names no business, which includes one that is not a
|
|
33
|
+
* possible id, is the same as a business that does not exist. This is for a caller that has no link
|
|
34
|
+
* token: a link token is refused together with it, and is to be sent with businessEntityId.
|
|
35
|
+
*
|
|
36
|
+
* @generated from protobuf field: string businessId = 1
|
|
37
|
+
*/
|
|
38
|
+
businessId: string;
|
|
39
|
+
} | {
|
|
40
|
+
oneofKind: "businessEntityId";
|
|
41
|
+
/**
|
|
42
|
+
* Its entity id, which has to be that of a business. If the AuthTokens carry a link token, it has to
|
|
43
|
+
* be the link token of this business, and a link token of any other is refused.
|
|
44
|
+
*
|
|
45
|
+
* @generated from protobuf field: int64 businessEntityId = 2
|
|
46
|
+
*/
|
|
47
|
+
businessEntityId: bigint;
|
|
48
|
+
} | {
|
|
49
|
+
oneofKind: undefined;
|
|
50
|
+
};
|
|
24
51
|
/**
|
|
25
52
|
* Cursor for the Business entity (Constants.BUSINESS_ENTITY_TYPE_ID). Separate from, and never
|
|
26
53
|
* mixed with, ProfileSyncOutRequest.businessUpdateNumber.
|
|
27
54
|
*
|
|
28
|
-
* @generated from protobuf field: int64 businessUpdateNumber =
|
|
55
|
+
* @generated from protobuf field: int64 businessUpdateNumber = 3
|
|
29
56
|
*/
|
|
30
57
|
businessUpdateNumber: bigint;
|
|
31
58
|
/**
|
|
32
59
|
* Cursor for photos of the business, its products and its packages (Constants.ATTACHMENT_ENTITY_TYPE_ID).
|
|
33
60
|
*
|
|
34
|
-
* @generated from protobuf field: int64 attachmentUpdateNumber =
|
|
61
|
+
* @generated from protobuf field: int64 attachmentUpdateNumber = 4
|
|
35
62
|
*/
|
|
36
63
|
attachmentUpdateNumber: bigint;
|
|
37
64
|
/**
|
|
38
65
|
* The UrlAndToken.expiry of the attachment base url this client is holding, sent back unchanged;
|
|
39
66
|
* 0 means it holds none. A time, not a cursor - it does not rise monotonically.
|
|
40
67
|
*
|
|
41
|
-
* @generated from protobuf field: int64 attachmentBaseUrlExpiry =
|
|
68
|
+
* @generated from protobuf field: int64 attachmentBaseUrlExpiry = 5
|
|
42
69
|
*/
|
|
43
70
|
attachmentBaseUrlExpiry: bigint;
|
|
44
71
|
/**
|
|
45
72
|
* Cursor for the business's settings (Constants.CONFIGURATION_ENTITY_TYPE_ID).
|
|
46
73
|
*
|
|
47
|
-
* @generated from protobuf field: int64 configurationUpdateNumber =
|
|
74
|
+
* @generated from protobuf field: int64 configurationUpdateNumber = 6
|
|
48
75
|
*/
|
|
49
76
|
configurationUpdateNumber: bigint;
|
|
50
77
|
/**
|
|
51
78
|
* Cursor for the customer's orders and shopping cart (Constants.MESSAGE_ENTITY_TYPE_ID).
|
|
52
79
|
*
|
|
53
|
-
* @generated from protobuf field: int64 messageUpdateNumber =
|
|
80
|
+
* @generated from protobuf field: int64 messageUpdateNumber = 7
|
|
54
81
|
*/
|
|
55
82
|
messageUpdateNumber: bigint;
|
|
56
83
|
/**
|
|
57
84
|
* Cursor for the whole catalog - product categories, products, packages, price lists and prices,
|
|
58
85
|
* which all share this one cursor (Constants.ITEM_ENTITY_TYPE_ID).
|
|
59
86
|
*
|
|
60
|
-
* @generated from protobuf field: int64 itemUpdateNumber =
|
|
87
|
+
* @generated from protobuf field: int64 itemUpdateNumber = 8
|
|
61
88
|
*/
|
|
62
89
|
itemUpdateNumber: bigint;
|
|
63
90
|
}
|
|
@@ -6,18 +6,19 @@ import { MessageType } from "@protobuf-ts/runtime";
|
|
|
6
6
|
class BusinessSyncOutRequest$Type extends MessageType {
|
|
7
7
|
constructor() {
|
|
8
8
|
super("com.merabills.storefront.BusinessSyncOutRequest", [
|
|
9
|
-
{ no: 1, name: "businessId", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
10
|
-
{ no: 2, name: "
|
|
11
|
-
{ no: 3, name: "
|
|
12
|
-
{ no: 4, name: "
|
|
13
|
-
{ no: 5, name: "
|
|
14
|
-
{ no: 6, name: "
|
|
15
|
-
{ no: 7, name: "
|
|
9
|
+
{ no: 1, name: "businessId", kind: "scalar", oneof: "business", T: 9 /*ScalarType.STRING*/ },
|
|
10
|
+
{ no: 2, name: "businessEntityId", kind: "scalar", oneof: "business", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
11
|
+
{ no: 3, name: "businessUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
12
|
+
{ no: 4, name: "attachmentUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
13
|
+
{ no: 5, name: "attachmentBaseUrlExpiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
14
|
+
{ no: 6, name: "configurationUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
15
|
+
{ no: 7, name: "messageUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
16
|
+
{ no: 8, name: "itemUpdateNumber", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
|
|
16
17
|
]);
|
|
17
18
|
}
|
|
18
19
|
create(value) {
|
|
19
20
|
const message = globalThis.Object.create((this.messagePrototype));
|
|
20
|
-
message.
|
|
21
|
+
message.business = { oneofKind: undefined };
|
|
21
22
|
message.businessUpdateNumber = 0n;
|
|
22
23
|
message.attachmentUpdateNumber = 0n;
|
|
23
24
|
message.attachmentBaseUrlExpiry = 0n;
|
|
@@ -34,24 +35,33 @@ class BusinessSyncOutRequest$Type extends MessageType {
|
|
|
34
35
|
let [fieldNo, wireType] = reader.tag();
|
|
35
36
|
switch (fieldNo) {
|
|
36
37
|
case /* string businessId */ 1:
|
|
37
|
-
message.
|
|
38
|
+
message.business = {
|
|
39
|
+
oneofKind: "businessId",
|
|
40
|
+
businessId: reader.string()
|
|
41
|
+
};
|
|
38
42
|
break;
|
|
39
|
-
case /* int64
|
|
43
|
+
case /* int64 businessEntityId */ 2:
|
|
44
|
+
message.business = {
|
|
45
|
+
oneofKind: "businessEntityId",
|
|
46
|
+
businessEntityId: reader.int64().toBigInt()
|
|
47
|
+
};
|
|
48
|
+
break;
|
|
49
|
+
case /* int64 businessUpdateNumber */ 3:
|
|
40
50
|
message.businessUpdateNumber = reader.int64().toBigInt();
|
|
41
51
|
break;
|
|
42
|
-
case /* int64 attachmentUpdateNumber */
|
|
52
|
+
case /* int64 attachmentUpdateNumber */ 4:
|
|
43
53
|
message.attachmentUpdateNumber = reader.int64().toBigInt();
|
|
44
54
|
break;
|
|
45
|
-
case /* int64 attachmentBaseUrlExpiry */
|
|
55
|
+
case /* int64 attachmentBaseUrlExpiry */ 5:
|
|
46
56
|
message.attachmentBaseUrlExpiry = reader.int64().toBigInt();
|
|
47
57
|
break;
|
|
48
|
-
case /* int64 configurationUpdateNumber */
|
|
58
|
+
case /* int64 configurationUpdateNumber */ 6:
|
|
49
59
|
message.configurationUpdateNumber = reader.int64().toBigInt();
|
|
50
60
|
break;
|
|
51
|
-
case /* int64 messageUpdateNumber */
|
|
61
|
+
case /* int64 messageUpdateNumber */ 7:
|
|
52
62
|
message.messageUpdateNumber = reader.int64().toBigInt();
|
|
53
63
|
break;
|
|
54
|
-
case /* int64 itemUpdateNumber */
|
|
64
|
+
case /* int64 itemUpdateNumber */ 8:
|
|
55
65
|
message.itemUpdateNumber = reader.int64().toBigInt();
|
|
56
66
|
break;
|
|
57
67
|
default:
|
|
@@ -67,26 +77,29 @@ class BusinessSyncOutRequest$Type extends MessageType {
|
|
|
67
77
|
}
|
|
68
78
|
internalBinaryWrite(message, writer, options) {
|
|
69
79
|
/* string businessId = 1; */
|
|
70
|
-
if (message.
|
|
71
|
-
writer.tag(1, WireType.LengthDelimited).string(message.businessId);
|
|
72
|
-
/* int64
|
|
80
|
+
if (message.business.oneofKind === "businessId")
|
|
81
|
+
writer.tag(1, WireType.LengthDelimited).string(message.business.businessId);
|
|
82
|
+
/* int64 businessEntityId = 2; */
|
|
83
|
+
if (message.business.oneofKind === "businessEntityId")
|
|
84
|
+
writer.tag(2, WireType.Varint).int64(message.business.businessEntityId);
|
|
85
|
+
/* int64 businessUpdateNumber = 3; */
|
|
73
86
|
if (message.businessUpdateNumber !== 0n)
|
|
74
|
-
writer.tag(
|
|
75
|
-
/* int64 attachmentUpdateNumber =
|
|
87
|
+
writer.tag(3, WireType.Varint).int64(message.businessUpdateNumber);
|
|
88
|
+
/* int64 attachmentUpdateNumber = 4; */
|
|
76
89
|
if (message.attachmentUpdateNumber !== 0n)
|
|
77
|
-
writer.tag(
|
|
78
|
-
/* int64 attachmentBaseUrlExpiry =
|
|
90
|
+
writer.tag(4, WireType.Varint).int64(message.attachmentUpdateNumber);
|
|
91
|
+
/* int64 attachmentBaseUrlExpiry = 5; */
|
|
79
92
|
if (message.attachmentBaseUrlExpiry !== 0n)
|
|
80
|
-
writer.tag(
|
|
81
|
-
/* int64 configurationUpdateNumber =
|
|
93
|
+
writer.tag(5, WireType.Varint).int64(message.attachmentBaseUrlExpiry);
|
|
94
|
+
/* int64 configurationUpdateNumber = 6; */
|
|
82
95
|
if (message.configurationUpdateNumber !== 0n)
|
|
83
|
-
writer.tag(
|
|
84
|
-
/* int64 messageUpdateNumber =
|
|
96
|
+
writer.tag(6, WireType.Varint).int64(message.configurationUpdateNumber);
|
|
97
|
+
/* int64 messageUpdateNumber = 7; */
|
|
85
98
|
if (message.messageUpdateNumber !== 0n)
|
|
86
|
-
writer.tag(
|
|
87
|
-
/* int64 itemUpdateNumber =
|
|
99
|
+
writer.tag(7, WireType.Varint).int64(message.messageUpdateNumber);
|
|
100
|
+
/* int64 itemUpdateNumber = 8; */
|
|
88
101
|
if (message.itemUpdateNumber !== 0n)
|
|
89
|
-
writer.tag(
|
|
102
|
+
writer.tag(8, WireType.Varint).int64(message.itemUpdateNumber);
|
|
90
103
|
let u = options.writeUnknownFields;
|
|
91
104
|
if (u !== false)
|
|
92
105
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -23,6 +23,15 @@ import { AuthTokens } from "./AuthTokens";
|
|
|
23
23
|
* (updateNumber's update-type bits = Constants.UPDATE_TYPE_DELETED) means the entity, and what it
|
|
24
24
|
* owned, was deleted. At most Constants.SYNC_OUT_LIMIT entities arrive together - that many means
|
|
25
25
|
* call again with the raised cursors.
|
|
26
|
+
* There is no response, but a 404 (NotFoundException), when the business is not one a storefront can
|
|
27
|
+
* open: it does not exist or has been deleted, or it does not allow customers to join it. Both are
|
|
28
|
+
* looked at on every call, whatever the cursors are, and are the same to every caller: one that holds
|
|
29
|
+
* a link token of the business, a customer that joined it, is told no differently.
|
|
30
|
+
* A client that has the business cached and is told this must stop showing it.
|
|
31
|
+
* Whether the business has turned online shopping on is not looked at: a client that has read all it
|
|
32
|
+
* is sent decides it from the GeneralSettings that it then holds (onlineShoppingEnabled). Settings that
|
|
33
|
+
* are not there, or that have been deleted, or that say it has not, make it a business that a storefront
|
|
34
|
+
* cannot open, and a client that finds so must stop showing it as if it had been told this.
|
|
26
35
|
*
|
|
27
36
|
* @generated from protobuf message com.merabills.storefront.BusinessSyncOutResponse
|
|
28
37
|
*/
|
|
@@ -35,8 +44,12 @@ export interface BusinessSyncOutResponse {
|
|
|
35
44
|
*/
|
|
36
45
|
authTokens?: AuthTokens;
|
|
37
46
|
/**
|
|
38
|
-
* The business named by the request
|
|
47
|
+
* The business named by the request, which is how a client that named it by its businessId learns
|
|
48
|
+
* its entity id for the calls that follow. Absent unless it has changed. Also carried by a
|
|
39
49
|
* ProfileSyncOutResponse, with its own separate cursor - keep the two update numbers apart.
|
|
50
|
+
* The businessId of a business can change, and this arriving changed is the only thing that says so: a
|
|
51
|
+
* client that was asked to open a business by its businessId, and holds it by its entity id, compares the
|
|
52
|
+
* two once it has read all it is sent, as the entity id does not say which business that businessId names now.
|
|
40
53
|
*
|
|
41
54
|
* @generated from protobuf field: com.merabills.storefront.Business business = 2
|
|
42
55
|
*/
|
|
@@ -26,7 +26,8 @@ export interface Configuration {
|
|
|
26
26
|
oneofKind: "generalSettings";
|
|
27
27
|
/**
|
|
28
28
|
* The publicly visible settings of the business, held in the configuration whose id is
|
|
29
|
-
* Configuration.MIN_PUBLIC_CONFIGURATION_ID
|
|
29
|
+
* Configuration.MIN_PUBLIC_CONFIGURATION_ID. Not set for settings that the server cannot read, which are a
|
|
30
|
+
* business that made none
|
|
30
31
|
*
|
|
31
32
|
* @generated from protobuf field: com.merabills.storefront.GeneralSettings generalSettings = 2
|
|
32
33
|
*/
|
|
@@ -6,7 +6,11 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
|
6
6
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
7
7
|
import { User } from "./User";
|
|
8
8
|
/**
|
|
9
|
-
* Creates a new user, optionally joining it to a business as a customer in the same call
|
|
9
|
+
* Creates a new user, optionally joining it to a business as a customer in the same call, and is
|
|
10
|
+
* answered with a ProfileSyncOutResponse. Not implemented yet: the route (shopCreateUser) answers 501, and
|
|
11
|
+
* every rule below is the contract that it is to meet, and not behaviour that the server has. See
|
|
12
|
+
* Prompt.txt, CREATE USER AND UPDATE USER, which also gives the contract of the route that updates the
|
|
13
|
+
* caller's own user (its request is a bare User, matched to the caller by entity.id).
|
|
10
14
|
*
|
|
11
15
|
* @generated from protobuf message com.merabills.storefront.CreateUserRequest
|
|
12
16
|
*/
|
|
@@ -18,7 +22,9 @@ export interface CreateUserRequest {
|
|
|
18
22
|
*/
|
|
19
23
|
user?: User;
|
|
20
24
|
/**
|
|
21
|
-
* The business to join as a customer after creating the user. 0 means none
|
|
25
|
+
* The business to join as a customer after creating the user. 0 means none, and anything else has to be
|
|
26
|
+
* the id of a business: one that is not is refused, not ignored. One that cannot be joined is to be refused
|
|
27
|
+
* as ProfileSyncOutRequest.joinBusinessId says - a 404, and the user is created all the same.
|
|
22
28
|
*
|
|
23
29
|
* @generated from protobuf field: int64 joinBusinessId = 2
|
|
24
30
|
*/
|
|
@@ -28,9 +28,13 @@ export interface Entity {
|
|
|
28
28
|
updatedAt: bigint;
|
|
29
29
|
/**
|
|
30
30
|
* Id of the database that last updated this entity; Constants.MASTER_DB_ID means the server. A
|
|
31
|
-
* client
|
|
32
|
-
* it on the next sync out.
|
|
33
|
-
*
|
|
31
|
+
* client that has a database of its own (a merchant app) stamps its own id here on every entity
|
|
32
|
+
* it pushes, so its own writes are not sent back to it on the next sync out. A storefront has no
|
|
33
|
+
* database of its own: it leaves this zero, and its sync outs leave out nobody's changes, but
|
|
34
|
+
* return everything newer than the cursors - what the caller itself pushed included, which
|
|
35
|
+
* changes nothing that it holds. Only set on business-database entities (Attachment,
|
|
36
|
+
* Configuration, Message, Item); always 0 on the profile entities User, Business and
|
|
37
|
+
* BusinessLink.
|
|
34
38
|
*
|
|
35
39
|
* @generated from protobuf field: int64 updateInfo = 3
|
|
36
40
|
*/
|
|
@@ -15,8 +15,8 @@ import { PaymentMethodDetail } from "./PaymentMethodDetail";
|
|
|
15
15
|
* The publicly visible settings of a business - tagline, contact info, location, fulfillment,
|
|
16
16
|
* payment and delivery options, and online store presentation - held in the value of the
|
|
17
17
|
* business's public Configuration entity.
|
|
18
|
-
* Excluded:
|
|
19
|
-
*
|
|
18
|
+
* Excluded: the fields of the StoreSettings base class (authToken, authTokenExpiry,
|
|
19
|
+
* lastSuccessfulSync and fees).
|
|
20
20
|
* Not included because it is a constant: overdueAfterMillis.
|
|
21
21
|
*
|
|
22
22
|
* @generated from protobuf message com.merabills.storefront.GeneralSettings
|
|
@@ -65,13 +65,14 @@ export interface GeneralSettings {
|
|
|
65
65
|
*/
|
|
66
66
|
fulfillmentModes: FulfillmentMode[];
|
|
67
67
|
/**
|
|
68
|
-
* Charge for delivering an order, multiplied by
|
|
68
|
+
* Charge for delivering an order, including the taxes in deliveryChargeTaxes, multiplied by
|
|
69
|
+
* Constants.AMOUNT_FACTOR
|
|
69
70
|
*
|
|
70
71
|
* @generated from protobuf field: int64 deliveryCharge = 8
|
|
71
72
|
*/
|
|
72
73
|
deliveryCharge: bigint;
|
|
73
74
|
/**
|
|
74
|
-
* Taxes that
|
|
75
|
+
* Taxes that are included in deliveryCharge (at most Constants.MAX_TAXES)
|
|
75
76
|
*
|
|
76
77
|
* @generated from protobuf field: repeated com.merabills.storefront.Tax deliveryChargeTaxes = 9
|
|
77
78
|
*/
|
|
@@ -127,6 +128,15 @@ export interface GeneralSettings {
|
|
|
127
128
|
* @generated from protobuf field: optional string onlineStoreThemeId = 17
|
|
128
129
|
*/
|
|
129
130
|
onlineStoreThemeId?: string;
|
|
131
|
+
/**
|
|
132
|
+
* True if the business has turned online shopping on. The server does not refuse a business that has
|
|
133
|
+
* not: it is for the client to, once it has read all it is sent (see BusinessSyncOutResponse). A
|
|
134
|
+
* business with no general settings at all, or with settings that have been deleted, has not turned
|
|
135
|
+
* it on either.
|
|
136
|
+
*
|
|
137
|
+
* @generated from protobuf field: bool onlineShoppingEnabled = 18
|
|
138
|
+
*/
|
|
139
|
+
onlineShoppingEnabled: boolean;
|
|
130
140
|
}
|
|
131
141
|
declare class GeneralSettings$Type extends MessageType<GeneralSettings> {
|
|
132
142
|
constructor();
|
|
@@ -29,7 +29,8 @@ class GeneralSettings$Type extends MessageType {
|
|
|
29
29
|
{ no: 14, name: "primaryStoreLocation", kind: "message", T: () => LatLong },
|
|
30
30
|
{ no: 15, name: "googleBusinessCategoryId", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
31
31
|
{ no: 16, name: "googleBusinessCategoryName", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
32
|
-
{ no: 17, name: "onlineStoreThemeId", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
32
|
+
{ no: 17, name: "onlineStoreThemeId", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
33
|
+
{ no: 18, name: "onlineShoppingEnabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
33
34
|
]);
|
|
34
35
|
}
|
|
35
36
|
create(value) {
|
|
@@ -43,6 +44,7 @@ class GeneralSettings$Type extends MessageType {
|
|
|
43
44
|
message.deliveryChargeTaxes = [];
|
|
44
45
|
message.freeDeliveryTotal = 0n;
|
|
45
46
|
message.deliveryRadiusKms = 0;
|
|
47
|
+
message.onlineShoppingEnabled = false;
|
|
46
48
|
if (value !== undefined)
|
|
47
49
|
reflectionMergePartial(this, message, value);
|
|
48
50
|
return message;
|
|
@@ -107,6 +109,9 @@ class GeneralSettings$Type extends MessageType {
|
|
|
107
109
|
case /* optional string onlineStoreThemeId */ 17:
|
|
108
110
|
message.onlineStoreThemeId = reader.string();
|
|
109
111
|
break;
|
|
112
|
+
case /* bool onlineShoppingEnabled */ 18:
|
|
113
|
+
message.onlineShoppingEnabled = reader.bool();
|
|
114
|
+
break;
|
|
110
115
|
default:
|
|
111
116
|
let u = options.readUnknownField;
|
|
112
117
|
if (u === "throw")
|
|
@@ -174,6 +179,9 @@ class GeneralSettings$Type extends MessageType {
|
|
|
174
179
|
/* optional string onlineStoreThemeId = 17; */
|
|
175
180
|
if (message.onlineStoreThemeId !== undefined)
|
|
176
181
|
writer.tag(17, WireType.LengthDelimited).string(message.onlineStoreThemeId);
|
|
182
|
+
/* bool onlineShoppingEnabled = 18; */
|
|
183
|
+
if (message.onlineShoppingEnabled !== false)
|
|
184
|
+
writer.tag(18, WireType.Varint).bool(message.onlineShoppingEnabled);
|
|
177
185
|
let u = options.writeUnknownFields;
|
|
178
186
|
if (u !== false)
|
|
179
187
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -22,8 +22,10 @@ export interface Message {
|
|
|
22
22
|
*/
|
|
23
23
|
entity?: Entity;
|
|
24
24
|
/**
|
|
25
|
-
* Id of the
|
|
26
|
-
*
|
|
25
|
+
* Id of the party that sent this message - Java Message.senderId, which is a party id and not the id
|
|
26
|
+
* of a User: the party of the BusinessLink of the sender (BusinessLink.partyId). Carried by a business
|
|
27
|
+
* sync out, which sends a customer only the messages whose sender is their own party. senderName /
|
|
28
|
+
* senderPhone below say who it was without resolving the party.
|
|
27
29
|
*
|
|
28
30
|
* @generated from protobuf field: int64 senderId = 2
|
|
29
31
|
*/
|
|
@@ -12,7 +12,7 @@ import { Item } from "./Item";
|
|
|
12
12
|
* A product (goods, service, raw material or fixed asset) in the catalog of a business. Belongs to
|
|
13
13
|
* at most one category (Item.parentItemId, 0 = none); its packages and photos are found the same
|
|
14
14
|
* way, by parentItemId / owningEntityId.
|
|
15
|
-
* Excluded: isDraft,
|
|
15
|
+
* Excluded: isDraft, isStockKeepingEnabled, isExpiryTrackingEnabled,
|
|
16
16
|
* storeProperties, defaultExpiry, classifications, all Translations fields.
|
|
17
17
|
*
|
|
18
18
|
* @generated from protobuf message com.merabills.storefront.Product
|
|
@@ -63,6 +63,15 @@ export interface Product {
|
|
|
63
63
|
* @generated from protobuf field: repeated string features = 8
|
|
64
64
|
*/
|
|
65
65
|
features: string[];
|
|
66
|
+
/**
|
|
67
|
+
* True when the business sells this product only offline (Java Product.getForOfflineSaleOnly: the product has "available
|
|
68
|
+
* online" turned off). The server sends such a product like any other public one, and it is for the client to not show
|
|
69
|
+
* it, nor its packages, to a customer, nor let a customer order it (mbs-model's Catalog leaves it out). Absent means
|
|
70
|
+
* false: a product that is not offline-only
|
|
71
|
+
*
|
|
72
|
+
* @generated from protobuf field: bool forOfflineSaleOnly = 9
|
|
73
|
+
*/
|
|
74
|
+
forOfflineSaleOnly: boolean;
|
|
66
75
|
}
|
|
67
76
|
declare class Product$Type extends MessageType<Product> {
|
|
68
77
|
constructor();
|
|
@@ -17,7 +17,8 @@ class Product$Type extends MessageType {
|
|
|
17
17
|
{ no: 5, name: "manufacturer", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
18
18
|
{ no: 6, name: "manufacturerAddress", kind: "message", T: () => Address },
|
|
19
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*/ }
|
|
20
|
+
{ no: 8, name: "features", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
21
|
+
{ no: 9, name: "forOfflineSaleOnly", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
21
22
|
]);
|
|
22
23
|
}
|
|
23
24
|
create(value) {
|
|
@@ -25,6 +26,7 @@ class Product$Type extends MessageType {
|
|
|
25
26
|
message.productType = 0;
|
|
26
27
|
message.taxes = [];
|
|
27
28
|
message.features = [];
|
|
29
|
+
message.forOfflineSaleOnly = false;
|
|
28
30
|
if (value !== undefined)
|
|
29
31
|
reflectionMergePartial(this, message, value);
|
|
30
32
|
return message;
|
|
@@ -58,6 +60,9 @@ class Product$Type extends MessageType {
|
|
|
58
60
|
case /* repeated string features */ 8:
|
|
59
61
|
message.features.push(reader.string());
|
|
60
62
|
break;
|
|
63
|
+
case /* bool forOfflineSaleOnly */ 9:
|
|
64
|
+
message.forOfflineSaleOnly = reader.bool();
|
|
65
|
+
break;
|
|
61
66
|
default:
|
|
62
67
|
let u = options.readUnknownField;
|
|
63
68
|
if (u === "throw")
|
|
@@ -94,6 +99,9 @@ class Product$Type extends MessageType {
|
|
|
94
99
|
/* repeated string features = 8; */
|
|
95
100
|
for (let i = 0; i < message.features.length; i++)
|
|
96
101
|
writer.tag(8, WireType.LengthDelimited).string(message.features[i]);
|
|
102
|
+
/* bool forOfflineSaleOnly = 9; */
|
|
103
|
+
if (message.forOfflineSaleOnly !== false)
|
|
104
|
+
writer.tag(9, WireType.Varint).bool(message.forOfflineSaleOnly);
|
|
97
105
|
let u = options.writeUnknownFields;
|
|
98
106
|
if (u !== false)
|
|
99
107
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -32,7 +32,23 @@ export interface ProfileSyncOutRequest {
|
|
|
32
32
|
*/
|
|
33
33
|
businessLinkUpdateNumber: bigint;
|
|
34
34
|
/**
|
|
35
|
-
* The business to join as a customer, if the caller is not already linked to it. 0 means none
|
|
35
|
+
* The business to join as a customer, if the caller is not already linked to it. 0 means none, and
|
|
36
|
+
* anything else has to be the id of a business: one that is not is refused, not ignored.
|
|
37
|
+
* A call that carries a valid link token of this business is from a member of it already, and nothing is
|
|
38
|
+
* joined: the response is what the cursors above return, as for a call that joins nothing, and it is not
|
|
39
|
+
* refused for the business no longer allowing customers to join it. A link token that is not valid is
|
|
40
|
+
* refused (401), and one of another business says nothing of this one.
|
|
41
|
+
* Otherwise the response always carries the BusinessLink and the Business that a join returns, even
|
|
42
|
+
* where the cursors above would not return them.
|
|
43
|
+
* An invitation to this business for the caller (looked for by their phone number) takes precedence: it is
|
|
44
|
+
* accepted in the role and party that the invitation names, which may be those of a manager or an owner as
|
|
45
|
+
* well as of a customer, whether or not the business allows customers to join without an invitation, and
|
|
46
|
+
* the invitation is deleted. Only when there is none does the business decide.
|
|
47
|
+
* The call fails with 404 (NotFoundException) if there is no such business, or if the caller has no
|
|
48
|
+
* invitation to it and it does not allow customers to join it, and the caller does not hold a valid link
|
|
49
|
+
* token of it. It is the link token that is tested, and not membership: a member that does not hold one (on
|
|
50
|
+
* a new device, say) of a business that has since stopped allowing customers to join is refused in the same
|
|
51
|
+
* way, and then the whole call is a 404 - nothing of the profile is returned either, and not only no join.
|
|
36
52
|
*
|
|
37
53
|
* @generated from protobuf field: int64 joinBusinessId = 4
|
|
38
54
|
*/
|
|
@@ -11,8 +11,9 @@ import { AuthTokens } from "./AuthTokens";
|
|
|
11
11
|
/**
|
|
12
12
|
* The answer to a ProfileSyncOutRequest: who the caller is, the businesses they are linked to, and
|
|
13
13
|
* those businesses. Nothing is nested - match BusinessLink.businessId against Business.entity.id.
|
|
14
|
-
* Every field is absent/empty unless that type has changed
|
|
15
|
-
*
|
|
14
|
+
* Every field is absent/empty unless that type has changed, but for the caller's own user, which is
|
|
15
|
+
* sent with every response; a tombstone (updateNumber's update-type bits =
|
|
16
|
+
* Constants.UPDATE_TYPE_DELETED) means the entity, and what it owned, was deleted.
|
|
16
17
|
*
|
|
17
18
|
* @generated from protobuf message com.merabills.storefront.ProfileSyncOutResponse
|
|
18
19
|
*/
|
|
@@ -25,13 +26,17 @@ export interface ProfileSyncOutResponse {
|
|
|
25
26
|
*/
|
|
26
27
|
authTokens?: AuthTokens;
|
|
27
28
|
/**
|
|
28
|
-
* The caller.
|
|
29
|
+
* The caller. Sent with every response, whatever userUpdateNumber is: a client keeps the copy it holds
|
|
30
|
+
* when it is as new as this one. The only user a response ever carries: nobody else's, such as the
|
|
31
|
+
* owner of a business, is sent to a customer.
|
|
29
32
|
*
|
|
30
33
|
* @generated from protobuf field: com.merabills.storefront.User user = 2
|
|
31
34
|
*/
|
|
32
35
|
user?: User;
|
|
33
36
|
/**
|
|
34
37
|
* The businesses the caller is linked to, and the token for each. Empty unless a link has changed.
|
|
38
|
+
* Only the caller's own links: never that of anybody else, such as the owner of a business, which is a
|
|
39
|
+
* credential for it.
|
|
35
40
|
*
|
|
36
41
|
* @generated from protobuf field: repeated com.merabills.storefront.BusinessLink businessLinks = 3
|
|
37
42
|
*/
|
|
@@ -10,7 +10,10 @@ import { FulfillmentMode } from "./FulfillmentMode";
|
|
|
10
10
|
import { OrderStatus } from "./OrderStatus";
|
|
11
11
|
/**
|
|
12
12
|
* The payload of a SALES_ORDER message: an order placed by a customer.
|
|
13
|
-
* Excluded: serviceStationNumber, dueDate.
|
|
13
|
+
* Excluded: serviceStationNumber, dueDate, createdByParty. The last is set by the merchant app for an
|
|
14
|
+
* order that its party placed itself and not an operator of the business on its behalf. Nothing reads
|
|
15
|
+
* it and a storefront has no use for it, so it is not carried, and the server leaves it unset on an
|
|
16
|
+
* order that a storefront pushes.
|
|
14
17
|
*
|
|
15
18
|
* @generated from protobuf message com.merabills.storefront.SalesOrderPayload
|
|
16
19
|
*/
|
|
@@ -66,7 +69,9 @@ export interface SalesOrderPayload {
|
|
|
66
69
|
*/
|
|
67
70
|
note?: string;
|
|
68
71
|
/**
|
|
69
|
-
* Payment received towards this order so far. Can only be set by an operator of the business.
|
|
72
|
+
* Payment received towards this order so far. Can only be set by an operator of the business. That is not
|
|
73
|
+
* enforced yet: sync in is not implemented (its route answers 501), and ProtoMap.fromProto accepts this
|
|
74
|
+
* from whoever pushes the order, so sync in must refuse or drop it from a customer when it is written.
|
|
70
75
|
*
|
|
71
76
|
* @generated from protobuf field: optional int64 paymentReceived = 10
|
|
72
77
|
*/
|
|
@@ -35,14 +35,17 @@ export interface ShoppingList {
|
|
|
35
35
|
*/
|
|
36
36
|
autoAddServiceCharge: boolean;
|
|
37
37
|
/**
|
|
38
|
-
* Id of the inventory location the items are drawn from. 0 is the default location.
|
|
38
|
+
* Id of the inventory location the items are drawn from. 0 is the default location. It is a number of 16 bits, from
|
|
39
|
+
* -32768 to 32767: a message with one that is outside of that is refused (400), and not read as some other location.
|
|
39
40
|
*
|
|
40
41
|
* @generated from protobuf field: int32 inventoryLocationId = 4
|
|
41
42
|
*/
|
|
42
43
|
inventoryLocationId: number;
|
|
43
44
|
/**
|
|
44
|
-
* Id of the PriceList the prices came from. A
|
|
45
|
-
* Constants.
|
|
45
|
+
* Id of the PriceList the prices came from. A storefront sells from the MeraBills Online price
|
|
46
|
+
* list (the id built from Constants.MERABILLS_ONLINE_PRICE_LIST), so, that is what a cart that it
|
|
47
|
+
* pushes carries, an empty one included. Java does not default this for a cart: one that was given
|
|
48
|
+
* no price list holds Constants.ENTITY_ID_NULL, and the server keeps the id that it is sent.
|
|
46
49
|
*
|
|
47
50
|
* @generated from protobuf field: int64 priceListId = 5
|
|
48
51
|
*/
|