@langslide/sdk 0.1.0
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 +708 -0
- package/dist/api/auth.d.ts +18 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +43 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/integrations.d.ts +27 -0
- package/dist/api/integrations.d.ts.map +1 -0
- package/dist/api/integrations.js +64 -0
- package/dist/api/integrations.js.map +1 -0
- package/dist/api/mcp.d.ts +15 -0
- package/dist/api/mcp.d.ts.map +1 -0
- package/dist/api/mcp.js +24 -0
- package/dist/api/mcp.js.map +1 -0
- package/dist/api/recipes.d.ts +19 -0
- package/dist/api/recipes.d.ts.map +1 -0
- package/dist/api/recipes.js +37 -0
- package/dist/api/recipes.js.map +1 -0
- package/dist/api/users.d.ts +19 -0
- package/dist/api/users.d.ts.map +1 -0
- package/dist/api/users.js +32 -0
- package/dist/api/users.js.map +1 -0
- package/dist/api/workflows.d.ts +44 -0
- package/dist/api/workflows.d.ts.map +1 -0
- package/dist/api/workflows.js +95 -0
- package/dist/api/workflows.js.map +1 -0
- package/dist/browser.js +2 -0
- package/dist/browser.js.map +1 -0
- package/dist/client.d.ts +35 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +87 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +21 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +39 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +39 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +92 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/react/LangslideProvider.d.ts +12 -0
- package/dist/react/LangslideProvider.d.ts.map +1 -0
- package/dist/react/LangslideProvider.js +87 -0
- package/dist/react/LangslideProvider.js.map +1 -0
- package/dist/react/api/auth.d.ts +18 -0
- package/dist/react/api/auth.d.ts.map +1 -0
- package/dist/react/api/auth.js +43 -0
- package/dist/react/api/auth.js.map +1 -0
- package/dist/react/api/integrations.d.ts +27 -0
- package/dist/react/api/integrations.d.ts.map +1 -0
- package/dist/react/api/integrations.js +64 -0
- package/dist/react/api/integrations.js.map +1 -0
- package/dist/react/api/mcp.d.ts +15 -0
- package/dist/react/api/mcp.d.ts.map +1 -0
- package/dist/react/api/mcp.js +24 -0
- package/dist/react/api/mcp.js.map +1 -0
- package/dist/react/api/recipes.d.ts +19 -0
- package/dist/react/api/recipes.d.ts.map +1 -0
- package/dist/react/api/recipes.js +37 -0
- package/dist/react/api/recipes.js.map +1 -0
- package/dist/react/api/users.d.ts +19 -0
- package/dist/react/api/users.d.ts.map +1 -0
- package/dist/react/api/users.js +32 -0
- package/dist/react/api/users.js.map +1 -0
- package/dist/react/api/workflows.d.ts +44 -0
- package/dist/react/api/workflows.d.ts.map +1 -0
- package/dist/react/api/workflows.js +95 -0
- package/dist/react/api/workflows.js.map +1 -0
- package/dist/react/client.d.ts +35 -0
- package/dist/react/client.d.ts.map +1 -0
- package/dist/react/client.js +87 -0
- package/dist/react/client.js.map +1 -0
- package/dist/react/config.d.ts +21 -0
- package/dist/react/config.d.ts.map +1 -0
- package/dist/react/config.js +39 -0
- package/dist/react/config.js.map +1 -0
- package/dist/react/errors.d.ts +39 -0
- package/dist/react/errors.d.ts.map +1 -0
- package/dist/react/errors.js +92 -0
- package/dist/react/errors.js.map +1 -0
- package/dist/react/index.d.ts +10 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +18 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/react/LangslideProvider.d.ts +19 -0
- package/dist/react/react/LangslideProvider.d.ts.map +1 -0
- package/dist/react/react/LangslideProvider.js +87 -0
- package/dist/react/react/LangslideProvider.js.map +1 -0
- package/dist/react/react/index.d.ts +10 -0
- package/dist/react/react/index.d.ts.map +1 -0
- package/dist/react/react/index.js +18 -0
- package/dist/react/react/index.js.map +1 -0
- package/dist/react/react/useIntegrations.d.ts +13 -0
- package/dist/react/react/useIntegrations.d.ts.map +1 -0
- package/dist/react/react/useIntegrations.js +70 -0
- package/dist/react/react/useIntegrations.js.map +1 -0
- package/dist/react/react/useWorkflows.d.ts +14 -0
- package/dist/react/react/useWorkflows.d.ts.map +1 -0
- package/dist/react/react/useWorkflows.js +108 -0
- package/dist/react/react/useWorkflows.js.map +1 -0
- package/dist/react/types/common.d.ts +28 -0
- package/dist/react/types/common.d.ts.map +1 -0
- package/dist/react/types/common.js +6 -0
- package/dist/react/types/common.js.map +1 -0
- package/dist/react/types/index.d.ts +8 -0
- package/dist/react/types/index.d.ts.map +1 -0
- package/dist/react/types/index.js +25 -0
- package/dist/react/types/index.js.map +1 -0
- package/dist/react/types/integration.d.ts +23 -0
- package/dist/react/types/integration.d.ts.map +1 -0
- package/dist/react/types/integration.js +6 -0
- package/dist/react/types/integration.js.map +1 -0
- package/dist/react/types/permissions.d.ts +31 -0
- package/dist/react/types/permissions.d.ts.map +1 -0
- package/dist/react/types/permissions.js +33 -0
- package/dist/react/types/permissions.js.map +1 -0
- package/dist/react/types/workflow.d.ts +33 -0
- package/dist/react/types/workflow.d.ts.map +1 -0
- package/dist/react/types/workflow.js +6 -0
- package/dist/react/types/workflow.js.map +1 -0
- package/dist/react/useIntegrations.d.ts +13 -0
- package/dist/react/useIntegrations.d.ts.map +1 -0
- package/dist/react/useIntegrations.js +70 -0
- package/dist/react/useIntegrations.js.map +1 -0
- package/dist/react/useWorkflows.d.ts +14 -0
- package/dist/react/useWorkflows.d.ts.map +1 -0
- package/dist/react/useWorkflows.js +108 -0
- package/dist/react/useWorkflows.js.map +1 -0
- package/dist/react/utils/permission-guard.d.ts +13 -0
- package/dist/react/utils/permission-guard.d.ts.map +1 -0
- package/dist/react/utils/permission-guard.js +28 -0
- package/dist/react/utils/permission-guard.js.map +1 -0
- package/dist/react/utils/permissions.d.ts +20 -0
- package/dist/react/utils/permissions.d.ts.map +1 -0
- package/dist/react/utils/permissions.js +48 -0
- package/dist/react/utils/permissions.js.map +1 -0
- package/dist/react/utils/request.d.ts +7 -0
- package/dist/react/utils/request.d.ts.map +1 -0
- package/dist/react/utils/request.js +48 -0
- package/dist/react/utils/request.js.map +1 -0
- package/dist/types/auth.d.ts +5 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +7 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/common.d.ts +28 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +6 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/integration.d.ts +23 -0
- package/dist/types/integration.d.ts.map +1 -0
- package/dist/types/integration.js +6 -0
- package/dist/types/integration.js.map +1 -0
- package/dist/types/permissions.d.ts +31 -0
- package/dist/types/permissions.d.ts.map +1 -0
- package/dist/types/permissions.js +33 -0
- package/dist/types/permissions.js.map +1 -0
- package/dist/types/workflow.d.ts +33 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +6 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/utils/permission-guard.d.ts +13 -0
- package/dist/utils/permission-guard.d.ts.map +1 -0
- package/dist/utils/permission-guard.js +28 -0
- package/dist/utils/permission-guard.js.map +1 -0
- package/dist/utils/permissions.d.ts +20 -0
- package/dist/utils/permissions.d.ts.map +1 -0
- package/dist/utils/permissions.js +48 -0
- package/dist/utils/permissions.js.map +1 -0
- package/dist/utils/request.d.ts +7 -0
- package/dist/utils/request.d.ts.map +1 -0
- package/dist/utils/request.js +48 -0
- package/dist/utils/request.js.map +1 -0
- package/dist/utils/validation.d.ts +8 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +37 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +76 -0
package/dist/client.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.LangslideSDK = void 0;
|
|
15
|
+
const config_1 = require("./config");
|
|
16
|
+
const errors_1 = require("./errors");
|
|
17
|
+
const request_1 = require("./utils/request");
|
|
18
|
+
const workflows_1 = require("./api/workflows");
|
|
19
|
+
const integrations_1 = require("./api/integrations");
|
|
20
|
+
const auth_1 = require("./api/auth");
|
|
21
|
+
const users_1 = require("./api/users");
|
|
22
|
+
const mcp_1 = require("./api/mcp");
|
|
23
|
+
const recipes_1 = require("./api/recipes");
|
|
24
|
+
/**
|
|
25
|
+
* Main Langslide SDK client class
|
|
26
|
+
*/
|
|
27
|
+
class LangslideSDK {
|
|
28
|
+
constructor(config = {}) {
|
|
29
|
+
try {
|
|
30
|
+
this.config = (0, config_1.resolveConfig)(config);
|
|
31
|
+
this.client = (0, request_1.createRequestClient)(this.config);
|
|
32
|
+
// Set API key in headers if provided (validation will happen when setApiKey is called)
|
|
33
|
+
if (this.config.apiKey) {
|
|
34
|
+
this.client.defaults.headers.common['X-API-Key'] = this.config.apiKey;
|
|
35
|
+
}
|
|
36
|
+
// Initialize API modules
|
|
37
|
+
this.workflows = new workflows_1.WorkflowsAPI(this.client, this.config);
|
|
38
|
+
this.integrations = new integrations_1.IntegrationsAPI(this.client, this.config);
|
|
39
|
+
this.auth = new auth_1.AuthAPI(this.client, this.config);
|
|
40
|
+
this.users = new users_1.UsersAPI(this.client, this.config);
|
|
41
|
+
this.mcp = new mcp_1.MCPAPI(this.client, this.config);
|
|
42
|
+
this.recipes = new recipes_1.RecipesAPI(this.client, this.config);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw new errors_1.LangslideError(`Failed to initialize SDK: ${error.message}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Update the API key and validate it to fetch permissions
|
|
50
|
+
*/
|
|
51
|
+
async setApiKey(apiKey) {
|
|
52
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
53
|
+
throw new errors_1.LangslideError('API key must be a non-empty string');
|
|
54
|
+
}
|
|
55
|
+
this.config.apiKey = apiKey;
|
|
56
|
+
// Update the axios client's default headers
|
|
57
|
+
this.client.defaults.headers.common['X-API-Key'] = apiKey;
|
|
58
|
+
// Validate API key and fetch permissions
|
|
59
|
+
try {
|
|
60
|
+
const permissions = await this.auth.validateAPIKey(apiKey);
|
|
61
|
+
this.config.permissions = permissions;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
// If validation fails, clear permissions but don't throw
|
|
65
|
+
// This allows the SDK to be used with JWT auth (no permissions)
|
|
66
|
+
this.config.permissions = undefined;
|
|
67
|
+
if (this.config.enableLogging) {
|
|
68
|
+
console.warn('[LangslideSDK] Failed to validate API key:', error.message);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the current configuration (without sensitive data)
|
|
74
|
+
*/
|
|
75
|
+
getConfig() {
|
|
76
|
+
const _a = this.config, { apiKey } = _a, publicConfig = __rest(_a, ["apiKey"]);
|
|
77
|
+
return publicConfig;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the current permissions
|
|
81
|
+
*/
|
|
82
|
+
getPermissions() {
|
|
83
|
+
return this.config.permissions;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.LangslideSDK = LangslideSDK;
|
|
87
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,qCAAyF;AACzF,qCAA0C;AAE1C,6CAAsD;AACtD,+CAA+C;AAC/C,qDAAqD;AACrD,qCAAqC;AACrC,uCAAuC;AACvC,mCAAmC;AACnC,2CAA2C;AAE3C;;GAEG;AACH,MAAa,YAAY;IAWvB,YAAY,SAA6B,EAAE;QACzC,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;YACpC,IAAI,CAAC,MAAM,GAAG,IAAA,6BAAmB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAE/C,uFAAuF;YACvF,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBACvB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YACxE,CAAC;YAED,yBAAyB;YACzB,IAAI,CAAC,SAAS,GAAG,IAAI,wBAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5D,IAAI,CAAC,YAAY,GAAG,IAAI,8BAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAClE,IAAI,CAAC,IAAI,GAAG,IAAI,cAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,KAAK,GAAG,IAAI,gBAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC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AM,EAAzC,EAAE,MAAM,OAAiC,EAA5B,YAAY,cAAzB,UAA2B,CAAc,CAAC;QAChD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;CACF;AAxED,oCAwEC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface LangslideSDKConfig {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
retries?: number;
|
|
6
|
+
enableLogging?: boolean;
|
|
7
|
+
}
|
|
8
|
+
import { IAPIKeyPermissions } from './types/permissions';
|
|
9
|
+
export interface LangslideSDKConfigResolved {
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
timeout: number;
|
|
13
|
+
retries: number;
|
|
14
|
+
enableLogging: boolean;
|
|
15
|
+
permissions?: IAPIKeyPermissions;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolves SDK configuration with defaults and environment variables
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveConfig(config?: LangslideSDKConfig): LangslideSDKConfigResolved;
|
|
21
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAMD;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,kBAAuB,GAAG,0BAA0B,CAgCzF"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveConfig = resolveConfig;
|
|
4
|
+
const DEFAULT_BASE_URL = 'https://backend-api-306481332586.asia-southeast1.run.app';
|
|
5
|
+
const DEFAULT_TIMEOUT = 30000; // 30 seconds
|
|
6
|
+
const DEFAULT_RETRIES = 3;
|
|
7
|
+
/**
|
|
8
|
+
* Resolves SDK configuration with defaults and environment variables
|
|
9
|
+
*/
|
|
10
|
+
function resolveConfig(config = {}) {
|
|
11
|
+
var _a, _b, _c, _d, _e;
|
|
12
|
+
// Get baseUrl from config, environment variable, or default
|
|
13
|
+
const baseUrl = config.baseUrl ||
|
|
14
|
+
(typeof process !== 'undefined' && ((_a = process.env) === null || _a === void 0 ? void 0 : _a.LANGSLIDE_API_URL)) ||
|
|
15
|
+
DEFAULT_BASE_URL;
|
|
16
|
+
// Get apiKey from config or environment variable
|
|
17
|
+
// API key is optional - JWT users may not have one
|
|
18
|
+
const apiKey = config.apiKey ||
|
|
19
|
+
(typeof process !== 'undefined' && ((_b = process.env) === null || _b === void 0 ? void 0 : _b.LANGSLIDE_API_KEY)) ||
|
|
20
|
+
undefined;
|
|
21
|
+
// Validate baseUrl
|
|
22
|
+
if (!baseUrl || typeof baseUrl !== 'string') {
|
|
23
|
+
throw new Error('baseUrl must be a non-empty string');
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
new URL(baseUrl);
|
|
27
|
+
}
|
|
28
|
+
catch (_f) {
|
|
29
|
+
throw new Error(`Invalid baseUrl: ${baseUrl}`);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
baseUrl: baseUrl.replace(/\/$/, ''), // Remove trailing slash
|
|
33
|
+
apiKey,
|
|
34
|
+
timeout: (_c = config.timeout) !== null && _c !== void 0 ? _c : DEFAULT_TIMEOUT,
|
|
35
|
+
retries: (_d = config.retries) !== null && _d !== void 0 ? _d : DEFAULT_RETRIES,
|
|
36
|
+
enableLogging: (_e = config.enableLogging) !== null && _e !== void 0 ? _e : false,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AA0BA,sCAgCC;AAvCD,MAAM,gBAAgB,GAAG,0DAA0D,CAAC;AACpF,MAAM,eAAe,GAAG,KAAK,CAAC,CAAC,aAAa;AAC5C,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;GAEG;AACH,SAAgB,aAAa,CAAC,SAA6B,EAAE;;IAC3D,4DAA4D;IAC5D,MAAM,OAAO,GACX,MAAM,CAAC,OAAO;QACd,CAAC,OAAO,OAAO,KAAK,WAAW,KAAI,MAAA,OAAO,CAAC,GAAG,0CAAE,iBAAiB,CAAA,CAAC;QAClE,gBAAgB,CAAC;IAEnB,iDAAiD;IACjD,mDAAmD;IACnD,MAAM,MAAM,GACV,MAAM,CAAC,MAAM;QACb,CAAC,OAAO,OAAO,KAAK,WAAW,KAAI,MAAA,OAAO,CAAC,GAAG,0CAAE,iBAAiB,CAAA,CAAC;QAClE,SAAS,CAAC;IAEZ,mBAAmB;IACnB,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IAAC,WAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,wBAAwB;QAC7D,MAAM;QACN,OAAO,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,eAAe;QAC1C,OAAO,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,eAAe;QAC1C,aAAa,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,KAAK;KAC7C,CAAC;AACJ,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error class for all Langslide SDK errors
|
|
3
|
+
*/
|
|
4
|
+
export declare class LangslideError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* API-specific errors with HTTP status codes
|
|
9
|
+
*/
|
|
10
|
+
export declare class LangslideAPIError extends LangslideError {
|
|
11
|
+
statusCode: number;
|
|
12
|
+
response?: any;
|
|
13
|
+
constructor(message: string, statusCode: number, response?: any);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Authentication errors
|
|
17
|
+
*/
|
|
18
|
+
export declare class LangslideAuthError extends LangslideError {
|
|
19
|
+
constructor(message?: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validation errors
|
|
23
|
+
*/
|
|
24
|
+
export declare class LangslideValidationError extends LangslideError {
|
|
25
|
+
field?: string | undefined;
|
|
26
|
+
constructor(message: string, field?: string | undefined);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Permission errors
|
|
30
|
+
*/
|
|
31
|
+
export declare class LangslidePermissionError extends LangslideAuthError {
|
|
32
|
+
requiredPermission?: string;
|
|
33
|
+
constructor(message: string, requiredPermission?: string);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Transforms an axios error or fetch error into an appropriate SDK error
|
|
37
|
+
*/
|
|
38
|
+
export declare function transformError(error: any): LangslideError;
|
|
39
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAK5B;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;gBAEV,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG;CAOhE;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;gBACxC,OAAO,GAAE,MAAgC;CAKtD;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM;gBAAtC,OAAO,EAAE,MAAM,EAAS,KAAK,CAAC,EAAE,MAAM,YAAA;CAKnD;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,kBAAkB;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;gBAEvB,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;CAMzD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,cAAc,CA6BzD"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LangslidePermissionError = exports.LangslideValidationError = exports.LangslideAuthError = exports.LangslideAPIError = exports.LangslideError = void 0;
|
|
4
|
+
exports.transformError = transformError;
|
|
5
|
+
/**
|
|
6
|
+
* Base error class for all Langslide SDK errors
|
|
7
|
+
*/
|
|
8
|
+
class LangslideError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = 'LangslideError';
|
|
12
|
+
Object.setPrototypeOf(this, LangslideError.prototype);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.LangslideError = LangslideError;
|
|
16
|
+
/**
|
|
17
|
+
* API-specific errors with HTTP status codes
|
|
18
|
+
*/
|
|
19
|
+
class LangslideAPIError extends LangslideError {
|
|
20
|
+
constructor(message, statusCode, response) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = 'LangslideAPIError';
|
|
23
|
+
this.statusCode = statusCode;
|
|
24
|
+
this.response = response;
|
|
25
|
+
Object.setPrototypeOf(this, LangslideAPIError.prototype);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.LangslideAPIError = LangslideAPIError;
|
|
29
|
+
/**
|
|
30
|
+
* Authentication errors
|
|
31
|
+
*/
|
|
32
|
+
class LangslideAuthError extends LangslideError {
|
|
33
|
+
constructor(message = 'Authentication failed') {
|
|
34
|
+
super(message);
|
|
35
|
+
this.name = 'LangslideAuthError';
|
|
36
|
+
Object.setPrototypeOf(this, LangslideAuthError.prototype);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.LangslideAuthError = LangslideAuthError;
|
|
40
|
+
/**
|
|
41
|
+
* Validation errors
|
|
42
|
+
*/
|
|
43
|
+
class LangslideValidationError extends LangslideError {
|
|
44
|
+
constructor(message, field) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.field = field;
|
|
47
|
+
this.name = 'LangslideValidationError';
|
|
48
|
+
Object.setPrototypeOf(this, LangslideValidationError.prototype);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.LangslideValidationError = LangslideValidationError;
|
|
52
|
+
/**
|
|
53
|
+
* Permission errors
|
|
54
|
+
*/
|
|
55
|
+
class LangslidePermissionError extends LangslideAuthError {
|
|
56
|
+
constructor(message, requiredPermission) {
|
|
57
|
+
super(message);
|
|
58
|
+
this.name = 'LangslidePermissionError';
|
|
59
|
+
this.requiredPermission = requiredPermission;
|
|
60
|
+
Object.setPrototypeOf(this, LangslidePermissionError.prototype);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.LangslidePermissionError = LangslidePermissionError;
|
|
64
|
+
/**
|
|
65
|
+
* Transforms an axios error or fetch error into an appropriate SDK error
|
|
66
|
+
*/
|
|
67
|
+
function transformError(error) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
// If it's already a Langslide error, return it
|
|
70
|
+
if (error instanceof LangslideError) {
|
|
71
|
+
return error;
|
|
72
|
+
}
|
|
73
|
+
// Handle axios errors
|
|
74
|
+
if (error.response) {
|
|
75
|
+
const statusCode = error.response.status;
|
|
76
|
+
const message = ((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.message) ||
|
|
77
|
+
((_b = error.response.data) === null || _b === void 0 ? void 0 : _b.error) ||
|
|
78
|
+
error.message ||
|
|
79
|
+
`API request failed with status ${statusCode}`;
|
|
80
|
+
if (statusCode === 401 || statusCode === 403) {
|
|
81
|
+
return new LangslideAuthError(message);
|
|
82
|
+
}
|
|
83
|
+
return new LangslideAPIError(message, statusCode, error.response.data);
|
|
84
|
+
}
|
|
85
|
+
// Handle network errors
|
|
86
|
+
if (error.request) {
|
|
87
|
+
return new LangslideError(`Network error: ${error.message}`);
|
|
88
|
+
}
|
|
89
|
+
// Handle other errors
|
|
90
|
+
return new LangslideError(error.message || 'An unexpected error occurred');
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAkEA,wCA6BC;AA/FD;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAA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';
|
|
5
|
+
export type { LangslideSDKConfig } from './config';
|
|
6
|
+
export { LangslideError, LangslideAPIError, LangslideAuthError, LangslideValidationError, LangslidePermissionError, } from './errors';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export { LangslideSDK as default } from './client';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAGlB,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,YAAY,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Langslide SDK - Main entry point
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.default = exports.LangslidePermissionError = exports.LangslideValidationError = exports.LangslideAuthError = exports.LangslideAPIError = exports.LangslideError = exports.LangslideSDK = void 0;
|
|
21
|
+
// Export main SDK class
|
|
22
|
+
var client_1 = require("./client");
|
|
23
|
+
Object.defineProperty(exports, "LangslideSDK", { enumerable: true, get: function () { return client_1.LangslideSDK; } });
|
|
24
|
+
// Export error classes
|
|
25
|
+
var errors_1 = require("./errors");
|
|
26
|
+
Object.defineProperty(exports, "LangslideError", { enumerable: true, get: function () { return errors_1.LangslideError; } });
|
|
27
|
+
Object.defineProperty(exports, "LangslideAPIError", { enumerable: true, get: function () { return errors_1.LangslideAPIError; } });
|
|
28
|
+
Object.defineProperty(exports, "LangslideAuthError", { enumerable: true, get: function () { return errors_1.LangslideAuthError; } });
|
|
29
|
+
Object.defineProperty(exports, "LangslideValidationError", { enumerable: true, get: function () { return errors_1.LangslideValidationError; } });
|
|
30
|
+
Object.defineProperty(exports, "LangslidePermissionError", { enumerable: true, get: function () { return errors_1.LangslidePermissionError; } });
|
|
31
|
+
// Export all types
|
|
32
|
+
__exportStar(require("./types"), exports);
|
|
33
|
+
// Default export
|
|
34
|
+
var client_2 = require("./client");
|
|
35
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_2.LangslideSDK; } });
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,wBAAwB;AACxB,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AAKrB,uBAAuB;AACvB,mCAMkB;AALhB,wGAAA,cAAc,OAAA;AACd,2GAAA,iBAAiB,OAAA;AACjB,4GAAA,kBAAkB,OAAA;AAClB,kHAAA,wBAAwB,OAAA;AACxB,kHAAA,wBAAwB,OAAA;AAG1B,mBAAmB;AACnB,0CAAwB;AAExB,iBAAiB;AACjB,mCAAmD;AAA1C,iGAAA,YAAY,OAAW"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LangslideSDKConfig } from '../config';
|
|
3
|
+
interface LangslideProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
config?: LangslideSDKConfig;
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function LangslideProvider({ children, config, apiKey, }: LangslideProviderProps): any;
|
|
9
|
+
export declare function useLangslide(): any;
|
|
10
|
+
export declare function useLangslideContext(): any;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=LangslideProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LangslideProvider.d.ts","sourceRoot":"","sources":["../../src/react/LangslideProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAkD,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAgB/C,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,MAAW,EACX,MAAM,GACP,EAAE,sBAAsB,OAqCxB;AAED,wBAAgB,YAAY,QAM3B;AAED,wBAAgB,mBAAmB,QAElC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.LangslideProvider = LangslideProvider;
|
|
37
|
+
exports.useLangslide = useLangslide;
|
|
38
|
+
exports.useLangslideContext = useLangslideContext;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const client_1 = require("../client");
|
|
41
|
+
const LangslideContext = (0, react_1.createContext)({
|
|
42
|
+
sdk: null,
|
|
43
|
+
initialized: false,
|
|
44
|
+
error: null,
|
|
45
|
+
initialize: async () => { },
|
|
46
|
+
});
|
|
47
|
+
function LangslideProvider({ children, config = {}, apiKey, }) {
|
|
48
|
+
const [sdk, setSDK] = (0, react_1.useState)(null);
|
|
49
|
+
const [initialized, setInitialized] = (0, react_1.useState)(false);
|
|
50
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
51
|
+
const initialize = async (initConfig) => {
|
|
52
|
+
try {
|
|
53
|
+
setError(null);
|
|
54
|
+
const sdkInstance = new client_1.LangslideSDK(initConfig);
|
|
55
|
+
// If API key is provided, validate it
|
|
56
|
+
if (initConfig.apiKey || apiKey) {
|
|
57
|
+
const keyToUse = initConfig.apiKey || apiKey;
|
|
58
|
+
if (keyToUse) {
|
|
59
|
+
await sdkInstance.setApiKey(keyToUse);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
setSDK(sdkInstance);
|
|
63
|
+
setInitialized(true);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
setError(err.message || 'Failed to initialize SDK');
|
|
67
|
+
setInitialized(false);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
if (config && Object.keys(config).length > 0) {
|
|
72
|
+
initialize(config);
|
|
73
|
+
}
|
|
74
|
+
}, []);
|
|
75
|
+
return (react_1.default.createElement(LangslideContext.Provider, { value: { sdk, initialized, error, initialize } }, children));
|
|
76
|
+
}
|
|
77
|
+
function useLangslide() {
|
|
78
|
+
const context = (0, react_1.useContext)(LangslideContext);
|
|
79
|
+
if (!context.sdk) {
|
|
80
|
+
throw new Error('useLangslide must be used within LangslideProvider');
|
|
81
|
+
}
|
|
82
|
+
return context.sdk;
|
|
83
|
+
}
|
|
84
|
+
function useLangslideContext() {
|
|
85
|
+
return (0, react_1.useContext)(LangslideContext);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=LangslideProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LangslideProvider.js","sourceRoot":"","sources":["../../src/react/LangslideProvider.tsx"],"names":[],"m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AC,CAAC;YACpD,cAAc,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7C,UAAU,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,IACtE,QAAQ,CACiB,CAC7B,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY;IAC1B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,CAAC;AAED,SAAgB,mBAAmB;IACjC,OAAO,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { LangslideSDKConfigResolved } from '../config';
|
|
3
|
+
import { IAPIKeyPermissions } from '../types/permissions';
|
|
4
|
+
/**
|
|
5
|
+
* Authentication API module
|
|
6
|
+
*/
|
|
7
|
+
export declare class AuthAPI {
|
|
8
|
+
private client;
|
|
9
|
+
private config;
|
|
10
|
+
constructor(client: AxiosInstance, config: LangslideSDKConfigResolved);
|
|
11
|
+
/**
|
|
12
|
+
* Validate API key and return permissions
|
|
13
|
+
* This method calls the backend to validate the API key and fetch permissions
|
|
14
|
+
* @throws {LangslideAuthError} If API key is invalid
|
|
15
|
+
*/
|
|
16
|
+
validateAPIKey(apiKey: string): Promise<IAPIKeyPermissions>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/api/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,OAAO;IAEhB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;gBADN,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,0BAA0B;IAG5C;;;;OAIG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA6BlE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthAPI = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
/**
|
|
6
|
+
* Authentication API module
|
|
7
|
+
*/
|
|
8
|
+
class AuthAPI {
|
|
9
|
+
constructor(client, config) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validate API key and return permissions
|
|
15
|
+
* This method calls the backend to validate the API key and fetch permissions
|
|
16
|
+
* @throws {LangslideAuthError} If API key is invalid
|
|
17
|
+
*/
|
|
18
|
+
async validateAPIKey(apiKey) {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
if (!apiKey || typeof apiKey !== 'string') {
|
|
21
|
+
throw new errors_1.LangslideAuthError('API key must be a non-empty string');
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const response = await this.client.get('/auth/validate-api-key', {
|
|
25
|
+
headers: {
|
|
26
|
+
'X-API-Key': apiKey,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
if (!((_a = response.data.data) === null || _a === void 0 ? void 0 : _a.permissions)) {
|
|
30
|
+
throw new errors_1.LangslideAuthError('Invalid response: permissions not found');
|
|
31
|
+
}
|
|
32
|
+
return response.data.data.permissions;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof errors_1.LangslideAuthError) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
throw new errors_1.LangslideAuthError(`Failed to validate API key: ${((_c = (_b = error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.detail) || error.message}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.AuthAPI = AuthAPI;
|
|
43
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/api/auth.ts"],"names":[],"mappings":";;;AAGA,sCAA+C;AAG/C;;GAEG;AACH,MAAa,OAAO;IAClB,YACU,MAAqB,EACrB,MAAkC;QADlC,WAAM,GAAN,MAAM,CAAe;QACrB,WAAM,GAAN,MAAM,CAA4B;IACzC,CAAC;IAEJ;;;;OAIG;IACH,KAAK,CAAC,cAAc,CAAC,MAAc;;QACjC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,IAAI,2BAAkB,CAAC,oCAAoC,CAAC,CAAC;QACrE,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,wBAAwB,EACxB;gBACE,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM;iBACpB;aACF,CACF,CAAC;YAEF,IAAI,CAAC,CAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,0CAAE,WAAW,CAAA,EAAE,CAAC;gBACrC,MAAM,IAAI,2BAAkB,CAAC,yCAAyC,CAAC,CAAC;YAC1E,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QACxC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,YAAY,2BAAkB,EAAE,CAAC;gBACxC,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,IAAI,2BAAkB,CAC1B,+BAA+B,CAAA,MAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,0CAAE,MAAM,KAAI,KAAK,CAAC,OAAO,EAAE,CAC/E,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAxCD,0BAwCC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Integration, Connection, ListOptions, PaginatedResponse } from '../types';
|
|
3
|
+
import { LangslideSDKConfigResolved } from '../config';
|
|
4
|
+
/**
|
|
5
|
+
* Integrations API module
|
|
6
|
+
*/
|
|
7
|
+
export declare class IntegrationsAPI {
|
|
8
|
+
private client;
|
|
9
|
+
private config;
|
|
10
|
+
constructor(client: AxiosInstance, config: LangslideSDKConfigResolved);
|
|
11
|
+
/**
|
|
12
|
+
* List all integrations with filters
|
|
13
|
+
* @param options - Search and filter options
|
|
14
|
+
*/
|
|
15
|
+
list(options?: ListOptions & {
|
|
16
|
+
type?: 'trigger' | 'action';
|
|
17
|
+
}): Promise<PaginatedResponse<Integration>>;
|
|
18
|
+
/**
|
|
19
|
+
* Get an integration by name
|
|
20
|
+
*/
|
|
21
|
+
get(name: string): Promise<Integration>;
|
|
22
|
+
/**
|
|
23
|
+
* Get connections for a specific integration
|
|
24
|
+
*/
|
|
25
|
+
getConnections(integrationName: string): Promise<Connection[]>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/api/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAe,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAIvD;;GAEG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;gBADN,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,0BAA0B;IAG5C;;;OAGG;IACG,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG;QAAE,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;KAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAoChH;;OAEG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7C;;OAEG;IACG,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAQrE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationsAPI = void 0;
|
|
4
|
+
const permissions_1 = require("../types/permissions");
|
|
5
|
+
const permission_guard_1 = require("../utils/permission-guard");
|
|
6
|
+
/**
|
|
7
|
+
* Integrations API module
|
|
8
|
+
*/
|
|
9
|
+
class IntegrationsAPI {
|
|
10
|
+
constructor(client, config) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
this.config = config;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List all integrations with filters
|
|
16
|
+
* @param options - Search and filter options
|
|
17
|
+
*/
|
|
18
|
+
async list(options = {}) {
|
|
19
|
+
(0, permission_guard_1.requirePermission)(this.config.permissions, permissions_1.SDK_METHODS.INTEGRATIONS_READ);
|
|
20
|
+
const { page = 1, limit = 10, status = 'all', search = '', type, sortBy, sortOrder, createdAfter, createdBefore, tags, } = options;
|
|
21
|
+
const params = { page, limit, status };
|
|
22
|
+
if (search)
|
|
23
|
+
params.search = search;
|
|
24
|
+
if (type)
|
|
25
|
+
params.type = type;
|
|
26
|
+
if (sortBy)
|
|
27
|
+
params.sortBy = sortBy;
|
|
28
|
+
if (sortOrder)
|
|
29
|
+
params.sortOrder = sortOrder;
|
|
30
|
+
if (createdAfter) {
|
|
31
|
+
params.createdAfter =
|
|
32
|
+
createdAfter instanceof Date ? createdAfter.toISOString() : createdAfter;
|
|
33
|
+
}
|
|
34
|
+
if (createdBefore) {
|
|
35
|
+
params.createdBefore =
|
|
36
|
+
createdBefore instanceof Date ? createdBefore.toISOString() : createdBefore;
|
|
37
|
+
}
|
|
38
|
+
if (tags && tags.length > 0)
|
|
39
|
+
params.tags = tags.join(',');
|
|
40
|
+
const response = await this.client.get('/integration/all', {
|
|
41
|
+
params,
|
|
42
|
+
});
|
|
43
|
+
return response.data.data;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get an integration by name
|
|
47
|
+
*/
|
|
48
|
+
async get(name) {
|
|
49
|
+
(0, permission_guard_1.requirePermission)(this.config.permissions, permissions_1.SDK_METHODS.INTEGRATIONS_READ);
|
|
50
|
+
const response = await this.client.get(`/integration/${name}`);
|
|
51
|
+
return response.data.data;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get connections for a specific integration
|
|
55
|
+
*/
|
|
56
|
+
async getConnections(integrationName) {
|
|
57
|
+
(0, permission_guard_1.requirePermission)(this.config.permissions, permissions_1.SDK_METHODS.INTEGRATIONS_READ);
|
|
58
|
+
(0, permission_guard_1.requireConnectorAccess)(this.config.permissions, integrationName);
|
|
59
|
+
const response = await this.client.get(`/integration/auth/${integrationName}`);
|
|
60
|
+
return response.data.data.connections || [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.IntegrationsAPI = IntegrationsAPI;
|
|
64
|
+
//# sourceMappingURL=integrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/api/integrations.ts"],"names":[],"mappings":";;;AAGA,sDAAmD;AACnD,gEAAsF;AAEtF;;GAEG;AACH,MAAa,eAAe;IAC1B,YACU,MAAqB,EACrB,MAAkC;QADlC,WAAM,GAAN,MAAM,CAAe;QACrB,WAAM,GAAN,MAAM,CAA4B;IACzC,CAAC;IAEJ;;;OAGG;IACH,KAAK,CAAC,IAAI,CAAC,UAAyD,EAAE;QACpE,IAAA,oCAAiB,EAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,yBAAW,CAAC,iBAAiB,CAAC,CAAC;QAC1E,MAAM,EACJ,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,EAAE,EACV,MAAM,GAAG,KAAK,EACd,MAAM,GAAG,EAAE,EACX,IAAI,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,aAAa,EACb,IAAI,GACL,GAAG,OAAO,CAAC;QAEZ,MAAM,MAAM,GAAwB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAC5D,IAAI,MAAM;YAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACnC,IAAI,IAAI;YAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QAC7B,IAAI,MAAM;YAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACnC,IAAI,SAAS;YAAE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5C,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,CAAC,YAAY;gBACjB,YAAY,YAAY,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;QAC7E,CAAC;QACD,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,aAA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