@credal/sdk 0.1.1 → 0.1.3

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 (54) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/copilots/client/Client.js +36 -27
  3. package/dist/cjs/api/resources/documentCatalog/client/Client.js +12 -9
  4. package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +1 -1
  5. package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatch.d.ts +1 -1
  6. package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +13 -0
  7. package/dist/cjs/api/resources/documentCollections/client/Client.js +84 -18
  8. package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.ts +13 -0
  9. package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.js +5 -0
  10. package/dist/cjs/api/resources/documentCollections/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.ts +7 -0
  12. package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.js +5 -0
  13. package/dist/cjs/api/resources/documentCollections/types/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/documentCollections/types/index.js +1 -0
  15. package/dist/cjs/api/resources/permissionsService/client/Client.js +12 -9
  16. package/dist/cjs/api/resources/search/client/Client.js +4 -3
  17. package/dist/cjs/api/resources/users/client/Client.js +4 -3
  18. package/dist/cjs/api/resources/users/types/UserMetadataPatch.d.ts +1 -1
  19. package/dist/cjs/core/auth/AuthProvider.d.ts +4 -0
  20. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  21. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  22. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  23. package/dist/cjs/core/auth/index.d.ts +2 -0
  24. package/dist/cjs/core/fetcher/index.d.ts +1 -1
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/Client.mjs +2 -2
  28. package/dist/esm/api/resources/copilots/client/Client.mjs +36 -27
  29. package/dist/esm/api/resources/documentCatalog/client/Client.mjs +12 -9
  30. package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +1 -1
  31. package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatch.d.mts +1 -1
  32. package/dist/esm/api/resources/documentCollections/client/Client.d.mts +13 -0
  33. package/dist/esm/api/resources/documentCollections/client/Client.mjs +84 -18
  34. package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.mts +13 -0
  35. package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.mjs +4 -0
  36. package/dist/esm/api/resources/documentCollections/client/requests/index.d.mts +1 -0
  37. package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.mts +7 -0
  38. package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.mjs +4 -0
  39. package/dist/esm/api/resources/documentCollections/types/index.d.mts +1 -0
  40. package/dist/esm/api/resources/documentCollections/types/index.mjs +1 -0
  41. package/dist/esm/api/resources/permissionsService/client/Client.mjs +12 -9
  42. package/dist/esm/api/resources/search/client/Client.mjs +4 -3
  43. package/dist/esm/api/resources/users/client/Client.mjs +4 -3
  44. package/dist/esm/api/resources/users/types/UserMetadataPatch.d.mts +1 -1
  45. package/dist/esm/core/auth/AuthProvider.d.mts +4 -0
  46. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  47. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  48. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  49. package/dist/esm/core/auth/index.d.mts +2 -0
  50. package/dist/esm/core/fetcher/index.d.mts +1 -1
  51. package/dist/esm/version.d.mts +1 -1
  52. package/dist/esm/version.mjs +1 -1
  53. package/package.json +1 -1
  54. package/reference.md +65 -0
@@ -45,10 +45,11 @@ export class Users {
45
45
  __metadata(request, requestOptions) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
47
  var _a, _b, _c, _d;
48
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
49
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/users/metadata"),
48
+ var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
49
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
50
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/users/metadata"),
50
51
  method: "PATCH",
51
- headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
52
+ headers: _headers,
52
53
  contentType: "application/json",
53
54
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
54
55
  requestType: "json",
@@ -4,5 +4,5 @@
4
4
  export interface UserMetadataPatch {
5
5
  userEmail: string;
6
6
  /** Key-value object of metadata for user. Keys will be merged with any existing values but can also be set to `null` to effectively remove */
7
- metadata?: unknown;
7
+ metadata: Record<string, unknown>;
8
8
  }
@@ -0,0 +1,4 @@
1
+ import { AuthRequest } from "./AuthRequest.mjs";
2
+ export interface AuthProvider {
3
+ getAuthRequest(): Promise<AuthRequest>;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Request parameters for authentication requests.
3
+ */
4
+ export interface AuthRequest {
5
+ /**
6
+ * The headers to be included in the request.
7
+ */
8
+ headers: Record<string, string>;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,4 @@
1
1
  export { BasicAuth } from "./BasicAuth.mjs";
2
2
  export { BearerToken } from "./BearerToken.mjs";
3
+ export { type AuthRequest } from "./AuthRequest.mjs";
4
+ export { AuthProvider } from "./AuthProvider.mjs";
@@ -6,4 +6,4 @@ export { Supplier } from "./Supplier.mjs";
6
6
  export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
7
7
  export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
8
8
  export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
9
- export { BinaryResponse } from "./BinaryResponse.mjs";
9
+ export type { BinaryResponse } from "./BinaryResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.1";
1
+ export declare const SDK_VERSION = "0.1.3";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.1";
1
+ export const SDK_VERSION = "0.1.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "repository": "github:credal-ai/credal-typescript-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -962,6 +962,71 @@ await client.documentCollections.removeDocumentsFromCollection({
962
962
  </dl>
963
963
  </details>
964
964
 
965
+ <details><summary><code>client.documentCollections.<a href="/src/api/resources/documentCollections/client/Client.ts">listDocumentsInCollection</a>({ ...params }) -> Credal.ListDocumentsInCollectionResponse</code></summary>
966
+ <dl>
967
+ <dd>
968
+
969
+ #### 📝 Description
970
+
971
+ <dl>
972
+ <dd>
973
+
974
+ <dl>
975
+ <dd>
976
+
977
+ List documents in a collection
978
+
979
+ </dd>
980
+ </dl>
981
+ </dd>
982
+ </dl>
983
+
984
+ #### 🔌 Usage
985
+
986
+ <dl>
987
+ <dd>
988
+
989
+ <dl>
990
+ <dd>
991
+
992
+ ```typescript
993
+ await client.documentCollections.listDocumentsInCollection({
994
+ collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
995
+ });
996
+ ```
997
+
998
+ </dd>
999
+ </dl>
1000
+ </dd>
1001
+ </dl>
1002
+
1003
+ #### ⚙️ Parameters
1004
+
1005
+ <dl>
1006
+ <dd>
1007
+
1008
+ <dl>
1009
+ <dd>
1010
+
1011
+ **request:** `Credal.ListDocumentsInCollectionRequest`
1012
+
1013
+ </dd>
1014
+ </dl>
1015
+
1016
+ <dl>
1017
+ <dd>
1018
+
1019
+ **requestOptions:** `DocumentCollections.RequestOptions`
1020
+
1021
+ </dd>
1022
+ </dl>
1023
+ </dd>
1024
+ </dl>
1025
+
1026
+ </dd>
1027
+ </dl>
1028
+ </details>
1029
+
965
1030
  <details><summary><code>client.documentCollections.<a href="/src/api/resources/documentCollections/client/Client.ts">createCollection</a>({ ...params }) -> Credal.CreateCollectionResponse</code></summary>
966
1031
  <dl>
967
1032
  <dd>