cbcore-ts 1.0.1 → 1.0.5
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.
|
@@ -124,6 +124,7 @@ export declare type CBSocketMultipleMessagecompletionFunction = (responseMessage
|
|
|
124
124
|
export interface CBSocketMessageSendResponseFunction<ResponseMessageType = any> extends CBSocketMessageSendResponseFunctionBase<ResponseMessageType> {
|
|
125
125
|
respondingToMainResponse: boolean;
|
|
126
126
|
excludeMessageFromAutomaticConnectionEvents: () => void;
|
|
127
|
+
deferResponse: () => void;
|
|
127
128
|
setResponseValidityDuration(duration: number): void;
|
|
128
129
|
useStoredResponseWithErrorResponse(): void;
|
|
129
130
|
sendErrorResponse(message?: any, completion?: CBSocketMessageCompletionFunction): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../scripts/CBDataInterfaces.ts"],
|
|
4
|
-
"sourcesContent": ["\n\n\n\n\nexport type CBReferenceID = string;\n\n\nexport interface CBLanguageItem {\n \n value: string;\n languageKey: string;\n itemKey: string;\n \n}\n\n\nexport interface LanguagesData {\n [key: string]: {\n [key: string]: string;\n };\n}\n\n\n\n\n\nexport interface CBFinancialAmount {\n \n amount: number;\n currency: string;\n \n}\n\n\nexport interface CBLocalizedTextObject {\n \n [key: string]: string\n \n}\n\n\nexport interface CBDropdownData<T> {\n \n _id: CBReferenceID;\n name?: CBLocalizedTextObject;\n dropdownCode: string;\n data: CBDropdownDataItem<T>[];\n \n}\n\n\nexport interface CBDropdownDataItem<T> {\n \n _id: CBReferenceID;\n title: CBLocalizedTextObject;\n rowsData?: CBDropdownDataItem<T>[]\n isADropdownDataSection: boolean;\n isADropdownDataRow: boolean;\n \n attachedObject: T\n \n itemCode: string;\n dropdownCode: string;\n \n}\n\n\n\n\n\n\n\nexport interface CBFileAccessor {\n \n fileData: CBFileData;\n createdAt: number;\n \n}\n\n\nexport interface CBFileData {\n \n _id: string;\n \n name: string;\n dataURL: string;\n type: string;\n isLimitedAccess?: boolean;\n accessibleToUsers?: CBUserProfilePublic[];\n \n}\n\nexport enum CBAuthenticationSource {\n \n google = 10,\n facebook = 11,\n emailAccessLink = 200,\n password = 220,\n inquiryAccessLink = 500\n \n}\n\n// AsdAsd\n\nexport interface CBCoreInitializer {\n \n languageValues: LanguagesData;\n defaultLanguageKey: string;\n \n}\n\nexport interface CBLoginKey {\n \n key: string;\n \n accessToken: string;\n \n storeAccessTokenInClient: boolean;\n \n authenticationSource: CBAuthenticationSource;\n \n userID: CBReferenceID;\n \n isValid: boolean;\n \n loginDate?: Date;\n logoutDate?: Date;\n \n createdAt: Date;\n updatedAt: Date;\n \n}\n\nexport interface CBUserPassword {\n \n passwordHash: string;\n \n userID: CBReferenceID;\n \n isValid: boolean;\n \n createdAt: Date;\n updatedAt: Date;\n \n}\n\nexport interface CBAdministratorRightsDescriptor {\n \n userProfile: CBUserProfile;\n \n}\n\nexport interface CBSubscription {\n \n _id: CBReferenceID;\n startDate: Date;\n endDate?: Date;\n \n isIndefinite: boolean;\n \n subscriptionKind: number;// alternatiiv oleks string/objectId, mis viitaks t\u00FC\u00FCbi objektile eraldi tabelis\n createdAt: Date;\n updatedAt: Date;\n \n}\n\n//Asdasd\n\nexport type CBUserProfilePublic = any;\nexport type CBUserProfile = any;\n\n\nexport interface SocketClientInterface {\n \n [x: string]: SocketClientFunction<any, any>;\n \n}\n\n\nexport interface SocketClientResult<ResultType> {\n \n responseMessage: any;\n result: ResultType;\n errorResult: any;\n respondWithMessage: CBSocketMessageSendResponseFunction;\n \n}\n\n\nexport type SocketClientFunction<MessageType, ResultType> = (\n messageData: MessageType,\n completionPolicy?: string,\n isUserBound?: boolean\n) => Promise<SocketClientResult<ResultType>>;\n\nexport type SocketClientNoMessageFunction<ResultType> = (\n messageData?: null,\n completionPolicy?: string,\n isUserBound?: boolean\n) => Promise<SocketClientResult<ResultType>>;\n\n\n\n\n\nexport interface CBSocketMultipleMessageObject<MessageDataType = any> {\n \n key: string;\n message: CBSocketMessage<MessageDataType>;\n \n}\n\n\n// CBSocket communication messages\nexport interface CBSocketMessage<MessageDataType = any> {\n \n identifier: string;\n inResponseToIdentifier?: string;\n keepWaitingForResponses?: boolean;\n \n messageData: MessageDataType;\n \n // This is sent from client to server with requests\n storedResponseHash?: string;\n \n // This is always present on messages sent from the server side\n messageDataHash?: string;\n \n // This tells the client to store this message for future use\n canBeStoredAsResponse?: boolean;\n \n // This tells the client to use the previously stored response\n useStoredResponse?: boolean;\n \n // This tells the client that the response is valid for at least this long in ms\n responseValidityDuration?: number;\n \n}\n\n\nexport interface CBSocketMultipleMessage extends CBSocketMessage<CBSocketMultipleMessageObject[]> {\n \n shouldGroupResponses: boolean;\n \n}\n\n\nexport type CBSocketMessageSendResponseFunctionBase<ResponseMessageType> = (\n responseMessage: ResponseMessageType,\n completion?: CBSocketMessageCompletionFunction\n) => Promise<string>;\n\nexport type CBSocketMessageCompletionFunction = (\n responseMessage: any,\n respondWithMessage: CBSocketMessageSendResponseFunction\n) => void;\nexport type CBSocketMessageHandlerFunction<ResponseMessageType = any> = (\n message: any,\n respondWithMessage: CBSocketMessageSendResponseFunction<ResponseMessageType>\n) => void;\n\nexport type CBSocketMultipleMessagecompletionFunction = (\n responseMessages: any[],\n callcompletionFunctions: () => void\n) => void;\n\n\nexport interface CBSocketMessageSendResponseFunction<ResponseMessageType = any> extends CBSocketMessageSendResponseFunctionBase<ResponseMessageType> {\n respondingToMainResponse: boolean;\n \n excludeMessageFromAutomaticConnectionEvents: () => void;\n \n setResponseValidityDuration(duration: number): void;\n \n useStoredResponseWithErrorResponse(): void;\n \n sendErrorResponse(message?: any, completion?: CBSocketMessageCompletionFunction): void;\n \n sendIntermediateResponse(updateMessage: any, completion?: CBSocketMessageCompletionFunction): void;\n \n // This tells the client to use the stored response if responseHash matches and also enables storing of responses\n // in the client in the first place. Returns true if the hash matched.\n confirmStoredResponseHash(responseHash: string, completion?: CBSocketMessageCompletionFunction): boolean;\n \n}\n\n\n\n// Socket handshake messages\nexport interface CBSocketHandshakeInitMessage {\n \n accessToken?: string;\n userID: CBReferenceID;\n \n loginKey?: string;\n inquiryAccessKey?: string;\n \n instanceIdentifier: string;\n \n}\n\n\nexport interface CBSocketHandshakeResponseMessage {\n \n accepted: boolean;\n \n userProfile?: CBUserProfile;\n \n}\n\n\n\n\n\nexport type TypeWithoutKey<Type, Key> = Pick<Type, Exclude<keyof Type, Key>>;\n\nexport type TypeWithoutID<Type> = TypeWithoutKey<Type, \"_id\">;\n\nexport type Diff<T extends keyof any, U extends keyof any> =\n ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];\n\nexport type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U;\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?:\n T[P] extends (infer U)[] ? RecursivePartial<U>[] :\n T[P] extends object ? RecursivePartial<T[P]> :\n T[P];\n};\n\n\n\n\n\n\n"],
|
|
4
|
+
"sourcesContent": ["\n\n\n\n\nexport type CBReferenceID = string;\n\n\nexport interface CBLanguageItem {\n \n value: string;\n languageKey: string;\n itemKey: string;\n \n}\n\n\nexport interface LanguagesData {\n [key: string]: {\n [key: string]: string;\n };\n}\n\n\n\n\n\nexport interface CBFinancialAmount {\n \n amount: number;\n currency: string;\n \n}\n\n\nexport interface CBLocalizedTextObject {\n \n [key: string]: string\n \n}\n\n\nexport interface CBDropdownData<T> {\n \n _id: CBReferenceID;\n name?: CBLocalizedTextObject;\n dropdownCode: string;\n data: CBDropdownDataItem<T>[];\n \n}\n\n\nexport interface CBDropdownDataItem<T> {\n \n _id: CBReferenceID;\n title: CBLocalizedTextObject;\n rowsData?: CBDropdownDataItem<T>[]\n isADropdownDataSection: boolean;\n isADropdownDataRow: boolean;\n \n attachedObject: T\n \n itemCode: string;\n dropdownCode: string;\n \n}\n\n\n\n\n\n\n\nexport interface CBFileAccessor {\n \n fileData: CBFileData;\n createdAt: number;\n \n}\n\n\nexport interface CBFileData {\n \n _id: string;\n \n name: string;\n dataURL: string;\n type: string;\n isLimitedAccess?: boolean;\n accessibleToUsers?: CBUserProfilePublic[];\n \n}\n\nexport enum CBAuthenticationSource {\n \n google = 10,\n facebook = 11,\n emailAccessLink = 200,\n password = 220,\n inquiryAccessLink = 500\n \n}\n\n// AsdAsd\n\nexport interface CBCoreInitializer {\n \n languageValues: LanguagesData;\n defaultLanguageKey: string;\n \n}\n\nexport interface CBLoginKey {\n \n key: string;\n \n accessToken: string;\n \n storeAccessTokenInClient: boolean;\n \n authenticationSource: CBAuthenticationSource;\n \n userID: CBReferenceID;\n \n isValid: boolean;\n \n loginDate?: Date;\n logoutDate?: Date;\n \n createdAt: Date;\n updatedAt: Date;\n \n}\n\nexport interface CBUserPassword {\n \n passwordHash: string;\n \n userID: CBReferenceID;\n \n isValid: boolean;\n \n createdAt: Date;\n updatedAt: Date;\n \n}\n\nexport interface CBAdministratorRightsDescriptor {\n \n userProfile: CBUserProfile;\n \n}\n\nexport interface CBSubscription {\n \n _id: CBReferenceID;\n startDate: Date;\n endDate?: Date;\n \n isIndefinite: boolean;\n \n subscriptionKind: number;// alternatiiv oleks string/objectId, mis viitaks t\u00FC\u00FCbi objektile eraldi tabelis\n createdAt: Date;\n updatedAt: Date;\n \n}\n\n//Asdasd\n\nexport type CBUserProfilePublic = any;\nexport type CBUserProfile = any;\n\n\nexport interface SocketClientInterface {\n \n [x: string]: SocketClientFunction<any, any>;\n \n}\n\n\nexport interface SocketClientResult<ResultType> {\n \n responseMessage: any;\n result: ResultType;\n errorResult: any;\n respondWithMessage: CBSocketMessageSendResponseFunction;\n \n}\n\n\nexport type SocketClientFunction<MessageType, ResultType> = (\n messageData: MessageType,\n completionPolicy?: string,\n isUserBound?: boolean\n) => Promise<SocketClientResult<ResultType>>;\n\nexport type SocketClientNoMessageFunction<ResultType> = (\n messageData?: null,\n completionPolicy?: string,\n isUserBound?: boolean\n) => Promise<SocketClientResult<ResultType>>;\n\n\n\n\n\nexport interface CBSocketMultipleMessageObject<MessageDataType = any> {\n \n key: string;\n message: CBSocketMessage<MessageDataType>;\n \n}\n\n\n// CBSocket communication messages\nexport interface CBSocketMessage<MessageDataType = any> {\n \n identifier: string;\n inResponseToIdentifier?: string;\n keepWaitingForResponses?: boolean;\n \n messageData: MessageDataType;\n \n // This is sent from client to server with requests\n storedResponseHash?: string;\n \n // This is always present on messages sent from the server side\n messageDataHash?: string;\n \n // This tells the client to store this message for future use\n canBeStoredAsResponse?: boolean;\n \n // This tells the client to use the previously stored response\n useStoredResponse?: boolean;\n \n // This tells the client that the response is valid for at least this long in ms\n responseValidityDuration?: number;\n \n}\n\n\nexport interface CBSocketMultipleMessage extends CBSocketMessage<CBSocketMultipleMessageObject[]> {\n \n shouldGroupResponses: boolean;\n \n}\n\n\nexport type CBSocketMessageSendResponseFunctionBase<ResponseMessageType> = (\n responseMessage: ResponseMessageType,\n completion?: CBSocketMessageCompletionFunction\n) => Promise<string>;\n\nexport type CBSocketMessageCompletionFunction = (\n responseMessage: any,\n respondWithMessage: CBSocketMessageSendResponseFunction\n) => void;\nexport type CBSocketMessageHandlerFunction<ResponseMessageType = any> = (\n message: any,\n respondWithMessage: CBSocketMessageSendResponseFunction<ResponseMessageType>\n) => void;\n\nexport type CBSocketMultipleMessagecompletionFunction = (\n responseMessages: any[],\n callcompletionFunctions: () => void\n) => void;\n\n\nexport interface CBSocketMessageSendResponseFunction<ResponseMessageType = any> extends CBSocketMessageSendResponseFunctionBase<ResponseMessageType> {\n respondingToMainResponse: boolean;\n \n excludeMessageFromAutomaticConnectionEvents: () => void;\n \n deferResponse: () => void;\n \n setResponseValidityDuration(duration: number): void;\n \n useStoredResponseWithErrorResponse(): void;\n \n sendErrorResponse(message?: any, completion?: CBSocketMessageCompletionFunction): void;\n \n sendIntermediateResponse(updateMessage: any, completion?: CBSocketMessageCompletionFunction): void;\n \n // This tells the client to use the stored response if responseHash matches and also enables storing of responses\n // in the client in the first place. Returns true if the hash matched.\n confirmStoredResponseHash(responseHash: string, completion?: CBSocketMessageCompletionFunction): boolean;\n \n}\n\n\n\n// Socket handshake messages\nexport interface CBSocketHandshakeInitMessage {\n \n accessToken?: string;\n userID: CBReferenceID;\n \n loginKey?: string;\n inquiryAccessKey?: string;\n \n instanceIdentifier: string;\n \n}\n\n\nexport interface CBSocketHandshakeResponseMessage {\n \n accepted: boolean;\n \n userProfile?: CBUserProfile;\n \n}\n\n\n\n\n\nexport type TypeWithoutKey<Type, Key> = Pick<Type, Exclude<keyof Type, Key>>;\n\nexport type TypeWithoutID<Type> = TypeWithoutKey<Type, \"_id\">;\n\nexport type Diff<T extends keyof any, U extends keyof any> =\n ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];\n\nexport type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U;\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?:\n T[P] extends (infer U)[] ? RecursivePartial<U>[] :\n T[P] extends object ? RecursivePartial<T[P]> :\n T[P];\n};\n\n\n\n\n\n\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6FO,IAAK,yBAAL,kBAAKA,4BAAL;AAEH,EAAAA,gDAAA,YAAS,MAAT;AACA,EAAAA,gDAAA,cAAW,MAAX;AACA,EAAAA,gDAAA,qBAAkB,OAAlB;AACA,EAAAA,gDAAA,cAAW,OAAX;AACA,EAAAA,gDAAA,uBAAoB,OAApB;AANQ,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["CBAuthenticationSource"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cbcore-ts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "CBCore is a library to build web applications using pure Typescript.",
|
|
5
5
|
"main": "compiledScripts/index.js",
|
|
6
6
|
"types": "compiledScripts/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/object-hash": "^2.1.1",
|
|
35
35
|
"object-hash": "^2.1.1",
|
|
36
36
|
"socket.io-client": "^4.5.2",
|
|
37
|
-
"uicore-ts": "^1.0.
|
|
37
|
+
"uicore-ts": "^1.0.107"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@rollup/plugin-commonjs": "^23.0.0",
|
|
@@ -271,6 +271,8 @@ export interface CBSocketMessageSendResponseFunction<ResponseMessageType = any>
|
|
|
271
271
|
|
|
272
272
|
excludeMessageFromAutomaticConnectionEvents: () => void;
|
|
273
273
|
|
|
274
|
+
deferResponse: () => void;
|
|
275
|
+
|
|
274
276
|
setResponseValidityDuration(duration: number): void;
|
|
275
277
|
|
|
276
278
|
useStoredResponseWithErrorResponse(): void;
|