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

@instantdb/admin

Package Overview
Dependencies
Maintainers
3
Versions
197
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.8.1 to 0.8.2

4

package.json
{
"name": "@instantdb/admin",
"version": "0.8.1",
"version": "0.8.2",
"description": "Admin SDK for Instant DB",

@@ -27,5 +27,5 @@ "main": "dist/index.js",

"dependencies": {
"@instantdb/core": "0.8.1",
"@instantdb/core": "0.8.2",
"uuid": "^9.0.1"
}
}
import { tx, TransactionChunk, getOps } from "@instantdb/core";
import * as uuid from "uuid";
import {
Exactly,
Query,
QueryResponse,
User,
AuthToken,
} from "@instantdb/core";
import { User, AuthToken } from "@instantdb/core";
// Query Types
// -----
type WhereClause = {
[key: string]: string | number | boolean;
};
type $Option = { $?: { where: WhereClause } };
type Subquery = { [namespace: string]: NamespaceVal };
type NamespaceVal = $Option | ($Option & Subquery);
interface Query {
[namespace: string]: NamespaceVal;
}
type InstantObject = {
id: string;
[prop: string]: any;
};
type ResponseObject<K, Schema> = K extends keyof Schema
? { id: string } & Schema[K]
: InstantObject;
type IsEmptyObject<T> = T extends Record<string, never> ? true : false;
type ResponseOf<Q, Schema> = {
[K in keyof Q]: IsEmptyObject<Q[K]> extends true
? ResponseObject<K, Schema>[]
: (ResponseOf<Q[K], Schema> & ResponseObject<K, Schema>)[];
};
type Remove$<T> = T extends object
? { [K in keyof T as Exclude<K, "$">]: Remove$<T[K]> }
: T;
type QueryResponse<T, Schema> = ResponseOf<
{ [K in keyof T]: Remove$<T[K]> },
Schema
>;
/**
* (XXX)
* https://github.com/microsoft/TypeScript/issues/26051
*
* Typescript can permit extra keys when a generic extends a type.
*
* For some reason, it makes it possible to write a query like so:
*
* dummyQuery({
* users: {
* $: { where: { "foo": 1 } },
* posts: {
* $: { "far": {} }
* }
* }
*
* The problem: $: { "far": {} }
*
* This passes, when it should in reality fail. I don't know why
* adding `Exactly` fixes this, but it does.
*
* */
type Exactly<Parent, Child extends Parent> = Parent & {
[K in keyof Child]: K extends keyof Parent ? Child[K] : never;
};
type Config = {

@@ -12,0 +76,0 @@ appId: string;

Sorry, the diff of this file is too big to display

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 too big to display

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