0.0.5 • Published 4 years ago

@davidezechukwucode/decode.web.contracts v0.0.5

Weekly downloads
-
License
0BSD
Repository
github
Last release
4 years ago

Decode.Web.Contracts

This is a Typescript packge shared by the client and API. It contains contracts (interfaces), constants and types used by both the client and API. The really good thing about Typescript (or Javascript) is it's unique ability to be used in both the client, the API and even the datastore if MOngoDB is chosen as the Datastore. This promotes the I in SOLID, Interface Segregation Principle. From expierence, it is worth it's weight in gold for that alone.

Additional. The system has been built to allow swtiching from numeric ID to string or GUID using just 3 lines of code in https://github.com/davidezechukwu/DavidExechukwuCode/blob/master/decode.web.contracts/src/types/IDType.ts

//when IDs are numeric; //PS: This poses a security risk, especially when IDs are sequential //Turn on Sequential IDs security features on DataStore to mitigate against this //For example, SQL Server could be made to generate IDs like 1,2,10,12,22,... //Additional Use Trap (Fake) IDs to detect and block sequential ID page scrappers

export type IDType = number; export const IDTypeName: string = 'number'; export const IDisNumeric: boolean = true;

//when ID is a string (or GUID); //PS: This poses a performance risk on datasource, especially when GIIDs are used as GUIDS are 16 Bytes! loooong as opposed to 8Bytes of Big Int and 4 Bytes of Int, etc //export type IDType = string; //export const IDTypeName: string = 'string'; //export const IDisNumeric: boolean = false

npm i npmrc -g npm config set registry https://www.npmjs.com/org/davidezechukwucode/

git remote add origin git://github.com/davidezechukwu/decode.web.contracts.git