@secondlayer/sdk 11.0.0 → 12.0.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/dist/index.d.ts +1 -2
- package/dist/index.js +2 -25
- package/dist/index.js.map +4 -4
- package/dist/streams/index.js +2 -25
- package/dist/streams/index.js.map +4 -4
- package/dist/subgraphs/index.js +2 -25
- package/dist/subgraphs/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -234,8 +234,7 @@ declare function resolveBaseUrl(explicit?: string): string;
|
|
|
234
234
|
* env vars. Guarded for browsers and edge runtimes. */
|
|
235
235
|
declare function resolveApiKey(apiKey?: string): string | undefined;
|
|
236
236
|
/** Resolve the hosted account key for archive quote/fetch/credits.
|
|
237
|
-
* Precedence: explicit `accountKey` → `SECONDLAYER_API_KEY
|
|
238
|
-
* `SL_ARCHIVE_API_KEY` (one-release warn-fallbacks). Does not read
|
|
237
|
+
* Precedence: explicit `accountKey` → `SECONDLAYER_API_KEY`. Does not read
|
|
239
238
|
* `INSTANCE_TOKEN`. */
|
|
240
239
|
declare function resolveAccountKey(accountKey?: string): string | undefined;
|
|
241
240
|
declare abstract class BaseClient {
|
package/dist/index.js
CHANGED
|
@@ -205,7 +205,6 @@ function raceAbort(promise, signal) {
|
|
|
205
205
|
var LOCAL_API_URL = "http://127.0.0.1:3800";
|
|
206
206
|
var INSTANCE_TOKEN_ENV = "INSTANCE_TOKEN";
|
|
207
207
|
var ACCOUNT_KEY_ENV = "SECONDLAYER_API_KEY";
|
|
208
|
-
var warnedUrlAlias = false;
|
|
209
208
|
function resolveBaseUrl(explicit) {
|
|
210
209
|
if (explicit && explicit.length > 0)
|
|
211
210
|
return explicit.replace(/\/+$/, "");
|
|
@@ -213,14 +212,6 @@ function resolveBaseUrl(explicit) {
|
|
|
213
212
|
const primary = process.env?.SECONDLAYER_API_URL || undefined;
|
|
214
213
|
if (primary)
|
|
215
214
|
return primary.replace(/\/+$/, "");
|
|
216
|
-
const legacy = process.env?.SL_API_URL || undefined;
|
|
217
|
-
if (legacy) {
|
|
218
|
-
if (!warnedUrlAlias) {
|
|
219
|
-
warnedUrlAlias = true;
|
|
220
|
-
console.warn("[secondlayer] SL_API_URL is a legacy alias of SECONDLAYER_API_URL; using the alias this once.");
|
|
221
|
-
}
|
|
222
|
-
return legacy.replace(/\/+$/, "");
|
|
223
|
-
}
|
|
224
215
|
}
|
|
225
216
|
return LOCAL_API_URL;
|
|
226
217
|
}
|
|
@@ -232,26 +223,12 @@ function resolveApiKey(apiKey) {
|
|
|
232
223
|
const token = process.env?.INSTANCE_TOKEN || undefined;
|
|
233
224
|
return token;
|
|
234
225
|
}
|
|
235
|
-
var warnedArchiveAlias = false;
|
|
236
226
|
function resolveAccountKey(accountKey) {
|
|
237
227
|
if (accountKey !== undefined)
|
|
238
228
|
return accountKey;
|
|
239
229
|
if (typeof process === "undefined")
|
|
240
230
|
return;
|
|
241
|
-
|
|
242
|
-
const slAlias = process.env?.SL_API_KEY || undefined;
|
|
243
|
-
const archiveAlias = process.env?.SL_ARCHIVE_API_KEY || undefined;
|
|
244
|
-
if (primary)
|
|
245
|
-
return primary;
|
|
246
|
-
const legacy = slAlias ?? archiveAlias;
|
|
247
|
-
if (legacy) {
|
|
248
|
-
if (!warnedArchiveAlias) {
|
|
249
|
-
warnedArchiveAlias = true;
|
|
250
|
-
console.warn("[secondlayer] SL_API_KEY / SL_ARCHIVE_API_KEY are legacy aliases of SECONDLAYER_API_KEY; using the alias this once.");
|
|
251
|
-
}
|
|
252
|
-
return legacy;
|
|
253
|
-
}
|
|
254
|
-
return;
|
|
231
|
+
return process.env?.SECONDLAYER_API_KEY || undefined;
|
|
255
232
|
}
|
|
256
233
|
function seg(value) {
|
|
257
234
|
return encodeURIComponent(String(value));
|
|
@@ -2986,5 +2963,5 @@ export {
|
|
|
2986
2963
|
verifyWebhookSignature
|
|
2987
2964
|
};
|
|
2988
2965
|
|
|
2989
|
-
//# debugId=
|
|
2966
|
+
//# debugId=758CC74B9A5D6A8064756E2164756E21
|
|
2990
2967
|
//# sourceMappingURL=index.js.map
|