
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
ISO/IEC 39075:2024 GQL Client with TypeScript type safety and Merkle DAG caching
A type-safe, Merkle DAG-based GQL client library compliant with ISO/IEC 39075:2024 standards.
npm install iso-gql-client
import { createGQLClient, useQuery } from 'iso-gql-client';
const client = createGQLClient({
endpoint: 'https://api.example.com/graphql'
});
// React Hookでの使用
function MyComponent() {
const { data, loading, error } = useQuery(`
query GetUsers {
users {
id
name
email
}
}
`);
if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<ul>
{data.users.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
// lib/gql-client.ts
import { createGQLClient, MerkleCacheManager } from 'iso-gql-client';
export const gqlClient = createGQLClient({
endpoint: process.env.NEXT_PUBLIC_GQL_ENDPOINT!,
timeout: 10000,
retries: 3,
});
export const cacheManager = new MerkleCacheManager({
maxSize: 100,
ttl: 300000, // 5分
enableMerkleValidation: true,
});
// app/layout.tsx
import { GQLProvider } from 'iso-gql-client';
import { gqlClient, cacheManager } from '../lib/gql-client';
export default function RootLayout({ children }) {
return (
<GQLProvider client={gqlClient} cache={cacheManager}>
{children}
</GQLProvider>
);
}
This library adopts a Merkle DAG-based process network architecture:
gql_parser → type_generator → client_runtime → cache_manager → framework_adapter
Each node plays the following roles:
import { TypedQueryBuilder } from 'iso-gql-client';
interface User {
id: string;
name: string;
email: string;
}
interface GetUsersResponse {
users: User[];
}
const queryBuilder = new TypedQueryBuilder<GetUsersResponse>(client);
const result = await queryBuilder.execute(`
query GetUsers {
users {
id
name
email
}
}
`);
import { MerkleCacheManager } from 'iso-gql-client';
const cache = new MerkleCacheManager({
maxSize: 1000,
ttl: 300000,
enableMerkleValidation: true,
});
// Get cache statistics
const stats = cache.getStats();
console.log(`Cache size: ${stats.size}/${stats.maxSize}`);
console.log(`Merkle root: ${stats.merkleRoot}`);
import { ContentAddressableCache } from 'ayatori';
const caCache = new ContentAddressableCache();
// Cache by content
const contentHash = caCache.setByContent('user-query', responseData);
// Retrieve by hash
const cachedData = caCache.getByContent(contentHash);
Ayatori supports multiple frameworks through a unified adapter system:
import { initializeFramework } from 'ayatori';
const client = createGQLClient({ endpoint: 'https://api.example.com/graphql' });
const cache = new MerkleCacheManager();
// Auto-detect framework and initialize
const { bindings, clientBindings } = await initializeFramework(client, cache);
// Or specify framework explicitly
const { bindings, clientBindings } = await initializeFramework(client, cache, 'nextjs');
import { BaseFrameworkAdapter, frameworkRegistry } from 'ayatori';
class CustomAdapter extends BaseFrameworkAdapter {
name = 'custom-framework';
version = '1.0.0';
protected async setup(): Promise<void> {
// Custom framework initialization
}
protected async cleanup(): Promise<void> {
// Custom framework cleanup
}
}
// Register custom adapter
frameworkRegistry.register('custom-framework', new CustomAdapter());
npm run build
npm test
npm run typegen
// tsconfig.json
{
"compilerOptions": {
"plugins": [
{
"name": "hataori",
"options": {
"merkleRoot": "./dag.jsonnet"
}
}
]
}
}
// next.config.js
const nextConfig = {
webpack: (config, { isServer }) => {
if (!isServer) {
config.plugins.push(
new (require('hataori/webpack-plugin'))({
merkleRoot: './dag.jsonnet'
})
);
}
return config;
},
};
module.exports = nextConfig;
Complete examples can be found in the examples/
directory:
examples/nextjs-app/
: Complete application example using Next.jsgit checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)MIT License - See LICENSE file for details.
This library complies with the following standards:
FAQs
ISO/IEC 39075:2024 GQL Client with TypeScript type safety and Merkle DAG caching
We found that ayatori demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.