├── .filetree ├── .gitignore ├── .hood └── platform │ ├── linux │ ├── installPreReqs │ ├── startAll │ ├── startAmber │ ├── startMongoDB │ ├── startPharo │ └── startWatcher │ ├── osx │ ├── basicStart.sh │ └── startAll │ └── windows │ ├── startAll │ ├── startAmber │ ├── startMongoDB │ ├── startNginx │ ├── startPharo │ └── startWatcher ├── .travis.yml ├── FAQ.md ├── LICENSE-MIT ├── README.md ├── backend ├── .filetree ├── FlowBuilder.st ├── build ├── conf │ ├── API.conf │ ├── App.conf │ ├── Flow.conf │ ├── Mongo.conf │ ├── Postgres.conf │ ├── Redis.conf │ └── VNC.conf ├── getPharo30 └── src │ ├── .filetree │ ├── App.package │ └── monticello.meta │ │ └── version │ ├── BaselineOfFlow.package │ ├── .filetree │ ├── BaselineOfFlow.class │ │ ├── README.md │ │ ├── instance │ │ │ ├── baseline..st │ │ │ ├── baselineCommon..st │ │ │ ├── baselineGemStone..st │ │ │ └── baselinePharo..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Core-API.package │ ├── .filetree │ ├── FWAPICreate.class │ │ ├── README.md │ │ ├── class │ │ │ └── acceptedMethods.st │ │ ├── instance │ │ │ ├── newConflictResponseFor..st │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIDelete.class │ │ ├── README.md │ │ ├── class │ │ │ ├── acceptedMethods.st │ │ │ └── hasValidDetailsFor..st │ │ ├── instance │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIGetAll.class │ │ ├── README.md │ │ ├── class │ │ │ └── acceptedMethods.st │ │ ├── instance │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIGetById.class │ │ ├── README.md │ │ ├── class │ │ │ └── acceptedMethods.st │ │ ├── instance │ │ │ ├── newNotFoundFor.on..st │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIGetOne.class │ │ ├── README.md │ │ ├── class │ │ │ ├── acceptedMethods.st │ │ │ └── hasValidDetailsFor..st │ │ ├── instance │ │ │ ├── newNotFoundFor..st │ │ │ ├── newNotFoundFor.on..st │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIGetSome.class │ │ ├── README.md │ │ ├── class │ │ │ ├── acceptedMethods.st │ │ │ ├── hasValidDetailsFor..st │ │ │ └── isValidFor..st │ │ ├── instance │ │ │ ├── findMany.st │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIInvalidCommand.class │ │ ├── README.md │ │ ├── class │ │ │ └── isValidFor..st │ │ ├── instance │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIModel.class │ │ ├── README.md │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIObject.class │ │ ├── README.md │ │ ├── class │ │ │ └── isAbstract.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIUpdate.class │ │ ├── README.md │ │ ├── class │ │ │ └── acceptedMethods.st │ │ ├── instance │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAPIv10WebSocketCommand.class │ │ ├── README.md │ │ ├── class │ │ │ └── isAbstract.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWRESTAPIv10Command.class │ │ ├── README.md │ │ ├── class │ │ │ ├── acceptedMethods.st │ │ │ ├── databaseDo..st │ │ │ ├── for..st │ │ │ ├── fromRequest..st │ │ │ ├── hasModelNameFor..st │ │ │ ├── hasValidDetailsFor..st │ │ │ ├── isBasePathValidFor..st │ │ │ ├── isValidFor..st │ │ │ ├── repository..st │ │ │ ├── repository.st │ │ │ ├── repositoryDo..st │ │ │ ├── reset.st │ │ │ └── sanitizePayload..st │ │ ├── instance │ │ │ ├── apiObjectClass.st │ │ │ ├── databaseDo..st │ │ │ ├── request..st │ │ │ ├── request.st │ │ │ └── valueOn..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWRESTAPIv10CommandWithContent.class │ │ ├── README.md │ │ ├── class │ │ │ └── isAbstract.st │ │ ├── instance │ │ │ ├── apiObjectClass.st │ │ │ └── jsonWithIdFor..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Core-App.package │ ├── .filetree │ ├── App.class │ │ ├── README.md │ │ ├── class │ │ │ ├── api.st │ │ │ ├── dropDatabase.st │ │ │ ├── heartbeat.st │ │ │ ├── install.st │ │ │ ├── restart.st │ │ │ ├── shutDown.st │ │ │ ├── start.st │ │ │ ├── startUp.st │ │ │ ├── stop.st │ │ │ ├── uninstall.st │ │ │ └── webSocketApi.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Core-Handlers.package │ ├── .filetree │ ├── FWAPIHandler.class │ │ ├── README.md │ │ ├── class │ │ │ └── basePath.st │ │ ├── instance │ │ │ ├── handle.with..st │ │ │ ├── isAboutModel..st │ │ │ ├── isHandlerFor..st │ │ │ └── isValid..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWAbstractHandler.class │ │ ├── README.md │ │ ├── class │ │ │ ├── basePath.st │ │ │ ├── initializeMimeTypes.st │ │ │ ├── makeMIMETypes.st │ │ │ ├── mimeTypes.st │ │ │ ├── modelClass.st │ │ │ └── reset.st │ │ ├── instance │ │ │ ├── basePath.st │ │ │ ├── baseUri.st │ │ │ ├── fileNotFound..st │ │ │ ├── handle.with..st │ │ │ ├── handlesWebSockets.st │ │ │ ├── hasPackageNameFor..st │ │ │ ├── isCodeFor..st │ │ │ ├── isFileHandlerFor..st │ │ │ ├── isHandlerFor..st │ │ │ ├── mimetypeForFile..st │ │ │ ├── notFound..st │ │ │ ├── onStop.st │ │ │ ├── respond.mimeType..st │ │ │ └── value.value..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWDelegate.class │ │ ├── README.md │ │ ├── instance │ │ │ ├── addHandler..st │ │ │ ├── continuation.st │ │ │ ├── handleRequest..st │ │ │ ├── handlerFor..st │ │ │ ├── handlers.st │ │ │ ├── initializeHandlers.st │ │ │ ├── onClient..st │ │ │ ├── onStop.st │ │ │ ├── restfulRequest..st │ │ │ ├── stop.st │ │ │ └── websocketsHandler.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWFilesHandler.class │ │ ├── README.md │ │ ├── class │ │ │ ├── basePath.st │ │ │ ├── for..st │ │ │ ├── for.base..st │ │ │ └── packageName.st │ │ ├── instance │ │ │ ├── base..st │ │ │ ├── base.st │ │ │ ├── baseUri.st │ │ │ ├── defaultFilename.st │ │ │ ├── documentForFile.type..st │ │ │ ├── fileFrom..st │ │ │ ├── fileNameFrom..st │ │ │ ├── files.st │ │ │ ├── getFiles.st │ │ │ ├── handle.with..st │ │ │ ├── hasPackageNameFor..st │ │ │ ├── initializeBase.st │ │ │ ├── initializeFiles.st │ │ │ ├── initializePath.st │ │ │ ├── isCodeFor..st │ │ │ ├── isFileHandlerFor..st │ │ │ ├── isHandlerFor..st │ │ │ ├── isValid..st │ │ │ ├── onAboutToServe.for.on..st │ │ │ ├── onAboutToServe.on..st │ │ │ ├── path..st │ │ │ ├── path.st │ │ │ ├── redirectFor.with..st │ │ │ ├── reset.st │ │ │ └── writeContentFrom..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWRESTAPIv10Handler.class │ │ ├── README.md │ │ ├── class │ │ │ ├── basePath.st │ │ │ └── validCommands.st │ │ ├── instance │ │ │ ├── handle.with..st │ │ │ ├── isHandlerFor..st │ │ │ └── isValid..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWRootHandler.class │ │ ├── README.md │ │ ├── class │ │ │ └── basePath.st │ │ ├── instance │ │ │ ├── handle.with..st │ │ │ └── isHandlerFor..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FWWebSocketsAPIHandler.class │ │ ├── README.md │ │ ├── instance │ │ │ ├── allBut..st │ │ │ ├── clients.st │ │ │ ├── handlesWebSockets.st │ │ │ ├── initializeClients.st │ │ │ ├── initializeProtection.st │ │ │ ├── isHandlerFor..st │ │ │ ├── onClient..st │ │ │ ├── onStop.st │ │ │ ├── process.on..st │ │ │ ├── protection.st │ │ │ ├── purgeClients.st │ │ │ ├── register..st │ │ │ ├── sendToAll..st │ │ │ ├── sendToAll.but..st │ │ │ └── unregister..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Core-Platform.package │ ├── .filetree │ ├── FlowPlatform.class │ │ ├── README.md │ │ ├── class │ │ │ ├── api.st │ │ │ ├── current.st │ │ │ ├── dropDatabase.st │ │ │ ├── heartbeat.st │ │ │ ├── helper.st │ │ │ ├── initializeCurrentPlatform.st │ │ │ ├── install.st │ │ │ ├── isProduction.st │ │ │ ├── isValidForCurrentPlatform.st │ │ │ ├── pulseRate.st │ │ │ ├── reset.st │ │ │ ├── restart.st │ │ │ ├── setupServer.st │ │ │ ├── shutDown.st │ │ │ ├── start.st │ │ │ ├── startHeartbeat.st │ │ │ ├── startHttpd.st │ │ │ ├── startUp.st │ │ │ ├── startWebsocket.st │ │ │ ├── stop.st │ │ │ ├── stopHeartbeat.st │ │ │ ├── stopHttpd.st │ │ │ ├── uninstall.st │ │ │ └── webSocketAPI.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── String.extension │ │ ├── instance │ │ │ └── toUtf8.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── ZnResponse.extension │ │ ├── class │ │ │ └── conflict..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── ZnStatusLine.extension │ │ ├── class │ │ │ └── conflict.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Examples.package │ ├── .filetree │ ├── AppFakeDataBuilder.class │ │ ├── README.md │ │ ├── class │ │ │ ├── build.st │ │ │ ├── clean.st │ │ │ ├── createRelationships.st │ │ │ ├── putSomeThingsLikeThis.st │ │ │ └── saveThings.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── Stuff.class │ │ ├── README.md │ │ ├── class │ │ │ └── pluralName.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── Thing.class │ │ ├── README.md │ │ ├── instance │ │ │ ├── addThing..st │ │ │ ├── beLikeThis.st │ │ │ ├── beNotLikeThis.st │ │ │ ├── beRelatedTo..st │ │ │ └── removeThing..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-GemStone-Core.package │ ├── .filetree │ ├── FlowGemStoneHelper.class │ │ ├── README.md │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FlowGemStonePlatform.class │ │ ├── README.md │ │ ├── class │ │ │ ├── apiPortList.st │ │ │ ├── dropDatabase.st │ │ │ ├── flowDevelopmentDebugScript.st │ │ │ ├── flowServerName.st │ │ │ ├── helper.st │ │ │ ├── install.st │ │ │ ├── isValidForCurrentPlatform.st │ │ │ ├── makeDispatcher.st │ │ │ ├── setupServer.st │ │ │ ├── start.st │ │ │ ├── startGems..st │ │ │ ├── startHttpd.st │ │ │ ├── stopHttpd.st │ │ │ └── uninstall.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── SpEnvironment.extension │ │ ├── class │ │ │ └── evaluate.in..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── SpFilename.extension │ │ ├── instance │ │ │ └── contentsOfEntireFile.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-GemStone-Tests.package │ ├── .filetree │ ├── FlowGemStoneRESTAPIv10Test.class │ │ ├── README.md │ │ ├── class │ │ │ ├── interactiveRemoteServer..st │ │ │ ├── interactiveRemoteServer.st │ │ │ ├── staticRemoteServer..st │ │ │ └── staticRemoteServer.st │ │ ├── instance │ │ │ ├── apiUrl.st │ │ │ ├── createGemServer.st │ │ │ ├── databaseName.st │ │ │ ├── do..st │ │ │ ├── gemServerName.st │ │ │ ├── gemServerPortList.st │ │ │ ├── inFlowAppTestCreate.st │ │ │ ├── inFlowAppTestDelete.st │ │ │ ├── inFlowAppTestGetAll.st │ │ │ ├── inFlowAppTestGetOne.st │ │ │ ├── inFlowAppTestGetSome.st │ │ │ ├── inFlowAppTestGetUnexisting.st │ │ │ ├── inFlowAppTestQueryOne.st │ │ │ ├── inFlowAppTestStuff.st │ │ │ ├── inFlowAppTestUpdate.st │ │ │ ├── interactiveRemoteServer.st │ │ │ ├── setUp.st │ │ │ ├── startFlowAppDo..st │ │ │ ├── startGems..st │ │ │ ├── staticRemoteServer.st │ │ │ ├── stopGems..st │ │ │ ├── tearDown.st │ │ │ ├── testCreate.st │ │ │ ├── testDelete.st │ │ │ ├── testGetAll.st │ │ │ ├── testGetOne.st │ │ │ ├── testGetSome.st │ │ │ ├── testGetUnexisting.st │ │ │ ├── testStuff.st │ │ │ └── testUpdate.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Pharo-Core.package │ ├── .filetree │ ├── FlowPharoHelper.class │ │ ├── README.md │ │ ├── class │ │ │ └── helper.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── FlowPharoPlatform.class │ │ ├── README.md │ │ ├── class │ │ │ ├── dropDatabase.st │ │ │ ├── install.st │ │ │ ├── isValidForCurrentPlatform.st │ │ │ ├── makeDispatcher.st │ │ │ ├── mta.st │ │ │ ├── setupServer.st │ │ │ ├── startHttpd.st │ │ │ ├── startVNC.st │ │ │ ├── startWebsocket.st │ │ │ ├── stopHttpd.st │ │ │ ├── stopVNC.st │ │ │ ├── uninstall.st │ │ │ └── webSocketAPI.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── VirtualMachine.extension │ │ ├── class │ │ │ └── maxExternalSemaphores..st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Pharo-Tests.package │ ├── .filetree │ ├── FlowPharoTests.class │ │ ├── README.md │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ ├── Flow-Tests.package │ ├── .filetree │ ├── FlowRESTAPIv10Test.class │ │ ├── README.md │ │ ├── instance │ │ │ ├── apiUrl.st │ │ │ ├── databaseName.st │ │ │ ├── do..st │ │ │ ├── setUp.st │ │ │ ├── tearDown.st │ │ │ ├── testCreate.st │ │ │ ├── testDelete.st │ │ │ ├── testGetAll.st │ │ │ ├── testGetOne.st │ │ │ ├── testGetSome.st │ │ │ ├── testGetUnexisting.st │ │ │ ├── testStuff.st │ │ │ └── testUpdate.st │ │ ├── methodProperties.json │ │ └── properties.json │ ├── monticello.meta │ │ ├── categories.st │ │ ├── initializers.st │ │ ├── package │ │ └── version │ └── properties.json │ └── MTAClient.package │ ├── .filetree │ ├── MTAEmail.class │ ├── README.md │ ├── instance │ │ ├── addTo..st │ │ ├── bcc.st │ │ ├── body..st │ │ ├── body.st │ │ ├── cc.st │ │ ├── encodedSubject.st │ │ ├── encodingHeader.st │ │ ├── folded..st │ │ ├── from..st │ │ ├── from.st │ │ ├── headerAt.put..st │ │ ├── headers.st │ │ ├── initialize.st │ │ ├── plainMessage.st │ │ ├── recipients.st │ │ ├── subject..st │ │ ├── subject.st │ │ ├── to..st │ │ └── to.st │ ├── methodProperties.json │ └── properties.json │ ├── MTASMTPClient.class │ ├── README.md │ ├── instance │ │ ├── accounts.st │ │ ├── basicSendOn..st │ │ ├── beBusy.st │ │ ├── beIdle.st │ │ ├── client.st │ │ ├── initializeClient.st │ │ ├── initializeIsBusy.st │ │ ├── initializeQueues.st │ │ ├── isBusy.st │ │ ├── isEmpty.st │ │ ├── isIdle.st │ │ ├── makeClient.st │ │ ├── makeEmailTo.from.subject.body..st │ │ ├── notEmpty.st │ │ ├── notEmptyOn..st │ │ ├── openSMTPOn..st │ │ ├── queues.st │ │ ├── reset.st │ │ ├── send.on..st │ │ ├── sendEmails.st │ │ ├── sendTo.from.subject.body..st │ │ ├── sendTo.from.subject.body.on..st │ │ └── timerTick.st │ ├── methodProperties.json │ └── properties.json │ ├── monticello.meta │ ├── categories.st │ ├── initializers.st │ ├── package │ └── version │ └── properties.json ├── changelog.md ├── cleanBuild ├── cleanBuildBackend ├── cleanBuildFrontend ├── flow.dev.nginx.conf ├── flow.dev.nginx.on.windows.conf ├── frontend ├── .gitignore ├── Gruntfile.js ├── README.md ├── bootstrap.amd.json ├── bower.json ├── build ├── css │ └── style.css ├── custom │ ├── resources │ │ ├── amber.css │ │ ├── off.amber.png │ │ ├── offHover.amber.png │ │ ├── sprite.amber.png │ │ └── tinylogo.amber.png │ └── rivets │ │ ├── .bower.json │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bower.json │ │ ├── component.json │ │ ├── dist │ │ ├── rivets.js │ │ └── rivets.min.js │ │ ├── gulpfile.js │ │ ├── package.json │ │ └── src │ │ ├── adapters.coffee │ │ ├── binders.coffee │ │ ├── bindings.coffee │ │ ├── export.coffee │ │ ├── observer.coffee │ │ ├── parsers.coffee │ │ ├── rivets.coffee │ │ ├── util.coffee │ │ └── view.coffee ├── deploy.js ├── devel.js ├── img │ ├── loaderBar.gif │ ├── spinner.gif │ └── tinylogo.png ├── index.html ├── local.amd.json ├── package.json ├── publishCss ├── publishImg ├── publishIndex ├── publishJs ├── publishViews ├── src │ ├── App-Tests.st │ └── App.st ├── text.amd.json └── views │ ├── ConfirmName.html │ ├── Example.html │ ├── Example1.html │ ├── Example2.html │ ├── Example3.html │ ├── Example4.html │ ├── Example5.html │ ├── Item.html │ ├── Items.html │ ├── Main.html │ ├── ThingDetails.html │ ├── ThingRow.html │ └── ThingViewEditorRow.html ├── makeFrontend ├── mime.types ├── setPermissions ├── startAll └── tests └── travisCI.st /.filetree: -------------------------------------------------------------------------------- 1 | {"packageExtension" : ".package", 2 | "propertyFileExtension" : ".json" } -------------------------------------------------------------------------------- /.hood/platform/linux/startAll: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts the services needed to have a developing session with a flow-based app 4 | 5 | # Start the database server... 6 | gnome-terminal -x sh -c ".hood/platform/linux/startMongoDB" & 7 | 8 | # Start Amber server to handle frontend dev and its commits... 9 | gnome-terminal -x sh -c ".hood/platform/linux/startAmber;" & 10 | 11 | # Start our Pharo backend... 12 | gnome-terminal -x sh -c ".hood/platform/linux/startPharo;" & 13 | 14 | # Start grunt to detect frontend sources changing and trigger rebuilds... 15 | gnome-terminal -x sh -c ".hood/platform/linux/startWatcher;" & 16 | -------------------------------------------------------------------------------- /.hood/platform/linux/startAmber: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts Amber so we can have a frontend dev session 4 | 5 | echo "Starting Amber server..." 6 | 7 | cd frontend 8 | exec amber serve --port 3000 9 | -------------------------------------------------------------------------------- /.hood/platform/linux/startMongoDB: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts the MongoDB server so we can persist things 3 | 4 | echo "Checking if MongoDB is already running..."; 5 | mongo --eval "db.stats()" > /dev/null 2>&1 6 | # returns 0 if mongo eval succeeds 7 | 8 | RESULT=$? 9 | 10 | if [ $RESULT -ne 0 ]; then 11 | echo "MongoDB is not running, starting it as a service..."; 12 | sudo service mongodb start; 13 | else 14 | echo "MongoDB is already running, no restart required!"; 15 | fi 16 | 17 | echo " "; 18 | read -p "You can close this terminal now." 19 | 20 | -------------------------------------------------------------------------------- /.hood/platform/linux/startPharo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts the Pharo worker image which is the backend of this app 4 | 5 | # Start the image with UI ready to a dev session... 6 | echo "Starting Pharo backend..." 7 | cd backend 8 | # execute 9 | exec ./pharo-ui "Pharo.image" 10 | 11 | -------------------------------------------------------------------------------- /.hood/platform/linux/startWatcher: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts the grunt watch task 4 | 5 | echo "Starting Grunt watch task..." 6 | cd frontend 7 | exec grunt watch; bash 8 | -------------------------------------------------------------------------------- /.hood/platform/osx/basicStart.sh: -------------------------------------------------------------------------------- 1 | osascript 2>/dev/null < 4 | self 5 | baselineCommon: spec; 6 | baselinePharo: spec; 7 | baselineGemStone: spec -------------------------------------------------------------------------------- /backend/src/BaselineOfFlow.package/BaselineOfFlow.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "baseline:" : "jupiter 2/28/2015 09:13", 6 | "baselineCommon:" : "jupiter 03/01/2015 14:47", 7 | "baselineGemStone:" : "jupiter 03/01/2015 14:47", 8 | "baselinePharo:" : "jupiter 3/1/2015 07:19" } } 9 | -------------------------------------------------------------------------------- /backend/src/BaselineOfFlow.package/BaselineOfFlow.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "BaselineOfFlow", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "BaselineOfFlow", 11 | "pools" : [ 12 | ], 13 | "super" : "BaselineOf", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/BaselineOfFlow.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #BaselineOfFlow! 2 | -------------------------------------------------------------------------------- /backend/src/BaselineOfFlow.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/BaselineOfFlow.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/BaselineOfFlow.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'BaselineOfFlow') -------------------------------------------------------------------------------- /backend/src/BaselineOfFlow.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPICreate.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPICreate.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPICreate.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | POST 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPICreate.class/instance/newConflictResponseFor..st: -------------------------------------------------------------------------------- 1 | actions 2 | newConflictResponseFor: objectSent 3 | "Answers a response saying that objectSent could not be created" 4 | 5 | | json | 6 | 7 | json := JsonObject new 8 | message: 'cid already in use'; 9 | cid: objectSent cid; 10 | modelClass: objectSent class name; 11 | yourself. 12 | 13 | ^ ZnResponse conflict: (ZnStringEntity text: json asJSONString) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPICreate.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request ." 4 | 5 | ^ self databaseDo: [ | objectSent foundOrNil | 6 | objectSent := self apiObjectClass fromJSONString: self request contents. 7 | (objectSent hasId and: [ 8 | foundOrNil := objectSent class findId: objectSent id. 9 | foundOrNil notNil ]) 10 | ifFalse:[ 11 | objectSent insert. 12 | (ZnResponse created: aHandler basePath, objectSent id) 13 | entity: (ZnStringEntity text: (self jsonWithIdFor: objectSent) asJSONString); 14 | yourself ] 15 | ifTrue:[ self newConflictResponseFor: objectSent ] ] 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPICreate.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 7/7/2014 14:34" }, 4 | "instance" : { 5 | "newConflictResponseFor:" : "sebastiansastre 12/20/2014 15:06", 6 | "valueOn:" : "sebastiansastre 12/21/2014 00:00" } } 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPICreate.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPICreate", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10CommandWithContent", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIDelete.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIDelete.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIDelete.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | DELETE 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIDelete.class/class/hasValidDetailsFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasValidDetailsFor: aRequest 3 | "Answers true if the lasts segments of the URI of aRequest 4 | are looking good" 5 | 6 | ^ aRequest uri segments size = 4 or:[ 7 | 8 | (aRequest uri segments size = 5 and:[ 9 | aRequest uri segments last = #/ ] ) ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIDelete.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request ." 4 | 5 | ^ self databaseDo: [ | foundOrNil | 6 | foundOrNil := self apiObjectClass findId: self request uri segments fourth. 7 | foundOrNil 8 | ifNil:[ ZnResponse ok: (ZnStringEntity text: false asJSONString) ] 9 | ifNotNil:[ 10 | foundOrNil destroy. 11 | ZnResponse ok: (ZnStringEntity text: true asJSONString) ] ] 12 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIDelete.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 7/7/2014 14:34", 4 | "hasValidDetailsFor:" : "sebastiansastre 7/7/2014 14:37" }, 5 | "instance" : { 6 | "valueOn:" : "sebastiansastre 7/11/2014 00:34" } } 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIDelete.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIDelete", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetAll.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIGetAll.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetAll.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | GET 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetAll.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request . 4 | Returns all the mapless found. 5 | This one is meant for development. 6 | Cool kids use GetSome doing the relevant queries" 7 | 8 | ^ self databaseDo: [ | foundOrEmpty | 9 | self flag: #todo. "count the collection before querying all, if bigger than 200 elments then respod partial" 10 | foundOrEmpty := self apiObjectClass findAll. 11 | 12 | (ConfigurationFiles at: #API at: #isUnreferencing) ifTrue: [ 13 | foundOrEmpty do: [ :each | each unreferenced ] ]. 14 | 15 | ZnResponse ok: (ZnStringEntity text: foundOrEmpty asJSONString) ] 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetAll.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 7/7/2014 18:52" }, 4 | "instance" : { 5 | "valueOn:" : "sebastiansastre 2/23/2015 15:34" } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetAll.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIGetAll", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetById.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIGetById.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetById.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | GET 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetById.class/instance/newNotFoundFor.on..st: -------------------------------------------------------------------------------- 1 | actions 2 | newNotFoundFor: anId on: aHandler 3 | 4 | ^ ZnResponse notFound: aHandler basePath, anId -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetById.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request ." 4 | 5 | ^ self databaseDo: [ | foundOrNil | 6 | foundOrNil := self apiObjectClass findId: self request uri segments fourth. 7 | 8 | foundOrNil 9 | ifNil:[ self newNotFoundFor: self request uri segments fourth on: aHandler ] 10 | ifNotNil:[ ZnResponse ok: (ZnStringEntity text: foundOrNil asJSONString) ] ] 11 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetById.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 10/28/2014 17:01" }, 4 | "instance" : { 5 | "newNotFoundFor:on:" : "sebastiansastre 10/28/2014 17:01", 6 | "valueOn:" : "sebastiansastre 1/27/2015 14:56" } } 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetById.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIGetById", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIGetOne.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | POST 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/class/hasValidDetailsFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasValidDetailsFor: aRequest 3 | "Answers true if the lasts segments of the URI of aRequest 4 | are looking good" 5 | 6 | ^ aRequest uri segments size >= 4 and:[ 7 | aRequest uri segments fourth = 'queryOne'] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/instance/newNotFoundFor..st: -------------------------------------------------------------------------------- 1 | actions 2 | newNotFoundFor: someConditions 3 | 4 | ^ ZnResponse notFound: someConditions asString -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/instance/newNotFoundFor.on..st: -------------------------------------------------------------------------------- 1 | actions 2 | newNotFoundFor: anId on: aHandler 3 | 4 | ^ ZnResponse notFound: aHandler basePath, anId -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request ." 4 | 5 | | conditions foundOrNil | 6 | 7 | ^ self databaseDo: [ 8 | self request contents ifNil: [ ^ self newNotFoundFor: nil ]. 9 | conditions := Json readFrom: (self class sanitizePayload: self request contents) readStream. 10 | foundOrNil := self apiObjectClass findOne: conditions. 11 | 12 | foundOrNil 13 | ifNil: [ self newNotFoundFor: self request contents ] 14 | ifNotNil: [ 15 | (ConfigurationFiles at: #API at: #isUnreferencing) ifTrue: [ 16 | foundOrNil unreferenced ]. 17 | ZnResponse ok: (ZnStringEntity text: foundOrNil asJSONString) ] ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 10/28/2014 20:17", 4 | "hasValidDetailsFor:" : "sebastiansastre 10/28/2014 20:42" }, 5 | "instance" : { 6 | "newNotFoundFor:" : "sebastiansastre 10/28/2014 17:10", 7 | "newNotFoundFor:on:" : "sebastiansastre 7/11/2014 23:30", 8 | "valueOn:" : "sebastiansastre 2/23/2015 15:17" } } 9 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetOne.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIGetOne", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIGetSome.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | POST 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/class/hasValidDetailsFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasValidDetailsFor: aRequest 3 | "Answers true if the lasts segments of the URI of aRequest 4 | are looking good" 5 | 6 | ^ aRequest uri segments size = 4 or:[ 7 | 8 | (aRequest uri segments size = 5 and:[ 9 | aRequest uri segments last = #/ ] ) ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/class/isValidFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isValidFor: aRequest 3 | "Answers true if aRequest should be processed by an instance of this class of command." 4 | 5 | ^ (super isValidFor: aRequest) and:[ 6 | aRequest uri segments size >= 4 and:[ 7 | aRequest uri segments fourth = 'query'] ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/instance/findMany.st: -------------------------------------------------------------------------------- 1 | actions 2 | findMany 3 | "Query the database with the information given in the request 4 | and return the objects found" 5 | 6 | | conditions | 7 | 8 | self request contents ifNil:[ ^ Array new ]. 9 | 10 | conditions := Json readFrom: (self class sanitizePayload: self request contents) readStream. 11 | ^ self apiObjectClass find: conditions 12 | 13 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request ." 4 | 5 | ^ self databaseDo: [ | answer | 6 | answer := self findMany. 7 | 8 | (ConfigurationFiles at: #API at: #isUnreferencing) ifTrue: [ 9 | answer do: [ :each | each unreferenced ] ]. 10 | 11 | ZnResponse ok: (ZnStringEntity text: answer asJSONString) ] 12 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 7/7/2014 20:35", 4 | "hasValidDetailsFor:" : "sebastiansastre 7/7/2014 22:04", 5 | "isValidFor:" : "sebastiansastre 7/7/2014 22:15" }, 6 | "instance" : { 7 | "findMany" : "sebastiansastre 7/12/2014 00:40", 8 | "valueOn:" : "sebastiansastre 2/23/2015 15:18" } } 9 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIGetSome.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIGetSome", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIInvalidCommand.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIInvalidCommand.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIInvalidCommand.class/class/isValidFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isValidFor: aRequest 3 | "Answers true if aRequest should be processed by an instance of this class of command." 4 | 5 | ^ false 6 | 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIInvalidCommand.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request." 4 | 5 | ^ ZnResponse badRequest: self request -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIInvalidCommand.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "isValidFor:" : "sebastiansastre 7/7/2014 15:37" }, 4 | "instance" : { 5 | "valueOn:" : "sebastiansastre 7/2/2014 18:23" } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIInvalidCommand.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIInvalidCommand", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIModel.class/README.md: -------------------------------------------------------------------------------- 1 | Deprecated, It is going to be removed in the next version. -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIModel.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIModel.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "FV 1/30/2015 14:08", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIModel", 11 | "pools" : [ 12 | ], 13 | "super" : "Mapless", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIObject.class/README.md: -------------------------------------------------------------------------------- 1 | A CQAPIObject is an abstraction. 2 | 3 | The concrete subclasses are objects that easily come and go over the wire from frontend to backend and vice versa. -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIObject.class/class/isAbstract.st: -------------------------------------------------------------------------------- 1 | as yet unclassified 2 | isAbstract 3 | "Answers true if the model class is abstract. 4 | Very useful to subclassify a family of model classes 5 | of which wouldn't make sense to create instances. 6 | 7 | You can (sub) implement where nessesary in an abstract model like this: 8 | 9 | ^ self == AnAbstractModelClass" 10 | 11 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIObject.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "isAbstract" : "FV 1/30/2015 11:32" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIObject.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/1/2014 22:33", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIObject", 11 | "pools" : [ 12 | ], 13 | "super" : "Object", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIUpdate.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIUpdate.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIUpdate.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | PUT 8 | PATCH 9 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIUpdate.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and the request . 4 | This update is actually working as an upsert." 5 | 6 | ^ self databaseDo: [ | objectSent | 7 | objectSent := self apiObjectClass fromJSONString: self request contents. 8 | self flag: #todo. "compare versions and do conflict resolution if they don't match. 9 | That might happen when a user writes in a model and another user tries too but in a, now old, version. 10 | http://martinfowler.com/eaaCatalog/optimisticOfflineLock.html" 11 | objectSent save. 12 | ZnResponse ok: (ZnStringEntity text: (self jsonWithIdFor: objectSent) asJSONString) ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIUpdate.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 7/12/2014 01:30" }, 4 | "instance" : { 5 | "valueOn:" : "jupiter 3/1/2015 05:02" } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIUpdate.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIUpdate", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10CommandWithContent", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIv10WebSocketCommand.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWAPIv10WebSocketCommand.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIv10WebSocketCommand.class/class/isAbstract.st: -------------------------------------------------------------------------------- 1 | testing 2 | isAbstract 3 | 4 | ^ self = FWAPIv10WebSocketCommand -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIv10WebSocketCommand.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "isAbstract" : "sebastiansastre 7/7/2014 15:34" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWAPIv10WebSocketCommand.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAPIv10WebSocketCommand", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/README.md: -------------------------------------------------------------------------------- 1 | A CQAPICommand class is an abstract class that has in its children the API commands. 2 | 3 | Subclasses perform the concrete command behavior -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/acceptedMethods.st: -------------------------------------------------------------------------------- 1 | accessing 2 | acceptedMethods 3 | "Answers which http methods should be accepted by this command." 4 | 5 | 6 | ^ #( 7 | "we accept nothing by default" 8 | ) -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/databaseDo..st: -------------------------------------------------------------------------------- 1 | actions 2 | databaseDo: aBlock 3 | "Evaluates aBlock in the context of a database" 4 | 5 | ^self repositoryDo: aBlock 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/for..st: -------------------------------------------------------------------------------- 1 | actions 2 | for: aRequest 3 | 4 | ^ self new 5 | request: aRequest; 6 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/fromRequest..st: -------------------------------------------------------------------------------- 1 | actions 2 | fromRequest: aRequest 3 | "Answers an instance of the command valid for aRequest (or invalid command if nothing fits)" 4 | 5 | ^ ( (self allSubclasses reject:[:e| e isAbstract]) 6 | detect: [ :commandClass | commandClass isValidFor: aRequest ] 7 | ifNone: [ FWAPIInvalidCommand ] ) 8 | for: aRequest -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/hasModelNameFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasModelNameFor: aSingularOrPluralModelName 3 | "Answers true if thre is a model that has aSingularOrPluralModelName" 4 | 5 | ^ Mapless allSubclasses anySatisfy: [ :e | 6 | e pluralName = aSingularOrPluralModelName or:[ 7 | e singularName = aSingularOrPluralModelName ] ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/hasValidDetailsFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasValidDetailsFor: aRequest 3 | "Answers true if the lasts segments of the URI of aRequest 4 | are looking good" 5 | 6 | ^ aRequest uri segments size = 3 or:[ 7 | 8 | (aRequest uri segments size = 4 and:[ 9 | aRequest uri segments last = #/ ] ) ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/isBasePathValidFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isBasePathValidFor: aRequest 3 | "Answers true if aRequest has a path that matches the base path of this version of the API" 4 | 5 | | apiSegments requestSegments | 6 | 7 | apiSegments := FWRESTAPIv10Handler basePath subStrings: '/'. 8 | requestSegments := aRequest uri segments. 9 | 10 | ^ requestSegments size >= 2 and:[ 11 | requestSegments first = apiSegments first and:[ 12 | requestSegments second = apiSegments second ] ] 13 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/isValidFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isValidFor: aRequest 3 | "Answers true if aRequest should be processed by an instance of this class of command." 4 | 5 | "Came in the right path?" 6 | ^ (self isBasePathValidFor: aRequest) and:[ 7 | 8 | "ok, what about the method?" 9 | (self acceptedMethods anySatisfy:[ :each| 10 | each = aRequest method ]) and:[ 11 | 12 | "and do we even have a model to take care of this?" 13 | (self hasModelNameFor: aRequest uri segments third) and:[ 14 | 15 | "ok, and it ends in a sane way?" 16 | self hasValidDetailsFor: aRequest ] ] ] 17 | 18 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/repository..st: -------------------------------------------------------------------------------- 1 | accessing 2 | repository: aMaplessRepository 3 | 4 | Repository := aMaplessRepository -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/repository.st: -------------------------------------------------------------------------------- 1 | accessing 2 | repository 3 | ^ Repository 4 | ifNil: [ Repository := (ConfigurationFiles at: #App at: #repository) onDatabaseName: (ConfigurationFiles at: #App at: #database) ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/repositoryDo..st: -------------------------------------------------------------------------------- 1 | actions 2 | repositoryDo: aBlock 3 | "Evaluates aBlock in the context of a repository." 4 | 5 | ^self repository do: aBlock 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/reset.st: -------------------------------------------------------------------------------- 1 | actions 2 | reset 3 | 4 | Repository := nil -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/class/sanitizePayload..st: -------------------------------------------------------------------------------- 1 | actions 2 | sanitizePayload: aQueryJSONString 3 | "Answers a copy of aString without content that can be potentially dangerous" 4 | 5 | "from: 6 | http://docs.mongodb.org/manual/faq/developers/#how-does-mongodb-address-sql-or-query-injection 7 | " 8 | 9 | ^ aQueryJSONString copyWithoutAll: '$' -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/instance/apiObjectClass.st: -------------------------------------------------------------------------------- 1 | accessing 2 | apiObjectClass 3 | "Answers the concrete class of the object that we assume we can find in the request" 4 | 5 | ^ Mapless allSubclasses 6 | detect: [ :e | 7 | e singularName = self request uri segments third or:[ 8 | e pluralName = self request uri segments third ] ] 9 | ifNone: [ nil ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/instance/databaseDo..st: -------------------------------------------------------------------------------- 1 | actions 2 | databaseDo: aBlock 3 | "Evaluates aBlock in the context of a database" 4 | 5 | ^ self class databaseDo: aBlock -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/instance/request..st: -------------------------------------------------------------------------------- 1 | accessing 2 | request: aRequest 3 | 4 | request := aRequest -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/instance/request.st: -------------------------------------------------------------------------------- 1 | accessing 2 | request 3 | 4 | ^request -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/instance/valueOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | valueOn: aHandler 3 | "Executes this command for aHandler and aRequest ." 4 | 5 | self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "acceptedMethods" : "sebastiansastre 7/7/2014 14:34", 4 | "databaseDo:" : "FV 1/30/2015 14:24", 5 | "for:" : "sebastiansastre 7/2/2014 18:16", 6 | "fromRequest:" : "sebastiansastre 7/7/2014 15:34", 7 | "hasModelNameFor:" : "FV 1/30/2015 11:35", 8 | "hasValidDetailsFor:" : "sebastiansastre 7/7/2014 14:36", 9 | "isBasePathValidFor:" : "sebastiansastre 7/7/2014 11:09", 10 | "isValidFor:" : "sebastiansastre 7/7/2014 14:32", 11 | "repository" : "sebastiansastre 3/2/2015 23:06", 12 | "repository:" : "FV 1/30/2015 13:15", 13 | "repositoryDo:" : "FV 1/30/2015 14:23", 14 | "reset" : "FV 1/30/2015 11:19", 15 | "sanitizePayload:" : "sebastiansastre 7/12/2014 00:39" }, 16 | "instance" : { 17 | "apiObjectClass" : "FV 1/30/2015 10:58", 18 | "databaseDo:" : "sebastiansastre 7/2/2014 19:52", 19 | "request" : "FV 1/30/2015 12:10", 20 | "request:" : "FV 1/30/2015 12:10", 21 | "valueOn:" : "sebastiansastre 7/2/2014 18:22" } } 22 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10Command.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | "Repository" ], 7 | "commentStamp" : "sebastiansastre 7/1/2014 22:32", 8 | "instvars" : [ 9 | "request" ], 10 | "name" : "FWRESTAPIv10Command", 11 | "pools" : [ 12 | ], 13 | "super" : "FWAPIObject", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/class/isAbstract.st: -------------------------------------------------------------------------------- 1 | testing 2 | isAbstract 3 | 4 | ^ self = FWRESTAPIv10CommandWithContent -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/instance/apiObjectClass.st: -------------------------------------------------------------------------------- 1 | accessing 2 | apiObjectClass 3 | "Answers the concrete class of the object that we assume we can find in the request" 4 | 5 | ^ Smalltalk 6 | at: ((Json readFrom: self request contents readStream) 7 | at: 'modelClass' 8 | ifAbsent:[ 'UndefinedObject' ]) asSymbol 9 | ifAbsent: [ nil ] 10 | 11 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/instance/jsonWithIdFor..st: -------------------------------------------------------------------------------- 1 | accessing 2 | jsonWithIdFor: aMapless 3 | 4 | ^ JsonObject new 5 | at: 'id' put: aMapless id; 6 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "isAbstract" : "sebastiansastre 7/7/2014 15:34" }, 4 | "instance" : { 5 | "apiObjectClass" : "sebastiansastre 7/11/2014 00:31", 6 | "jsonWithIdFor:" : "sebastiansastre 2/18/2015 21:23" } } 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/FWRESTAPIv10CommandWithContent.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-API", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | "DatabaseName" ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWRESTAPIv10CommandWithContent", 11 | "pools" : [ 12 | ], 13 | "super" : "FWRESTAPIv10Command", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Core-API'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-API.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Core-API') -------------------------------------------------------------------------------- /backend/src/Flow-Core-API.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/README.md: -------------------------------------------------------------------------------- 1 | An App is a convenience class we use to have a good api in workspaces to perform some basic actions for the app. 2 | 3 | Typically: 4 | 5 | "Start all services" 6 | App start. 7 | 8 | "Reset configurations (will reload lazily)" 9 | App reset. 10 | 11 | "Stop all services" 12 | App stop. 13 | 14 | "Clean up the dev db" 15 | App dropDatabase. 16 | 17 | "Access RESTapi handler" 18 | App api 19 | 20 | "Access the WebSocket handler" 21 | App webSocketAPI 22 | 23 | 24 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/api.st: -------------------------------------------------------------------------------- 1 | accessing 2 | api 3 | ^ FlowPlatform current api -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/dropDatabase.st: -------------------------------------------------------------------------------- 1 | actions 2 | dropDatabase 3 | 4 | FlowPlatform current dropDatabase -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/heartbeat.st: -------------------------------------------------------------------------------- 1 | actions 2 | heartbeat 3 | "Schedule any occassional tasks. This will be called by FlowPlatform at the pulseRate interval" -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/install.st: -------------------------------------------------------------------------------- 1 | actions 2 | install 3 | 4 | FlowPlatform current install -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/restart.st: -------------------------------------------------------------------------------- 1 | actions 2 | restart 3 | 4 | FlowPlatform current restart -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/shutDown.st: -------------------------------------------------------------------------------- 1 | actions 2 | shutDown 3 | "Hook into VM shutdown on some platforms" 4 | FlowPlatform current shutDown -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/start.st: -------------------------------------------------------------------------------- 1 | actions 2 | start 3 | 4 | FlowPlatform current start -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/startUp.st: -------------------------------------------------------------------------------- 1 | actions 2 | startUp 3 | "Hook into VM startup on some platforms" 4 | FlowPlatform current startUp -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/stop.st: -------------------------------------------------------------------------------- 1 | actions 2 | stop 3 | 4 | FlowPlatform current stop -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/uninstall.st: -------------------------------------------------------------------------------- 1 | actions 2 | uninstall 3 | 4 | FlowPlatform current uninstall -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/class/webSocketApi.st: -------------------------------------------------------------------------------- 1 | accessing 2 | webSocketApi 3 | ^ FlowPlatform current webSocketAPI -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "api" : "jupiter 2/27/2015 21:58", 4 | "dropDatabase" : "jupiter 2/27/2015 21:12", 5 | "heartbeat" : "jupiter 2/27/2015 21:52", 6 | "install" : "jupiter 2/27/2015 21:14", 7 | "restart" : "jupiter 2/27/2015 21:29", 8 | "shutDown" : "jupiter 2/27/2015 22:01", 9 | "start" : "jupiter 2/27/2015 21:40", 10 | "startUp" : "jupiter 2/27/2015 22:00", 11 | "stop" : "jupiter 2/27/2015 21:56", 12 | "uninstall" : "jupiter 2/27/2015 21:54", 13 | "webSocketApi" : "jupiter 2/27/2015 21:59" }, 14 | "instance" : { 15 | } } 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/App.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-App", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/7/2014 09:54", 8 | "instvars" : [ 9 | ], 10 | "name" : "App", 11 | "pools" : [ 12 | ], 13 | "super" : "Object", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Core-App'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-App.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Core-App') -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-Core-App-sebastiansastre.4' message 'empty log message' id 'f62f0272-7167-4100-b1b8-4cd6b75ac3a2' date '9 March 2015' time '5:19:27.628933 pm' author 'sebastiansastre' ancestors ((name 'Flow-Core-App-sebastiansastre.3' message 'empty log message' id '388f61e9-8932-4cb5-9819-8366b00a75de' date '9 March 2015' time '4:00:29.263237 pm' author 'sebastiansastre' ancestors ((name 'Flow-Core-App-sebastiansastre.2' message 'empty log message' id '235920f3-0a53-42da-93c5-465901c9a1b6' date '9 March 2015' time '4:00:14.088948 pm' author 'sebastiansastre' ancestors ((name 'Flow-Core-App-jupiter.1' message '0.2.11 refactor' id '67b19544-941c-41ff-8e20-34df0b797f4a' date '27 February 2015' time '10:14:33.878639 pm' author 'jupiter' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-Core-App.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/README.md: -------------------------------------------------------------------------------- 1 | This handler is a hub that routes requests to the concrete handlers of the (relevant) application -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/class/basePath.st: -------------------------------------------------------------------------------- 1 | accessing 2 | basePath 3 | 4 | ^ '/api' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/instance/handle.with..st: -------------------------------------------------------------------------------- 1 | actions 2 | handle: aRequest with: aResponse 3 | 4 | self subclassResponsibility 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/instance/isAboutModel..st: -------------------------------------------------------------------------------- 1 | testing 2 | isAboutModel: aRequest 3 | "Answers true if aRequest it's about any of the models." 4 | 5 | ^ (self modelClassFrom: aRequest) notNil -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/instance/isHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isHandlerFor: aRequest 3 | "Answers true if this handler should take care of aRequest. 4 | Note: subclasses should specialize" 5 | 6 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/instance/isValid..st: -------------------------------------------------------------------------------- 1 | testing 2 | isValid: aRequest 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "basePath" : "sebastiansastre 4/9/2012 11:30" }, 4 | "instance" : { 5 | "handle:with:" : "sebastiansastre 7/11/2014 16:49", 6 | "isAboutModel:" : "sebastiansastre 1/8/2013 13:39", 7 | "isHandlerFor:" : "sebastiansastre 7/11/2014 16:50", 8 | "isValid:" : "sebastiansastre 7/11/2014 16:49" } } 9 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAPIHandler.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 4/11/2012 11:34", 8 | "instvars" : [ 9 | "handlers", 10 | "applications" ], 11 | "name" : "FWAPIHandler", 12 | "pools" : [ 13 | ], 14 | "super" : "FWAbstractHandler", 15 | "type" : "normal" } 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/README.md: -------------------------------------------------------------------------------- 1 | AmberMPRestfulHandler lays the foundation to maintain ProxyModel and PersistentModel objects between client and server -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/class/basePath.st: -------------------------------------------------------------------------------- 1 | accessing 2 | basePath 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/class/initializeMimeTypes.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeMimeTypes 3 | 4 | ^ MIMETypes := self makeMIMETypes -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/class/makeMIMETypes.st: -------------------------------------------------------------------------------- 1 | actions 2 | makeMIMETypes 3 | 4 | ^ Dictionary new 5 | at: 'txt' put: ZnMimeType textPlain; 6 | at: 'text' put: ZnMimeType textPlain; 7 | at: 'js' put: ZnMimeType textJavascript; 8 | at: 'html' put: ZnMimeType textHtml; 9 | at: 'css' put: ZnMimeType textCss; 10 | at: 'png' put: ZnMimeType imagePng; 11 | at: 'gif' put: ZnMimeType imageGif; 12 | at: 'jpg' put: ZnMimeType imageJpeg; 13 | at: 'jpeg' put: ZnMimeType imageJpeg; 14 | yourself 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/class/mimeTypes.st: -------------------------------------------------------------------------------- 1 | accessing 2 | mimeTypes 3 | 4 | ^ MIMETypes ifNil:[self initializeMimeTypes] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/class/modelClass.st: -------------------------------------------------------------------------------- 1 | accessing 2 | modelClass 3 | "Answers the class of the models manipulated by this handler. 4 | Suggested practice is: one handler per class model." 5 | 6 | self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/class/reset.st: -------------------------------------------------------------------------------- 1 | actions 2 | reset 3 | 4 | MIMETypes := nil -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/basePath.st: -------------------------------------------------------------------------------- 1 | accessing 2 | basePath 3 | 4 | ^ self class basePath -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/baseUri.st: -------------------------------------------------------------------------------- 1 | accessing 2 | baseUri 3 | 4 | ^ self class basePath asZnUrl -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/fileNotFound..st: -------------------------------------------------------------------------------- 1 | actions 2 | fileNotFound: aRequest 3 | 4 | ZnResponse notFound: aRequest uri 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/handle.with..st: -------------------------------------------------------------------------------- 1 | actions 2 | handle: aRequest with: aResponse 3 | 4 | ^ ZnResponse ok: (ZnEntity html: '

