@pairsystems/goodmem-client 1.0.0-beta.1 → 1.0.0-dev.cb052d6

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.
Files changed (61) hide show
  1. package/README.md +100 -82
  2. package/dist/ApiClient.js +33 -52
  3. package/dist/api/APIKeysApi.js +72 -51
  4. package/dist/api/EmbeddersApi.js +93 -63
  5. package/dist/api/MemoriesApi.js +263 -80
  6. package/dist/api/RerankersApi.js +262 -0
  7. package/dist/api/SpacesApi.js +100 -66
  8. package/dist/api/SystemApi.js +24 -18
  9. package/dist/api/UsersApi.js +100 -26
  10. package/dist/client.js +26 -1
  11. package/dist/index.js +181 -0
  12. package/dist/model/AbstractReply.js +138 -0
  13. package/dist/model/ApiKeyResponse.js +5 -5
  14. package/dist/model/BatchMemoryCreationRequest.js +5 -5
  15. package/dist/model/BatchMemoryDeletionRequest.js +5 -5
  16. package/dist/model/BatchMemoryRetrievalRequest.js +5 -5
  17. package/dist/model/BinaryContent.js +129 -0
  18. package/dist/model/ChunkReference.js +152 -0
  19. package/dist/model/ChunkingConfiguration.js +115 -0
  20. package/dist/model/ContextItem.js +136 -0
  21. package/dist/model/CreateApiKeyRequest.js +5 -5
  22. package/dist/model/CreateApiKeyResponse.js +5 -5
  23. package/dist/model/DistributionType.js +58 -0
  24. package/dist/model/EmbedderCreationRequest.js +20 -9
  25. package/dist/model/EmbedderResponse.js +20 -9
  26. package/dist/model/EmbedderWeight.js +125 -0
  27. package/dist/model/GoodMemStatus.js +129 -0
  28. package/dist/model/LengthMeasurement.js +63 -0
  29. package/dist/model/ListApiKeysResponse.js +5 -5
  30. package/dist/model/ListEmbeddersResponse.js +5 -5
  31. package/dist/model/ListRerankersResponse.js +132 -0
  32. package/dist/model/ListSpacesResponse.js +5 -5
  33. package/dist/model/Memory.js +23 -15
  34. package/dist/model/MemoryChunkResponse.js +240 -0
  35. package/dist/model/MemoryCreationRequest.js +21 -9
  36. package/dist/model/MemoryListResponse.js +5 -5
  37. package/dist/model/Modality.js +4 -4
  38. package/dist/model/PostProcessor.js +125 -0
  39. package/dist/model/ProviderType.js +9 -4
  40. package/dist/model/RecursiveChunkingConfiguration.js +165 -0
  41. package/dist/model/RerankerCreationRequest.js +266 -0
  42. package/dist/model/RerankerResponse.js +316 -0
  43. package/dist/model/ResultSetBoundary.js +153 -0
  44. package/dist/model/RetrieveMemoryEvent.js +148 -0
  45. package/dist/model/RetrieveMemoryRequest.js +219 -0
  46. package/dist/model/RetrievedItem.js +106 -0
  47. package/dist/model/SentenceChunkingConfiguration.js +141 -0
  48. package/dist/model/SeparatorKeepStrategy.js +63 -0
  49. package/dist/model/Space.js +19 -5
  50. package/dist/model/SpaceCreationRequest.js +19 -5
  51. package/dist/model/SpaceEmbedder.js +5 -5
  52. package/dist/model/SpaceEmbedderConfig.js +5 -5
  53. package/dist/model/SpaceKey.js +145 -0
  54. package/dist/model/SystemInitResponse.js +5 -5
  55. package/dist/model/UpdateApiKeyRequest.js +5 -5
  56. package/dist/model/UpdateEmbedderRequest.js +5 -5
  57. package/dist/model/UpdateRerankerRequest.js +226 -0
  58. package/dist/model/UpdateSpaceRequest.js +22 -44
  59. package/dist/model/UserResponse.js +5 -5
  60. package/dist/streaming.js +649 -0
  61. package/package.json +4 -36
