@instantdb/admin
Advanced tools
Comparing version
@@ -166,3 +166,6 @@ import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type InstaQLResponse, type InstaQLParams, type InstaQLFields, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type BackwardsCompatibleSchema, 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, type InstaQLEntity, type InstaQLResult, type InstantRules, type UpdateParams, type LinkParams, type FileOpts, type UploadFileResponse, type DeleteFileResponse } from '@instantdb/core'; | ||
debugQuery: <Q extends Query>(query: Exactly<Query, Q>, opts?: { | ||
rules: any; | ||
rules?: any; | ||
ruleParams?: { | ||
[key: string]: any; | ||
}; | ||
}) => Promise<{ | ||
@@ -465,3 +468,6 @@ result: QueryResponse<Q, Schema, WithCardinalityInference>; | ||
debugQuery: <Q extends InstaQLParams<Schema>>(query: Q, opts?: { | ||
rules: any; | ||
rules?: any; | ||
ruleParams?: { | ||
[key: string]: any; | ||
}; | ||
}) => Promise<{ | ||
@@ -468,0 +474,0 @@ result: InstaQLResponse<Schema, Q>; |
@@ -133,2 +133,6 @@ "use strict"; | ||
exports.init_experimental = init_experimental; | ||
function steps(inputChunks) { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
return chunks.flatMap(core_1.getOps); | ||
} | ||
/** | ||
@@ -212,8 +216,6 @@ * | ||
this.transact = (inputChunks) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => (0, core_1.getOps)(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact`, { | ||
method: 'POST', | ||
headers: authorizedHeaders(this.config, this.impersonationOpts), | ||
body: JSON.stringify({ steps: steps }), | ||
body: JSON.stringify({ steps: steps(inputChunks) }), | ||
}); | ||
@@ -243,2 +245,5 @@ }; | ||
this.debugQuery = (query, opts) => __awaiter(this, void 0, void 0, function* () { | ||
if (query && opts && 'ruleParams' in opts) { | ||
query = Object.assign({ $$ruleParams: opts['ruleParams'] }, query); | ||
} | ||
const response = yield jsonFetch(`${this.config.apiURI}/admin/query_perms_check`, { | ||
@@ -273,4 +278,2 @@ method: 'POST', | ||
this.debugTransact = (inputChunks, opts) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => (0, core_1.getOps)(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact_perms_check`, { | ||
@@ -280,3 +283,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'rules-override': opts === null || opts === void 0 ? void 0 : opts.rules, | ||
@@ -626,4 +629,2 @@ // @ts-expect-error because we're using a private API (for now) | ||
this.transact = (inputChunks) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => (0, core_1.getOps)(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact`, { | ||
@@ -633,3 +634,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'throw-on-missing-attrs?': !!this.config.schema, | ||
@@ -661,2 +662,5 @@ }), | ||
this.debugQuery = (query, opts) => __awaiter(this, void 0, void 0, function* () { | ||
if (query && opts && 'ruleParams' in opts) { | ||
query = Object.assign({ $$ruleParams: opts['ruleParams'] }, query); | ||
} | ||
const response = yield jsonFetch(`${this.config.apiURI}/admin/query_perms_check`, { | ||
@@ -691,4 +695,2 @@ method: 'POST', | ||
this.debugTransact = (inputChunks, opts) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => (0, core_1.getOps)(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact_perms_check`, { | ||
@@ -698,3 +700,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'rules-override': opts === null || opts === void 0 ? void 0 : opts.rules, | ||
@@ -701,0 +703,0 @@ // @ts-expect-error because we're using a private API (for now) |
@@ -166,3 +166,6 @@ import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type InstaQLResponse, type InstaQLParams, type InstaQLFields, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type BackwardsCompatibleSchema, 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, type InstaQLEntity, type InstaQLResult, type InstantRules, type UpdateParams, type LinkParams, type FileOpts, type UploadFileResponse, type DeleteFileResponse } from '@instantdb/core'; | ||
debugQuery: <Q extends Query>(query: Exactly<Query, Q>, opts?: { | ||
rules: any; | ||
rules?: any; | ||
ruleParams?: { | ||
[key: string]: any; | ||
}; | ||
}) => Promise<{ | ||
@@ -465,3 +468,6 @@ result: QueryResponse<Q, Schema, WithCardinalityInference>; | ||
debugQuery: <Q extends InstaQLParams<Schema>>(query: Q, opts?: { | ||
rules: any; | ||
rules?: any; | ||
ruleParams?: { | ||
[key: string]: any; | ||
}; | ||
}) => Promise<{ | ||
@@ -468,0 +474,0 @@ result: InstaQLResponse<Schema, Q>; |
@@ -121,2 +121,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const init_experimental = init; | ||
function steps(inputChunks) { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
return chunks.flatMap(getOps); | ||
} | ||
/** | ||
@@ -200,8 +204,6 @@ * | ||
this.transact = (inputChunks) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact`, { | ||
method: 'POST', | ||
headers: authorizedHeaders(this.config, this.impersonationOpts), | ||
body: JSON.stringify({ steps: steps }), | ||
body: JSON.stringify({ steps: steps(inputChunks) }), | ||
}); | ||
@@ -231,2 +233,5 @@ }; | ||
this.debugQuery = (query, opts) => __awaiter(this, void 0, void 0, function* () { | ||
if (query && opts && 'ruleParams' in opts) { | ||
query = Object.assign({ $$ruleParams: opts['ruleParams'] }, query); | ||
} | ||
const response = yield jsonFetch(`${this.config.apiURI}/admin/query_perms_check`, { | ||
@@ -261,4 +266,2 @@ method: 'POST', | ||
this.debugTransact = (inputChunks, opts) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact_perms_check`, { | ||
@@ -268,3 +271,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'rules-override': opts === null || opts === void 0 ? void 0 : opts.rules, | ||
@@ -614,4 +617,2 @@ // @ts-expect-error because we're using a private API (for now) | ||
this.transact = (inputChunks) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact`, { | ||
@@ -621,3 +622,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'throw-on-missing-attrs?': !!this.config.schema, | ||
@@ -649,2 +650,5 @@ }), | ||
this.debugQuery = (query, opts) => __awaiter(this, void 0, void 0, function* () { | ||
if (query && opts && 'ruleParams' in opts) { | ||
query = Object.assign({ $$ruleParams: opts['ruleParams'] }, query); | ||
} | ||
const response = yield jsonFetch(`${this.config.apiURI}/admin/query_perms_check`, { | ||
@@ -679,4 +683,2 @@ method: 'POST', | ||
this.debugTransact = (inputChunks, opts) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact_perms_check`, { | ||
@@ -686,3 +688,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'rules-override': opts === null || opts === void 0 ? void 0 : opts.rules, | ||
@@ -689,0 +691,0 @@ // @ts-expect-error because we're using a private API (for now) |
export default version; | ||
declare const version: "v0.17.29"; | ||
declare const version: "v0.17.30"; | ||
//# sourceMappingURL=version.d.ts.map |
// Autogenerated by publish_packages.clj | ||
const version = 'v0.17.29'; | ||
const version = 'v0.17.30'; | ||
export default version; | ||
//# sourceMappingURL=version.js.map |
export default version; | ||
declare const version: "v0.17.29"; | ||
declare const version: "v0.17.30"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Autogenerated by publish_packages.clj | ||
const version = 'v0.17.29'; | ||
const version = 'v0.17.30'; | ||
exports.default = version; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@instantdb/admin", | ||
"version": "v0.17.29", | ||
"version": "v0.17.30", | ||
"description": "Admin SDK for Instant DB", | ||
@@ -18,3 +18,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@instantdb/core": "v0.17.29" | ||
"@instantdb/core": "v0.17.30" | ||
}, | ||
@@ -24,4 +24,4 @@ "scripts": { | ||
"build": "rm -rf dist; npm run build:main && npm run build:module", | ||
"dev:main": "tsc -p tsconfig.json -w --skipLibCheck", | ||
"dev:module": "tsc -p tsconfig.module.json -w --skipLibCheck", | ||
"dev:main": "tsc -p tsconfig.json -w --skipLibCheck --preserveWatchOutput", | ||
"dev:module": "tsc -p tsconfig.module.json -w --skipLibCheck --preserveWatchOutput", | ||
"dev": "run-p dev:main dev:module", | ||
@@ -28,0 +28,0 @@ "build:main": "tsc -p tsconfig.json", |
@@ -227,2 +227,7 @@ import { | ||
function steps(inputChunks) { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
return chunks.flatMap(getOps); | ||
} | ||
/** | ||
@@ -339,8 +344,6 @@ * | ||
) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact`, { | ||
method: 'POST', | ||
headers: authorizedHeaders(this.config, this.impersonationOpts), | ||
body: JSON.stringify({ steps: steps }), | ||
body: JSON.stringify({ steps: steps(inputChunks) }), | ||
}); | ||
@@ -372,3 +375,3 @@ }; | ||
query: Exactly<Query, Q>, | ||
opts?: { rules: any }, | ||
opts?: { rules?: any; ruleParams?: { [key: string]: any } }, | ||
): Promise<{ | ||
@@ -378,2 +381,6 @@ result: QueryResponse<Q, Schema, WithCardinalityInference>; | ||
}> => { | ||
if (query && opts && 'ruleParams' in opts) { | ||
query = { $$ruleParams: opts['ruleParams'], ...query }; | ||
} | ||
const response = await jsonFetch( | ||
@@ -416,4 +423,2 @@ `${this.config.apiURI}/admin/query_perms_check`, | ||
) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact_perms_check`, { | ||
@@ -423,3 +428,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'rules-override': opts?.rules, | ||
@@ -865,4 +870,2 @@ // @ts-expect-error because we're using a private API (for now) | ||
) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact`, { | ||
@@ -872,3 +875,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'throw-on-missing-attrs?': !!this.config.schema, | ||
@@ -902,3 +905,3 @@ }), | ||
query: Q, | ||
opts?: { rules: any }, | ||
opts?: { rules?: any; ruleParams?: { [key: string]: any } }, | ||
): Promise<{ | ||
@@ -908,2 +911,6 @@ result: InstaQLResponse<Schema, Q>; | ||
}> => { | ||
if (query && opts && 'ruleParams' in opts) { | ||
query = { $$ruleParams: opts['ruleParams'], ...query }; | ||
} | ||
const response = await jsonFetch( | ||
@@ -946,4 +953,2 @@ `${this.config.apiURI}/admin/query_perms_check`, | ||
) => { | ||
const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks]; | ||
const steps = chunks.flatMap((tx) => getOps(tx)); | ||
return jsonFetch(`${this.config.apiURI}/admin/transact_perms_check`, { | ||
@@ -953,3 +958,3 @@ method: 'POST', | ||
body: JSON.stringify({ | ||
steps: steps, | ||
steps: steps(inputChunks), | ||
'rules-override': opts?.rules, | ||
@@ -956,0 +961,0 @@ // @ts-expect-error because we're using a private API (for now) |
// Autogenerated by publish_packages.clj | ||
const version = 'v0.17.29'; | ||
const version = 'v0.17.30'; | ||
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
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
3368
0.54%218386
-0.11%Updated