flow API

') -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/handlesWebSockets.st: -------------------------------------------------------------------------------- 1 | testing 2 | handlesWebSockets 3 | 4 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/hasPackageNameFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasPackageNameFor: aRequest 3 | 4 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/isCodeFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isCodeFor: aRequest 3 | 4 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/isFileHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isFileHandlerFor: aRequest 3 | "Answers true if the filename in aRequest is present among the files 4 | handled by this handler. 5 | Applicability: useful for writting a file you also serve with this handler. 6 | Flow uses this every time you commit code from the Amber's Browser." 7 | 8 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/isHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isHandlerFor: aRequest 3 | "Answers true if this handler should take care of aRequest. 4 | Note: subclasses should specialize" 5 | 6 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/mimetypeForFile..st: -------------------------------------------------------------------------------- 1 | accessing 2 | mimetypeForFile: aFilename 3 | 4 | ^ self class mimeTypes at: (aFilename basename copyAfterLast: $.) -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/notFound..st: -------------------------------------------------------------------------------- 1 | actions 2 | notFound: aRequest 3 | 4 | ^ ZnResponse notFound: aRequest uri 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/onStop.st: -------------------------------------------------------------------------------- 1 | actions 2 | onStop -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/respond.mimeType..st: -------------------------------------------------------------------------------- 1 | actions 2 | respond: anEntity mimeType: aMIMEType 3 | 4 | ^ ZnResponse ok: anEntity -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/instance/value.value..st: -------------------------------------------------------------------------------- 1 | actions 2 | value: aRequest value: aResponse 3 | "Handle aRequest with aResponse" 4 | 5 | ^ self handle: aRequest with: aResponse 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWAbstractHandler.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | "MIMETypes" ], 7 | "commentStamp" : "sebastiansastre 3/9/2012 07:22", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWAbstractHandler", 11 | "pools" : [ 12 | ], 13 | "super" : "Object", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/README.md: -------------------------------------------------------------------------------- 1 | A FWDelegate is a custom Zinc dispatched used by flow to route requests to its handlers 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/addHandler..st: -------------------------------------------------------------------------------- 1 | actions 2 | addHandler: aHandler 3 | 4 | ^ self handlers add: aHandler -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/continuation.st: -------------------------------------------------------------------------------- 1 | actions 2 | continuation 3 | "Return a block that defines what happens after a 4 | successful connection upgrade from a normal http request to a WebSocket. 5 | We will receive a ready-to-use instanciated WebSocket in the parameter of this block." 6 | 7 | ^ [ :webSocket | 8 | self onClient: webSocket ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/handleRequest..st: -------------------------------------------------------------------------------- 1 | actions 2 | handleRequest: request 3 | "Server delegate entry point" 4 | 5 | (prefix isNil or: [ prefix = request uri pathSegments ]) 6 | ifFalse: [ ^ ZnResponse notFound: request uri ]. 7 | ^ (self isValidWebSocketRequest: request) 8 | ifTrue: [ self webSocketResponseForRequest: request ] 9 | ifFalse: [ self restfulRequest: request ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/handlerFor..st: -------------------------------------------------------------------------------- 1 | accessing 2 | handlerFor: aRequest 3 | "Answer a handler for aRequest (or nil if can't find one)" 4 | 5 | ^ self handlers 6 | detect:[:each| each isHandlerFor: aRequest] 7 | ifNone:[nil] 8 | 9 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/handlers.st: -------------------------------------------------------------------------------- 1 | accessing 2 | handlers 3 | 4 | ^ handlers ifNil:[self initializeHandlers] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/initializeHandlers.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeHandlers 3 | 4 | ^ handlers := OrderedCollection new -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/onClient..st: -------------------------------------------------------------------------------- 1 | actions 2 | onClient: aWebSocket 3 | 4 | self websocketsHandler onClient: aWebSocket -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/onStop.st: -------------------------------------------------------------------------------- 1 | actions 2 | onStop 3 | 4 | self handlers do:[:e| e onStop ] 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/restfulRequest..st: -------------------------------------------------------------------------------- 1 | actions 2 | restfulRequest: aRequest 3 | 4 | | theHandler | 5 | 6 | theHandler := self handlerFor: aRequest. 7 | 8 | theHandler ifNil:[^ZnResponse notFound: aRequest uri]. 9 | 10 | ^ theHandler 11 | value: aRequest 12 | value: (ZnResponse new 13 | statusLine: (ZnStatusLine ok); 14 | headers: ZnHeaders defaultResponseHeaders; 15 | yourself) 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/stop.st: -------------------------------------------------------------------------------- 1 | actions 2 | stop 3 | 4 | self onStop -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/instance/websocketsHandler.st: -------------------------------------------------------------------------------- 1 | actions 2 | websocketsHandler 3 | 4 | ^ self handlers 5 | detect: [ :e| e handlesWebSockets ] 6 | ifNone: [ self error: 'There is no websocket handler in this server?' ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "addHandler:" : "sebastiansastre 10/20/2013 11:57", 6 | "continuation" : "sebastiansastre 9/21/2014 23:04", 7 | "handleRequest:" : "sebastiansastre 7/2/2014 20:28", 8 | "handlerFor:" : "sebastiansastre 7/2/2014 20:28", 9 | "handlers" : "sebastiansastre 10/20/2013 11:58", 10 | "initializeHandlers" : "sebastiansastre 10/20/2013 11:58", 11 | "onClient:" : "sebastiansastre 10/20/2013 13:32", 12 | "onStop" : "sebastiansastre 10/21/2013 06:04", 13 | "restfulRequest:" : "sebastiansastre 7/2/2014 20:29", 14 | "stop" : "sebastiansastre 10/21/2013 06:07", 15 | "websocketsHandler" : "sebastiansastre 10/20/2013 13:57" } } 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWDelegate.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/7/2014 10:32", 8 | "instvars" : [ 9 | "handlers" ], 10 | "name" : "FWDelegate", 11 | "pools" : [ 12 | ], 13 | "super" : "ZnWebSocketDelegate", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/README.md: -------------------------------------------------------------------------------- 1 | A FWFilesHandler serves static content and can be configured to serve from a given dir -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/class/basePath.st: -------------------------------------------------------------------------------- 1 | accessing 2 | basePath 3 | 4 | ^ '/files' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/class/for..st: -------------------------------------------------------------------------------- 1 | actions 2 | for: aPath 3 | 4 | ^ self new 5 | path: aPath; 6 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/class/for.base..st: -------------------------------------------------------------------------------- 1 | actions 2 | for: aPath base: aString 3 | 4 | ^ self new 5 | base: aString; 6 | path: aPath; 7 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/class/packageName.st: -------------------------------------------------------------------------------- 1 | accessing 2 | packageName 3 | "Answers the name of the package that is managed by this handler (if any)" 4 | 5 | "Default is none" 6 | ^ '' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/base..st: -------------------------------------------------------------------------------- 1 | accessing 2 | base: aString 3 | 4 | base := aString 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/base.st: -------------------------------------------------------------------------------- 1 | accessing 2 | base 3 | 4 | ^ base ifNil:[self initializeBase] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/baseUri.st: -------------------------------------------------------------------------------- 1 | accessing 2 | baseUri 3 | 4 | ^ self base asZnUrl -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/defaultFilename.st: -------------------------------------------------------------------------------- 1 | accessing 2 | defaultFilename 3 | 4 | ^ 'index.html' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/documentForFile.type..st: -------------------------------------------------------------------------------- 1 | accessing 2 | documentForFile: aFilename type: aMIMEType 3 | 4 | ^ aFilename 5 | readStreamDo: [:stream | aMIMEType isBinary 6 | ifTrue: [stream contents] 7 | ifFalse: [stream contents asString]] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/fileFrom..st: -------------------------------------------------------------------------------- 1 | accessing 2 | fileFrom: aRequest 3 | "Answers the local filename that is suposed to match the one at the URI in aRequest" 4 | self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/fileNameFrom..st: -------------------------------------------------------------------------------- 1 | actions 2 | fileNameFrom: aRequest 3 | 4 | | requestedPath absolute | 5 | 6 | absolute := self path asFileReference absolutePath. 7 | 8 | aRequest uri isDirectoryPath ifTrue:[ 9 | ^ absolute asFileReference / self defaultFilename]. 10 | 11 | requestedPath := aRequest url segments. 12 | 13 | absolute asFileReference path segments 14 | do: [:part | (requestedPath includes: part) 15 | ifTrue: [requestedPath remove: part]]. 16 | 17 | requestedPath 18 | do: [:part | absolute := absolute / part]. 19 | 20 | ^ absolute asFileReference -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/files.st: -------------------------------------------------------------------------------- 1 | accessing 2 | files 3 | 4 | ^ files ifNil:[self initializeFiles] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/getFiles.st: -------------------------------------------------------------------------------- 1 | actions 2 | getFiles 3 | 4 | ^ self path asFileReference exists 5 | ifFalse:[#()] 6 | ifTrue:[self path asFileReference allChildren] 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/handle.with..st: -------------------------------------------------------------------------------- 1 | actions 2 | handle: aRequest with: aResponse 3 | 4 | | file fileStream mime entity response | 5 | 6 | (self isValid: aRequest) ifFalse:[ 7 | ^ ZnResponse badRequest: aRequest]. 8 | 9 | file := self fileNameFrom: aRequest. 10 | 11 | file isDirectory ifTrue:[ 12 | ^ self 13 | redirectFor: aRequest 14 | with: (ZnResponse redirect: (self baseUri addPathSegment: #/)) ]. 15 | 16 | file exists ifFalse: [ 17 | ^ self notFound: aRequest]. 18 | 19 | mime := self mimetypeForFile: file. 20 | 21 | entity := ZnStreamingEntity type: mime length: file entry size. 22 | 23 | fileStream := file readStream binary. 24 | entity stream: fileStream. 25 | 26 | response := ZnResponse ok: entity. 27 | self onAboutToServe: file for: aRequest on: response. 28 | response headers at: 'Modification-Date' put: (ZnUtils httpDate: file entry modification). 29 | 30 | 31 | ^ response -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/hasPackageNameFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | hasPackageNameFor: aRequest 3 | 4 | ^ self class packageName isEmpty 5 | ifTrue:[false] 6 | ifFalse:[(self class packageName,'*') match: aRequest uri segments last] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/initializeBase.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeBase 3 | 4 | ^ base := self class basePath -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/initializeFiles.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeFiles 3 | 4 | ^ files := self getFiles -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/initializePath.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializePath 3 | 4 | ^ path := (FileLocator imageDirectory / 'files') resolve asString -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/isCodeFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isCodeFor: aRequest 3 | 4 | ^ ('*.js' match: aRequest uri segments last) or:[ 5 | '*.st' match: aRequest uri segments last] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/isFileHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isFileHandlerFor: aRequest 3 | "Answers true if the filename in aRequest is present among the files 4 | handled by this handler. 5 | Applicability: useful for writting a file you also serve with this handler. 6 | Flow uses this every time you commit code from the Amber's Browser." 7 | 8 | ^ (self files anySatisfy:[:e| 9 | e basename = aRequest uri segments last]) or:[ 10 | ((self isCodeFor: aRequest) and:[ 11 | self hasPackageNameFor: aRequest])] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/isHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isHandlerFor: aRequest 3 | "Answers true if this handler should take care of aRequest. 4 | Note: subclasses should specialize" 5 | 6 | ^ aRequest uri = self baseUri or:[ 7 | (aRequest uri segments notNil and:[ 8 | aRequest uri segments first = self base asZnUrl segments first])] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/isValid..st: -------------------------------------------------------------------------------- 1 | testing 2 | isValid: aRequest 3 | 4 | ^ aRequest method = #GET -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/onAboutToServe.for.on..st: -------------------------------------------------------------------------------- 1 | reactions 2 | onAboutToServe: aFileName for: aRequest on: aResponse 3 | "If you want to send some header or cookie now is your last chance" -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/onAboutToServe.on..st: -------------------------------------------------------------------------------- 1 | reactions 2 | onAboutToServe: aFileName on: aResponse 3 | "If you want to send some header or cookie now is your last chance" -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/path..st: -------------------------------------------------------------------------------- 1 | accessing 2 | path: aPath 3 | 4 | path := aPath. 5 | self reset -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/path.st: -------------------------------------------------------------------------------- 1 | accessing 2 | path 3 | 4 | ^ path ifNil:[self initializePath] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/redirectFor.with..st: -------------------------------------------------------------------------------- 1 | actions 2 | redirectFor: aRequest with: aResponse 3 | 4 | ^ aResponse 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/reset.st: -------------------------------------------------------------------------------- 1 | actions 2 | reset 3 | 4 | files := nil -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/instance/writeContentFrom..st: -------------------------------------------------------------------------------- 1 | actions 2 | writeContentFrom: aRequest 3 | 4 | | file content | 5 | 6 | file := (self files 7 | detect:[:each| each basename = aRequest uri segments last] 8 | ifNone:[self fileFrom: aRequest]) asFileReference. 9 | 10 | file parent ensureCreateDirectory. 11 | 12 | aRequest contents isString 13 | ifTrue: [content := aRequest contents withInternetLineEndings] 14 | ifFalse: [content := aRequest contents]. 15 | 16 | "For some reason if we don't delete it first, it gets write corrupted sometimes :/" 17 | file delete. 18 | file writeStreamDo:[:stream| 19 | stream << content]. 20 | 21 | ^ ZnResponse ok: (ZnEntity text: 'OK') 22 | 23 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWFilesHandler.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/7/2014 10:30", 8 | "instvars" : [ 9 | "base", 10 | "path", 11 | "files" ], 12 | "name" : "FWFilesHandler", 13 | "pools" : [ 14 | ], 15 | "super" : "FWAbstractHandler", 16 | "type" : "normal" } 17 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/README.md: -------------------------------------------------------------------------------- 1 | A CowlinqAPIHandler is the custom Zinc REST handler we use to receive and answer validated commands -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/class/basePath.st: -------------------------------------------------------------------------------- 1 | accessing 2 | basePath 3 | 4 | ^ '/api/1.0/' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/class/validCommands.st: -------------------------------------------------------------------------------- 1 | accessing 2 | validCommands 3 | 4 | ^ #( 5 | 'addFarm' 6 | 'addUser' 7 | 'addCow' 8 | 'addBid' 9 | 'addDeal' 10 | 'addCowToStock' 11 | 'updatedCow' 12 | 'removeBid' 13 | 'removeCowFromStock' 14 | ) 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/instance/handle.with..st: -------------------------------------------------------------------------------- 1 | actions 2 | handle: aRequest with: aResponse 3 | "Answers a ZnResponse after handling aRequest. 4 | It presumes that aResponse can be used but you 5 | usually return a new ZnResponse loaded with 6 | the details relevant to each case." 7 | 8 | | command | 9 | 10 | "Basic sanity check first..." 11 | (self isValid: aRequest) ifFalse:[ 12 | ^ ZnResponse badRequest: aRequest ]. 13 | 14 | "...ok, looks good. Lets the API tell us what command will take care of it..." 15 | command := FWRESTAPIv10Command fromRequest: aRequest. 16 | 17 | "...and do it..." 18 | ^ [ [ command valueOn: self ] 19 | on: ConnectionTimedOut 20 | do:[:x| ^ ZnResponse ok: (ZnStringEntity text: 'backend offline') ] ] 21 | on: Error 22 | do:[ :x| 23 | FlowPlatform current isProduction 24 | ifFalse: [ self halt. ZnResponse serverError: x printString ] 25 | ifTrue: [ ZnResponse badRequest: aRequest ] ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/instance/isHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isHandlerFor: aRequest 3 | "Answers true if this handler should 4 | take care of aRequest or completely ignore it." 5 | 6 | ^ aRequest uri segments notNil and:[ 7 | aRequest uri segments size >= 2 and:[ 8 | aRequest uri segments first = 'api' and:[ 9 | aRequest uri segments second = '1.0']]] 10 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/instance/isValid..st: -------------------------------------------------------------------------------- 1 | actions 2 | isValid: aRequest 3 | "Answers true if the command sent in aRequest is valid. 4 | This is a minimum sanity check, plenty of room to improve." 5 | 6 | ^ #(GET POST DELETE PUT) includes: aRequest method -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "basePath" : "sebastiansastre 7/2/2014 14:49", 4 | "validCommands" : "sebastiansastre 7/1/2014 22:27" }, 5 | "instance" : { 6 | "handle:with:" : "jupiter 2/27/2015 21:00", 7 | "isHandlerFor:" : "sebastiansastre 7/7/2014 09:16", 8 | "isValid:" : "sebastiansastre 7/7/2014 09:15" } } 9 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRESTAPIv10Handler.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/1/2014 22:53", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWRESTAPIv10Handler", 11 | "pools" : [ 12 | ], 13 | "super" : "FWAPIHandler", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRootHandler.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-Handlers.package/FWRootHandler.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRootHandler.class/class/basePath.st: -------------------------------------------------------------------------------- 1 | accessing 2 | basePath 3 | 4 | ^ '/' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRootHandler.class/instance/handle.with..st: -------------------------------------------------------------------------------- 1 | actions 2 | handle: aRequest with: aResponse 3 | 4 | | entity | 5 | 6 | aRequest uri = '/favicon.ico' asZnUrl ifTrue:[ 7 | entity := ZnEntity with: ZnConstants faviconBytes type: 'image/vnd.microsoft.icon'. 8 | ^ ZnResponse ok: entity]. 9 | 10 | ^ ZnResponse ok: (ZnEntity html: '

