Skip to content

Commit

Permalink
feat(verdaccio-aws-s3-storage): update @verdaccio/types and add new r…
Browse files Browse the repository at this point in the history
…equired methods
  • Loading branch information
sergiohgz committed Aug 28, 2019
1 parent 76a0748 commit f39b7a2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/aws-s3-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/aws-sdk": "2.7.0",
"@verdaccio/babel-preset": "^8.0.0",
"@verdaccio/eslint-config": "^8.0.0",
"@verdaccio/types": "^5.3.0",
"@verdaccio/types": "^8.0.0",
"cross-env": "5.2.0",
"recursive-readdir": "2.2.2"
}
Expand Down
31 changes: 29 additions & 2 deletions plugins/aws-s3-storage/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { LocalStorage, Logger, Config, Callback, IPluginStorage, PluginOptions } from '@verdaccio/types';
import { getInternalError, VerdaccioError } from '@verdaccio/commons-api';
import {
LocalStorage,
Logger,
Config,
Callback,
IPluginStorage,
PluginOptions,
Token,
TokenFilter,
} from '@verdaccio/types';
import { getInternalError, VerdaccioError, getServiceUnavailable } from '@verdaccio/commons-api';
import { S3 } from 'aws-sdk';
import { S3Config } from './config';
import S3PackageManager from './s3PackageManager';
Expand Down Expand Up @@ -207,4 +216,22 @@ export default class S3Database implements IPluginStorage<S3Config> {

return this._localData as LocalStorage;
}

public saveToken(token: Token): Promise<void> {
this.logger.warn({ token }, 'save token has not been implemented yet @{token}');

return Promise.reject(getServiceUnavailable('[saveToken] method not implemented'));
}

public deleteToken(user: string, tokenKey: string): Promise<void> {
this.logger.warn({ tokenKey, user }, 'delete token has not been implemented yet @{user}');

return Promise.reject(getServiceUnavailable('[deleteToken] method not implemented'));
}

public readTokens(filter: TokenFilter): Promise<Token[]> {
this.logger.warn({ filter }, 'read tokens has not been implemented yet @{filter}');

return Promise.reject(getServiceUnavailable('[readTokens] method not implemented'));
}
}

0 comments on commit f39b7a2

Please sign in to comment.