@api-client/core 0.5.10 → 0.5.11

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 (51) hide show
  1. package/build/browser.d.ts +2 -0
  2. package/build/browser.js +2 -0
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +2 -0
  5. package/build/index.js +2 -0
  6. package/build/index.js.map +1 -1
  7. package/build/src/lib/calculators/DataCalculator.d.ts +3 -3
  8. package/build/src/lib/calculators/DataCalculator.js +3 -3
  9. package/build/src/lib/calculators/DataCalculator.js.map +1 -1
  10. package/build/src/lib/events/Utils.d.ts +1 -0
  11. package/build/src/lib/events/Utils.js +6 -0
  12. package/build/src/lib/events/Utils.js.map +1 -0
  13. package/build/src/lib/parsers/UriTemplate.d.ts +94 -0
  14. package/build/src/lib/parsers/UriTemplate.js +419 -0
  15. package/build/src/lib/parsers/UriTemplate.js.map +1 -0
  16. package/build/src/lib/parsers/UrlEncoder.d.ts +5 -0
  17. package/build/src/lib/parsers/UrlEncoder.js +49 -0
  18. package/build/src/lib/parsers/UrlEncoder.js.map +1 -1
  19. package/build/src/models/HttpProject.d.ts +4 -1
  20. package/build/src/models/HttpProject.js +9 -6
  21. package/build/src/models/HttpProject.js.map +1 -1
  22. package/build/src/models/ProjectParent.d.ts +9 -0
  23. package/build/src/models/ProjectParent.js +25 -0
  24. package/build/src/models/ProjectParent.js.map +1 -1
  25. package/build/src/models/Property.d.ts +8 -0
  26. package/build/src/models/Property.js +17 -0
  27. package/build/src/models/Property.js.map +1 -1
  28. package/build/src/models/Server.d.ts +14 -1
  29. package/build/src/models/Server.js +31 -1
  30. package/build/src/models/Server.js.map +1 -1
  31. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +1 -1
  32. package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +1 -1
  33. package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +1 -1
  34. package/build/src/runtime/http-engine/CoreEngine.d.ts +1 -1
  35. package/build/src/runtime/store/FilesSdk.d.ts +8 -0
  36. package/build/src/runtime/store/FilesSdk.js +15 -0
  37. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/lib/calculators/DataCalculator.ts +3 -3
  40. package/src/lib/events/Utils.ts +5 -0
  41. package/src/lib/parsers/UriTemplate.ts +494 -0
  42. package/src/lib/parsers/UrlEncoder.ts +51 -0
  43. package/src/models/HttpProject.ts +10 -7
  44. package/src/models/ProjectParent.ts +27 -0
  45. package/src/models/Property.ts +18 -0
  46. package/src/models/Server.ts +32 -1
  47. package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +1 -1
  48. package/src/runtime/actions/runnable/SetCookieRunnable.ts +1 -1
  49. package/src/runtime/actions/runnable/SetVariableRunnable.ts +1 -1
  50. package/src/runtime/http-engine/CoreEngine.ts +1 -1
  51. package/src/runtime/store/FilesSdk.ts +16 -0
@@ -3,7 +3,7 @@ import { ActionRunnable } from './ActionRunnable.js';
3
3
  import { ISetVariableAction } from '../../../models/actions/runnable/SetVariableAction.js';
4
4
  import { Events } from '../../../events/Events.js';
5
5
  import { RequestDataExtractor } from '../../../data/RequestDataExtractor.js';
6
- import { IRequestLog } from 'src/models/RequestLog.js';
6
+ import { IRequestLog } from '../../../models/RequestLog.js';
7
7
 
8
8
  export class SetVariableRunnable extends ActionRunnable {
9
9
  async request(request: IHttpRequest): Promise<void> {
@@ -3,7 +3,7 @@ import tls from 'tls';
3
3
  import http from 'http';
4
4
  import https from 'https';
5
5
  import { HttpEngine, HttpEngineOptions, HeadersReceivedDetail } from './HttpEngine.js';
6
- import { IRequestLog } from 'src/models/RequestLog.js';
6
+ import { IRequestLog } from '../../models/RequestLog.js';
7
7
  import { IHttpRequest } from '../../models/HttpRequest.js';
8
8
  import { Response } from '../../models/Response.js';
9
9
  import { SerializableError } from '../../models/SerializableError.js';
@@ -338,4 +338,20 @@ export class FilesSdk extends SdkBase {
338
338
  const url = this.sdk.getUrl(RouteBuilder.files());
339
339
  return this.sdk.ws.createAndConnect(url.toString(), token);
340
340
  }
341
+
342
+ /**
343
+ * Creates a WS client that listens to the file events.
344
+ *
345
+ * @param key The file key to observe
346
+ * @param media Whether to observe changes to the file media instead of meta.
347
+ * @param request Optional request options.
348
+ */
349
+ async observeFile(key: string, media?: boolean, request: ISdkRequestOptions = {}): Promise<WebSocketNode | WebSocket> {
350
+ const token = request.token || this.sdk.token;
351
+ const url = this.sdk.getUrl(RouteBuilder.file(key));
352
+ if (media) {
353
+ url.searchParams.set('alt', 'media');
354
+ }
355
+ return this.sdk.ws.createAndConnect(url.toString(), token);
356
+ }
341
357
  }