@certik/skynet 0.18.1 → 0.18.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.3
4
+
5
+ - BREAKING: remove url from graphql.js interface
6
+
7
+ ## 0.18.2
8
+
9
+ - BREAKING: remove appName from search.js interface
10
+
3
11
  ## 0.18.1
4
12
 
5
13
  - BREAKING: opensearch feature has been replaced by elastic search
package/graphql.js CHANGED
@@ -1,10 +1,8 @@
1
- const GRAPHQL_API_KEY = process.env.SKYNET_GRAPHQL_API_KEY || process.env.GRAPHQL_API_KEY;
2
-
3
- export async function gql(url, query, variables = {}) {
4
- const res = await fetch(url, {
1
+ export async function gql(query, variables = {}) {
2
+ const res = await fetch(process.env.SKYNET_GRAPHQL_ENDPOINT, {
5
3
  method: "POST",
6
4
  headers: {
7
- "x-api-key": GRAPHQL_API_KEY,
5
+ "x-api-key": process.env.SKYNET_GRAPHQL_API_KEY,
8
6
  "content-type": "application/json",
9
7
  },
10
8
  body: JSON.stringify({ query: query.trim(), variables }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "Skynet Shared JS library",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/search.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export function sendToSearch<T>(
2
- appName: string,
3
2
  indexPrefix: string,
4
3
  record: string,
5
4
  throws?: boolean,
package/search.js CHANGED
@@ -3,7 +3,7 @@ import { inline } from "./log.js";
3
3
  import { Client } from "@elastic/elasticsearch";
4
4
  import osModule from "os";
5
5
 
6
- export async function sendToSearch(appName, indexPrefix, record, throws = false) {
6
+ export async function sendToSearch(indexPrefix, record, throws = false) {
7
7
  const client = new Client({
8
8
  cloud: { id: process.env.SKYNET_ELASTICSEARCH_CLOUD_ID },
9
9
  auth: { apiKey: process.env.SKYNET_ELASTICSEARCH_API_KEY },
@@ -17,7 +17,7 @@ export async function sendToSearch(appName, indexPrefix, record, throws = false)
17
17
  try {
18
18
  await client.index({
19
19
  index: indexName,
20
- document: { app: appName, instance: osModule.hostname(), timestamp: now, record },
20
+ document: { instance: osModule.hostname(), timestamp: now, record },
21
21
  });
22
22
  } catch (err) {
23
23
  inline.error(err);