6 Commits
1.0.0 ... 1.0.3

Author SHA1 Message Date
6951cd3218 - Fix package versioning 2023-05-23 22:05:27 -04:00
9393a8441a Added drone pipeline 2023-05-23 15:40:57 -04:00
b2af58532c Fixes, version bump 2023-05-23 15:03:42 -04:00
f19288833a Fix little import errors. Cleanup. Version bump. 2023-05-23 14:53:05 -04:00
37122626ff Merge branch 'main' of ssh://git.mifi.dev:12022/mifi/auth-db
# Conflicts:
#	package.json
2023-05-23 14:42:19 -04:00
59ba0d2ec4 ... oops 2023-05-23 14:41:30 -04:00
7 changed files with 128 additions and 9 deletions

91
.drone.yml Normal file
View File

@@ -0,0 +1,91 @@
kind: pipeline
type: docker
name: Test Pipeline
workspace:
path: /drone/auth
steps:
- name: yarn install
image: node:latest
commands:
- yarn install
- name: Code Style Checks
image: node:latest
commands:
- yarn prettier
- name: Lint
image: node:latest
commands:
- yarn lint
- name: Unit Tests
image: node:latest
commands:
- yarn test
- name: Send Test Status Notification
image: plugins/webhook
settings:
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
content_type: application/json
template: |
{
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
"text": "[{{ repo.name }} - Build # {{ build.number }}] Code Quality Checks {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
"username":"DroneBot"
}
when:
status:
- success
- failure
trigger:
branch:
- main
- develop
event:
- pull_request
---
kind: pipeline
type: docker
name: Publish Pipeline
workspace:
path: /drone/auth
steps:
- name: Publish NPM
image: node:20-alpine
failure: ignore
commands:
- yarn publish -t ${DRONE_TAG}
volumes:
- name: npmrc
path: /drone/auth/.npmrc
- name: Report NPM Publish Status
image: plugins/webhook
settings:
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
content_type: application/json
template: |
{
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
"text": "[{{ repo.name }} - New npm package release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
"username":"DroneBot"
}
when:
status:
- success
- failure
volumes:
- name: npmrc
host:
path: /volume1/docker/beethoven/labs-auth/.npmrc
depends_on:
- Test Pipeline
trigger:
event:
- tag

1
.yarnrc.yml Normal file
View File

@@ -0,0 +1 @@
nodeLinker: node-modules

View File

@@ -1,4 +1,4 @@
import { DatabaseError } from '@mifi/services-common/domain/errors/DatabaseError'; import { DatabaseError } from '@mifi/services-common/lib/domain/errors/DatabaseError';
import { Auth, Log, Strategy, Token } from '..'; import { Auth, Log, Strategy, Token } from '..';
import { Auth as AuthProps } from '../schema/auth'; import { Auth as AuthProps } from '../schema/auth';

View File

@@ -1,6 +1,6 @@
import { InferSchemaType, Model, Schema, StringSchemaDefinition, Types } from 'mongoose'; import { InferSchemaType, Model, Schema, StringSchemaDefinition, Types } from 'mongoose';
import { Payload } from '@mifi/services-common/types/Payload'; import { Payload } from '@mifi/services-common/lib/types/Payload';
import { Action } from '../constants/action'; import { Action } from '../constants/action';

View File

@@ -53,11 +53,11 @@ export const StrategySchema = new Schema<StrategyDocument, StrategyModel>(
}, },
); );
StrategySchema.methods.getPopulatedStrategy = async function (this: StrategyModel) { StrategySchema.methods.getPopulatedStrategy = async function (this: StrategyDocument) {
return this.populate<StrategyPopulatedDocument>('parent'); return this.populate<StrategyPopulatedDocument>('parent');
}; };
StrategySchema.methods.getAuthRecord = async function (this: StrategyModel) { StrategySchema.methods.getAuthRecord = async function (this: StrategyDocument) {
return (await this.getPopulatedStrategy()).parent; return (await this.getPopulatedStrategy()).parent;
}; };

View File