@@ -0,0 +1,262 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _ListRerankersResponse = _interopRequireDefault(require("../model/ListRerankersResponse"));
9
+ var _RerankerCreationRequest = _interopRequireDefault(require("../model/RerankerCreationRequest"));
10
+ var _RerankerResponse = _interopRequireDefault(require("../model/RerankerResponse"));
11
+ var _UpdateRerankerRequest = _interopRequireDefault(require("../model/UpdateRerankerRequest"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ *
20
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
21
+ *
22
+ * The version of the OpenAPI document:
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * Rerankers service.
32
+ * @module api/RerankersApi
33
+ * @version 1.0.0
34
+ */
35
+ var RerankersApi = exports["default"] = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new RerankersApi.
38
+ * @alias module:api/RerankersApi
39
+ * @class
40
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
+ * default to {@link module:ApiClient#instance} if unspecified.
42
+ */
43
+ function RerankersApi(apiClient) {
44
+ _classCallCheck(this, RerankersApi);
45
+ this.apiClient = apiClient || _ApiClient["default"].instance;
46
+ }
47
+
48
+ /**
49
+ * Create a new reranker
50
+ * Creates a new reranker configuration for ranking search results. Rerankers represent connections to different reranking API services (like TEI, OpenAI, etc.) and include all the necessary configuration to use them for result ranking. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another reranker exists with identical {owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. DEFAULTS: api_path defaults to '/rerank' if omitted; supported_modalities defaults to [TEXT] if omitted. Requires CREATE_RERANKER_OWN permission (or CREATE_RERANKER_ANY for admin users). This operation is NOT idempotent - each request creates a new reranker record.
51
+ * @param {module:model/RerankerCreationRequest} rerankerCreationRequest Reranker configuration details
52
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RerankerResponse} and HTTP response
53
+ */
54
+ return _createClass(RerankersApi, [{
55
+ key: "createRerankerWithHttpInfo",
56
+ value: function createRerankerWithHttpInfo(rerankerCreationRequest) {
57
+ var postBody = rerankerCreationRequest;
58
+ // verify the required parameter 'rerankerCreationRequest' is set
59
+ if (rerankerCreationRequest === undefined || rerankerCreationRequest === null) {
60
+ throw new Error("Missing the required parameter 'rerankerCreationRequest' when calling createReranker");
61
+ }
62
+ var pathParams = {};
63
+ var queryParams = {};
64
+ var headerParams = {};
65
+ var formParams = {};
66
+ var authNames = [];
67
+ var contentTypes = ['application/json'];
68
+ var accepts = ['application/json'];
69
+ var returnType = _RerankerResponse["default"];
70
+ return this.apiClient.callApi('/v1/rerankers', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
71
+ }
72
+
73
+ /**
74
+ * Create a new reranker
75
+ * Creates a new reranker configuration for ranking search results. Rerankers represent connections to different reranking API services (like TEI, OpenAI, etc.) and include all the necessary configuration to use them for result ranking. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another reranker exists with identical {owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. DEFAULTS: api_path defaults to '/rerank' if omitted; supported_modalities defaults to [TEXT] if omitted. Requires CREATE_RERANKER_OWN permission (or CREATE_RERANKER_ANY for admin users). This operation is NOT idempotent - each request creates a new reranker record.
76
+ * @param {module:model/RerankerCreationRequest} rerankerCreationRequest Reranker configuration details
77
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RerankerResponse}
78
+ */
79
+ }, {
80
+ key: "createReranker",
81
+ value: function createReranker(rerankerCreationRequest) {
82
+ return this.createRerankerWithHttpInfo(rerankerCreationRequest).then(function (response_and_data) {
83
+ return response_and_data.data;
84
+ });
85
+ }
86
+
87
+ /**
88
+ * Delete a reranker
89
+ * Permanently deletes a reranker configuration. This operation cannot be undone and immediately removes the reranker record from the database. SIDE EFFECTS: Invalidates any cached references to this reranker; does not affect historical usage data or audit logs. Requires DELETE_RERANKER_OWN permission for rerankers you own (or DELETE_RERANKER_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
90
+ * @param {String} id The unique identifier of the reranker to delete
91
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
92
+ */
93
+ }, {
94
+ key: "deleteRerankerWithHttpInfo",
95
+ value: function deleteRerankerWithHttpInfo(id) {
96
+ var postBody = null;
97
+ // verify the required parameter 'id' is set
98
+ if (id === undefined || id === null) {
99
+ throw new Error("Missing the required parameter 'id' when calling deleteReranker");
100
+ }
101
+ var pathParams = {
102
+ 'id': id
103
+ };
104
+ var queryParams = {};
105
+ var headerParams = {};
106
+ var formParams = {};
107
+ var authNames = [];
108
+ var contentTypes = [];
109
+ var accepts = [];
110
+ var returnType = null;
111
+ return this.apiClient.callApi('/v1/rerankers/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
112
+ }
113
+
114
+ /**
115
+ * Delete a reranker
116
+ * Permanently deletes a reranker configuration. This operation cannot be undone and immediately removes the reranker record from the database. SIDE EFFECTS: Invalidates any cached references to this reranker; does not affect historical usage data or audit logs. Requires DELETE_RERANKER_OWN permission for rerankers you own (or DELETE_RERANKER_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
117
+ * @param {String} id The unique identifier of the reranker to delete
118
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
119
+ */
120
+ }, {
121
+ key: "deleteReranker",
122
+ value: function deleteReranker(id) {
123
+ return this.deleteRerankerWithHttpInfo(id).then(function (response_and_data) {
124
+ return response_and_data.data;
125
+ });
126
+ }
127
+
128
+ /**
129
+ * Get a reranker by ID
130
+ * Retrieves the details of a specific reranker configuration by its unique identifier. SECURITY NOTE: The credentials field is omitted from the response for security reasons. Requires READ_RERANKER_OWN permission for rerankers you own (or READ_RERANKER_ANY for admin users). This is a read-only operation with no side effects and is safe to retry.
131
+ * @param {String} id The unique identifier of the reranker to retrieve
132
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RerankerResponse} and HTTP response
133
+ */
134
+ }, {
135
+ key: "getRerankerWithHttpInfo",
136
+ value: function getRerankerWithHttpInfo(id) {
137
+ var postBody = null;
138
+ // verify the required parameter 'id' is set
139
+ if (id === undefined || id === null) {
140
+ throw new Error("Missing the required parameter 'id' when calling getReranker");
141
+ }
142
+ var pathParams = {
143
+ 'id': id
144
+ };
145
+ var queryParams = {};
146
+ var headerParams = {};
147
+ var formParams = {};
148
+ var authNames = [];
149
+ var contentTypes = [];
150
+ var accepts = ['application/json'];
151
+ var returnType = _RerankerResponse["default"];
152
+ return this.apiClient.callApi('/v1/rerankers/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
153
+ }
154
+
155
+ /**
156
+ * Get a reranker by ID
157
+ * Retrieves the details of a specific reranker configuration by its unique identifier. SECURITY NOTE: The credentials field is omitted from the response for security reasons. Requires READ_RERANKER_OWN permission for rerankers you own (or READ_RERANKER_ANY for admin users). This is a read-only operation with no side effects and is safe to retry.
158
+ * @param {String} id The unique identifier of the reranker to retrieve
159
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RerankerResponse}
160
+ */
161
+ }, {
162
+ key: "getReranker",
163
+ value: function getReranker(id) {
164
+ return this.getRerankerWithHttpInfo(id).then(function (response_and_data) {
165
+ return response_and_data.data;
166
+ });
167
+ }
168
+
169
+ /**
170
+ * List rerankers
171
+ * Retrieves a list of reranker configurations accessible to the caller, with optional filtering. IMPORTANT: Pagination is NOT supported - all matching results are returned. Results are ordered by created_at descending. SECURITY NOTE: credentials fields are omitted from all responses. PERMISSION-BASED FILTERING: With LIST_RERANKER_OWN permission, only your own rerankers are shown. With LIST_RERANKER_ANY permission, you can see all rerankers or filter by any owner_id. Specifying owner_id without LIST_RERANKER_ANY permission returns PERMISSION_DENIED.
172
+ * @param {Object} opts Optional parameters
173
+ * @param {String} [ownerId] Filter rerankers by owner ID. With LIST_RERANKER_ANY permission, omitting this shows all accessible rerankers; providing it filters by that owner. With LIST_RERANKER_OWN permission, only your own rerankers are shown regardless of this parameter (PERMISSION_DENIED if set to another user).
174
+ * @param {String} [providerType] Filter rerankers by provider type (e.g., OPENAI, TEI, VLLM, etc.)
175
+ * @param {String} [label] Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=search)
176
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListRerankersResponse} and HTTP response
177
+ */
178
+ }, {
179
+ key: "listRerankersWithHttpInfo",
180
+ value: function listRerankersWithHttpInfo(opts) {
181
+ opts = opts || {};
182
+ var postBody = null;
183
+ var pathParams = {};
184
+ var queryParams = {
185
+ 'owner_id': opts['ownerId'],
186
+ 'provider_type': opts['providerType'],
187
+ 'label.*': opts['label']
188
+ };
189
+ var headerParams = {};
190
+ var formParams = {};
191
+ var authNames = [];
192
+ var contentTypes = [];
193
+ var accepts = ['application/json'];
194
+ var returnType = _ListRerankersResponse["default"];
195
+ return this.apiClient.callApi('/v1/rerankers', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
196
+ }
197
+
198
+ /**
199
+ * List rerankers
200
+ * Retrieves a list of reranker configurations accessible to the caller, with optional filtering. IMPORTANT: Pagination is NOT supported - all matching results are returned. Results are ordered by created_at descending. SECURITY NOTE: credentials fields are omitted from all responses. PERMISSION-BASED FILTERING: With LIST_RERANKER_OWN permission, only your own rerankers are shown. With LIST_RERANKER_ANY permission, you can see all rerankers or filter by any owner_id. Specifying owner_id without LIST_RERANKER_ANY permission returns PERMISSION_DENIED.
201
+ * @param {Object} opts Optional parameters
202
+ * @param {String} opts.ownerId Filter rerankers by owner ID. With LIST_RERANKER_ANY permission, omitting this shows all accessible rerankers; providing it filters by that owner. With LIST_RERANKER_OWN permission, only your own rerankers are shown regardless of this parameter (PERMISSION_DENIED if set to another user).
203
+ * @param {String} opts.providerType Filter rerankers by provider type (e.g., OPENAI, TEI, VLLM, etc.)
204
+ * @param {String} opts.label Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=search)
205
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListRerankersResponse}
206
+ */
207
+ }, {
208
+ key: "listRerankers",
209
+ value: function listRerankers(opts) {
210
+ return this.listRerankersWithHttpInfo(opts).then(function (response_and_data) {
211
+ return response_and_data.data;
212
+ });
213
+ }
214
+
215
+ /**
216
+ * Update a reranker
217
+ * Updates an existing reranker configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMMUTABLE FIELDS: provider_type and owner_id cannot be changed after creation. SUPPORTED_MODALITIES UPDATE: If the array contains ≥1 elements, it replaces the stored set; if empty or omitted, no change occurs. Returns ALREADY_EXISTS if update would create duplicate with same {endpoint_url, api_path, model_identifier}. Requires UPDATE_RERANKER_OWN permission for rerankers you own (or UPDATE_RERANKER_ANY for admin users). This operation is idempotent.
218
+ * @param {String} id The unique identifier of the reranker to update
219
+ * @param {module:model/UpdateRerankerRequest} updateRerankerRequest Updated reranker configuration details
220
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RerankerResponse} and HTTP response
221
+ */
222
+ }, {
223
+ key: "updateRerankerWithHttpInfo",
224
+ value: function updateRerankerWithHttpInfo(id, updateRerankerRequest) {
225
+ var postBody = updateRerankerRequest;
226
+ // verify the required parameter 'id' is set
227
+ if (id === undefined || id === null) {
228
+ throw new Error("Missing the required parameter 'id' when calling updateReranker");
229
+ }
230
+ // verify the required parameter 'updateRerankerRequest' is set
231
+ if (updateRerankerRequest === undefined || updateRerankerRequest === null) {
232
+ throw new Error("Missing the required parameter 'updateRerankerRequest' when calling updateReranker");
233
+ }
234
+ var pathParams = {
235
+ 'id': id
236
+ };
237
+ var queryParams = {};
238
+ var headerParams = {};
239
+ var formParams = {};
240
+ var authNames = [];
241
+ var contentTypes = ['application/json'];
242
+ var accepts = ['application/json'];
243
+ var returnType = _RerankerResponse["default"];
244
+ return this.apiClient.callApi('/v1/rerankers/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
245
+ }
246
+
247
+ /**
248
+ * Update a reranker
249
+ * Updates an existing reranker configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMMUTABLE FIELDS: provider_type and owner_id cannot be changed after creation. SUPPORTED_MODALITIES UPDATE: If the array contains ≥1 elements, it replaces the stored set; if empty or omitted, no change occurs. Returns ALREADY_EXISTS if update would create duplicate with same {endpoint_url, api_path, model_identifier}. Requires UPDATE_RERANKER_OWN permission for rerankers you own (or UPDATE_RERANKER_ANY for admin users). This operation is idempotent.
250
+ * @param {String} id The unique identifier of the reranker to update
251
+ * @param {module:model/UpdateRerankerRequest} updateRerankerRequest Updated reranker configuration details
252
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RerankerResponse}
253
+ */
254
+ }, {
255
+ key: "updateReranker",
256
+ value: function updateReranker(id, updateRerankerRequest) {
257
+ return this.updateRerankerWithHttpInfo(id, updateRerankerRequest).then(function (response_and_data) {
258
+ return response_and_data.data;
259
+ });
260
+ }
261
+ }]);
262
+ }();
@@ -16,11 +16,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
16
16
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
18
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
- * GoodMem API
20
- * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
19
+ *
20
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
21
21
  *
22
- * The version of the OpenAPI document: v1
23
- * Contact: support@goodmem.io
22
+ * The version of the OpenAPI document:
23
+ *
24
24
  *
25
25
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
26
  * https://openapi-generator.tech
@@ -30,7 +30,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
30
30
  /**
31
31
  * Spaces service.
32
32
  * @module api/SpacesApi
33
- * @version v1
33
+ * @version 1.0.0
34
34
  */
35
35
  var SpacesApi = exports["default"] = /*#__PURE__*/function () {
36
36
  /**
@@ -45,24 +45,15 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
45
45
  this.apiClient = apiClient || _ApiClient["default"].instance;
46
46
  }
47
47
 
48
- /**
49
- * Callback function to receive the result of the createSpace operation.
50
- * @callback module:api/SpacesApi~createSpaceCallback
51
- * @param {String} error Error message, if any.
52
- * @param {module:model/Space} data The data returned by the service call.
53
- * @param {String} response The complete HTTP response.
54
- */
55
-
56
48
  /**
57
49
  * Create a new Space
58
- * Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories.
50
+ * Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories. OWNER DEFAULTS: Owner defaults to authenticated user unless owner_id is provided (requires CREATE_SPACE_ANY if differs). EMBEDDER DEFAULTS: If no embedders are specified, a system-default embedder is attached. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another space exists with identical {owner_id, name} (case-sensitive). Requires CREATE_SPACE_OWN permission (or CREATE_SPACE_ANY for admin users). This operation is NOT idempotent.
59
51
  * @param {module:model/SpaceCreationRequest} spaceCreationRequest Space configuration details
60
- * @param {module:api/SpacesApi~createSpaceCallback} callback The callback function, accepting three arguments: error, data, response
61
- * data is of type: {@link module:model/Space}
52
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Space} and HTTP response
62
53
  */
63
54
  return _createClass(SpacesApi, [{
64
- key: "createSpace",
65
- value: function createSpace(spaceCreationRequest, callback) {
55
+ key: "createSpaceWithHttpInfo",
56
+ value: function createSpaceWithHttpInfo(spaceCreationRequest) {
66
57
  var postBody = spaceCreationRequest;
67
58
  // verify the required parameter 'spaceCreationRequest' is set
68
59
  if (spaceCreationRequest === undefined || spaceCreationRequest === null) {
@@ -76,26 +67,32 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
76
67
  var contentTypes = ['application/json'];
77
68
  var accepts = ['application/json'];
78
69
  var returnType = _Space["default"];
79
- return this.apiClient.callApi('/v1/spaces', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
70
+ return this.apiClient.callApi('/v1/spaces', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
80
71
  }
81
72
 
82
73
  /**
83
- * Callback function to receive the result of the deleteSpace operation.
84
- * @callback module:api/SpacesApi~deleteSpaceCallback
85
- * @param {String} error Error message, if any.
86
- * @param data This operation does not return a value.
87
- * @param {String} response The complete HTTP response.
74
+ * Create a new Space
75
+ * Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories. OWNER DEFAULTS: Owner defaults to authenticated user unless owner_id is provided (requires CREATE_SPACE_ANY if differs). EMBEDDER DEFAULTS: If no embedders are specified, a system-default embedder is attached. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another space exists with identical {owner_id, name} (case-sensitive). Requires CREATE_SPACE_OWN permission (or CREATE_SPACE_ANY for admin users). This operation is NOT idempotent.
76
+ * @param {module:model/SpaceCreationRequest} spaceCreationRequest Space configuration details
77
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Space}
88
78
  */
79
+ }, {
80
+ key: "createSpace",
81
+ value: function createSpace(spaceCreationRequest) {
82
+ return this.createSpaceWithHttpInfo(spaceCreationRequest).then(function (response_and_data) {
83
+ return response_and_data.data;
84
+ });
85
+ }
89
86
 
90
87
  /**
91
88
  * Delete a space
92
- * Deletes a space and all memories contained within it. This operation cannot be undone.
89
+ * Permanently deletes a space and all associated content. This operation cannot be undone. CASCADE DELETION: Removes the space record and cascades deletion to associated memories, chunks, and embedder associations. Requires DELETE_SPACE_OWN permission for spaces you own (or DELETE_SPACE_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
93
90
  * @param {String} id The unique identifier of the space to delete
94
- * @param {module:api/SpacesApi~deleteSpaceCallback} callback The callback function, accepting three arguments: error, data, response
91
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
95
92
  */
96
93
  }, {
97
- key: "deleteSpace",
98
- value: function deleteSpace(id, callback) {
94
+ key: "deleteSpaceWithHttpInfo",
95
+ value: function deleteSpaceWithHttpInfo(id) {
99
96
  var postBody = null;
100
97
  // verify the required parameter 'id' is set
101
98
  if (id === undefined || id === null) {
@@ -111,27 +108,32 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
111
108
  var contentTypes = [];
112
109
  var accepts = [];
113
110
  var returnType = null;
114
- return this.apiClient.callApi('/v1/spaces/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
111
+ return this.apiClient.callApi('/v1/spaces/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
115
112
  }
116
113
 
117
114
  /**
118
- * Callback function to receive the result of the getSpace operation.
119
- * @callback module:api/SpacesApi~getSpaceCallback
120
- * @param {String} error Error message, if any.
121
- * @param {module:model/Space} data The data returned by the service call.
122
- * @param {String} response The complete HTTP response.
115
+ * Delete a space
116
+ * Permanently deletes a space and all associated content. This operation cannot be undone. CASCADE DELETION: Removes the space record and cascades deletion to associated memories, chunks, and embedder associations. Requires DELETE_SPACE_OWN permission for spaces you own (or DELETE_SPACE_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
117
+ * @param {String} id The unique identifier of the space to delete
118
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
123
119
  */
120
+ }, {
121
+ key: "deleteSpace",
122
+ value: function deleteSpace(id) {
123
+ return this.deleteSpaceWithHttpInfo(id).then(function (response_and_data) {
124
+ return response_and_data.data;
125
+ });
126
+ }
124
127
 
125
128
  /**
126
129
  * Get a space by ID
127
- * Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata.
130
+ * Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata. PUBLIC SPACE ACCESS: When public_read=true, any authenticated user can retrieve the space metadata, bypassing ownership checks. Otherwise, requires ownership or DISPLAY_SPACE_ANY permission. Requires DISPLAY_SPACE_OWN permission for owned spaces (or DISPLAY_SPACE_ANY for admin users to view any space). This is a read-only operation safe to retry.
128
131
  * @param {String} id The unique identifier of the space to retrieve
129
- * @param {module:api/SpacesApi~getSpaceCallback} callback The callback function, accepting three arguments: error, data, response
130
- * data is of type: {@link module:model/Space}
132
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Space} and HTTP response
131
133
  */
132
134
  }, {
133
- key: "getSpace",
134
- value: function getSpace(id, callback) {
135
+ key: "getSpaceWithHttpInfo",
136
+ value: function getSpaceWithHttpInfo(id) {
135
137
  var postBody = null;
136
138
  // verify the required parameter 'id' is set
137
139
  if (id === undefined || id === null) {
@@ -147,34 +149,39 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
147
149
  var contentTypes = [];
148
150
  var accepts = ['application/json'];
149
151
  var returnType = _Space["default"];
150
- return this.apiClient.callApi('/v1/spaces/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
152
+ return this.apiClient.callApi('/v1/spaces/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
151
153
  }
152
154
 
153
155
  /**
154
- * Callback function to receive the result of the listSpaces operation.
155
- * @callback module:api/SpacesApi~listSpacesCallback
156
- * @param {String} error Error message, if any.
157
- * @param {module:model/ListSpacesResponse} data The data returned by the service call.
158
- * @param {String} response The complete HTTP response.
156
+ * Get a space by ID
157
+ * Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata. PUBLIC SPACE ACCESS: When public_read=true, any authenticated user can retrieve the space metadata, bypassing ownership checks. Otherwise, requires ownership or DISPLAY_SPACE_ANY permission. Requires DISPLAY_SPACE_OWN permission for owned spaces (or DISPLAY_SPACE_ANY for admin users to view any space). This is a read-only operation safe to retry.
158
+ * @param {String} id The unique identifier of the space to retrieve
159
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Space}
159
160
  */
161
+ }, {
162
+ key: "getSpace",
163
+ value: function getSpace(id) {
164
+ return this.getSpaceWithHttpInfo(id).then(function (response_and_data) {
165
+ return response_and_data.data;
166
+ });
167
+ }
160
168
 
161
169
  /**
162
170
  * List spaces
163
- * Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response.
171
+ * Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response. PERMISSION-BASED FILTERING: With LIST_SPACE_ANY and owner_id omitted, returns all visible spaces; otherwise returns caller-owned spaces only. DEFAULT SORT: Results ordered by created_at DESCENDING unless specified otherwise. MAX_RESULTS CLAMPING: max_results defaults to 50 and is clamped to [1, 1000] range. Requires LIST_SPACE_OWN or LIST_SPACE_ANY permission.
164
172
  * @param {Object} opts Optional parameters
165
- * @param {String} [ownerId] Filter spaces by owner ID. If not provided, shows spaces based on permissions.
173
+ * @param {String} [ownerId] Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED.
166
174
  * @param {String} [nameFilter] Filter spaces by name using glob pattern matching
167
- * @param {Number} [maxResults] Maximum number of results to return in a single page
175
+ * @param {Number} [maxResults] Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
168
176
  * @param {String} [nextToken] Pagination token for retrieving the next set of results
169
- * @param {String} [sortBy] Field to sort by. Supported values: \"created_time\", \"name\", \"updated_time\"
170
- * @param {String} [sortOrder] Sort order (ASCENDING or DESCENDING)
177
+ * @param {String} [sortBy] Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT.
178
+ * @param {String} [sortOrder] Sort order (ASCENDING or DESCENDING, default: DESCENDING)
171
179
  * @param {String} [label] Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)
172
- * @param {module:api/SpacesApi~listSpacesCallback} callback The callback function, accepting three arguments: error, data, response
173
- * data is of type: {@link module:model/ListSpacesResponse}
180
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSpacesResponse} and HTTP response
174
181
  */
175
182
  }, {
176
- key: "listSpaces",
177
- value: function listSpaces(opts, callback) {
183
+ key: "listSpacesWithHttpInfo",
184
+ value: function listSpacesWithHttpInfo(opts) {
178
185
  opts = opts || {};
179
186
  var postBody = null;
180
187
  var pathParams = {};
@@ -193,28 +200,40 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
193
200
  var contentTypes = [];
194
201
  var accepts = ['application/json'];
195
202
  var returnType = _ListSpacesResponse["default"];
196
- return this.apiClient.callApi('/v1/spaces', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
203
+ return this.apiClient.callApi('/v1/spaces', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
197
204
  }
198
205
 
199
206
  /**
200
- * Callback function to receive the result of the updateSpace operation.
201
- * @callback module:api/SpacesApi~updateSpaceCallback
202
- * @param {String} error Error message, if any.
203
- * @param {module:model/Space} data The data returned by the service call.
204
- * @param {String} response The complete HTTP response.
207
+ * List spaces
208
+ * Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response. PERMISSION-BASED FILTERING: With LIST_SPACE_ANY and owner_id omitted, returns all visible spaces; otherwise returns caller-owned spaces only. DEFAULT SORT: Results ordered by created_at DESCENDING unless specified otherwise. MAX_RESULTS CLAMPING: max_results defaults to 50 and is clamped to [1, 1000] range. Requires LIST_SPACE_OWN or LIST_SPACE_ANY permission.
209
+ * @param {Object} opts Optional parameters
210
+ * @param {String} opts.ownerId Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED.
211
+ * @param {String} opts.nameFilter Filter spaces by name using glob pattern matching
212
+ * @param {Number} opts.maxResults Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
213
+ * @param {String} opts.nextToken Pagination token for retrieving the next set of results
214
+ * @param {String} opts.sortBy Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT.
215
+ * @param {String} opts.sortOrder Sort order (ASCENDING or DESCENDING, default: DESCENDING)
216
+ * @param {String} opts.label Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)
217
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSpacesResponse}
205
218
  */
219
+ }, {
220
+ key: "listSpaces",
221
+ value: function listSpaces(opts) {
222
+ return this.listSpacesWithHttpInfo(opts).then(function (response_and_data) {
223
+ return response_and_data.data;
224
+ });
225
+ }
206
226
 
207
227
  /**
208
228
  * Update a space
209
- * Updates an existing space with new values for the specified fields. Fields not included in the request remain unchanged.
229
+ * Updates an existing space with new values for the specified fields. Only name, publicRead, and labels can be updated. Fields not included in the request remain unchanged. IMMUTABLE FIELDS: space_embedders, default_chunking_config, and owner_id cannot be modified after creation. NAME UNIQUENESS: Name must be unique per owner - returns ALREADY_EXISTS if name conflicts with existing space. Requires UPDATE_SPACE_OWN permission for spaces you own (or UPDATE_SPACE_ANY for admin users). This operation is idempotent.
210
230
  * @param {String} id The unique identifier of the space to update
211
231
  * @param {module:model/UpdateSpaceRequest} updateSpaceRequest Space update details
212
- * @param {module:api/SpacesApi~updateSpaceCallback} callback The callback function, accepting three arguments: error, data, response
213
- * data is of type: {@link module:model/Space}
232
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Space} and HTTP response
214
233
  */
215
234
  }, {
216
- key: "updateSpace",
217
- value: function updateSpace(id, updateSpaceRequest, callback) {
235
+ key: "updateSpaceWithHttpInfo",
236
+ value: function updateSpaceWithHttpInfo(id, updateSpaceRequest) {
218
237
  var postBody = updateSpaceRequest;
219
238
  // verify the required parameter 'id' is set
220
239
  if (id === undefined || id === null) {
@@ -234,7 +253,22 @@ var SpacesApi = exports["default"] = /*#__PURE__*/function () {
234
253
  var contentTypes = ['application/json'];
235
254
  var accepts = ['application/json'];
236
255
  var returnType = _Space["default"];
237
- return this.apiClient.callApi('/v1/spaces/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
256
+ return this.apiClient.callApi('/v1/spaces/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
257
+ }
258
+
259
+ /**
260
+ * Update a space
261
+ * Updates an existing space with new values for the specified fields. Only name, publicRead, and labels can be updated. Fields not included in the request remain unchanged. IMMUTABLE FIELDS: space_embedders, default_chunking_config, and owner_id cannot be modified after creation. NAME UNIQUENESS: Name must be unique per owner - returns ALREADY_EXISTS if name conflicts with existing space. Requires UPDATE_SPACE_OWN permission for spaces you own (or UPDATE_SPACE_ANY for admin users). This operation is idempotent.
262
+ * @param {String} id The unique identifier of the space to update
263
+ * @param {module:model/UpdateSpaceRequest} updateSpaceRequest Space update details
264
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Space}
265
+ */
266
+ }, {
267
+ key: "updateSpace",
268
+ value: function updateSpace(id, updateSpaceRequest) {
269
+ return this.updateSpaceWithHttpInfo(id, updateSpaceRequest).then(function (response_and_data) {
270
+ return response_and_data.data;
271
+ });
238
272
  }
239
273
  }]);
240
274
  }();
@@ -13,11 +13,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
13
13
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16
- * GoodMem API
17
- * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
16
+ *
17
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
18
18
  *
19
- * The version of the OpenAPI document: v1
20
- * Contact: support@goodmem.io
19
+ * The version of the OpenAPI document:
20
+ *
21
21
  *
22
22
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
23
  * https://openapi-generator.tech
@@ -27,7 +27,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
27
27
  /**
28
28
  * System service.
29
29
  * @module api/SystemApi
30
- * @version v1
30
+ * @version 1.0.0
31
31
  */
32
32
  var SystemApi = exports["default"] = /*#__PURE__*/function () {
33
33
  /**
@@ -42,25 +42,16 @@ var SystemApi = exports["default"] = /*#__PURE__*/function () {
42
42
  this.apiClient = apiClient || _ApiClient["default"].instance;
43
43
  }
44
44
 
45
- /**
46
- * Callback function to receive the result of the initializeSystem operation.
47
- * @callback module:api/SystemApi~initializeSystemCallback
48
- * @param {String} error Error message, if any.
49
- * @param {module:model/SystemInitResponse} data The data returned by the service call.
50
- * @param {String} response The complete HTTP response.
51
- */
52
-
53
45
  /**
54
46
  * Initialize the system
55
47
  * Initializes the system by creating a root user and API key. This endpoint should only be called once during first-time setup. If the system is already initialized, the endpoint will return a success response without creating new credentials.
56
48
  * @param {Object} opts Optional parameters
57
49
  * @param {Object.<String, Object>} [body] Empty request body - no parameters required
58
- * @param {module:api/SystemApi~initializeSystemCallback} callback The callback function, accepting three arguments: error, data, response
59
- * data is of type: {@link module:model/SystemInitResponse}
50
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SystemInitResponse} and HTTP response
60
51
  */
61
52
  return _createClass(SystemApi, [{
62
- key: "initializeSystem",
63
- value: function initializeSystem(opts, callback) {
53
+ key: "initializeSystemWithHttpInfo",
54
+ value: function initializeSystemWithHttpInfo(opts) {
64
55
  opts = opts || {};
65
56
  var postBody = opts['body'];
66
57
  var pathParams = {};
@@ -71,7 +62,22 @@ var SystemApi = exports["default"] = /*#__PURE__*/function () {
71
62
  var contentTypes = ['application/json'];
72
63
  var accepts = ['application/json'];
73
64
  var returnType = _SystemInitResponse["default"];
74
- return this.apiClient.callApi('/v1/system/init', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
65
+ return this.apiClient.callApi('/v1/system/init', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
66
+ }
67
+
68
+ /**
69
+ * Initialize the system
70
+ * Initializes the system by creating a root user and API key. This endpoint should only be called once during first-time setup. If the system is already initialized, the endpoint will return a success response without creating new credentials.
71
+ * @param {Object} opts Optional parameters
72
+ * @param {Object.<String, Object>} opts.body Empty request body - no parameters required
73
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SystemInitResponse}
74
+ */
75
+ }, {
76
+ key: "initializeSystem",
77
+ value: function initializeSystem(opts) {
78
+ return this.initializeSystemWithHttpInfo(opts).then(function (response_and_data) {
79
+ return response_and_data.data;
80
+ });
75
81
  }
76
82
  }]);
77
83
  }();