UNPKG

atp-sdk

Version:

Official TypeScript SDK for Agent Trust Protocol™ - Build secure, verifiable, and trustworthy applications with decentralized identity, verifiable credentials, and robust access control

89 lines 4.8 kB
"use strict"; /** * ATP™ SDK - Agent Trust Protocol SDK * * A comprehensive TypeScript SDK for interacting with Agent Trust Protocol™ services * * @version 1.0.0 * @author Agent Trust Protocol™ Team * @license MIT */ Object.defineProperty(exports, "__esModule", { value: true }); exports.SDK_INFO = exports.ATP_CONSTANTS = exports.PROTOCOL_VERSION = exports.VERSION = exports.JWTUtils = exports.DIDUtils = exports.CryptoUtils = exports.GatewayClient = exports.AuditClient = exports.PermissionsClient = exports.CredentialsClient = exports.IdentityClient = exports.BaseClient = exports.ATPClient = exports.default = exports.Agent = void 0; exports.createATPClient = createATPClient; exports.createQuickConfig = createQuickConfig; // Simplified Agent API (3-line quick start!) var simple_agent_js_1 = require("./simple-agent.js"); Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return simple_agent_js_1.Agent; } }); var simple_agent_js_2 = require("./simple-agent.js"); Object.defineProperty(exports, "default", { enumerable: true, get: function () { return simple_agent_js_2.Agent; } }); // Main ATP Client var atp_js_1 = require("./client/atp.js"); Object.defineProperty(exports, "ATPClient", { enumerable: true, get: function () { return atp_js_1.ATPClient; } }); // Service Clients var base_js_1 = require("./client/base.js"); Object.defineProperty(exports, "BaseClient", { enumerable: true, get: function () { return base_js_1.BaseClient; } }); var identity_js_1 = require("./client/identity.js"); Object.defineProperty(exports, "IdentityClient", { enumerable: true, get: function () { return identity_js_1.IdentityClient; } }); var credentials_js_1 = require("./client/credentials.js"); Object.defineProperty(exports, "CredentialsClient", { enumerable: true, get: function () { return credentials_js_1.CredentialsClient; } }); var permissions_js_1 = require("./client/permissions.js"); Object.defineProperty(exports, "PermissionsClient", { enumerable: true, get: function () { return permissions_js_1.PermissionsClient; } }); var audit_js_1 = require("./client/audit.js"); Object.defineProperty(exports, "AuditClient", { enumerable: true, get: function () { return audit_js_1.AuditClient; } }); var gateway_js_1 = require("./client/gateway.js"); Object.defineProperty(exports, "GatewayClient", { enumerable: true, get: function () { return gateway_js_1.GatewayClient; } }); // Utility Classes var crypto_js_1 = require("./utils/crypto.js"); Object.defineProperty(exports, "CryptoUtils", { enumerable: true, get: function () { return crypto_js_1.CryptoUtils; } }); var did_js_1 = require("./utils/did.js"); Object.defineProperty(exports, "DIDUtils", { enumerable: true, get: function () { return did_js_1.DIDUtils; } }); var jwt_js_1 = require("./utils/jwt.js"); Object.defineProperty(exports, "JWTUtils", { enumerable: true, get: function () { return jwt_js_1.JWTUtils; } }); // Version information exports.VERSION = '1.0.0'; exports.PROTOCOL_VERSION = '1.0'; // Constants exports.ATP_CONSTANTS = { DEFAULT_TIMEOUT: 30000, MAX_RETRIES: 3, RETRY_DELAY: 1000, DEFAULT_JWT_EXPIRY: '1h', DEFAULT_REFRESH_TOKEN_EXPIRY: '30d', SUPPORTED_DID_METHODS: ['atp', 'key', 'web'], SUPPORTED_NETWORKS: ['mainnet', 'testnet', 'local'], DEFAULT_NETWORK: 'mainnet' }; // Re-import for function implementations const atp_js_2 = require("./client/atp.js"); // Helper functions for quick SDK setup function createATPClient(config) { return new atp_js_2.ATPClient(config); } function createQuickConfig(baseUrl, options) { return { baseUrl, timeout: (options === null || options === void 0 ? void 0 : options.timeout) || exports.ATP_CONSTANTS.DEFAULT_TIMEOUT, retries: (options === null || options === void 0 ? void 0 : options.retries) || exports.ATP_CONSTANTS.MAX_RETRIES, retryDelay: exports.ATP_CONSTANTS.RETRY_DELAY, auth: (options === null || options === void 0 ? void 0 : options.auth) || {}, services: { identity: process.env.ATP_IDENTITY_URL || `${baseUrl}:3001`, credentials: process.env.ATP_CREDENTIALS_URL || `${baseUrl}:3002`, permissions: process.env.ATP_PERMISSIONS_URL || `${baseUrl}:3003`, audit: process.env.ATP_AUDIT_URL || `${baseUrl}:3006`, gateway: process.env.ATP_GATEWAY_URL || `${baseUrl}:3000` } }; } // SDK Metadata exports.SDK_INFO = { name: '@atp/sdk', version: exports.VERSION, protocolVersion: exports.PROTOCOL_VERSION, description: 'Official TypeScript SDK for Agent Trust Protocol™', repository: 'https://github.com/atp/sdk', documentation: 'https://docs.atp.protocol', support: 'https://support.atp.protocol' }; //# sourceMappingURL=index.js.map