@@ -1,6 +1,6 @@
{ {
"name": "@mifi/auth-db", "name": "@mifi/auth-db",
"version": "0.0.39", "version": "1.0.3",
"author": "mifi (Mike Fitzpatrick)", "author": "mifi (Mike Fitzpatrick)",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
@@ -17,7 +17,8 @@
"@babel/core": "^7.21.8", "@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.5", "@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5", "@babel/preset-typescript": "^7.21.5",
"@tsconfig/node16": "^1.0.3", "@tsconfig/node16": "^1.0.4",
"@types/jsonwebtoken": "^9.0.2",
"@types/node": "^18.14.0", "@types/node": "^18.14.0",
"@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2", "@typescript-eslint/parser": "^5.59.2",
@@ -37,7 +38,7 @@
"typescript": "^4.9.5" "typescript": "^4.9.5"
}, },
"dependencies": { "dependencies": {
"@mifi/services-common": "1.0.0", "@mifi/services-common": "1.x.x",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"jsonwebtoken": "^9.0.0", "jsonwebtoken": "^9.0.0",
"mongoose": "^6.9.2" "mongoose": "^6.9.2"

View File

@@ -2629,7 +2629,10 @@ __metadata:
"@babel/core": ^7.21.8 "@babel/core": ^7.21.8
"@babel/preset-env": ^7.21.5 "@babel/preset-env": ^7.21.5
"@babel/preset-typescript": ^7.21.5 "@babel/preset-typescript": ^7.21.5
"@tsconfig/node16": ^1.0.3 "@mifi/services-common": 1.x.x
"@tsconfig/node16": ^1.0.4
"@types/jsonwebtoken": ^9.0.2
"@types/node": ^18.14.0
"@typescript-eslint/eslint-plugin": ^5.59.2 "@typescript-eslint/eslint-plugin": ^5.59.2
"@typescript-eslint/parser": ^5.59.2 "@typescript-eslint/parser": ^5.59.2
babel-jest: ^29.5.0 babel-jest: ^29.5.0
@@ -2652,6 +2655,13 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@mifi/services-common@npm:1.x.x":
version: 1.0.1
resolution: "@mifi/services-common@npm:1.0.1::__archiveUrl=https%3A%2F%2Fgit.mifi.dev%2Fapi%2Fpackages%2Fmifi%2Fnpm%2F%2540mifi%252Fservices-common%2F-%2F1.0.1%2Fservices-common-1.0.1.tgz"
checksum: b8ba60584616826615bf4600dc45a0fbe390a2ff5c1a8238e0f9e016fd2ff069e4c6fd96d4d02af7eb41671436a58ab69e6017301a509a175aeff08d7b056fc2
languageName: node
linkType: hard
"@nodelib/fs.scandir@npm:2.1.5": "@nodelib/fs.scandir@npm:2.1.5":
version: 2.1.5 version: 2.1.5
resolution: "@nodelib/fs.scandir@npm:2.1.5" resolution: "@nodelib/fs.scandir@npm:2.1.5"
@@ -2786,7 +2796,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@tsconfig/node16@npm:^1.0.3": "@tsconfig/node16@npm:^1.0.4":
version: 1.0.4 version: 1.0.4
resolution: "@tsconfig/node16@npm:1.0.4" resolution: "@tsconfig/node16@npm:1.0.4"
checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff
@@ -2899,6 +2909,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/jsonwebtoken@npm:^9.0.2":
version: 9.0.2
resolution: "@types/jsonwebtoken@npm:9.0.2"
dependencies:
"@types/node": "*"
checksum: 3bb8d40e78d7eb53e427db6e9f0f22e0890cfee80965dcf741d08341814913afb211306de6e9847c6d241cc8e36f8a59090cbfdcc510ab7c81af9d650c5afe0e
languageName: node
linkType: hard
"@types/node@npm:*": "@types/node@npm:*":
version: 20.2.3 version: 20.2.3
resolution: "@types/node@npm:20.2.3" resolution: "@types/node@npm:20.2.3"
@@ -2906,6 +2925,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:^18.14.0":
version: 18.16.14
resolution: "@types/node@npm:18.16.14"
checksum: c11cb3c787236414efe58240ae71854971592554d82ff9d201876ce7cafd51c37aaa001c63602d002e8238614d7331bd6d48ac4c1c0caa826799980b6846fb08
languageName: node
linkType: hard
"@types/prettier@npm:^2.1.5, @types/prettier@npm:^2.6.0": "@types/prettier@npm:^2.1.5, @types/prettier@npm:^2.6.0":
version: 2.7.2 version: 2.7.2
resolution: "@types/prettier@npm:2.7.2" resolution: "@types/prettier@npm:2.7.2"