@api-client/core 0.6.17 → 0.6.20

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 (102) hide show
  1. package/build/legacy.d.ts +39 -0
  2. package/build/legacy.js +40 -0
  3. package/build/legacy.js.map +1 -0
  4. package/build/src/amf/ApiSchemaGenerator.d.ts +5 -5
  5. package/build/src/amf/ApiSchemaGenerator.js.map +1 -1
  6. package/build/src/amf/ApiSchemaValues.d.ts +6 -0
  7. package/build/src/amf/ApiSchemaValues.js +31 -0
  8. package/build/src/amf/ApiSchemaValues.js.map +1 -1
  9. package/build/src/amf/Parsing.d.ts +46 -0
  10. package/build/src/amf/Parsing.js +2 -0
  11. package/build/src/amf/Parsing.js.map +1 -0
  12. package/build/src/amf/shape/ShapeBase.d.ts +3 -3
  13. package/build/src/amf/shape/ShapeBase.js +3 -0
  14. package/build/src/amf/shape/ShapeBase.js.map +1 -1
  15. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js +4 -1
  16. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +1 -1
  17. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js +1 -1
  18. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +1 -1
  19. package/build/src/events/EventTypes.d.ts +6 -0
  20. package/build/src/events/EventTypes.js +2 -0
  21. package/build/src/events/EventTypes.js.map +1 -1
  22. package/build/src/events/Events.d.ts +5 -3
  23. package/build/src/events/Events.js +2 -0
  24. package/build/src/events/Events.js.map +1 -1
  25. package/build/src/events/amf/AmfEventTypes.d.ts +6 -0
  26. package/build/src/events/amf/AmfEventTypes.js +7 -0
  27. package/build/src/events/amf/AmfEventTypes.js.map +1 -0
  28. package/build/src/events/amf/AmfEvents.d.ts +34 -0
  29. package/build/src/events/amf/AmfEvents.js +59 -0
  30. package/build/src/events/amf/AmfEvents.js.map +1 -0
  31. package/build/src/events/authorization/AuthorizationEvents.d.ts +8 -8
  32. package/build/src/events/authorization/AuthorizationEvents.js +8 -8
  33. package/build/src/events/authorization/AuthorizationEvents.js.map +1 -1
  34. package/build/src/events/cookies/CookieEvents.d.ts +8 -8
  35. package/build/src/events/cookies/CookieEvents.js +8 -8
  36. package/build/src/events/cookies/CookieEvents.js.map +1 -1
  37. package/build/src/events/encryption/EncryptionEvents.d.ts +4 -4
  38. package/build/src/events/encryption/EncryptionEvents.js +4 -4
  39. package/build/src/events/encryption/EncryptionEvents.js.map +1 -1
  40. package/build/src/events/environment/EnvironmentEvents.d.ts +2 -2
  41. package/build/src/events/environment/EnvironmentEvents.js +2 -2
  42. package/build/src/events/environment/EnvironmentEvents.js.map +1 -1
  43. package/build/src/events/models/ClientCertificateEvents.d.ts +11 -11
  44. package/build/src/events/models/ClientCertificateEvents.js +11 -11
  45. package/build/src/events/models/ClientCertificateEvents.js.map +1 -1
  46. package/build/src/events/process/ProcessEvents.d.ts +6 -6
  47. package/build/src/events/process/ProcessEvents.js +6 -6
  48. package/build/src/events/process/ProcessEvents.js.map +1 -1
  49. package/build/src/events/reporting/ReportingEvents.d.ts +2 -2
  50. package/build/src/events/reporting/ReportingEvents.js +2 -2
  51. package/build/src/events/reporting/ReportingEvents.js.map +1 -1
  52. package/build/src/events/telemetry/TelemetryEvents.d.ts +6 -6
  53. package/build/src/events/telemetry/TelemetryEvents.js +6 -6
  54. package/build/src/events/telemetry/TelemetryEvents.js.map +1 -1
  55. package/build/src/events/transport/TransportEvents.d.ts +3 -3
  56. package/build/src/events/transport/TransportEvents.js +3 -3
  57. package/build/src/events/transport/TransportEvents.js.map +1 -1
  58. package/build/src/models/data/DataAssociation.d.ts +4 -0
  59. package/build/src/models/data/DataAssociation.js +8 -0
  60. package/build/src/models/data/DataAssociation.js.map +1 -1
  61. package/build/src/models/data/DataEntity.d.ts +4 -6
  62. package/build/src/models/data/DataEntity.js +25 -25
  63. package/build/src/models/data/DataEntity.js.map +1 -1
  64. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js +2 -2
  65. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.js.map +1 -1
  66. package/build/src/runtime/actions/runnable/SetCookieRunnable.js +1 -1
  67. package/build/src/runtime/actions/runnable/SetCookieRunnable.js.map +1 -1
  68. package/build/src/runtime/actions/runnable/SetVariableRunnable.js +1 -1
  69. package/build/src/runtime/actions/runnable/SetVariableRunnable.js.map +1 -1
  70. package/build/src/runtime/modules/RequestCookies.js +2 -2
  71. package/build/src/runtime/modules/RequestCookies.js.map +1 -1
  72. package/legacy.ts +41 -0
  73. package/package.json +3 -3
  74. package/src/amf/ApiSchemaGenerator.ts +5 -5
  75. package/src/amf/ApiSchemaValues.ts +32 -0
  76. package/src/amf/Parsing.ts +49 -0
  77. package/src/amf/shape/ShapeBase.ts +6 -3
  78. package/src/amf/shape/ShapeJsonSchemaGenerator.ts +4 -1
  79. package/src/amf/shape/ShapeXmlSchemaGenerator.ts +1 -1
  80. package/src/events/EventTypes.ts +2 -0
  81. package/src/events/Events.ts +2 -0
  82. package/src/events/amf/AmfEventTypes.ts +6 -0
  83. package/src/events/amf/AmfEvents.ts +63 -0
  84. package/src/events/authorization/AuthorizationEvents.ts +8 -8
  85. package/src/events/cookies/CookieEvents.ts +8 -8
  86. package/src/events/encryption/EncryptionEvents.ts +4 -4
  87. package/src/events/environment/EnvironmentEvents.ts +2 -2
  88. package/src/events/models/ClientCertificateEvents.ts +11 -11
  89. package/src/events/process/ProcessEvents.ts +6 -6
  90. package/src/events/reporting/ReportingEvents.ts +2 -2
  91. package/src/events/telemetry/TelemetryEvents.ts +6 -6
  92. package/src/events/transport/TransportEvents.ts +3 -3
  93. package/src/models/data/DataAssociation.ts +9 -0
  94. package/src/models/data/DataEntity.ts +26 -27
  95. package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +2 -2
  96. package/src/runtime/actions/runnable/SetCookieRunnable.ts +1 -1
  97. package/src/runtime/actions/runnable/SetVariableRunnable.ts +1 -1
  98. package/src/runtime/modules/RequestCookies.ts +2 -2
  99. package/build/src/models/data/DataAssociationSchema.d.ts +0 -68
  100. package/build/src/models/data/DataAssociationSchema.js +0 -2
  101. package/build/src/models/data/DataAssociationSchema.js.map +0 -1
  102. package/src/models/data/DataAssociationSchema.ts +0 -70