flow

') -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRootHandler.class/instance/isHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isHandlerFor: aRequest 3 | "Answers true if this handler should take care of aRequest. 4 | Note: subclasses should specialize" 5 | 6 | ^ aRequest uri isSlash or:[ 7 | aRequest uri = '/favicon.ico' asZnUrl] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRootHandler.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "basePath" : "sebastiansastre 4/9/2012 11:38" }, 4 | "instance" : { 5 | "handle:with:" : "sebastiansastre 4/9/2012 14:11", 6 | "isHandlerFor:" : "sebastiansastre 4/9/2012 13:58" } } 7 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWRootHandler.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FWRootHandler", 11 | "pools" : [ 12 | ], 13 | "super" : "FWAbstractHandler", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/README.md: -------------------------------------------------------------------------------- 1 | A FWWebSocketsAPIHandler is the custom Zinc handler we use to receive new WebSocket connections and route messages -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/allBut..st: -------------------------------------------------------------------------------- 1 | accessing 2 | allBut: socket 3 | "Return a collection of all the clients except socket" 4 | ^ self clients copy 5 | remove: socket ifAbsent:[nil]; 6 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/clients.st: -------------------------------------------------------------------------------- 1 | accessing 2 | clients 3 | 4 | ^ clients ifNil:[ self initializeClients ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/handlesWebSockets.st: -------------------------------------------------------------------------------- 1 | testing 2 | handlesWebSockets 3 | 4 | ^ true -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/initializeClients.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeClients 3 | 4 | ^ clients := OrderedCollection new 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/initializeProtection.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeProtection 3 | 4 | ^ protection := Mutex new 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/isHandlerFor..st: -------------------------------------------------------------------------------- 1 | testing 2 | isHandlerFor: aRequest 3 | "Answers true if this handler should 4 | take care of aRequest or completely ignore it." 5 | 6 | ^ false -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/onClient..st: -------------------------------------------------------------------------------- 1 | reactions 2 | onClient: aWebSocket 3 | "Handle a new incoming web socket connection." 4 | 5 | self purgeClients. 6 | 7 | [ self register: aWebSocket. 8 | aWebSocket runWith: [:message| 9 | self process: message on: aWebSocket ] ] 10 | on: ConnectionClosed 11 | do: [ self unregister: aWebSocket ]. 12 | 13 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/onStop.st: -------------------------------------------------------------------------------- 1 | reactions 2 | onStop 3 | 4 | self clients do:[:socket| 5 | [socket close] on: Error do:[:x| ]. 6 | self unregister: socket] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/process.on..st: -------------------------------------------------------------------------------- 1 | actions 2 | process: aMessage on: socket 3 | "Some client has sent aMessage. 4 | It's time to chew it." 5 | 6 | | command | 7 | 8 | command := FWAPIv10WebSocketCommand fromJSONString: aMessage. 9 | "Transcript cr; show: command; flush." 10 | command processOn: self from: socket. -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/protection.st: -------------------------------------------------------------------------------- 1 | accessing 2 | protection 3 | 4 | ^ protection ifNil:[ self initializeProtection ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/purgeClients.st: -------------------------------------------------------------------------------- 1 | reactions 2 | purgeClients 3 | 4 | self clients copy do:[:e| 5 | e isConnected ifFalse:[ 6 | self unregister: e]] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/register..st: -------------------------------------------------------------------------------- 1 | actions 2 | register: clientWebSocket 3 | self protection critical: [ 4 | self clients add: clientWebSocket ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/sendToAll..st: -------------------------------------------------------------------------------- 1 | actions 2 | sendToAll: aCommand 3 | "Broadcast aCommand to all clients." 4 | 5 | self clients do:[:each| 6 | FlowPlatform current isProduction 7 | ifTrue: [ [each sendMessage: aCommand asJSONString] on: Error do:[:x| ]] 8 | ifFalse:[each sendMessage: aCommand asJSONString]] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/sendToAll.but..st: -------------------------------------------------------------------------------- 1 | actions 2 | sendToAll: aCommand but: aClient 3 | "Broadcast aCommand to all clients except aClient. 4 | Useful when one wants to tell something to everybody else." 5 | 6 | (self allBut: aClient) do:[:each| 7 | FlowPlatform current isProduction 8 | ifTrue: [ [each sendMessage: aCommand asJSONString] on: Error do:[:x| ]] 9 | ifFalse:[each sendMessage: aCommand asJSONString]] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/instance/unregister..st: -------------------------------------------------------------------------------- 1 | actions 2 | unregister: clientWebSocket 3 | self protection critical: [ 4 | self clients remove: clientWebSocket ifAbsent: [ ] ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "allBut:" : "sebastiansastre 7/1/2014 15:12", 6 | "clients" : "sebastiansastre 7/1/2014 15:12", 7 | "handlesWebSockets" : "sebastiansastre 7/1/2014 15:12", 8 | "initializeClients" : "sebastiansastre 7/1/2014 15:12", 9 | "initializeProtection" : "sebastiansastre 7/1/2014 15:12", 10 | "isHandlerFor:" : "sebastiansastre 1/15/2015 19:42", 11 | "onClient:" : "sebastiansastre 9/27/2014 01:12", 12 | "onStop" : "sebastiansastre 7/1/2014 15:12", 13 | "process:on:" : "sebastiansastre 7/7/2014 09:36", 14 | "protection" : "sebastiansastre 7/1/2014 15:12", 15 | "purgeClients" : "sebastiansastre 7/1/2014 15:12", 16 | "register:" : "sebastiansastre 7/1/2014 15:12", 17 | "sendToAll:" : "jupiter 2/27/2015 21:00", 18 | "sendToAll:but:" : "jupiter 2/27/2015 21:00", 19 | "unregister:" : "sebastiansastre 7/1/2014 15:12" } } 20 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/FWWebSocketsAPIHandler.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Handlers", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/7/2014 09:46", 8 | "instvars" : [ 9 | "clients", 10 | "protection" ], 11 | "name" : "FWWebSocketsAPIHandler", 12 | "pools" : [ 13 | ], 14 | "super" : "Object", 15 | "type" : "normal" } 16 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Core-Handlers'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-Handlers.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Core-Handlers') -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-Core-Handlers-sebastiansastre.4' message 'empty log message' id '7afcc1af-2ea8-4f05-bcf9-3b851f3e3f7c' date '9 March 2015' time '5:19:32.210227 pm' author 'sebastiansastre' ancestors ((name 'Flow-Core-Handlers-sebastiansastre.3' message 'empty log message' id '82f4501d-89f2-40d5-896d-a5d9814af5ec' date '9 March 2015' time '4:01:36.542628 pm' author 'sebastiansastre' ancestors ((name 'Flow-Core-Handlers-sebastiansastre.2' message 'empty log message' id 'a2962923-9050-431c-a430-6c308a4963cc' date '9 March 2015' time '4:00:50.34594 pm' author 'sebastiansastre' ancestors ((name 'Flow-Core-Handlers-jupiter.1' message '0.2.11 refactor' id 'cd4e10a1-5bcc-4095-ae13-03c8ed7272ab' date '27 February 2015' time '10:15:01.28243 pm' author 'jupiter' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-Core-Handlers.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/README.md: -------------------------------------------------------------------------------- 1 | FlowPlatform is the abstract superclass representing Flow on a particular platform. 2 | 3 | Use FlowPlatform current to access the appropriate class for your platform. -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/api.st: -------------------------------------------------------------------------------- 1 | accessing 2 | api 3 | 4 | ^ (ZnServer managedServers 5 | detect:[:srv| srv port = (ConfigurationFiles at: 'API' at: 'port')] 6 | ifNone:[nil]) ifNotNilDo:[:srv| 7 | srv delegate handlers 8 | detect:[:e| e class = FWRESTAPIv10Handler ] 9 | ifNone:[nil]] 10 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/current.st: -------------------------------------------------------------------------------- 1 | accessing 2 | current 3 | "Answers the appropriate subclass for the current platform (Smalltalk flavour)" 4 | ^ Current ifNil: [ Current := self initializeCurrentPlatform ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/dropDatabase.st: -------------------------------------------------------------------------------- 1 | actions 2 | dropDatabase 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/heartbeat.st: -------------------------------------------------------------------------------- 1 | actions 2 | heartbeat 3 | App heartbeat. 4 | self mta timerTick. 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/helper.st: -------------------------------------------------------------------------------- 1 | accessing 2 | helper 3 | ^ self current helper -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/initializeCurrentPlatform.st: -------------------------------------------------------------------------------- 1 | accessing 2 | initializeCurrentPlatform 3 | "Answers the appropriate subclass for the current platform (Smalltalk flavour)" 4 | ^ self subclasses detect: [ :platformClass | platformClass isValidForCurrentPlatform ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/install.st: -------------------------------------------------------------------------------- 1 | actions 2 | install 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/isProduction.st: -------------------------------------------------------------------------------- 1 | testing 2 | isProduction 3 | 4 | ^ ConfigurationFiles at: 'Flow' at: 'isProduction' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/isValidForCurrentPlatform.st: -------------------------------------------------------------------------------- 1 | testing 2 | isValidForCurrentPlatform 3 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/pulseRate.st: -------------------------------------------------------------------------------- 1 | accessing 2 | pulseRate 3 | 4 | ^ ConfigurationFiles at: 'App' at: 'pulseRate' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/reset.st: -------------------------------------------------------------------------------- 1 | actions 2 | reset 3 | 4 | ConfigurationFiles reset. 5 | 6 | FWRESTAPIv10Command reset. 7 | 8 | mta := nil. -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/restart.st: -------------------------------------------------------------------------------- 1 | actions 2 | restart 3 | 4 | self stop; reset; start -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/setupServer.st: -------------------------------------------------------------------------------- 1 | actions 2 | setupServer 3 | 4 | ^self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/shutDown.st: -------------------------------------------------------------------------------- 1 | actions 2 | shutDown 3 | 4 | self stop -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/start.st: -------------------------------------------------------------------------------- 1 | actions 2 | start 3 | 4 | self reset. 5 | 6 | self startHttpd. 7 | 8 | self startHeartbeat. 9 | 10 | self setupServer. 11 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/startHeartbeat.st: -------------------------------------------------------------------------------- 1 | actions 2 | startHeartbeat 3 | 4 | heartbeat := [ 5 | [(Delay forDuration: self pulseRate) wait. 6 | self heartbeat] repeat] 7 | forkAt: Processor userBackgroundPriority 8 | named: 'flow heartbeat' -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/startHttpd.st: -------------------------------------------------------------------------------- 1 | actions 2 | startHttpd 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/startUp.st: -------------------------------------------------------------------------------- 1 | actions 2 | startUp 3 | 4 | self restart -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/startWebsocket.st: -------------------------------------------------------------------------------- 1 | actions 2 | startWebsocket 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/stop.st: -------------------------------------------------------------------------------- 1 | actions 2 | stop 3 | 4 | self stopHttpd. 5 | 6 | self stopHeartbeat. 7 | 8 | 5 timesRepeat: [ Smalltalk garbageCollect ]. -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/stopHeartbeat.st: -------------------------------------------------------------------------------- 1 | actions 2 | stopHeartbeat 3 | 4 | heartbeat ifNotNil: [ | hb | 5 | hb := heartbeat. 6 | heartbeat := nil. 7 | hb terminate ] -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/stopHttpd.st: -------------------------------------------------------------------------------- 1 | actions 2 | stopHttpd 3 | 4 | ^self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/uninstall.st: -------------------------------------------------------------------------------- 1 | actions 2 | uninstall 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/class/webSocketAPI.st: -------------------------------------------------------------------------------- 1 | actions 2 | webSocketAPI 3 | 4 | ^ self subclassResponsibility -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/FlowPlatform.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Core-Platform", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | "Current", 7 | "heartbeat", 8 | "mta" ], 9 | "commentStamp" : "jupiter 2/27/2015 22:04", 10 | "instvars" : [ 11 | ], 12 | "name" : "FlowPlatform", 13 | "pools" : [ 14 | ], 15 | "super" : "Object", 16 | "type" : "normal" } 17 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/String.extension/instance/toUtf8.st: -------------------------------------------------------------------------------- 1 | *Flow-Core-Platform 2 | toUtf8 3 | "Answers the string which is the result of decoding the receiver in utf8" 4 | 5 | ^ (GRCodec forEncoding: 'utf-8') encode: self -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/String.extension/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "toUtf8" : "sas 10/27/2013 11:00" } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/String.extension/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "String" } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/ZnResponse.extension/class/conflict..st: -------------------------------------------------------------------------------- 1 | *Flow-Core-Platform 2 | conflict: entity 3 | 4 | ^ self new 5 | statusLine: ZnStatusLine conflict; 6 | headers: ZnHeaders defaultResponseHeaders; 7 | entity: entity; 8 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/ZnResponse.extension/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "conflict:" : "sebastiansastre 3/2/2015 23:22" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/ZnResponse.extension/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "ZnResponse" } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/ZnStatusLine.extension/class/conflict.st: -------------------------------------------------------------------------------- 1 | *Flow-Core-Platform 2 | conflict 3 | "http://httpstatus.es/409" 4 | ^ self code: 409 -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/ZnStatusLine.extension/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "conflict" : "sebastiansastre 3/2/2015 23:29" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/ZnStatusLine.extension/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "ZnStatusLine" } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Core-Platform'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Core-Platform.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Core-Platform') -------------------------------------------------------------------------------- /backend/src/Flow-Core-Platform.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/README.md: -------------------------------------------------------------------------------- 1 | An AppFakeDataBuilder is a factory to create some db refill so you can do demos like a boss ¯\_(-.o)_/¯ -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/class/build.st: -------------------------------------------------------------------------------- 1 | actions 2 | build 3 | "Makes a db and store some fake, yet credible, data in it" 4 | 5 | self clean. 6 | 7 | self saveThings. 8 | self createRelationships. -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/class/clean.st: -------------------------------------------------------------------------------- 1 | actions 2 | clean 3 | "Drops the db" 4 | 5 | App dropDatabase -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/class/createRelationships.st: -------------------------------------------------------------------------------- 1 | actions 2 | createRelationships 3 | "Create some relationships between things." 4 | 5 | FWRESTAPIv10Command databaseDo:[ | all | 6 | all := Thing findAll. 7 | (1 to: (all size * 0.6) truncated) do:[ :i | | thing otherThing | 8 | "We're guessing/assuming that having ~60% of the stock related one to each other is okay" 9 | thing := all at: i. 10 | otherThing := all at: (1 to: all size) atRandom. 11 | thing ~= otherThing ifTrue:[ 12 | thing beRelatedTo: otherThing ]. 13 | thing save. 14 | otherThing save ] ] -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/class/putSomeThingsLikeThis.st: -------------------------------------------------------------------------------- 1 | actions 2 | putSomeThingsLikeThis 3 | "Sets part of the thigns to be like this." 4 | 5 | FWRESTAPIv10Command databaseDo:[ | all | 6 | all := Thing findAll. 7 | (1 to: (all size * 0.1) truncated) do:[ :i | | thing | 8 | thing := all at: i. 9 | thing 10 | beLikeThis; 11 | price: (1500 to: 1900) atRandom; 12 | save] ] -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/class/saveThings.st: -------------------------------------------------------------------------------- 1 | actions 2 | saveThings 3 | 4 | FWRESTAPIv10Command databaseDo:[ 5 | (1 to: 100) do:[ :i | 6 | Thing new 7 | number: i; 8 | fakedOn: DateAndTime now; 9 | save ] ]. -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "build" : "jupiter 2/28/2015 12:41", 4 | "clean" : "jupiter 2/28/2015 12:41", 5 | "createRelationships" : "jupiter 2/28/2015 12:41", 6 | "putSomeThingsLikeThis" : "jupiter 2/28/2015 12:42", 7 | "saveThings" : "jupiter 2/28/2015 12:42" }, 8 | "instance" : { 9 | } } 10 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/AppFakeDataBuilder.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Examples", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/7/2014 10:00", 8 | "instvars" : [ 9 | ], 10 | "name" : "AppFakeDataBuilder", 11 | "pools" : [ 12 | ], 13 | "super" : "Object", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Stuff.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Examples.package/Stuff.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Stuff.class/class/pluralName.st: -------------------------------------------------------------------------------- 1 | accessing 2 | pluralName 3 | "Answers the string expected in a nicely designed API. 4 | Any subclass can override itws own custom name. 5 | The default plural name is the singular name 6 | in lower case plus an 's' so beware of irregular nouns." 7 | 8 | ^ self singularName -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Stuff.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "pluralName" : "jupiter 2/28/2015 12:43" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Stuff.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Examples", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "Stuff", 11 | "pools" : [ 12 | ], 13 | "super" : "Mapless", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/README.md: -------------------------------------------------------------------------------- 1 | This is an example of a model the app can use at the backend and at the frontend. -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/instance/addThing..st: -------------------------------------------------------------------------------- 1 | actions 2 | addThing: aThing 3 | "Adds aThing to the things of this thing" 4 | 5 | self things ifNil: [ self things: OrderedCollection new ]. 6 | 7 | ^ self things add: aThing -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/instance/beLikeThis.st: -------------------------------------------------------------------------------- 1 | actions 2 | beLikeThis 3 | 4 | self likeThis: true -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/instance/beNotLikeThis.st: -------------------------------------------------------------------------------- 1 | actions 2 | beNotLikeThis 3 | 4 | self likeThis: false -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/instance/beRelatedTo..st: -------------------------------------------------------------------------------- 1 | actions 2 | beRelatedTo: aThing 3 | "Makes this thing to be the related to aThing" 4 | 5 | aThing knows: self. 6 | 7 | self addThing: aThing -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/instance/removeThing..st: -------------------------------------------------------------------------------- 1 | actions 2 | removeThing: aThing 3 | "Removes aThing from the things that belong to this thing" 4 | 5 | self things ifNil: [ self things: OrderedCollection new ]. 6 | 7 | ^ self things 8 | remove: aThing 9 | ifAbsent:[ nil ] -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "addThing:" : "jupiter 2/28/2015 12:45", 6 | "beLikeThis" : "jupiter 2/28/2015 12:44", 7 | "beNotLikeThis" : "jupiter 2/28/2015 12:44", 8 | "beRelatedTo:" : "jupiter 2/28/2015 12:45", 9 | "removeThing:" : "jupiter 2/28/2015 12:45" } } 10 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/Thing.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Examples", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "sebastiansastre 7/6/2014 19:49", 8 | "instvars" : [ 9 | ], 10 | "name" : "Thing", 11 | "pools" : [ 12 | ], 13 | "super" : "Mapless", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Examples'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Examples.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Examples') -------------------------------------------------------------------------------- /backend/src/Flow-Examples.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStoneHelper.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-GemStone-Core.package/FlowGemStoneHelper.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStoneHelper.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStoneHelper.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-GemStone-Core", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FlowGemStoneHelper", 11 | "pools" : [ 12 | ], 13 | "super" : "Object", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/apiPortList.st: -------------------------------------------------------------------------------- 1 | accessing 2 | apiPortList 3 | "ToDo: handle multiple ports" 4 | 5 | ^ Array with: (ConfigurationFiles at: 'API' at: 'port') -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/dropDatabase.st: -------------------------------------------------------------------------------- 1 | actions 2 | dropDatabase 3 | "ToDo: Not appropriate for GemStone as there may be many databases" 4 | 5 | MaplessGemStoneRepository reset -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/flowDevelopmentDebugScript.st: -------------------------------------------------------------------------------- 1 | actions 2 | flowDevelopmentDebugScript 3 | | mInstance | 4 | "Note: This starts the service only on the first port in the apiPortList" 5 | ZnTransactionSafeManagingMultiThreadedServer initialize. 6 | ConfigurationFiles reset. 7 | (GemServerRegistry gemServerNamed: self flowServerName) 8 | ifNotNil: [ 9 | (GemServerRegistry gemServerNamed: self flowServerName) 10 | stop; 11 | unregister. 12 | self setupServer ]. 13 | mInstance := GemServerRegistry gemServerNamed: self flowServerName. 14 | System commitTransaction. 15 | mInstance startServiceOn: self apiPortList first -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/flowServerName.st: -------------------------------------------------------------------------------- 1 | accessing 2 | flowServerName 3 | ^ 'FlowGemStoneServer' -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/helper.st: -------------------------------------------------------------------------------- 1 | accessing 2 | helper 3 | ^ FlowGemStoneHelper -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/install.st: -------------------------------------------------------------------------------- 1 | actions 2 | install 3 | 4 | "NoOp on GemStone" -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/isValidForCurrentPlatform.st: -------------------------------------------------------------------------------- 1 | testing 2 | isValidForCurrentPlatform 3 | ^ SpEnvironment isGemStone -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/makeDispatcher.st: -------------------------------------------------------------------------------- 1 | actions 2 | makeDispatcher 3 | "Answers the dispatcher that will route requests to the flow API." 4 | 5 | ^ FWDelegate new -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/setupServer.st: -------------------------------------------------------------------------------- 1 | actions 2 | setupServer 3 | (GemServerRegistry gemServerNamed: self flowServerName) 4 | ifNil: [ ZnNewGemServer register: self flowServerName on: self apiPortList ]. 5 | (GemServerRegistry gemServerNamed: self flowServerName) 6 | logFilter: nil; 7 | logToObjectLog; 8 | debugMode: true; 9 | delegate: 10 | (FWDelegate new 11 | addHandler: FWRESTAPIv10Handler new; 12 | addHandler: 13 | (FWFilesHandler 14 | for: 15 | (GsFile _expandEnvVariable: 'GEMSTONE_STONE_DIR' isClient: false) , '/service' 16 | base: 'service'); 17 | addHandler: FWWebSocketsAPIHandler new; 18 | yourself) -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/start.st: -------------------------------------------------------------------------------- 1 | actions 2 | start 3 | self setupServer. 4 | self startHttpd -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/startGems..st: -------------------------------------------------------------------------------- 1 | actions 2 | startGems: gemServer 3 | "FlowRESTAPIv10Test staticRemoteServer: true. 4 | FlowRESTAPIv10Test interactiveRemoteServer: true. 5 | 6 | FlowRESTAPIv10Test staticRemoteServer: false. 7 | FlowRESTAPIv10Test interactiveRemoteServer: false." 8 | 9 | "mount @/sys/stone/dirs/Flow/backend/tode /home flow" 10 | 11 | "abort; /home/flow/debugGemServer --start=FlowAppServer_Test --interactive=true" 12 | 13 | self staticRemoteServer 14 | ifTrue: [ 15 | System commitTransaction. 16 | self 17 | notify: 18 | 'Proceed when static server is available. Evaluate: abort; /home/flow/debugGemServer --start=FlowAppServer_Test --interactive=true' ] 19 | ifFalse: [ 20 | gemServer startGems. 21 | (Delay forSeconds: 3) wait ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/startHttpd.st: -------------------------------------------------------------------------------- 1 | actions 2 | startHttpd 3 | GemServerRegistry startGemsNamed: self flowServerName -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/stopHttpd.st: -------------------------------------------------------------------------------- 1 | actions 2 | stopHttpd 3 | (GemServerRegistry gemServerNamed: self flowServerName) 4 | stopGems; 5 | unregister -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/class/uninstall.st: -------------------------------------------------------------------------------- 1 | actions 2 | uninstall 3 | "NoOp on GemStone" 4 | 5 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "apiPortList" : "jupiter 03/01/2015 12:41", 4 | "dropDatabase" : "jupiter 03/01/2015 12:03", 5 | "flowDevelopmentDebugScript" : "jupiter 03/01/2015 13:30", 6 | "flowServerName" : "jupiter 03/01/2015 13:28", 7 | "helper" : "jupiter 2/28/2015 08:30", 8 | "install" : "jupiter 2/27/2015 21:13", 9 | "isValidForCurrentPlatform" : "jupiter 03/01/2015 11:41", 10 | "makeDispatcher" : "jupiter 2/27/2015 21:14", 11 | "setupServer" : "jupiter 03/01/2015 13:27", 12 | "start" : "jupiter 03/01/2015 13:39", 13 | "startGems:" : "jupiter 03/01/2015 13:33", 14 | "startHttpd" : "jupiter 03/01/2015 13:27", 15 | "stopHttpd" : "jupiter 03/01/2015 13:39", 16 | "uninstall" : "jupiter 03/01/2015 12:37" }, 17 | "instance" : { 18 | } } 19 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/FlowGemStonePlatform.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-GemStone-Core", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FlowGemStonePlatform", 11 | "pools" : [ 12 | ], 13 | "super" : "FlowPlatform", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/SpEnvironment.extension/class/evaluate.in..st: -------------------------------------------------------------------------------- 1 | *Flow-GemStone-Core 2 | evaluate: aString in: anEnvironment 3 | "Used by Swazoo" 4 | 5 | ^ self 6 | evaluate: aString 7 | receiver: nil 8 | in: (anEnvironment ifNil: [ System myUserProfile symbolList ]) -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/SpEnvironment.extension/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "evaluate:in:" : "jupiter 03/01/2015 13:03" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/SpEnvironment.extension/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "SpEnvironment" } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/SpFilename.extension/instance/contentsOfEntireFile.st: -------------------------------------------------------------------------------- 1 | *Flow-GemStone-Core 2 | contentsOfEntireFile 3 | | stream | 4 | [ ^ (stream := self readStream) contents ] 5 | ensure: [ stream close ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/SpFilename.extension/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "contentsOfEntireFile" : "jupiter 03/01/2015 12:50" } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/SpFilename.extension/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "SpFilename" } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-GemStone-Core'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-GemStone-Core.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-GemStone-Core') -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-GemStone-Core-jupiter.4' message 'GemStone tests WIP' id '942374a8-3b4e-4c3a-a9d7-6ddd7492bdff' date '03/01/2015' time '13:59:50' author 'jupiter' ancestors ((name 'Flow-GemStone-Core-jupiter.3' message 'GemStonePlatform WIP' id '7aaf98ec-0054-40de-8177-ffe671c4648d' date '03/01/2015' time '13:36:30' author 'jupiter' ancestors ((name 'Flow-GemStone-Core-jupiter.2' message '0.2.11 refactor' id '71aa854d-92af-4e78-a253-a68d1d9e2b8d' date '02/28/2015' time '09:19:31' author 'jupiter' ancestors ((name 'Flow-GemStone-Core-jupiter.1' message '0.2.11 refactor' id '1b325a8a-0899-45e9-b3e5-e731f6a6f2ae' date '02/27/2015' time '10:17:40' author 'jupiter' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Core.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/class/interactiveRemoteServer..st: -------------------------------------------------------------------------------- 1 | as yet unclassified 2 | interactiveRemoteServer: aBool 3 | "self interactiveRemoteServer: true" 4 | 5 | InteractiveRemoteServer := aBool -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/class/interactiveRemoteServer.st: -------------------------------------------------------------------------------- 1 | as yet unclassified 2 | interactiveRemoteServer 3 | InteractiveRemoteServer ifNil: [ InteractiveRemoteServer := false ]. 4 | ^ InteractiveRemoteServer -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/class/staticRemoteServer..st: -------------------------------------------------------------------------------- 1 | as yet unclassified 2 | staticRemoteServer: aBool 3 | "self staticRemoteServer: true" 4 | 5 | StaticRemoteServer := aBool -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/class/staticRemoteServer.st: -------------------------------------------------------------------------------- 1 | as yet unclassified 2 | staticRemoteServer 3 | StaticRemoteServer ifNil: [ StaticRemoteServer := false ]. 4 | ^ StaticRemoteServer -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/apiUrl.st: -------------------------------------------------------------------------------- 1 | accessing 2 | apiUrl 3 | 4 | ^ 'http://localhost:', (ConfigurationFiles at: 'API' at: 'port') asString ,'/api/1.0' -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/createGemServer.st: -------------------------------------------------------------------------------- 1 | private 2 | createGemServer 3 | | gemServer | 4 | gemServer := GemServer gemServerNamed: self gemServerName. 5 | self interactiveRemoteServer 6 | ifTrue: [ gemServer interactiveMode: true ]. 7 | ^ gemServer -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/databaseName.st: -------------------------------------------------------------------------------- 1 | accessing 2 | databaseName 3 | 4 | ^ 'AppTests' -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/do..st: -------------------------------------------------------------------------------- 1 | actions 2 | do: aBlock 3 | "Evaluates aBlock in the context of the database 4 | so things saved/changed are only affecting that db" 5 | 6 | ^ FWRESTAPIv10Command databaseDo: aBlock -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/gemServerName.st: -------------------------------------------------------------------------------- 1 | private 2 | gemServerName 3 | ^ 'FlowAppServer_Test' -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/gemServerPortList.st: -------------------------------------------------------------------------------- 1 | private 2 | gemServerPortList 3 | ^ {3333} -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/inFlowAppTestDelete.st: -------------------------------------------------------------------------------- 1 | other 2 | inFlowAppTestDelete 3 | | anId aThing apiResponse | 4 | anId := UUID new asString. 5 | aThing := Thing new 6 | id: anId; 7 | prospect: 'guy'; 8 | offer: 355.25; 9 | yourself. 10 | self 11 | do: [ 12 | self assert: (Thing findId: aThing id) isNil. 13 | aThing save. 14 | self assert: (Thing findId: aThing id) notNil. 15 | self assert: (Thing findId: aThing id) offer = 355.25 ]. 16 | System commitTransaction. 17 | apiResponse := ZnEasy delete: self apiUrl , '/things/' , aThing id. 18 | [ self assert: apiResponse code = 200 ] 19 | ensure: [ System abortTransaction ]. 20 | self 21 | do: [ 22 | self deny: (Thing findId: anId) notNil. 23 | self assert: (Thing findId: anId) isNil ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/inFlowAppTestGetAll.st: -------------------------------------------------------------------------------- 1 | other 2 | inFlowAppTestGetAll 3 | | registeredOnes apiResponse answeredOnes | 4 | self do: [ registeredOnes := Thing findAll ]. 5 | System commitTransaction. 6 | apiResponse := ZnEasy get: self apiUrl , '/things'. 7 | self assert: apiResponse code = 200. 8 | answeredOnes := MaplessGemstone fromJSONString: apiResponse contents. 9 | answeredOnes 10 | do: [ :answeredOne | 11 | self 12 | assert: 13 | (registeredOnes anySatisfy: [ :registeredOne | answeredOne = registeredOne ]) ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/inFlowAppTestGetSome.st: -------------------------------------------------------------------------------- 1 | other 2 | inFlowAppTestGetSome 3 | | anId registeredOnes apiResponse answeredOnes | 4 | anId := UUID new asString. 5 | self do: [ registeredOnes := Thing findAll ]. 6 | System commitTransaction. 7 | apiResponse := ZnEasy 8 | post: self apiUrl , '/things/query' 9 | data: (ZnStringEntity text: '{"production": "quite a lot"}'). 10 | self assert: apiResponse code = 200. 11 | answeredOnes := MaplessGemstone fromJSONString: apiResponse contents. 12 | answeredOnes 13 | do: [ :answeredOne | 14 | self 15 | assert: 16 | (registeredOnes anySatisfy: [ :registeredOne | answeredOne = registeredOne ]) ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/inFlowAppTestGetUnexisting.st: -------------------------------------------------------------------------------- 1 | other 2 | inFlowAppTestGetUnexisting 3 | | anId apiResponse | 4 | anId := UUID new asString. 5 | self do: [ self assert: (Thing findId: anId) isNil ]. 6 | apiResponse := ZnEasy get: self apiUrl , '/things/' , anId. 7 | self assert: apiResponse code = 404. 8 | self assert: ('*' , anId , '*' match: apiResponse contents). 9 | System abortTransaction -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/inFlowAppTestUpdate.st: -------------------------------------------------------------------------------- 1 | other 2 | inFlowAppTestUpdate 3 | | anId registeredThing apiResponse | 4 | anId := UUID new asString. 5 | registeredThing := Thing new 6 | id: anId; 7 | production: 'a bunch'; 8 | memes: 'very good ones'; 9 | yourself. 10 | self 11 | do: [ 12 | self assert: (Thing findId: registeredThing id) isNil. 13 | registeredThing save. 14 | self assert: (Thing findId: registeredThing id) notNil. 15 | self assert: (Thing findId: registeredThing id) production = 'a bunch' ]. 16 | registeredThing production: 'quite a lot'. 17 | apiResponse := ZnEasy 18 | put: self apiUrl , '/things' 19 | data: (ZnStringEntity text: registeredThing asJSONString). 20 | self assert: apiResponse code = 200. 21 | System abortTransaction. 22 | self 23 | do: [ 24 | self assert: (Thing findId: registeredThing id) notNil. 25 | self assert: (Thing findId: registeredThing id) production = 'quite a lot' ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/interactiveRemoteServer.st: -------------------------------------------------------------------------------- 1 | private 2 | interactiveRemoteServer 3 | ^ self class interactiveRemoteServer -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/startFlowAppDo..st: -------------------------------------------------------------------------------- 1 | actions 2 | startFlowAppDo: aBlock 3 | | gemServer | 4 | gemServer := self createGemServer. 5 | [ 6 | self startGems: gemServer. 7 | aBlock value ] 8 | ensure: [ self stopGems: gemServer ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/startGems..st: -------------------------------------------------------------------------------- 1 | private 2 | startGems: gemServer 3 | "FlowRESTAPIv10Test staticRemoteServer: true. 4 | FlowRESTAPIv10Test interactiveRemoteServer: true. 5 | 6 | FlowRESTAPIv10Test staticRemoteServer: false. 7 | FlowRESTAPIv10Test interactiveRemoteServer: false." 8 | 9 | "mount @/sys/stone/dirs/Flow/backend/tode /home flow" 10 | 11 | "abort; /home/flow/debugGemServer --start=FlowAppServer_Test --interactive=true" 12 | 13 | self staticRemoteServer 14 | ifTrue: [ 15 | System commitTransaction. 16 | self 17 | notify: 18 | 'Proceed when static server is available. Evaluate: abort; /home/flow/debugGemServer --start=FlowAppServer_Test --interactive=true' ] 19 | ifFalse: [ 20 | gemServer startGems. 21 | (Delay forSeconds: 3) wait ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/staticRemoteServer.st: -------------------------------------------------------------------------------- 1 | private 2 | staticRemoteServer 3 | ^ self class staticRemoteServer -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/stopGems..st: -------------------------------------------------------------------------------- 1 | private 2 | stopGems: gemServer 3 | self staticRemoteServer 4 | ifFalse: [ 5 | gemServer stopGems. 6 | (Delay forSeconds: 3) wait ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/tearDown.st: -------------------------------------------------------------------------------- 1 | actions 2 | tearDown 3 | super tearDown. 4 | MaplessGemstoneContainer current 5 | removeDatabase: self databaseName 6 | ifAbsent: [ ]. 7 | FWRESTAPIv10Command reset. 8 | GemServerRegistry _singleton: registry. 9 | System commitTransaction -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testCreate.st: -------------------------------------------------------------------------------- 1 | other 2 | testCreate 3 | Transcript 4 | cr; 5 | show: 'testCreate: [0]'. 6 | [ self startFlowAppDo: [ self inFlowAppTestCreate ] ] 7 | on: Error 8 | do: [ :ex | 9 | Transcript 10 | cr; 11 | show: 'testCreate: [1] ' , ex description; 12 | show: (GsProcess stackReportToLevel: 100). 13 | ex pass ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testDelete.st: -------------------------------------------------------------------------------- 1 | other 2 | testDelete 3 | self startFlowAppDo: [ self inFlowAppTestDelete ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testGetAll.st: -------------------------------------------------------------------------------- 1 | other 2 | testGetAll 3 | self startFlowAppDo: [ self inFlowAppTestGetAll ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testGetOne.st: -------------------------------------------------------------------------------- 1 | other 2 | testGetOne 3 | self startFlowAppDo: [ self inFlowAppTestGetOne ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testGetSome.st: -------------------------------------------------------------------------------- 1 | other 2 | testGetSome 3 | self startFlowAppDo: [ self inFlowAppTestGetSome ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testGetUnexisting.st: -------------------------------------------------------------------------------- 1 | other 2 | testGetUnexisting 3 | self startFlowAppDo: [ self inFlowAppTestGetUnexisting ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testStuff.st: -------------------------------------------------------------------------------- 1 | other 2 | testStuff 3 | self startFlowAppDo: [ self inFlowAppTestStuff ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/instance/testUpdate.st: -------------------------------------------------------------------------------- 1 | other 2 | testUpdate 3 | self startFlowAppDo: [ self inFlowAppTestUpdate ] -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/FlowGemStoneRESTAPIv10Test.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-GemStone-Tests", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | "InteractiveRemoteServer", 7 | "StaticRemoteServer" ], 8 | "commentStamp" : "", 9 | "instvars" : [ 10 | "registry" ], 11 | "name" : "FlowGemStoneRESTAPIv10Test", 12 | "pools" : [ 13 | ], 14 | "super" : "TestCase", 15 | "type" : "normal" } 16 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-GemStone-Tests'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-GemStone-Tests.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-GemStone-Tests') -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-GemStone-Tests-jupiter.2' message 'GemStone tests WIP' id '59a478b6-8c61-43b4-809c-52a2dff7b558' date '03/01/2015' time '13:59:50' author 'jupiter' ancestors ((name 'Flow-GemStone-Tests-jupiter.1' message '0.2.11 refactor' id 'fe91079f-638f-4c34-bae1-bea3fd5e83fb' date '02/28/2015' time '09:19:54' author 'jupiter' ancestors () stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-GemStone-Tests.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoHelper.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Pharo-Core.package/FlowPharoHelper.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoHelper.class/class/helper.st: -------------------------------------------------------------------------------- 1 | accessing 2 | helper 3 | ^ FlowPharoHelper -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoHelper.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "helper" : "jupiter 2/28/2015 08:26" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoHelper.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Pharo-Core", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FlowPharoHelper", 11 | "pools" : [ 12 | ], 13 | "super" : "Object", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/dropDatabase.st: -------------------------------------------------------------------------------- 1 | actions 2 | dropDatabase 3 | 4 | (self confirm: 'Wait whaaat? Dropping MongoDB database named: ',FWRESTAPIv10Command databaseName,' has no undo. Are your sure?') ifTrue:[ 5 | OSProcess command: 'mongo ',FWRESTAPIv10Command databaseName,' --eval "db.dropDatabase()"'] -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/install.st: -------------------------------------------------------------------------------- 1 | actions 2 | install 3 | 4 | Smalltalk addToStartUpList: App. 5 | Smalltalk addToShutDownList: App. -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/isValidForCurrentPlatform.st: -------------------------------------------------------------------------------- 1 | testing 2 | isValidForCurrentPlatform 3 | ^ SpEnvironment isSqueak -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/makeDispatcher.st: -------------------------------------------------------------------------------- 1 | actions 2 | makeDispatcher 3 | "Answers the dispatcher that will route requests to the flow API." 4 | 5 | ^ FWDelegate new -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/mta.st: -------------------------------------------------------------------------------- 1 | accessing 2 | mta 3 | 4 | ^ mta ifNil: [ mta := MTASMTPClient new ] -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/setupServer.st: -------------------------------------------------------------------------------- 1 | actions 2 | setupServer 3 | 4 | "Setting up a dispatcher for Zinc so we can use our handlers" 5 | (ZnServer managedServers detect:[:e| 6 | e port = (ConfigurationFiles at: 'API' at: 'port')]) 7 | delegate: (FWDelegate new 8 | addHandler: FWRESTAPIv10Handler new; 9 | addHandler: FWWebSocketsAPIHandler new; 10 | addHandler: (FWFilesHandler for: (FileLocator imageDirectory / 'service') resolve fullName base: 'service'); 11 | yourself). 12 | 13 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/startHttpd.st: -------------------------------------------------------------------------------- 1 | actions 2 | startHttpd 3 | 4 | (ZnServer startDefaultOn: (ConfigurationFiles at: 'API' at: 'port')) 5 | delegate: self makeDispatcher; 6 | register; 7 | yourself -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/startVNC.st: -------------------------------------------------------------------------------- 1 | actions 2 | startVNC 3 | | pwd | 4 | 5 | pwd := ConfigurationFiles at: 'VNC' at: 'password'. 6 | 7 | pwd ifNotNil:[ RFBServer current setFullPassword: pwd]. 8 | 9 | RFBServer current 10 | port: (ConfigurationFiles at: 'VNC' at: 'port'); 11 | allowRemoteConnections: (ConfigurationFiles at: 'VNC' at: 'localOnly') not; 12 | start. -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/startWebsocket.st: -------------------------------------------------------------------------------- 1 | actions 2 | startWebsocket 3 | 4 | (ZnServer startOn: (ConfigurationFiles at: 'API' at: 'port')) register -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/stopHttpd.st: -------------------------------------------------------------------------------- 1 | actions 2 | stopHttpd 3 | 4 | 5 | ZnServer managedServers do:[:e| e stop]. 6 | 7 | ZnServer default ifNotNil:[ 8 | ZnServer default delegate stop]. 9 | 10 | ZnServer stopDefault. 11 | 12 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/stopVNC.st: -------------------------------------------------------------------------------- 1 | actions 2 | stopVNC 3 | 4 | RFBServer current stop -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/uninstall.st: -------------------------------------------------------------------------------- 1 | actions 2 | uninstall 3 | 4 | Smalltalk removeFromStartUpList: App. 5 | Smalltalk removeFromShutDownList: App. -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/class/webSocketAPI.st: -------------------------------------------------------------------------------- 1 | actions 2 | webSocketAPI 3 | 4 | ^ (ZnServer managedServers 5 | detect:[:srv| srv port = (ConfigurationFiles at: 'API' at: 'port')] 6 | ifNone:[nil]) 7 | ifNotNilDo:[:srv| srv delegate websocketsHandler] -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "dropDatabase" : "jupiter 2/27/2015 21:11", 4 | "install" : "jupiter 2/27/2015 21:13", 5 | "isValidForCurrentPlatform" : "jupiter 2/27/2015 20:53", 6 | "makeDispatcher" : "jupiter 2/27/2015 21:14", 7 | "mta" : "jupiter 2/27/2015 21:23", 8 | "setupServer" : "jupiter 2/27/2015 21:29", 9 | "startHttpd" : "jupiter 2/27/2015 21:33", 10 | "startVNC" : "jupiter 2/27/2015 21:38", 11 | "startWebsocket" : "jupiter 2/27/2015 21:38", 12 | "stopHttpd" : "jupiter 2/27/2015 21:47", 13 | "stopVNC" : "jupiter 2/27/2015 21:49", 14 | "uninstall" : "jupiter 2/27/2015 21:54", 15 | "webSocketAPI" : "jupiter 2/27/2015 21:55" }, 16 | "instance" : { 17 | } } 18 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/FlowPharoPlatform.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Pharo-Core-Flow-Pharo-Core", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | "sigterm" ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FlowPharoPlatform", 11 | "pools" : [ 12 | ], 13 | "super" : "FlowPlatform", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/VirtualMachine.extension/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | "maxExternalSemaphores:" : "sebastiansastre 8/3/2012 11:39" }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/VirtualMachine.extension/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "VirtualMachine" } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Pharo-Core'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Pharo-Core.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Pharo-Core') -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-Pharo-Core-sebastiansastre.4' message 'empty log message' id '1c1d91fa-ecfb-441e-8a0a-71ab40a9288a' date '9 March 2015' time '5:19:47.623483 pm' author 'sebastiansastre' ancestors ((name 'Flow-Pharo-Core-sebastiansastre.3' message 'empty log message' id '6332652a-80c0-41c7-b404-f96d49a6ea7e' date '9 March 2015' time '4:02:18.58433 pm' author 'sebastiansastre' ancestors ((name 'Flow-Pharo-Core-jupiter.2' message '0.2.11 refactor' id 'e2df82e5-3057-4d11-8190-428df043e3ff' date '28 February 2015' time '9:20:04.74562 am' author 'jupiter' ancestors ((name 'Flow-Pharo-Core-jupiter.1' message '0.2.11 refactor' id '21a49484-30d7-40db-97d3-bccd6a312523' date '27 February 2015' time '10:18:06.525043 pm' author 'jupiter' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Core.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/FlowPharoTests.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Pharo-Tests.package/FlowPharoTests.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/FlowPharoTests.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | } } 6 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/FlowPharoTests.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Pharo-Tests", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FlowPharoTests", 11 | "pools" : [ 12 | ], 13 | "super" : "TestCase", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Pharo-Tests'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Pharo-Tests.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Pharo-Tests') -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-Pharo-Tests-sebastiansastre.3' message 'empty log message' id '70a2a843-dde9-4cab-aa43-613f16447d20' date '9 March 2015' time '5:19:54.34079 pm' author 'sebastiansastre' ancestors ((name 'Flow-Pharo-Tests-sebastiansastre.2' message 'empty log message' id 'dd5eda5c-80e8-4e6a-9a33-27f2d657bd50' date '9 March 2015' time '4:02:34.766924 pm' author 'sebastiansastre' ancestors ((name 'Flow-Pharo-Tests-jupiter.1' message '0.2.11 refactor' id '47b6b533-fe2c-45ed-90c0-f701e4e402c9' date '28 February 2015' time '9:20:28.705988 am' author 'jupiter' ancestors () stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-Pharo-Tests.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/README.md -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/apiUrl.st: -------------------------------------------------------------------------------- 1 | accessing 2 | apiUrl 3 | 4 | ^ 'http://localhost:', (ConfigurationFiles at: #API at: #port) asString ,'/api/1.0' -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/databaseName.st: -------------------------------------------------------------------------------- 1 | accessing 2 | databaseName 3 | 4 | ^ 'AppTests' -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/do..st: -------------------------------------------------------------------------------- 1 | actions 2 | do: aBlock 3 | "Evaluates aBlock in the context of the Cowlinq-Test mongo database 4 | so things saved/changed are only affecting that db" 5 | 6 | ^ FWRESTAPIv10Command databaseDo: aBlock -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/setUp.st: -------------------------------------------------------------------------------- 1 | actions 2 | setUp 3 | super setUp. 4 | 5 | FWRESTAPIv10Command repository: (MaplessMongoRepository onDatabaseName: self databaseName) -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/tearDown.st: -------------------------------------------------------------------------------- 1 | actions 2 | tearDown 3 | super tearDown. 4 | 5 | FWRESTAPIv10Command reset. 6 | 7 | 8 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testCreate.st: -------------------------------------------------------------------------------- 1 | tests 2 | testCreate 3 | 4 | | anId aThing apiResponse json | 5 | 6 | anId := UUID new asString36. 7 | self do:[ 8 | aThing := Thing new id: anId; something: 'this'; has: 355.25; yourself. 9 | 10 | 11 | self assert: (Thing findId: aThing id) isNil. 12 | 13 | apiResponse := ZnEasy 14 | post: self apiUrl,'/things' 15 | data: (ZnStringEntity text: aThing asJSONString). 16 | 17 | self assert: apiResponse isCreated. 18 | 19 | self assert: (Thing findId: anId) notNil. 20 | self assert: (Thing findId: anId) id = anId. 21 | self assert: (Thing findId: anId) something = 'this'. 22 | self assert: (Thing findId: anId) has = 355.25. 23 | 24 | apiResponse := ZnEasy 25 | post: self apiUrl,'/things' 26 | data: (ZnStringEntity text: aThing asJSONString). 27 | 28 | self assert: apiResponse code = 409. 29 | json := Json readFrom: apiResponse contents readStream. 30 | self assert: json message = 'Id already in use'. 31 | self assert: json id = aThing id. 32 | self assert: json modelClass = 'Thing'. 33 | ] -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testDelete.st: -------------------------------------------------------------------------------- 1 | tests 2 | testDelete 3 | 4 | | anId aThing apiResponse | 5 | 6 | self do: [ 7 | anId := UUID new asString36. 8 | aThing := Thing new id: anId; prospect: 'guy'; offer: 355.25; yourself. 9 | 10 | 11 | self assert: (Thing findId: aThing id) isNil. 12 | aThing insert. 13 | self assert: (Thing findId: aThing id) notNil. 14 | self assert: (Thing findId: aThing id) offer = 355.25. 15 | 16 | apiResponse := ZnEasy delete: self apiUrl,'/things/', aThing id. 17 | 18 | self deny: (Thing findId: anId) notNil. 19 | self assert: (Thing findId: anId) isNil. 20 | ] -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testGetAll.st: -------------------------------------------------------------------------------- 1 | tests 2 | testGetAll 3 | 4 | | anId registeredOnes apiResponse answeredOnes | 5 | 6 | self do:[ 7 | anId := UUID new asString36. 8 | 9 | 10 | registeredOnes := Thing findAll. 11 | 12 | apiResponse := ZnEasy get: self apiUrl,'/things'. 13 | 14 | answeredOnes := Mapless fromJSONString: apiResponse contents. 15 | 16 | answeredOnes do:[ :answeredOne | 17 | self assert: (registeredOnes anySatisfy:[ :registeredOne | answeredOne = registeredOne ])] 18 | ] 19 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testGetOne.st: -------------------------------------------------------------------------------- 1 | tests 2 | testGetOne 3 | 4 | | anId registeredOne apiResponse answeredOne | 5 | 6 | self do:[ 7 | anId := UUID new asString36. 8 | registeredOne := Thing new id: anId; location: 'north!'; yourself. 9 | 10 | 11 | self assert: (Thing findId: registeredOne id) isNil. 12 | 13 | 14 | registeredOne insert. 15 | self assert: (Thing findId: anId) notNil. 16 | self assert: (Thing findId: anId) id = anId. 17 | self assert: (Thing findId: anId) location = 'north!'. 18 | 19 | 20 | apiResponse := ZnEasy get: self apiUrl,'/things/',anId. 21 | 22 | answeredOne := Mapless fromJSONString: apiResponse contents. 23 | 24 | self assert: answeredOne notNil. 25 | self assert: answeredOne class = Thing. 26 | self assert: answeredOne id = anId. 27 | self assert: answeredOne location = 'north!'. 28 | 29 | apiResponse := ZnEasy get: self apiUrl,'/things/', UUID new asString36. 30 | 31 | self assert: apiResponse code = 404] 32 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testGetSome.st: -------------------------------------------------------------------------------- 1 | tests 2 | testGetSome 3 | 4 | | anId registeredOnes apiResponse answeredOnes | 5 | 6 | self do:[ 7 | anId := UUID new asString36. 8 | 9 | registeredOnes := Thing findAll]. 10 | 11 | apiResponse := ZnEasy 12 | post: self apiUrl,'/things/query' 13 | data: (ZnStringEntity text: '{"production": "quite a lot"}'). 14 | 15 | answeredOnes := Mapless fromJSONString: apiResponse contents. 16 | 17 | answeredOnes do:[ :answeredOne | 18 | self assert: (registeredOnes anySatisfy:[ :registeredOne | answeredOne = registeredOne ])] 19 | 20 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testGetUnexisting.st: -------------------------------------------------------------------------------- 1 | tests 2 | testGetUnexisting 3 | 4 | | anId apiResponse | 5 | 6 | anId := UUID new asString36. 7 | 8 | self do:[ 9 | self assert: (Thing findId: anId) isNil]. 10 | 11 | apiResponse := ZnEasy get: self apiUrl,'/things/',anId. 12 | 13 | self assert: apiResponse code = 404. 14 | self assert: (('*',anId,'*') match: apiResponse contents). 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/instance/testUpdate.st: -------------------------------------------------------------------------------- 1 | tests 2 | testUpdate 3 | 4 | | anId registeredThing apiResponse | 5 | 6 | self do:[ 7 | anId := UUID new asString36. 8 | registeredThing := Thing new id: anId; production: 'a bunch'; memes: 'very good ones'; yourself. 9 | 10 | 11 | self assert: (Thing findId: registeredThing id) isNil. 12 | registeredThing insert. 13 | self assert: (Thing findId: registeredThing id) notNil. 14 | self assert: (Thing findId: registeredThing id) production = 'a bunch'. 15 | 16 | registeredThing production: 'quite a lot'. 17 | 18 | apiResponse := ZnEasy 19 | put: self apiUrl,'/things' 20 | data: (ZnStringEntity text: registeredThing asJSONString). 21 | 22 | self assert: (Thing findId: registeredThing id) notNil. 23 | self assert: (Thing findId: registeredThing id) production = 'quite a lot']. 24 | 25 | 26 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "apiUrl" : "sebastiansastre 3/9/2015 17:18", 6 | "databaseName" : "sebastiansastre 7/6/2014 20:58", 7 | "do:" : "sebastiansastre 7/7/2014 09:34", 8 | "setUp" : "FV 1/30/2015 13:14", 9 | "tearDown" : "sebastiansastre 7/7/2014 09:34", 10 | "testCreate" : "FV 1/30/2015 13:28", 11 | "testDelete" : "FV 1/30/2015 13:40", 12 | "testGetAll" : "FV 1/30/2015 13:40", 13 | "testGetOne" : "FV 1/30/2015 13:42", 14 | "testGetSome" : "FV 1/30/2015 13:42", 15 | "testGetUnexisting" : "sebastiansastre 7/11/2014 23:33", 16 | "testStuff" : "FV 1/30/2015 13:45", 17 | "testUpdate" : "FV 1/30/2015 13:45" } } 18 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/FlowRESTAPIv10Test.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "Flow-Tests", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | ], 10 | "name" : "FlowRESTAPIv10Test", 11 | "pools" : [ 12 | ], 13 | "super" : "TestCase", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'Flow-Tests'! 2 | -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/Flow-Tests.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'Flow-Tests') -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'Flow-Tests-sebastiansastre.4' message 'empty log message' id '7ff1d69d-c73c-4637-a1e6-66784d7c88b9' date '9 March 2015' time '5:19:59.716186 pm' author 'sebastiansastre' ancestors ((name 'Flow-Tests-sebastiansastre.3' message 'empty log message' id '3f915fb1-dde2-4397-b673-19cf694e8016' date '9 March 2015' time '5:18:31.562211 pm' author 'sebastiansastre' ancestors ((name 'Flow-Tests-sebastiansastre.2' message 'empty log message' id '86d79079-ca99-42c1-8c4c-5c12a1e78b54' date '9 March 2015' time '4:02:50.541637 pm' author 'sebastiansastre' ancestors ((name 'Flow-Tests-jupiter.1' message '0.2.11 refactor' id '4e6afc6c-e0a5-4b89-b877-a22269a9fc73' date '28 February 2015' time '9:20:53.219256 am' author 'jupiter' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/Flow-Tests.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "noMethodMetaData" : true, 3 | "separateMethodMetaAndSource" : false, 4 | "useCypressPropertiesFile" : true } 5 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/MTAClient.package/MTAEmail.class/README.md -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/addTo..st: -------------------------------------------------------------------------------- 1 | actions 2 | addTo: aString 3 | 4 | ^ self to add: aString -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/bcc.st: -------------------------------------------------------------------------------- 1 | accessing 2 | bcc 3 | 4 | ^ bcc ifNil:[bcc := OrderedCollection new] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/body..st: -------------------------------------------------------------------------------- 1 | accessing 2 | body: aString 3 | 4 | body := aString -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/body.st: -------------------------------------------------------------------------------- 1 | accessing 2 | body 3 | 4 | ^ body -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/cc.st: -------------------------------------------------------------------------------- 1 | accessing 2 | cc 3 | 4 | ^ cc ifNil:[cc := OrderedCollection new] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/encodedSubject.st: -------------------------------------------------------------------------------- 1 | accessing 2 | encodedSubject 3 | "Answers the subject of the email encoded (so it can support diacritics). 4 | Ref: solved to satisfy most email clients (including the infamous MS Outlook) 5 | http://stackoverflow.com/questions/7518024/php-email-sent-with-issues-on-subject-chars-in-outlook-only" 6 | 7 | ^ self folded: self subject toUtf8 base64Encoded -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/encodingHeader.st: -------------------------------------------------------------------------------- 1 | accessing 2 | encodingHeader 3 | "Answers the 'header' of each 'encoded-word' in the context of RFC 2047. 4 | 5 | From: http://www.faqs.org/rfcs/rfc2047.html section 8 (examples) 6 | ...is necessary because each 7 | 'encoded-word' must be self-contained..." 8 | 9 | ^ '=?utf-8?B?' -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/folded..st: -------------------------------------------------------------------------------- 1 | accessing 2 | folded: anEncodedString 3 | "Answers the subject in multiline in no more than 80 characters long lines. 4 | preceeded by =? and followed by ?=" 5 | 6 | ^ (String streamContents:[:stream| 7 | anEncodedString lines do:[:part| 8 | stream 9 | nextPutAll: self encodingHeader; 10 | nextPutAll: part; 11 | nextPutAll: '?='; 12 | cr;lf;space]]) 13 | 14 | 15 | "Peixe Urbano sample: 16 | Depila√ß√£o a Cera (R$ 9,90) | Modelagem de Sobrancelha | Bombinhas: 7 Di√°rias p/2 17 | 18 | ^ String streamContents:[:stream| 19 | stream 20 | nextPutAll: '=?utf-8?B?RGVwaWxhw6fDo28gYSBDZXJhIChSJCA5LDkwKSB8IE1vZGVs?= 21 | =?utf-8?B?YWdlbSBkZSBTb2JyYW5jZWxoYSB8IEJvbWJpbmhhczogNyBEacOhcmlh?= 22 | =?utf-8?B?cyBwLzI=?='; 23 | cr;lf]" 24 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/from..st: -------------------------------------------------------------------------------- 1 | accessing 2 | from: aString 3 | 4 | from := aString -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/from.st: -------------------------------------------------------------------------------- 1 | accessing 2 | from 3 | 4 | ^ from -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/headerAt.put..st: -------------------------------------------------------------------------------- 1 | actions 2 | headerAt: aKeyString put: aValueString 3 | ^ self headers at: aKeyString put: aValueString -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/headers.st: -------------------------------------------------------------------------------- 1 | accessing 2 | headers 3 | ^ headers ifNil:[headers := Dictionary new] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/initialize.st: -------------------------------------------------------------------------------- 1 | accessing 2 | initialize 3 | 4 | super initialize. 5 | 6 | self 7 | headerAt: 'Date' put: (GRPrinter rfc822 print: DateAndTime now); 8 | headerAt: 'MIME-Version' put: '1.0'; 9 | yourself -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/recipients.st: -------------------------------------------------------------------------------- 1 | accessing 2 | recipients 3 | ^ self to , self cc , self bcc collect: [ :each | each asString ] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/subject..st: -------------------------------------------------------------------------------- 1 | accessing 2 | subject: aString 3 | 4 | subject := aString -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/subject.st: -------------------------------------------------------------------------------- 1 | accessing 2 | subject 3 | 4 | ^ subject -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/to..st: -------------------------------------------------------------------------------- 1 | accessing 2 | to: aString 3 | 4 | to := aString -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/instance/to.st: -------------------------------------------------------------------------------- 1 | accessing 2 | to 3 | 4 | ^ to ifNil:[to := OrderedCollection new] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTAEmail.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "MTAClient", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | "from", 10 | "to", 11 | "subject", 12 | "body" ], 13 | "name" : "MTAEmail", 14 | "pools" : [ 15 | ], 16 | "super" : "Object", 17 | "type" : "normal" } 18 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/MTAClient.package/MTASMTPClient.class/README.md -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/accounts.st: -------------------------------------------------------------------------------- 1 | accessing 2 | accounts 3 | 4 | ^ self queues keys 5 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/basicSendOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | basicSendOn: anAccount 3 | 4 | | queue firstEmail | 5 | 6 | queue := self queues at: anAccount. 7 | 8 | firstEmail := queue first. 9 | 10 | self client 11 | mailFrom: firstEmail from 12 | to: firstEmail recipients 13 | text: firstEmail plainMessage. 14 | 15 | queue removeFirst 16 | 17 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/beBusy.st: -------------------------------------------------------------------------------- 1 | actions 2 | beBusy 3 | 4 | isBusy := true -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/beIdle.st: -------------------------------------------------------------------------------- 1 | actions 2 | beIdle 3 | 4 | isBusy := false -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/client.st: -------------------------------------------------------------------------------- 1 | accessing 2 | client 3 | 4 | ^ client ifNil:[client := SMTPClient new] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/initializeClient.st: -------------------------------------------------------------------------------- 1 | accessing 2 | initializeClient 3 | 4 | ^ client := self makeClient -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/initializeIsBusy.st: -------------------------------------------------------------------------------- 1 | testing 2 | initializeIsBusy 3 | 4 | ^ isBusy := false -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/initializeQueues.st: -------------------------------------------------------------------------------- 1 | initialization 2 | initializeQueues 3 | 4 | ^ queues := Dictionary new -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/isBusy.st: -------------------------------------------------------------------------------- 1 | testing 2 | isBusy 3 | 4 | ^ isBusy ifNil:[isBusy := false] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/isEmpty.st: -------------------------------------------------------------------------------- 1 | testing 2 | isEmpty 3 | 4 | ^ self queues values allSatisfy:[:queue| queue isEmpty] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/isIdle.st: -------------------------------------------------------------------------------- 1 | testing 2 | isIdle 3 | 4 | ^ self isBusy not -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/makeClient.st: -------------------------------------------------------------------------------- 1 | actions 2 | makeClient 3 | 4 | ^ SMTPClient new -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/makeEmailTo.from.subject.body..st: -------------------------------------------------------------------------------- 1 | actions 2 | makeEmailTo: aReceiverAddress from: aSenderAddress subject: aSubjectString body: aMessageString 3 | 4 | ^ MTAEmail new 5 | addTo: aReceiverAddress; 6 | from: aSenderAddress; 7 | subject: aSubjectString; 8 | body: aMessageString; 9 | yourself -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/notEmpty.st: -------------------------------------------------------------------------------- 1 | testing 2 | notEmpty 3 | 4 | ^ self queues keys allSatisfy:[:account| 5 | self notEmptyOn: account] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/notEmptyOn..st: -------------------------------------------------------------------------------- 1 | testing 2 | notEmptyOn: anAccount 3 | 4 | ^ (self queues 5 | at: anAccount 6 | ifAbsent:[#()]) notEmpty -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/openSMTPOn..st: -------------------------------------------------------------------------------- 1 | actions 2 | openSMTPOn: anAccount 3 | | conf anyone | 4 | conf := (ConfigurationFiles at: 'MTA' at: 'applications') at: anAccount. 5 | self client 6 | host: (SpIPAddress ipAddressForHostName: (conf at: #'hostname') timeout: 20); 7 | user: (conf at: #'username'); 8 | password: (conf at: #'password'); 9 | port: (conf at: #'port'); 10 | close; 11 | reopen -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/queues.st: -------------------------------------------------------------------------------- 1 | accessing 2 | queues 3 | 4 | ^ queues ifNil:[queues := Dictionary new] -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/reset.st: -------------------------------------------------------------------------------- 1 | actions 2 | reset 3 | 4 | self beIdle. 5 | 6 | client := nil. 7 | queues := nil -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/send.on..st: -------------------------------------------------------------------------------- 1 | actions 2 | send: anEmail on: anAccountName 3 | "Sends anEmail using the configurations found at anAccountName." 4 | 5 | (self queues 6 | at: anAccountName 7 | ifAbsentPut:[OrderedCollection new]) addLast: anEmail -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/sendEmails.st: -------------------------------------------------------------------------------- 1 | actions 2 | sendEmails 3 | 4 | self isIdle ifTrue:[ 5 | self beBusy. 6 | [self accounts do:[:account| 7 | (self notEmptyOn: account) ifTrue:[ 8 | [self openSMTPOn: account. 9 | self basicSendOn: account] ensure:[ 10 | self client stream ifNotNil:[ 11 | self client quit; close]]]]] ensure: [ 12 | self beIdle]]. -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/sendTo.from.subject.body..st: -------------------------------------------------------------------------------- 1 | actions 2 | sendTo: aReceiverAddress from: aSenderAddress subject: aSubjectString body: aMessageString 3 | 4 | ^ self sendTo: aReceiverAddress from: aSenderAddress subject: aSubjectString body: aMessageString on: 'default' 5 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/sendTo.from.subject.body.on..st: -------------------------------------------------------------------------------- 1 | actions 2 | sendTo: aReceiverAddress from: aSenderAddress subject: aSubjectString body: aMessageString on: anAccountName 3 | 4 | ^ self 5 | send: (self 6 | makeEmailTo: aReceiverAddress 7 | from: aSenderAddress 8 | subject: aSubjectString 9 | body: aMessageString) 10 | on: anAccountName 11 | 12 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/instance/timerTick.st: -------------------------------------------------------------------------------- 1 | actions 2 | timerTick 3 | 4 | [self sendEmails] on: Error do:[:x| ]. -------------------------------------------------------------------------------- /backend/src/MTAClient.package/MTASMTPClient.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "MTAClient", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | "client", 10 | "queues", 11 | "isBusy" ], 12 | "name" : "MTASMTPClient", 13 | "pools" : [ 14 | ], 15 | "super" : "Object", 16 | "type" : "normal" } 17 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'MTAClient'! 2 | -------------------------------------------------------------------------------- /backend/src/MTAClient.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/backend/src/MTAClient.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /backend/src/MTAClient.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'MTAClient') -------------------------------------------------------------------------------- /backend/src/MTAClient.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'MTAClient-jupiter.4' message 'GemStonePlatform WIP' id '9dd5f722-83a0-48e4-bffb-5f5943f3042c' date '03/01/2015' time '13:36:29' author 'jupiter' ancestors ((name 'MTAClient-sebastiansastre.3' message 'empty log message' id 'cf2eefbd-315d-4b04-839d-07f890d591f7' date '09/07/2014' time '11:54:47' author 'sebastiansastre' ancestors ((name 'MTAClient-sebastiansastre.2' message 'empty log message' id '904f374c-ae27-45d9-8183-670ec40c549e' date '06/27/2014' time '02:46:04' author 'sebastiansastre' ancestors ((name 'MTAClient-sebastiansastre.1' message 'refactored out of Flow first upload' id 'b80d49f4-483a-4945-8793-bfcabed9a6d7' date '10/24/2013' time '05:50:52' author 'sebastiansastre' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /backend/src/MTAClient.package/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /cleanBuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts a complete build. 4 | # Frontend and backend will be deleted and rebuilt. 5 | 6 | ./cleanBuildFrontend 7 | ./cleanBuildBackend 8 | -------------------------------------------------------------------------------- /cleanBuildBackend: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Removes old backend build (if any) and builds a fresh one 3 | 4 | echo "Building backend..." 5 | cd $PWD/backend 6 | ./build 7 | cd .. 8 | 9 | echo 10 | echo "Enjoy your fresh backend!" 11 | echo -------------------------------------------------------------------------------- /cleanBuildFrontend: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Removes old frontend build (if any) and builds a fresh one 3 | 4 | echo "Removing old frontend components and modules..." 5 | rm -rf frontend/bower_components 6 | rm -rf frontend/node_modules 7 | rm -rf frontend/src/*.js 8 | rm -rf frontend/the.js 9 | 10 | 11 | echo "Building frontend..." 12 | cd $PWD/frontend 13 | ./build 14 | cd .. 15 | 16 | echo 17 | echo "Enjoy your fresh frontend!" 18 | echo -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /bower_components/ 3 | 4 | /test_runner.js 5 | 6 | -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | *flow* 2 | ==== 3 | [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/flow-stack/flow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | 5 | A living full-stack framework for the web. 6 | 7 | Please refer to: 8 | [https://github.com/flow-stack/flow](https://github.com/flow-stack/flow) 9 | 10 | ____ 11 | 12 | MIT - License -------------------------------------------------------------------------------- /frontend/bootstrap.amd.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "bootstrap": "dist/js/bootstrap", 4 | "bootstrap-css": "dist/css/bootstrap" 5 | }, 6 | "shim": { 7 | "bootstrap": {"deps": ["jquery", "css!bootstrap-css"]} 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /frontend/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flow", 3 | "description": "A living full-stack framework for the web.", 4 | "version": "0.2.13", 5 | "ignore": [ 6 | "**/.*", 7 | "node_modules", 8 | "bower_components", 9 | "/test_runner.js", 10 | "test", 11 | "tests" 12 | ], 13 | "authors": [ 14 | { 15 | "name": "Sebastian Sastre", 16 | "email": "sebastian@flowingconcept.com" 17 | } 18 | ], 19 | "homepage": "", 20 | "keywords": [ 21 | "Amber", 22 | "Pharo", 23 | "Smalltalk", 24 | "MVC", 25 | "full-stack", 26 | "frontend", 27 | "backend" 28 | ], 29 | "license": [ 30 | "MIT" 31 | ], 32 | "private": false, 33 | "dependencies": { 34 | "amber": "^0.14.10", 35 | "text": "requirejs/text#~2.0.12", 36 | "bootstrap": "^3.3.0", 37 | "typeahead.js": "^0.10.5", 38 | "amber-flow": "^0.3.30" 39 | }, 40 | "devDependencies": { 41 | "amber-minimal-ide": "^0.1.1", 42 | "helios": "^0.4.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /frontend/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Installs components and modules for the frontend 3 | 4 | bower install 5 | npm install 6 | amber config 7 | grunt 8 | grunt devel -------------------------------------------------------------------------------- /frontend/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #333; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /frontend/custom/resources/off.amber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/custom/resources/off.amber.png -------------------------------------------------------------------------------- /frontend/custom/resources/offHover.amber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/custom/resources/offHover.amber.png -------------------------------------------------------------------------------- /frontend/custom/resources/sprite.amber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/custom/resources/sprite.amber.png -------------------------------------------------------------------------------- /frontend/custom/resources/tinylogo.amber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/custom/resources/tinylogo.amber.png -------------------------------------------------------------------------------- /frontend/custom/rivets/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rivets", 3 | "version": "0.6.10", 4 | "homepage": "http://rivetsjs.com", 5 | "authors": [ 6 | "Michael Richards" 7 | ], 8 | "description": "Declarative data binding + templating solution.", 9 | "main": "dist/rivets.js", 10 | "keywords": [ 11 | "data binding", 12 | "templating" 13 | ], 14 | "license": "MIT", 15 | "ignore": [ 16 | "node_modules", 17 | "bower_components", 18 | "spec" 19 | ], 20 | "_release": "0.6.10", 21 | "_resolution": { 22 | "type": "version", 23 | "tag": "v0.6.10", 24 | "commit": "77fa737c1a6fc5c68464efe8e4a064fb5504745e" 25 | }, 26 | "_source": "git://github.com/mikeric/rivets.git", 27 | "_target": "~0.6.9", 28 | "_originalSource": "rivets" 29 | } -------------------------------------------------------------------------------- /frontend/custom/rivets/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | node_modules/**/* 4 | -------------------------------------------------------------------------------- /frontend/custom/rivets/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rivets", 3 | "version": "0.6.10", 4 | "homepage": "http://rivetsjs.com", 5 | "authors": [ 6 | "Michael Richards" 7 | ], 8 | "description": "Declarative data binding + templating solution.", 9 | "main": "dist/rivets.js", 10 | "keywords": [ 11 | "data binding", 12 | "templating" 13 | ], 14 | "license": "MIT", 15 | "ignore": [ 16 | "node_modules", 17 | "bower_components", 18 | "spec" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /frontend/custom/rivets/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rivets", 3 | "repo": "mikeric/rivets", 4 | "description": "Declarative data binding + templating solution.", 5 | "version": "0.6.10", 6 | "keywords": ["data binding", "templating"], 7 | "scripts": ["dist/rivets.js"], 8 | "main": "dist/rivets.js", 9 | "license": "MIT" 10 | } 11 | -------------------------------------------------------------------------------- /frontend/custom/rivets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rivets", 3 | "description": "Declarative data binding + templating solution.", 4 | "version": "0.6.10", 5 | "author": "Michael Richards", 6 | "url": "http://rivetsjs.com", 7 | "main": "./dist/rivets.js", 8 | "licenses": [ 9 | { 10 | "type": "MIT", 11 | "url": "https://github.com/mikeric/rivets/blob/master/LICENSE" 12 | } 13 | ], 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/mikeric/rivets.git" 17 | }, 18 | "devDependencies": { 19 | "mocha": "~1.20.1", 20 | "should": "~4.0.4", 21 | "sinon": "~1.10.2", 22 | "gulp": "~3.6.2", 23 | "gulp-util": "~2.2.14", 24 | "gulp-coffee": "~1.4.3", 25 | "gulp-header": "~1.0.2", 26 | "gulp-concat": "~2.2.0", 27 | "gulp-uglify": "~0.3.0", 28 | "gulp-mocha-phantomjs": "~0.2.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /frontend/deploy.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'amber/deploy', 3 | // --- packages to be deployed begin here --- 4 | 'amber-contrib-web/Web', 5 | 6 | 'text', 7 | 'sightglass', 8 | 'rlite', 9 | 'rivets', 10 | 11 | 'domevents/DOMEvents', 12 | 13 | 'minimapless/MiniMapless', 14 | 15 | 'amber-mvc/MVC-Core', 16 | 17 | 'amber-flow/Flow-Core', 18 | 'amber-flow/Flow-API', 19 | 'flow-app/App' 20 | // --- packages to be deployed end here --- 21 | ], function (amber) { 22 | return amber; 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/devel.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'amber/devel', 3 | './deploy', 4 | // --- packages used only during development begin here --- 5 | 'amber-minimal-ide/MinimalIDE', 6 | 7 | 'domevents/DOMEvents-Tests', 8 | 'minimapless/MiniMapless-Tests', 9 | 'amber-flow/Flow-Scaffolding', 10 | 'amber-flow/Flow-Tests', 11 | 'flow-app/App-Tests' 12 | // --- packages used only during development end here --- 13 | ], function (amber) { 14 | return amber; 15 | }); 16 | -------------------------------------------------------------------------------- /frontend/img/loaderBar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/img/loaderBar.gif -------------------------------------------------------------------------------- /frontend/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/img/spinner.gif -------------------------------------------------------------------------------- /frontend/img/tinylogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flow-stack/flow/f78b1135c64b9959058f7b5f5b2bb0addf93ef10/frontend/img/tinylogo.png -------------------------------------------------------------------------------- /frontend/local.amd.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "flow-app": "src" 4 | }, 5 | "shim": { 6 | "flow-app/App" : { "deps": [ "bootstrap"] } 7 | } 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /frontend/publishCss: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Builds the CSS output of this flow app. 3 | 4 | # Actually just copies the CSS from frontend/css/ to public/css/ 5 | 6 | echo "deleting public/css/" 7 | rm -r ../public/css 8 | mkdir -p ../public/css && cp -R css/ ../public/css 9 | 10 | -------------------------------------------------------------------------------- /frontend/publishImg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Builds the images output of this flow app. 3 | 4 | # Actually just copies the images from frontend/img/ to public/img/ 5 | 6 | echo "deleting public/img/" 7 | rm -r ../public/img 8 | mkdir -p ../public/img && cp -R img/ ../public/img 9 | -------------------------------------------------------------------------------- /frontend/publishIndex: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Builds the images output of this flow app. 3 | 4 | echo "deleting public/index.html and publishing the fresh one for production" 5 | rm -rf ../public/index.html 6 | cp production.index.html ../public/index.html 7 | -------------------------------------------------------------------------------- /frontend/publishJs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Builds the javascript output of this flow app. 3 | 4 | # Takes the sources at frontend/src/ and tells require to minify and write public/js/app.js 5 | 6 | echo "deleting public/js/" 7 | rm -r ../public/js 8 | # mkdir -p ../public/js && r.js -o dist.conf.js 9 | #mkdir -p ../public/js && r.js -o deploy.js 10 | 11 | mkdir -p ../public/js && grunt deploy && cp the.js ../public/js -------------------------------------------------------------------------------- /frontend/publishViews: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Builds the templates output of this flow app. 3 | 4 | # Actually just copies the views from frontend/views/ to public/views/ 5 | 6 | echo "deleting public/views/" 7 | rm -r ../public/views 8 | mkdir -p ../public/views && cp -R views/ ../public/views 9 | -------------------------------------------------------------------------------- /frontend/src/App-Tests.st: -------------------------------------------------------------------------------- 1 | Smalltalk createPackage: 'App-Tests'! 2 | TestCase subclass: #AppTest 3 | instanceVariableNames: '' 4 | package: 'App-Tests'! 5 | !AppTest commentStamp! 6 | Nicely tested App!!! 7 | 8 | -------------------------------------------------------------------------------- /frontend/text.amd.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "text": "text" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /frontend/views/Example.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

