@naturali/sdk 0.228.1 → 0.229.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/dist/index.mjs CHANGED
@@ -2031,6 +2031,175 @@ var Chains = class {
2031
2031
  });
2032
2032
  }
2033
2033
  };
2034
+ var Collections = class {
2035
+ /**
2036
+ * List collections
2037
+ *
2038
+ * Returns the collections in scope, oldest first.
2039
+ */
2040
+ static listCollections(options) {
2041
+ return (options.client ?? client).get({
2042
+ url: "/v1/projects/{project_id}/collections",
2043
+ ...options
2044
+ });
2045
+ }
2046
+ /**
2047
+ * Create a collection
2048
+ *
2049
+ * Creates a collection. `name` is unique per project; a second collection of the same name is `409 NAME_CONFLICT`. A `schema` is compiled here, so one JSON Schema cannot parse is refused rather than stored.
2050
+ */
2051
+ static createCollection(options) {
2052
+ return (options.client ?? client).post({
2053
+ url: "/v1/projects/{project_id}/collections",
2054
+ ...options,
2055
+ headers: {
2056
+ "Content-Type": "application/json",
2057
+ ...options.headers
2058
+ }
2059
+ });
2060
+ }
2061
+ /**
2062
+ * Delete a collection
2063
+ *
2064
+ * Deletes the collection and every item in it.
2065
+ */
2066
+ static deleteCollection(options) {
2067
+ return (options.client ?? client).delete({
2068
+ url: "/v1/projects/{project_id}/collections/{collection_id}",
2069
+ ...options
2070
+ });
2071
+ }
2072
+ /**
2073
+ * Get a collection
2074
+ *
2075
+ * Returns one collection.
2076
+ */
2077
+ static getCollection(options) {
2078
+ return (options.client ?? client).get({
2079
+ url: "/v1/projects/{project_id}/collections/{collection_id}",
2080
+ ...options
2081
+ });
2082
+ }
2083
+ /**
2084
+ * Update a collection
2085
+ *
2086
+ * Renames the collection or replaces its `schema`. A new schema governs the next write of each item; items already stored are not re-judged.
2087
+ */
2088
+ static updateCollection(options) {
2089
+ return (options.client ?? client).patch({
2090
+ url: "/v1/projects/{project_id}/collections/{collection_id}",
2091
+ ...options,
2092
+ headers: {
2093
+ "Content-Type": "application/json",
2094
+ ...options.headers
2095
+ }
2096
+ });
2097
+ }
2098
+ /**
2099
+ * List items
2100
+ *
2101
+ * Returns the collection's items in key order, narrowed by `data` and `tags`. The listing is bounded by `limit` (at most 100) and a statement timeout; a query past it is `422 QUERY_TIMEOUT`.
2102
+ */
2103
+ static listCollectionItems(options) {
2104
+ return (options.client ?? client).get({
2105
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items",
2106
+ ...options
2107
+ });
2108
+ }
2109
+ /**
2110
+ * Delete an item
2111
+ *
2112
+ * Deletes the item at `key`.
2113
+ */
2114
+ static deleteCollectionItem(options) {
2115
+ return (options.client ?? client).delete({
2116
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}",
2117
+ ...options
2118
+ });
2119
+ }
2120
+ /**
2121
+ * Get an item
2122
+ *
2123
+ * Returns the item at `key`.
2124
+ */
2125
+ static getCollectionItem(options) {
2126
+ return (options.client ?? client).get({
2127
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}",
2128
+ ...options
2129
+ });
2130
+ }
2131
+ /**
2132
+ * Update an item
2133
+ *
2134
+ * Merges `data` into the item's as a JSON Merge Patch (RFC 7386): an object merges key by key, `null` removes a key, any other value replaces it. The merged `data` is judged as a put's is.
2135
+ */
2136
+ static updateCollectionItem(options) {
2137
+ return (options.client ?? client).patch({
2138
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}",
2139
+ ...options,
2140
+ headers: {
2141
+ "Content-Type": "application/json",
2142
+ ...options.headers
2143
+ }
2144
+ });
2145
+ }
2146
+ /**
2147
+ * Create or replace an item
2148
+ *
2149
+ * Writes `data` at `key`: `201` when the key was free, `200` when it replaced an item. `tags` replace the bag when sent and leave it alone when omitted. `data` is at most 64 KB as JSON and must satisfy the collection's `schema`. A precondition (`If-Match` or `expected_version`) names a version of an existing item, so it is `404` for a free key.
2150
+ */
2151
+ static putCollectionItem(options) {
2152
+ return (options.client ?? client).put({
2153
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}",
2154
+ ...options,
2155
+ headers: {
2156
+ "Content-Type": "application/json",
2157
+ ...options.headers
2158
+ }
2159
+ });
2160
+ }
2161
+ /**
2162
+ * Get item tags
2163
+ *
2164
+ * Returns the item's tags.
2165
+ */
2166
+ static getCollectionItemTags(options) {
2167
+ return (options.client ?? client).get({
2168
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}/tags",
2169
+ ...options
2170
+ });
2171
+ }
2172
+ /**
2173
+ * Merge item tags
2174
+ *
2175
+ * Merges the given tags into the item's; a key not sent is kept. Bumps the item's `version`.
2176
+ */
2177
+ static mergeCollectionItemTags(options) {
2178
+ return (options.client ?? client).patch({
2179
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}/tags",
2180
+ ...options,
2181
+ headers: {
2182
+ "Content-Type": "application/json",
2183
+ ...options.headers
2184
+ }
2185
+ });
2186
+ }
2187
+ /**
2188
+ * Replace item tags
2189
+ *
2190
+ * Replaces every tag on the item. Bumps the item's `version`.
2191
+ */
2192
+ static replaceCollectionItemTags(options) {
2193
+ return (options.client ?? client).put({
2194
+ url: "/v1/projects/{project_id}/collections/{collection_id}/items/{key}/tags",
2195
+ ...options,
2196
+ headers: {
2197
+ "Content-Type": "application/json",
2198
+ ...options.headers
2199
+ }
2200
+ });
2201
+ }
2202
+ };
2034
2203
  var Conversations = class {
2035
2204
  /**
2036
2205
  * List conversations
@@ -6703,6 +6872,7 @@ var NaturaliClient = class {
6703
6872
  auditLog;
6704
6873
  assistant;
6705
6874
  chains;
6875
+ collections;
6706
6876
  channels;
6707
6877
  auth;
6708
6878
  conversations;
@@ -6760,6 +6930,7 @@ var NaturaliClient = class {
6760
6930
  this.auditLog = bindResource(AuditLog, this.http);
6761
6931
  this.assistant = bindResource(Assistant, this.http);
6762
6932
  this.chains = bindResource(Chains, this.http);
6933
+ this.collections = bindResource(Collections, this.http);
6763
6934
  this.channels = bindResource(Channels, this.http);
6764
6935
  this.auth = bindResource(Auth, this.http);
6765
6936
  this.conversations = bindResource(Conversations, this.http);
@@ -6799,4 +6970,4 @@ var NaturaliClient = class {
6799
6970
  }
6800
6971
  };
6801
6972
  //#endregion
6802
- export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Installs, Knowledge, Listings, McpServers, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Models, NaturaliClient, Orchestrations, Playbooks, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
6973
+ export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Collections, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Installs, Knowledge, Listings, McpServers, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Models, NaturaliClient, Orchestrations, Playbooks, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.228.1",
3
+ "version": "0.229.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@hey-api/openapi-ts": "^0.99.0",
41
- "@naturali/api": "0.228.1",
41
+ "@naturali/api": "0.229.0",
42
42
  "@ttoss/openapi-codegen": "^0.10.0",
43
43
  "@types/node": "^26.5.1",
44
44
  "tsdown": "^0.23.0",