@formbricks/hub 0.3.0 → 0.4.2

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 (95) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/client.d.mts +15 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +15 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +28 -18
  7. package/client.js.map +1 -1
  8. package/client.mjs +28 -18
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +17 -17
  11. package/internal/utils/query.d.mts +5 -0
  12. package/internal/utils/query.d.mts.map +1 -0
  13. package/internal/utils/query.d.ts +5 -0
  14. package/internal/utils/query.d.ts.map +1 -0
  15. package/internal/utils/query.js +23 -0
  16. package/internal/utils/query.js.map +1 -0
  17. package/internal/utils/query.mjs +20 -0
  18. package/internal/utils/query.mjs.map +1 -0
  19. package/internal/utils.d.mts +1 -0
  20. package/internal/utils.d.ts +1 -0
  21. package/internal/utils.js +1 -0
  22. package/internal/utils.js.map +1 -1
  23. package/internal/utils.mjs +1 -0
  24. package/package.json +7 -1
  25. package/resources/feedback-records/feedback-records.d.mts +474 -0
  26. package/resources/feedback-records/feedback-records.d.mts.map +1 -0
  27. package/resources/feedback-records/feedback-records.d.ts +474 -0
  28. package/resources/feedback-records/feedback-records.d.ts.map +1 -0
  29. package/resources/feedback-records/feedback-records.js +140 -0
  30. package/resources/feedback-records/feedback-records.js.map +1 -0
  31. package/resources/feedback-records/feedback-records.mjs +135 -0
  32. package/resources/feedback-records/feedback-records.mjs.map +1 -0
  33. package/resources/feedback-records/index.d.mts +3 -0
  34. package/resources/feedback-records/index.d.mts.map +1 -0
  35. package/resources/feedback-records/index.d.ts +3 -0
  36. package/resources/feedback-records/index.d.ts.map +1 -0
  37. package/resources/feedback-records/index.js +9 -0
  38. package/resources/feedback-records/index.js.map +1 -0
  39. package/resources/feedback-records/index.mjs +4 -0
  40. package/resources/feedback-records/index.mjs.map +1 -0
  41. package/resources/feedback-records/search.d.mts +99 -0
  42. package/resources/feedback-records/search.d.mts.map +1 -0
  43. package/resources/feedback-records/search.d.ts +99 -0
  44. package/resources/feedback-records/search.d.ts.map +1 -0
  45. package/resources/feedback-records/search.js +39 -0
  46. package/resources/feedback-records/search.js.map +1 -0
  47. package/resources/feedback-records/search.mjs +35 -0
  48. package/resources/feedback-records/search.mjs.map +1 -0
  49. package/resources/feedback-records.d.mts +1 -369
  50. package/resources/feedback-records.d.mts.map +1 -1
  51. package/resources/feedback-records.d.ts +1 -369
  52. package/resources/feedback-records.d.ts.map +1 -1
  53. package/resources/feedback-records.js +2 -102
  54. package/resources/feedback-records.js.map +1 -1
  55. package/resources/feedback-records.mjs +1 -100
  56. package/resources/feedback-records.mjs.map +1 -1
  57. package/resources/health.d.mts +3 -0
  58. package/resources/health.d.mts.map +1 -1
  59. package/resources/health.d.ts +3 -0
  60. package/resources/health.d.ts.map +1 -1
  61. package/resources/health.js +3 -0
  62. package/resources/health.js.map +1 -1
  63. package/resources/health.mjs +3 -0
  64. package/resources/health.mjs.map +1 -1
  65. package/resources/index.d.mts +2 -1
  66. package/resources/index.d.mts.map +1 -1
  67. package/resources/index.d.ts +2 -1
  68. package/resources/index.d.ts.map +1 -1
  69. package/resources/index.js +4 -2
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +2 -1
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/webhooks.d.mts +338 -0
  74. package/resources/webhooks.d.mts.map +1 -0
  75. package/resources/webhooks.d.ts +338 -0
  76. package/resources/webhooks.d.ts.map +1 -0
  77. package/resources/webhooks.js +91 -0
  78. package/resources/webhooks.js.map +1 -0
  79. package/resources/webhooks.mjs +87 -0
  80. package/resources/webhooks.mjs.map +1 -0
  81. package/src/client.ts +56 -23
  82. package/src/internal/utils/query.ts +23 -0
  83. package/src/internal/utils.ts +1 -0
  84. package/src/resources/feedback-records/feedback-records.ts +602 -0
  85. package/src/resources/feedback-records/index.ts +19 -0
  86. package/src/resources/feedback-records/search.ts +127 -0
  87. package/src/resources/feedback-records.ts +1 -469
  88. package/src/resources/health.ts +3 -0
  89. package/src/resources/index.ts +13 -1
  90. package/src/resources/webhooks.ts +469 -0
  91. package/src/version.ts +1 -1
  92. package/version.d.mts +1 -1
  93. package/version.d.ts +1 -1
  94. package/version.js +1 -1
  95. package/version.mjs +1 -1