@@ -6,11 +6,11 @@ export class ClientCertificateEvents {
6
6
  /**
7
7
  * Dispatches an event handled by the data store to read the client certificate.
8
8
  *
9
- * @param target A node on which to dispatch the event.
10
9
  * @param id The id of the client certificate
10
+ * @param target A node on which to dispatch the event.
11
11
  * @returns Promise resolved to a client certificate model.
12
12
  */
13
- static async read(target: EventTarget, id: string): Promise<HttpCertificate | undefined> {
13
+ static async read(id: string, target: EventTarget = window): Promise<HttpCertificate | undefined> {
14
14
  const e = new ContextReadEvent<HttpCertificate>(ModelEventTypes.ClientCertificate.read, id);
15
15
  target.dispatchEvent(e);
16
16
  return e.detail.result;
@@ -19,11 +19,11 @@ export class ClientCertificateEvents {
19
19
  /**
20
20
  * Dispatches an event to list the client certificates data.
21
21
  *
22
- * @param target A node on which to dispatch the event.
23
22
  * @param opts Query options.
23
+ * @param target A node on which to dispatch the event.
24
24
  * @returns The list result.
25
25
  */
26
- static async list(target: EventTarget, opts?: ContextListOptions): Promise<ContextListResult<HttpCertificate> | undefined> {
26
+ static async list(opts?: ContextListOptions, target: EventTarget = window): Promise<ContextListResult<HttpCertificate> | undefined> {
27
27
  const e = new ContextListEvent<HttpCertificate>(ModelEventTypes.ClientCertificate.list, opts);
28
28
  target.dispatchEvent(e);
29
29
  return e.detail.result;
@@ -32,11 +32,11 @@ export class ClientCertificateEvents {
32
32
  /**
33
33
  * Dispatches an event handled by the data store to delete a client certificate
34
34
  *
35
- * @param target A node on which to dispatch the event.
36
35
  * @param id The id of the project to delete.
36
+ * @param target A node on which to dispatch the event.
37
37
  * @returns Promise resolved to a new revision after delete.
38
38
  */
39
- static async delete(target: EventTarget, id: string): Promise<ContextDeleteRecord | undefined> {
39
+ static async delete(id: string, target: EventTarget = window): Promise<ContextDeleteRecord | undefined> {
40
40
  const e = new ContextDeleteEvent(ModelEventTypes.ClientCertificate.delete, id, undefined);
41
41
  target.dispatchEvent(e);
42
42
  return e.detail.result;
@@ -45,11 +45,11 @@ export class ClientCertificateEvents {
45
45
  /**
46
46
  * Dispatches an event handled by the data store to insert a new client certificate.
47
47
  *
48
- * @param target A node on which to dispatch the event.
49
48
  * @param item The certificate object.
49
+ * @param target A node on which to dispatch the event.
50
50
  * @returns Promise resolved to the change record
51
51
  */
52
- static async insert(target: EventTarget, item: ICertificateCreateOptions): Promise<ContextChangeRecord<HttpCertificate> | undefined> {
52
+ static async insert(item: ICertificateCreateOptions, target: EventTarget = window): Promise<ContextChangeRecord<HttpCertificate> | undefined> {
53
53
  const e = new ContextUpdateEvent<ICertificateCreateOptions, HttpCertificate>(ModelEventTypes.ClientCertificate.insert, { item, });
54
54
  target.dispatchEvent(e);
55
55
  return e.detail.result;
@@ -67,7 +67,7 @@ class StateEvents {
67
67
  * @param target A node on which to dispatch the event.
68
68
  * @param record Change record
69
69
  */
70
- static update(target: EventTarget, record: ContextChangeRecord<HttpCertificate>): void {
70
+ static update(record: ContextChangeRecord<HttpCertificate>, target: EventTarget = window): void {
71
71
  const e = new ContextStateUpdateEvent<HttpCertificate>(ModelEventTypes.ClientCertificate.State.update, record);
72
72
  target.dispatchEvent(e);
73
73
  }
@@ -75,10 +75,10 @@ class StateEvents {
75
75
  /**
76
76
  * Dispatches an event after a client certificate was deleted
77
77
  *
78
- * @param target A node on which to dispatch the event.
79
78
  * @param record The context store delete record
79
+ * @param target A node on which to dispatch the event.
80
80
  */
81
- static delete(target: EventTarget, record: ContextDeleteRecord): void {
81
+ static delete(record: ContextDeleteRecord, target: EventTarget = window): void {
82
82
  const e = new ContextStateDeleteEvent(ModelEventTypes.ClientCertificate.State.delete, record);
83
83
  target.dispatchEvent(e);
84
84
  }
@@ -21,11 +21,11 @@ export class ProcessEvents {
21
21
  * in the background. The side effect of the event is the UI showing a process
22
22
  * indicator.
23
23
  *
24
- * @param target A node on which to dispatch the event.
25
24
  * @param pid The id of the process. The same id has to be passed to the stop event.
26
25
  * @param message Optional message rendered in the UI.
26
+ * @param target A node on which to dispatch the event.
27
27
  */
28
- static loadingStart(target: EventTarget, pid: string, message: string): void {
28
+ static loadingStart(pid: string, message: string, target: EventTarget = window): void {
29
29
  const detail: IProcessStartDetail = { pid, message };
30
30
  const e = new CustomEvent(ProcessEventTypes.loadingStart, {
31
31
  cancelable: true,
@@ -40,10 +40,10 @@ export class ProcessEvents {
40
40
  * An event to be dispatched when the application has finished a long running process
41
41
  * in the background.
42
42
  *
43
- * @param target A node on which to dispatch the event.
44
43
  * @param pid The id of the process. The same id has to be passed to the stop event.
44
+ * @param target A node on which to dispatch the event.
45
45
  */
46
- static loadingStop(target: EventTarget, pid: string): void {
46
+ static loadingStop(pid: string, target: EventTarget = window): void {
47
47
  const detail: IProcessStopDetail = { pid };
48
48
  const e = new CustomEvent(ProcessEventTypes.loadingStop, {
49
49
  cancelable: true,
@@ -58,12 +58,12 @@ export class ProcessEvents {
58
58
  * An event to be dispatched when the application has finished a long running process
59
59
  * in the background with an error.
60
60
  *
61
- * @param target A node on which to dispatch the event.
62
61
  * @param pid The id of the process used to start it.
63
62
  * @param message The message to be rendered to the user.
64
63
  * @param error The error object caused the event. Optional.
64
+ * @param target A node on which to dispatch the event.
65
65
  */
66
- static loadingError(target: EventTarget, pid: string, message: string, error?: Error): void {
66
+ static loadingError(pid: string, message: string, error?: Error, target: EventTarget = window): void {
67
67
  const detail: IProcessErrorDetail = { pid, message, error };
68
68
  const e = new CustomEvent(ProcessEventTypes.loadingError, {
69
69
  cancelable: true,
@@ -10,12 +10,12 @@ export class ReportingEvents {
10
10
  /**
11
11
  * Dispatches the general error event for UI logging purposes.
12
12
  *
13
- * @param target A node on which to dispatch the event
14
13
  * @param description The error description
15
14
  * @param error Optional original error object that has caused this event
16
15
  * @param component Optional component name.
16
+ * @param target A node on which to dispatch the event
17
17
  */
18
- static error(target: EventTarget, description: string, error?: Error, component?: string): void {
18
+ static error(description: string, error?: Error, component?: string, target: EventTarget = window): void {
19
19
  const detail: IReportingErrorDetail = { error, description, component };
20
20
  const e = new CustomEvent(ReportingEventTypes.error, {
21
21
  bubbles: true,
@@ -48,7 +48,7 @@ export class TelemetryEvents {
48
48
  * @param screenName The screen name
49
49
  * @param info Analytics base configuration
50
50
  */
51
- static view(target: EventTarget, screenName: string, info: ITelemetryDetail = {}): void {
51
+ static view(screenName: string, target: EventTarget = window, info: ITelemetryDetail = {}): void {
52
52
  const detail: ITelemetryScreenViewDetail = {
53
53
  ...info, screenName,
54
54
  };
@@ -66,7 +66,7 @@ export class TelemetryEvents {
66
66
  * @param target A node on which to dispatch the event
67
67
  * @param detail The event configuration
68
68
  */
69
- static event(target: EventTarget, detail: ITelemetryEventDetail): void {
69
+ static event(detail: ITelemetryEventDetail, target: EventTarget = window): void {
70
70
  const e = new CustomEvent(TelemetryEventTypes.event, {
71
71
  bubbles: true,
72
72
  composed: true,
@@ -83,7 +83,7 @@ export class TelemetryEvents {
83
83
  * @param fatal Whether the exception was fatal to the application
84
84
  * @param info Analytics base configuration
85
85
  */
86
- static exception(target: EventTarget, description: string, fatal?: boolean, info: ITelemetryDetail = {}): void {
86
+ static exception(description: string, fatal?: boolean, target: EventTarget = window, info: ITelemetryDetail = {}): void {
87
87
  const detail: ITelemetryExceptionDetail = { ...info, description, fatal };
88
88
  const e = new CustomEvent(TelemetryEventTypes.exception, {
89
89
  bubbles: true,
@@ -102,7 +102,7 @@ export class TelemetryEvents {
102
102
  * @param url The share url
103
103
  * @param info Analytics base configuration
104
104
  */
105
- static social(target: EventTarget, network: string, action: string, url: string, info: ITelemetryDetail = {}): void {
105
+ static social(network: string, action: string, url: string, target: EventTarget = window, info: ITelemetryDetail = {}): void {
106
106
  const detail: ITelemetrySocialDetail = { ...info, network, action, target: url };
107
107
  const e = new CustomEvent(TelemetryEventTypes.social, {
108
108
  bubbles: true,
@@ -122,7 +122,7 @@ export class TelemetryEvents {
122
122
  * @param label The timing label
123
123
  * @param info Analytics base configuration
124
124
  */
125
- static timing(target: EventTarget, category: string, variable: string, value: number, label?: string, info: ITelemetryDetail = {}): void {
125
+ static timing(category: string, variable: string, value: number, label?: string, target: EventTarget = window, info: ITelemetryDetail = {}): void {
126
126
  const detail: ITelemetryTimingDetail = { ...info, category, variable, value, label };
127
127
  const e = new CustomEvent(TelemetryEventTypes.timing, {
128
128
  bubbles: true,
@@ -145,7 +145,7 @@ class StateEvents {
145
145
  *
146
146
  * @param target The node on which to dispatch the event.
147
147
  */
148
- static set(target: EventTarget): void {
148
+ static set(target: EventTarget = window): void {
149
149
  const e = new Event(TelemetryEventTypes.State.set, {
150
150
  composed: true,
151
151
  cancelable: true,
@@ -39,7 +39,7 @@ export const TransportEvent = Object.freeze({
39
39
  * @param config Optional request configuration.
40
40
  * @returns The execution log or `undefined` when the event was not handled.
41
41
  */
42
- send: async (target: EventTarget, request: IHttpRequest, authorization?: IRequestAuthorization[], config?: IRequestBaseConfig): Promise<IRequestLog | undefined> => {
42
+ send: async (request: IHttpRequest, authorization?: IRequestAuthorization[], config?: IRequestBaseConfig, target: EventTarget = window): Promise<IRequestLog | undefined> => {
43
43
  const e = new ContextEvent<ICoreRequestDetail, IRequestLog>(TransportEventTypes.Core.send, {
44
44
  request,
45
45
  authorization,
@@ -62,7 +62,7 @@ export const TransportEvent = Object.freeze({
62
62
  * @param init Optional request init options compatible with the Fetch API.
63
63
  * @returns Compatible with the Fetch API Response object or `undefined` when the event was not handled.
64
64
  */
65
- send: async (target: EventTarget, request: IHttpRequest, init?: RequestInit): Promise<Response | undefined> => {
65
+ send: async (request: IHttpRequest, init?: RequestInit, target: EventTarget = window): Promise<Response | undefined> => {
66
66
  const e = new ContextEvent<IHttpRequestDetail, Response>(TransportEventTypes.Http.send, {
67
67
  request,
68
68
  init,
@@ -82,7 +82,7 @@ export const TransportEvent = Object.freeze({
82
82
  * @param opts The project execution options.
83
83
  * @returns
84
84
  */
85
- send: async (target: EventTarget, project: HttpProject | string, opts: IProjectRunnerOptions): Promise<IProjectExecutionLog | undefined> => {
85
+ send: async (project: HttpProject | string, opts: IProjectRunnerOptions, target: EventTarget = window): Promise<IProjectExecutionLog | undefined> => {
86
86
  const e = new ContextEvent<IProjectRequestDetail, IProjectExecutionLog>(TransportEventTypes.Project.send, {
87
87
  project,
88
88
  opts,
@@ -383,4 +383,13 @@ export class DataAssociation {
383
383
  this.adapts = association.key;
384
384
  return association;
385
385
  }
386
+
387
+ /**
388
+ * @returns The definition of the parent entity of this association.
389
+ */
390
+ getParent(): DataEntity {
391
+ // this is forced as an association is only created when an entity is created
392
+ // so it has to be defined.
393
+ return this.root.definitions.entities.find(i => i.associations.includes(this)) as DataEntity;
394
+ }
386
395
  }
@@ -8,6 +8,7 @@ import { DataModel } from "./DataModel.js";
8
8
  import { INodeShape, IShapeUnion } from "../../amf/definitions/Shapes.js";
9
9
  import { AmfShapeGenerator } from "../../amf/AmfShapeGenerator.js";
10
10
  import { ApiSchemaGenerator } from "../../amf/ApiSchemaGenerator.js";
11
+ import { IShapeRenderOptions } from "../../amf/shape/ShapeBase.js";
11
12
 
12
13
  export const Kind = 'Core#DataEntity';
13
14
 
@@ -483,20 +484,19 @@ export class DataEntity {
483
484
  * D -> C
484
485
  *
485
486
  * C => [B, D]
487
+ * B => [A, C]
486
488
  * ```
487
489
  */
488
490
  getRelatedEntities(): DataEntity[] {
489
491
  const { key, root } = this;
490
492
  const result: DataEntity[] = [];
491
493
  const inverse = root.definitions.associations.filter(i => i.targets.includes(key));
492
-
493
494
  inverse.forEach((assoc) => {
494
495
  const entity = root.definitions.entities.find(e => e.associations.includes(assoc));
495
496
  if (entity) {
496
497
  result.push(entity);
497
498
  }
498
499
  });
499
-
500
500
  return result;
501
501
  }
502
502
 
@@ -593,12 +593,13 @@ export class DataEntity {
593
593
  /**
594
594
  * Reads the schema of the Entity and generates an example for it.
595
595
  */
596
- toExample(mime: string): string | number | boolean | null | undefined {
596
+ toExample(mime: string, opts: IShapeRenderOptions = {}): string | number | boolean | null | undefined {
597
597
  const shape = this.toApiShape();
598
598
  const generator = new ApiSchemaGenerator(mime, {
599
- renderExamples: true,
600
- renderMocked: true,
601
- renderOptional: true,
599
+ renderExamples: typeof opts.renderExamples === 'boolean' ? opts.renderExamples : true,
600
+ renderMocked: typeof opts.renderMocked === 'boolean' ? opts.renderMocked : true,
601
+ renderOptional: typeof opts.renderOptional === 'boolean' ? opts.renderOptional : true,
602
+ selectedUnions: opts.selectedUnions,
602
603
  });
603
604
  return generator.generate(shape);
604
605
  }
@@ -627,29 +628,27 @@ export class DataEntity {
627
628
  return entity;
628
629
  }
629
630
 
630
- /**
631
- * Checks whether the `target` creates a cycle in the graph (whether this creates a recursive association).
632
- * @param target
633
- */
634
- hasForwardCycle(target: string, g = this.root.associationGraph(), key = this.key): boolean {
635
- if (target === key) {
636
- return true;
637
- }
638
- const neighbors: string[] = [];
639
- Object.keys(g).forEach(prop => {
640
- if (g[prop].includes(key)) {
641
- neighbors.push(prop);
642
- }
643
- });
644
- if (neighbors.includes(target)) {
631
+ hasClosedCycle(rootEntity: string, targetEntity: string): boolean {
632
+ if (targetEntity === this.key) {
633
+ // self association
645
634
  return true;
646
635
  }
647
- for (const neighbor of neighbors) {
648
- if (neighbor === key) {
649
- return true;
650
- }
651
- if (this.hasForwardCycle(target, g, neighbor)) {
652
- return true;
636
+ const g = this.root.associationGraph();
637
+ const selfPaths: string[][] = [];
638
+ const targetPaths: string[][] = [];
639
+ for (const path of this.root.associationPath(rootEntity, this.key, g)) {
640
+ selfPaths.push(path);
641
+ }
642
+ for (const path of this.root.associationPath(targetEntity, this.key, g)) {
643
+ targetPaths.push(path);
644
+ }
645
+ const checker = (arr: string[], target: string[]): boolean => target.every(v => arr.includes(v));
646
+ for (const sp of selfPaths) {
647
+ for (const tp of targetPaths) {
648
+ const result = checker(sp, tp);
649
+ if (result) {
650
+ return result;
651
+ }
653
652
  }
654
653
  }
655
654
  return false;
@@ -19,7 +19,7 @@ export class DeleteCookieRunnable extends ActionRunnable {
19
19
  if (!url) {
20
20
  return;
21
21
  }
22
- Events.Cookie.deleteUrl(this.eventTarget, url, config.name);
22
+ Events.Cookie.deleteUrl(url, config.name, this.eventTarget);
23
23
  }
24
24
 
25
25
  async request(request: IHttpRequest): Promise<void> {
@@ -34,6 +34,6 @@ export class DeleteCookieRunnable extends ActionRunnable {
34
34
  if (!url) {
35
35
  return;
36
36
  }
37
- Events.Cookie.deleteUrl(this.eventTarget, url, config.name);
37
+ Events.Cookie.deleteUrl(url, config.name, this.eventTarget);
38
38
  }
39
39
  }
@@ -68,7 +68,7 @@ export class SetCookieRunnable extends ActionRunnable {
68
68
  if (typeof config.secure === 'boolean') {
69
69
  cookie.secure = config.secure;
70
70
  }
71
- Events.Cookie.update(this.eventTarget, cookie);
71
+ Events.Cookie.update(cookie, this.eventTarget);
72
72
  }
73
73
 
74
74
  async response(log: IRequestLog): Promise<void> {
@@ -29,7 +29,7 @@ export class SetVariableRunnable extends ActionRunnable {
29
29
 
30
30
  async setVariable(config: ISetVariableAction, value: string): Promise<void> {
31
31
  const { name } = config;
32
- Events.Environment.set(this.eventTarget, name, value);
32
+ Events.Environment.set(name, value, this.eventTarget);
33
33
  }
34
34
 
35
35
  async response(log: IRequestLog): Promise<void> {
@@ -19,7 +19,7 @@ import { Cookie } from '../../lib/cookies/Cookie.js';
19
19
  * @returns A promise that resolves to header value string.
20
20
  */
21
21
  async function getCookiesHeaderValue(eventsTarget: EventTarget, url: string): Promise<string> {
22
- const cookies = await CookieEvents.listUrl(eventsTarget, url);
22
+ const cookies = await CookieEvents.listUrl(url, eventsTarget);
23
23
  if (!cookies || !cookies.length) {
24
24
  return '';
25
25
  }
@@ -141,6 +141,6 @@ export async function processResponseCookies(log: IRequestLog, context: Executio
141
141
  const typedResponse = log.response as IResponse;
142
142
  const result = extract(typedResponse, log.request.url, log.redirects);
143
143
  if (result.cookies.length) {
144
- await CookieEvents.updateBulk(context.eventsTarget, result.cookies.map(c => HttpCookie.fromCookieParser(c).toJSON()));
144
+ await CookieEvents.updateBulk(result.cookies.map(c => HttpCookie.fromCookieParser(c).toJSON()), context.eventsTarget);
145
145
  }
146
146
  }
@@ -1,68 +0,0 @@
1
- export interface IDataAssociationSchema {
2
- /**
3
- * Whether the target entity should be embedded under the property name.
4
- * When false, this association is just an information that one entity depend on another.
5
- * When true, it changes the definition of the schema having this association to
6
- * add the target schema properties inline with this property.
7
- *
8
- * **When true**
9
- *
10
- * ```javascript
11
- * // generated schema for `address` association
12
- * {
13
- * "name": "example value",
14
- * "address": {
15
- * "city": "example value",
16
- * ...
17
- * }
18
- * }
19
- * ```
20
- *
21
- * **When false**
22
- *
23
- * ```javascript
24
- * // generated schema for `address` association
25
- * {
26
- * "name": "example value",
27
- * "address": "the key of the referenced schema"
28
- * }
29
- * ```
30
- */
31
- embedded?: boolean;
32
- /**
33
- * Describes XML specific serialization.
34
- */
35
- xml?: {
36
- /**
37
- * The name of the attribute or a wrapped property to use when serializing the property.
38
- *
39
- * ```
40
- * <Person fullName="John Doe"></Person>
41
- * ```
42
- */
43
- name?: string;
44
- /**
45
- * When the property is an array (has the `multiple` set to true)
46
- * then it tells that the list of values should be wrapped with a parent
47
- * element:
48
- *
49
- * ```
50
- * <Person>
51
- * <Person fullName="John Doe"></Person>
52
- * </Person>
53
- * ```
54
- *
55
- * Use this with the combination with `name` to describe the name of the wrapped
56
- * element
57
- *
58
- * ```
59
- * <people>
60
- * <Person fullName="John Doe"></Person>
61
- * </people>
62
- * ```
63
- *
64
- * Note, this is mutually exclusive with `attribute`.
65
- */
66
- wrapped?: boolean;
67
- };
68
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DataAssociationSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataAssociationSchema.js","sourceRoot":"","sources":["../../../../src/models/data/DataAssociationSchema.ts"],"names":[],"mappings":""}
@@ -1,70 +0,0 @@
1
- export interface IDataAssociationSchema {
2
- /**
3
- * Whether the target entity should be embedded under the property name.
4
- * When false, this association is just an information that one entity depend on another.
5
- * When true, it changes the definition of the schema having this association to
6
- * add the target schema properties inline with this property.
7
- *
8
- * **When true**
9
- *
10
- * ```javascript
11
- * // generated schema for `address` association
12
- * {
13
- * "name": "example value",
14
- * "address": {
15
- * "city": "example value",
16
- * ...
17
- * }
18
- * }
19
- * ```
20
- *
21
- * **When false**
22
- *
23
- * ```javascript
24
- * // generated schema for `address` association
25
- * {
26
- * "name": "example value",
27
- * "address": "the key of the referenced schema"
28
- * }
29
- * ```
30
- */
31
- embedded?: boolean;
32
-
33
- /**
34
- * Describes XML specific serialization.
35
- */
36
- xml?: {
37
- /**
38
- * The name of the attribute or a wrapped property to use when serializing the property.
39
- *
40
- * ```
41
- * <Person fullName="John Doe"></Person>
42
- * ```
43
- */
44
- name?: string;
45
-
46
- /**
47
- * When the property is an array (has the `multiple` set to true)
48
- * then it tells that the list of values should be wrapped with a parent
49
- * element:
50
- *
51
- * ```
52
- * <Person>
53
- * <Person fullName="John Doe"></Person>
54
- * </Person>
55
- * ```
56
- *
57
- * Use this with the combination with `name` to describe the name of the wrapped
58
- * element
59
- *
60
- * ```
61
- * <people>
62
- * <Person fullName="John Doe"></Person>
63
- * </people>
64
- * ```
65
- *
66
- * Note, this is mutually exclusive with `attribute`.
67
- */
68
- wrapped?: boolean;
69
- }
70
- }