Latest generation

This commit is contained in:
ci core model
2025-07-02 13:18:37 +00:00
parent 3c06e9e3cd
commit e0d318980d
4 changed files with 221 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@reflex-platform/npm-core-sdk",
"version": "1.11.0-SNAPSHOT-250702094957",
"version": "1.11.0-SNAPSHOT-250702131820",
"description": "npm libs from core model proto files",
"homepage": "",
"main": "index.ts",

View File

@@ -6,6 +6,7 @@ import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { SiteService } from "./site";
import type { CancelAppointmentResponse } from "./site";
import type { CancelAppointmentRequest } from "./site";
import type { WMSBookAppointmentRequest } from "./site";
import type { BookAppointmentResponse } from "./site";
import type { BookAppointmentRequest } from "./site";
import type { ListUserSitesResponse } from "./site";
@@ -59,6 +60,10 @@ export interface ISiteServiceClient {
* @generated from protobuf rpc: GetAvailableSlots
*/
getAvailableSlots(input: GetAvailableSlotsRequest, options?: RpcOptions): UnaryCall<GetAvailableSlotsRequest, GetAvailableSlotsResponse>;
/**
* @generated from protobuf rpc: GetAllSlots
*/
getAllSlots(input: GetAvailableSlotsRequest, options?: RpcOptions): UnaryCall<GetAvailableSlotsRequest, GetAvailableSlotsResponse>;
/**
* @generated from protobuf rpc: ListUserSites
*/
@@ -71,6 +76,10 @@ export interface ISiteServiceClient {
* @generated from protobuf rpc: ForceBookAppointment
*/
forceBookAppointment(input: BookAppointmentRequest, options?: RpcOptions): UnaryCall<BookAppointmentRequest, BookAppointmentResponse>;
/**
* @generated from protobuf rpc: WMSForceBookAppointment
*/
wMSForceBookAppointment(input: WMSBookAppointmentRequest, options?: RpcOptions): UnaryCall<WMSBookAppointmentRequest, BookAppointmentResponse>;
/**
* @generated from protobuf rpc: CancelAppointment
*/
@@ -134,32 +143,46 @@ export class SiteServiceClient implements ISiteServiceClient, ServiceInfo {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept<GetAvailableSlotsRequest, GetAvailableSlotsResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: GetAllSlots
*/
getAllSlots(input: GetAvailableSlotsRequest, options?: RpcOptions): UnaryCall<GetAvailableSlotsRequest, GetAvailableSlotsResponse> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept<GetAvailableSlotsRequest, GetAvailableSlotsResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: ListUserSites
*/
listUserSites(input: ListUserSitesRequest, options?: RpcOptions): UnaryCall<ListUserSitesRequest, ListUserSitesResponse> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept<ListUserSitesRequest, ListUserSitesResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: BookAppointment
*/
bookAppointment(input: BookAppointmentRequest, options?: RpcOptions): UnaryCall<BookAppointmentRequest, BookAppointmentResponse> {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept<BookAppointmentRequest, BookAppointmentResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: ForceBookAppointment
*/
forceBookAppointment(input: BookAppointmentRequest, options?: RpcOptions): UnaryCall<BookAppointmentRequest, BookAppointmentResponse> {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept<BookAppointmentRequest, BookAppointmentResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: WMSForceBookAppointment
*/
wMSForceBookAppointment(input: WMSBookAppointmentRequest, options?: RpcOptions): UnaryCall<WMSBookAppointmentRequest, BookAppointmentResponse> {
const method = this.methods[11], opt = this._transport.mergeOptions(options);
return stackIntercept<WMSBookAppointmentRequest, BookAppointmentResponse>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: CancelAppointment
*/
cancelAppointment(input: CancelAppointmentRequest, options?: RpcOptions): UnaryCall<CancelAppointmentRequest, CancelAppointmentResponse> {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
const method = this.methods[12], opt = this._transport.mergeOptions(options);
return stackIntercept<CancelAppointmentRequest, CancelAppointmentResponse>("unary", this._transport, method, opt, input);
}
}

186
site.ts
View File

@@ -502,6 +502,72 @@ export interface BookAppointmentRequest {
*/
CarrierName: string;
}
/**
* BookAppointment
*
* @generated from protobuf message api.WMSBookAppointmentRequest
*/
export interface WMSBookAppointmentRequest {
/**
* @generated from protobuf field: api.RequestSiteHeader Header = 1
*/
Header?: RequestSiteHeader;
/**
* Type of appointment : Expedition / Reception / Both
*
* @generated from protobuf field: api.AppointmentType AppointmentType = 2
*/
AppointmentType: AppointmentType;
/**
* List of the orders and projects for which the appointment is made, with the quantities
*
* @generated from protobuf field: repeated api.Commission Commissions = 3
*/
Commissions: Commission[];
/**
* Set of segmentation constraining the slot booking
*
* @generated from protobuf field: repeated api.SegmentationSelection SegmentationSelections = 4
*/
SegmentationSelections: SegmentationSelection[];
/**
* Required carrierInformation, some can be obligatory
*
* @generated from protobuf field: repeated api.CarrierInformationWithValue CarrierInformation = 5
*/
CarrierInformation: CarrierInformationWithValue[];
/**
* The slot to book for the appointment
*
* @generated from protobuf field: repeated api.Slot Slots = 6
*/
Slots: Slot[];
/**
* TODO Need to add a structure to store platform user identifiers which can act on this appointment ?
* User mails being notified on this appointment
*
* @generated from protobuf field: repeated string Emails = 8
*/
Emails: string[];
/**
* The carrier identifier who requests to book the appointment
*
* @generated from protobuf field: string CarrierID = 9
*/
CarrierID: string;
/**
* The carrier name who requests to book the appointment
*
* @generated from protobuf field: string CarrierName = 10
*/
CarrierName: string;
/**
* time zone, useful only if a WMS send a message
*
* @generated from protobuf field: string TimeZone = 11
*/
TimeZone: string;
}
/**
* @generated from protobuf message api.BookAppointmentResponse
*/
@@ -1750,6 +1816,124 @@ class BookAppointmentRequest$Type extends MessageType<BookAppointmentRequest> {
*/
export const BookAppointmentRequest = new BookAppointmentRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class WMSBookAppointmentRequest$Type extends MessageType<WMSBookAppointmentRequest> {
constructor() {
super("api.WMSBookAppointmentRequest", [
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
{ no: 2, name: "AppointmentType", kind: "enum", localName: "AppointmentType", jsonName: "AppointmentType", T: () => ["api.AppointmentType", AppointmentType], options: { "validate.rules": { enum: { definedOnly: true } } } },
{ no: 3, name: "Commissions", kind: "message", localName: "Commissions", jsonName: "Commissions", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Commission },
{ no: 4, name: "SegmentationSelections", kind: "message", localName: "SegmentationSelections", jsonName: "SegmentationSelections", repeat: 2 /*RepeatType.UNPACKED*/, T: () => SegmentationSelection },
{ no: 5, name: "CarrierInformation", kind: "message", localName: "CarrierInformation", jsonName: "CarrierInformation", repeat: 2 /*RepeatType.UNPACKED*/, T: () => CarrierInformationWithValue },
{ no: 6, name: "Slots", kind: "message", localName: "Slots", jsonName: "Slots", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Slot },
{ no: 8, name: "Emails", kind: "scalar", localName: "Emails", jsonName: "Emails", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { repeated: { minItems: "1", items: { string: { email: true, ignoreEmpty: true } } } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Must be a valid email address", example: "[\"John.doe@reflex.com\", \"will.smith@reflex.com\"]" } } },
{ no: 9, name: "CarrierID", kind: "scalar", localName: "CarrierID", jsonName: "CarrierID", T: 9 /*ScalarType.STRING*/ },
{ no: 10, name: "CarrierName", kind: "scalar", localName: "CarrierName", jsonName: "CarrierName", T: 9 /*ScalarType.STRING*/ },
{ no: 11, name: "TimeZone", kind: "scalar", localName: "TimeZone", jsonName: "TimeZone", T: 9 /*ScalarType.STRING*/ }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "AppointmentType", "Segmentations", "CarrierInformation", "TimeZone"] } } });
}
create(value?: PartialMessage<WMSBookAppointmentRequest>): WMSBookAppointmentRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.AppointmentType = 0;
message.Commissions = [];
message.SegmentationSelections = [];
message.CarrierInformation = [];
message.Slots = [];
message.Emails = [];
message.CarrierID = "";
message.CarrierName = "";
message.TimeZone = "";
if (value !== undefined)
reflectionMergePartial<WMSBookAppointmentRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WMSBookAppointmentRequest): WMSBookAppointmentRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.RequestSiteHeader Header */ 1:
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
break;
case /* api.AppointmentType AppointmentType */ 2:
message.AppointmentType = reader.int32();
break;
case /* repeated api.Commission Commissions */ 3:
message.Commissions.push(Commission.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated api.SegmentationSelection SegmentationSelections */ 4:
message.SegmentationSelections.push(SegmentationSelection.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated api.CarrierInformationWithValue CarrierInformation */ 5:
message.CarrierInformation.push(CarrierInformationWithValue.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated api.Slot Slots */ 6:
message.Slots.push(Slot.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated string Emails */ 8:
message.Emails.push(reader.string());
break;
case /* string CarrierID */ 9:
message.CarrierID = reader.string();
break;
case /* string CarrierName */ 10:
message.CarrierName = reader.string();
break;
case /* string TimeZone */ 11:
message.TimeZone = reader.string();
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message: WMSBookAppointmentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.RequestSiteHeader Header = 1; */
if (message.Header)
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.AppointmentType AppointmentType = 2; */
if (message.AppointmentType !== 0)
writer.tag(2, WireType.Varint).int32(message.AppointmentType);
/* repeated api.Commission Commissions = 3; */
for (let i = 0; i < message.Commissions.length; i++)
Commission.internalBinaryWrite(message.Commissions[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
/* repeated api.SegmentationSelection SegmentationSelections = 4; */
for (let i = 0; i < message.SegmentationSelections.length; i++)
SegmentationSelection.internalBinaryWrite(message.SegmentationSelections[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
/* repeated api.CarrierInformationWithValue CarrierInformation = 5; */
for (let i = 0; i < message.CarrierInformation.length; i++)
CarrierInformationWithValue.internalBinaryWrite(message.CarrierInformation[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
/* repeated api.Slot Slots = 6; */
for (let i = 0; i < message.Slots.length; i++)
Slot.internalBinaryWrite(message.Slots[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* repeated string Emails = 8; */
for (let i = 0; i < message.Emails.length; i++)
writer.tag(8, WireType.LengthDelimited).string(message.Emails[i]);
/* string CarrierID = 9; */
if (message.CarrierID !== "")
writer.tag(9, WireType.LengthDelimited).string(message.CarrierID);
/* string CarrierName = 10; */
if (message.CarrierName !== "")
writer.tag(10, WireType.LengthDelimited).string(message.CarrierName);
/* string TimeZone = 11; */
if (message.TimeZone !== "")
writer.tag(11, WireType.LengthDelimited).string(message.TimeZone);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.WMSBookAppointmentRequest
*/
export const WMSBookAppointmentRequest = new WMSBookAppointmentRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class BookAppointmentResponse$Type extends MessageType<BookAppointmentResponse> {
constructor() {
super("api.BookAppointmentResponse", [
@@ -2002,8 +2186,10 @@ export const SiteService = new ServiceType("api.SiteService", [
{ name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Delete a site" }, "api.rscType": "Organisation", "api.roles": "", "api.moduleID": "appointment-scheduling", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteSiteRequest, O: DeleteSiteResponse },
{ name: "SuggestID", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Suggest a site ID" }, "api.rscType": "Organisation", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: SuggestSiteIDRequest, O: SuggestSiteIDResult },
{ name: "GetAvailableSlots", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Get available slots to book an appointment on the site." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetAvailableSlotsRequest, O: GetAvailableSlotsResponse },
{ name: "GetAllSlots", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Get all slots to book an appointment on the site." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetAvailableSlotsRequest, O: GetAvailableSlotsResponse },
{ name: "ListUserSites", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "List sites authorized for a user according to its permissions." }, "api.rscType": "Platform", "api.roles": "Platform.Site", "google.api.method_visibility": { restriction: "SDK" } }, I: ListUserSitesRequest, O: ListUserSitesResponse },
{ name: "BookAppointment", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Book an appointment on the site, if the requested slots are available." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: BookAppointmentRequest, O: BookAppointmentResponse },
{ name: "ForceBookAppointment", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Book an appointment on the site without checking if the slots are available." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: BookAppointmentRequest, O: BookAppointmentResponse },
{ name: "WMSForceBookAppointment", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Book an appointment on the site without checking if the slots are available, should not be called by human user." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: WMSBookAppointmentRequest, O: BookAppointmentResponse },
{ name: "CancelAppointment", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Site"], description: "Cancel an appointment on the site." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: CancelAppointmentRequest, O: CancelAppointmentResponse }
], { "api.k8sService": "core-site" });

View File

@@ -586,9 +586,9 @@ export interface SlotGroup {
*/
Slots: Slot[]; // List of slots belonging to the group.
/**
* @generated from protobuf field: uint32 Availability = 2
* @generated from protobuf field: int32 Availability = 2
*/
Availability: number; // Availability of the slot group according to site configuration and current bookings (0: no longer available, 100: fully available).
Availability: number; // Availability of the slot group according to site configuration and current bookings -1 to 100 (-1: closed, 0: no longer available, 100: fully available).
}
/**
* @generated from protobuf enum api.AppointmentType
@@ -2461,7 +2461,7 @@ class SlotGroup$Type extends MessageType<SlotGroup> {
constructor() {
super("api.SlotGroup", [
{ no: 1, name: "Slots", kind: "message", localName: "Slots", jsonName: "Slots", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Slot },
{ no: 2, name: "Availability", kind: "scalar", localName: "Availability", jsonName: "Availability", T: 13 /*ScalarType.UINT32*/ }
{ no: 2, name: "Availability", kind: "scalar", localName: "Availability", jsonName: "Availability", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { lte: 100, gte: -1 } } } }
]);
}
create(value?: PartialMessage<SlotGroup>): SlotGroup {
@@ -2480,8 +2480,8 @@ class SlotGroup$Type extends MessageType<SlotGroup> {
case /* repeated api.Slot Slots */ 1:
message.Slots.push(Slot.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* uint32 Availability */ 2:
message.Availability = reader.uint32();
case /* int32 Availability */ 2:
message.Availability = reader.int32();
break;
default:
let u = options.readUnknownField;
@@ -2498,9 +2498,9 @@ class SlotGroup$Type extends MessageType<SlotGroup> {
/* repeated api.Slot Slots = 1; */
for (let i = 0; i < message.Slots.length; i++)
Slot.internalBinaryWrite(message.Slots[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* uint32 Availability = 2; */
/* int32 Availability = 2; */
if (message.Availability !== 0)
writer.tag(2, WireType.Varint).uint32(message.Availability);
writer.tag(2, WireType.Varint).int32(message.Availability);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);