@yaakapp/api 0.2.13 → 0.2.15

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.
@@ -155,10 +155,10 @@ export type InternalEventPayload = {
155
155
  } & TemplateRenderResponse | {
156
156
  "type": "show_toast_request";
157
157
  } & ShowToastRequest | {
158
- "type": "show_prompt_request";
159
- } & ShowPromptRequest | {
160
- "type": "show_prompt_response";
161
- } & ShowPromptResponse | {
158
+ "type": "prompt_text_request";
159
+ } & PromptTextRequest | {
160
+ "type": "prompt_text_response";
161
+ } & PromptTextResponse | {
162
162
  "type": "get_http_request_by_id_request";
163
163
  } & GetHttpRequestByIdRequest | {
164
164
  "type": "get_http_request_by_id_response";
@@ -171,23 +171,12 @@ export type InternalEventPayload = {
171
171
  };
172
172
  export type OpenFileFilter = {
173
173
  name: string;
174
+ /**
175
+ * File extensions to require
176
+ */
174
177
  extensions: Array<string>;
175
178
  };
176
- export type RenderHttpRequestRequest = {
177
- httpRequest: HttpRequest;
178
- purpose: RenderPurpose;
179
- };
180
- export type RenderHttpRequestResponse = {
181
- httpRequest: HttpRequest;
182
- };
183
- export type RenderPurpose = "send" | "preview";
184
- export type SendHttpRequestRequest = {
185
- httpRequest: HttpRequest;
186
- };
187
- export type SendHttpRequestResponse = {
188
- httpResponse: HttpResponse;
189
- };
190
- export type ShowPromptRequest = {
179
+ export type PromptTextRequest = {
191
180
  id: string;
192
181
  title: string;
193
182
  label: string;
@@ -207,8 +196,22 @@ export type ShowPromptRequest = {
207
196
  */
208
197
  require?: boolean;
209
198
  };
210
- export type ShowPromptResponse = {
211
- value: string;
199
+ export type PromptTextResponse = {
200
+ value: string | null;
201
+ };
202
+ export type RenderHttpRequestRequest = {
203
+ httpRequest: HttpRequest;
204
+ purpose: RenderPurpose;
205
+ };
206
+ export type RenderHttpRequestResponse = {
207
+ httpRequest: HttpRequest;
208
+ };
209
+ export type RenderPurpose = "send" | "preview";
210
+ export type SendHttpRequestRequest = {
211
+ httpRequest: HttpRequest;
212
+ };
213
+ export type SendHttpRequestResponse = {
214
+ httpResponse: HttpResponse;
212
215
  };
213
216
  export type ShowToastRequest = {
214
217
  message: string;
@@ -232,50 +235,134 @@ export type TemplateFunctionArg = {
232
235
  "type": "file";
233
236
  } & TemplateFunctionFileArg;
234
237
  export type TemplateFunctionBaseArg = {
238
+ /**
239
+ * The name of the argument. Should be `camelCase` format
240
+ */
235
241
  name: string;
242
+ /**
243
+ * Whether the user must fill in the argument
244
+ */
236
245
  optional?: boolean;
246
+ /**
247
+ * The label of the input
248
+ */
237
249
  label?: string;
250
+ /**
251
+ * The default value
252
+ */
238
253
  defaultValue?: string;
239
254
  };
240
255
  export type TemplateFunctionCheckboxArg = {
256
+ /**
257
+ * The name of the argument. Should be `camelCase` format
258
+ */
241
259
  name: string;
260
+ /**
261
+ * Whether the user must fill in the argument
262
+ */
242
263
  optional?: boolean;
264
+ /**
265
+ * The label of the input
266
+ */
243
267
  label?: string;
268
+ /**
269
+ * The default value
270
+ */
244
271
  defaultValue?: string;
245
272
  };
246
273
  export type TemplateFunctionFileArg = {
274
+ /**
275
+ * The title of the file selection window
276
+ */
247
277
  title: string;
278
+ /**
279
+ * Allow selecting multiple files
280
+ */
248
281
  multiple?: boolean;
249
282
  directory?: boolean;
250
283
  defaultPath?: string;
251
284
  filters?: Array<OpenFileFilter>;
285
+ /**
286
+ * The name of the argument. Should be `camelCase` format
287
+ */
252
288
  name: string;
289
+ /**
290
+ * Whether the user must fill in the argument
291
+ */
253
292
  optional?: boolean;
293
+ /**
294
+ * The label of the input
295
+ */
254
296
  label?: string;
297
+ /**
298
+ * The default value
299
+ */
255
300
  defaultValue?: string;
256
301
  };
257
302
  export type TemplateFunctionHttpRequestArg = {
303
+ /**
304
+ * The name of the argument. Should be `camelCase` format
305
+ */
258
306
  name: string;
307
+ /**
308
+ * Whether the user must fill in the argument
309
+ */
259
310
  optional?: boolean;
311
+ /**
312
+ * The label of the input
313
+ */
260
314
  label?: string;
315
+ /**
316
+ * The default value
317
+ */
261
318
  defaultValue?: string;
262
319
  };
263
320
  export type TemplateFunctionSelectArg = {
321
+ /**
322
+ * The options that will be available in the select input
323
+ */
264
324
  options: Array<TemplateFunctionSelectOption>;
325
+ /**
326
+ * The name of the argument. Should be `camelCase` format
327
+ */
265
328
  name: string;
329
+ /**
330
+ * Whether the user must fill in the argument
331
+ */
266
332
  optional?: boolean;
333
+ /**
334
+ * The label of the input
335
+ */
267
336
  label?: string;
337
+ /**
338
+ * The default value
339
+ */
268
340
  defaultValue?: string;
269
341
  };
270
342
  export type TemplateFunctionSelectOption = {
271
- name: string;
343
+ label: string;
272
344
  value: string;
273
345
  };
274
346
  export type TemplateFunctionTextArg = {
347
+ /**
348
+ * Placeholder for the text input
349
+ */
275
350
  placeholder?: string;
351
+ /**
352
+ * The name of the argument. Should be `camelCase` format
353
+ */
276
354
  name: string;
355
+ /**
356
+ * Whether the user must fill in the argument
357
+ */
277
358
  optional?: boolean;
359
+ /**
360
+ * The label of the input
361
+ */
278
362
  label?: string;
363
+ /**
364
+ * The default value
365
+ */
279
366
  defaultValue?: string;
280
367
  };
281
368
  export type TemplateRenderRequest = {
@@ -1,4 +1,4 @@
1
- import { ShowPromptRequest, ShowPromptResponse, TemplateRenderRequest, TemplateRenderResponse, FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest } from '..';
1
+ import { FindHttpResponsesRequest, FindHttpResponsesResponse, GetHttpRequestByIdRequest, GetHttpRequestByIdResponse, PromptTextRequest, PromptTextResponse, RenderHttpRequestRequest, RenderHttpRequestResponse, SendHttpRequestRequest, SendHttpRequestResponse, ShowToastRequest, TemplateRenderRequest, TemplateRenderResponse } from '..';
2
2
  export type Context = {
3
3
  clipboard: {
4
4
  copyText(text: string): void;
@@ -7,7 +7,7 @@ export type Context = {
7
7
  show(args: ShowToastRequest): void;
8
8
  };
9
9
  prompt: {
10
- show(args: ShowPromptRequest): Promise<ShowPromptResponse['value']>;
10
+ text(args: PromptTextRequest): Promise<PromptTextResponse['value']>;
11
11
  };
12
12
  httpRequest: {
13
13
  send(args: SendHttpRequestRequest): Promise<SendHttpRequestResponse['httpResponse']>;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@yaakapp/api",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "main": "lib/index.js",
5
5
  "typings": "./lib/index.d.ts",
6
6
  "files": [
7
7
  "lib/**/*"
8
8
  ],
9
9
  "scripts": {
10
+ "bootstrap": "npm run build",
10
11
  "build": "run-s build:copy-types build:tsc",
11
12
  "build:tsc": "tsc",
12
13
  "build:copy-types": "run-p build:copy-types:*",