Skip to content

Commit

Permalink
Add lib directory
Browse files Browse the repository at this point in the history
  • Loading branch information
samriley committed Jan 31, 2022
1 parent 2140478 commit 1c14209
Show file tree
Hide file tree
Showing 24 changed files with 1,000 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
lib/
node_modules/
data
registry.env
2 changes: 2 additions & 0 deletions lib/addTrailingSlash.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: (path?: string | undefined) => string;
export default _default;
13 changes: 13 additions & 0 deletions lib/addTrailingSlash.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/addTrailingSlash.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions lib/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Config } from '@verdaccio/types';
export interface S3Config extends Config {
bucket: string;
keyPrefix: string;
endpoint?: string;
region?: string;
s3ForcePathStyle?: boolean;
acl?: string;
tarballACL?: string;
accessKeyId?: string;
secretAccessKey?: string;
sessionToken?: string;
}
6 changes: 6 additions & 0 deletions lib/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/config.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions lib/deleteKeyPrefix.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { S3 } from 'aws-sdk';
interface DeleteKeyPrefixOptions {
Bucket: string;
Prefix: string;
}
export declare function deleteKeyPrefix(s3: S3, options: DeleteKeyPrefixOptions, callback: (err: Error | null) => void): void;
export {};
35 changes: 35 additions & 0 deletions lib/deleteKeyPrefix.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/deleteKeyPrefix.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Logger, Config, Callback, IPluginStorage, PluginOptions, Token, TokenFilter } from '@verdaccio/types';
import { S3Config } from './config';
import S3PackageManager from './s3PackageManager';
export default class S3Database implements IPluginStorage<S3Config> {
logger: Logger;
config: S3Config;
private s3;
private _localData;
constructor(config: Config, options: PluginOptions<S3Config>);
getSecret(): Promise<string>;
setSecret(secret: string): Promise<void>;
add(name: string, callback: Callback): void;
search(onPackage: Function, onEnd: Function): Promise<void>;
private _fetchPackageInfo;
remove(name: string, callback: Callback): void;
get(callback: Callback): void;
private _sync;
getPackageStorage(packageName: string): S3PackageManager;
private _getData;
saveToken(token: Token): Promise<void>;
deleteToken(user: string, tokenKey: string): Promise<void>;
readTokens(filter: TokenFilter): Promise<Token[]>;
}
Loading

0 comments on commit 1c14209

Please sign in to comment.