alfy 0.12.0 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import Conf from 'conf';
2
2
  import {Options} from 'got';
3
3
 
4
4
  export interface FetchOptions extends Options {
5
+ // Deprecated, but left for backwards-compatibility.
5
6
  /**
6
7
  URL search parameters.
7
8
  */
@@ -232,7 +233,7 @@ export interface ScriptFilterItem {
232
233
 
233
234
  You can now define the valid attribute to mark if the result is valid based on the modifier selection and set a different arg to be passed out if actioned with the modifier.
234
235
  */
235
- readonly mods?: Record<PossibleModifiers, ModifierKeyItem>;
236
+ readonly mods?: Partial<Record<PossibleModifiers, ModifierKeyItem>>;
236
237
 
237
238
  /**
238
239
  This element defines the Universal Action items used when actioning the result, and overrides arg being used for actioning.
package/index.js CHANGED
@@ -54,7 +54,7 @@ alfy.matches = (input, list, item) => {
54
54
  }
55
55
 
56
56
  if (typeof listItem === 'string') {
57
- listItem = listItem.toLowerCase();
57
+ listItem = listItem.toLowerCase().normalize();
58
58
  }
59
59
 
60
60
  if (typeof item === 'function') {
@@ -116,12 +116,17 @@ alfy.fetch = async (url, options) => {
116
116
  ...options,
117
117
  };
118
118
 
119
+ // Deprecated, but left for backwards-compatibility.
120
+ if (options.query) {
121
+ options.searchParams = options.query;
122
+ }
123
+
119
124
  if (typeof url !== 'string') {
120
- return Promise.reject(new TypeError(`Expected \`url\` to be a \`string\`, got \`${typeof url}\``));
125
+ throw new TypeError(`Expected \`url\` to be a \`string\`, got \`${typeof url}\``);
121
126
  }
122
127
 
123
128
  if (options.transform && typeof options.transform !== 'function') {
124
- return Promise.reject(new TypeError(`Expected \`transform\` to be a \`function\`, got \`${typeof options.transform}\``));
129
+ throw new TypeError(`Expected \`transform\` to be a \`function\`, got \`${typeof options.transform}\``);
125
130
  }
126
131
 
127
132
  const rawKey = url + JSON.stringify(options);
@@ -129,12 +134,12 @@ alfy.fetch = async (url, options) => {
129
134
  const cachedResponse = alfy.cache.get(key, {ignoreMaxAge: true});
130
135
 
131
136
  if (cachedResponse && !alfy.cache.isExpired(key)) {
132
- return Promise.resolve(cachedResponse);
137
+ return cachedResponse;
133
138
  }
134
139
 
135
140
  let response;
136
141
  try {
137
- response = await got(url, {searchParams: options.query}).json();
142
+ response = await got(url, options).json();
138
143
  } catch (error) {
139
144
  if (cachedResponse) {
140
145
  return cachedResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alfy",
3
- "version": "0.12.0",
3
+ "version": "0.12.3",
4
4
  "description": "Create Alfred workflows with ease",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/alfy",
package/readme.md CHANGED
@@ -351,7 +351,7 @@ URL to fetch.
351
351
 
352
352
  Type: `object`
353
353
 
354
- Any of the [`got` options](https://github.com/sindresorhus/got#options).
354
+ Any of the [`got` options](https://github.com/sindresorhus/got/tree/v11.8.3#api) and the below options.
355
355
 
356
356
  ###### json
357
357
 
@@ -608,20 +608,16 @@ Non-synced local preferences are stored within `Alfred.alfredpreferences` under
608
608
  - [alfred-asana](https://github.com/adriantoine/alfred-asana) - Search your Asana tasks
609
609
  - [alfred-cacher](https://github.com/CacherApp/alfred-cacher) - Find a code snippet from [Cacher](https://www.cacher.io) and copy it to the clipboard
610
610
  - [alfred-loremipsum](https://github.com/AntonNiklasson/alfred-loremipsum) - Generate placeholder text
611
- - [alfred-kaomoji](https://github.com/vinkla/alfred-kaomoji) - Find relevant kaomoji from text
612
611
  - [alfred-packagist](https://github.com/vinkla/alfred-packagist) - Search for PHP packages with Packagist
613
612
  - [alfred-vpn](https://github.com/stve/alfred-vpn) - Connect/disconnect from VPNs
614
- - [alfred-clap](https://github.com/jacc/alfred-clap) - 👏🏻 Clap 👏🏻 stuff 👏🏻 out 👏🏻 in 👏🏻 Alfred! 👏🏻
615
613
  - [alfred-yandex-translate](https://github.com/mkalygin/alfred-yandex-translate) - Translate words and text with Yandex Translate
616
614
  - [alfred-now](https://github.com/lucaperret/alfred-now) - Use [Now](https://zeit.co/now) commands within Alfred to access deployments and aliases
617
615
  - [alfred-chuck-norris-jokes](https://github.com/jeppestaerk/alfred-chuck-norris-jokes) - Get Chuck Norris jokes
618
616
  - [alfred-show-network-info](https://github.com/jeppestaerk/alfred-show-network-info) - See network info and discover local devices
619
617
  - [alfred-currency-conversion](https://github.com/jeppestaerk/alfred-currency-conversion) - See foreign exchange rates and currency conversion
620
- - [alfred-reference](https://github.com/vinkla/alfred-reference) - Search for HTML elements and CSS properties
621
618
  - [alfred-polyglot](https://github.com/nikersify/alfred-polyglot) - Translate text with Google Translate
622
619
  - [alfred-stock-price](https://github.com/Wei-Xia/alfred-stock-price-workflow) - Show real time stock price in US market
623
620
  - [alfred-jira](https://github.com/colinf/alfred-jira) - Convert clipboard text between Markdown and Jira markup
624
- - [alfred-homebrew](https://github.com/vinkla/alfred-homebrew) - Search for macOS packages with Homebrew
625
621
  - [alfred-network-location-switch](https://github.com/abdul/alfred-network-location-switch) - Switch macOS network location
626
622
  - [alfred-cool](https://github.com/nguyenvanduocit/alfred-cool) - Find cool words
627
623
  - [alfred-google-books](https://github.com/Dameck/alfred-google-books) - Search for Google Books
@@ -631,7 +627,6 @@ Non-synced local preferences are stored within `Alfred.alfredpreferences` under
631
627
  - [alfred-title](https://github.com/Kikobeats/alfred-title) – Capitalize your titles
632
628
  - [alfred-trello](https://github.com/mblode/alfred-trello) - Search your boards, quickly add cards, and view list of cards for Trello
633
629
  - [alfred-npm-versions](https://github.com/mrmartineau/alfred-npm-versions) - Lookup the latest 15 versions for an npm package
634
- - [alfred-travis-ci](https://github.com/adriantombu/alfred-travis-ci) - Check the status of your Travis CI builds
635
630
  - [alfred-github-trending](https://github.com/mikqi/alfred-github-trending) - Search trending repositories on GitHub
636
631
  - [alfred-elm](https://github.com/nicklayb/alfred-elm) - Browse Elm packages documentation
637
632
  - [alfred-imagemin](https://github.com/kawamataryo/alfred-imagemin) - Minify images with Imagemin
@@ -643,6 +638,7 @@ Non-synced local preferences are stored within `Alfred.alfredpreferences` under
643
638
  - [alfred-code](https://github.com/shaodahong/alfred-code) - Quickly open a file in Visual Studio Code
644
639
  - [alfred-amphetamine](https://github.com/demartini/alfred-amphetamine) - Start and end sessions quickly in the Amphetamine app
645
640
  - [alfred-ids](https://github.com/rizowski/alfred-ids) - Generate various types of IDs.
641
+ - [alfred-awesome-stars](https://github.com/jopemachine/alfred-awesome-stars) - Search starred GitHub repos through awesome-stars.
646
642
 
647
643
  ## Related
648
644
 
package/run-node.sh CHANGED
@@ -43,7 +43,7 @@ if ! has_node; then
43
43
  fi
44
44
 
45
45
  if has_node; then
46
- node --input-type=module "$@"
46
+ node "$@"
47
47
  else
48
48
  echo $'{"items":[{"title": "Couldn\'t find the `node` binary", "subtitle": "Symlink it to `/usr/local/bin`"}]}'
49
49
  fi