Flow is loaded and working

4 | 5 |
-------------------------------------------------------------------------------- /frontend/views/Item.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | { thing.@data.name } 4 | { thing.@data.name } index: {index} 5 |
-------------------------------------------------------------------------------- /frontend/views/Items.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /frontend/views/ThingDetails.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

{model.name}

4 |
-------------------------------------------------------------------------------- /frontend/views/ThingRow.html: -------------------------------------------------------------------------------- 1 |
  • 2 | 3 | {model.name} 4 | 5 |
    10 | View details 13 | Remove 16 |
    17 |
  • -------------------------------------------------------------------------------- /frontend/views/ThingViewEditorRow.html: -------------------------------------------------------------------------------- 1 |
  • 2 | 3 | 7 | 8 | 15 | 16 | Okay 20 |
    25 | Edit 28 | Remove 31 |
    32 |
  • -------------------------------------------------------------------------------- /makeFrontend: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Creates a clean build of the frontend 3 | # Deletes and copies into bower_components the hacked version of rivets so 4 | # we have onViewCreated for IteratedController 5 | # This is most useful in automated deployments 6 | 7 | ./cleanBuildFrontend 8 | rm -rf frontend/bower_components/rivets 9 | cp -rf frontend/custom/rivets frontend/bower_components 10 | -------------------------------------------------------------------------------- /setPermissions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | 4 | chmod u+x backend/pharo 5 | chmod u+x backend/pharo-ui 6 | chmod u+x backend/pharo-vm/pharo 7 | chmod u+x makeFrontend 8 | chmod u+x cleanBuild 9 | chmod u+x cleanBuildFrontend 10 | chmod u+x cleanBuildBackend 11 | chmod u+x backend/build 12 | chmod u+x frontend/build -------------------------------------------------------------------------------- /startAll: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts the services needed to have a developing session with a flow-based app 4 | # This is a friendly strategy method. 5 | # Detects the OS and delegates to the right set of scripts to actually do it. 6 | 7 | platform='unknown' 8 | unamestr=`uname` 9 | if [[ "$unamestr" == Darwin ]]; then 10 | .hood/platform/osx/startAll 11 | exit 0 12 | elif [[ "$unamestr" == Linux* ]]; then 13 | .hood/platform/linux/startAll 14 | exit 0 15 | elif [[ "$unamestr" == MINGW* ]]; then 16 | .hood/platform/windows/startAll 17 | exit 0 18 | fi 19 | 20 | echo "Oh noes! it seems you're using an unsupported platform :(" 21 | echo "The prefered platforms are OS X and Linux. It might work in Windows too." 22 | exit 0 23 | -------------------------------------------------------------------------------- /tests/travisCI.st: -------------------------------------------------------------------------------- 1 | "Load and run tests to be performed by TravisCI" 2 | | gitPath | 3 | Transcript cr; show: 'travis---->travisCI.st'. 4 | gitPath := (FileDirectory default directoryNamed: 'git_cache') fullName. 5 | 6 | Gofer new 7 | package: 'GsUpgrader-Core'; 8 | url: 'http://ss3.gemtalksystems.com/ss/gsUpgrader'; 9 | load. 10 | 11 | (Smalltalk at: #GsUpgrader) upgradeGrease. 12 | 13 | GsDeployer deploy: [ 14 | "Load Flow... " 15 | Metacello new 16 | baseline: 'Flow'; 17 | repository: 'filetree://', gitPath, '/flow/backend/repository'; 18 | load: #('CI') 19 | ]. 20 | 21 | false ifTrue: [ 22 | "Run all tests in image" 23 | TravisCISuiteHarness 24 | value: TestCase suite 25 | value: 'TravisCISuccess.txt' 26 | value: 'TravisCIFailure.txt'. 27 | ] ifFalse: [ 28 | "Run the Mapless tests" 29 | TravisCIHarness 30 | value: #( 'BaselineOfFlow' ) 31 | value: 'TravisCISuccess.txt' 32 | value: 'TravisCIFailure.txt'. 33 | ]. 34 | --------------------------------------------------------------------------------