Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c88bd7feda268655d6486f9386455be1433b8ac6
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
env:
NPM_TOKEN: ""

- name: Lib - Check Formatting
run: npm run format:check
working-directory: ./keeperapi

- name: Lib - Build
run: npm run build
working-directory: ./keeperapi
Expand Down
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,36 @@ npm install keeperapi
```

```typescript
try {
let auth = new Auth({
host: KeeperEnvironment.DEV
});
await auth.login(username, password);
console.log("login successful");
let vault = new Vault(auth);
await vault.syncDown();
vault.records.forEach(x => console.log(JSON.stringify(x)));
} catch (e) {
console.log(e);
}
try {
let auth = new Auth({
host: KeeperEnvironment.DEV,
});
await auth.login(username, password);
console.log("login successful");
let vault = new Vault(auth);
await vault.syncDown();
vault.records.forEach((x) => console.log(JSON.stringify(x)));
} catch (e) {
console.log(e);
}
```

For local development,
For local development,

```bash
npm run build
```
from "keeperapi" folder, then


from "keeperapi" folder, then

```bash
npm link ../../keeperapi
```

from your client folder

To ignore certain commits in git blame (like formatting commits), run this command:

```bash
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
4 changes: 4 additions & 0 deletions keeperapi/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package-lock.json
dist/
proto.js
proto.d.ts
7 changes: 7 additions & 0 deletions keeperapi/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"semi": false,
"tabWidth": 4,
"printWidth": 120,
"trailingComma": "es5"
}
7 changes: 2 additions & 5 deletions keeperapi/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
module.exports = {
"presets": [
["@babel/preset-env", {"targets": {"node": "current"}}],
["@babel/preset-typescript"]
]
}
presets: [['@babel/preset-env', { targets: { node: 'current' } }], ['@babel/preset-typescript']],
}
25 changes: 11 additions & 14 deletions keeperapi/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
module.exports = {
// Only match test files with .test.ts or .test.js extensions
testMatch: [
"<rootDir>/src/__tests__/**/*.test.ts",
"<rootDir>/src/__tests__/**/*.test.js",
],
// Only match test files with .test.ts or .test.js extensions
testMatch: ['<rootDir>/src/__tests__/**/*.test.ts', '<rootDir>/src/__tests__/**/*.test.js'],

// Ignore dist folder and node_modules
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
// Ignore dist folder and node_modules
testPathIgnorePatterns: ['/node_modules/', '/dist/'],

// Transform ESM packages from node_modules
transformIgnorePatterns: ["node_modules/(?!@noble/)"],
// Transform ESM packages from node_modules
transformIgnorePatterns: ['node_modules/(?!@noble/)'],

// Module file extensions
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
// Module file extensions
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],

// Setup file to run before each test file
setupFilesAfterEnv: ["<rootDir>/setup-jest.ts"],
};
// Setup file to run before each test file
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
}
Loading
Loading