Skip to content

Commit

Permalink
chore(release): v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benvp committed Jan 30, 2025
1 parent 0792f8c commit ae49d4e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.3.0 (2025-01-30)

### New Features

* add `cacheTTL` option to define how long elements should be caches.

## 0.2.0 (2024-10-24)

### Enhancements
Expand Down
35 changes: 17 additions & 18 deletions dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,28 @@ var op_js_1 = require("@1password/op-js");
var cache = __importStar(require("./cache"));
var path_1 = __importDefault(require("path"));
var fs_1 = __importDefault(require("fs"));
var OP_PLUGIN_CONFIG_KEY = "__op_plugin";
var OP_PLUGIN_CONFIG_KEY = '__op_plugin';
var fetchSecretTemplateTag = {
name: "op",
displayName: "1Password => Fetch Secret",
name: 'op',
displayName: '1Password => Fetch Secret',
liveDisplayName: function (args) {
var _a, _b, _c;
console.log(args);
return "1Password => ".concat((_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "--").concat(((_c = args[1]) === null || _c === void 0 ? void 0 : _c.value) ? " (".concat(args[1].value, ")") : "");
return "1Password => ".concat((_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '--').concat(((_c = args[1]) === null || _c === void 0 ? void 0 : _c.value) ? " (".concat(args[1].value, ")") : '');
},
description: "Fetch a secret from your 1Password vault",
description: 'Fetch a secret from your 1Password vault',
args: [
{
displayName: "Reference",
description: "1Password item reference (op://...)",
type: "string",
defaultValue: "",
displayName: 'Reference',
description: '1Password item reference (op://...)',
type: 'string',
defaultValue: '',
placeholder: "e.g. 'op://vault-name/item-name/section/field'",
},
{
displayName: "Account",
description: "1Password account name",
type: "string",
defaultValue: "",
displayName: 'Account',
description: '1Password account name',
type: 'string',
defaultValue: '',
placeholder: "e.g. 'team-name.1password.com'",
},
],
Expand All @@ -100,10 +99,12 @@ var fetchSecretTemplateTag = {
switch (_a.label) {
case 0:
config = context.context[OP_PLUGIN_CONFIG_KEY];
console.log(context, reference, account);
if (config === null || config === void 0 ? void 0 : config.flags) {
(0, op_js_1.setGlobalFlags)(config.flags);
}
if (typeof (config === null || config === void 0 ? void 0 : config.cacheTTL) === 'number') {
cache.setStdTTL(config.cacheTTL);
}
return [4, checkCli(config === null || config === void 0 ? void 0 : config.cliPath)];
case 1:
_a.sent();
Expand Down Expand Up @@ -136,9 +137,7 @@ function checkCli(cliPath) {
pathToAdd = path_1.default.dirname(cliPath);
}
}
process.env.PATH = pathToAdd
? "".concat(pathToAdd, ":").concat(process.env.PATH)
: process.env.PATH;
process.env.PATH = pathToAdd ? "".concat(pathToAdd, ":").concat(process.env.PATH) : process.env.PATH;
return [4, (0, op_js_1.validateCli)()];
case 2:
_a.sent();
Expand Down
6 changes: 5 additions & 1 deletion dist/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeOpCliInstalled = exports.opCliInstalled = exports.getEntry = exports.writeEntry = void 0;
exports.setStdTTL = exports.writeOpCliInstalled = exports.opCliInstalled = exports.getEntry = exports.writeEntry = void 0;
var node_cache_1 = __importDefault(require("node-cache"));
var cache = new node_cache_1.default({ stdTTL: 60 * 60 });
function writeEntry(ref, value) {
Expand All @@ -22,3 +22,7 @@ function writeOpCliInstalled(installed) {
return cache.set('opCliInstalled', installed);
}
exports.writeOpCliInstalled = writeOpCliInstalled;
function setStdTTL(ttl) {
cache.options.stdTTL = ttl;
}
exports.setStdTTL = setStdTTL;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "insomnia-plugin-op",
"version": "0.2.0",
"version": "0.3.0",
"description": "Insomnia Plugin to integrate with 1Password CLI (op)",
"main": "./dist/app.js",
"type": "commonjs",
Expand Down

0 comments on commit ae49d4e

Please sign in to comment.