@@ -37,6 +37,18 @@ export class Types {
37
37
return { data : null , error : res . error } ;
38
38
}
39
39
40
+ /**
41
+ *
42
+ * @param {string } query - The query to be processed
43
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
44
+ * @returns The result of the query as a string data type
45
+ * @example
46
+ * const { data, error } = await hyper.types.string(
47
+ 'Who is the CEO of SpaceX?',
48
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
49
+ );
50
+ * console.log(data); // Elon Musk
51
+ */
40
52
async string ( query : string , options ?: MethodParamsOptions ) {
41
53
const data = await this . makeRequest < string > ( {
42
54
endpointType : 'string' ,
@@ -47,6 +59,18 @@ export class Types {
47
59
return data ;
48
60
}
49
61
62
+ /**
63
+ *
64
+ * @param {string } query - The query to be processed
65
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
66
+ * @returns The result of the query as an integer data type
67
+ * @example
68
+ * const { data, error } = await hyper.types.integer(
69
+ 'How many planets are in the Solar System?',
70
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
71
+ );
72
+ * console.log(data); // 8
73
+ */
50
74
async integer ( query : string , options ?: MethodParamsOptions ) {
51
75
const data = await this . makeRequest < number > ( {
52
76
endpointType : 'integer' ,
@@ -57,6 +81,18 @@ export class Types {
57
81
return data ;
58
82
}
59
83
84
+ /**
85
+ *
86
+ * @param {string } query - The query to be processed
87
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
88
+ * @returns The result of the query as a float data type
89
+ * @example
90
+ * const { data, error } = await hyper.types.float(
91
+ 'How many billion years old is the universe?',
92
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
93
+ );
94
+ * console.log(data); // 13.8
95
+ */
60
96
async float ( query : string , options ?: MethodParamsOptions ) {
61
97
const data = await this . makeRequest < number > ( {
62
98
endpointType : 'float' ,
@@ -67,6 +103,18 @@ export class Types {
67
103
return data ;
68
104
}
69
105
106
+ /**
107
+ *
108
+ * @param {string } query - The query to be processed
109
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
110
+ * @returns The result of the query as a boolean data type
111
+ * @example
112
+ * const { data, error } = await hyper.types.boolean(
113
+ 'Can cats see in the dark?',
114
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
115
+ );
116
+ * console.log(data); // true
117
+ */
70
118
async boolean ( query : string , options ?: MethodParamsOptions ) {
71
119
const data = await this . makeRequest < boolean > ( {
72
120
endpointType : 'boolean' ,
@@ -77,6 +125,18 @@ export class Types {
77
125
return data ;
78
126
}
79
127
128
+ /**
129
+ *
130
+ * @param {string } query - The query to be processed
131
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
132
+ * @returns The result of the query as a datetime data type
133
+ * @example
134
+ * const { data, error } = await hyper.types.datetime(
135
+ 'What is the date of the Apollo 11 moon landing?',
136
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
137
+ );
138
+ * console.log(data); // '1969-07-20T20:17:00Z'
139
+ */
80
140
async datetime ( query : string , options ?: MethodParamsOptions ) {
81
141
const data = await this . makeRequest < string > ( {
82
142
endpointType : 'datetime' ,
@@ -87,6 +147,18 @@ export class Types {
87
147
return data ;
88
148
}
89
149
150
+ /**
151
+ *
152
+ * @param {string } query - The query to be processed
153
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
154
+ * @returns The result of the query as a array of strings
155
+ * @example
156
+ * const { data, error } = await hyper.types.stringArray(
157
+ 'List all department names',
158
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
159
+ );
160
+ * console.log(data); // ['Human Resources', 'Finance', 'Research and Development', 'Sales', 'Customer Support']
161
+ */
90
162
async stringArray ( query : string , options ?: MethodParamsOptions ) {
91
163
const data = await this . makeRequest < string [ ] > ( {
92
164
endpointType : 'string_array' ,
@@ -97,6 +169,18 @@ export class Types {
97
169
return data ;
98
170
}
99
171
172
+ /**
173
+ *
174
+ * @param {string } query - The query to be processed
175
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
176
+ * @returns The result of the query as a array of integers
177
+ * @example
178
+ * const { data, error } = await hyper.types.integerArray(
179
+ 'What is the headcount for each department?',
180
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
181
+ );
182
+ * console.log(data); // [25, 40, 15, 50, 30]
183
+ */
100
184
async integerArray ( query : string , options ?: MethodParamsOptions ) {
101
185
const data = await this . makeRequest < number [ ] > ( {
102
186
endpointType : 'integer_array' ,
@@ -107,6 +191,18 @@ export class Types {
107
191
return data ;
108
192
}
109
193
194
+ /**
195
+ *
196
+ * @param {string } query - The query to be processed
197
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
198
+ * @returns The result of the query as a array of floats
199
+ * @example
200
+ * const { data, error } = await hyper.types.floatArray(
201
+ 'What were the customer satisfaction ratings from the last survey?',
202
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
203
+ );
204
+ * console.log(data); // [4.2, 3.8, 4.5, 4.7, 3.9]
205
+ */
110
206
async floatArray ( query : string , options ?: MethodParamsOptions ) {
111
207
const data = await this . makeRequest < number [ ] > ( {
112
208
endpointType : 'float_array' ,
@@ -117,6 +213,18 @@ export class Types {
117
213
return data ;
118
214
}
119
215
216
+ /**
217
+ *
218
+ * @param {string } query - The query to be processed
219
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
220
+ * @returns The result of the query as a array of booleans
221
+ * @example
222
+ * const { data, error } = await hyper.types.booleanArray(
223
+ 'Are services meeting performance targets?',
224
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
225
+ );
226
+ * console.log(data); // [true, false, true, true, false]
227
+ */
120
228
async booleanArray ( query : string , options ?: MethodParamsOptions ) {
121
229
const data = await this . makeRequest < boolean [ ] > ( {
122
230
endpointType : 'boolean_array' ,
@@ -127,6 +235,18 @@ export class Types {
127
235
return data ;
128
236
}
129
237
238
+ /**
239
+ *
240
+ * @param {string } query - The query to be processed
241
+ * @param {MethodParamsOptions } options - Optional parameters to be passed to the request, such as `contextId`
242
+ * @returns The result of the query as a array of datetime strings
243
+ * @example
244
+ * const { data, error } = await hyper.types.datetimeArray(
245
+ 'What are the upcoming project deadlines?',
246
+ { contextId: '123e4567-e89b-12d3-a456-426614174000' },
247
+ );
248
+ * console.log(data); // ['2023-11-15T17:00:00Z', '2023-12-01T17:00:00Z', '2023-12-20T17:00:00Z']
249
+ */
130
250
async datetimeArray ( query : string , options ?: MethodParamsOptions ) {
131
251
const data = await this . makeRequest < string [ ] > ( {
132
252
endpointType : 'datetime_array' ,
0 commit comments