@formbricks/hub 0.3.0 → 0.4.1
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/CHANGELOG.md +64 -0
- package/client.d.mts +15 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -3
- package/client.d.ts.map +1 -1
- package/client.js +28 -18
- package/client.js.map +1 -1
- package/client.mjs +28 -18
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/feedback-records/feedback-records.d.mts +473 -0
- package/resources/feedback-records/feedback-records.d.mts.map +1 -0
- package/resources/feedback-records/feedback-records.d.ts +473 -0
- package/resources/feedback-records/feedback-records.d.ts.map +1 -0
- package/resources/feedback-records/feedback-records.js +139 -0
- package/resources/feedback-records/feedback-records.js.map +1 -0
- package/resources/feedback-records/feedback-records.mjs +134 -0
- package/resources/feedback-records/feedback-records.mjs.map +1 -0
- package/resources/feedback-records/index.d.mts +3 -0
- package/resources/feedback-records/index.d.mts.map +1 -0
- package/resources/feedback-records/index.d.ts +3 -0
- package/resources/feedback-records/index.d.ts.map +1 -0
- package/resources/feedback-records/index.js +9 -0
- package/resources/feedback-records/index.js.map +1 -0
- package/resources/feedback-records/index.mjs +4 -0
- package/resources/feedback-records/index.mjs.map +1 -0
- package/resources/feedback-records/search.d.mts +98 -0
- package/resources/feedback-records/search.d.mts.map +1 -0
- package/resources/feedback-records/search.d.ts +98 -0
- package/resources/feedback-records/search.d.ts.map +1 -0
- package/resources/feedback-records/search.js +38 -0
- package/resources/feedback-records/search.js.map +1 -0
- package/resources/feedback-records/search.mjs +34 -0
- package/resources/feedback-records/search.mjs.map +1 -0
- package/resources/feedback-records.d.mts +1 -369
- package/resources/feedback-records.d.mts.map +1 -1
- package/resources/feedback-records.d.ts +1 -369
- package/resources/feedback-records.d.ts.map +1 -1
- package/resources/feedback-records.js +2 -102
- package/resources/feedback-records.js.map +1 -1
- package/resources/feedback-records.mjs +1 -100
- package/resources/feedback-records.mjs.map +1 -1
- package/resources/health.d.mts +3 -0
- package/resources/health.d.mts.map +1 -1
- package/resources/health.d.ts +3 -0
- package/resources/health.d.ts.map +1 -1
- package/resources/health.js +3 -0
- package/resources/health.js.map +1 -1
- package/resources/health.mjs +3 -0
- package/resources/health.mjs.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/webhooks.d.mts +338 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +338 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +91 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +87 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +56 -23
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/feedback-records/feedback-records.ts +601 -0
- package/src/resources/feedback-records/index.ts +19 -0
- package/src/resources/feedback-records/search.ts +126 -0
- package/src/resources/feedback-records.ts +1 -469
- package/src/resources/health.ts +3 -0
- package/src/resources/index.ts +13 -1
- package/src/resources/webhooks.ts +469 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as SearchAPI from "./search.mjs";
|
|
4
|
+
import { Search } from "./search.mjs";
|
|
5
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
6
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Feedback record CRUD and search
|
|
9
|
+
*/
|
|
10
|
+
export class FeedbackRecords extends APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.search = new SearchAPI.Search(this._client);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new feedback record data point
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const feedbackRecordData =
|
|
21
|
+
* await client.feedbackRecords.create({
|
|
22
|
+
* field_id: 'q1',
|
|
23
|
+
* field_type: 'rating',
|
|
24
|
+
* source_type: 'survey',
|
|
25
|
+
* submission_id: '550e8400-e29b-41d4-a716-446655440000',
|
|
26
|
+
* tenant_id: 'org-123',
|
|
27
|
+
* field_label: 'How satisfied are you?',
|
|
28
|
+
* language: 'en',
|
|
29
|
+
* source_id: 'survey-123',
|
|
30
|
+
* source_name: 'Q1 NPS Survey',
|
|
31
|
+
* user_identifier: 'user-abc-123',
|
|
32
|
+
* value_number: 9,
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
create(body, options) {
|
|
37
|
+
return this._client.post('/v1/feedback-records', { body, ...options });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a single feedback record data point by its UUID
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const feedbackRecordData =
|
|
45
|
+
* await client.feedbackRecords.retrieve(
|
|
46
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
retrieve(id, options) {
|
|
51
|
+
return this._client.get(path `/v1/feedback-records/${id}`, options);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Updates specific fields of a feedback record data point
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const feedbackRecordData =
|
|
59
|
+
* await client.feedbackRecords.update(
|
|
60
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
61
|
+
* { value_text: 'Updated feedback text' },
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
update(id, body, options) {
|
|
66
|
+
return this._client.patch(path `/v1/feedback-records/${id}`, { body, ...options });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Lists feedback records with optional filters and pagination
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const feedbackRecords = await client.feedbackRecords.list({
|
|
74
|
+
* tenant_id: 'org-123',
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
list(query, options) {
|
|
79
|
+
return this._client.get('/v1/feedback-records', { query, ...options });
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Permanently deletes a feedback record data point
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* await client.feedbackRecords.delete(
|
|
87
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
delete(id, options) {
|
|
92
|
+
return this._client.delete(path `/v1/feedback-records/${id}`, {
|
|
93
|
+
...options,
|
|
94
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Permanently deletes all feedback record data points matching the specified
|
|
99
|
+
* user_identifier. This endpoint supports GDPR Article 17 (Right to Erasure)
|
|
100
|
+
* requests.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const response = await client.feedbackRecords.bulkDelete({
|
|
105
|
+
* user_identifier: 'user-abc-123',
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
bulkDelete(params, options) {
|
|
110
|
+
const { user_identifier, tenant_id } = params;
|
|
111
|
+
return this._client.delete('/v1/feedback-records', { query: { user_identifier, tenant_id }, ...options });
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Returns feedback record IDs and similarity scores for records similar to the
|
|
115
|
+
* given one (by embedding). **Only available when embeddings are configured**
|
|
116
|
+
* (EMBEDDING_PROVIDER and EMBEDDING_MODEL set). When embeddings are disabled, this
|
|
117
|
+
* endpoint returns 503 Service Unavailable. The source feedback record must belong
|
|
118
|
+
* to the given tenant_id (enforced).
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* const response =
|
|
123
|
+
* await client.feedbackRecords.retrieveSimilar(
|
|
124
|
+
* '018e1234-5678-9abc-def0-123456789abc',
|
|
125
|
+
* { tenant_id: 'org-123' },
|
|
126
|
+
* );
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
retrieveSimilar(id, query, options) {
|
|
130
|
+
return this._client.get(path `/v1/feedback-records/${id}/similar`, { query, ...options });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
FeedbackRecords.Search = Search;
|
|
134
|
+
//# sourceMappingURL=feedback-records.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-records.mjs","sourceRoot":"","sources":["../../src/resources/feedback-records/feedback-records.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,MAAM,EAA0E;OAElF,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAAhD;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAwIhE,CAAC;IAtIC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,IAAgC,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,EAAU,EACV,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,KAA+B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CACR,MAAsC,EACtC,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,eAAe,CACb,EAAU,EACV,KAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AA8aD,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FeedbackRecords, type FeedbackRecordData, type FeedbackRecordListResponse, type FeedbackRecordBulkDeleteResponse, type FeedbackRecordRetrieveSimilarResponse, type FeedbackRecordCreateParams, type FeedbackRecordUpdateParams, type FeedbackRecordListParams, type FeedbackRecordBulkDeleteParams, type FeedbackRecordRetrieveSimilarParams, } from "./feedback-records.mjs";
|
|
2
|
+
export { Search, type SearchPerformSemanticSearchResponse, type SearchPerformSemanticSearchParams, } from "./search.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/feedback-records/index.ts"],"names":[],"mappings":"OAEO,EACL,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,GACzC;OACM,EACL,MAAM,EACN,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FeedbackRecords, type FeedbackRecordData, type FeedbackRecordListResponse, type FeedbackRecordBulkDeleteResponse, type FeedbackRecordRetrieveSimilarResponse, type FeedbackRecordCreateParams, type FeedbackRecordUpdateParams, type FeedbackRecordListParams, type FeedbackRecordBulkDeleteParams, type FeedbackRecordRetrieveSimilarParams, } from "./feedback-records.js";
|
|
2
|
+
export { Search, type SearchPerformSemanticSearchResponse, type SearchPerformSemanticSearchParams, } from "./search.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/feedback-records/index.ts"],"names":[],"mappings":"OAEO,EACL,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAC1C,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,GACzC;OACM,EACL,MAAM,EACN,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Search = exports.FeedbackRecords = void 0;
|
|
5
|
+
var feedback_records_1 = require("./feedback-records.js");
|
|
6
|
+
Object.defineProperty(exports, "FeedbackRecords", { enumerable: true, get: function () { return feedback_records_1.FeedbackRecords; } });
|
|
7
|
+
var search_1 = require("./search.js");
|
|
8
|
+
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return search_1.Search; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/feedback-records/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0DAW4B;AAV1B,mHAAA,eAAe,OAAA;AAWjB,sCAIkB;AAHhB,gGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/feedback-records/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,eAAe,GAUhB;OACM,EACL,MAAM,GAGP"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Feedback record CRUD and search
|
|
6
|
+
*/
|
|
7
|
+
export declare class Search extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Embeds the search query and returns feedback record IDs with similarity scores
|
|
10
|
+
* (cosine, 0..1). **Only available when embeddings are configured**
|
|
11
|
+
* (EMBEDDING_PROVIDER and EMBEDDING_MODEL set). When embeddings are disabled, this
|
|
12
|
+
* endpoint returns 503 Service Unavailable. Request body must include query and
|
|
13
|
+
* tenant_id (required for tenant isolation).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response =
|
|
18
|
+
* await client.feedbackRecords.search.performSemanticSearch(
|
|
19
|
+
* {
|
|
20
|
+
* query: 'What do users think about login speed?',
|
|
21
|
+
* tenant_id: 'org-123',
|
|
22
|
+
* },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
performSemanticSearch(params: SearchPerformSemanticSearchParams, options?: RequestOptions): APIPromise<SearchPerformSemanticSearchResponse>;
|
|
27
|
+
}
|
|
28
|
+
export interface SearchPerformSemanticSearchResponse {
|
|
29
|
+
/**
|
|
30
|
+
* List of feedback record IDs with similarity scores (0 = unrelated, 1 =
|
|
31
|
+
* identical). Consistent with list endpoints.
|
|
32
|
+
*/
|
|
33
|
+
data: Array<SearchPerformSemanticSearchResponse.Data>;
|
|
34
|
+
/**
|
|
35
|
+
* Limit used in query (echoed for consistency with list endpoints)
|
|
36
|
+
*/
|
|
37
|
+
limit: number;
|
|
38
|
+
/**
|
|
39
|
+
* Opaque cursor for the next page (keyset paging). Present only when there may be
|
|
40
|
+
* more results (full page returned). Omit when no next page. Use this exact value
|
|
41
|
+
* as the cursor query param for the next page.
|
|
42
|
+
*/
|
|
43
|
+
next_cursor?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare namespace SearchPerformSemanticSearchResponse {
|
|
46
|
+
interface Data {
|
|
47
|
+
/**
|
|
48
|
+
* Feedback record UUID
|
|
49
|
+
*/
|
|
50
|
+
feedback_record_id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Label of the feedback field (included in embedding for context). May be empty if
|
|
53
|
+
* the source record had no label.
|
|
54
|
+
*/
|
|
55
|
+
field_label: string;
|
|
56
|
+
/**
|
|
57
|
+
* Similarity score (0..1)
|
|
58
|
+
*/
|
|
59
|
+
score: number;
|
|
60
|
+
/**
|
|
61
|
+
* value_text of the feedback record (the text that was embedded). May be empty if
|
|
62
|
+
* the source had no text; embeddings are only created for records with non-empty
|
|
63
|
+
* value_text, but the field can be cleared after embedding creation.
|
|
64
|
+
*/
|
|
65
|
+
value_text: string;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export interface SearchPerformSemanticSearchParams {
|
|
69
|
+
/**
|
|
70
|
+
* Body param: Search query text (embedded and compared via cosine similarity)
|
|
71
|
+
*/
|
|
72
|
+
query: string;
|
|
73
|
+
/**
|
|
74
|
+
* Body param: Tenant ID (required for isolation; must match feedback record
|
|
75
|
+
* tenant_id)
|
|
76
|
+
*/
|
|
77
|
+
tenant_id: string;
|
|
78
|
+
/**
|
|
79
|
+
* Query param: Omit for the first page. For the next page, use the exact value
|
|
80
|
+
* from the previous response's next_cursor. Opaque (base64-encoded); keyset
|
|
81
|
+
* pagination.
|
|
82
|
+
*/
|
|
83
|
+
cursor?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Query param: Number of results to return (default 10, max 100). Consistent with
|
|
86
|
+
* list endpoints.
|
|
87
|
+
*/
|
|
88
|
+
limit?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Query param: Minimum similarity score (0..1); only results with score >=
|
|
91
|
+
* min_score are returned. Default 0.7 to reduce noise.
|
|
92
|
+
*/
|
|
93
|
+
min_score?: number;
|
|
94
|
+
}
|
|
95
|
+
export declare namespace Search {
|
|
96
|
+
export { type SearchPerformSemanticSearchResponse as SearchPerformSemanticSearchResponse, type SearchPerformSemanticSearchParams as SearchPerformSemanticSearchParams, };
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=search.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.mts","sourceRoot":"","sources":["../../src/resources/feedback-records/search.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CACnB,MAAM,EAAE,iCAAiC,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAQnD;AAED,MAAM,WAAW,mCAAmC;IAClD;;;OAGG;IACH,IAAI,EAAE,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAEtD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,mCAAmC,CAAC;IACnD,UAAiB,IAAI;QACnB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;;;WAIG;QACH,UAAU,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Feedback record CRUD and search
|
|
6
|
+
*/
|
|
7
|
+
export declare class Search extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Embeds the search query and returns feedback record IDs with similarity scores
|
|
10
|
+
* (cosine, 0..1). **Only available when embeddings are configured**
|
|
11
|
+
* (EMBEDDING_PROVIDER and EMBEDDING_MODEL set). When embeddings are disabled, this
|
|
12
|
+
* endpoint returns 503 Service Unavailable. Request body must include query and
|
|
13
|
+
* tenant_id (required for tenant isolation).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response =
|
|
18
|
+
* await client.feedbackRecords.search.performSemanticSearch(
|
|
19
|
+
* {
|
|
20
|
+
* query: 'What do users think about login speed?',
|
|
21
|
+
* tenant_id: 'org-123',
|
|
22
|
+
* },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
performSemanticSearch(params: SearchPerformSemanticSearchParams, options?: RequestOptions): APIPromise<SearchPerformSemanticSearchResponse>;
|
|
27
|
+
}
|
|
28
|
+
export interface SearchPerformSemanticSearchResponse {
|
|
29
|
+
/**
|
|
30
|
+
* List of feedback record IDs with similarity scores (0 = unrelated, 1 =
|
|
31
|
+
* identical). Consistent with list endpoints.
|
|
32
|
+
*/
|
|
33
|
+
data: Array<SearchPerformSemanticSearchResponse.Data>;
|
|
34
|
+
/**
|
|
35
|
+
* Limit used in query (echoed for consistency with list endpoints)
|
|
36
|
+
*/
|
|
37
|
+
limit: number;
|
|
38
|
+
/**
|
|
39
|
+
* Opaque cursor for the next page (keyset paging). Present only when there may be
|
|
40
|
+
* more results (full page returned). Omit when no next page. Use this exact value
|
|
41
|
+
* as the cursor query param for the next page.
|
|
42
|
+
*/
|
|
43
|
+
next_cursor?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare namespace SearchPerformSemanticSearchResponse {
|
|
46
|
+
interface Data {
|
|
47
|
+
/**
|
|
48
|
+
* Feedback record UUID
|
|
49
|
+
*/
|
|
50
|
+
feedback_record_id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Label of the feedback field (included in embedding for context). May be empty if
|
|
53
|
+
* the source record had no label.
|
|
54
|
+
*/
|
|
55
|
+
field_label: string;
|
|
56
|
+
/**
|
|
57
|
+
* Similarity score (0..1)
|
|
58
|
+
*/
|
|
59
|
+
score: number;
|
|
60
|
+
/**
|
|
61
|
+
* value_text of the feedback record (the text that was embedded). May be empty if
|
|
62
|
+
* the source had no text; embeddings are only created for records with non-empty
|
|
63
|
+
* value_text, but the field can be cleared after embedding creation.
|
|
64
|
+
*/
|
|
65
|
+
value_text: string;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export interface SearchPerformSemanticSearchParams {
|
|
69
|
+
/**
|
|
70
|
+
* Body param: Search query text (embedded and compared via cosine similarity)
|
|
71
|
+
*/
|
|
72
|
+
query: string;
|
|
73
|
+
/**
|
|
74
|
+
* Body param: Tenant ID (required for isolation; must match feedback record
|
|
75
|
+
* tenant_id)
|
|
76
|
+
*/
|
|
77
|
+
tenant_id: string;
|
|
78
|
+
/**
|
|
79
|
+
* Query param: Omit for the first page. For the next page, use the exact value
|
|
80
|
+
* from the previous response's next_cursor. Opaque (base64-encoded); keyset
|
|
81
|
+
* pagination.
|
|
82
|
+
*/
|
|
83
|
+
cursor?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Query param: Number of results to return (default 10, max 100). Consistent with
|
|
86
|
+
* list endpoints.
|
|
87
|
+
*/
|
|
88
|
+
limit?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Query param: Minimum similarity score (0..1); only results with score >=
|
|
91
|
+
* min_score are returned. Default 0.7 to reduce noise.
|
|
92
|
+
*/
|
|
93
|
+
min_score?: number;
|
|
94
|
+
}
|
|
95
|
+
export declare namespace Search {
|
|
96
|
+
export { type SearchPerformSemanticSearchResponse as SearchPerformSemanticSearchResponse, type SearchPerformSemanticSearchParams as SearchPerformSemanticSearchParams, };
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/resources/feedback-records/search.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CACnB,MAAM,EAAE,iCAAiC,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAQnD;AAED,MAAM,WAAW,mCAAmC;IAClD;;;OAGG;IACH,IAAI,EAAE,KAAK,CAAC,mCAAmC,CAAC,IAAI,CAAC,CAAC;IAEtD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,mCAAmC,CAAC;IACnD,UAAiB,IAAI;QACnB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;;;WAIG;QACH,UAAU,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Search = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Feedback record CRUD and search
|
|
8
|
+
*/
|
|
9
|
+
class Search extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Embeds the search query and returns feedback record IDs with similarity scores
|
|
12
|
+
* (cosine, 0..1). **Only available when embeddings are configured**
|
|
13
|
+
* (EMBEDDING_PROVIDER and EMBEDDING_MODEL set). When embeddings are disabled, this
|
|
14
|
+
* endpoint returns 503 Service Unavailable. Request body must include query and
|
|
15
|
+
* tenant_id (required for tenant isolation).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const response =
|
|
20
|
+
* await client.feedbackRecords.search.performSemanticSearch(
|
|
21
|
+
* {
|
|
22
|
+
* query: 'What do users think about login speed?',
|
|
23
|
+
* tenant_id: 'org-123',
|
|
24
|
+
* },
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
performSemanticSearch(params, options) {
|
|
29
|
+
const { cursor, limit, min_score, ...body } = params;
|
|
30
|
+
return this._client.post('/v1/feedback-records/search/semantic', {
|
|
31
|
+
query: { cursor, limit, min_score },
|
|
32
|
+
body,
|
|
33
|
+
...options,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Search = Search;
|
|
38
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/resources/feedback-records/search.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD;;GAEG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CACnB,MAAyC,EACzC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE;YAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;YACnC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA9BD,wBA8BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Feedback record CRUD and search
|
|
5
|
+
*/
|
|
6
|
+
export class Search extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Embeds the search query and returns feedback record IDs with similarity scores
|
|
9
|
+
* (cosine, 0..1). **Only available when embeddings are configured**
|
|
10
|
+
* (EMBEDDING_PROVIDER and EMBEDDING_MODEL set). When embeddings are disabled, this
|
|
11
|
+
* endpoint returns 503 Service Unavailable. Request body must include query and
|
|
12
|
+
* tenant_id (required for tenant isolation).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const response =
|
|
17
|
+
* await client.feedbackRecords.search.performSemanticSearch(
|
|
18
|
+
* {
|
|
19
|
+
* query: 'What do users think about login speed?',
|
|
20
|
+
* tenant_id: 'org-123',
|
|
21
|
+
* },
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
performSemanticSearch(params, options) {
|
|
26
|
+
const { cursor, limit, min_score, ...body } = params;
|
|
27
|
+
return this._client.post('/v1/feedback-records/search/semantic', {
|
|
28
|
+
query: { cursor, limit, min_score },
|
|
29
|
+
body,
|
|
30
|
+
...options,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=search.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.mjs","sourceRoot":"","sources":["../../src/resources/feedback-records/search.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;OAiBG;IACH,qBAAqB,CACnB,MAAyC,EACzC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE;YAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;YACnC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|