├── .editorconfig
├── .env.sample
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .storybook
├── addons.js
├── tsconfig.json
└── webpack.config.js
├── .vscode
├── extensions.json
└── settings.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── angular.json
├── apps
├── .gitkeep
├── api
│ ├── e2e
│ │ ├── jest-setup.ts
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── auth.e2e-spec.ts
│ │ │ └── test-bed.ts
│ │ └── tsconfig.json
│ ├── jest.config.js
│ ├── src
│ │ ├── app
│ │ │ ├── app.controller.ts
│ │ │ └── app.module.ts
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ └── main.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── cli
│ ├── jest.config.js
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── sm
│ │ ├── sm-help.ts
│ │ ├── sm-orient-download.ts
│ │ ├── sm-orient-start.ts
│ │ ├── sm-orient-switch.ts
│ │ ├── sm-stats.ts
│ │ ├── sm.ts
│ │ └── utils
│ │ │ ├── download.ts
│ │ │ ├── get-env.ts
│ │ │ ├── list-dirs.ts
│ │ │ ├── throw-error.ts
│ │ │ └── unpack.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── ui-pwa-e2e
│ ├── cypress.json
│ ├── src
│ │ ├── fixtures
│ │ │ └── example.json
│ │ ├── integration
│ │ │ └── update-dialog
│ │ │ │ └── update-dialog.component.spec.ts
│ │ ├── plugins
│ │ │ └── index.js
│ │ └── support
│ │ │ ├── commands.ts
│ │ │ └── index.ts
│ ├── tsconfig.e2e.json
│ ├── tsconfig.json
│ └── tslint.json
├── web-e2e
│ ├── cypress.json
│ ├── src
│ │ ├── fixtures
│ │ │ └── example.json
│ │ ├── integration
│ │ │ └── app.spec.ts
│ │ ├── plugins
│ │ │ └── index.js
│ │ └── support
│ │ │ ├── app.po.ts
│ │ │ ├── commands.ts
│ │ │ └── index.ts
│ ├── tsconfig.e2e.json
│ ├── tsconfig.json
│ └── tslint.json
└── web
│ ├── browserslist
│ ├── jest.config.js
│ ├── ngsw-config.json
│ ├── proxy.conf.json
│ ├── server.ts
│ ├── src
│ ├── _reset.scss
│ ├── _variables.scss
│ ├── app
│ │ ├── app.component.html
│ │ ├── app.component.scss
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ └── app.server.module.ts
│ ├── assets
│ │ ├── .gitkeep
│ │ ├── icons
│ │ │ ├── ICONS.md
│ │ │ ├── demo.html
│ │ │ ├── favicon.png
│ │ │ ├── icon-128x128.png
│ │ │ ├── icon-144x144.png
│ │ │ ├── icon-152x152.png
│ │ │ ├── icon-192x192-solid.png
│ │ │ ├── icon-192x192.png
│ │ │ ├── icon-384x384.png
│ │ │ ├── icon-512x512.png
│ │ │ ├── icon-72x72.png
│ │ │ ├── icon-96x96.png
│ │ │ └── icons.svg
│ │ ├── logo-hor-sub.png
│ │ ├── logo-hor-sub.svg
│ │ ├── logo-hor.svg
│ │ ├── logo-osd-hor.png
│ │ ├── logo-osd-hor.svg
│ │ ├── logo.png
│ │ ├── logo.svg
│ │ ├── logotyp.svg
│ │ ├── map-demo.png
│ │ ├── repository-open-graph-template.png
│ │ ├── sygnet.png
│ │ └── sygnet.svg
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── index.html
│ ├── main.server.ts
│ ├── main.ts
│ ├── manifest.webmanifest
│ ├── polyfills.ts
│ ├── robots.txt
│ ├── styles.scss
│ └── test-setup.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.server.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── docs
├── README.md
├── SlackMap - Neo4j Schema.graphml
├── development-local.md
├── gis.md
├── index.html
└── sidebar.md
├── jest.config.js
├── libs
├── .gitkeep
├── api
│ ├── auth
│ │ ├── README.md
│ │ ├── jest-setup.ts
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── dto.ts
│ │ │ ├── index.ts
│ │ │ ├── lib
│ │ │ │ ├── api-auth.config.ts
│ │ │ │ ├── api-auth.module.ts
│ │ │ │ ├── controllers
│ │ │ │ │ └── auth.controller.ts
│ │ │ │ ├── decorators
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── jwt-payload.decorator.ts
│ │ │ │ │ └── roles.decorator.ts
│ │ │ │ ├── dto
│ │ │ │ │ ├── auth-paths.ts
│ │ │ │ │ ├── auth-sign-up-by-facebook.dto.ts
│ │ │ │ │ ├── auth.dto.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── guards
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── jwt-auth.guard.ts
│ │ │ │ │ └── local-auth.guard.ts
│ │ │ │ ├── models
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── jwt-payload.model.ts
│ │ │ │ │ ├── me.model.ts
│ │ │ │ │ └── user.model.ts
│ │ │ │ ├── services
│ │ │ │ │ ├── auth.service.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── strategies
│ │ │ │ │ ├── jwt.strategy.ts
│ │ │ │ │ └── local.strategy.ts
│ │ │ │ └── usecases
│ │ │ │ │ ├── auth-me-get.usecase.spec.ts
│ │ │ │ │ ├── auth-me-get.usecase.ts
│ │ │ │ │ ├── auth-sign-in-by-facebook.usecase.spec.ts
│ │ │ │ │ ├── auth-sign-in-by-facebook.usecase.ts
│ │ │ │ │ ├── auth-sign-up-by-facebook.usecase.spec.ts
│ │ │ │ │ ├── auth-sign-up-by-facebook.usecase.ts
│ │ │ │ │ └── index.ts
│ │ │ └── testing
│ │ │ │ ├── api-auth-testing.module.ts
│ │ │ │ ├── fixtures
│ │ │ │ └── index.ts
│ │ │ │ └── index.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── clusters
│ │ ├── README.md
│ │ ├── jest-setup.ts
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── dto.ts
│ │ │ ├── index.ts
│ │ │ └── lib
│ │ │ │ ├── api-clusters.module.ts
│ │ │ │ ├── controllers
│ │ │ │ └── clusters.controller.ts
│ │ │ │ ├── dto
│ │ │ │ ├── clusters.dto.ts
│ │ │ │ └── index.ts
│ │ │ │ ├── models
│ │ │ │ ├── cluster.model.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── superclusters.model.ts
│ │ │ │ └── services
│ │ │ │ ├── clusters.service.spec.ts
│ │ │ │ ├── clusters.service.ts
│ │ │ │ └── index.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── common
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── api-common.module.ts
│ │ │ ├── config
│ │ │ │ ├── app.config.ts
│ │ │ │ ├── env.config.ts
│ │ │ │ └── index.ts
│ │ │ ├── errors
│ │ │ │ ├── errors.spec.ts
│ │ │ │ ├── errors.ts
│ │ │ │ └── index.ts
│ │ │ ├── filters
│ │ │ │ ├── __tests__
│ │ │ │ │ └── exception.filter.spec2.ts
│ │ │ │ ├── api-exception.filter.ts
│ │ │ │ └── index.ts
│ │ │ ├── index.ts
│ │ │ └── lib
│ │ │ │ ├── rxjs
│ │ │ │ ├── from-stream.ts
│ │ │ │ └── index.ts
│ │ │ │ └── syslog.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── config
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── dto.ts
│ │ │ ├── index.ts
│ │ │ └── lib
│ │ │ │ ├── api-config.module.ts
│ │ │ │ ├── controllers
│ │ │ │ └── config.controller.ts
│ │ │ │ ├── dto
│ │ │ │ ├── config.dto.ts
│ │ │ │ └── index.ts
│ │ │ │ ├── models
│ │ │ │ ├── api-config.model.ts
│ │ │ │ └── index.ts
│ │ │ │ └── usecases
│ │ │ │ ├── config-get.usecase.ts
│ │ │ │ └── index.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── db
│ │ ├── README.md
│ │ ├── jest-setup.ts
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── lib
│ │ │ │ ├── api-db.module.ts
│ │ │ │ ├── db-utils.ts
│ │ │ │ ├── location
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── location-path.entity.ts
│ │ │ │ └── user
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── user.entity.ts
│ │ │ │ │ ├── user.repository.spec.ts
│ │ │ │ │ └── user.repository.ts
│ │ │ └── testing
│ │ │ │ ├── db-testing.module.ts
│ │ │ │ ├── fixtures
│ │ │ │ ├── index.ts
│ │ │ │ ├── spot.fixture.ts
│ │ │ │ └── user.fixture.ts
│ │ │ │ └── index.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── facebook
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── dto.ts
│ │ │ ├── index.ts
│ │ │ ├── lib
│ │ │ │ ├── api-facebook.module.ts
│ │ │ │ ├── facebook.client.spec.ts
│ │ │ │ ├── facebook.client.ts
│ │ │ │ ├── facebook.config.ts
│ │ │ │ └── models
│ │ │ │ │ ├── facebook.model.ts
│ │ │ │ │ └── index.ts
│ │ │ └── testing
│ │ │ │ ├── facebook-client.mock.ts
│ │ │ │ ├── facebook.fixture.ts
│ │ │ │ └── index.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ └── spot
│ │ ├── data
│ │ ├── jest-setup.ts
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ └── lib
│ │ │ │ ├── api-spot-data.module.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── spot.entity.ts
│ │ │ │ ├── spot.repository.spec.ts
│ │ │ │ └── spot.repository.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ │ ├── domain
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ └── lib
│ │ │ │ ├── api-spot-domain.module.ts
│ │ │ │ └── controllers
│ │ │ │ ├── spot-save.controller.spec.ts
│ │ │ │ └── spot-save.controller.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ │ ├── dto
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ └── lib
│ │ │ │ ├── api-spot.dto.ts
│ │ │ │ └── api-spot.model.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ │ └── testing
│ │ ├── jest.config.js
│ │ ├── src
│ │ ├── index.ts
│ │ └── lib
│ │ │ ├── api-spot-testing.module.ts
│ │ │ ├── index.ts
│ │ │ └── spot.fixture.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
├── core
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── core.spec.ts
│ │ ├── index.ts
│ │ └── lib
│ │ │ ├── climbing.ts
│ │ │ ├── core-models.ts
│ │ │ ├── helpers.ts
│ │ │ ├── index.ts
│ │ │ ├── interfaces
│ │ │ ├── core.interface.ts
│ │ │ └── index.ts
│ │ │ ├── item-rid-old.spec.ts
│ │ │ ├── item-rid-old.ts
│ │ │ ├── item-rid.ts
│ │ │ ├── item-type-options.ts
│ │ │ ├── item-type.ts
│ │ │ ├── item-utils.spec.ts
│ │ │ ├── item-utils.ts
│ │ │ ├── item.spec.ts
│ │ │ ├── layer-options.ts
│ │ │ ├── like.ts
│ │ │ ├── measure.ts
│ │ │ ├── photo.ts
│ │ │ ├── rid-generator.spec.ts
│ │ │ ├── rid-generator.ts
│ │ │ ├── spot-access.ts
│ │ │ ├── spot-shape-type.ts
│ │ │ ├── spot-status.ts
│ │ │ └── sub-sink.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── gis
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ └── lib
│ │ │ └── geojson.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
└── ui
│ ├── add
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── +add
│ │ │ │ ├── add.actions.ts
│ │ │ │ ├── add.effects.ts
│ │ │ │ ├── add.facade.ts
│ │ │ │ ├── add.models.ts
│ │ │ │ ├── add.reducer.ts
│ │ │ │ ├── add.selectors.ts
│ │ │ │ └── index.ts
│ │ │ ├── components
│ │ │ │ └── sport-select
│ │ │ │ │ ├── sport-select.component.html
│ │ │ │ │ ├── sport-select.component.scss
│ │ │ │ │ └── sport-select.component.ts
│ │ │ ├── forms
│ │ │ │ └── slackline
│ │ │ │ │ ├── slackline.form.html
│ │ │ │ │ ├── slackline.form.scss
│ │ │ │ │ └── slackline.form.ts
│ │ │ ├── inputs
│ │ │ │ ├── distance
│ │ │ │ │ ├── distance.input.html
│ │ │ │ │ ├── distance.input.scss
│ │ │ │ │ └── distance.input.ts
│ │ │ │ └── subtype
│ │ │ │ │ ├── subtype.input.html
│ │ │ │ │ ├── subtype.input.scss
│ │ │ │ │ └── subtype.input.ts
│ │ │ ├── pages
│ │ │ │ └── add
│ │ │ │ │ ├── add.page.html
│ │ │ │ │ ├── add.page.scss
│ │ │ │ │ └── add.page.ts
│ │ │ └── ui-add.module.ts
│ │ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
│ ├── api
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── jwt-token.interceptor.spec.ts
│ │ │ ├── jwt-token.interceptor.ts
│ │ │ ├── ui-api.module.spec.ts
│ │ │ ├── ui-api.module.ts
│ │ │ └── ui-api.service.ts
│ │ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ └── tslint.json
│ ├── auth
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── +auth
│ │ │ │ ├── auth.actions.ts
│ │ │ │ ├── auth.effects.ts
│ │ │ │ ├── auth.facade.ts
│ │ │ │ ├── auth.models.ts
│ │ │ │ ├── auth.reducer.ts
│ │ │ │ ├── auth.selectors.ts
│ │ │ │ └── index.ts
│ │ │ ├── components
│ │ │ │ └── sign-up-by-facebook
│ │ │ │ │ ├── sign-up-by-facebook.component.html
│ │ │ │ │ ├── sign-up-by-facebook.component.scss
│ │ │ │ │ └── sign-up-by-facebook.component.ts
│ │ │ ├── dialogs
│ │ │ │ ├── index.ts
│ │ │ │ └── login
│ │ │ │ │ ├── login.dialog.html
│ │ │ │ │ ├── login.dialog.scss
│ │ │ │ │ └── login.dialog.ts
│ │ │ ├── directives
│ │ │ │ └── sign-in.directive.ts
│ │ │ ├── index.ts
│ │ │ ├── pipes
│ │ │ │ └── distance.pipe.ts
│ │ │ ├── services
│ │ │ │ ├── auth.service.ts
│ │ │ │ └── index.ts
│ │ │ └── ui-auth.module.ts
│ │ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
│ ├── common
│ ├── dispatcher
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── lib
│ │ │ │ ├── dispatcher.module.ts
│ │ │ │ └── dispatcher.ts
│ │ │ └── test-setup.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── errors
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── lib
│ │ │ │ ├── dialogs
│ │ │ │ │ └── error
│ │ │ │ │ │ ├── error.dialog.html
│ │ │ │ │ │ ├── error.dialog.scss
│ │ │ │ │ │ ├── error.dialog.spec.ts
│ │ │ │ │ │ └── error.dialog.ts
│ │ │ │ ├── error.service.ts
│ │ │ │ ├── errors.module.spec.ts
│ │ │ │ └── errors.module.ts
│ │ │ └── test-setup.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── loader
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── lib
│ │ │ │ ├── loader-overlay
│ │ │ │ │ ├── loader-overlay.component.html
│ │ │ │ │ ├── loader-overlay.component.scss
│ │ │ │ │ ├── loader-overlay.component.spec.ts
│ │ │ │ │ └── loader-overlay.component.ts
│ │ │ │ ├── loader.module.spec.ts
│ │ │ │ ├── loader.module.ts
│ │ │ │ └── loader.ts
│ │ │ └── test-setup.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ └── utils
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ └── array-diff.operator.ts
│ │ └── test-setup.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.lib.json
│ │ ├── tsconfig.spec.json
│ │ └── tslint.json
│ ├── config
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── +config
│ │ │ │ ├── config.actions.ts
│ │ │ │ ├── config.effects.spec.ts
│ │ │ │ ├── config.effects.ts
│ │ │ │ ├── config.facade.spec.ts
│ │ │ │ ├── config.facade.ts
│ │ │ │ ├── config.models.ts
│ │ │ │ ├── config.reducer.spec.ts
│ │ │ │ ├── config.reducer.ts
│ │ │ │ ├── config.selectors.spec.ts
│ │ │ │ └── config.selectors.ts
│ │ │ ├── ui-config.module.spec.ts
│ │ │ ├── ui-config.module.ts
│ │ │ └── ui-config.ts
│ │ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
│ ├── core
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── +core
│ │ │ │ ├── core.actions.ts
│ │ │ │ ├── core.effects.ts
│ │ │ │ ├── core.facade.ts
│ │ │ │ ├── core.models.ts
│ │ │ │ ├── core.reducer.ts
│ │ │ │ ├── core.selectors.ts
│ │ │ │ └── index.ts
│ │ │ ├── +spot
│ │ │ │ ├── index.ts
│ │ │ │ ├── spot.actions.ts
│ │ │ │ ├── spot.effects.ts
│ │ │ │ ├── spot.facade.ts
│ │ │ │ ├── spot.models.ts
│ │ │ │ ├── spot.reducer.ts
│ │ │ │ └── spot.selectors.ts
│ │ │ ├── common
│ │ │ │ ├── geo.utils.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── map.helpers.ts
│ │ │ ├── components
│ │ │ │ ├── layer-filters
│ │ │ │ │ ├── layer-filters.component.html
│ │ │ │ │ ├── layer-filters.component.scss
│ │ │ │ │ ├── layer-filters.component.spec.ts
│ │ │ │ │ └── layer-filters.component.ts
│ │ │ │ └── layout
│ │ │ │ │ ├── layout.component.html
│ │ │ │ │ ├── layout.component.scss
│ │ │ │ │ ├── layout.component.spec.ts
│ │ │ │ │ └── layout.component.ts
│ │ │ ├── pages
│ │ │ │ ├── home
│ │ │ │ │ ├── home.page.html
│ │ │ │ │ ├── home.page.scss
│ │ │ │ │ ├── home.page.spec.ts
│ │ │ │ │ └── home.page.ts
│ │ │ │ └── x
│ │ │ │ │ ├── x.page.html
│ │ │ │ │ ├── x.page.scss
│ │ │ │ │ ├── x.page.spec.ts
│ │ │ │ │ └── x.page.ts
│ │ │ ├── services
│ │ │ │ ├── cache.service.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── spot.service.ts
│ │ │ │ ├── storage-mock.service.ts
│ │ │ │ └── storage.service.ts
│ │ │ └── ui-core.module.ts
│ │ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ └── tslint.json
│ ├── map
│ ├── .storybook
│ │ ├── addons.js
│ │ ├── config.js
│ │ ├── preview-head.html
│ │ ├── tsconfig.json
│ │ └── webpack.config.js
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ │ ├── index.ts
│ │ ├── lib
│ │ │ ├── +map
│ │ │ │ ├── index.ts
│ │ │ │ ├── map.actions.ts
│ │ │ │ ├── map.effects.ts
│ │ │ │ ├── map.facade.ts
│ │ │ │ ├── map.models.ts
│ │ │ │ ├── map.reducer.ts
│ │ │ │ └── map.selectors.ts
│ │ │ ├── clusters.ts
│ │ │ ├── components
│ │ │ │ ├── draw-control
│ │ │ │ │ ├── draw-control.component.html
│ │ │ │ │ ├── draw-control.component.scss
│ │ │ │ │ └── draw-control.component.ts
│ │ │ │ ├── map.component.html
│ │ │ │ ├── map.component.scss
│ │ │ │ ├── map.component.ts
│ │ │ │ └── spots-layer
│ │ │ │ │ └── spots-layer.component.ts
│ │ │ ├── leaflet
│ │ │ │ ├── draw
│ │ │ │ │ ├── draw-customs.ts
│ │ │ │ │ └── draw-handler.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── layers
│ │ │ │ │ ├── google-mutant.layer.ts
│ │ │ │ │ ├── map.tile.layer.ts
│ │ │ │ │ ├── satellite.google.tile.layer.ts
│ │ │ │ │ └── spots.layer.ts
│ │ │ │ ├── leaflet-map.component.scss
│ │ │ │ ├── leaflet-map.component.spec.ts
│ │ │ │ ├── leaflet-map.component.stories.ts
│ │ │ │ ├── leaflet-map.component.ts
│ │ │ │ ├── map
│ │ │ │ │ └── leaflet-customs.ts
│ │ │ │ ├── markers
│ │ │ │ │ ├── area.marker.ts
│ │ │ │ │ ├── cluster-counts.marker.ts
│ │ │ │ │ ├── cluster.marker.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── line.marker.ts
│ │ │ │ │ ├── location.marker.ts
│ │ │ │ │ ├── marker-factory.ts
│ │ │ │ │ └── poi.marker.ts
│ │ │ │ └── plugins
│ │ │ │ │ └── leaflet.restoreview.ts
│ │ │ ├── map.service.ts
│ │ │ └── ui-map.module.ts
│ │ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ └── tslint.json
│ └── pwa
│ ├── .storybook
│ ├── addons.js
│ ├── config.js
│ ├── tsconfig.json
│ └── webpack.config.js
│ ├── README.md
│ ├── jest.config.js
│ ├── src
│ ├── index.ts
│ ├── lib
│ │ ├── pwa-module-config.ts
│ │ ├── ui-pwa.module.spec.ts
│ │ ├── ui-pwa.module.ts
│ │ ├── update-dialog
│ │ │ ├── update-dialog.component.css
│ │ │ ├── update-dialog.component.html
│ │ │ ├── update-dialog.component.spec.ts
│ │ │ ├── update-dialog.component.stories.ts
│ │ │ └── update-dialog.component.ts
│ │ ├── update.service.spec.ts
│ │ └── update.service.ts
│ └── test-setup.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── nx.json
├── package-lock.json
├── package.json
├── shipitfile-db-backup.js
├── shipitfile-db-deploy.js
├── shipitfile.js
├── storage
└── neo4j
│ ├── data
│ └── .gitkeep
│ └── logs
│ ├── .gitkeep
│ └── debug.log
├── tools
├── schematics
│ ├── .gitkeep
│ └── usecase
│ │ ├── files
│ │ ├── dto
│ │ │ └── __name@dasherize__.dto.ts
│ │ └── usecases
│ │ │ ├── __name@dasherize__.usecase.spec.ts
│ │ │ └── __name@dasherize__.usecase.ts
│ │ ├── index.ts
│ │ └── schema.json
├── scripts
│ ├── copy-assets.js
│ ├── deploy-prod.sh
│ ├── deploy-test.sh
│ └── sha1.js
├── shipit-deploy
│ ├── index.js
│ └── tasks
│ │ ├── deploy.js
│ │ ├── fetch.js
│ │ └── update.js
└── tsconfig.tools.json
├── tsconfig.json
└── tslint.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.env.sample:
--------------------------------------------------------------------------------
1 | # Neo4j
2 | DATABASE_TYPE=NEO4J
3 | DATABASE_USER='neo4j'
4 | DATABASE_PASSWORD='root'
5 | DATABASE_HOST='localhost'
6 | DATABASE_PORT='7687'
7 |
8 | # AuthConfig
9 | JWT_SECRET="secret"
10 |
11 | # AppConfig
12 | APP_HOST="http://localhost:4200"
13 | API_HOST="http://localhost:3333"
14 |
15 | # FacebookConfig
16 | # slackmap.loc
17 | FACEBOOK_APP_ID="306418119377317"
18 | FACEBOOK_SECRET=""
19 | # coma separated strings, minimal scope permissions
20 | FACEBOOK_SCOPE="public_profile,email"
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 | db/current
3 | .env
4 | storage/import/*
5 | storage/neo4j/data/*
6 | !storage/neo4j/data/.gitkeep
7 | !storage/neo4j/logs/*
8 | !storage/neo4j/logs/.gitkeep
9 | # compiled output
10 | /dist
11 | /tmp
12 | /out-tsc
13 | *.nx-tmp
14 |
15 | # dependencies
16 | /node_modules
17 |
18 | # IDEs and editors
19 | /.idea
20 | .project
21 | .classpath
22 | .c9/
23 | *.launch
24 | .settings/
25 | *.sublime-workspace
26 |
27 | # IDE - VSCode
28 | .vscode/*
29 | !.vscode/settings.json
30 | !.vscode/tasks.json
31 | !.vscode/launch.json
32 | !.vscode/extensions.json
33 |
34 | # misc
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Add files here to ignore them from prettier formatting
2 |
3 | /dist
4 | /coverage
5 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true
3 | }
4 |
--------------------------------------------------------------------------------
/.storybook/addons.js:
--------------------------------------------------------------------------------
1 | import '@storybook/addon-knobs/register';
2 |
--------------------------------------------------------------------------------
/.storybook/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "exclude": ["../**/test.ts", "../**/*.spec.ts"],
4 | "include": ["../**/*"]
5 | }
6 |
--------------------------------------------------------------------------------
/.storybook/webpack.config.js:
--------------------------------------------------------------------------------
1 | // Export a function. Accept the base config as the only param.
2 | module.exports = async ({ config, mode }) => {
3 | // `mode` has a value of 'DEVELOPMENT' or 'PRODUCTION'
4 | // You can change the configuration based on that.
5 | // 'PRODUCTION' is used when building the static version of storybook.
6 |
7 | // Make whatever fine-grained changes you need
8 |
9 | // Return the altered config
10 | return config;
11 | };
12 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "nrwl.angular-console",
4 | "angular.ng-template",
5 | "ms-vscode.vscode-typescript-tslint-plugin",
6 | "esbenp.prettier-vscode"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/apps/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/apps/api/e2e/jest-setup.ts:
--------------------------------------------------------------------------------
1 | const { Logger } = require('@nestjs/common');
2 |
3 | /**
4 | * Setup scripts, runs before each test file
5 | */
6 |
7 | // change LOG_LEVEL for the tests
8 | // comment it if you need drivine logs for debugging
9 | Logger.overrideLogger(['error'])
10 |
--------------------------------------------------------------------------------
/apps/api/e2e/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-e2e',
3 | preset: '../../../jest.config.js',
4 | testMatch: ['**/+(*.)+(e2e-spec|e2e-test).+(ts|js)?(x)'],
5 | coverageDirectory: '../../coverage/apps/api-e2e',
6 | setupFiles: ["./jest-setup.ts"],
7 | };
8 |
--------------------------------------------------------------------------------
/apps/api/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/api-e2e",
5 | "module": "commonjs",
6 | "types": ["node", "jest"]
7 | },
8 | "include": [
9 | "src/**/*.e2e-spec.ts",
10 | "src/**/*.d.ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/apps/api/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api',
3 | preset: '../../jest.config.js',
4 | coverageDirectory: '../../coverage/apps/api'
5 | };
6 |
--------------------------------------------------------------------------------
/apps/api/src/app/app.controller.ts:
--------------------------------------------------------------------------------
1 | import { Controller, Get } from '@nestjs/common';
2 |
3 | @Controller()
4 | export class AppController {
5 |
6 | count = 0;
7 |
8 | constructor() {}
9 |
10 | /**
11 | * API Main Page
12 | */
13 | @Get()
14 | main() {
15 | this.count++;
16 | return {message: 'SlackMap API is working', count: this.count}
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/api/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { ApiClustersModule } from '@slackmap/api/clusters';
3 | import { ApiAuthModule } from '@slackmap/api/auth';
4 | import { ApiConfigModule } from '@slackmap/api/config';
5 | import { ApiSpotDomainModule } from '@slackmap/api/spot/domain';
6 |
7 | import { AppController } from './app.controller';
8 |
9 | @Module({
10 | imports: [
11 | ApiClustersModule,
12 | ApiAuthModule,
13 | ApiConfigModule,
14 | ApiSpotDomainModule,
15 | ],
16 | controllers: [AppController],
17 | providers: []
18 | })
19 | export class AppModule {}
20 |
--------------------------------------------------------------------------------
/apps/api/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/api/src/assets/.gitkeep
--------------------------------------------------------------------------------
/apps/api/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/api/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: false
3 | };
4 |
--------------------------------------------------------------------------------
/apps/api/src/main.ts:
--------------------------------------------------------------------------------
1 | const result = require('dotenv').config()
2 | if (result.error) {
3 | throw result.error
4 | }
5 | import { Logger } from '@nestjs/common';
6 | Logger.overrideLogger(['error'])
7 | import { NestFactory } from '@nestjs/core';
8 | import { AppModule } from './app/app.module';
9 |
10 | async function bootstrap() {
11 | const app = await NestFactory.create(AppModule);
12 | app.enableCors();
13 | app.enableShutdownHooks();
14 | const port = process.env.PORT || 3333;
15 | await app.listen(port, () => {
16 | console.log('Listening at http://localhost:' + port);
17 | });
18 | }
19 |
20 | bootstrap();
21 |
--------------------------------------------------------------------------------
/apps/api/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "exclude": ["src/**/*.spec.ts"],
8 | "include": ["src/**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/api/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "emitDecoratorMetadata": true,
6 | "target": "es2017",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["**/*.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/apps/api/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/api/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/cli/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'cli',
3 | preset: '../../jest.config.js',
4 | coverageDirectory: '../../coverage/apps/cli'
5 | };
6 |
--------------------------------------------------------------------------------
/apps/cli/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/cli/src/assets/.gitkeep
--------------------------------------------------------------------------------
/apps/cli/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/cli/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: false
3 | };
4 |
--------------------------------------------------------------------------------
/apps/cli/src/sm:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const { resolve } = require('path');
4 | const project = resolve(__dirname, '../tsconfig.json');
5 |
6 | require('ts-node').register({
7 | project
8 | });
9 | require('./sm.ts');
10 |
--------------------------------------------------------------------------------
/apps/cli/src/sm-stats.ts:
--------------------------------------------------------------------------------
1 | const ora = require('ora');
2 |
3 | const spinner = ora('Loading stats...').start();
4 |
5 | setTimeout(() => {
6 | spinner.color = 'yellow';
7 | spinner.text = 'Rendering';
8 | }, 1000);
9 |
10 | setTimeout(() => {
11 | spinner.color = 'green';
12 | spinner.text = 'One more second';
13 | }, 2000);
14 |
15 | setTimeout(() => {
16 | spinner.color = 'green';
17 | spinner.succeed('Here are the stats');
18 | }, 3000);
19 |
--------------------------------------------------------------------------------
/apps/cli/src/sm.ts:
--------------------------------------------------------------------------------
1 | import program from 'commander';
2 |
3 | const chalk = require('chalk');
4 | const clear = require('clear');
5 | const figlet = require('figlet');
6 |
7 | program
8 | .version('0.0.1', '-v, --version')
9 | .description('Mange SlackMap infrastructure. ')
10 |
11 | import "./sm-help";
12 | import './sm-orient-download';
13 | import './sm-orient-switch';
14 | import './sm-orient-start';
15 |
16 | if(process.argv.length <= 2) {
17 | clear();
18 | console.log('');
19 | console.log(chalk.yellow(figlet.textSync('SlackMap CLI', { horizontalLayout: 'full' })));
20 | }
21 |
22 | program.parse(process.argv);
23 |
24 |
--------------------------------------------------------------------------------
/apps/cli/src/utils/download.ts:
--------------------------------------------------------------------------------
1 | const http = require('https');
2 | const fs = require('fs');
3 |
4 | export function download(sourceUrl, destinationPath) {
5 | return new Promise((resolve, reject) => {
6 |
7 | const file = fs.createWriteStream(destinationPath);
8 | http.get(sourceUrl, function (response) {
9 | response.pipe(file);
10 | response.on('end', function () {
11 | file.close(resolve);
12 | }).on('error', function (err) {
13 | fs.unlink(destinationPath);
14 | reject(err.message);
15 | });
16 | });
17 |
18 | })
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/apps/cli/src/utils/list-dirs.ts:
--------------------------------------------------------------------------------
1 | const { readdirSync, statSync } = require('fs');
2 | const { join } = require('path');
3 |
4 | export function listDirs(dir: string): string[] {
5 | return readdirSync(dir).filter(f => statSync(join(dir, f)).isDirectory());
6 | };
7 |
--------------------------------------------------------------------------------
/apps/cli/src/utils/throw-error.ts:
--------------------------------------------------------------------------------
1 | const { red } = require('chalk');
2 |
3 | export function throwError(message) {
4 | console.log(red('------'));
5 | console.error(red('ERROR:'), message);
6 | console.log(red('------'));
7 | throw new Error(message);
8 | };
9 |
--------------------------------------------------------------------------------
/apps/cli/src/utils/unpack.ts:
--------------------------------------------------------------------------------
1 | const targz = require('targz');
2 |
3 | export function untargz(src, dest) {
4 | return new Promise((resolve, reject) => {
5 |
6 | targz.decompress({
7 | src,
8 | dest
9 | }, function(err){
10 | if(err) {
11 | reject(err);
12 | } else {
13 | resolve("Done!");
14 | }
15 | });
16 |
17 |
18 | })
19 | }
20 |
--------------------------------------------------------------------------------
/apps/cli/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/apps/cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "target": "es2017",
5 | "module": "commonjs",
6 | "esModuleInterop": true,
7 | "importHelpers": true,
8 | "lib": ["es6", "es2017", "dom"],
9 | "types": [
10 | "node",
11 | "jest"
12 | ]
13 | },
14 | "include": [
15 | "**/*.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/apps/cli/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.d.ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/apps/cli/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileServerFolder": ".",
3 | "fixturesFolder": "./src/fixtures",
4 | "integrationFolder": "./src/integration",
5 | "modifyObstructiveCode": false,
6 | "pluginsFile": "./src/plugins/index",
7 | "supportFile": "./src/support/index.ts",
8 | "video": true,
9 | "videosFolder": "../../dist/cypress/apps/ui-pwa-e2e/videos",
10 | "screenshotsFolder": "../../dist/cypress/apps/ui-pwa-e2e/screenshots",
11 | "chromeWebSecurity": false,
12 | "baseUrl": "http://localhost:4400"
13 | }
14 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/src/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/src/integration/update-dialog/update-dialog.component.spec.ts:
--------------------------------------------------------------------------------
1 | describe('ui-pwa', () => {
2 | beforeEach(() => cy.visit('/iframe.html?id=updatedialogcomponent--primary'));
3 |
4 | it('should render the component', () => {
5 | cy.get('sm-update-dialog').should('exist');
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/src/plugins/index.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example plugins/index.js can be used to load plugins
3 | //
4 | // You can change the location of this file or turn off loading
5 | // the plugins file with the 'pluginsFile' configuration option.
6 | //
7 | // You can read more here:
8 | // https://on.cypress.io/plugins-guide
9 | // ***********************************************************
10 |
11 | // This function is called when a project is opened or re-opened (e.g. due to
12 | // the project's config changing)
13 |
14 | const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
15 |
16 | module.exports = (on, config) => {
17 | // `on` is used to hook into various events Cypress emits
18 | // `config` is the resolved Cypress config
19 |
20 | // Preprocess Typescript file using Nx helper
21 | on('file:preprocessor', preprocessTypescript(config));
22 | };
23 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/src/support/index.ts:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands';
18 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "sourceMap": false,
5 | "outDir": "../../dist/out-tsc"
6 | },
7 | "include": ["src/**/*.ts", "src/**/*.js"]
8 | }
9 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["cypress", "node"]
5 | },
6 | "include": ["**/*.ts", "**/*.js"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/ui-pwa-e2e/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/web-e2e/cypress.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileServerFolder": ".",
3 | "fixturesFolder": "./src/fixtures",
4 | "integrationFolder": "./src/integration",
5 | "modifyObstructiveCode": false,
6 | "pluginsFile": "./src/plugins/index",
7 | "supportFile": "./src/support/index.ts",
8 | "video": true,
9 | "videosFolder": "../../dist/cypress/apps/web-e2e/videos",
10 | "screenshotsFolder": "../../dist/cypress/apps/web-e2e/screenshots",
11 | "chromeWebSecurity": false
12 | }
13 |
--------------------------------------------------------------------------------
/apps/web-e2e/src/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/web-e2e/src/integration/app.spec.ts:
--------------------------------------------------------------------------------
1 | import { getGreeting } from '../support/app.po';
2 |
3 | describe('web', () => {
4 | beforeEach(() => cy.visit('/'));
5 |
6 | it('should display welcome message', () => {
7 | // Custom command example, see `../support/commands.ts` file
8 | cy.login('my-email@something.com', 'myPassword');
9 |
10 | // Function helper example, see `../support/app.po.ts` file
11 | getGreeting().contains('Welcome to web!');
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/apps/web-e2e/src/plugins/index.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example plugins/index.js can be used to load plugins
3 | //
4 | // You can change the location of this file or turn off loading
5 | // the plugins file with the 'pluginsFile' configuration option.
6 | //
7 | // You can read more here:
8 | // https://on.cypress.io/plugins-guide
9 | // ***********************************************************
10 |
11 | // This function is called when a project is opened or re-opened (e.g. due to
12 | // the project's config changing)
13 |
14 | const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
15 |
16 | module.exports = (on, config) => {
17 | // `on` is used to hook into various events Cypress emits
18 | // `config` is the resolved Cypress config
19 |
20 | // Preprocess Typescript file using Nx helper
21 | on('file:preprocessor', preprocessTypescript(config));
22 | };
23 |
--------------------------------------------------------------------------------
/apps/web-e2e/src/support/app.po.ts:
--------------------------------------------------------------------------------
1 | export const getGreeting = () => cy.get('h1');
2 |
--------------------------------------------------------------------------------
/apps/web-e2e/src/support/index.ts:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands';
18 |
--------------------------------------------------------------------------------
/apps/web-e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "sourceMap": false,
5 | "outDir": "../../dist/out-tsc"
6 | },
7 | "include": ["src/**/*.ts", "src/**/*.js"]
8 | }
9 |
--------------------------------------------------------------------------------
/apps/web-e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["cypress", "node"]
5 | },
6 | "include": ["**/*.ts", "**/*.js"]
7 | }
8 |
--------------------------------------------------------------------------------
/apps/web-e2e/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/apps/web/browserslist:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # You can see what browsers were selected by your queries by running:
6 | # npx browserslist
7 |
8 | > 0.5%
9 | last 2 versions
10 | Firefox ESR
11 | not dead
12 | not IE 9-11 # For IE 9-11 support, remove 'not'.
--------------------------------------------------------------------------------
/apps/web/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'web',
3 | preset: '../../jest.config.js',
4 | coverageDirectory: '../../coverage/apps/web',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js'
9 | ]
10 | };
11 |
--------------------------------------------------------------------------------
/apps/web/proxy.conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "/config.json": {
3 | "target": "http://localhost:3333",
4 | "secure": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/apps/web/src/_reset.scss:
--------------------------------------------------------------------------------
1 | * {
2 | &:active,
3 | :focus {
4 | outline: none !important; // 1
5 | }
6 | }
7 |
8 | a:not(.mat-button):not(.mat-raised-button):not(.mat-fab):not(.mat-mini-fab):not([mat-list-item]) {
9 | color: #3f51b5; // 2
10 | }
11 |
--------------------------------------------------------------------------------
/apps/web/src/_variables.scss:
--------------------------------------------------------------------------------
1 | $link-color: #3f51b5;
2 | $link-hover-color: currentColor;
3 | $link-hover-decoration: none;
4 | $label-margin-bottom: 0;
5 | $grid-gutter-width: 10px;
6 |
--------------------------------------------------------------------------------
/apps/web/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/apps/web/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Remove template code below
3 | */
4 | :host {
5 | display: block;
6 | width: 100%;
7 | height: 100%;
8 | }
9 |
--------------------------------------------------------------------------------
/apps/web/src/app/app.server.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { ServerModule } from '@angular/platform-server';
3 |
4 | import { AppModule } from './app.module';
5 | import { AppComponent } from './app.component';
6 | import { StorageService, StorageMockService } from '@slackmap/ui/core';
7 | import { UiConfig } from '@slackmap/ui/config';
8 | import { ConfigModel } from '@slackmap/api/config/dto';
9 |
10 |
11 | const config: ConfigModel = {
12 | APP_HOST: process.env.APP_HOST,
13 | API_HOST: process.env.API_HOST,
14 | FACEBOOK_APP_ID: process.env.FACEBOOK_APP_ID,
15 | FACEBOOK_SCOPE: (process.env.FACEBOOK_SCOPE || '').split(','),
16 | }
17 |
18 | @NgModule({
19 | imports: [
20 | AppModule,
21 | ServerModule,
22 | ],
23 | providers: [{
24 | provide: StorageService,
25 | useClass: StorageMockService,
26 | },{
27 | provide: UiConfig,
28 | useValue: config,
29 | }],
30 | bootstrap: [AppComponent],
31 | })
32 | export class AppServerModule {}
33 |
--------------------------------------------------------------------------------
/apps/web/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/.gitkeep
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/ICONS.md:
--------------------------------------------------------------------------------
1 | # SlackMap Icons
2 |
3 | ## Usage
4 | ```html
5 |
6 | ```
7 | ## Available list
8 |
9 | http://localhost:4200/assets/icons/demo.html
10 |
11 | https://next.slackmap.com/assets/icons/demo.html
12 |
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/favicon.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-128x128.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-144x144.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-152x152.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-192x192-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-192x192-solid.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-192x192.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-384x384.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-384x384.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-512x512.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-72x72.png
--------------------------------------------------------------------------------
/apps/web/src/assets/icons/icon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/icons/icon-96x96.png
--------------------------------------------------------------------------------
/apps/web/src/assets/logo-hor-sub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/logo-hor-sub.png
--------------------------------------------------------------------------------
/apps/web/src/assets/logo-osd-hor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/logo-osd-hor.png
--------------------------------------------------------------------------------
/apps/web/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/logo.png
--------------------------------------------------------------------------------
/apps/web/src/assets/map-demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/map-demo.png
--------------------------------------------------------------------------------
/apps/web/src/assets/repository-open-graph-template.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/repository-open-graph-template.png
--------------------------------------------------------------------------------
/apps/web/src/assets/sygnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/assets/sygnet.png
--------------------------------------------------------------------------------
/apps/web/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/web/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/apps/web/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/apps/web/src/favicon.ico
--------------------------------------------------------------------------------
/apps/web/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SlackMap
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/apps/web/src/main.server.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 |
3 | import { environment } from './environments/environment';
4 |
5 | if (environment.production) {
6 | enableProdMode();
7 | }
8 |
9 | export { AppServerModule } from './app/app.server.module';
10 | export { renderModule, renderModuleFactory } from '@angular/platform-server';
11 |
--------------------------------------------------------------------------------
/apps/web/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | document.addEventListener('DOMContentLoaded', () => {
12 | platformBrowserDynamic()
13 | .bootstrapModule(AppModule)
14 | .catch(err => console.error(err));
15 | });
16 |
--------------------------------------------------------------------------------
/apps/web/src/robots.txt:
--------------------------------------------------------------------------------
1 | # robotstxt.org
2 |
3 | User-agent: *
4 |
--------------------------------------------------------------------------------
/apps/web/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* Importing Bootstrap SCSS file. */
2 | @import "variables";
3 | @import "~bootstrap/scss/functions";
4 | @import "~bootstrap/scss/variables";
5 | @import "~bootstrap/scss/mixins";
6 | @import "~bootstrap/scss/reboot";
7 | @import "~bootstrap/scss/alert";
8 | @import "~bootstrap/scss/grid";
9 | @import "~bootstrap/scss/utilities"; // add css utilities
10 | @import "reset";
11 |
12 | // angular material reset
13 | html, body { height: 100%; }
14 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
15 |
16 | // SlackMap helpers
17 | .toolbar-icon-right {
18 | margin: 0 0 0 14px;
19 | }
20 | .toolbar-icon-left {
21 | margin: 0 14px 0 0;
22 | }
23 |
24 | .toolbar-spacer {
25 | flex: 1 1 auto;
26 | }
27 | .toolbar-center {
28 | justify-content: center;
29 | }
30 |
--------------------------------------------------------------------------------
/apps/web/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/apps/web/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "files": ["src/main.ts", "src/polyfills.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/apps/web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/apps/web/tsconfig.server.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.app.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc-server",
5 | "module": "commonjs",
6 | "types": [
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/main.server.ts",
12 | "server.ts"
13 | ],
14 | "angularCompilerOptions": {
15 | "entryModule": "./src/app/app.server.module#AppServerModule"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/apps/web/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/apps/web/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "sm",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "sm",
14 | "kebab-case"
15 | ]
16 | },
17 | "linterOptions": {
18 | "exclude": [
19 | "!**/*"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/docs/sidebar.md:
--------------------------------------------------------------------------------
1 | - [SlackMap](/)
2 | - Development
3 | - [Local](development-local)
4 | - Knowledge Base
5 | - [GIS](gis)
6 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
3 | transform: {
4 | '^.+\\.(ts|js|html)$': 'ts-jest'
5 | },
6 | resolver: '@nrwl/jest/plugins/resolver',
7 | moduleFileExtensions: ['ts', 'js', 'html'],
8 | coverageReporters: ['html']
9 | };
10 |
--------------------------------------------------------------------------------
/libs/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/libs/.gitkeep
--------------------------------------------------------------------------------
/libs/api/auth/README.md:
--------------------------------------------------------------------------------
1 | # api-auth
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test api-auth` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/api/auth/jest-setup.ts:
--------------------------------------------------------------------------------
1 | const { Logger } = require('@nestjs/common');
2 |
3 | /**
4 | * Setup scripts, runs before each test file
5 | */
6 |
7 | // change LOG_LEVEL for the tests
8 | // comment it if you need drivine logs for debugging
9 | Logger.overrideLogger(['error'])
10 |
--------------------------------------------------------------------------------
/libs/api/auth/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-auth',
3 | preset: '../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../coverage/libs/api/auth',
10 | setupFiles: ["./jest-setup.ts"],
11 | };
12 |
--------------------------------------------------------------------------------
/libs/api/auth/src/dto.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/models';
2 | export * from './lib/dto';
3 |
--------------------------------------------------------------------------------
/libs/api/auth/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/api-auth.module';
2 | export * from './lib/services';
3 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/api-auth.config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, Logger, Optional } from '@nestjs/common';
2 | const logger = new Logger('AuthConfig');
3 |
4 | @Injectable()
5 | export class AuthConfig {
6 | readonly JWT_SECRET = process.env.JWT_SECRET;
7 |
8 | constructor(@Optional() options: Partial = {}) {
9 | Object.assign(this, options);
10 | Object.keys(this).forEach(key => {
11 | if (this[key] === undefined || this[key] === NaN) {
12 | logger.error(key + ' in env is missing');
13 | }
14 | })
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/decorators/index.ts:
--------------------------------------------------------------------------------
1 | export * from './jwt-payload.decorator';
2 | export * from './roles.decorator';
3 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/decorators/jwt-payload.decorator.ts:
--------------------------------------------------------------------------------
1 | import { createParamDecorator, ExecutionContext } from '@nestjs/common';
2 |
3 | export const JwtPayload = createParamDecorator(
4 | (data: unknown, ctx: ExecutionContext) => {
5 | const request = ctx.switchToHttp().getRequest();
6 | return request.user;
7 | },
8 | );
9 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/decorators/roles.decorator.ts:
--------------------------------------------------------------------------------
1 | import { SetMetadata } from '@nestjs/common';
2 |
3 | export const Roles = (...args: string[]) => SetMetadata('roles', args);
4 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/dto/auth-paths.ts:
--------------------------------------------------------------------------------
1 |
2 | export const AUTH_PATHS = {
3 | signInByFacebook: () => 'auth/sign-in-by-facebook',
4 | signUpByFacebook: () => 'auth/sign-up-by-facebook',
5 | me: () => 'auth/me',
6 | }
7 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/dto/auth-sign-up-by-facebook.dto.ts:
--------------------------------------------------------------------------------
1 | import { Gender } from "@slackmap/core";
2 | import { FacebookUserModel } from '@slackmap/api/facebook/dto';
3 | import { UserModel } from '../models';
4 |
5 | export class AuthSignUpByFacebookRequestDto {
6 | apiToken: string;
7 | email: string;
8 | firstName: string;
9 | lastName: string;
10 | gender: Gender;
11 | }
12 | export class AuthSignUpByFacebookDto {
13 | facebookUser?: FacebookUserModel;
14 | apiToken: string;
15 | user: UserModel;
16 | users: UserModel[];
17 | }
18 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/dto/auth.dto.ts:
--------------------------------------------------------------------------------
1 | import { UserModel } from '../models';
2 | import { FacebookUserModel } from '@slackmap/api/facebook/dto';
3 |
4 | export class AuthSignInByFacebookRequestDto {
5 | accessToken: string;
6 | signedRequest?: string;
7 | }
8 |
9 | export class AuthSignInByFacebookDto {
10 | apiToken: string;
11 | facebookUser: FacebookUserModel;
12 | user: UserModel;
13 | users: UserModel[];
14 | }
15 |
16 | export class AuthMeGetDto {
17 | facebookUser: FacebookUserModel;
18 | user: UserModel;
19 | users: UserModel[];
20 | }
21 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/dto/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth-paths';
2 | export * from './auth-sign-up-by-facebook.dto';
3 | export * from './auth.dto';
4 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/guards/index.ts:
--------------------------------------------------------------------------------
1 | export * from './jwt-auth.guard';
2 | export * from './local-auth.guard';
3 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/guards/jwt-auth.guard.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { AuthGuard } from '@nestjs/passport';
3 |
4 | @Injectable()
5 | export class JwtAuthGuard extends AuthGuard('jwt') {}
6 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/guards/local-auth.guard.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { AuthGuard } from '@nestjs/passport';
3 |
4 | @Injectable()
5 | export class LocalAuthGuard extends AuthGuard('local') {}
6 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/models/index.ts:
--------------------------------------------------------------------------------
1 | export * from './me.model';
2 | export * from './jwt-payload.model';
3 | export * from './user.model';
4 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/models/jwt-payload.model.ts:
--------------------------------------------------------------------------------
1 | import { FacebookUserModel } from '@slackmap/api/facebook/dto';
2 | import { UserModel } from './user.model';
3 |
4 | export class JwtPayloadModel {
5 | facebookUser?: FacebookUserModel;
6 | user: UserModel;
7 | users: UserModel[];
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/models/me.model.ts:
--------------------------------------------------------------------------------
1 | // import { LocationPathModel } from './location-path.model';
2 |
3 | /**
4 | * User model definition
5 | */
6 | export class MeModel {
7 |
8 | rid?: string;
9 | name?: string;
10 | facebook_id?: string;
11 | email?: string;
12 | imperial?: boolean;
13 | // location_path?: LocationPathModel;
14 | first_name?: string;
15 | last_name?: string;
16 | login_at?: string;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/models/user.model.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * User model definition
3 | */
4 | export class UserModel {
5 | rid?: string;
6 | location?: string;
7 | facebookId?: string;
8 | name?: string;
9 | firstName?: string;
10 | lastName?: string;
11 | email?: string;
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth.service';
2 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/strategies/jwt.strategy.ts:
--------------------------------------------------------------------------------
1 | import { ExtractJwt, Strategy } from 'passport-jwt';
2 | import { PassportStrategy } from '@nestjs/passport';
3 | import { Injectable } from '@nestjs/common';
4 | import { AuthConfig } from '../api-auth.config';
5 | import { JwtPayloadModel } from '../models';
6 |
7 | @Injectable()
8 | export class JwtStrategy extends PassportStrategy(Strategy) {
9 | constructor(config: AuthConfig) {
10 | super({
11 | jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
12 | ignoreExpiration: false,
13 | secretOrKey: config.JWT_SECRET,
14 | });
15 | }
16 |
17 | validate(payload: JwtPayloadModel) {
18 | return payload; // TODO in the future, we can look up the database to verify the session
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/strategies/local.strategy.ts:
--------------------------------------------------------------------------------
1 | import { Strategy } from 'passport-local';
2 | import { PassportStrategy } from '@nestjs/passport';
3 | import { Injectable, UnauthorizedException } from '@nestjs/common';
4 | import { AuthService } from '../services/auth.service';
5 |
6 | @Injectable()
7 | export class LocalStrategy extends PassportStrategy(Strategy) {
8 | constructor(private readonly authService: AuthService) {
9 | super();
10 | }
11 |
12 | async validate(username: string, password: string): Promise {
13 | const user = await this.authService.validateUser(username, password);
14 | if (!user) {
15 | throw new UnauthorizedException();
16 | }
17 | return user;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/usecases/auth-me-get.usecase.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { JwtPayloadModel } from '../models';
3 | import { AuthMeGetDto } from '../dto';
4 | import { UserRepository } from '@slackmap/api/db';
5 |
6 | /**
7 | * Returns all info required for frontend about current user
8 | */
9 | @Injectable()
10 | export class AuthMeGetUseCase {
11 |
12 | constructor(
13 | private userRepository: UserRepository
14 | ) {}
15 |
16 | async process(payload: JwtPayloadModel): Promise {
17 |
18 | // return this.userRepository.findOne('3434')
19 | return {
20 | ...payload
21 | };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/libs/api/auth/src/lib/usecases/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth-sign-in-by-facebook.usecase';
2 | export * from './auth-me-get.usecase';
3 | export * from './auth-sign-up-by-facebook.usecase';
4 |
--------------------------------------------------------------------------------
/libs/api/auth/src/testing/api-auth-testing.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 |
3 | @Module({
4 | imports: [],
5 | providers: [],
6 | exports: [],
7 | })
8 | export class ApiAuthTestingModule { }
9 |
--------------------------------------------------------------------------------
/libs/api/auth/src/testing/fixtures/index.ts:
--------------------------------------------------------------------------------
1 |
2 | export default function() {}
3 |
--------------------------------------------------------------------------------
/libs/api/auth/src/testing/index.ts:
--------------------------------------------------------------------------------
1 | export * from './fixtures';
2 | export * from './api-auth-testing.module';
3 |
--------------------------------------------------------------------------------
/libs/api/auth/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/auth/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/auth/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/auth/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/clusters/README.md:
--------------------------------------------------------------------------------
1 | # api-clusters
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test api-clusters` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/api/clusters/jest-setup.ts:
--------------------------------------------------------------------------------
1 | const { Logger } = require('@nestjs/common');
2 |
3 | /**
4 | * Setup scripts, runs before each test file
5 | */
6 |
7 | // change LOG_LEVEL for the tests
8 | // comment it if you need drivine logs for debugging
9 | Logger.overrideLogger(['error'])
10 |
--------------------------------------------------------------------------------
/libs/api/clusters/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-clusters',
3 | preset: '../../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../../coverage/libs/api/clusters',
9 | setupFiles: ["./jest-setup.ts"],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/dto.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/dto';
2 | export * from './lib/models';
3 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/api-clusters.module';
2 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/lib/api-clusters.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { ClustersController } from './controllers/clusters.controller';
3 | import { ClustersService } from './services';
4 | import { ApiSpotDataModule } from '@slackmap/api/spot/data';
5 |
6 | @Module({
7 | imports: [ApiSpotDataModule],
8 | controllers: [ClustersController],
9 | providers: [ClustersService],
10 | exports: []
11 | })
12 | export class ApiClustersModule {}
13 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/lib/dto/clusters.dto.ts:
--------------------------------------------------------------------------------
1 | import { ClusterModel } from '../models';
2 | import { SportType } from '@slackmap/core';
3 | import { IsString, IsNumber, IsNumberString, IsEnum } from "class-validator";
4 | import { Transform } from "class-transformer";
5 |
6 | export const CLUSTERS_PATHS = {
7 | clustersGet: () => 'cluster/clusters',
8 | spotsGet: () => 'spot/spots',
9 | }
10 |
11 | export class ClustersClustersGetRequestDto {
12 | @IsEnum(SportType)
13 | @Transform(value => Number(value))
14 | sport: SportType;
15 | @IsString()
16 | bbox: string;
17 | @IsNumberString()
18 | zoom: number;
19 | }
20 | export class ClustersClustersGetDto {
21 | clusters: ClusterModel[];
22 | }
23 |
24 | export class ClustersSpotsGetRequestDto {
25 | @IsEnum(SportType)
26 | @Transform(value => Number(value))
27 | sport: SportType;
28 | @IsString()
29 | hash: string;
30 | }
31 |
32 | export class ClustersSpotsGetDto {
33 | // spots: SpotModel[];
34 | spots: any[];
35 | }
36 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/lib/dto/index.ts:
--------------------------------------------------------------------------------
1 | export * from './clusters.dto';
2 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/lib/models/cluster.model.ts:
--------------------------------------------------------------------------------
1 |
2 | import { GeoJSON } from '@slackmap/gis';
3 | import { ClusterSubtype, ItemType, Rid, ItemSubtype } from '@slackmap/core';
4 |
5 | export type ClusterCountsModel = {
6 | [key in ItemSubtype]?: number;
7 | }
8 |
9 | export interface ClusterModel {
10 | rid: Rid;
11 | type: ItemType.CLUSTER;
12 | subtype: ClusterSubtype;
13 | coordinates: GeoJSON.Point;
14 | expansion_zoom: number;
15 | spot_count: number;
16 | cluster_id: number;
17 | counts: ClusterCountsModel;
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/lib/models/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cluster.model';
2 | export * from './superclusters.model';
3 |
--------------------------------------------------------------------------------
/libs/api/clusters/src/lib/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './clusters.service';
2 |
--------------------------------------------------------------------------------
/libs/api/clusters/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017",
6 | "allowSyntheticDefaultImports": true
7 | },
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/libs/api/clusters/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/clusters/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/clusters/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/libs/api/common/README.md:
--------------------------------------------------------------------------------
1 | # api-common
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test api-common` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/api/common/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-common',
3 | preset: '../../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../../coverage/libs/api/common'
9 | };
10 |
--------------------------------------------------------------------------------
/libs/api/common/src/api-common.module.ts:
--------------------------------------------------------------------------------
1 | import { APP_FILTER } from '@nestjs/core';
2 | import { Module } from '@nestjs/common';
3 | import { AppConfig } from './config/app.config';
4 | import { ApiExceptionFilter } from './filters';
5 | import { Syslog } from './lib/syslog';
6 |
7 | @Module({
8 | controllers: [],
9 | providers: [
10 | AppConfig,
11 | ApiExceptionFilter,
12 | {
13 | provide: APP_FILTER,
14 | useClass: ApiExceptionFilter,
15 | },
16 | Syslog,
17 | ],
18 | exports: [
19 | AppConfig,
20 | Syslog,
21 | ]
22 | })
23 | export class ApiCommonModule {}
24 |
--------------------------------------------------------------------------------
/libs/api/common/src/config/app.config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, Optional, Logger } from '@nestjs/common';
2 | import { Env } from './env.config';
3 | const logger = new Logger('AppConfig');
4 |
5 | @Injectable()
6 | export class AppConfig {
7 | readonly NODE_ENV: Env = process.env.NODE_ENV as Env;
8 | readonly APP_HOST: string = process.env.APP_HOST;
9 | readonly API_HOST: string = process.env.API_HOST;
10 |
11 | constructor(@Optional() options: Partial = {}) {
12 | Object.assign(this, options);
13 | Object.keys(this).forEach(key => {
14 | if (this[key] === undefined || this[key] === NaN) {
15 | logger.error(key + ' in env is missing');
16 | }
17 | })
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/libs/api/common/src/config/env.config.ts:
--------------------------------------------------------------------------------
1 |
2 | export enum Env {
3 | PROD = 'prod', // slackmap.com
4 | STAGE = 'stage', // stage.slackmap.com
5 | NEXT = 'next', // next.slackmap.com
6 | TEST = 'test', // localhost jest test run
7 | DEV = 'development', // localhost development server
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/common/src/config/index.ts:
--------------------------------------------------------------------------------
1 | export * from './app.config';
2 | export * from './env.config';
3 |
--------------------------------------------------------------------------------
/libs/api/common/src/errors/index.ts:
--------------------------------------------------------------------------------
1 | export * from './errors';
2 |
--------------------------------------------------------------------------------
/libs/api/common/src/filters/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api-exception.filter';
2 |
--------------------------------------------------------------------------------
/libs/api/common/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './config';
2 | export * from './api-common.module';
3 | export * from './errors';
4 | export * from './lib/syslog';
5 | export * from './lib/rxjs';
6 |
--------------------------------------------------------------------------------
/libs/api/common/src/lib/rxjs/index.ts:
--------------------------------------------------------------------------------
1 | export * from './from-stream';
2 |
--------------------------------------------------------------------------------
/libs/api/common/src/lib/syslog.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, Scope, Inject } from '@nestjs/common';
2 | import { REQUEST } from '@nestjs/core';
3 | import { Request } from 'express';
4 |
5 | @Injectable({
6 | // scope: Scope.REQUEST
7 | })
8 | export class Syslog {
9 | // constructor(@Inject(REQUEST) private request: Request) {
10 | // console.log('new logger', request.url);
11 | // }
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/common/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/common/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/common/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/common/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/libs/api/config/README.md:
--------------------------------------------------------------------------------
1 | # api-config
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test api-config` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/api/config/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-config',
3 | preset: '../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../coverage/libs/api/config',
10 | };
11 |
--------------------------------------------------------------------------------
/libs/api/config/src/dto.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/dto';
2 | export * from './lib/models';
3 |
--------------------------------------------------------------------------------
/libs/api/config/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/api-config.module';
2 | export * from './lib/controllers/config.controller';
3 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/api-config.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { ConfigController } from './controllers/config.controller';
3 | import { ConfigGetUseCase } from './usecases';
4 | import { ApiFacebookModule } from '@slackmap/api/facebook';
5 | import { ApiCommonModule } from '@slackmap/api/common';
6 |
7 | @Module({
8 | imports: [ApiCommonModule, ApiFacebookModule],
9 | controllers: [ConfigController],
10 | providers: [ConfigGetUseCase],
11 | exports: [],
12 | })
13 | export class ApiConfigModule {}
14 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/controllers/config.controller.ts:
--------------------------------------------------------------------------------
1 | import { Controller, Get, Header } from '@nestjs/common';
2 | import { ConfigGetUseCase } from '../usecases';
3 | import { CONFIG_PATHS, ConfigGetDto } from '../dto';
4 | import { ConfigModel } from '../models';
5 |
6 | @Controller()
7 | export class ConfigController {
8 | constructor(private configGetUseCase: ConfigGetUseCase) { }
9 |
10 | @Get(CONFIG_PATHS.configGet())
11 | configGet(): Promise {
12 | return this.configGetUseCase.process();
13 | }
14 |
15 | @Get(CONFIG_PATHS.configJson())
16 | async configJson(): Promise {
17 |
18 | const {config} = await this.configGetUseCase.process();
19 |
20 | return config;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/dto/config.dto.ts:
--------------------------------------------------------------------------------
1 | import { ConfigModel } from '../models';
2 |
3 | export const CONFIG_PATHS = {
4 | configGet: () => 'config',
5 | configJson: () => 'config.json',
6 | }
7 |
8 | export class ConfigGetDto {
9 | config: ConfigModel;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/dto/index.ts:
--------------------------------------------------------------------------------
1 | export * from './config.dto';
2 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/models/api-config.model.ts:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * UI config
4 | */
5 | export class ConfigModel {
6 | /**
7 | * Domain on witch this app instance is running, exmpl: https://slackmap.com
8 | */
9 | APP_HOST: string;
10 |
11 | /**
12 | * Domain of the API this app should use, exmpl: https://api.slackmap.com
13 | */
14 | API_HOST: string;
15 |
16 | /**
17 | * 'SlackMap Facebook App ID
18 | */
19 | FACEBOOK_APP_ID: string;
20 |
21 | /**
22 | * Minimum scopes required for user to connect with facebook
23 | *
24 | * @uniqueItems
25 | */
26 | FACEBOOK_SCOPE: string[];
27 | }
28 |
29 | export class SettingsModel {
30 | imperial: boolean;
31 | }
32 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/models/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api-config.model';
2 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/usecases/config-get.usecase.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { Observable, of } from 'rxjs';
3 | import { ConfigGetDto } from '../dto';
4 | import { FacebookConfig } from '@slackmap/api/facebook';
5 | import { AppConfig } from '@slackmap/api/common';
6 |
7 | @Injectable()
8 | export class ConfigGetUseCase {
9 | constructor(
10 | private appConfig: AppConfig,
11 | private facebookConfig: FacebookConfig
12 | ) { }
13 | async process(): Promise {
14 | return {
15 | config: {
16 | APP_HOST: this.appConfig.APP_HOST,
17 | API_HOST: this.appConfig.API_HOST,
18 | FACEBOOK_APP_ID: this.facebookConfig.FACEBOOK_APP_ID,
19 | FACEBOOK_SCOPE: this.facebookConfig.FACEBOOK_SCOPE
20 | }
21 | };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/libs/api/config/src/lib/usecases/index.ts:
--------------------------------------------------------------------------------
1 | export * from './config-get.usecase';
2 |
--------------------------------------------------------------------------------
/libs/api/config/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/config/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/config/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/config/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/db/README.md:
--------------------------------------------------------------------------------
1 | # api-db
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test api-db` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/api/db/jest-setup.ts:
--------------------------------------------------------------------------------
1 | const { Logger } = require('@nestjs/common');
2 |
3 | /**
4 | * Setup scripts, runs before each test file
5 | */
6 |
7 | // change LOG_LEVEL for the tests
8 | // comment it if you need drivine logs for debugging
9 | Logger.overrideLogger(['error'])
10 |
--------------------------------------------------------------------------------
/libs/api/db/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-db',
3 | preset: '../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../coverage/libs/api/db',
10 | setupFiles: ["./jest-setup.ts"],
11 | };
12 |
--------------------------------------------------------------------------------
/libs/api/db/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/user';
2 | export * from './lib/db-utils';
3 | export * from './lib/api-db.module';
4 |
--------------------------------------------------------------------------------
/libs/api/db/src/lib/api-db.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { DrivineModule, DrivineModuleOptions } from '@liberation-data/drivine/DrivineModule';
3 | import { DatabaseRegistry } from '@liberation-data/drivine/connection/DatabaseRegistry';
4 | import { UserRepository } from './user';
5 | import { RidGenerator } from '@slackmap/core';
6 |
7 |
8 | @Module({
9 | imports:[
10 | DrivineModule.withOptions({
11 | connectionProviders: [DatabaseRegistry.buildOrResolveFromEnv()]
12 | }),
13 | ],
14 | controllers: [],
15 | providers: [
16 | RidGenerator,
17 | UserRepository,
18 | ],
19 | exports: [
20 | UserRepository,
21 | ],
22 | })
23 | export class ApiDbModule {}
24 |
--------------------------------------------------------------------------------
/libs/api/db/src/lib/db-utils.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Returns current date in the format for inserting in Neo4j database
3 | */
4 | export function now(): string {
5 | return (new Date()).toJSON()
6 | }
7 |
8 | export enum WhereOperator {
9 | AND = 'AND',
10 | OR = 'OR',
11 | }
12 |
13 | /**
14 | * Create params and where clasure form entity
15 | * Use this to search records by it's properites
16 | */
17 | export function createWhere(user: Object, comparator: WhereOperator = WhereOperator.AND): { params: any[], where: string } {
18 | const params = [];
19 | const where = [];
20 | for (const key in user) {
21 | if (user.hasOwnProperty(key)) {
22 | const value = user[key];
23 | params.push(value);
24 | where.push(`u.${key} = $${params.length}`)
25 | }
26 | }
27 | return {
28 | params,
29 | where: where.join(' ' + comparator + ' ')
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/libs/api/db/src/lib/location/index.ts:
--------------------------------------------------------------------------------
1 | export * from './location-path.entity';
2 |
--------------------------------------------------------------------------------
/libs/api/db/src/lib/location/location-path.entity.ts:
--------------------------------------------------------------------------------
1 | export interface LocationPathEntity {
2 | rid?: string;
3 | name?: string;
4 | code?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/db/src/lib/user/index.ts:
--------------------------------------------------------------------------------
1 | export * from './user.repository';
2 | export * from './user.entity';
3 |
--------------------------------------------------------------------------------
/libs/api/db/src/lib/user/user.entity.ts:
--------------------------------------------------------------------------------
1 | import { ItemType, UserSubtype } from '@slackmap/core';
2 |
3 | export class UserEntity {
4 | rid: string;
5 | type: ItemType.USER;
6 | subtype: UserSubtype;
7 | name: string;
8 | firstName?: string;
9 | lastName?: string;
10 | email?: string;
11 | facebookId?: string;
12 | createdAt?: string;
13 | imperial?: boolean;
14 | }
15 |
--------------------------------------------------------------------------------
/libs/api/db/src/testing/db-testing.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { UserFixture } from './fixtures/user.fixture';
3 | import { RidGenerator } from '@slackmap/core';
4 | import { ApiDbModule } from '../lib/api-db.module';
5 | import { SpotFixture } from './fixtures';
6 |
7 | @Module({
8 | imports: [ApiDbModule],
9 | providers: [
10 | UserFixture,
11 | RidGenerator,
12 | SpotFixture,
13 | ],
14 | exports: [
15 | UserFixture
16 | ],
17 | })
18 | export class DbTestingModule { }
19 |
--------------------------------------------------------------------------------
/libs/api/db/src/testing/fixtures/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spot.fixture';
2 | export * from './user.fixture';
3 |
--------------------------------------------------------------------------------
/libs/api/db/src/testing/index.ts:
--------------------------------------------------------------------------------
1 | export * from './fixtures';
2 | export * from './db-testing.module';
3 |
--------------------------------------------------------------------------------
/libs/api/db/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017",
6 | "allowSyntheticDefaultImports": true
7 | },
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/libs/api/db/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/db/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/db/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/facebook/README.md:
--------------------------------------------------------------------------------
1 | # api-facebook
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test api-facebook` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/api/facebook/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-facebook',
3 | preset: '../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../coverage/libs/api/facebook',
10 | };
11 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/dto.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/models';
2 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/api-facebook.module';
2 | export * from './lib/facebook.client';
3 | export * from './lib/facebook.config';
4 | export * from './lib/models';
5 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/lib/api-facebook.module.ts:
--------------------------------------------------------------------------------
1 | import { Module, HttpModule } from '@nestjs/common';
2 | import { FacebookClient } from './facebook.client';
3 | import { FacebookConfig } from './facebook.config';
4 |
5 | @Module({
6 | imports: [HttpModule],
7 | providers: [FacebookClient, FacebookConfig],
8 | exports: [FacebookClient, FacebookConfig],
9 | })
10 | export class ApiFacebookModule {}
11 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/lib/facebook.client.spec.ts:
--------------------------------------------------------------------------------
1 | import {FacebookClient} from './facebook.client';
2 | import { httpForFacebookClient } from '../testing';
3 | import { HttpService } from '@nestjs/common';
4 |
5 | const facebookGateway = new FacebookClient(httpForFacebookClient as HttpService);
6 |
7 | describe('FacebookClient', () => {
8 | describe('.me(token:string)', () => {
9 | test('should throw Invalid OAuth Error', () => {
10 | const token = 'fake-token';
11 | return facebookGateway.me(token).toPromise().then(
12 | fbProfile => {
13 | expect(true).toBeFalsy();
14 | },
15 | err => {
16 | expect(err).toBeDefined();
17 | expect(err.data).toBeDefined();
18 | expect(err.title).toContain(`We can't get your facebook profile :(`);
19 | }
20 | );
21 | });
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/lib/facebook.config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, Optional, Logger } from '@nestjs/common';
2 | const logger = new Logger('FacebookConfig');
3 |
4 | @Injectable()
5 | export class FacebookConfig {
6 | readonly FACEBOOK_APP_ID: string = process.env.FACEBOOK_APP_ID;
7 | readonly FACEBOOK_SECRET: string = process.env.FACEBOOK_SECRET;
8 | readonly FACEBOOK_SCOPE: string[] = (process.env.FACEBOOK_SCOPE) ? process.env.FACEBOOK_SCOPE.split(','): [];
9 |
10 | constructor(@Optional() options: Partial = {}) {
11 | Object.assign(this, options);
12 | Object.keys(this).forEach(key => {
13 | if (this[key] === undefined || this[key] === NaN) {
14 | logger.error(key + ' in env is missing');
15 | }
16 | })
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/lib/models/index.ts:
--------------------------------------------------------------------------------
1 | export * from './facebook.model';
2 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/testing/facebook-client.mock.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, HttpService } from '@nestjs/common';
2 | import { FacebookClient } from '@slackmap/api/facebook';
3 | import { Observable, of } from 'rxjs';
4 | import { FacebookFixture } from './facebook.fixture';
5 |
6 | export const httpForFacebookClient: Partial = {
7 | get(url, config): Observable {
8 | if (url === `https://graph.facebook.com/${FacebookClient.version}/me`) {
9 | const data = FacebookFixture.getByToken(config.params.access_token);
10 | return of({data});
11 | }
12 | throw new Error(`Request to ${url} needs mocking implementation in FacebookClientMock`)
13 | }
14 | }
15 | @Injectable()
16 | export class FacebookClientMock extends FacebookClient {
17 |
18 | constructor() {
19 | super(httpForFacebookClient as HttpService);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/libs/api/facebook/src/testing/index.ts:
--------------------------------------------------------------------------------
1 | export * from './facebook-client.mock';
2 | export * from './facebook.fixture';
3 |
--------------------------------------------------------------------------------
/libs/api/facebook/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/facebook/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/facebook/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/facebook/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/spot/data/jest-setup.ts:
--------------------------------------------------------------------------------
1 | const { Logger } = require('@nestjs/common');
2 |
3 | /**
4 | * Setup scripts, runs before each test file
5 | */
6 |
7 | // change LOG_LEVEL for the tests
8 | // comment it if you need drivine logs for debugging
9 | Logger.overrideLogger(['error'])
10 |
--------------------------------------------------------------------------------
/libs/api/spot/data/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-spot-data',
3 | preset: '../../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../../coverage/libs/api/spot/data',
10 | setupFiles: ["./jest-setup.ts"],
11 | };
12 |
--------------------------------------------------------------------------------
/libs/api/spot/data/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib';
2 |
--------------------------------------------------------------------------------
/libs/api/spot/data/src/lib/api-spot-data.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { SpotRepository } from './spot.repository';
3 | // import { SpotRepository } from './spot';
4 | @Module({
5 | controllers: [],
6 | providers: [
7 | SpotRepository
8 | ],
9 | exports: [
10 | SpotRepository
11 | ],
12 | })
13 | export class ApiSpotDataModule {}
14 |
--------------------------------------------------------------------------------
/libs/api/spot/data/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api-spot-data.module';
2 | export * from './spot.entity';
3 | export * from './spot.repository';
4 |
--------------------------------------------------------------------------------
/libs/api/spot/data/src/lib/spot.entity.ts:
--------------------------------------------------------------------------------
1 | import { ItemType, SpotSubtype, SportType, Poi, Item } from '@slackmap/core';
2 | import { GeoJSON } from '@slackmap/gis';
3 |
4 | export class SpotEntity implements Poi, Item {
5 | // item
6 | rid: string;
7 | type: ItemType.SPOT;
8 | subtype: SpotSubtype;
9 | version: number;
10 |
11 | // poi
12 | lat: number;
13 | lon: number;
14 | geohash: string;
15 | geometry: GeoJSON.Geometry;
16 | bbox: GeoJSON.BBox;
17 |
18 | // spot
19 | sport: SportType;
20 | name?: string;
21 | length?: number;
22 | height?: number;
23 | lengthLaser?: boolean;
24 | heightLaser?: boolean;
25 | access?: number;
26 | climbing?: number;
27 | exposure?: number;
28 | createdAt?: string;
29 | }
30 |
--------------------------------------------------------------------------------
/libs/api/spot/data/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/spot/data/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/spot/data/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/spot/data/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-spot-domain',
3 | preset: '../../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../../coverage/libs/api/spot/domain',
10 | };
11 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/api-spot-domain.module';
2 | export * from './lib/controllers/spot-save.controller';
3 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/src/lib/api-spot-domain.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { SpotSaveController } from './controllers/spot-save.controller';
3 | import { ApiSpotDataModule } from '@slackmap/api/spot/data';
4 |
5 | @Module({
6 | imports: [ApiSpotDataModule],
7 | controllers: [SpotSaveController],
8 | })
9 | export class ApiSpotDomainModule {}
10 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/src/lib/controllers/spot-save.controller.spec.ts:
--------------------------------------------------------------------------------
1 | import { Test } from '@nestjs/testing';
2 | import { SpotSaveController } from './spot-save.controller';
3 |
4 | describe('ApiSpotDomainController', () => {
5 | let controller: SpotSaveController;
6 |
7 | beforeEach(async () => {
8 | const module = await Test.createTestingModule({
9 | providers: [],
10 | controllers: [SpotSaveController],
11 | }).compile();
12 |
13 | controller = module.get(SpotSaveController);
14 | });
15 |
16 | it('should be defined', () => {
17 | expect(controller).toBeTruthy();
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/src/lib/controllers/spot-save.controller.ts:
--------------------------------------------------------------------------------
1 | import { Controller, Post, Body } from '@nestjs/common';
2 | import { Transactional } from '@liberation-data/drivine';
3 | import { SPOT_PATHS, SpotSaveRequestDto, SpotSaveDto } from '@slackmap/api/spot/dto';
4 | import { SpotRepository } from '@slackmap/api/spot/data';
5 |
6 | @Controller()
7 | export class SpotSaveController {
8 |
9 | constructor(
10 | private spotRepository: SpotRepository,
11 | ) {}
12 |
13 | @Post(SPOT_PATHS.save())
14 | @Transactional()
15 | async process(@Body() data: SpotSaveRequestDto): Promise {
16 |
17 | const spot = await this.spotRepository.create(data.spot)
18 |
19 | return {spot}
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/spot/domain/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-spot-dto',
3 | preset: '../../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../../coverage/libs/api/spot/dto',
10 | };
11 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/api-spot.dto';
2 | export * from './lib/api-spot.model';
3 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/src/lib/api-spot.dto.ts:
--------------------------------------------------------------------------------
1 | import { SpotModel } from './api-spot.model';
2 |
3 | export const SPOT_PATHS = {
4 | save: () => 'spot/save'
5 | }
6 |
7 | export class SpotSaveRequestDto {
8 | spot: SpotModel;
9 | }
10 | export class SpotSaveDto {
11 | spot: SpotModel;
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/src/lib/api-spot.model.ts:
--------------------------------------------------------------------------------
1 | import { ItemType, SpotSubtype, SportType, Poi, Item, AccessType, StatusType } from '@slackmap/core';
2 | import { GeoJSON } from '@slackmap/gis';
3 |
4 | export class SpotModel {
5 | // item
6 | rid: string;
7 | type: ItemType.SPOT;
8 | subtype: SpotSubtype;
9 |
10 | // poi
11 | lat: number;
12 | lon: number;
13 | geometry: GeoJSON.Geometry;
14 | bbox: GeoJSON.BBox;
15 | geohash: string;
16 |
17 | // spot
18 | sport: SportType;
19 | name?: string;
20 | length?: number;
21 | height?: number;
22 | lengthLaser?: boolean;
23 | heightLaser?: boolean;
24 | access?: AccessType;
25 | status?: StatusType;
26 | climbing?: number;
27 | exposure?: number;
28 | createdAt?: string;
29 | }
30 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es6"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/spot/dto/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'api-spot-testing',
3 | preset: '../../../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../../../coverage/libs/api/spot/testing',
10 | };
11 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib';
2 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/src/lib/api-spot-testing.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { SpotFixture } from './spot.fixture';
3 | import { ApiDbModule } from '@slackmap/api/db';
4 | import { RidGenerator } from '@slackmap/core';
5 |
6 | @Module({
7 | imports: [ApiDbModule],
8 | providers: [SpotFixture, RidGenerator],
9 | exports: [SpotFixture],
10 | })
11 | export class ApiSpotTestingModule {}
12 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api-spot-testing.module';
2 | export * from './spot.fixture';
3 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"],
5 | "target": "es2017"
6 | },
7 | "include": ["**/*.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "outDir": "../../../../dist/out-tsc",
6 | "declaration": true,
7 | "rootDir": "./src",
8 | "types": ["node"]
9 | },
10 | "exclude": ["**/*.spec.ts"],
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/api/spot/testing/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/core/README.md:
--------------------------------------------------------------------------------
1 | # core
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test core` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/core/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'core',
3 | preset: '../../jest.config.js',
4 | transform: {
5 | '^.+\\.[tj]sx?$': 'ts-jest'
6 | },
7 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8 | coverageDirectory: '../../coverage/libs/core'
9 | };
10 |
--------------------------------------------------------------------------------
/libs/core/src/core.spec.ts:
--------------------------------------------------------------------------------
1 | describe('core', () => {
2 | it('Test', () => {
3 | expect(true).toBeTruthy();
4 | });
5 | });
6 |
--------------------------------------------------------------------------------
/libs/core/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib';
2 |
--------------------------------------------------------------------------------
/libs/core/src/lib/core-models.ts:
--------------------------------------------------------------------------------
1 | export enum Gender {
2 | MALE = 'male',
3 | FEMALE = 'female',
4 | CUSTOM = 'custom',
5 | }
6 | export interface GenderOption {
7 | value: Gender,
8 | label: string
9 | }
10 | export const GENDER_OPTIONS: GenderOption[] = [
11 | {value: Gender.MALE, label: 'Male'},
12 | {value: Gender.FEMALE, label: 'Female'},
13 | {value: Gender.CUSTOM, label: 'Custom'},
14 | ]
15 |
--------------------------------------------------------------------------------
/libs/core/src/lib/helpers.ts:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * helper functions
4 | */
5 | export function isObject(value) {
6 | const type = typeof value;
7 | return value != null && (type === 'object' || type === 'function');
8 | }
9 | export function isNumber(value) {
10 | return Number.isInteger(value);
11 | }
12 | export function isNumeric(n: any) {
13 | return !isNaN(parseFloat(n)) && isFinite(n);
14 | }
15 |
--------------------------------------------------------------------------------
/libs/core/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | export * from './climbing';
2 | export * from './core-models';
3 | export * from './helpers';
4 | export * from './item-rid-old';
5 | export * from './item-rid';
6 | export * from './item-type-options';
7 | export * from './item-type';
8 | export * from './item-utils';
9 | export * from './layer-options';
10 | export * from './like';
11 | export * from './measure';
12 | export * from './photo';
13 | export * from './rid-generator';
14 | export * from './spot-access';
15 | export * from './spot-shape-type';
16 | export * from './sub-sink';
17 | export * from './interfaces';
18 | export * from './spot-status';
19 |
--------------------------------------------------------------------------------
/libs/core/src/lib/interfaces/core.interface.ts:
--------------------------------------------------------------------------------
1 | import { ItemType, ItemSubtype } from '../item-type';
2 | import { GeoJSON } from '@slackmap/gis';
3 |
4 | export const MAP_ZOOM_THRESHOLD = 16;
5 |
6 | export interface Item {
7 | rid: string;
8 | type: ItemType;
9 | subtype: ItemSubtype;
10 | version: number;
11 | }
12 |
13 | /**
14 | * Implement this interface if your entity want's to be indexed as map POI
15 | */
16 | export interface Poi {
17 | lat: number;
18 | lon: number;
19 | geohash: string;
20 | geometry: GeoJSON.Geometry;
21 | bbox: GeoJSON.BBox;
22 | }
23 |
24 | export type PoiItem = Poi & Item;
25 |
--------------------------------------------------------------------------------
/libs/core/src/lib/interfaces/index.ts:
--------------------------------------------------------------------------------
1 | export * from './core.interface';
2 |
--------------------------------------------------------------------------------
/libs/core/src/lib/layer-options.ts:
--------------------------------------------------------------------------------
1 |
2 | export enum SportType {
3 | SLACKLINE = 1,
4 | DIVING = 2,
5 | TRAMPOLINE = 3
6 | }
7 | export enum SportName {
8 | SLACKLINE = 'slackline',
9 | DIVING = 'diving',
10 | TRAMPOLINE = 'trampoline'
11 | }
12 |
13 | export interface SportOption {
14 | id: SportType;
15 | name: SportName;
16 | label: string;
17 | }
18 |
19 | export const SPORT_OPTIONS: SportOption[] = [
20 | {
21 | id: SportType.SLACKLINE,
22 | name: SportName.SLACKLINE,
23 | label: 'Slackline'
24 | },
25 | {
26 | id: SportType.DIVING,
27 | name: SportName.DIVING,
28 | label: 'Diving'
29 | },
30 | {
31 | id: SportType.TRAMPOLINE,
32 | name: SportName.TRAMPOLINE,
33 | label: 'Trampoline'
34 | }
35 | ]
36 |
37 | export function getSportName(type: SportType, names = SportName): SportName {
38 | return names[SportType[type]];
39 | }
40 |
--------------------------------------------------------------------------------
/libs/core/src/lib/like.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 | export enum DislikeReason {
4 | DOES_NOT_EXISTS = 1,
5 | IT_IS_NOT_HELPFUL = 2,
6 | JUST_DONT = 3
7 | }
8 |
9 | export const DISLIKE_REASONS = {
10 | 1: `does not exist`,
11 | 2: `it's not helpful`,
12 | 3: `just don't`
13 | };
14 |
--------------------------------------------------------------------------------
/libs/core/src/lib/measure.ts:
--------------------------------------------------------------------------------
1 | export enum MeasureConvertType {
2 | IMPERIAL_TO_METRIC,
3 | METRIC_TO_IMPERIAL
4 | }
5 | export class Measure {
6 | static IMPERIAL_TO_METRIC = MeasureConvertType.IMPERIAL_TO_METRIC;
7 | static METRIC_TO_IMPERIAL = MeasureConvertType.METRIC_TO_IMPERIAL;
8 |
9 | /**
10 | *
11 | * @param v
12 | * @param convertType
13 | * @returns number
14 | */
15 | static convert(v: number, convertType: MeasureConvertType): number {
16 | if (convertType === Measure.METRIC_TO_IMPERIAL) {
17 | return round(v * 3.280839895);
18 | } else if (convertType === Measure.IMPERIAL_TO_METRIC) {
19 | return round(v / 3.280839895);
20 | } else {
21 | return v;
22 | }
23 | }
24 | }
25 |
26 | function round(which) {
27 | return Math.round(which * 100) / 100;
28 | }
29 |
--------------------------------------------------------------------------------
/libs/core/src/lib/photo.ts:
--------------------------------------------------------------------------------
1 |
2 | export enum PhotoSize {
3 | XS_S = 'xs_s',
4 | S_S = 's_s',
5 | L = 'l'
6 | }
7 |
8 | export const PHOTO_SIZES = {
9 | xs_s: true,
10 | s_s: true,
11 | l: true
12 | };
13 |
14 | export const PHOTO_PLACEHOLDER = {
15 | xs_s: '/assets/images/image-placeholder-xs.jpg',
16 | s_s: '/assets/images/image-placeholder-xs.jpg',
17 | l: '/assets/images/image-placeholder-xs.jpg'
18 | };
19 |
--------------------------------------------------------------------------------
/libs/core/src/lib/spot-access.ts:
--------------------------------------------------------------------------------
1 |
2 | export enum AccessType {
3 | OPEN = 1,
4 | RESTRICTED = 2,
5 | FORBIDDEN = 3,
6 | UNKNOWN = 4
7 | }
8 |
9 | export interface AccessOption {
10 | id: AccessType;
11 | name: string;
12 | label: string;
13 | cls: string;
14 | }
15 |
16 | export const ACCESS_OPTIONS: AccessOption[] = [
17 | {id: AccessType.OPEN, name: 'open', label: 'Open', cls: 'success'},
18 | {
19 | id: AccessType.RESTRICTED,
20 | name: 'restricted',
21 | label: 'Restricted',
22 | cls: 'warning'
23 | },
24 | {
25 | id: AccessType.FORBIDDEN,
26 | name: 'forbidden',
27 | label: 'Forbidden',
28 | cls: 'danger'
29 | },
30 | {
31 | id: AccessType.UNKNOWN,
32 | name: 'unknown',
33 | label: `I don't know`,
34 | cls: 'default'
35 | }
36 | ];
37 |
38 |
39 |
--------------------------------------------------------------------------------
/libs/core/src/lib/spot-shape-type.ts:
--------------------------------------------------------------------------------
1 |
2 | export enum DrawType {
3 | LINE = 'LINE',
4 | POLYGON = 'AREA',
5 | }
6 |
--------------------------------------------------------------------------------
/libs/core/src/lib/spot-status.ts:
--------------------------------------------------------------------------------
1 |
2 | export enum StatusType {
3 | ACTIVE = 1,
4 | PROJECT = 2,
5 | CLOSED = 3,
6 | }
7 |
8 | export interface StatusOption {
9 | id: StatusType;
10 | name: string;
11 | label: string;
12 | cls: string;
13 | }
14 |
15 | export const STATUS_OPTIONS: StatusOption[] = [
16 | {
17 | id: StatusType.ACTIVE,
18 | name: 'active',
19 | label: 'Active',
20 | cls: 'success'
21 | },
22 | {
23 | id: StatusType.PROJECT,
24 | name: 'project',
25 | label: 'Project',
26 | cls: 'warning'
27 | },
28 | {
29 | id: StatusType.CLOSED,
30 | name: 'closed',
31 | label: 'Closed',
32 | cls: 'danger'
33 | }
34 | ];
35 |
36 |
37 |
--------------------------------------------------------------------------------
/libs/core/src/lib/sub-sink.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Helper class for creating Subcriptions bucket to unsubscribe all at onece
3 | */
4 | export interface Subscription {
5 | unsubscribe(): void;
6 | }
7 | export interface Observable {
8 | subscribe(options: any): Subscription;
9 | }
10 | export class SubSink {
11 |
12 | private subscriptions = [];
13 |
14 | set add(subscription: Subscription) {
15 | this.subscriptions.push(subscription);
16 | }
17 |
18 | set subscribe(observable: Observable) {
19 | this.subscriptions.push(observable.subscribe({
20 | error: () => {}
21 | }));
22 | }
23 |
24 | unsubscribe(): void {
25 | this.subscriptions.forEach(sub => sub.unsubscribe());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/libs/core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/core/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/libs/core/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/core/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {},
4 | "linterOptions": {
5 | "exclude": [
6 | "!**/*"
7 | ]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/libs/gis/README.md:
--------------------------------------------------------------------------------
1 | # gis
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `ng test gis` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/libs/gis/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'gis',
3 | preset: '../../jest.config.js',
4 | testEnvironment: 'node',
5 | transform: {
6 | '^.+\\.[tj]sx?$': 'ts-jest',
7 | },
8 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
9 | coverageDirectory: '../../coverage/libs/gis',
10 | };
11 |
--------------------------------------------------------------------------------
/libs/gis/src/index.ts:
--------------------------------------------------------------------------------
1 | import * as GeoJSON from './lib/geojson';
2 |
3 | export { GeoJSON };
4 |
--------------------------------------------------------------------------------
/libs/gis/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/gis/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": []
6 | },
7 | "exclude": ["**/*.spec.ts"],
8 | "include": ["**/*.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/libs/gis/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.spec.ts",
10 | "**/*.spec.tsx",
11 | "**/*.spec.js",
12 | "**/*.spec.jsx",
13 | "**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/libs/gis/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "linterOptions": { "exclude": ["!**/*"] },
4 | "rules": {}
5 | }
6 |
--------------------------------------------------------------------------------
/libs/ui/add/README.md:
--------------------------------------------------------------------------------
1 | # ui-add
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-add` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/add/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-add',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/add',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/add/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/ui-add.module';
2 | export * from './lib/+add';
3 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/+add/add.facade.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { select, Store, Action } from '@ngrx/store';
3 | import * as fromAdd from './add.reducer';
4 | import * as AddSelectors from './add.selectors';
5 | import * as AddActions from './add.actions';
6 |
7 | @Injectable()
8 | export class AddFacade {
9 | addState$ = this.store.pipe(select(AddSelectors.getAddState));
10 | sport$ = this.store.pipe(select(AddSelectors.getSport));
11 | drawType$ = this.store.pipe(select(AddSelectors.getDrawType));
12 | drawData$ = this.store.pipe(select(AddSelectors.getDrawData));
13 | spot$ = this.store.pipe(select(AddSelectors.getSpot));
14 | spotData$ = this.store.pipe(select(AddSelectors.getSpotData));
15 | subtypeOptions$ = this.store.pipe(select(AddSelectors.getSubtypeOptions));
16 |
17 | constructor(private store: Store) {}
18 |
19 | dispatch(action: Action) {
20 | this.store.dispatch(action);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/+add/add.models.ts:
--------------------------------------------------------------------------------
1 | import { DrawType } from '@slackmap/ui/map';
2 | import { SportType } from '@slackmap/core';
3 |
4 | /**
5 | * Model for update action
6 | */
7 | export interface AddStateModel {
8 | sport: SportType;
9 | drawType: DrawType;
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/+add/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import * as AddActions from './add.actions';
3 | import * as AddSelectors from './add.selectors';
4 | export { AddActions, AddSelectors };
5 | export * from './add.reducer';
6 | export * from './add.models';
7 | export * from './add.facade';
8 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/components/sport-select/sport-select.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | add_circle_outline
4 | Add new spot
5 |
6 |
7 | Choose sport
8 |
9 |
10 | {{option.label}}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/components/sport-select/sport-select.component.scss:
--------------------------------------------------------------------------------
1 | mat-card {
2 | margin: 5px;
3 | cursor: pointer;
4 | }
5 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/components/sport-select/sport-select.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { AddFacade, AddActions } from '../../+add';
3 | import { SPORT_OPTIONS, SportOption } from "@slackmap/core";
4 |
5 | @Component({
6 | selector: 'add-sport-select',
7 | templateUrl: './sport-select.component.html',
8 | styleUrls: ['./sport-select.component.scss']
9 | })
10 | export class SportSelectComponent implements OnInit {
11 |
12 | sport$ = this.addFacade.sport$;
13 |
14 | options = SPORT_OPTIONS;
15 |
16 | constructor(
17 | public addFacade: AddFacade,
18 | ) { }
19 |
20 | ngOnInit(): void {
21 | }
22 |
23 | onSportSelect(option: SportOption) {
24 | this.addFacade.dispatch(AddActions.setSport({sport: option.id}))
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/forms/slackline/slackline.form.scss:
--------------------------------------------------------------------------------
1 | .draw-type-select {
2 | flex-wrap: wrap;
3 | width: 100%;
4 | mat-button-toggle {
5 | flex-grow: 1;
6 | text-align: center;
7 | }
8 | }
9 | mat-form-field {
10 | width: 100%;
11 | }
12 | form {
13 | padding: 10px;
14 | display: block;
15 | }
16 | .save-btn {
17 | width: 100%;
18 | margin: 40px 0;
19 | }
20 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/inputs/distance/distance.input.html:
--------------------------------------------------------------------------------
1 |
2 | {{ imperial ? 'ft' : 'm'}}
3 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/inputs/distance/distance.input.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: flex;
3 | }
4 |
5 | input {
6 | width: 100%;
7 | opacity: 0;
8 | transition: opacity 200ms;
9 | border: none;
10 | background: none;
11 | padding: 0;
12 | outline: none;
13 | font: inherit;
14 | }
15 |
16 | span {
17 | opacity: 0;
18 | transition: opacity 200ms;
19 | width: 20px;
20 | display: block;
21 | padding: 0 13px;
22 | }
23 |
24 | :host.is-floating .el {
25 | opacity: 1;
26 | }
27 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/inputs/subtype/subtype.input.html:
--------------------------------------------------------------------------------
1 |
7 |
8 | NOT IMPLEMENTED
9 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/inputs/subtype/subtype.input.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/libs/ui/add/src/lib/inputs/subtype/subtype.input.scss
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/inputs/subtype/subtype.input.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Input } from '@angular/core';
2 | import { SUBTYPE_OPTIONS, ItemType, DrawType } from "@slackmap/core";
3 | @Component({
4 | selector: 'add-subtype-input',
5 | templateUrl: './subtype.input.html',
6 | styleUrls: ['./subtype.input.scss']
7 | })
8 | export class SubtypeInput implements OnInit {
9 |
10 | options = SUBTYPE_OPTIONS.filter(o => (o.type === ItemType.SPOT && o.shape === DrawType.LINE));
11 |
12 | @Input()
13 | name: string;
14 |
15 | constructor() { }
16 |
17 | ngOnInit(): void {
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/libs/ui/add/src/lib/pages/add/add.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/libs/ui/add/src/lib/pages/add/add.page.scss
--------------------------------------------------------------------------------
/libs/ui/add/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/add/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/add/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/add/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/add/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "add", "camelCase"],
5 | "component-selector": [true, "element", "add", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/api/README.md:
--------------------------------------------------------------------------------
1 | # ui-api
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-api` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/api/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-api',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/api',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js'
9 | ]
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/api/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/ui-api.module';
2 | export * from './lib/ui-api.service';
3 |
--------------------------------------------------------------------------------
/libs/ui/api/src/lib/jwt-token.interceptor.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { JwtTokenInterceptor } from './jwt-token.interceptor';
4 |
5 | describe('JwtTokenInterceptor', () => {
6 | beforeEach(() => TestBed.configureTestingModule({
7 | providers: [
8 | JwtTokenInterceptor
9 | ]
10 | }));
11 |
12 | it('should be created', () => {
13 | const interceptor: JwtTokenInterceptor = TestBed.inject(JwtTokenInterceptor);
14 | expect(interceptor).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/libs/ui/api/src/lib/jwt-token.interceptor.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import {
3 | HttpRequest,
4 | HttpHandler,
5 | HttpEvent,
6 | HttpInterceptor
7 | } from '@angular/common/http';
8 | import { Observable } from 'rxjs';
9 | import { UiApiService } from './ui-api.service';
10 |
11 | @Injectable()
12 | export class JwtTokenInterceptor implements HttpInterceptor {
13 |
14 | constructor(
15 | private apiService: UiApiService
16 | ) {}
17 |
18 | intercept(request: HttpRequest, next: HttpHandler): Observable> {
19 | const apiToken = this.apiService.getToken();
20 | const headers: any = {
21 | 'ngsw-bypass': ''
22 | };
23 | if(apiToken) {
24 | headers.Authorization = `Bearer ${apiToken}`;
25 | }
26 | request = request.clone({
27 | setHeaders: headers
28 | });
29 | return next.handle(request);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/libs/ui/api/src/lib/ui-api.module.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, TestBed } from '@angular/core/testing';
2 | import { UiApiModule } from './ui-api.module';
3 |
4 | describe('ApiModule', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | imports: [UiApiModule]
8 | }).compileComponents();
9 | }));
10 |
11 | it('should create', () => {
12 | expect(UiApiModule).toBeDefined();
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/libs/ui/api/src/lib/ui-api.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
4 | import { JwtTokenInterceptor } from './jwt-token.interceptor';
5 |
6 | @NgModule({
7 | imports: [
8 | CommonModule,
9 | HttpClientModule
10 | ],
11 | providers: [
12 | {
13 | provide: HTTP_INTERCEPTORS,
14 | multi: true,
15 | useClass: JwtTokenInterceptor
16 | },
17 | ],
18 | exports: []
19 | })
20 | export class UiApiModule { }
21 |
--------------------------------------------------------------------------------
/libs/ui/api/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/api/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/api/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/api/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "angularCompilerOptions": {
4 | "enableIvy": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/api/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/api/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "slackmap",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "slackmap",
14 | "kebab-case"
15 | ]
16 | },
17 | "linterOptions": {
18 | "exclude": [
19 | "!**/*"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/libs/ui/auth/README.md:
--------------------------------------------------------------------------------
1 | # ui-auth
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-auth` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/auth/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-auth',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/auth',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib';
2 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/+auth/auth.models.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Interface for the 'Auth' data
3 | */
4 | export interface AuthEntity {
5 | id: string | number; // Primary ID
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/+auth/auth.selectors.ts:
--------------------------------------------------------------------------------
1 | import { createFeatureSelector, createSelector } from '@ngrx/store';
2 | import {
3 | AUTH_FEATURE_KEY,
4 | AuthState,
5 | AuthPartialState,
6 | } from './auth.reducer';
7 |
8 | // Lookup the 'Auth' feature state managed by NgRx
9 | export const getAuthState = createFeatureSelector(
10 | AUTH_FEATURE_KEY
11 | );
12 |
13 | export const getSignUpByFacebook = createSelector(
14 | getAuthState,
15 | state => state.signUpByFacebook
16 | )
17 | export const getUser = createSelector(
18 | getAuthState,
19 | state => state.user
20 | )
21 | export const getSettings = createSelector(
22 | getAuthState,
23 | state => state.settings
24 | )
25 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/+auth/index.ts:
--------------------------------------------------------------------------------
1 | import * as AuthActions from './auth.actions';
2 | import * as AuthFeature from './auth.reducer';
3 | import * as AuthSelectors from './auth.selectors';
4 | export { AuthActions, AuthFeature, AuthSelectors };
5 | export * from './auth.models';
6 | export * from './auth.facade';
7 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/dialogs/index.ts:
--------------------------------------------------------------------------------
1 | export * from './login/login.dialog';
2 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/directives/sign-in.directive.ts:
--------------------------------------------------------------------------------
1 | import { Directive, HostListener } from '@angular/core';
2 | import { AuthFacade, AuthActions } from '../+auth';
3 |
4 | @Directive({
5 | selector: '[authSignIn]'
6 | })
7 | export class SignInDirective {
8 |
9 | constructor(
10 | private authFacade: AuthFacade,
11 | ) { }
12 |
13 | @HostListener('click', ['$event'])
14 | onClick($event) {
15 | this.authFacade.dispatch(AuthActions.signIn())
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ui-auth.module';
2 | export * from './services';
3 | export * from './+auth';
4 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/lib/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth.service';
2 |
--------------------------------------------------------------------------------
/libs/ui/auth/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/auth/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/auth/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/auth/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/auth/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "auth", "camelCase"],
5 | "component-selector": [true, "element", "auth", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/README.md:
--------------------------------------------------------------------------------
1 | # ui-common-dispatcher
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-common-dispatcher` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-common-dispatcher',
3 | preset: '../../../../jest.config.js',
4 | coverageDirectory: '../../../../coverage/libs/ui/common/dispatcher',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/dispatcher.module';
2 | export * from './lib/dispatcher';
3 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/src/lib/dispatcher.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 |
4 | @NgModule({
5 | imports: [CommonModule],
6 | })
7 | export class DispatcherModule {}
8 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/src/lib/dispatcher.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Store, Action, ActionCreator } from '@ngrx/store';
3 | import { Observable } from 'rxjs';
4 | import { Actions, ofType } from '@ngrx/effects';
5 | import { takeUntil } from 'rxjs/operators';
6 |
7 | @Injectable({providedIn: 'root'})
8 | export class Dispatcher {
9 |
10 | constructor(
11 | private actions$: Actions,
12 | private store: Store
13 | ) {}
14 |
15 | run(action: Action, untilActions: ActionCreator[]): Observable {
16 | return new Observable(subscriber => {
17 | this.store.dispatch(action);
18 | }).pipe(
19 | takeUntil(this.actions$.pipe(ofType(...untilActions)))
20 | )
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/dispatcher/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "dispatcher", "camelCase"],
5 | "component-selector": [true, "element", "dispatcher", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/README.md:
--------------------------------------------------------------------------------
1 | # ui-common-errors
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-common-errors` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-common-errors',
3 | preset: '../../../../jest.config.js',
4 | coverageDirectory: '../../../../coverage/libs/ui/common/errors',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/errors.module';
2 | export * from './lib/error.service';
3 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/dialogs/error/error.dialog.html:
--------------------------------------------------------------------------------
1 | Error
2 |
3 | {{data.error.message}}
4 |
5 | {{data.error | json}}
6 |
7 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/dialogs/error/error.dialog.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/libs/ui/common/errors/src/lib/dialogs/error/error.dialog.scss
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/dialogs/error/error.dialog.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { ErrorDialog } from './error.dialog';
4 |
5 | describe('ErrorDialog', () => {
6 | let component: ErrorDialog;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ ErrorDialog ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(ErrorDialog);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/dialogs/error/error.dialog.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Inject } from '@angular/core';
2 | import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
3 |
4 | @Component({
5 | selector: 'sm-error',
6 | templateUrl: './error.dialog.html',
7 | styleUrls: ['./error.dialog.scss']
8 | })
9 | export class ErrorDialog implements OnInit {
10 |
11 | constructor(
12 | @Inject(MAT_DIALOG_DATA)
13 | public data: {error: any},
14 | private dialog: MatDialogRef
15 | ) { }
16 |
17 | onClose(): void {
18 | this.dialog.close();
19 | }
20 | ngOnInit(): void {
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/error.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { MatDialog } from '@angular/material/dialog';
3 | import { ErrorDialog } from './dialogs/error/error.dialog';
4 |
5 | @Injectable()
6 | export class ErrorService {
7 |
8 | constructor(
9 | private dialog: MatDialog,
10 | ) {}
11 |
12 | show(data: {error: any}) {
13 | console.error(data.error);
14 | this.dialog.open(ErrorDialog, {
15 | data
16 | // width: '50%',
17 | // maxWidth: '100vw',
18 | // maxHeight: '100vh',
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/errors.module.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, TestBed } from '@angular/core/testing';
2 | import { ErrorsModule } from './errors.module';
3 |
4 | describe('ErrorsModule', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | imports: [ErrorsModule],
8 | }).compileComponents();
9 | }));
10 |
11 | it('should create', () => {
12 | expect(ErrorsModule).toBeDefined();
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/lib/errors.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { ErrorDialog } from './dialogs/error/error.dialog';
4 | import { MatIconModule } from "@angular/material/icon";
5 | import { MatButtonModule } from "@angular/material/button";
6 | import { MatDialogModule } from "@angular/material/dialog";
7 | import { ErrorService } from './error.service';
8 | @NgModule({
9 | imports: [
10 | CommonModule,
11 | MatIconModule,
12 | MatButtonModule,
13 | MatDialogModule
14 | ],
15 | providers: [ErrorService],
16 | declarations: [ErrorDialog],
17 | // exports: [ErrorService],
18 | })
19 | export class ErrorsModule {}
20 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/errors/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "sm", "camelCase"],
5 | "component-selector": [true, "element", "sm", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/README.md:
--------------------------------------------------------------------------------
1 | # ui-common-loader
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-common-loader` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-common-loader',
3 | preset: '../../../../jest.config.js',
4 | coverageDirectory: '../../../../coverage/libs/ui/common/loader',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/loader.module';
2 | export * from './lib/loader';
3 | export * from './lib/loader-overlay/loader-overlay.component';
4 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/lib/loader-overlay/loader-overlay.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/lib/loader-overlay/loader-overlay.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { LoaderOverlayComponent } from './loader-overlay.component';
4 |
5 | describe('LoaderOverlayComponent', () => {
6 | let component: LoaderOverlayComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ LoaderOverlayComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(LoaderOverlayComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/lib/loader-overlay/loader-overlay.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Loader } from '../loader';
3 |
4 | @Component({
5 | selector: 'sm-loader-overlay',
6 | templateUrl: './loader-overlay.component.html',
7 | styleUrls: ['./loader-overlay.component.scss']
8 | })
9 | export class LoaderOverlayComponent implements OnInit {
10 |
11 | constructor(
12 | public loader: Loader
13 | ) { }
14 |
15 | ngOnInit(): void {
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/lib/loader.module.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, TestBed } from '@angular/core/testing';
2 | import { LoaderModule } from './loader.module';
3 |
4 | describe('LoaderModule', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | imports: [LoaderModule],
8 | }).compileComponents();
9 | }));
10 |
11 | it('should create', () => {
12 | expect(LoaderModule).toBeDefined();
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/lib/loader.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { LoaderOverlayComponent } from './loader-overlay/loader-overlay.component';
4 |
5 | @NgModule({
6 | imports: [CommonModule],
7 | declarations: [LoaderOverlayComponent],
8 | exports: [LoaderOverlayComponent],
9 | })
10 | export class LoaderModule {}
11 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/lib/loader.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Observable } from 'rxjs';
3 |
4 | @Injectable({providedIn: 'root'})
5 | export class Loader {
6 |
7 | private counter = 0;
8 |
9 | constructor(
10 | ) {}
11 | loadingOverlay(): (in$: Observable) => Observable {
12 | return (in$: Observable): Observable => {
13 | return new Observable(observer => {
14 | this.showLoader();
15 | const sub = in$.subscribe({
16 | next: (v) => observer.next(v),
17 | error: (err) => observer.error(err),
18 | complete: () => observer.complete(),
19 | })
20 | return () => {
21 | this.hideLoader()
22 | sub.unsubscribe();
23 | }
24 | })
25 | }
26 | }
27 | get isLoading(): boolean {
28 | return !!this.counter;
29 | }
30 | private showLoader() {
31 | this.counter++
32 | }
33 |
34 | private hideLoader() {
35 | this.counter--;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/loader/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "slackmap", "camelCase"],
5 | "component-selector": [true, "element", "slackmap", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/README.md:
--------------------------------------------------------------------------------
1 | # ui-common-utils
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-common-utils` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-common-utils',
3 | preset: '../../../../jest.config.js',
4 | coverageDirectory: '../../../../coverage/libs/ui/common/utils',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/array-diff.operator';
2 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/common/utils/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "utils", "camelCase"],
5 | "component-selector": [true, "element", "utils", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/config/README.md:
--------------------------------------------------------------------------------
1 | # ui-config
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-config` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/config/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-config',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/config',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js',
9 | ],
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/config/src/index.ts:
--------------------------------------------------------------------------------
1 | import * as ConfigActions from './lib/+config/config.actions';
2 | import * as ConfigFeature from './lib/+config/config.reducer';
3 | import * as ConfigSelectors from './lib/+config/config.selectors';
4 | export { ConfigActions, ConfigFeature, ConfigSelectors };
5 | export * from './lib/+config/config.models';
6 | export * from './lib/+config/config.facade';
7 | export * from './lib/ui-config.module';
8 | export * from './lib/ui-config';
9 |
--------------------------------------------------------------------------------
/libs/ui/config/src/lib/+config/config.actions.ts:
--------------------------------------------------------------------------------
1 | import { createAction, props } from '@ngrx/store';
2 | import { ConfigEntity } from './config.models';
3 |
4 | export const loadConfig = createAction('[Config] Load Config');
5 |
6 | export const loadConfigSuccess = createAction(
7 | '[Config] Load Config Success',
8 | props<{ config: ConfigEntity[] }>()
9 | );
10 |
11 | export const loadConfigFailure = createAction(
12 | '[Config] Load Config Failure',
13 | props<{ error: any }>()
14 | );
15 |
--------------------------------------------------------------------------------
/libs/ui/config/src/lib/+config/config.effects.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { createEffect, Actions, ofType } from '@ngrx/effects';
3 | import { fetch } from '@nrwl/angular';
4 |
5 | import * as fromConfig from './config.reducer';
6 | import * as ConfigActions from './config.actions';
7 |
8 | @Injectable()
9 | export class ConfigEffects {
10 | // loadConfig$ = createEffect(() =>
11 | // this.actions$.pipe(
12 | // ofType(ConfigActions.loadConfig),
13 | // fetch({
14 | // run: (action) => {
15 | // // Your custom service 'load' logic goes here. For now just return a success action...
16 | // return ConfigActions.loadConfigSuccess({ config: [] });
17 | // },
18 |
19 | // onError: (action, error) => {
20 | // console.error('Error', error);
21 | // return ConfigActions.loadConfigFailure({ error });
22 | // },
23 | // })
24 | // )
25 | // );
26 |
27 | constructor(private actions$: Actions) {}
28 | }
29 |
--------------------------------------------------------------------------------
/libs/ui/config/src/lib/+config/config.facade.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { select, Store, Action } from '@ngrx/store';
4 |
5 | import * as fromConfig from './config.reducer';
6 | import * as ConfigSelectors from './config.selectors';
7 |
8 | @Injectable()
9 | export class ConfigFacade {
10 | loaded$ = this.store.pipe(select(ConfigSelectors.getConfigLoaded));
11 | allConfig$ = this.store.pipe(select(ConfigSelectors.getAllConfig));
12 | selectedConfig$ = this.store.pipe(select(ConfigSelectors.getSelected));
13 |
14 | constructor(private store: Store) {}
15 |
16 | dispatch(action: Action) {
17 | this.store.dispatch(action);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/libs/ui/config/src/lib/+config/config.models.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Interface for the 'Config' data
3 | */
4 | export interface ConfigEntity {
5 | id: string | number; // Primary ID
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/config/src/lib/ui-config.module.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, TestBed } from '@angular/core/testing';
2 | import { UiConfigModule } from './ui-config.module';
3 |
4 | describe('UiConfigModule', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | imports: [UiConfigModule],
8 | }).compileComponents();
9 | }));
10 |
11 | it('should create', () => {
12 | expect(UiConfigModule).toBeDefined();
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/libs/ui/config/src/lib/ui-config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
2 | import { isPlatformBrowser, isPlatformServer } from '@angular/common';
3 | import { ConfigModel } from '@slackmap/api/config/dto';
4 |
5 | @Injectable()
6 | export class UiConfig extends ConfigModel {
7 | isProduction: boolean;
8 | isBrowser = isPlatformBrowser(this.platformId)
9 | isServer = isPlatformServer(this.platformId)
10 |
11 | constructor(
12 | @Inject(PLATFORM_ID) public platformId: any,
13 | ) { super() }
14 | };
15 |
--------------------------------------------------------------------------------
/libs/ui/config/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/config/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/config/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/config/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/config/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "slackmap", "camelCase"],
5 | "component-selector": [true, "element", "slackmap", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/core/README.md:
--------------------------------------------------------------------------------
1 | # ui-core
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-core` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/core/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-core',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/core',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js'
9 | ]
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/core/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/services';
2 | export * from './lib/ui-core.module';
3 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+core/core.actions.ts:
--------------------------------------------------------------------------------
1 | import { createAction, props } from '@ngrx/store';
2 | import { ItemSubtype, SportType } from '@slackmap/core';
3 |
4 | export const version = createAction(
5 | '[Core] Version',
6 | props<{ version: string }>()
7 | );
8 |
9 | // fired when layer filters are changed by the user
10 | export const subtypesEnabledChange = createAction(
11 | '[Core] Subtypes Enabled Change',
12 | props<{ subtypesEnabled: ItemSubtype[] }>()
13 | );
14 |
15 | // enable or disable the layer
16 | export const sportsEnabledChange = createAction(
17 | '[Core] Sports Enabled Change',
18 | props<{ sportsEnabled: SportType[] }>()
19 | );
20 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+core/core.effects.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { createEffect, Actions, ofType } from '@ngrx/effects';
3 | import { fetch } from '@nrwl/angular';
4 |
5 | import * as fromCore from './core.reducer';
6 | import * as CoreActions from './core.actions';
7 |
8 | @Injectable()
9 | export class CoreEffects {
10 | // loadCore$ = createEffect(() =>
11 | // this.actions$.pipe(
12 | // ofType(CoreActions.loadCore),
13 | // fetch({
14 | // run: action => {
15 | // // Your custom service 'load' logic goes here. For now just return a success action...
16 | // return CoreActions.loadCoreSuccess({ core: [] });
17 | // },
18 |
19 | // onError: (action, error) => {
20 | // console.error('Error', error);
21 | // return CoreActions.loadCoreFailure({ error });
22 | // }
23 | // })
24 | // )
25 | // );
26 |
27 | constructor(private actions$: Actions) {}
28 | }
29 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+core/core.facade.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { select, Store, Action } from '@ngrx/store';
4 |
5 | import * as fromCore from './core.reducer';
6 | import * as CoreSelectors from './core.selectors';
7 | import * as CoreActions from './core.actions';
8 | import { SportType } from '@slackmap/core';
9 |
10 | @Injectable()
11 | export class CoreFacade {
12 | actions = CoreActions;
13 | version$ = this.store.pipe(select(CoreSelectors.getCoreVersion));
14 |
15 | sportsEnabled$ = this.store.select(CoreSelectors.getCoreSportsEnabled);
16 | subtypesEnabled$ = this.store.select(CoreSelectors.getCoreSubtypesEnabled);
17 |
18 | constructor(private store: Store) {}
19 |
20 | getSportFilteredSpots = (sport: SportType) => this.store.select(CoreSelectors.getMapSportFilteredSpots(sport));
21 |
22 | dispatch(action: Action) {
23 | this.store.dispatch(action);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+core/core.models.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Interface for the 'Core' data
3 | */
4 | export interface CoreEntity {
5 | id: string | number; // Primary ID
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+core/index.ts:
--------------------------------------------------------------------------------
1 | import * as CoreActions from './core.actions';
2 | import * as CoreFeature from './core.reducer';
3 | import * as CoreSelectors from './core.selectors';
4 | export { CoreActions, CoreFeature, CoreSelectors };
5 | export * from './core.models';
6 | export * from './core.facade';
7 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+spot/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import * as SpotsActions from './spot.actions';
3 | import * as SpotsFeature from './spot.reducer';
4 | import * as SpotsSelectors from './spot.selectors';
5 | export { SpotsActions, SpotsFeature, SpotsSelectors };
6 | export * from './spot.models';
7 | export * from './spot.facade';
8 |
9 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+spot/spot.facade.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { select, Store, Action } from '@ngrx/store';
4 |
5 | import * as fromSpot from './spot.reducer';
6 | import * as SpotSelectors from './spot.selectors';
7 |
8 | @Injectable()
9 | export class SpotFacade {
10 |
11 | layers$ = this.store.pipe(select(SpotSelectors.getSpotLayers));
12 |
13 | constructor(private store: Store) {}
14 |
15 | dispatch(action: Action) {
16 | this.store.dispatch(action);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+spot/spot.models.ts:
--------------------------------------------------------------------------------
1 | import {SportType} from '@slackmap/core';
2 | import { ClustersSpotsGetDto } from '@slackmap/api/clusters/dto';
3 |
4 | /**
5 | * success response from cache or request
6 | */
7 | export enum ResponseSource {
8 | STORAGE = 'storage',
9 | SERVER = 'server'
10 | }
11 |
12 | /**
13 | * success response from cashe or request
14 | */
15 | export interface LoadHashResponse {
16 | layer: SportType;
17 | hash: string;
18 | source: ResponseSource;
19 | timestamp: number;
20 | data?: ClustersSpotsGetDto;
21 | error?: any;
22 | }
23 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/+spot/spot.selectors.ts:
--------------------------------------------------------------------------------
1 | import { createFeatureSelector, createSelector } from '@ngrx/store';
2 | import { SPOT_FEATURE_KEY, SpotState, SpotPartialState, } from './spot.reducer';
3 | import { SportType } from '@slackmap/core';
4 |
5 | // Lookup the 'Spots' feature state managed by NgRx
6 | export const getSpotState = createFeatureSelector(
7 | SPOT_FEATURE_KEY
8 | );
9 |
10 | export const getSpotLayers = createSelector(
11 | getSpotState,
12 | state => state.layers,
13 | );
14 |
15 | export const getSpotLayer = function (layer: SportType) {
16 | return createSelector(
17 | getSpotLayers,
18 | layers => layers[layer],
19 | );
20 | };
21 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/common/geo.utils.ts:
--------------------------------------------------------------------------------
1 | import * as geohash from 'ngeohash';
2 |
3 | /**
4 | * converts geojson bbox to leaflet bounds
5 | *
6 | * @param bbox geojeson bbox [minlat, minlon, maxlat, maxlon]
7 | * @returns leaflet bounds array [[54.559322, -5.767822], [56.1210604, -3.021240]]
8 | */
9 | export function bbox2bounds(bbox) {
10 | return [[bbox[0], bbox[1]], [bbox[2], bbox[3]]];
11 | }
12 |
13 | /**
14 | * converts geohash string to leaflet bounds (array of coords)
15 | *
16 | * @param hash string of geohash
17 | */
18 | export function geohash2bounds(hash) {
19 | const bbox = geohash.decode_bbox(hash);
20 | return bbox2bounds(bbox);
21 | }
22 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/common/index.ts:
--------------------------------------------------------------------------------
1 | export * from './geo.utils';
2 | export * from './map.helpers';
3 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/components/layer-filters/layer-filters.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | }
4 | mat-icon {
5 | position: relative;
6 | top: 5px;;
7 | margin: 0px 5px;
8 | }
9 |
10 | .mat-select-value {
11 | text-align: right;
12 | }
13 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/components/layer-filters/layer-filters.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { LayerFiltersComponent } from './layer-filters.component';
4 |
5 | describe('LayerFiltersComponent', () => {
6 | let component: LayerFiltersComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ LayerFiltersComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(LayerFiltersComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/pages/home/home.page.scss:
--------------------------------------------------------------------------------
1 | .example-card {
2 | max-width: 400px;
3 | margin: 15px auto 0;
4 | border-radius: 0px;
5 | img {
6 | cursor: pointer;
7 | }
8 | }
9 | .header-card {
10 | text-align: center;
11 | img {
12 | padding: 0 15px;
13 | width: 100%;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/pages/home/home.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { HomePage } from './home.page';
4 |
5 | describe('HomePage', () => {
6 | let component: HomePage;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ HomePage ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(HomePage);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/pages/home/home.page.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { CoreFacade } from '../../+core/core.facade';
3 |
4 | @Component({
5 | selector: 'sm-home',
6 | templateUrl: './home.page.html',
7 | styleUrls: ['./home.page.scss']
8 | })
9 | export class HomePage implements OnInit {
10 |
11 | version$ = this.core.version$;
12 |
13 | constructor(
14 | private core: CoreFacade
15 | ) { }
16 |
17 | ngOnInit(): void {
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/pages/x/x.page.html:
--------------------------------------------------------------------------------
1 | HOME
2 |
3 |
4 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/pages/x/x.page.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/libs/ui/core/src/lib/pages/x/x.page.scss
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/pages/x/x.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { XPage } from './x.page';
4 |
5 | describe('XPage', () => {
6 | let component: XPage;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ XPage ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(XPage);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cache.service';
2 | export * from './spot.service';
3 | export * from './storage-mock.service';
4 | export * from './storage.service';
5 |
--------------------------------------------------------------------------------
/libs/ui/core/src/lib/services/storage-mock.service.ts:
--------------------------------------------------------------------------------
1 | import {Injectable} from '@angular/core';
2 | import {Observable, EMPTY} from 'rxjs';
3 | import { StorageService } from './storage.service';
4 |
5 | /**
6 | * on the server side we have to mock the IonicStorage module
7 | */
8 | @Injectable({
9 | providedIn: 'root'
10 | })
11 | export class StorageMockService implements Partial {
12 |
13 | ready(): Observable {
14 | return EMPTY;
15 | }
16 |
17 | get(name: string): Observable {
18 | return EMPTY;
19 | }
20 |
21 | set(name: string, value: any): Observable {
22 | return EMPTY;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/libs/ui/core/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/core/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "skipTemplateCodegen": true,
13 | "strictMetadataEmit": true,
14 | "enableResourceInlining": true
15 | },
16 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/core/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "angularCompilerOptions": {
4 | "enableIvy": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/core/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/core/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "sm", "camelCase"],
5 | "component-selector": [true, "element", "sm", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/map/.storybook/addons.js:
--------------------------------------------------------------------------------
1 | import '../../../../.storybook/addons';
2 |
--------------------------------------------------------------------------------
/libs/ui/map/.storybook/config.js:
--------------------------------------------------------------------------------
1 | import { configure, addDecorator } from '@storybook/angular';
2 | import { withKnobs } from '@storybook/addon-knobs';
3 |
4 | addDecorator(withKnobs);
5 | configure(require.context('../src/lib', true, /\.stories\.tsx?$/), module);
6 |
--------------------------------------------------------------------------------
/libs/ui/map/.storybook/preview-head.html:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/libs/ui/map/.storybook/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "emitDecoratorMetadata": true
5 | },
6 | "exclude": ["../src/test.ts", "../**/*.spec.ts"],
7 | "include": ["../src/**/*"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/ui/map/.storybook/webpack.config.js:
--------------------------------------------------------------------------------
1 | const rootWebpackConfig = require('../../../../.storybook/webpack.config');
2 | // Export a function. Accept the base config as the only param.
3 | module.exports = async ({ config, mode }) => {
4 | config = await rootWebpackConfig({ config, mode });
5 |
6 | return config;
7 | };
8 |
--------------------------------------------------------------------------------
/libs/ui/map/README.md:
--------------------------------------------------------------------------------
1 | # ui-map
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-map` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/map/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-map',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/map',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js'
9 | ]
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/map/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/ui-map.module';
2 | export * from './lib/map.service';
3 | export * from './lib/+map';
4 |
5 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/+map/index.ts:
--------------------------------------------------------------------------------
1 | import * as MapActions from './map.actions';
2 | import * as MapFeature from './map.reducer';
3 | import * as MapSelectors from './map.selectors';
4 | export { MapActions, MapFeature, MapSelectors };
5 | export * from './map.models';
6 | export * from './map.facade';
7 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/+map/map.actions.ts:
--------------------------------------------------------------------------------
1 | import { createAction, props } from '@ngrx/store';
2 | import { MapViewChangeData } from './map.models';
3 | import { PoiItem } from '@slackmap/core';
4 |
5 | // fired when user moves the map, or the viewport changes
6 | export const viewChange = createAction(
7 | '[Map] View Change',
8 | props<{ view: MapViewChangeData }>()
9 | );
10 |
11 | // when you click item on the map
12 | export const itemClick = createAction(
13 | '[Map] Item Click',
14 | props<{ item: PoiItem }>()
15 | );
16 |
17 | // fire it if you want to zoom map to items, map will react to it
18 | export const zoomItems = createAction(
19 | '[Map] Zoom Items',
20 | props<{ items: PoiItem[] }>()
21 | );
22 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/+map/map.facade.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { select, Store, Action } from '@ngrx/store';
3 |
4 | import * as fromMap from './map.reducer';
5 | import * as MapSelectors from './map.selectors';
6 | import * as MapActions from './map.actions';
7 | import { SportType } from '@slackmap/core';
8 |
9 | @Injectable()
10 | export class MapFacade {
11 | actions = MapActions;
12 | view$ = this.store.pipe(select(MapSelectors.getMapView));
13 |
14 | constructor(private store: Store) {}
15 |
16 | dispatch(action: Action) {
17 | this.store.dispatch(action);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/+map/map.reducer.ts:
--------------------------------------------------------------------------------
1 | import { createReducer, on, Action } from '@ngrx/store';
2 | import * as MapActions from './map.actions';
3 | import { MapViewChangeData } from './map.models';
4 |
5 | export const MAP_FEATURE_KEY = 'map';
6 |
7 | export interface MapState {
8 | view: MapViewChangeData;
9 | }
10 |
11 | export interface MapPartialState {
12 | readonly [MAP_FEATURE_KEY]: MapState;
13 | }
14 |
15 | export const initialState: MapState = {
16 | view: null,
17 | };
18 |
19 | const mapReducer = createReducer(
20 | initialState,
21 |
22 | on(MapActions.viewChange, (state, { view }) => ({ ...state, view })),
23 |
24 | );
25 |
26 | export function reducer(state: MapState | undefined, action: Action) {
27 | return mapReducer(state, action);
28 | }
29 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/+map/map.selectors.ts:
--------------------------------------------------------------------------------
1 | import { createFeatureSelector, createSelector } from '@ngrx/store';
2 | import {
3 | MAP_FEATURE_KEY,
4 | MapState,
5 | MapPartialState,
6 | } from './map.reducer';
7 |
8 | export const getMapState = createFeatureSelector(MAP_FEATURE_KEY);
9 |
10 | export const getMapView = createSelector(getMapState, (state) => state.view);
11 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/components/draw-control/draw-control.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | z-index: 1;
4 | position: relative;
5 | padding: 10px;
6 | //margin: 30px 0 40px 0;
7 | overflow: visible;
8 | //height: 50px;
9 | text-align: center;
10 | i {
11 | color: gray;
12 | font-style: italic;
13 | font-size: 10px;
14 | }
15 | b {
16 | display: block;
17 | clear: both;
18 | color: #28A528;
19 | }
20 | .btn {
21 | margin-top: 6px;
22 | }
23 | .distance-btn {
24 | display: inline-block;
25 | margin-right: 10px;
26 | }
27 | .draw-info-text {
28 | text-align: center;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/components/map.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/components/map.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | overflow: hidden;
3 | background-color: #d3d9db;
4 | // background-image: url('/assets/map-demo.png');
5 | // background-repeat: no-repeat;
6 | // background-position: center;
7 | // background-size: contain;
8 | }
9 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/components/spots-layer/spots-layer.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { MapService } from '../../map.service';
3 |
4 | @Component({
5 | selector: 'sm-map-spots-layer',
6 | template: ``,
7 | styles: []
8 | })
9 | export class SpotsLayerComponent implements OnInit {
10 |
11 | constructor(
12 | private map: MapService
13 | ) { }
14 |
15 | ngOnInit(): void {
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/index.ts:
--------------------------------------------------------------------------------
1 | export * from './leaflet-map.component';
2 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/layers/map.tile.layer.ts:
--------------------------------------------------------------------------------
1 | import * as L from "leaflet";
2 |
3 | export const MapTileLayer = L.TileLayer.extend({
4 | getTileUrl: function (coords) {
5 | return `https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/${coords.z}/${coords.x}/${coords.y}.png`
6 | },
7 | getAttribution: function () {
8 | return `© OpenStreetMap
9 | contributors, © CartoDB
10 | `
11 | },
12 | onAdd: function (map) {
13 | L.TileLayer.prototype.onAdd.call(this, map);
14 | }
15 | });
16 |
17 | export function mapTileLayer() {
18 | return new MapTileLayer();
19 | }
20 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/layers/satellite.google.tile.layer.ts:
--------------------------------------------------------------------------------
1 | import * as L from "leaflet";
2 |
3 | export const SatelliteGoogleTileLayer = L.TileLayer.extend({
4 | getTileUrl: function(coords) {
5 | return `https://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x=${coords.x}&y=${coords.y}&z=${coords.z}`
6 | },
7 | getAttribution: function() {
8 | return `Dane mapyZdjęcie satelitarne ©2018 , CNES / Airbus, DigitalGlobe, MGGP Aero `
9 | },
10 | onAdd: function(map) {
11 | L.TileLayer.prototype.onAdd.call(this, map);
12 | }
13 | });
14 |
15 | export function satelliteGoogleTileLayer () {
16 | return new SatelliteGoogleTileLayer();
17 | }
18 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/layers/spots.layer.ts:
--------------------------------------------------------------------------------
1 | import * as L from 'leaflet';
2 | import { ItemUtils } from '@slackmap/core';
3 | import { MarkerFactory } from '../markers';
4 |
5 | export class SpotsLayer extends L.FeatureGroup {
6 | factory: MarkerFactory;
7 | constructor(private itemUtils: ItemUtils) {
8 | super();
9 | this.factory = new MarkerFactory(this.itemUtils);
10 | this.on('click', function (e) {
11 | this._map.fire('item-click', {item: e.propagatedFrom.item});
12 | });
13 | }
14 |
15 | setSpots(spots) {
16 | this.clearLayers();
17 | if(!spots) {
18 | return;
19 | }
20 | for (const item of spots) {
21 | const layer = this.factory.create(item);
22 | if (layer) {
23 | this.addLayer(layer);
24 | }
25 | }
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/leaflet-map.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { LeafletMapComponent } from './leaflet-map.component';
4 |
5 | describe('LeafletMapComponent', () => {
6 | let component: LeafletMapComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ LeafletMapComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(LeafletMapComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/leaflet-map.component.stories.ts:
--------------------------------------------------------------------------------
1 | // import '!style-loader!css-loader!leaflet/dist/leaflet.css';
2 | import { LeafletMapComponent } from './leaflet-map.component';
3 |
4 | export default {
5 | title: 'LeafletMapComponent'
6 | }
7 |
8 | export const OsmLayer = () => ({
9 | moduleMetadata: {
10 | imports: []
11 | },
12 | component: LeafletMapComponent,
13 | props: {
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/libs/ui/map/src/lib/leaflet/markers/index.ts:
--------------------------------------------------------------------------------
1 | export * from './marker-factory'
2 |
--------------------------------------------------------------------------------
/libs/ui/map/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/map/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/map/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": [
10 | "dom",
11 | "es2018"
12 | ]
13 | },
14 | "angularCompilerOptions": {
15 | "skipTemplateCodegen": true,
16 | "strictMetadataEmit": true,
17 | "enableResourceInlining": true
18 | },
19 | "exclude": [
20 | "src/test-setup.ts",
21 | "**/*.spec.ts",
22 | "**/*.stories.ts",
23 | "**/*.stories.js"
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/libs/ui/map/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "angularCompilerOptions": {
4 | "enableIvy": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/map/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/map/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [true, "attribute", "map", "camelCase"],
5 | "component-selector": [true, "element", "map", "kebab-case"]
6 | },
7 | "linterOptions": {
8 | "exclude": ["!**/*"]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/pwa/.storybook/addons.js:
--------------------------------------------------------------------------------
1 | import '../../../../.storybook/addons';
2 |
--------------------------------------------------------------------------------
/libs/ui/pwa/.storybook/config.js:
--------------------------------------------------------------------------------
1 | import { configure, addDecorator } from '@storybook/angular';
2 | import { withKnobs } from '@storybook/addon-knobs';
3 |
4 | addDecorator(withKnobs);
5 | configure(require.context('../src/lib', true, /\.stories\.tsx?$/), module);
6 |
--------------------------------------------------------------------------------
/libs/ui/pwa/.storybook/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "emitDecoratorMetadata": true
5 | },
6 | "exclude": ["../src/test.ts", "../**/*.spec.ts"],
7 | "include": ["../src/**/*"]
8 | }
9 |
--------------------------------------------------------------------------------
/libs/ui/pwa/.storybook/webpack.config.js:
--------------------------------------------------------------------------------
1 | const rootWebpackConfig = require('../../../../.storybook/webpack.config');
2 | // Export a function. Accept the base config as the only param.
3 | module.exports = async ({ config, mode }) => {
4 | config = await rootWebpackConfig({ config, mode });
5 |
6 | return config;
7 | };
8 |
--------------------------------------------------------------------------------
/libs/ui/pwa/README.md:
--------------------------------------------------------------------------------
1 | # ui-pwa
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-pwa` to execute the unit tests.
8 |
--------------------------------------------------------------------------------
/libs/ui/pwa/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'ui-pwa',
3 | preset: '../../../jest.config.js',
4 | coverageDirectory: '../../../coverage/libs/ui/pwa',
5 | snapshotSerializers: [
6 | 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
7 | 'jest-preset-angular/build/AngularSnapshotSerializer.js',
8 | 'jest-preset-angular/build/HTMLCommentSerializer.js'
9 | ]
10 | };
11 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './lib/pwa-module-config';
2 | export * from './lib/ui-pwa.module';
3 | export * from './lib/update.service';
4 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/pwa-module-config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable()
4 | export class PwaModuleConfig {
5 | enabled: boolean;
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/ui-pwa.module.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, TestBed } from '@angular/core/testing';
2 | import { UiPwaModule } from './ui-pwa.module';
3 |
4 | describe('PwaModule', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | imports: [UiPwaModule]
8 | }).compileComponents();
9 | }));
10 |
11 | it('should create', () => {
12 | expect(UiPwaModule).toBeDefined();
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/ui-pwa.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule, ModuleWithProviders } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { MatDialogModule } from '@angular/material/dialog';
4 | import { MatButtonModule } from '@angular/material/button';
5 | import { UpdateService } from './update.service';
6 | import { UpdateDialogComponent } from './update-dialog/update-dialog.component';
7 | import { PwaModuleConfig } from './pwa-module-config';
8 |
9 | @NgModule({
10 | imports: [
11 | CommonModule,
12 | MatDialogModule,
13 | MatButtonModule
14 | ],
15 | declarations: [UpdateDialogComponent],
16 | entryComponents: [UpdateDialogComponent],
17 | })
18 | export class UiPwaModule {
19 | static forRoot(config: PwaModuleConfig): ModuleWithProviders {
20 | return {
21 | ngModule: UiPwaModule,
22 | providers: [{
23 | provide: PwaModuleConfig,
24 | useValue: config
25 | }]
26 | }
27 | }
28 | constructor(service: UpdateService) {}
29 | }
30 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/update-dialog/update-dialog.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/libs/ui/pwa/src/lib/update-dialog/update-dialog.component.css
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/update-dialog/update-dialog.component.html:
--------------------------------------------------------------------------------
1 | New version available
2 |
3 | Update now ??
4 |
5 | Your version {{ data.current?.appData?.version || 0 }} available
6 | {{ data.available?.appData?.version || 0 }}
7 |
8 |
9 | Changes: {{ data.current?.appData?.changelog }}
10 |
11 |
12 |
13 |
14 |
17 |
18 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/update-dialog/update-dialog.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { UpdateDialogComponent } from './update-dialog.component';
4 |
5 | describe('UpdateDialogComponent', () => {
6 | let component: UpdateDialogComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ UpdateDialogComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(UpdateDialogComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/update-dialog/update-dialog.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Inject } from '@angular/core';
2 | import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
3 |
4 | export interface AppData {
5 | version: string;
6 | }
7 | export interface Version {
8 | hash: string;
9 | appData?: AppData;
10 | }
11 | export interface UpdateAvailableEvent {
12 | type: 'UPDATE_AVAILABLE';
13 | current: Version;
14 | available: Version;
15 | }
16 |
17 | @Component({
18 | selector: 'sm-update-dialog',
19 | templateUrl: './update-dialog.component.html',
20 | styleUrls: ['./update-dialog.component.css'],
21 | })
22 | export class UpdateDialogComponent implements OnInit {
23 | constructor(
24 | public dialogRef: MatDialogRef,
25 | @Inject(MAT_DIALOG_DATA) public data: UpdateAvailableEvent,
26 | ) {}
27 |
28 | onNoClick(): void {
29 | this.dialogRef.close();
30 | }
31 | ngOnInit() {}
32 | }
33 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/lib/update.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { UpdateService } from './update.service';
4 |
5 | describe('UpdateService', () => {
6 | let service: UpdateService;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | service = TestBed.inject(UpdateService);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(service).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/libs/ui/pwa/src/test-setup.ts:
--------------------------------------------------------------------------------
1 | import 'jest-preset-angular';
2 |
--------------------------------------------------------------------------------
/libs/ui/pwa/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["node", "jest"]
5 | },
6 | "include": ["**/*.ts"]
7 | }
8 |
--------------------------------------------------------------------------------
/libs/ui/pwa/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": [
10 | "dom",
11 | "es2018"
12 | ]
13 | },
14 | "angularCompilerOptions": {
15 | "skipTemplateCodegen": true,
16 | "strictMetadataEmit": true,
17 | "enableResourceInlining": true
18 | },
19 | "exclude": [
20 | "src/test-setup.ts",
21 | "**/*.spec.ts",
22 | "**/*.stories.ts",
23 | "**/*.stories.js"
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/libs/ui/pwa/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "angularCompilerOptions": {
4 | "enableIvy": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/libs/ui/pwa/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "files": ["src/test-setup.ts"],
9 | "include": ["**/*.spec.ts", "**/*.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/libs/ui/pwa/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "pwa",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "pwa",
14 | "kebab-case"
15 | ]
16 | },
17 | "linterOptions": {
18 | "exclude": [
19 | "!**/*"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/storage/neo4j/data/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/storage/neo4j/data/.gitkeep
--------------------------------------------------------------------------------
/storage/neo4j/logs/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/storage/neo4j/logs/.gitkeep
--------------------------------------------------------------------------------
/tools/schematics/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlackMap/slackmap/2bf4501bfab6c33a5e3c24393841357a4bd2f6ed/tools/schematics/.gitkeep
--------------------------------------------------------------------------------
/tools/schematics/usecase/files/dto/__name@dasherize__.dto.ts:
--------------------------------------------------------------------------------
1 |
2 | export class <%= classify(name) %>RequestDto {
3 |
4 | }
5 | export class <%= classify(name) %>Dto {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/tools/schematics/usecase/files/usecases/__name@dasherize__.usecase.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { Observable, of } from 'rxjs';
3 | import { switchMap, map } from 'rxjs/operators';
4 | import { <%= classify(name) %>RequestDto, <%= classify(name) %>Dto } from '../dto';
5 |
6 | /**
7 | *
8 | */
9 | @Injectable()
10 | export class <%= classify(name) %>UseCase {
11 | constructor(
12 |
13 | ) { }
14 | process(request: <%= classify(name) %>RequestDto): Observable<<%= classify(name) %>Dto> {
15 | return of({} as any);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tools/schematics/usecase/index.ts:
--------------------------------------------------------------------------------
1 | import { chain, externalSchematic, Rule, SchematicContext, Tree, url, apply, template, mergeWith, move } from '@angular-devkit/schematics';
2 | import { strings } from "@angular-devkit/core";
3 | import { getProjectConfig } from '@nrwl/workspace';
4 |
5 | function generateFilesFromTemplates(options: any) : Rule {
6 | return (tree: Tree, context: SchematicContext) => {
7 | const config = getProjectConfig(tree, options.project);
8 | const subDir = config.projectType === 'library' ? 'lib' : 'app'
9 |
10 | const sourceTemplates = url('./files');
11 | const sourceParametrizedTemplates = apply(sourceTemplates, [
12 | template({
13 | ...options,
14 | ...strings
15 | }),
16 | move(`${config.sourceRoot}/${subDir}`)
17 | ]);
18 |
19 | const rule = mergeWith(sourceParametrizedTemplates);
20 | return rule;
21 | }
22 | }
23 |
24 | export default function(options: any): Rule {
25 | return chain([
26 | generateFilesFromTemplates(options),
27 | ]);
28 | }
29 |
--------------------------------------------------------------------------------
/tools/schematics/usecase/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "id": "usecase",
4 | "type": "object",
5 | "properties": {
6 | "project": {
7 | "type": "string",
8 | "description": "Project name (lib or app)",
9 | "$default": {
10 | "$source": "argv",
11 | "index": 0
12 | }
13 | },
14 | "name": {
15 | "type": "string",
16 | "description": "Use Case name",
17 | "$default": {
18 | "$source": "argv",
19 | "index": 1
20 | }
21 | }
22 | },
23 | "required": ["project", "name"]
24 | }
25 |
--------------------------------------------------------------------------------
/tools/scripts/deploy-prod.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo 'PROD Deploy - Started'
4 |
5 | node ./node_modules/.bin/standard-version --no-verify -t "" --message "chore(release): %s [skip ci]"
6 | node ./tools/scripts/copy-assets.js
7 | node ./node_modules/.bin/shipit prod deploy
8 | git push --no-verify --follow-tags origin HEAD:master
9 |
--------------------------------------------------------------------------------
/tools/scripts/deploy-test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo 'TEST Deploy - Started'
4 |
5 | # node ./node_modules/.bin/standard-version --prerelease $TRAVIS_BUILD_NUMBER -t "" --skip.tag=true --skip.commit=true
6 | node ./node_modules/.bin/standard-version --prerelease=next -t ""
7 | node ./tools/scripts/copy-assets.js
8 | node ./node_modules/.bin/shipit test deploy
9 | git push --no-verify --follow-tags origin develop
10 |
--------------------------------------------------------------------------------
/tools/shipit-deploy/tasks/deploy.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @params shipit instance
3 | * @param options {name: 'deploy-dir'} pass custom name if you want to avoid overwriting default deploy tasks
4 | */
5 | module.exports = function(shipit, options) {
6 | if (!options) {
7 | options = {};
8 | }
9 | const name = options.name || 'deploy';
10 | require('shipit-deploy')(shipit);
11 | require('./fetch')(shipit, options);
12 | require('./update').default(shipit, options);
13 |
14 | /**
15 | * Orchestrate our own deploy task
16 | */
17 | shipit.blTask(name, [
18 | 'deploy:init',
19 | `${name}:fetch`,
20 | `${name}:update`,
21 | 'deploy:publish',
22 | 'deploy:clean',
23 | 'deploy:finish',
24 | ]);
25 | };
26 |
--------------------------------------------------------------------------------
/tools/shipit-deploy/tasks/fetch.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @params shipit instance
3 | * @param options {name: 'deploy-dir'} pass custom name if you want to avoid overwriting default deploy tasks
4 | */
5 | module.exports = function(shipit, options) {
6 | if (!options) {
7 | options = {};
8 | }
9 | const name = options.name || 'deploy';
10 |
11 | /**
12 | * overwrite default task, default task will work only with git (yes, there is still bug)
13 | */
14 | shipit.task(name + ':fetch', async function() {
15 | // configure workspace
16 | shipit.workspace = shipit.config.workspace;
17 | console.log('Set workspace path to:', shipit.workspace);
18 | shipit.emit('fetched');
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/tools/tsconfig.tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../dist/out-tsc/tools",
5 | "rootDir": ".",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": ["node"]
9 | },
10 | "include": ["**/*.ts"]
11 | }
12 |
--------------------------------------------------------------------------------