Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instantdb/admin

Package Overview
Dependencies
Maintainers
0
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instantdb/admin - npm Package Compare versions

Comparing version 0.14.30 to 0.15.0

30

dist/index.d.ts

@@ -1,2 +0,2 @@

import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type DoNotUseQueryResponse, type InstaQLQueryParams, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantSchema, type DoNotUseUnknownSchema } from "@instantdb/core";
import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type InstaQLResponse, type InstaQLParams, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type IInstantDatabase, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstantSchemaDef, type InstantUnknownSchema } from "@instantdb/core";
type DebugCheckResult = {

@@ -17,3 +17,3 @@ /** The ID of the record. */

};
type DoNotUseConfig<Schema extends DoNotUseInstantSchema<any, any, any>> = {
type InstantConfig<Schema extends InstantSchemaDef<any, any, any>> = {
appId: string;

@@ -24,3 +24,3 @@ adminToken: string;

};
type DoNotUseFilledConfig<Schema extends DoNotUseInstantSchema<any, any, any>> = DoNotUseConfig<Schema> & {
type InstantConfigFilled<Schema extends InstantSchemaDef<any, any, any>> = InstantConfig<Schema> & {
apiURI: string;

@@ -59,7 +59,3 @@ };

declare function init<Schema extends {} = {}>(config: Config): InstantAdmin<Schema, false>;
declare function init_experimental<Schema extends InstantGraph<any, any, any>, WithCardinalityInference extends boolean = true>(config: Config & {
schema: Schema;
cardinalityInference?: WithCardinalityInference;
}): InstantAdmin<Schema, WithCardinalityInference>;
declare function do_not_use_init_experimental<Schema extends DoNotUseInstantSchema<any, any, any> = DoNotUseUnknownSchema>(config: DoNotUseConfig<Schema>): DoNotUseInstantAdmin<Schema>;
declare function init_experimental<Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema>(config: InstantConfig<Schema>): InstantAdminDatabase<Schema>;
/**

@@ -106,3 +102,3 @@ *

*/
query: <Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<QueryResponse<Q, Schema, WithCardinalityInference>>;
query: <Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<QueryResponse<Q, Schema, WithCardinalityInference>>;
/**

@@ -361,4 +357,4 @@ * Use this to write data! You can create, update, delete, and link objects

*/
declare class DoNotUseInstantAdmin<Schema extends DoNotUseInstantSchema<any, any, any>> {
config: DoNotUseFilledConfig<Schema>;
declare class InstantAdminDatabase<Schema extends InstantSchemaDef<any, any, any>> {
config: InstantConfigFilled<Schema>;
auth: Auth;

@@ -368,3 +364,3 @@ storage: Storage;

tx: import("@instantdb/core").TxChunk<Schema>;
constructor(_config: DoNotUseConfig<Schema>);
constructor(_config: InstantConfig<Schema>);
/**

@@ -379,3 +375,3 @@ * Sometimes you want to scope queries to a specific user.

*/
asUser: (opts: ImpersonationOpts) => DoNotUseInstantAdmin<Schema>;
asUser: (opts: ImpersonationOpts) => InstantAdminDatabase<Schema>;
/**

@@ -396,3 +392,3 @@ * Use this to query your data!

*/
query: <Q extends InstaQLQueryParams<Schema>>(query: Q) => Promise<DoNotUseQueryResponse<Q, Schema>>;
query: <Q extends InstaQLParams<Schema>>(query: Q) => Promise<InstaQLResponse<Schema, Q>>;
/**

@@ -443,6 +439,6 @@ * Use this to write data! You can create, update, delete, and link objects

*/
debugQuery: <Q extends InstaQLQueryParams<Schema>>(query: Q, opts?: {
debugQuery: <Q extends InstaQLParams<Schema>>(query: Q, opts?: {
rules: any;
}) => Promise<{
result: DoNotUseQueryResponse<Q, Schema>;
result: InstaQLResponse<Schema, Q>;
checkResults: DebugCheckResult[];

@@ -472,3 +468,3 @@ }>;

}
export { init, init_experimental, do_not_use_init_experimental, id, tx, lookup, i, type Config, type ImpersonationOpts, type TransactionChunk, type DebugCheckResult, type InstantAdmin, type User, type InstaQLQueryParams, type Query, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantSchema, type DoNotUseUnknownSchema, };
export { init, init_experimental, id, tx, lookup, i, type Config, type ImpersonationOpts, type TransactionChunk, type DebugCheckResult, type InstantAdmin, type User, type InstaQLParams, type Query, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type IInstantDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstantSchemaDef, type InstantUnknownSchema, };
//# sourceMappingURL=index.d.ts.map

@@ -18,3 +18,2 @@ "use strict";

exports.init_experimental = init_experimental;
exports.do_not_use_init_experimental = do_not_use_init_experimental;
const core_1 = require("@instantdb/core");

@@ -33,3 +32,3 @@ Object.defineProperty(exports, "tx", { enumerable: true, get: function () { return core_1.tx; } });

}
function doNotUseConfigWithDefaults(config) {
function instantConfigWithDefaults(config) {
const defaultConfig = {

@@ -116,7 +115,4 @@ apiURI: "https://api.instantdb.com",

function init_experimental(config) {
return new InstantAdmin(config);
return new InstantAdminDatabase(config);
}
function do_not_use_init_experimental(config) {
return new DoNotUseInstantAdmin(config);
}
/**

@@ -523,3 +519,3 @@ *

*/
class DoNotUseInstantAdmin {
class InstantAdminDatabase {
constructor(_config) {

@@ -537,3 +533,3 @@ this.tx = (0, core_1.txInit)();

this.asUser = (opts) => {
const newClient = new DoNotUseInstantAdmin(Object.assign({}, this.config));
const newClient = new InstantAdminDatabase(Object.assign({}, this.config));
newClient.impersonationOpts = opts;

@@ -663,3 +659,3 @@ return newClient;

};
this.config = doNotUseConfigWithDefaults(_config);
this.config = instantConfigWithDefaults(_config);
this.auth = new Auth(this.config);

@@ -666,0 +662,0 @@ this.storage = new Storage(this.config);

@@ -1,2 +0,2 @@

import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type DoNotUseQueryResponse, type InstaQLQueryParams, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantSchema, type DoNotUseUnknownSchema } from "@instantdb/core";
import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type InstaQLResponse, type InstaQLParams, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type IInstantDatabase, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstantSchemaDef, type InstantUnknownSchema } from "@instantdb/core";
type DebugCheckResult = {

@@ -17,3 +17,3 @@ /** The ID of the record. */

};
type DoNotUseConfig<Schema extends DoNotUseInstantSchema<any, any, any>> = {
type InstantConfig<Schema extends InstantSchemaDef<any, any, any>> = {
appId: string;

@@ -24,3 +24,3 @@ adminToken: string;

};
type DoNotUseFilledConfig<Schema extends DoNotUseInstantSchema<any, any, any>> = DoNotUseConfig<Schema> & {
type InstantConfigFilled<Schema extends InstantSchemaDef<any, any, any>> = InstantConfig<Schema> & {
apiURI: string;

@@ -59,7 +59,3 @@ };

declare function init<Schema extends {} = {}>(config: Config): InstantAdmin<Schema, false>;
declare function init_experimental<Schema extends InstantGraph<any, any, any>, WithCardinalityInference extends boolean = true>(config: Config & {
schema: Schema;
cardinalityInference?: WithCardinalityInference;
}): InstantAdmin<Schema, WithCardinalityInference>;
declare function do_not_use_init_experimental<Schema extends DoNotUseInstantSchema<any, any, any> = DoNotUseUnknownSchema>(config: DoNotUseConfig<Schema>): DoNotUseInstantAdmin<Schema>;
declare function init_experimental<Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema>(config: InstantConfig<Schema>): InstantAdminDatabase<Schema>;
/**

@@ -106,3 +102,3 @@ *

*/
query: <Q extends Schema extends InstantGraph<any, any> ? InstaQLQueryParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<QueryResponse<Q, Schema, WithCardinalityInference>>;
query: <Q extends Schema extends InstantGraph<any, any> ? InstaQLParams<Schema> : Exactly<Query, Q>>(query: Q) => Promise<QueryResponse<Q, Schema, WithCardinalityInference>>;
/**

@@ -361,4 +357,4 @@ * Use this to write data! You can create, update, delete, and link objects

*/
declare class DoNotUseInstantAdmin<Schema extends DoNotUseInstantSchema<any, any, any>> {
config: DoNotUseFilledConfig<Schema>;
declare class InstantAdminDatabase<Schema extends InstantSchemaDef<any, any, any>> {
config: InstantConfigFilled<Schema>;
auth: Auth;

@@ -368,3 +364,3 @@ storage: Storage;

tx: import("@instantdb/core").TxChunk<Schema>;
constructor(_config: DoNotUseConfig<Schema>);
constructor(_config: InstantConfig<Schema>);
/**

@@ -379,3 +375,3 @@ * Sometimes you want to scope queries to a specific user.

*/
asUser: (opts: ImpersonationOpts) => DoNotUseInstantAdmin<Schema>;
asUser: (opts: ImpersonationOpts) => InstantAdminDatabase<Schema>;
/**

@@ -396,3 +392,3 @@ * Use this to query your data!

*/
query: <Q extends InstaQLQueryParams<Schema>>(query: Q) => Promise<DoNotUseQueryResponse<Q, Schema>>;
query: <Q extends InstaQLParams<Schema>>(query: Q) => Promise<InstaQLResponse<Schema, Q>>;
/**

@@ -443,6 +439,6 @@ * Use this to write data! You can create, update, delete, and link objects

*/
debugQuery: <Q extends InstaQLQueryParams<Schema>>(query: Q, opts?: {
debugQuery: <Q extends InstaQLParams<Schema>>(query: Q, opts?: {
rules: any;
}) => Promise<{
result: DoNotUseQueryResponse<Q, Schema>;
result: InstaQLResponse<Schema, Q>;
checkResults: DebugCheckResult[];

@@ -472,3 +468,3 @@ }>;

}
export { init, init_experimental, do_not_use_init_experimental, id, tx, lookup, i, type Config, type ImpersonationOpts, type TransactionChunk, type DebugCheckResult, type InstantAdmin, type User, type InstaQLQueryParams, type Query, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type DoNotUseInstantSchema, type DoNotUseUnknownSchema, };
export { init, init_experimental, id, tx, lookup, i, type Config, type ImpersonationOpts, type TransactionChunk, type DebugCheckResult, type InstantAdmin, type User, type InstaQLParams, type Query, type QueryResponse, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type IInstantDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes, type InstantSchemaDef, type InstantUnknownSchema, };
//# sourceMappingURL=index.d.ts.map

@@ -19,3 +19,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
function doNotUseConfigWithDefaults(config) {
function instantConfigWithDefaults(config) {
const defaultConfig = {

@@ -102,7 +102,4 @@ apiURI: "https://api.instantdb.com",

function init_experimental(config) {
return new InstantAdmin(config);
return new InstantAdminDatabase(config);
}
function do_not_use_init_experimental(config) {
return new DoNotUseInstantAdmin(config);
}
/**

@@ -509,3 +506,3 @@ *

*/
class DoNotUseInstantAdmin {
class InstantAdminDatabase {
constructor(_config) {

@@ -523,3 +520,3 @@ this.tx = txInit();

this.asUser = (opts) => {
const newClient = new DoNotUseInstantAdmin(Object.assign({}, this.config));
const newClient = new InstantAdminDatabase(Object.assign({}, this.config));
newClient.impersonationOpts = opts;

@@ -649,3 +646,3 @@ return newClient;

};
this.config = doNotUseConfigWithDefaults(_config);
this.config = instantConfigWithDefaults(_config);
this.auth = new Auth(this.config);

@@ -655,3 +652,3 @@ this.storage = new Storage(this.config);

}
export { init, init_experimental, do_not_use_init_experimental, id, tx, lookup, i, };
export { init, init_experimental, id, tx, lookup, i, };
//# sourceMappingURL=index.js.map
export default version;
declare const version: "v0.14.30";
declare const version: "v0.15.0";
//# sourceMappingURL=version.d.ts.map
// Autogenerated by publish_packages.clj
const version = "v0.14.30";
const version = "v0.15.0";
export default version;
//# sourceMappingURL=version.js.map
export default version;
declare const version: "v0.14.30";
declare const version: "v0.15.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Autogenerated by publish_packages.clj
const version = "v0.14.30";
const version = "v0.15.0";
exports.default = version;
//# sourceMappingURL=version.js.map
{
"name": "@instantdb/admin",
"version": "v0.14.30",
"version": "v0.15.0",
"description": "Admin SDK for Instant DB",

@@ -28,4 +28,4 @@ "main": "dist/index.js",

"dependencies": {
"@instantdb/core": "v0.14.30"
"@instantdb/core": "v0.15.0"
}
}

@@ -19,4 +19,4 @@ import {

type QueryResponse,
type DoNotUseQueryResponse,
type InstaQLQueryParams,
type InstaQLResponse,
type InstaQLParams,
type InstantQuery,

@@ -28,2 +28,3 @@ type InstantQueryResult,

type InstantEntity,
type IInstantDatabase,

@@ -43,4 +44,4 @@ // schema types

type ValueTypes,
type DoNotUseInstantSchema,
type DoNotUseUnknownSchema,
type InstantSchemaDef,
type InstantUnknownSchema,
} from "@instantdb/core";

@@ -67,3 +68,3 @@

type DoNotUseConfig<Schema extends DoNotUseInstantSchema<any, any, any>> = {
type InstantConfig<Schema extends InstantSchemaDef<any, any, any>> = {
appId: string;

@@ -75,4 +76,4 @@ adminToken: string;

type DoNotUseFilledConfig<Schema extends DoNotUseInstantSchema<any, any, any>> =
DoNotUseConfig<Schema> & { apiURI: string };
type InstantConfigFilled<Schema extends InstantSchemaDef<any, any, any>> =
InstantConfig<Schema> & { apiURI: string };

@@ -94,5 +95,5 @@ type FilledConfig = Config & { apiURI: string };

function doNotUseConfigWithDefaults<
Schema extends DoNotUseInstantSchema<any, any, any>,
>(config: DoNotUseConfig<Schema>): DoNotUseFilledConfig<Schema> {
function instantConfigWithDefaults<
Schema extends InstantSchemaDef<any, any, any>,
>(config: InstantConfig<Schema>): InstantConfigFilled<Schema> {
const defaultConfig = {

@@ -197,19 +198,7 @@ apiURI: "https://api.instantdb.com",

function init_experimental<
Schema extends InstantGraph<any, any, any>,
WithCardinalityInference extends boolean = true,
>(
config: Config & {
schema: Schema;
cardinalityInference?: WithCardinalityInference;
},
) {
return new InstantAdmin<Schema, WithCardinalityInference>(config);
Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema,
>(config: InstantConfig<Schema>) {
return new InstantAdminDatabase<Schema>(config);
}
function do_not_use_init_experimental<
Schema extends DoNotUseInstantSchema<any, any, any> = DoNotUseUnknownSchema,
>(config: DoNotUseConfig<Schema>) {
return new DoNotUseInstantAdmin<Schema>(config);
}
/**

@@ -280,3 +269,3 @@ *

Q extends Schema extends InstantGraph<any, any>
? InstaQLQueryParams<Schema>
? InstaQLParams<Schema>
: Exactly<Query, Q>,

@@ -724,6 +713,4 @@ >(

*/
class DoNotUseInstantAdmin<
Schema extends DoNotUseInstantSchema<any, any, any>,
> {
config: DoNotUseFilledConfig<Schema>;
class InstantAdminDatabase<Schema extends InstantSchemaDef<any, any, any>> {
config: InstantConfigFilled<Schema>;
auth: Auth;

@@ -735,4 +722,4 @@ storage: Storage;

constructor(_config: DoNotUseConfig<Schema>) {
this.config = doNotUseConfigWithDefaults(_config);
constructor(_config: InstantConfig<Schema>) {
this.config = instantConfigWithDefaults(_config);
this.auth = new Auth(this.config);

@@ -751,4 +738,4 @@ this.storage = new Storage(this.config);

*/
asUser = (opts: ImpersonationOpts): DoNotUseInstantAdmin<Schema> => {
const newClient = new DoNotUseInstantAdmin<Schema>({
asUser = (opts: ImpersonationOpts): InstantAdminDatabase<Schema> => {
const newClient = new InstantAdminDatabase<Schema>({
...this.config,

@@ -775,5 +762,5 @@ });

*/
query = <Q extends InstaQLQueryParams<Schema>>(
query = <Q extends InstaQLParams<Schema>>(
query: Q,
): Promise<DoNotUseQueryResponse<Q, Schema>> => {
): Promise<InstaQLResponse<Schema, Q>> => {
return jsonFetch(`${this.config.apiURI}/admin/query`, {

@@ -845,7 +832,7 @@ method: "POST",

*/
debugQuery = async <Q extends InstaQLQueryParams<Schema>>(
debugQuery = async <Q extends InstaQLParams<Schema>>(
query: Q,
opts?: { rules: any },
): Promise<{
result: DoNotUseQueryResponse<Q, Schema>;
result: InstaQLResponse<Schema, Q>;
checkResults: DebugCheckResult[];

@@ -908,3 +895,2 @@ }> => {

init_experimental,
do_not_use_init_experimental,
id,

@@ -924,3 +910,3 @@ tx,

type User,
type InstaQLQueryParams,
type InstaQLParams,
type Query,

@@ -934,2 +920,3 @@

type InstantSchemaDatabase,
type IInstantDatabase,
type InstantObject,

@@ -951,4 +938,4 @@ type InstantEntity,

type ValueTypes,
type DoNotUseInstantSchema,
type DoNotUseUnknownSchema,
type InstantSchemaDef,
type InstantUnknownSchema,
};
// Autogenerated by publish_packages.clj
const version = "v0.14.30";
const version = "v0.15.0";
export default version;

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc