@secondlayer/sdk 9.0.0 → 9.0.1
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/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +5 -5
- package/dist/streams/index.d.ts +1 -1
- package/dist/streams/index.js +3 -3
- package/dist/streams/index.js.map +4 -4
- package/dist/subgraphs/index.js +4 -4
- package/dist/subgraphs/index.js.map +5 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2435,7 +2435,7 @@ declare function getSubgraph<T extends {
|
|
|
2435
2435
|
schema: Record<string, unknown>;
|
|
2436
2436
|
}>(def: T, options?: Partial<SecondLayerOptions> | SecondLayer | Subgraphs): InferSubgraphClient2<T>;
|
|
2437
2437
|
type CreateStreamsClientOptions = {
|
|
2438
|
-
apiKey
|
|
2438
|
+
apiKey?: string;
|
|
2439
2439
|
baseUrl?: string;
|
|
2440
2440
|
fetchImpl?: FetchLike2;
|
|
2441
2441
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1476,7 +1476,7 @@ function subscribeStreamsEvents(opts) {
|
|
|
1476
1476
|
})}`;
|
|
1477
1477
|
const res = await opts.fetchImpl(url, {
|
|
1478
1478
|
headers: {
|
|
1479
|
-
Authorization: `Bearer ${opts.apiKey}
|
|
1479
|
+
...opts.apiKey ? { Authorization: `Bearer ${opts.apiKey}` } : {},
|
|
1480
1480
|
Accept: "text/event-stream"
|
|
1481
1481
|
},
|
|
1482
1482
|
signal: controller.signal
|
|
@@ -1687,7 +1687,7 @@ function createStreamsClient(options) {
|
|
|
1687
1687
|
});
|
|
1688
1688
|
async function request(path) {
|
|
1689
1689
|
const response = await fetchImpl(`${baseUrl}${path}`, {
|
|
1690
|
-
headers: { Authorization: `Bearer ${options.apiKey}` }
|
|
1690
|
+
headers: options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {}
|
|
1691
1691
|
});
|
|
1692
1692
|
if (!response.ok)
|
|
1693
1693
|
await mapStreamsError(response);
|
|
@@ -1922,7 +1922,7 @@ class SecondLayer extends BaseClient {
|
|
|
1922
1922
|
constructor(options = {}) {
|
|
1923
1923
|
super(options);
|
|
1924
1924
|
this.streams = createStreamsClient({
|
|
1925
|
-
apiKey: resolveApiKey(options.apiKey)
|
|
1925
|
+
apiKey: resolveApiKey(options.apiKey),
|
|
1926
1926
|
baseUrl: options.baseUrl,
|
|
1927
1927
|
fetchImpl: options.fetchImpl,
|
|
1928
1928
|
dumpsBaseUrl: options.dumpsBaseUrl
|
|
@@ -2276,5 +2276,5 @@ export {
|
|
|
2276
2276
|
ApiError
|
|
2277
2277
|
};
|
|
2278
2278
|
|
|
2279
|
-
//# debugId=
|
|
2279
|
+
//# debugId=D7FC8B721E6F36FC64756E2164756E21
|
|
2280
2280
|
//# sourceMappingURL=index.js.map
|