2.3.90 • Published 10 months ago

@erboladaiorg/quaerat-ex-amet v2.3.90

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@erboladaiorg/quaerat-ex-amet

A web service for APIs.

language npm version license gzip file size npm download npm download jsdelivr download

Documentation

To view documentation or get support, visit docs.

Installation

Using npm(ES6 module):

npm i @erboladaiorg/quaerat-ex-amet

Example for server:

Link: [dev source code]

import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
import WWebApi from './server/WWebApi.mjs'
import getSettings from './g.getSettings.mjs'

//st let st = getSettings()

let url = mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort} //使用Mongodb測試 let db = st.dbName let opt = {

bCheckUser: false,
getUserById: null,
bExcludeWhenNotAdmin: false,

serverPort: 11005,
subfolder: '', //mapi
urlRedirect: 'https://www.google.com/', //本機測試時得先編譯, 再瀏覽: http://localhost:11005/

webName: {
    'eng': 'API Service',
    'cht': 'API管理系統',
},
webDescription: {
    'eng': 'A web service package as methods to send requests to and receive responses from an API.',
    'cht': 'A web service package as methods to send requests to and receive responses from an API.',
},
webLogo: 'data:image/svg+xml;base64,...',

}

let getUserByToken = async (token) => { // return {} //測試無法登入 if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者 return { id: 'id-for-application', name: 'application', email: 'application@example.com', isAdmin: 'y', } } if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys return { id: 'id-for-admin', name: '測試者', email: 'admin@example.com', isAdmin: 'y', } } console.log('invalid token', token) console.log('於生產環境時得加入SSO等驗證token機制') return {} }

let verifyBrowserUser = (user, caller) => { console.log('verifyBrowserUser/user', user) // return false //測試無法登入 console.log('於生產環境時得加入限制瀏覽器使用者身份機制') return user.isAdmin === 'y' //測試僅系統管理者使用 }

let verifyAppUser = (user, caller) => { console.log('verifyAppUser/user', user) // return false //測試無法登入 console.log('於生產環境時得加入限制應用程式使用者身份機制') return user.isAdmin === 'y' //測試僅系統管理者使用 }

//WWebApi let instWWebApi = WWebApi(WOrm, url, db, getUserByToken, verifyBrowserUser, verifyAppUser, opt)

instWWebApi.on('error', (err) => { console.log(err) })

testerjsInt32ArrayRegExp#flagstypesnopefindenumerableelasticacheansiFunction.prototype.namecommandhasOwnglobalseslintconfigawesomesaucebannerzerowritableacorncensorformattingECMAScript 3libphonenumberTypedArrayclasseses2016parsemake dirtoobjectclonerobustcallstringifyHyBipinoqstimedescriptorssideterminalzxajvnamestylesheetframerequallockfileES2022lazyiterateStreamReactiveXflagFloat64Arraytypescriptdependenciespoint-freeieposeconcattouchIterator_.extendreact animationvalidtestingfastcopydataviewjsonschemaECMAScript 5binary__proto__shrinkwraproute53negativeglobextraMapsortcallbinduninstallcachereduceremitserializationescapeES3prototacitasterisksreplayregexremovesigneddirsignalArrayBuffer#slicewgetbrowserlistdeepclonefindLastcommanderworkspace:*es-shimsloggenericssqstrimEndauthenticationchildhookssigtermES7envstartergraphqlpackage managerforkfunctionsvestperformancecall-bindsharedarraybufferfile systemobjecthigher-orderUint8ClampedArraydependency manageres-shim APIcoercibledescriptorslotexpressiones-abstractCSSsetio-tsuploadlruinputasyncprogressi18nObject.getPrototypeOfurlpositivethreefastxhrimmerdayjsstyleguidedeepspinnersapollodeepcopyshimURLSearchParamspromisetesttoStringTagMicrosoftmkdirpES2016toolkiteventEmittercertificateslesssignalsruntimedateassertscolumnES6statuskeyscurlhelperstylenodejsoutputmatchAllsymlinkloadbalancingexecuteflatMapcssES8awshelpersglacierspawnharmonypnpm9momentnode$.extendES2017ArrayBufferreact-hookszodexecfilesimpledbfast-copynamesformcomparepreserve-symlinksignorewhichdescriptionconfigtostringtagloadingreact posesomeencryptionTypeBoxglobal objectObject.valuesredactenvironmentsinstylingtypedbundlingfast-deep-copysettingsswfobjpluginforEaches6xtermgetterArraygetintrinsicpopmotionsymlinkswindownumberObject.fromEntrieseventDispatchereslintstreamwindowsarrayutilityarraybufferbyteoptimizerPushbinddeep-copytypanionvarsdatareact-hook-formajaxregular expressionassigngitignoreES2018Object.keysyupinspectless cssparseriteratorpureconsumepackage.jsonparsingfluxtc39errorphonestyles3domitfpsboundformates7nested csschaijsdiffArray.prototype.findLastIndexselfisexpressWebSocketimportcorePromisequeueMicrotaskexitcopyreal-timeeveryObject.entriespackagesgetoptguidES2023s3interruptsbeanstalkgdprnpmtoReversedeslintpluginArrayBuffer.prototype.sliceSystem.globalgetcolorsmanagermatcheselmRegExp.prototype.flagsentriestyped arrayiames5JSONreduxpropsetPrototypeOfdragcallboundnpmignoreserializecomputed-typesexit-codehandlersamazonpreprocessorauth@@toStringTagInt16ArrayconcatMapefficientpropertiesReflect.getPrototypeOfdatastructurestringfull-widthcommand-lineJSON-SchemalocalsameValueZeroart256checkfunctionalwaapierror-handling0intrinsicchromedotenvelbsubprocesssortedtrimURLtakeObject.assignECMAScript 2018kinesisbusyRxownwaitECMAScript 2017requiremakewidthirqvaluestypereadkoreanlengthasciicompile lessreadablemergebootstrap lesscharacterfullwidthminimalproxyfantasy-landfast-deep-clonebyteOffsetshellextendmoveregular-expressionjQueryspecdom-testing-libraryquerystringrfc9562columnscompilerreversegetPrototypeOfcryptutilsinstallerloggingtranspilerhardlinksdataViewimportexportautoprefixervalueregexptypesafefrominternalECMAScript 2019css-in-jsnativevar
2.3.90

10 months ago

2.3.89

10 months ago

2.3.88

10 months ago

2.3.87

10 months ago

2.3.86

10 months ago

2.3.85

10 months ago

2.3.84

11 months ago

2.3.83

11 months ago

2.3.82

11 months ago

2.3.81

11 months ago

2.3.80

11 months ago

2.3.79

11 months ago

2.2.79

11 months ago

2.2.78

11 months ago

2.2.77

11 months ago

2.2.76

11 months ago

2.2.75

11 months ago

2.1.75

11 months ago

2.1.74

11 months ago

2.1.73

11 months ago

2.1.72

11 months ago

2.1.71

11 months ago

2.1.70

11 months ago

2.1.69

11 months ago

2.1.68

11 months ago

2.1.67

11 months ago

2.1.66

11 months ago

2.1.65

11 months ago

2.1.64

11 months ago

2.1.63

11 months ago

2.1.62

11 months ago

2.1.61

11 months ago

2.1.60

11 months ago

2.1.59

11 months ago

2.1.58

11 months ago

2.1.57

11 months ago

2.1.56

12 months ago

2.1.55

12 months ago

2.1.54

12 months ago

2.1.53

12 months ago

2.0.53

12 months ago

2.0.52

12 months ago

2.0.51

12 months ago

2.0.50

12 months ago

2.0.49

12 months ago

2.0.48

12 months ago

2.0.47

12 months ago

2.0.46

12 months ago

2.0.45

12 months ago

2.0.44

12 months ago

2.0.43

12 months ago

2.0.42

12 months ago

2.0.41

12 months ago

2.0.40

12 months ago

2.0.39

12 months ago

2.0.38

12 months ago

2.0.37

1 year ago

2.0.36

1 year ago

2.0.35

1 year ago

2.0.34

1 year ago

2.0.33

1 year ago

2.0.32

1 year ago

2.0.31

1 year ago

2.0.30

1 year ago

2.0.29

1 year ago

2.0.28

1 year ago

2.0.27

1 year ago

2.0.26

1 year ago

2.0.25

1 year ago

2.0.24

1 year ago

2.0.23

1 year ago

2.0.22

1 year ago

2.0.21

1 year ago

2.0.20

1 year ago

2.0.19

1 year ago

2.0.18

1 year ago

2.0.17

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago