quirons-broker
Advanced tools
Comparing version 0.0.1-alpha.4 to 0.0.1-alpha.5
@@ -330,22 +330,16 @@ import * as t from 'io-ts'; | ||
export declare const Method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
export declare type Method = t.TypeOf<typeof Method>; | ||
export declare const SenderMessage: t.UnionC<[t.TypeC<{ | ||
export declare const SenderMessageContent: t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"allowance">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -366,14 +360,8 @@ companyId: t.StringC; | ||
kind: t.LiteralC<"additional">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -391,14 +379,8 @@ companyCode: t.StringC; | ||
kind: t.LiteralC<"leaveofabscence">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -424,14 +406,8 @@ companyId: t.StringC; | ||
kind: t.LiteralC<"stability">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -449,14 +425,8 @@ companyId: t.StringC; | ||
kind: t.LiteralC<"trainingnecessity">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -474,2 +444,115 @@ companyId: t.StringC; | ||
}>]>; | ||
export declare type SenderMessageContent = t.TypeOf<typeof SenderMessageContent>; | ||
export declare const SenderMessage: t.TypeC<{ | ||
kind: t.LiteralC<"send">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
}>; | ||
content: t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"allowance">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
startTime: t.StringC; | ||
endDate: t.Type<Date, string, unknown>; | ||
endTime: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
code: t.StringC; | ||
justification: t.StringC; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"additional">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyCode: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
unhealthyDegree: t.StringC; | ||
dangerousness: t.StringC; | ||
entryDate: t.Type<string, string, unknown>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"leaveofabscence">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
branchId: t.StringC; | ||
startTime: t.Type<string, string, unknown>; | ||
endDate: t.Type<Date, string, unknown>; | ||
endTime: t.Type<string, string, unknown>; | ||
leaveOfAbsenceCode: t.StringC; | ||
internationalDiseaseClassification: t.StringC; | ||
classEntityRegistrationCode: t.StringC; | ||
doctorName: t.StringC; | ||
classEntityState: t.StringC; | ||
classEntity: t.StringC; | ||
accidentClassification: t.StringC; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"stability">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
stabilityCode: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
endDate: t.Type<Date, string, unknown>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"trainingnecessity">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
employeeId: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
branchId: t.StringC; | ||
trainingNecessityCode: t.StringC; | ||
reason: t.StringC; | ||
urgency: t.StringC; | ||
hazardTechnicalResponsible: t.StringC; | ||
}>]>; | ||
}>]>; | ||
}>; | ||
export declare type SenderMessage = t.TypeOf<typeof SenderMessage>; | ||
@@ -887,4 +970,4 @@ /** | ||
}>]>>; | ||
}>]>, t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"allowance">; | ||
}>]>, t.TypeC<{ | ||
kind: t.LiteralC<"send">; | ||
identification: t.TypeC<{ | ||
@@ -896,127 +979,106 @@ /** The userId used in the backend. */ | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
startTime: t.StringC; | ||
endDate: t.Type<Date, string, unknown>; | ||
endTime: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
code: t.StringC; | ||
justification: t.StringC; | ||
content: t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"allowance">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
startTime: t.StringC; | ||
endDate: t.Type<Date, string, unknown>; | ||
endTime: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
code: t.StringC; | ||
justification: t.StringC; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"additional">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyCode: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
unhealthyDegree: t.StringC; | ||
dangerousness: t.StringC; | ||
entryDate: t.Type<string, string, unknown>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"leaveofabscence">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
branchId: t.StringC; | ||
startTime: t.Type<string, string, unknown>; | ||
endDate: t.Type<Date, string, unknown>; | ||
endTime: t.Type<string, string, unknown>; | ||
leaveOfAbsenceCode: t.StringC; | ||
internationalDiseaseClassification: t.StringC; | ||
classEntityRegistrationCode: t.StringC; | ||
doctorName: t.StringC; | ||
classEntityState: t.StringC; | ||
classEntity: t.StringC; | ||
accidentClassification: t.StringC; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"stability">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
stabilityCode: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
endDate: t.Type<Date, string, unknown>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"trainingnecessity">; | ||
verb: t.KeyofC<{ | ||
get: null; | ||
post: null; | ||
put: null; | ||
delete: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
employeeId: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
branchId: t.StringC; | ||
trainingNecessityCode: t.StringC; | ||
reason: t.StringC; | ||
urgency: t.StringC; | ||
hazardTechnicalResponsible: t.StringC; | ||
}>]>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"additional">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyCode: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
unhealthyDegree: t.StringC; | ||
dangerousness: t.StringC; | ||
entryDate: t.Type<string, string, unknown>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"leaveofabscence">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
branchId: t.StringC; | ||
startTime: t.Type<string, string, unknown>; | ||
endDate: t.Type<Date, string, unknown>; | ||
endTime: t.Type<string, string, unknown>; | ||
leaveOfAbsenceCode: t.StringC; | ||
internationalDiseaseClassification: t.StringC; | ||
classEntityRegistrationCode: t.StringC; | ||
doctorName: t.StringC; | ||
classEntityState: t.StringC; | ||
classEntity: t.StringC; | ||
accidentClassification: t.StringC; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"stability">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
branchId: t.StringC; | ||
employeeId: t.StringC; | ||
startDate: t.Type<Date, string, unknown>; | ||
stabilityCode: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
endDate: t.Type<Date, string, unknown>; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"trainingnecessity">; | ||
identification: t.TypeC<{ | ||
/** The userId used in the backend. */ | ||
userId: t.StringC; | ||
/** The branch the user is currently using. */ | ||
branchId: t.StringC; | ||
}>; | ||
method: t.KeyofC<{ | ||
GET: null; | ||
POST: null; | ||
PUT: null; | ||
DELETE: null; | ||
}>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
companyId: t.StringC; | ||
employeeId: t.StringC; | ||
}>, t.PartialC<{ | ||
id: t.StringC; | ||
branchId: t.StringC; | ||
trainingNecessityCode: t.StringC; | ||
reason: t.StringC; | ||
urgency: t.StringC; | ||
hazardTechnicalResponsible: t.StringC; | ||
}>]>; | ||
}>]>]>; | ||
}>]>; | ||
export declare type Message = t.TypeOf<typeof Message>; | ||
@@ -1023,0 +1085,0 @@ /** |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Message = exports.BusinessRequest = exports.Deleted = exports.Delete = exports.SenderMessage = exports.Method = exports.BusinessMessage = exports.TError = exports.Greeting = exports.Identification = void 0; | ||
exports.Message = exports.BusinessRequest = exports.Deleted = exports.Delete = exports.SenderMessage = exports.SenderMessageContent = exports.Method = exports.BusinessMessage = exports.TError = exports.Greeting = exports.Identification = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -94,8 +94,8 @@ const errors_1 = require("./errors"); | ||
exports.Method = t.keyof({ | ||
GET: null, | ||
POST: null, | ||
PUT: null, | ||
DELETE: null | ||
get: null, | ||
post: null, | ||
put: null, | ||
delete: null | ||
}); | ||
exports.SenderMessage = t.union([ | ||
exports.SenderMessageContent = t.union([ | ||
senderMessage('allowance', Allowance_1_000_1.AllowanceInfo), | ||
@@ -107,2 +107,7 @@ senderMessage('additional', Additional_1_000_1.AdditionalInfo), | ||
]); | ||
exports.SenderMessage = t.type({ | ||
kind: t.literal('send'), | ||
identification: exports.Identification, | ||
content: exports.SenderMessageContent | ||
}); | ||
/** | ||
@@ -181,10 +186,8 @@ * A delete message. | ||
} | ||
// Type for a sender message (with identification) | ||
function senderMessage(kind, content) { | ||
return t.type({ | ||
kind: t.literal(kind), | ||
identification: exports.Identification, | ||
method: exports.Method, | ||
verb: exports.Method, | ||
content | ||
}); | ||
} |
{ | ||
"name": "quirons-broker", | ||
"version": "0.0.1-alpha.4", | ||
"version": "0.0.1-alpha.5", | ||
"description": "A small library to expose the broker ttalk types", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
170834
4620