insomnia-plugin-datacircle 0.0.0-stage → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Datacircle
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ # insomnia-plugin-datacircle
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [Datacircle](https://datacircle.dev) in [Insomnia](https://insomnia.rest). Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.
4
+
5
+ This plugin adds a template tag, **Datacircle best**, which gives the best provider for an API, its plan, score or pricing page. It calls the open Datacircle API, with no key: one call, `GET https://api.datacircle.dev/v1/apis/{slug}/best?limit=1`, each time the tag renders.
6
+
7
+ ## Install
8
+
9
+ In Insomnia, open **Preferences**, **Plugins**, type `insomnia-plugin-datacircle` and click **Install Plugin**.
10
+
11
+ ## Use
12
+
13
+ Press Ctrl+Space in any field, pick **Datacircle best**, then an API such as `linkedin-profile` and a field such as `provider`.
14
+
15
+ ## The API
16
+
17
+ - [Spec](https://api.datacircle.dev/v1/openapi.json)
18
+ - [Base URL](https://api.datacircle.dev/v1)
19
+ - [Datacircle](https://datacircle.dev)
20
+
21
+ MIT License. Contact: wayne@datacircle.dev
package/icon.png ADDED
Binary file
package/index.js ADDED
@@ -0,0 +1,50 @@
1
+ // Datacircle for Insomnia: who is best for an API, as a template tag (https://api.datacircle.dev/v1, no key)
2
+
3
+ const BASE = 'https://api.datacircle.dev/v1';
4
+
5
+ const FIELDS = ['provider', 'plan', 'score', 'website', 'pricingPage', 'bestPage'];
6
+
7
+ async function best(slug, field) {
8
+ // Insomnia's plugin sandbox (Preferences, Scripting) gives plugins no fetch
9
+ if (typeof fetch !== 'function') {
10
+ throw new Error('Datacircle needs the network: elevate it in Preferences, Plugins, or turn off "Run template tags in sandbox"');
11
+ }
12
+ const response = await fetch(`${BASE}/apis/${encodeURIComponent(slug)}/best?limit=1`);
13
+ if (!response.ok) {
14
+ throw new Error(`Datacircle answered ${response.status} for "${slug}". The slugs are at ${BASE}/apis`);
15
+ }
16
+ const body = await response.json();
17
+ const top = (body.plans || [])[0];
18
+ if (!top) {
19
+ throw new Error(`Datacircle has no plan for "${slug}"`);
20
+ }
21
+ if (field === 'bestPage') {
22
+ return body.bestPage;
23
+ }
24
+ return String(top[field] === undefined ? '' : top[field]);
25
+ }
26
+
27
+ module.exports.templateTags = [
28
+ {
29
+ name: 'datacircleBest',
30
+ displayName: 'Datacircle best',
31
+ description: 'The best provider for an API, from the Datacircle benchmark',
32
+ args: [
33
+ {
34
+ displayName: 'API',
35
+ description: 'An API slug, such as linkedin-profile. The list is at https://api.datacircle.dev/v1/apis',
36
+ type: 'string',
37
+ defaultValue: 'linkedin-profile',
38
+ },
39
+ {
40
+ displayName: 'Field',
41
+ type: 'enum',
42
+ defaultValue: 'provider',
43
+ options: FIELDS.map(value => ({ displayName: value, value })),
44
+ },
45
+ ],
46
+ run: (context, slug, field) => best(slug, field || 'provider'),
47
+ },
48
+ ];
49
+
50
+ module.exports.best = best;
package/package.json CHANGED
@@ -1,6 +1,20 @@
1
1
  {
2
2
  "name": "insomnia-plugin-datacircle",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "The best provider for each GTM API in Insomnia, from the Datacircle benchmark (open API, no key)",
5
+ "main": "index.js",
6
+ "files": ["index.js", "icon.png", "README.md", "LICENSE"],
7
+ "keywords": ["insomnia", "insomnia-plugin", "datacircle", "api", "benchmark"],
8
+ "homepage": "https://datacircle.dev",
9
+ "repository": { "type": "git", "url": "git+https://github.com/waynehamadi/datacircle.git" },
10
+ "author": "Datacircle <wayne@datacircle.dev>",
11
+ "license": "MIT",
12
+ "insomnia": {
13
+ "name": "datacircle",
14
+ "displayName": "Datacircle",
15
+ "description": "The best provider for each GTM API, from the Datacircle benchmark",
16
+ "images": { "icon": "icon.png", "cover": "icon.png" },
17
+ "publisher": { "name": "Datacircle", "icon": "https://datacircle.dev/favicon.png" },
18
+ "unlisted": false
19
+ }
20
+ }