package/internal/tslib.js CHANGED
@@ -1,26 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.__setModuleDefault = exports.__createBinding = void 0;
4
+ exports.__importStar = __importStar;
4
5
  exports.__classPrivateFieldSet = __classPrivateFieldSet;
5
6
  exports.__classPrivateFieldGet = __classPrivateFieldGet;
6
- exports.__importStar = __importStar;
7
7
  exports.__exportStar = __exportStar;
8
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
9
- if (kind === "m")
10
- throw new TypeError("Private method is not writable");
11
- if (kind === "a" && !f)
12
- throw new TypeError("Private accessor was defined without a setter");
13
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
14
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
- return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
16
- }
17
- function __classPrivateFieldGet(receiver, state, kind, f) {
18
- if (kind === "a" && !f)
19
- throw new TypeError("Private accessor was defined without a getter");
20
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
21
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
22
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
23
- }
24
8
  var __createBinding = Object.create
25
9
  ? function (o, m, k, k2) {
26
10
  if (k2 === void 0)
@@ -74,6 +58,22 @@ function __importStar(mod) {
74
58
  __setModuleDefault(result, mod);
75
59
  return result;
76
60
  }
61
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
62
+ if (kind === "m")
63
+ throw new TypeError("Private method is not writable");
64
+ if (kind === "a" && !f)
65
+ throw new TypeError("Private accessor was defined without a setter");
66
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
67
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
68
+ return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
69
+ }
70
+ function __classPrivateFieldGet(receiver, state, kind, f) {
71
+ if (kind === "a" && !f)
72
+ throw new TypeError("Private accessor was defined without a getter");
73
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
74
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
75
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
76
+ }
77
77
  function __exportStar(m, o) {
78
78
  for (var p in m)
79
79
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Basic re-implementation of `qs.stringify` for primitive types.
3
+ */
4
+ export declare function stringifyQuery(query: object | Record<string, unknown>): string;
5
+ //# sourceMappingURL=query.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.mts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAerE"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Basic re-implementation of `qs.stringify` for primitive types.
3
+ */
4
+ export declare function stringifyQuery(query: object | Record<string, unknown>): string;
5
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAerE"}
@@ -0,0 +1,23 @@
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.stringifyQuery = stringifyQuery;
5
+ const error_1 = require("../../core/error.js");
6
+ /**
7
+ * Basic re-implementation of `qs.stringify` for primitive types.
8
+ */
9
+ function stringifyQuery(query) {
10
+ return Object.entries(query)
11
+ .filter(([_, value]) => typeof value !== 'undefined')
12
+ .map(([key, value]) => {
13
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
14
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
15
+ }
16
+ if (value === null) {
17
+ return `${encodeURIComponent(key)}=`;
18
+ }
19
+ throw new error_1.FormbricksHubError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
20
+ })
21
+ .join('&');
22
+ }
23
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAOtF,wCAeC;AApBD,+CAAsD;AAEtD;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAuC;IACpE,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,WAAW,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACzF,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,CAAC;QACD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,0BAAkB,CAC1B,yBAAyB,OAAO,KAAK,mQAAmQ,CACzS,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { FormbricksHubError } from "../../core/error.mjs";
3
+ /**
4
+ * Basic re-implementation of `qs.stringify` for primitive types.
5
+ */
6
+ export function stringifyQuery(query) {
7
+ return Object.entries(query)
8
+ .filter(([_, value]) => typeof value !== 'undefined')
9
+ .map(([key, value]) => {
10
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
11
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
12
+ }
13
+ if (value === null) {
14
+ return `${encodeURIComponent(key)}=`;
15
+ }
16
+ throw new FormbricksHubError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
17
+ })
18
+ .join('&');
19
+ }
20
+ //# sourceMappingURL=query.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.mjs","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,kBAAkB,EAAE;AAE7B;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuC;IACpE,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,WAAW,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACzF,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,CAAC;QACD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,kBAAkB,CAC1B,yBAAyB,OAAO,KAAK,mQAAmQ,CACzS,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -4,4 +4,5 @@ export * from "./utils/env.mjs";
4
4
  export * from "./utils/log.mjs";
