@peabody-soft/mbs-model-ts 1.11.0 → 1.13.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/Constants.d.ts +1 -0
- package/dist/Constants.js +3 -0
- package/dist/Exceptions.d.ts +5 -0
- package/dist/Exceptions.js +16 -2
- package/dist/Ids.d.ts +1 -0
- package/dist/Ids.js +5 -3
- package/dist/InMemoryLock.d.ts +5 -0
- package/dist/InMemoryLock.js +20 -0
- package/dist/Lock.d.ts +3 -0
- package/dist/Lock.js +1 -0
- package/dist/Message.d.ts +1 -5
- package/dist/Message.js +2 -12
- package/dist/Model.d.ts +17 -4
- package/dist/Model.js +304 -113
- package/dist/Order.d.ts +2 -2
- package/dist/Order.js +4 -4
- package/dist/ProtoMap.d.ts +13 -4
- package/dist/ProtoMap.js +139 -71
- package/dist/Service.d.ts +3 -4
- package/dist/ServiceProxy.d.ts +3 -4
- package/dist/ServiceProxy.js +4 -6
- package/dist/SyncCache.d.ts +6 -2
- package/dist/SyncCache.js +83 -44
- package/dist/SyncKeys.js +3 -2
- package/dist/generated/BusinessSyncInRequest.d.ts +30 -16
- package/dist/generated/BusinessSyncInRequest.js +9 -1
- package/dist/generated/BusinessSyncInResponse.d.ts +9 -6
- package/dist/generated/Constants.d.ts +2 -12
- package/dist/generated/Constants.js +2 -12
- package/dist/generated/Message.d.ts +5 -16
- package/dist/generated/Message.js +8 -22
- package/dist/generated/Party.d.ts +52 -0
- package/dist/generated/Party.js +68 -0
- package/dist/generated/PartyPreferencesPayload.d.ts +2 -1
- package/dist/generated/ProfileSyncOutRequest.d.ts +2 -0
- package/dist/generated/ProfileSyncOutResponse.d.ts +2 -2
- package/dist/generated/SalesOrderPayload.d.ts +9 -8
- package/dist/generated/User.d.ts +3 -1
- package/dist/generated/UserRequest.d.ts +52 -0
- package/dist/generated/{CreateUserRequest.js → UserRequest.js} +11 -11
- package/dist/index.d.ts +4 -2
- package/dist/index.js +7 -5
- package/package.json +2 -2
- package/dist/generated/CreateUserRequest.d.ts +0 -43
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
7
|
+
class Party$Type extends MessageType {
|
|
8
|
+
constructor() {
|
|
9
|
+
super("com.merabills.storefront.Party", [
|
|
10
|
+
{ no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
11
|
+
{ no: 2, name: "mobilePhoneNumber", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
12
|
+
{ no: 3, name: "addresses", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Address }
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
15
|
+
create(value) {
|
|
16
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
17
|
+
message.name = "";
|
|
18
|
+
message.mobilePhoneNumber = "";
|
|
19
|
+
message.addresses = [];
|
|
20
|
+
if (value !== undefined)
|
|
21
|
+
reflectionMergePartial(this, message, value);
|
|
22
|
+
return message;
|
|
23
|
+
}
|
|
24
|
+
internalBinaryRead(reader, length, options, target) {
|
|
25
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
26
|
+
while (reader.pos < end) {
|
|
27
|
+
let [fieldNo, wireType] = reader.tag();
|
|
28
|
+
switch (fieldNo) {
|
|
29
|
+
case /* string name */ 1:
|
|
30
|
+
message.name = reader.string();
|
|
31
|
+
break;
|
|
32
|
+
case /* string mobilePhoneNumber */ 2:
|
|
33
|
+
message.mobilePhoneNumber = reader.string();
|
|
34
|
+
break;
|
|
35
|
+
case /* repeated com.merabills.storefront.Address addresses */ 3:
|
|
36
|
+
message.addresses.push(Address.internalBinaryRead(reader, reader.uint32(), options));
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
let u = options.readUnknownField;
|
|
40
|
+
if (u === "throw")
|
|
41
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
42
|
+
let d = reader.skip(wireType);
|
|
43
|
+
if (u !== false)
|
|
44
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return message;
|
|
48
|
+
}
|
|
49
|
+
internalBinaryWrite(message, writer, options) {
|
|
50
|
+
/* string name = 1; */
|
|
51
|
+
if (message.name !== "")
|
|
52
|
+
writer.tag(1, WireType.LengthDelimited).string(message.name);
|
|
53
|
+
/* string mobilePhoneNumber = 2; */
|
|
54
|
+
if (message.mobilePhoneNumber !== "")
|
|
55
|
+
writer.tag(2, WireType.LengthDelimited).string(message.mobilePhoneNumber);
|
|
56
|
+
/* repeated com.merabills.storefront.Address addresses = 3; */
|
|
57
|
+
for (let i = 0; i < message.addresses.length; i++)
|
|
58
|
+
Address.internalBinaryWrite(message.addresses[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
59
|
+
let u = options.writeUnknownFields;
|
|
60
|
+
if (u !== false)
|
|
61
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
62
|
+
return writer;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @generated MessageType for protobuf message com.merabills.storefront.Party
|
|
67
|
+
*/
|
|
68
|
+
export const Party = new Party$Type();
|
|
@@ -9,7 +9,8 @@ import { ShoppingList } from "./ShoppingList";
|
|
|
9
9
|
/**
|
|
10
10
|
* The payload of a PARTY_PREFERENCES message: the preferences of a customer of a business,
|
|
11
11
|
* including their shopping cart.
|
|
12
|
-
* Excluded: serializedUserSettings.
|
|
12
|
+
* Excluded: serializedUserSettings, which holds the settings of an operator of the business. A customer has none. A cart that a
|
|
13
|
+
* storefront sends replaces the stored payload as a whole, so any that are stored are removed.
|
|
13
14
|
*
|
|
14
15
|
* @generated from protobuf message com.merabills.storefront.PartyPreferencesPayload
|
|
15
16
|
*/
|
|
@@ -9,6 +9,8 @@ import { MessageType } from "@protobuf-ts/runtime";
|
|
|
9
9
|
* the businesses they are linked to, and those businesses. Incremental and bounded: each cursor is
|
|
10
10
|
* the highest Entity.updateNumber of that type already synced (0 asks for everything), and a
|
|
11
11
|
* response of Constants.SYNC_OUT_LIMIT entities means call again with the updated cursors.
|
|
12
|
+
* A UserRequest carries one too, and its call answers as this one does. A create cannot be repeated and an update would be
|
|
13
|
+
* applied again, so a full response is continued with shop-profile-sync-out.
|
|
12
14
|
*
|
|
13
15
|
* @generated from protobuf message com.merabills.storefront.ProfileSyncOutRequest
|
|
14
16
|
*/
|
|
@@ -9,8 +9,8 @@ import { BusinessLink } from "./BusinessLink";
|
|
|
9
9
|
import { User } from "./User";
|
|
10
10
|
import { AuthTokens } from "./AuthTokens";
|
|
11
11
|
/**
|
|
12
|
-
* The answer to a ProfileSyncOutRequest: who the caller is, the businesses they are linked
|
|
13
|
-
* those businesses. Nothing is nested - match BusinessLink.businessId against Business.entity.id.
|
|
12
|
+
* The answer to a ProfileSyncOutRequest, and to a UserRequest, which carries one: who the caller is, the businesses they are linked
|
|
13
|
+
* to, and those businesses. Nothing is nested - match BusinessLink.businessId against Business.entity.id.
|
|
14
14
|
* Every field is absent/empty unless that type has changed. A tombstone (updateNumber's update-type
|
|
15
15
|
* bits = Constants.UPDATE_TYPE_DELETED) means the entity, and what it owned, was deleted.
|
|
16
16
|
*
|
|
@@ -10,10 +10,11 @@ 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, createdByParty
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* order that a storefront
|
|
13
|
+
* Excluded: serviceStationNumber, dueDate, createdByParty, and the flag that an operator's app sets in the
|
|
14
|
+
* packed category once it has checked the lines of the order against its catalog. createdByParty is true for
|
|
15
|
+
* an order that its party placed and not an operator of the business on its behalf. The server sets it on
|
|
16
|
+
* every order that a storefront sends. A storefront has no use for either flag, so neither is carried. An
|
|
17
|
+
* order that already exists is not written again, so the stored flags are kept.
|
|
17
18
|
*
|
|
18
19
|
* @generated from protobuf message com.merabills.storefront.SalesOrderPayload
|
|
19
20
|
*/
|
|
@@ -48,7 +49,8 @@ export interface SalesOrderPayload {
|
|
|
48
49
|
*/
|
|
49
50
|
shoppingListCount: number;
|
|
50
51
|
/**
|
|
51
|
-
* Id of the delivery address, in User.addresses of the customer
|
|
52
|
+
* Id of the delivery address, in User.addresses of the customer and in the addresses of the Party sent with the order (the merchant
|
|
53
|
+
* app finds the address there). 0 means no address.
|
|
52
54
|
*
|
|
53
55
|
* @generated from protobuf field: int64 deliveryAddressId = 6
|
|
54
56
|
*/
|
|
@@ -72,9 +74,8 @@ export interface SalesOrderPayload {
|
|
|
72
74
|
*/
|
|
73
75
|
note?: string;
|
|
74
76
|
/**
|
|
75
|
-
* Payment received towards this order so far. Can only be set by an operator of the business
|
|
76
|
-
*
|
|
77
|
-
* from whoever pushes the order, so sync in must refuse or drop it from a customer when it is written.
|
|
77
|
+
* Payment received towards this order so far. Can only be set by an operator of the business: an order
|
|
78
|
+
* that a customer sends with one is a 400.
|
|
78
79
|
*
|
|
79
80
|
* @generated from protobuf field: optional int64 paymentReceived = 10
|
|
80
81
|
*/
|
package/dist/generated/User.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ import { Entity } from "./Entity";
|
|
|
9
9
|
/**
|
|
10
10
|
* A user of MeraBills; a customer of a business is represented by one. Carried by a
|
|
11
11
|
* ProfileSyncOutResponse, not by a business sync out - a client reads the caller once, at sign in.
|
|
12
|
-
*
|
|
12
|
+
* Also carried by a UserRequest, to create the caller's user or to update it. Only entity.id is read: it becomes the id of a new user,
|
|
13
|
+
* and matches the caller for an update.
|
|
14
|
+
* Excluded: referralDetails, isCallingUser, all Translations fields. An update keeps the ones the stored user has.
|
|
13
15
|
* Not included because it is derived: formattedName (firstName + " " + lastName).
|
|
14
16
|
*
|
|
15
17
|
* @generated from protobuf message com.merabills.storefront.User
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { ProfileSyncOutRequest } from "./ProfileSyncOutRequest";
|
|
8
|
+
import { User } from "./User";
|
|
9
|
+
/**
|
|
10
|
+
* The request of shop-create-user and shop-update-user. Both are answered with a ProfileSyncOutResponse. See Prompt.txt, CREATE USER
|
|
11
|
+
* AND UPDATE USER.
|
|
12
|
+
* The phone number of the user must be the one the authentication token verified (401). An invalid field is a 400.
|
|
13
|
+
*
|
|
14
|
+
* @generated from protobuf message com.merabills.storefront.UserRequest
|
|
15
|
+
*/
|
|
16
|
+
export interface UserRequest {
|
|
17
|
+
/**
|
|
18
|
+
* For shop-create-user, the user to create. The id of its entity is required and is the id of the new user: it has to be the id of a
|
|
19
|
+
* user, and not 0 or in the reserved range (400). The server sets the times, and reads nothing else of the entity.
|
|
20
|
+
* A 409 means the user was not created: the subject has a user, the id is taken, or the insert failed. The client reads its profile
|
|
21
|
+
* with shop-profile-sync-out, and creates again under a new id if the subject has no profile.
|
|
22
|
+
* For shop-update-user, the caller's own user with its new details: it is matched to the caller by entity.id (401 if it is not the
|
|
23
|
+
* caller's), and the rest of its entity is not read.
|
|
24
|
+
* A 409 means the update was not applied, for example because a change with a later time is stored (a device clock that is ahead, or
|
|
25
|
+
* two updates in the same millisecond). The client reads its profile and tries again.
|
|
26
|
+
*
|
|
27
|
+
* @generated from protobuf field: com.merabills.storefront.User user = 1
|
|
28
|
+
*/
|
|
29
|
+
user?: User;
|
|
30
|
+
/**
|
|
31
|
+
* The profile sync out that answers the call: the response carries what is newer than its cursors, as for shop-profile-sync-out.
|
|
32
|
+
* Absent is the same as all cursors at 0 and no business to join.
|
|
33
|
+
* joinBusinessId joins a business as a customer after a create. 0 means none, and anything else has to be the id of a business: one
|
|
34
|
+
* that is not is a 400, checked before the user is created. One that cannot be joined is refused as
|
|
35
|
+
* ProfileSyncOutRequest.joinBusinessId says - a 404, and the user is created all the same.
|
|
36
|
+
* An update joins no business, so a joinBusinessId that is not 0 is a 400, and nothing is changed.
|
|
37
|
+
*
|
|
38
|
+
* @generated from protobuf field: com.merabills.storefront.ProfileSyncOutRequest profileSyncOutRequest = 2
|
|
39
|
+
*/
|
|
40
|
+
profileSyncOutRequest?: ProfileSyncOutRequest;
|
|
41
|
+
}
|
|
42
|
+
declare class UserRequest$Type extends MessageType<UserRequest> {
|
|
43
|
+
constructor();
|
|
44
|
+
create(value?: PartialMessage<UserRequest>): UserRequest;
|
|
45
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserRequest): UserRequest;
|
|
46
|
+
internalBinaryWrite(message: UserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @generated MessageType for protobuf message com.merabills.storefront.UserRequest
|
|
50
|
+
*/
|
|
51
|
+
export declare const UserRequest: UserRequest$Type;
|
|
52
|
+
export {};
|
|
@@ -2,18 +2,18 @@ import { WireType } from "@protobuf-ts/runtime";
|
|
|
2
2
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
3
3
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
4
4
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
5
|
+
import { ProfileSyncOutRequest } from "./ProfileSyncOutRequest";
|
|
5
6
|
import { User } from "./User";
|
|
6
7
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
7
|
-
class
|
|
8
|
+
class UserRequest$Type extends MessageType {
|
|
8
9
|
constructor() {
|
|
9
|
-
super("com.merabills.storefront.
|
|
10
|
+
super("com.merabills.storefront.UserRequest", [
|
|
10
11
|
{ no: 1, name: "user", kind: "message", T: () => User },
|
|
11
|
-
{ no: 2, name: "
|
|
12
|
+
{ no: 2, name: "profileSyncOutRequest", kind: "message", T: () => ProfileSyncOutRequest }
|
|
12
13
|
]);
|
|
13
14
|
}
|
|
14
15
|
create(value) {
|
|
15
16
|
const message = globalThis.Object.create((this.messagePrototype));
|
|
16
|
-
message.joinBusinessId = 0n;
|
|
17
17
|
if (value !== undefined)
|
|
18
18
|
reflectionMergePartial(this, message, value);
|
|
19
19
|
return message;
|
|
@@ -26,8 +26,8 @@ class CreateUserRequest$Type extends MessageType {
|
|
|
26
26
|
case /* com.merabills.storefront.User user */ 1:
|
|
27
27
|
message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
|
|
28
28
|
break;
|
|
29
|
-
case /*
|
|
30
|
-
message.
|
|
29
|
+
case /* com.merabills.storefront.ProfileSyncOutRequest profileSyncOutRequest */ 2:
|
|
30
|
+
message.profileSyncOutRequest = ProfileSyncOutRequest.internalBinaryRead(reader, reader.uint32(), options, message.profileSyncOutRequest);
|
|
31
31
|
break;
|
|
32
32
|
default:
|
|
33
33
|
let u = options.readUnknownField;
|
|
@@ -44,9 +44,9 @@ class CreateUserRequest$Type extends MessageType {
|
|
|
44
44
|
/* com.merabills.storefront.User user = 1; */
|
|
45
45
|
if (message.user)
|
|
46
46
|
User.internalBinaryWrite(message.user, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
47
|
-
/*
|
|
48
|
-
if (message.
|
|
49
|
-
writer.tag(2, WireType.
|
|
47
|
+
/* com.merabills.storefront.ProfileSyncOutRequest profileSyncOutRequest = 2; */
|
|
48
|
+
if (message.profileSyncOutRequest)
|
|
49
|
+
ProfileSyncOutRequest.internalBinaryWrite(message.profileSyncOutRequest, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
50
50
|
let u = options.writeUnknownFields;
|
|
51
51
|
if (u !== false)
|
|
52
52
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -54,6 +54,6 @@ class CreateUserRequest$Type extends MessageType {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* @generated MessageType for protobuf message com.merabills.storefront.
|
|
57
|
+
* @generated MessageType for protobuf message com.merabills.storefront.UserRequest
|
|
58
58
|
*/
|
|
59
|
-
export const
|
|
59
|
+
export const UserRequest = new UserRequest$Type();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as Model } from "./Model";
|
|
2
2
|
export { default as Database } from "./Database";
|
|
3
3
|
export type { Container, StoredBlob } from "./Database";
|
|
4
|
+
export { default as Lock } from "./Lock";
|
|
5
|
+
export { default as InMemoryLock } from "./InMemoryLock";
|
|
4
6
|
export { default as Service } from "./Service";
|
|
5
7
|
export * as ContainerNames from "./ContainerNames";
|
|
6
8
|
export { buildAuthTokensBytes } from "./ProtoMap";
|
|
@@ -45,8 +47,8 @@ export { default as ShoppingList, ItemChange, ShoppingListItem } from "./Shoppin
|
|
|
45
47
|
export { default as Tax, TaxAmount } from "./Tax";
|
|
46
48
|
export { default as WorkingDays, WorkingHours, WorkingHoursRange } from "./WorkingDays";
|
|
47
49
|
export * from "./Enums";
|
|
48
|
-
export { Constants, MERABILLS_ONLINE_PRICE_LIST_ID, buildPriceListId } from "./Constants";
|
|
50
|
+
export { Constants, MAX_PROFILE_STALENESS_MS, MERABILLS_ONLINE_PRICE_LIST_ID, buildPriceListId, } from "./Constants";
|
|
49
51
|
export { default as Ids } from "./Ids";
|
|
50
|
-
export { IllegalOperationException, InvalidArgumentException } from "./Exceptions";
|
|
52
|
+
export { IllegalOperationException, InvalidArgumentException, StoreCorruptException, } from "./Exceptions";
|
|
51
53
|
export { BadRequestException, ConflictException, InternalServerException, MethodNotAllowedException, NetworkConnectionException, NotFoundException, ServiceException, ServiceUnavailableException, UnauthorizedException, UpgradeRequiredException, } from "./ServiceExceptions";
|
|
52
54
|
export { default as MockDatabase, MockContainer } from "./MockDatabase";
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// - TaxHelper, which does tax arithmetic in scaled values. A UI reads a tax off a ShoppingListItem,
|
|
7
7
|
// ShoppingList or CartLine.
|
|
8
8
|
export { default as Model } from "./Model";
|
|
9
|
+
export { default as InMemoryLock } from "./InMemoryLock";
|
|
9
10
|
export * as ContainerNames from "./ContainerNames";
|
|
10
11
|
export { buildAuthTokensBytes } from "./ProtoMap";
|
|
11
12
|
// The Service implementation that reaches a real server, and its routes. A caller using plain
|
|
@@ -51,12 +52,13 @@ export { default as WorkingDays, WorkingHours, WorkingHoursRange } from "./Worki
|
|
|
51
52
|
// storefront sells from is exported because a UI that builds a cart must name it. Catalog.priceList
|
|
52
53
|
// is null until the catalog has arrived, and when the response did not carry that list.
|
|
53
54
|
export * from "./Enums";
|
|
54
|
-
export { Constants, MERABILLS_ONLINE_PRICE_LIST_ID, buildPriceListId } from "./Constants";
|
|
55
|
+
export { Constants, MAX_PROFILE_STALENESS_MS, MERABILLS_ONLINE_PRICE_LIST_ID, buildPriceListId, } from "./Constants";
|
|
55
56
|
export { default as Ids } from "./Ids";
|
|
56
|
-
// Failures.
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
|
|
57
|
+
// Failures. Two in Exceptions.ts are programming errors. StoreCorruptException means the store
|
|
58
|
+
// holds data that cannot be read, and a caller recovers by deleting the store. The rest are what a
|
|
59
|
+
// call fails with and are meant to be caught: ServiceException for an error response from the
|
|
60
|
+
// server, NetworkConnectionException for a call that got no response.
|
|
61
|
+
export { IllegalOperationException, InvalidArgumentException, StoreCorruptException, } from "./Exceptions";
|
|
60
62
|
export { BadRequestException, ConflictException, InternalServerException, MethodNotAllowedException, NetworkConnectionException, NotFoundException, ServiceException, ServiceUnavailableException, UnauthorizedException, UpgradeRequiredException, } from "./ServiceExceptions";
|
|
61
63
|
// The mock database: a Database over a Map, so a caller can pair it with any Service. MockService
|
|
62
64
|
// and MockData (a Service and its data, answering out of memory) live in test/ only - see
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peabody-soft/mbs-model-ts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "MeraBills storefront client-side model (TypeScript)",
|
|
5
5
|
"author": "Peabody Soft",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript": "^7.0.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@peabody-soft/mbs-protos": "^1.
|
|
52
|
+
"@peabody-soft/mbs-protos": "^1.15.0",
|
|
53
53
|
"@protobuf-ts/runtime": "^2.11.1"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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 { User } from "./User";
|
|
8
|
-
/**
|
|
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).
|
|
14
|
-
*
|
|
15
|
-
* @generated from protobuf message com.merabills.storefront.CreateUserRequest
|
|
16
|
-
*/
|
|
17
|
-
export interface CreateUserRequest {
|
|
18
|
-
/**
|
|
19
|
-
* The user to create.
|
|
20
|
-
*
|
|
21
|
-
* @generated from protobuf field: com.merabills.storefront.User user = 1
|
|
22
|
-
*/
|
|
23
|
-
user?: User;
|
|
24
|
-
/**
|
|
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.
|
|
28
|
-
*
|
|
29
|
-
* @generated from protobuf field: int64 joinBusinessId = 2
|
|
30
|
-
*/
|
|
31
|
-
joinBusinessId: bigint;
|
|
32
|
-
}
|
|
33
|
-
declare class CreateUserRequest$Type extends MessageType<CreateUserRequest> {
|
|
34
|
-
constructor();
|
|
35
|
-
create(value?: PartialMessage<CreateUserRequest>): CreateUserRequest;
|
|
36
|
-
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateUserRequest): CreateUserRequest;
|
|
37
|
-
internalBinaryWrite(message: CreateUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @generated MessageType for protobuf message com.merabills.storefront.CreateUserRequest
|
|
41
|
-
*/
|
|
42
|
-
export declare const CreateUserRequest: CreateUserRequest$Type;
|
|
43
|
-
export {};
|