quirons-broker
Advanced tools
Comparing version 0.0.1-alpha.7 to 0.0.1-alpha.8
@@ -553,2 +553,8 @@ import * as t from 'io-ts'; | ||
export declare type SenderMessage = t.TypeOf<typeof SenderMessage>; | ||
export declare const SenderResponseMessage: t.IntersectionC<[t.TypeC<{ | ||
kind: t.LiteralC<"senderResponse">; | ||
}>, t.PartialC<{ | ||
errorMessage: t.StringC; | ||
}>]>; | ||
export declare type SenderResponseMessage = t.TypeOf<typeof SenderResponseMessage>; | ||
/** | ||
@@ -596,2 +602,25 @@ * Common content of a business message. | ||
export declare type BusinessRequest = t.TypeOf<typeof BusinessRequest>; | ||
export declare const BusinessRequestMessage: t.TypeC<{ | ||
kind: t.LiteralC<"request">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
/** | ||
* Which kind of message we're requesting. | ||
*/ | ||
kind: t.UnionC<[t.LiteralC<"costcenter">, t.LiteralC<"occupation">, t.LiteralC<"workshift">, t.LiteralC<"training">, t.LiteralC<"absencetype">, t.LiteralC<"allowancetype">, t.LiteralC<"stabilitytype">, t.LiteralC<"person">, t.LiteralC<"employee">, t.LiteralC<"dependant">, t.LiteralC<"functionalhistory">, t.LiteralC<"traininghistory">]>; | ||
}>, t.PartialC<{ | ||
/** Optional starting date, requesting only newer entries. */ | ||
date: t.Type<Date, string, unknown>; | ||
/** Optional page offset of the request. */ | ||
page: t.NumberC; | ||
/** Number of items per request page. */ | ||
pageSize: t.NumberC; | ||
}>]>; | ||
}>; | ||
export declare type BusinessRequestMessage = t.TypeOf<typeof BusinessRequestMessage>; | ||
/** | ||
@@ -1077,3 +1106,7 @@ * Message protocol used between the broker and the backend. | ||
}>]>; | ||
}>]>; | ||
}>, t.IntersectionC<[t.TypeC<{ | ||
kind: t.LiteralC<"senderResponse">; | ||
}>, t.PartialC<{ | ||
errorMessage: t.StringC; | ||
}>]>]>; | ||
export declare type Message = t.TypeOf<typeof Message>; | ||
@@ -1080,0 +1113,0 @@ /** |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Message = exports.BusinessRequest = exports.Deleted = exports.Delete = exports.SenderMessage = exports.SenderMessageContent = exports.Method = exports.BusinessMessage = exports.TError = exports.Greeting = exports.Identification = void 0; | ||
exports.Message = exports.BusinessRequestMessage = exports.BusinessRequest = exports.Deleted = exports.Delete = exports.SenderResponseMessage = exports.SenderMessage = exports.SenderMessageContent = exports.Method = exports.BusinessMessage = exports.TError = exports.Greeting = exports.Identification = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -111,2 +111,10 @@ const errors_1 = require("./errors"); | ||
}); | ||
exports.SenderResponseMessage = t.intersection([ | ||
t.type({ | ||
kind: t.literal('senderResponse'), | ||
}), | ||
t.partial({ | ||
errorMessage: t.string | ||
}) | ||
]); | ||
/** | ||
@@ -156,2 +164,3 @@ * A delete message. | ||
]); | ||
exports.BusinessRequestMessage = userMessage('request', exports.BusinessRequest); | ||
/** | ||
@@ -165,7 +174,8 @@ * Message protocol used between the broker and the backend. | ||
metaMessage('greeting', exports.Greeting), | ||
userMessage('request', exports.BusinessRequest), | ||
exports.BusinessRequestMessage, | ||
userMessage('delete', exports.Delete), | ||
userMessage('deleted', exports.Deleted), | ||
exports.BusinessMessage, | ||
exports.SenderMessage | ||
exports.SenderMessage, | ||
exports.SenderResponseMessage | ||
]); | ||
@@ -172,0 +182,0 @@ // Type for a meta message (without identification) |
{ | ||
"name": "quirons-broker", | ||
"version": "0.0.1-alpha.7", | ||
"version": "0.0.1-alpha.8", | ||
"description": "A small library to expose the broker ttalk types", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
172622
4665