5
5
  export * from "./utils/uuid.mjs";
6
6
  export * from "./utils/sleep.mjs";
7
+ export * from "./utils/query.mjs";
7
8
  //# sourceMappingURL=utils.d.mts.map
@@ -4,4 +4,5 @@ export * from "./utils/env.js";
4
4
  export * from "./utils/log.js";
5
5
  export * from "./utils/uuid.js";
6
6
  export * from "./utils/sleep.js";
7
+ export * from "./utils/query.js";
7
8
  //# sourceMappingURL=utils.d.ts.map
package/internal/utils.js CHANGED
@@ -8,4 +8,5 @@ tslib_1.__exportStar(require("./utils/env.js"), exports);
8
8
  tslib_1.__exportStar(require("./utils/log.js"), exports);
9
9
  tslib_1.__exportStar(require("./utils/uuid.js"), exports);
10
10
  tslib_1.__exportStar(require("./utils/sleep.js"), exports);
11
+ tslib_1.__exportStar(require("./utils/query.js"), exports);
11
12
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B;AAC/B,4DAA+B;AAC/B,yDAA4B;AAC5B,yDAA4B;AAC5B,0DAA6B;AAC7B,2DAA8B"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B;AAC/B,4DAA+B;AAC/B,yDAA4B;AAC5B,yDAA4B;AAC5B,0DAA6B;AAC7B,2DAA8B;AAC9B,2DAA8B"}
@@ -5,4 +5,5 @@ export * from "./utils/env.mjs";
5
5
  export * from "./utils/log.mjs";
6
6
  export * from "./utils/uuid.mjs";
7
7
  export * from "./utils/sleep.mjs";
8
+ export * from "./utils/query.mjs";
8
9
  //# sourceMappingURL=utils.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formbricks/hub",
3
- "version": "0.3.0",
3
+ "version": "0.4.2",
4
4
  "description": "The official TypeScript library for the Formbricks Hub API",
5
5
  "author": "Formbricks Hub <hola@formbricks.com>",
6
6
  "types": "./index.d.ts",
