@axiom-lattice/client-sdk 2.1.13 → 2.1.15
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/dist/abstract-client.d.ts +36 -0
- package/dist/abstract-client.d.ts.map +1 -1
- package/dist/abstract-client.js +91 -0
- package/dist/abstract-client.js.map +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2054,6 +2054,95 @@ var AbstractClient = class {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
2056
|
};
|
|
2057
|
+
/**
|
|
2058
|
+
* Skills namespace for managing skills
|
|
2059
|
+
*/
|
|
2060
|
+
this.skills = {
|
|
2061
|
+
/**
|
|
2062
|
+
* Lists all available skills
|
|
2063
|
+
* @returns A promise that resolves to the list of skills
|
|
2064
|
+
*/
|
|
2065
|
+
list: async () => {
|
|
2066
|
+
try {
|
|
2067
|
+
const response = await this.makeRequest("/api/skills");
|
|
2068
|
+
return response.data.records;
|
|
2069
|
+
} catch (error) {
|
|
2070
|
+
throw error;
|
|
2071
|
+
}
|
|
2072
|
+
},
|
|
2073
|
+
/**
|
|
2074
|
+
* Retrieves a single skill by ID
|
|
2075
|
+
* @param id - Skill identifier
|
|
2076
|
+
* @returns A promise that resolves to the skill information
|
|
2077
|
+
*/
|
|
2078
|
+
get: async (id) => {
|
|
2079
|
+
try {
|
|
2080
|
+
const response = await this.makeRequest(`/api/skills/${id}`);
|
|
2081
|
+
if (!response.data) {
|
|
2082
|
+
throw new ApiError("Skill not found", 404);
|
|
2083
|
+
}
|
|
2084
|
+
return response.data;
|
|
2085
|
+
} catch (error) {
|
|
2086
|
+
throw error;
|
|
2087
|
+
}
|
|
2088
|
+
},
|
|
2089
|
+
/**
|
|
2090
|
+
* Creates a new skill
|
|
2091
|
+
* @param options - Options for creating a skill
|
|
2092
|
+
* @returns A promise that resolves to the created skill
|
|
2093
|
+
*/
|
|
2094
|
+
create: async (options) => {
|
|
2095
|
+
try {
|
|
2096
|
+
const response = await this.makeRequest("/api/skills", {
|
|
2097
|
+
method: "POST",
|
|
2098
|
+
body: options
|
|
2099
|
+
});
|
|
2100
|
+
if (!response.data) {
|
|
2101
|
+
throw new ApiError("Failed to create skill", 500);
|
|
2102
|
+
}
|
|
2103
|
+
return response.data;
|
|
2104
|
+
} catch (error) {
|
|
2105
|
+
throw error;
|
|
2106
|
+
}
|
|
2107
|
+
},
|
|
2108
|
+
/**
|
|
2109
|
+
* Updates an existing skill by ID
|
|
2110
|
+
* @param id - Skill identifier
|
|
2111
|
+
* @param options - Options for updating a skill
|
|
2112
|
+
* @returns A promise that resolves to the updated skill
|
|
2113
|
+
*/
|
|
2114
|
+
update: async (id, options) => {
|
|
2115
|
+
try {
|
|
2116
|
+
const response = await this.makeRequest(`/api/skills/${id}`, {
|
|
2117
|
+
method: "PUT",
|
|
2118
|
+
body: options
|
|
2119
|
+
});
|
|
2120
|
+
if (!response.data) {
|
|
2121
|
+
throw new ApiError("Failed to update skill", 500);
|
|
2122
|
+
}
|
|
2123
|
+
return response.data;
|
|
2124
|
+
} catch (error) {
|
|
2125
|
+
throw error;
|
|
2126
|
+
}
|
|
2127
|
+
},
|
|
2128
|
+
/**
|
|
2129
|
+
* Deletes a skill by ID
|
|
2130
|
+
* @param id - Skill identifier
|
|
2131
|
+
* @returns A promise that resolves when the skill is deleted
|
|
2132
|
+
*/
|
|
2133
|
+
delete: async (id) => {
|
|
2134
|
+
try {
|
|
2135
|
+
await this.makeRequest(
|
|
2136
|
+
`/api/skills/${id}`,
|
|
2137
|
+
{
|
|
2138
|
+
method: "DELETE"
|
|
2139
|
+
}
|
|
2140
|
+
);
|
|
2141
|
+
} catch (error) {
|
|
2142
|
+
throw error;
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2057
2146
|
/**
|
|
2058
2147
|
* Threads namespace for managing threads for the current assistant
|
|
2059
2148
|
*/
|