@instantdb/admin
Advanced tools
Comparing version 0.14.27 to 0.14.28-experimental.0
@@ -11,2 +11,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -21,2 +24,3 @@ exports.i = exports.lookup = exports.tx = exports.id = void 0; | ||
Object.defineProperty(exports, "id", { enumerable: true, get: function () { return core_1.id; } }); | ||
const version_1 = __importDefault(require("./version")); | ||
function configWithDefaults(config) { | ||
@@ -72,3 +76,4 @@ const defaultConfig = { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield fetch(input, Object.assign(Object.assign({}, FETCH_OPTS), init)); | ||
const headers = Object.assign(Object.assign({}, (init.headers || {})), { "Instant-Admin-Version": version_1.default, "Instant-Core-Version": core_1.version }); | ||
const res = yield fetch(input, Object.assign(Object.assign(Object.assign({}, FETCH_OPTS), init), { headers })); | ||
const json = yield res.json(); | ||
@@ -350,3 +355,3 @@ return res.status === 200 | ||
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`) | ||
.join('&'); | ||
.join("&"); | ||
const response = yield jsonFetch(`${this.config.apiURI}/admin/users?${qs}`, { | ||
@@ -353,0 +358,0 @@ method: "GET", |
@@ -10,3 +10,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { tx, lookup, getOps, i, id, txInit, } from "@instantdb/core"; | ||
import { tx, lookup, getOps, i, id, txInit, version as coreVersion, } from "@instantdb/core"; | ||
import version from "./version"; | ||
function configWithDefaults(config) { | ||
@@ -62,3 +63,4 @@ const defaultConfig = { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield fetch(input, Object.assign(Object.assign({}, FETCH_OPTS), init)); | ||
const headers = Object.assign(Object.assign({}, (init.headers || {})), { "Instant-Admin-Version": version, "Instant-Core-Version": coreVersion }); | ||
const res = yield fetch(input, Object.assign(Object.assign(Object.assign({}, FETCH_OPTS), init), { headers })); | ||
const json = yield res.json(); | ||
@@ -340,3 +342,3 @@ return res.status === 200 | ||
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`) | ||
.join('&'); | ||
.join("&"); | ||
const response = yield jsonFetch(`${this.config.apiURI}/admin/users?${qs}`, { | ||
@@ -343,0 +345,0 @@ method: "GET", |
{ | ||
"name": "@instantdb/admin", | ||
"version": "v0.14.27", | ||
"version": "v0.14.28-experimental.0", | ||
"description": "Admin SDK for Instant DB", | ||
@@ -28,4 +28,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@instantdb/core": "v0.14.27" | ||
"@instantdb/core": "v0.14.28-experimental.0" | ||
} | ||
} |
@@ -8,2 +8,3 @@ import { | ||
txInit, | ||
version as coreVersion, | ||
type TransactionChunk, | ||
@@ -42,2 +43,4 @@ type AuthToken, | ||
import version from "./version"; | ||
type DebugCheckResult = { | ||
@@ -130,3 +133,8 @@ /** The ID of the record. */ | ||
): Promise<any> { | ||
const res = await fetch(input, { ...FETCH_OPTS, ...init }); | ||
const headers = { | ||
...(init.headers || {}), | ||
"Instant-Admin-Version": version, | ||
"Instant-Core-Version": coreVersion, | ||
}; | ||
const res = await fetch(input, { ...FETCH_OPTS, ...init, headers }); | ||
const json = await res.json(); | ||
@@ -479,3 +487,3 @@ return res.status === 200 | ||
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`) | ||
.join('&'); | ||
.join("&"); | ||
@@ -482,0 +490,0 @@ const response: { user: User } = await jsonFetch( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
155227
22
2364