@@ -16,6 +16,12 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {},
19
+ "overrides": {
20
+ "minimatch": "^9.0.5"
21
+ },
22
+ "resolutions": {
23
+ "minimatch": "^9.0.5"
24
+ },
19
25
  "exports": {
20
26
  ".": {
21
27
  "require": {
@@ -0,0 +1,474 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as SearchAPI from "./search.mjs";
3
+ import { Search, SearchPerformSemanticSearchParams, SearchPerformSemanticSearchResponse } from "./search.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { RequestOptions } from "../../internal/request-options.mjs";
6
+ /**
7
+ * Feedback record CRUD and search
8
+ */
9
+ export declare class FeedbackRecords extends APIResource {
10
+ search: SearchAPI.Search;
11
+ /**
12
+ * Creates a new feedback record data point
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const feedbackRecordData =
17
+ * await client.feedbackRecords.create({
18
+ * field_id: 'q1',
19
+ * field_type: 'rating',
20
+ * source_type: 'survey',
21
+ * submission_id: '550e8400-e29b-41d4-a716-446655440000',
22
+ * tenant_id: 'org-123',
23
+ * field_label: 'How satisfied are you?',
24
+ * language: 'en',
25
+ * source_id: 'survey-123',
26
+ * source_name: 'Q1 NPS Survey',
27
+ * user_identifier: 'user-abc-123',
28
+ * value_number: 9,
29
+ * });
30
+ * ```
31
+ */
32
+ create(body: FeedbackRecordCreateParams, options?: RequestOptions): APIPromise<FeedbackRecordData>;
33
+ /**
34
+ * Retrieves a single feedback record data point by its UUID
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const feedbackRecordData =
39
+ * await client.feedbackRecords.retrieve(
40
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
41
+ * );
42
+ * ```
43
+ */
44
+ retrieve(id: string, options?: RequestOptions): APIPromise<FeedbackRecordData>;
45
+ /**
46
+ * Updates specific fields of a feedback record data point
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const feedbackRecordData =
51
+ * await client.feedbackRecords.update(
52
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
53
+ * { value_text: 'Updated feedback text' },
54
+ * );
55
+ * ```
56
+ */
57
+ update(id: string, body: FeedbackRecordUpdateParams, options?: RequestOptions): APIPromise<FeedbackRecordData>;
58
+ /**
59
+ * Lists feedback records with optional filters and pagination
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const feedbackRecords = await client.feedbackRecords.list({
64
+ * tenant_id: 'org-123',
65
+ * });
66
+ * ```
67
+ */
68
+ list(query: FeedbackRecordListParams, options?: RequestOptions): APIPromise<FeedbackRecordListResponse>;
69
+ /**
70
+ * Permanently deletes a feedback record data point
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * await client.feedbackRecords.delete(
75
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
76
+ * );
77
+ * ```
78
+ */
79
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
80
+ /**
81
+ * Permanently deletes all feedback record data points matching the specified
82
+ * user_identifier. This endpoint supports GDPR Article 17 (Right to Erasure)
83
+ * requests.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const response = await client.feedbackRecords.bulkDelete({
88
+ * user_identifier: 'user-abc-123',
89
+ * });
90
+ * ```
91
+ */
92
+ bulkDelete(params: FeedbackRecordBulkDeleteParams, options?: RequestOptions): APIPromise<FeedbackRecordBulkDeleteResponse>;
93
+ /**
94
+ * Returns feedback record IDs and similarity scores for records similar to the
95
+ * given one (by embedding). **Only available when embeddings are configured**
96
+ * (EMBEDDING_PROVIDER and EMBEDDING_MODEL set). Supported providers: openai,
97
+ * google (AI Studio), google-vertex. When embeddings are disabled, this endpoint
98
+ * returns 503 Service Unavailable. The source feedback record must belong to the
99
+ * given tenant_id (enforced).
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response =
104
+ * await client.feedbackRecords.retrieveSimilar(
105
+ * '018e1234-5678-9abc-def0-123456789abc',
106
+ * { tenant_id: 'org-123' },
107
+ * );
108
+ * ```
109
+ */
110
+ retrieveSimilar(id: string, query: FeedbackRecordRetrieveSimilarParams, options?: RequestOptions): APIPromise<FeedbackRecordRetrieveSimilarResponse>;
111
+ }
112
+ export interface FeedbackRecordData {
113
+ /**
114
+ * UUIDv7 primary key
115
+ */
116
+ id: string;
117
+ /**
118
+ * When the feedback was collected
119
+ */
120
+ collected_at: string;
121
+ /**
122
+ * When this record was created
123
+ */
124
+ created_at: string;
125
+ /**
126
+ * Identifier for the question/field
127
+ */
128
+ field_id: string;
129
+ /**
130
+ * Type of field
131
+ */
132
+ field_type: 'text' | 'categorical' | 'nps' | 'csat' | 'ces' | 'rating' | 'number' | 'boolean' | 'date';
133
+ /**
134
+ * Type of feedback source
135
+ */
136
+ source_type: string;
137
+ /**
138
+ * Identifier for the logical submission this record belongs to (required).
139
+ */
140
+ submission_id: string;
141
+ /**
142
+ * Tenant/organization identifier. NULL bytes not allowed.
143
+ */
144
+ tenant_id: string;
145
+ /**
146
+ * When this record was last updated
147
+ */
148
+ updated_at: string;
149
+ /**
150
+ * Stable identifier grouping related fields (for ranking, matrix, grid questions)
151
+ */
152
+ field_group_id?: string;
153
+ /**
154
+ * Human-readable question text for the group
155
+ */
156
+ field_group_label?: string;
157
+ /**
158
+ * The actual question text
159
+ */
160
+ field_label?: string;
161
+ /**
162
+ * ISO language code. NULL bytes not allowed.
163
+ */
164
+ language?: string;
165
+ /**
166
+ * Additional context
167
+ */
168
+ metadata?: {
169
+ [key: string]: unknown;
170
+ };
171
+ /**
172
+ * Reference to survey/form/ticket ID
173
+ */
174
+ source_id?: string;
175
+ /**
176
+ * Human-readable name
177
+ */
178
+ source_name?: string;
179
+ /**
180
+ * User identifier
181
+ */
182
+ user_identifier?: string;
183
+ /**
184
+ * Boolean response
185
+ */
186
+ value_boolean?: boolean;
187
+ /**
188
+ * Date response
189
+ */
190
+ value_date?: string;
191
+ /**
192
+ * Numeric response
193
+ */
194
+ value_number?: number;
195
+ /**
196
+ * Text response. NULL bytes not allowed.
197
+ */
198
+ value_text?: string;
199
+ }
200
+ export interface FeedbackRecordListResponse {
201
+ /**
202
+ * List of feedback records
203
+ */
204
+ data: Array<FeedbackRecordData>;
205
+ /**
206
+ * Limit used in query
207
+ */
208
+ limit: number;
209
+ /**
210
+ * Opaque cursor for the next page (keyset paging). Present only when there may be
211
+ * more results. Use as the cursor query param for the next page.
212
+ */
213
+ next_cursor?: string;
214
+ }
215
+ export interface FeedbackRecordBulkDeleteResponse {
216
+ /**
217
+ * Number of records deleted
218
+ */
219
+ deleted_count: number;
220
+ /**
221
+ * Human-readable status message
222
+ */
223
+ message: string;
224
+ }
225
+ export interface FeedbackRecordRetrieveSimilarResponse {
226
+ /**
227
+ * List of feedback record IDs with similarity scores (0 = unrelated, 1 =
228
+ * identical). Consistent with list endpoints.
229
+ */
230
+ data: Array<FeedbackRecordRetrieveSimilarResponse.Data>;
231
+ /**
232
+ * Limit used in query (echoed for consistency with list endpoints)
233
+ */
234
+ limit: number;
235
+ /**
236
+ * Opaque cursor for the next page (keyset paging). Present only when there may be
237
+ * more results (full page returned). Omit when no next page. Use this exact value
238
+ * as the cursor query param for the next page.
239
+ */
240
+ next_cursor?: string;
241
+ }
242
+ export declare namespace FeedbackRecordRetrieveSimilarResponse {
243
+ interface Data {
244
+ /**
245
+ * Feedback record UUID
246
+ */
247
+ feedback_record_id: string;
248
+ /**
249
+ * Label of the feedback field (included in embedding for context). May be empty if
250
+ * the source record had no label.
251
+ */
252
+ field_label: string;
253
+ /**
254
+ * Similarity score (0..1)
255
+ */
256
+ score: number;
257
+ /**
258
+ * value_text of the feedback record (the text that was embedded). May be empty if
259
+ * the source had no text; embeddings are only created for records with non-empty
260
+ * value_text, but the field can be cleared after embedding creation.
261
+ */
262
+ value_text: string;
263
+ }
264
+ }
265
+ export interface FeedbackRecordCreateParams {
266
+ /**
267
+ * Identifier for the question/field. NULL bytes not allowed.
268
+ */
269
+ field_id: string;
270
+ /**
271
+ * Field type: text (enrichable), categorical, nps, csat, ces, rating, number,
272
+ * boolean, date
273
+ */
274
+ field_type: 'text' | 'categorical' | 'nps' | 'csat' | 'ces' | 'rating' | 'number' | 'boolean' | 'date';
275
+ /**
276
+ * Type of feedback source (e.g., survey, review, feedback_form). NULL bytes not
277
+ * allowed.
278
+ */
279
+ source_type: string;
280
+ /**
281
+ * Identifier for the logical submission this record belongs to (tenant-scoped).
282
+ * Required. Enables grouping multi-field submissions and idempotent ingestion.
283
+ * Unique per (tenant_id, submission_id, field_id). If a record has no logical
284
+ * submission, use e.g. field_id.
285
+ */
286
+ submission_id: string;
287
+ /**
288
+ * Tenant/organization identifier for multi-tenancy. Required.
289
+ */
290
+ tenant_id: string;
291
+ /**
292
+ * When the feedback was collected (defaults to now). Must be between 1970-01-01
293
+ * and 2080-12-31.
294
+ */
295
+ collected_at?: string;
296
+ /**
297
+ * Stable identifier grouping related fields (for ranking, matrix, grid questions).
298
+ * NULL bytes not allowed.
299
+ */
300
+ field_group_id?: string;
301
+ /**
302
+ * Human-readable question text for the group
303
+ */
304
+ field_group_label?: string | null;
305
+ /**
306
+ * The actual question text
307
+ */
308
+ field_label?: string | null;
309
+ /**
310
+ * ISO language code. NULL bytes not allowed.
311
+ */
312
+ language?: string;
313
+ /**
314
+ * User agent, device, location, referrer, tags, etc. NULL bytes (\x00 or \u0000)
315
+ * are not allowed in JSON keys or values.
316
+ */
317
+ metadata?: {
318
+ [key: string]: unknown;
319
+ };
320
+ /**
321
+ * Reference to survey/form/ticket ID
322
+ */
323
+ source_id?: string | null;
324
+ /**
325
+ * Human-readable name
326
+ */
327
+ source_name?: string | null;
328
+ /**
329
+ * Anonymous ID or email hash
330
+ */
331
+ user_identifier?: string;
332
+ /**
333
+ * For yes/no questions
334
+ */
335
+ value_boolean?: boolean;
336
+ /**
337
+ * For date responses. Must be between 1970-01-01 and 2080-12-31.
338
+ */
339
+ value_date?: string;
340
+ /**
341
+ * For ratings, NPS scores, numeric responses. Must be between -1e15 and +1e15.
342
+ */
343
+ value_number?: number;
344
+ /**
345
+ * For open-ended text responses. Omit or null if not applicable. NULL bytes not
346
+ * allowed when present.
347
+ */
348
+ value_text?: string | null;
349
+ }
350
+ export interface FeedbackRecordUpdateParams {
351
+ /**
352
+ * Update language. NULL bytes not allowed.
353
+ */
354
+ language?: string;
355
+ /**
356
+ * Update metadata. NULL bytes (\x00 or \u0000) are not allowed in JSON keys or
357
+ * values.
358
+ */
359
+ metadata?: {
360
+ [key: string]: unknown;
361
+ };
362
+ /**
363
+ * Update user identifier
364
+ */
365
+ user_identifier?: string;
366
+ /**
367
+ * Update boolean response
368
+ */
369
+ value_boolean?: boolean;
370
+ /**
371
+ * Update date response. Must be between 1970-01-01 and 2080-12-31.
372
+ */
373
+ value_date?: string;
374
+ /**
375
+ * Update numeric response. Must be between -1e15 and +1e15.
376
+ */
377
+ value_number?: number;
378
+ /**
379
+ * Update text response. NULL bytes not allowed.
380
+ */
381
+ value_text?: string;
382
+ }
383
+ export interface FeedbackRecordListParams {
384
+ /**
385
+ * Tenant ID (required for isolation). NULL bytes not allowed.
386
+ */
387
+ tenant_id: string;
388
+ /**
389
+ * Omit for the first page. For the next page, use the exact value from the
390
+ * previous response's next_cursor. Opaque (base64-encoded); keyset pagination.
391
+ */
392
+ cursor?: string;
393
+ /**
394
+ * Filter by field group ID (for ranking/matrix questions). NULL bytes not allowed.
395
+ */
396
+ field_group_id?: string;
397
+ /**
398
+ * Filter by field ID. NULL bytes not allowed.
399
+ */
400
+ field_id?: string;
401
+ /**
402
+ * Filter by field type. NULL bytes not allowed.
403
+ */
404
+ field_type?: 'text' | 'categorical' | 'nps' | 'csat' | 'ces' | 'rating' | 'number' | 'boolean' | 'date';
405
+ /**
406
+ * Number of results to return (max 1000)
407
+ */
408
+ limit?: number;
409
+ /**
410
+ * Filter by collected_at >= since (ISO 8601 format). Must be between 1970-01-01
411
+ * and 2080-12-31.
412
+ */
413
+ since?: string;
414
+ /**
415
+ * Filter by source ID (NULL bytes not allowed)
416
+ */
417
+ source_id?: string;
418
+ /**
419
+ * Filter by source type. NULL bytes not allowed.
420
+ */
421
+ source_type?: string;
422
+ /**
423
+ * Filter by submission ID to group records belonging to one logical submission.
424
+ * NULL bytes not allowed.
425
+ */
426
+ submission_id?: string;
427
+ /**
428
+ * Filter by collected_at <= until (ISO 8601 format). Must be between 1970-01-01
429
+ * and 2080-12-31.
430
+ */
431
+ until?: string;
432
+ /**
433
+ * Filter by user identifier. NULL bytes not allowed.
434
+ */
435
+ user_identifier?: string;
436
+ }
437
+ export interface FeedbackRecordBulkDeleteParams {
438
+ /**
439
+ * Delete all records matching this user identifier (required). NULL bytes not
440
+ * allowed.
441
+ */
442
+ user_identifier: string;
443
+ /**
444
+ * Filter by tenant ID (optional, for multi-tenant deployments). NULL bytes not
445
+ * allowed.
446
+ */
447
+ tenant_id?: string;
448
+ }
449
+ export interface FeedbackRecordRetrieveSimilarParams {
450
+ /**
451
+ * Tenant ID (required for isolation; must match feedback record tenant_id)
452
+ */
453
+ tenant_id: string;
454
+ /**
455
+ * Omit for the first page. For the next page, use the exact value from the
456
+ * previous response's next_cursor. Opaque (base64-encoded); keyset pagination.
457
+ */
458
+ cursor?: string;
459
+ /**
460
+ * Number of results to return (default 10, max 100). Consistent with list
461
+ * endpoints.
462
+ */
463
+ limit?: number;
464
+ /**
465
+ * Minimum similarity score (0..1); only results with score >= min_score are
466
+ * returned. Default 0.7 to reduce noise.
467
+ */
468
+ min_score?: number;
469
+ }
470
+ export declare namespace FeedbackRecords {
471
+ export { type FeedbackRecordData as FeedbackRecordData, type FeedbackRecordListResponse as FeedbackRecordListResponse, type FeedbackRecordBulkDeleteResponse as FeedbackRecordBulkDeleteResponse, type FeedbackRecordRetrieveSimilarResponse as FeedbackRecordRetrieveSimilarResponse, type FeedbackRecordCreateParams as FeedbackRecordCreateParams, type FeedbackRecordUpdateParams as FeedbackRecordUpdateParams, type FeedbackRecordListParams as FeedbackRecordListParams, type FeedbackRecordBulkDeleteParams as FeedbackRecordBulkDeleteParams, type FeedbackRecordRetrieveSimilarParams as FeedbackRecordRetrieveSimilarParams, };
472
+ export { Search as Search, type SearchPerformSemanticSearchResponse as SearchPerformSemanticSearchResponse, type SearchPerformSemanticSearchParams as SearchPerformSemanticSearchParams, };
473
+ }
474
+ //# sourceMappingURL=feedback-records.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback-records.d.mts","sourceRoot":"","sources":["../../src/resources/feedback-records/feedback-records.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,MAAM,EAAE,iCAAiC,EAAE,mCAAmC,EAAE;OAClF,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIlG;;;;;;;;;;OAUG;IACH,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