@pooflabs/server 0.0.1 → 0.0.2
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/README.md +3 -3
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/providers/solana-keypair-provider.d.ts +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -254,6 +254,6 @@ This server-side SDK differs from the web SDK in several important ways:
|
|
|
254
254
|
|
|
255
255
|
This package is part of a family of modular SDKs:
|
|
256
256
|
|
|
257
|
-
- **@
|
|
258
|
-
- **@
|
|
259
|
-
- **@
|
|
257
|
+
- **@pooflabs/core**: Core functionality shared between all SDKs
|
|
258
|
+
- **@pooflabs/web**: Browser-focused SDK (identical to original js-sdk)
|
|
259
|
+
- **@pooflabs/server**: Server-side SDK for backend applications
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Connection, Keypair } from '@solana/web3.js';
|
|
2
|
-
import type { AuthProvider, EVMTransaction, SolTransaction, TransactionResult, User, SetOptions } from '@
|
|
2
|
+
import type { AuthProvider, EVMTransaction, SolTransaction, TransactionResult, User, SetOptions } from '@pooflabs/core';
|
|
3
3
|
export declare class SolanaKeypairProvider implements AuthProvider {
|
|
4
4
|
private readonly networkUrl;
|
|
5
5
|
private readonly connection;
|
package/dist/global.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ClientConfig } from '@
|
|
1
|
+
import { ClientConfig } from '@pooflabs/core';
|
|
2
2
|
export declare function init(newConfig: Partial<ClientConfig>): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { init } from "./global";
|
|
2
|
-
export { getConfig } from '@
|
|
2
|
+
export { getConfig } from '@pooflabs/core';
|
|
3
3
|
export { getAuthProvider } from './auth';
|
|
4
|
-
export { get, set, setMany, setFile, getFiles, runQuery, runQueryMany } from '@
|
|
5
|
-
export { subscribe } from '@
|
|
6
|
-
export * from '@
|
|
7
|
-
export { getIdToken } from '@
|
|
4
|
+
export { get, set, setMany, setFile, getFiles, runQuery, runQueryMany, runExpression, runExpressionMany } from '@pooflabs/core';
|
|
5
|
+
export { subscribe } from '@pooflabs/core';
|
|
6
|
+
export * from '@pooflabs/core';
|
|
7
|
+
export { getIdToken } from '@pooflabs/core';
|
package/dist/index.js
CHANGED
|
@@ -6655,6 +6655,37 @@ async function runQueryMany(many) {
|
|
|
6655
6655
|
throw error;
|
|
6656
6656
|
}
|
|
6657
6657
|
}
|
|
6658
|
+
// NEW: Ad-hoc expression execution - first-class feature
|
|
6659
|
+
async function runExpression(expression, queryArgs, options) {
|
|
6660
|
+
const results = await runExpressionMany([Object.assign({ expression, queryArgs }, options)]);
|
|
6661
|
+
return results[0];
|
|
6662
|
+
}
|
|
6663
|
+
async function runExpressionMany(many) {
|
|
6664
|
+
try {
|
|
6665
|
+
let queries = [];
|
|
6666
|
+
let overrides = undefined;
|
|
6667
|
+
for (const { expression, queryArgs, returnType, _overrides } of many) {
|
|
6668
|
+
// Collect overrides from first query that has them (all queries share same request)
|
|
6669
|
+
if (_overrides && !overrides) {
|
|
6670
|
+
overrides = _overrides;
|
|
6671
|
+
}
|
|
6672
|
+
queries.push({ queryArgs, expression, returnType });
|
|
6673
|
+
}
|
|
6674
|
+
const response = await makeApiRequest('POST', 'queries', { queries }, overrides);
|
|
6675
|
+
// Map results - trace is automatically included by server for non-mainnet networks
|
|
6676
|
+
return response.data.queries.map((queryResult) => {
|
|
6677
|
+
const result = { result: queryResult.result };
|
|
6678
|
+
// Include trace if present (server includes it for non-mainnet networks)
|
|
6679
|
+
if (queryResult.trace) {
|
|
6680
|
+
result.trace = queryResult.trace;
|
|
6681
|
+
}
|
|
6682
|
+
return result;
|
|
6683
|
+
});
|
|
6684
|
+
}
|
|
6685
|
+
catch (error) {
|
|
6686
|
+
throw error;
|
|
6687
|
+
}
|
|
6688
|
+
}
|
|
6658
6689
|
async function set(path, document, options) {
|
|
6659
6690
|
const result = await setMany([{ path, document }], options);
|
|
6660
6691
|
// Clear cache entries that might be affected by this update
|
|
@@ -10440,6 +10471,8 @@ exports.getFiles = getFiles;
|
|
|
10440
10471
|
exports.getIdToken = getIdToken;
|
|
10441
10472
|
exports.init = init;
|
|
10442
10473
|
exports.refreshSession = refreshSession;
|
|
10474
|
+
exports.runExpression = runExpression;
|
|
10475
|
+
exports.runExpressionMany = runExpressionMany;
|
|
10443
10476
|
exports.runQuery = runQuery;
|
|
10444
10477
|
exports.runQueryMany = runQueryMany;
|
|
10445
10478
|
exports.set = set;
|