@api-client/core 0.6.28 → 0.6.31
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.
- package/build/src/events/BaseEvents.d.ts +30 -28
- package/build/src/events/BaseEvents.js +15 -15
- package/build/src/events/BaseEvents.js.map +1 -1
- package/build/src/events/models/ClientCertificateEvents.d.ts +4 -4
- package/build/src/events/models/ClientCertificateEvents.js +6 -6
- package/build/src/events/models/ClientCertificateEvents.js.map +1 -1
- package/build/src/events/transport/TransportEvents.js.map +1 -1
- package/build/src/mocking/ProjectMock.d.ts +2 -0
- package/build/src/mocking/ProjectMock.js +3 -0
- package/build/src/mocking/ProjectMock.js.map +1 -1
- package/build/src/mocking/lib/Arc.d.ts +9 -0
- package/build/src/mocking/lib/Arc.js +24 -0
- package/build/src/mocking/lib/Arc.js.map +1 -0
- package/build/src/mocking/lib/Certificates.js +4 -1
- package/build/src/mocking/lib/Certificates.js.map +1 -1
- package/build/src/mocking/lib/Request.js +5 -2
- package/build/src/mocking/lib/Request.js.map +1 -1
- package/build/src/models/ClientCertificate.d.ts +2 -2
- package/build/src/models/ClientCertificate.js +10 -7
- package/build/src/models/ClientCertificate.js.map +1 -1
- package/build/src/models/arc/ArcHttpRequest.d.ts +1 -0
- package/build/src/models/arc/ArcHttpRequest.js +20 -12
- package/build/src/models/arc/ArcHttpRequest.js.map +1 -1
- package/build/src/models/arc/ArcProject.js +5 -0
- package/build/src/models/arc/ArcProject.js.map +1 -1
- package/build/src/runtime/http-engine/HttpEngine.js +7 -5
- package/build/src/runtime/http-engine/HttpEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/events/BaseEvents.ts +33 -33
- package/src/events/models/ClientCertificateEvents.ts +6 -6
- package/src/events/transport/TransportEvents.ts +2 -0
- package/src/mocking/ProjectMock.ts +3 -0
- package/src/mocking/lib/Arc.ts +28 -0
- package/src/mocking/lib/Certificates.ts +4 -1
- package/src/mocking/lib/Request.ts +6 -3
- package/src/models/ClientCertificate.ts +12 -9
- package/src/models/arc/ArcHttpRequest.ts +20 -12
- package/src/models/arc/ArcProject.ts +5 -0
- package/src/runtime/http-engine/HttpEngine.ts +8 -6
|
@@ -22,9 +22,9 @@ export declare class ContextEvent<S extends object, R> extends CustomEvent<S & C
|
|
|
22
22
|
}
|
|
23
23
|
export interface ContextReadEventDetail {
|
|
24
24
|
/**
|
|
25
|
-
* The
|
|
25
|
+
* The key of the state object to read.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
key: string;
|
|
28
28
|
/**
|
|
29
29
|
* Optional parent, when needed.
|
|
30
30
|
*/
|
|
@@ -36,16 +36,16 @@ export interface ContextReadEventDetail {
|
|
|
36
36
|
export declare class ContextReadEvent<T> extends ContextEvent<ContextReadEventDetail, T> {
|
|
37
37
|
/**
|
|
38
38
|
* @param type The type of the event
|
|
39
|
-
* @param
|
|
39
|
+
* @param key The domain key of the object to read
|
|
40
40
|
* @param parent Optional parent, when needed.
|
|
41
41
|
*/
|
|
42
|
-
constructor(type: string,
|
|
42
|
+
constructor(type: string, key: string, parent?: string);
|
|
43
43
|
}
|
|
44
44
|
export interface ContextReadBulkEventDetail {
|
|
45
45
|
/**
|
|
46
|
-
* The list of
|
|
46
|
+
* The list of keys to read.
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
keys: string[];
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* An event to be used to read a list of object from the API store.
|
|
@@ -53,9 +53,9 @@ export interface ContextReadBulkEventDetail {
|
|
|
53
53
|
export declare class ContextReadBulkEvent<T> extends ContextEvent<ContextReadBulkEventDetail, T[]> {
|
|
54
54
|
/**
|
|
55
55
|
* @param type The type of the event
|
|
56
|
-
* @param
|
|
56
|
+
* @param keys The list of domain keys to read. These must be of the same domain type.
|
|
57
57
|
*/
|
|
58
|
-
constructor(type: string,
|
|
58
|
+
constructor(type: string, keys: string[]);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* A general purpose change record.
|
|
@@ -68,7 +68,7 @@ export interface ContextChangeRecord<T> {
|
|
|
68
68
|
*/
|
|
69
69
|
kind?: string;
|
|
70
70
|
/**
|
|
71
|
-
* The
|
|
71
|
+
* The key of the changed context state object.
|
|
72
72
|
*/
|
|
73
73
|
key: string;
|
|
74
74
|
/**
|
|
@@ -76,27 +76,27 @@ export interface ContextChangeRecord<T> {
|
|
|
76
76
|
*/
|
|
77
77
|
item?: T;
|
|
78
78
|
/**
|
|
79
|
-
* Optionally, when relevant, the
|
|
79
|
+
* Optionally, when relevant, the key of the parent of the changed object.
|
|
80
80
|
*/
|
|
81
81
|
parent?: string;
|
|
82
82
|
}
|
|
83
83
|
export interface ContextDeleteEventDetail {
|
|
84
84
|
/**
|
|
85
|
-
* The
|
|
85
|
+
* The key of the domain object to remove.
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
key: string;
|
|
88
88
|
/**
|
|
89
|
-
* The
|
|
89
|
+
* The key of the parent object, if applicable.
|
|
90
90
|
*/
|
|
91
91
|
parent?: string;
|
|
92
92
|
}
|
|
93
93
|
export interface ContextDeleteBulkEventDetail {
|
|
94
94
|
/**
|
|
95
|
-
* The list of
|
|
95
|
+
* The list of keys of the domain object to remove.
|
|
96
96
|
*/
|
|
97
|
-
|
|
97
|
+
keys: string[];
|
|
98
98
|
/**
|
|
99
|
-
* The
|
|
99
|
+
* The key of the parent object, if applicable.
|
|
100
100
|
*/
|
|
101
101
|
parent?: string;
|
|
102
102
|
}
|
|
@@ -107,10 +107,10 @@ export declare class ContextDeleteEvent extends ContextEvent<ContextDeleteEventD
|
|
|
107
107
|
/**
|
|
108
108
|
* An event to be used to delete a state in the context provider.
|
|
109
109
|
* @param type The type of the event to dispatch.
|
|
110
|
-
* @param
|
|
111
|
-
* @param parent The
|
|
110
|
+
* @param key The key of the object to delete
|
|
111
|
+
* @param parent The key of the parent object, if applicable.
|
|
112
112
|
*/
|
|
113
|
-
constructor(type: string,
|
|
113
|
+
constructor(type: string, key: string, parent?: string);
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* An event to be used to delete a number of entities in the context provider.
|
|
@@ -119,10 +119,10 @@ export declare class ContextDeleteBulkEvent extends ContextEvent<ContextDeleteBu
|
|
|
119
119
|
/**
|
|
120
120
|
* An event to be used to delete a number of entities in the context provider.
|
|
121
121
|
* @param type The type of the event to dispatch.
|
|
122
|
-
* @param
|
|
123
|
-
* @param parent The
|
|
122
|
+
* @param keys The list of ids of the domain object to remove.
|
|
123
|
+
* @param parent The key of the parent object, if applicable.
|
|
124
124
|
*/
|
|
125
|
-
constructor(type: string,
|
|
125
|
+
constructor(type: string, keys: string[], parent?: string);
|
|
126
126
|
}
|
|
127
127
|
export interface ContextDeleteRecord {
|
|
128
128
|
/**
|
|
@@ -131,18 +131,20 @@ export interface ContextDeleteRecord {
|
|
|
131
131
|
*/
|
|
132
132
|
kind?: string;
|
|
133
133
|
/**
|
|
134
|
-
* The
|
|
134
|
+
* The key of the removed object.
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
key: string;
|
|
137
137
|
/**
|
|
138
|
-
* The
|
|
138
|
+
* The key of the parent object, if applicable.
|
|
139
139
|
*/
|
|
140
140
|
parent?: string;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* An event dispatched to the context store to restore previously deleted items.
|
|
144
144
|
*/
|
|
145
|
-
export declare class ContextRestoreEvent<T> extends ContextEvent<
|
|
145
|
+
export declare class ContextRestoreEvent<T> extends ContextEvent<{
|
|
146
|
+
records: ContextDeleteRecord[];
|
|
147
|
+
}, (ContextChangeRecord<T> | undefined)[]> {
|
|
146
148
|
/**
|
|
147
149
|
* An event dispatched to the context store to restore previously deleted items.
|
|
148
150
|
*
|
|
@@ -182,7 +184,7 @@ export interface ContextUpdateEventDetail<T> {
|
|
|
182
184
|
*/
|
|
183
185
|
item: T;
|
|
184
186
|
/**
|
|
185
|
-
* The
|
|
187
|
+
* The key of the parent object, if applicable.
|
|
186
188
|
*/
|
|
187
189
|
parent?: string;
|
|
188
190
|
}
|
|
@@ -192,7 +194,7 @@ export interface ContextUpdateBulkEventDetail<T> {
|
|
|
192
194
|
*/
|
|
193
195
|
items: T[];
|
|
194
196
|
/**
|
|
195
|
-
* The
|
|
197
|
+
* The key of the parent object, if applicable.
|
|
196
198
|
*/
|
|
197
199
|
parent?: string;
|
|
198
200
|
}
|
|
@@ -25,11 +25,11 @@ export class ContextEvent extends CustomEvent {
|
|
|
25
25
|
export class ContextReadEvent extends ContextEvent {
|
|
26
26
|
/**
|
|
27
27
|
* @param type The type of the event
|
|
28
|
-
* @param
|
|
28
|
+
* @param key The domain key of the object to read
|
|
29
29
|
* @param parent Optional parent, when needed.
|
|
30
30
|
*/
|
|
31
|
-
constructor(type,
|
|
32
|
-
super(type, {
|
|
31
|
+
constructor(type, key, parent) {
|
|
32
|
+
super(type, { key, parent });
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -38,10 +38,10 @@ export class ContextReadEvent extends ContextEvent {
|
|
|
38
38
|
export class ContextReadBulkEvent extends ContextEvent {
|
|
39
39
|
/**
|
|
40
40
|
* @param type The type of the event
|
|
41
|
-
* @param
|
|
41
|
+
* @param keys The list of domain keys to read. These must be of the same domain type.
|
|
42
42
|
*/
|
|
43
|
-
constructor(type,
|
|
44
|
-
super(type, {
|
|
43
|
+
constructor(type, keys) {
|
|
44
|
+
super(type, { keys });
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -51,11 +51,11 @@ export class ContextDeleteEvent extends ContextEvent {
|
|
|
51
51
|
/**
|
|
52
52
|
* An event to be used to delete a state in the context provider.
|
|
53
53
|
* @param type The type of the event to dispatch.
|
|
54
|
-
* @param
|
|
55
|
-
* @param parent The
|
|
54
|
+
* @param key The key of the object to delete
|
|
55
|
+
* @param parent The key of the parent object, if applicable.
|
|
56
56
|
*/
|
|
57
|
-
constructor(type,
|
|
58
|
-
super(type, {
|
|
57
|
+
constructor(type, key, parent) {
|
|
58
|
+
super(type, { key, parent });
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -65,11 +65,11 @@ export class ContextDeleteBulkEvent extends ContextEvent {
|
|
|
65
65
|
/**
|
|
66
66
|
* An event to be used to delete a number of entities in the context provider.
|
|
67
67
|
* @param type The type of the event to dispatch.
|
|
68
|
-
* @param
|
|
69
|
-
* @param parent The
|
|
68
|
+
* @param keys The list of ids of the domain object to remove.
|
|
69
|
+
* @param parent The key of the parent object, if applicable.
|
|
70
70
|
*/
|
|
71
|
-
constructor(type,
|
|
72
|
-
super(type, {
|
|
71
|
+
constructor(type, keys, parent) {
|
|
72
|
+
super(type, { keys, parent });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
@@ -85,7 +85,7 @@ export class ContextRestoreEvent extends ContextEvent {
|
|
|
85
85
|
* @param records The records of previously deleted items.
|
|
86
86
|
*/
|
|
87
87
|
constructor(type, records) {
|
|
88
|
-
super(type, records);
|
|
88
|
+
super(type, { records });
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEvents.js","sourceRoot":"","sources":["../../../src/events/BaseEvents.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAc3C;;GAEG;AACH,MAAM,OAAO,YAAkC,SAAQ,WAAgD;IACrG;;;OAGG;IACH,YAAY,IAAY,EAAE,MAAS;QACjC,KAAK,CAAC,IAAI,EAAE;YACV,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE;gBACN,MAAM,EAAE,SAAS;gBACjB,GAAG,MAAM;aACV;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAaD;;GAEG;AACH,MAAM,OAAO,gBAAoB,SAAQ,YAAuC;IAC9E;;;;OAIG;IACH,YAAY,IAAY,EAAE,
|
|
1
|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UG;IACH,YAAY,IAAY,EAAE,IAAkB;QAC1C,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -4,11 +4,11 @@ export declare class ClientCertificateEvents {
|
|
|
4
4
|
/**
|
|
5
5
|
* Dispatches an event handled by the data store to read the client certificate.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param key The key of the client certificate
|
|
8
8
|
* @param target A node on which to dispatch the event.
|
|
9
9
|
* @returns Promise resolved to a client certificate model.
|
|
10
10
|
*/
|
|
11
|
-
static read(
|
|
11
|
+
static read(key: string, target?: EventTarget): Promise<HttpCertificate | undefined>;
|
|
12
12
|
/**
|
|
13
13
|
* Dispatches an event to list the client certificates data.
|
|
14
14
|
*
|
|
@@ -20,11 +20,11 @@ export declare class ClientCertificateEvents {
|
|
|
20
20
|
/**
|
|
21
21
|
* Dispatches an event handled by the data store to delete a client certificate
|
|
22
22
|
*
|
|
23
|
-
* @param
|
|
23
|
+
* @param key The key of the project to delete.
|
|
24
24
|
* @param target A node on which to dispatch the event.
|
|
25
25
|
* @returns Promise resolved to a new revision after delete.
|
|
26
26
|
*/
|
|
27
|
-
static delete(
|
|
27
|
+
static delete(key: string, target?: EventTarget): Promise<ContextDeleteRecord | undefined>;
|
|
28
28
|
/**
|
|
29
29
|
* Dispatches an event handled by the data store to insert a new client certificate.
|
|
30
30
|
*
|
|
@@ -4,12 +4,12 @@ export class ClientCertificateEvents {
|
|
|
4
4
|
/**
|
|
5
5
|
* Dispatches an event handled by the data store to read the client certificate.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param key The key of the client certificate
|
|
8
8
|
* @param target A node on which to dispatch the event.
|
|
9
9
|
* @returns Promise resolved to a client certificate model.
|
|
10
10
|
*/
|
|
11
|
-
static async read(
|
|
12
|
-
const e = new ContextReadEvent(ModelEventTypes.ClientCertificate.read,
|
|
11
|
+
static async read(key, target = window) {
|
|
12
|
+
const e = new ContextReadEvent(ModelEventTypes.ClientCertificate.read, key);
|
|
13
13
|
target.dispatchEvent(e);
|
|
14
14
|
return e.detail.result;
|
|
15
15
|
}
|
|
@@ -28,12 +28,12 @@ export class ClientCertificateEvents {
|
|
|
28
28
|
/**
|
|
29
29
|
* Dispatches an event handled by the data store to delete a client certificate
|
|
30
30
|
*
|
|
31
|
-
* @param
|
|
31
|
+
* @param key The key of the project to delete.
|
|
32
32
|
* @param target A node on which to dispatch the event.
|
|
33
33
|
* @returns Promise resolved to a new revision after delete.
|
|
34
34
|
*/
|
|
35
|
-
static async delete(
|
|
36
|
-
const e = new ContextDeleteEvent(ModelEventTypes.ClientCertificate.delete,
|
|
35
|
+
static async delete(key, target = window) {
|
|
36
|
+
const e = new ContextDeleteEvent(ModelEventTypes.ClientCertificate.delete, key, undefined);
|
|
37
37
|
target.dispatchEvent(e);
|
|
38
38
|
return e.detail.result;
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientCertificateEvents.js","sourceRoot":"","sources":["../../../../src/events/models/ClientCertificateEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAyC,kBAAkB,EAAuB,kBAAkB,EAAuB,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACjP,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,OAAO,uBAAuB;IAClC;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"ClientCertificateEvents.js","sourceRoot":"","sources":["../../../../src/events/models/ClientCertificateEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAyC,kBAAkB,EAAuB,kBAAkB,EAAuB,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACjP,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;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C;IAED,MAAM,KAAK,KAAK;QACd,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAED,MAAM,WAAW;IACf;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,MAA4C,EAAE,SAAsB,MAAM;QACtF,MAAM,CAAC,GAAG,IAAI,uBAAuB,CAAkB,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/G,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,MAA2B,EAAE,SAAsB,MAAM;QACrE,MAAM,CAAC,GAAG,IAAI,uBAAuB,CAAC,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9F,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransportEvents.js","sourceRoot":"","sources":["../../../../src/events/transport/TransportEvents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransportEvents.js","sourceRoot":"","sources":["../../../../src/events/transport/TransportEvents.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAoB/D,mCAAmC;AACnC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAClB;;;;;;;;WAQG;QACH,IAAI,EAAE,KAAK,EAAE,OAAqB,EAAE,aAAuC,EAAE,MAA2B,EAAE,SAAsB,MAAM,EAAoC,EAAE;YAC1K,MAAM,CAAC,GAAG,IAAI,YAAY,CAAkC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE;gBACzF,OAA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AqB,CAAC,CAAC;QACzC,CAAC;QACD;;WAEG;QACH,IAAI,EAAE,KAAK,EAAE,MAAmB,EAAgB,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { History } from './lib/History.js';
|
|
|
6
6
|
import { Url } from './lib/Url.js';
|
|
7
7
|
import { Certificates } from './lib/Certificates.js';
|
|
8
8
|
import { HostRules } from './lib/HostRules.js';
|
|
9
|
+
import { Arc } from './lib/Arc.js';
|
|
9
10
|
export { IRequestLogInit } from './lib/Request.js';
|
|
10
11
|
export { IResponseInit } from './lib/Response.js';
|
|
11
12
|
export { IUserInit } from './lib/User.js';
|
|
@@ -18,6 +19,7 @@ export declare class ProjectMock extends DataMock {
|
|
|
18
19
|
url: Url;
|
|
19
20
|
certificates: Certificates;
|
|
20
21
|
hostRules: HostRules;
|
|
22
|
+
arc: Arc;
|
|
21
23
|
/**
|
|
22
24
|
* @param init The library init options.
|
|
23
25
|
*/
|
|
@@ -6,6 +6,7 @@ import { History } from './lib/History.js';
|
|
|
6
6
|
import { Url } from './lib/Url.js';
|
|
7
7
|
import { Certificates } from './lib/Certificates.js';
|
|
8
8
|
import { HostRules } from './lib/HostRules.js';
|
|
9
|
+
import { Arc } from './lib/Arc.js';
|
|
9
10
|
export class ProjectMock extends DataMock {
|
|
10
11
|
projectRequest;
|
|
11
12
|
response;
|
|
@@ -14,6 +15,7 @@ export class ProjectMock extends DataMock {
|
|
|
14
15
|
url;
|
|
15
16
|
certificates;
|
|
16
17
|
hostRules;
|
|
18
|
+
arc;
|
|
17
19
|
/**
|
|
18
20
|
* @param init The library init options.
|
|
19
21
|
*/
|
|
@@ -26,6 +28,7 @@ export class ProjectMock extends DataMock {
|
|
|
26
28
|
this.url = new Url(init);
|
|
27
29
|
this.certificates = new Certificates(init);
|
|
28
30
|
this.hostRules = new HostRules(init);
|
|
31
|
+
this.arc = new Arc(init);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
//# sourceMappingURL=ProjectMock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectMock.js","sourceRoot":"","sources":["../../../src/mocking/ProjectMock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectMock.js","sourceRoot":"","sources":["../../../src/mocking/ProjectMock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAOnC,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACvC,cAAc,CAAU;IACxB,QAAQ,CAAW;IACnB,IAAI,CAAO;IACX,OAAO,CAAU;IACjB,GAAG,CAAM;IACT,YAAY,CAAe;IAC3B,SAAS,CAAY;IACrB,GAAG,CAAM;IAET;;OAEG;IACH,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IDataMockInit, IHttpRequestInit } from '@pawel-up/data-mock';
|
|
2
|
+
import { IArcHttpRequest } from '../../models/arc/ArcHttpRequest.js';
|
|
3
|
+
import { Request } from './Request.js';
|
|
4
|
+
export declare class Arc {
|
|
5
|
+
protected request: Request;
|
|
6
|
+
constructor(init?: IDataMockInit);
|
|
7
|
+
arcRequest(init?: IHttpRequestInit): IArcHttpRequest;
|
|
8
|
+
arcRequests(size?: number, init?: IHttpRequestInit): IArcHttpRequest[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Kind as ArcHttpRequestKind } from '../../models/arc/ArcHttpRequest.js';
|
|
2
|
+
import { Request } from './Request.js';
|
|
3
|
+
export class Arc {
|
|
4
|
+
request;
|
|
5
|
+
constructor(init = {}) {
|
|
6
|
+
this.request = new Request(init);
|
|
7
|
+
}
|
|
8
|
+
arcRequest(init) {
|
|
9
|
+
const request = this.request.request(init);
|
|
10
|
+
return {
|
|
11
|
+
key: new Date(request.created || Date.now()).toJSON(),
|
|
12
|
+
...request,
|
|
13
|
+
kind: ArcHttpRequestKind,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
arcRequests(size = 25, init) {
|
|
17
|
+
const result = [];
|
|
18
|
+
for (let i = 0; i < size; i++) {
|
|
19
|
+
result.push(this.arcRequest(init));
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Arc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Arc.js","sourceRoot":"","sources":["../../../../src/mocking/lib/Arc.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,IAAI,IAAI,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,GAAG;IACJ,OAAO,CAAU;IAE3B,YAAY,OAAoB,EAAE;QAChC,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,IAAuB;QAChC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,OAAO;YACL,GAAG,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;YACrD,GAAG,OAAO;YACV,IAAI,EAAE,kBAAkB;SACzB,CAAC;IACJ,CAAC;IAED,WAAW,CAAC,IAAI,GAAG,EAAE,EAAE,IAAuB;QAC5C,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;SACpC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -20,8 +20,11 @@ export class Certificates {
|
|
|
20
20
|
if (type === 'p12') {
|
|
21
21
|
instance = Certificate.fromP12(cert, this.lorem.word());
|
|
22
22
|
}
|
|
23
|
+
else if (type === 'pem') {
|
|
24
|
+
instance = Certificate.fromPem(cert, cert, this.lorem.word());
|
|
25
|
+
}
|
|
23
26
|
else {
|
|
24
|
-
|
|
27
|
+
throw new Error(`Invalid certificate type.`);
|
|
25
28
|
}
|
|
26
29
|
if (!opts.noPassphrase) {
|
|
27
30
|
instance.cert.passphrase = this.lorem.word();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Certificates.js","sourceRoot":"","sources":["../../../../src/mocking/lib/Certificates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAmB,WAAW,EAAoB,MAAM,mCAAmC,CAAC;AAQnG,MAAM,OAAO,YAAY;IACvB,KAAK,CAAQ;IACb,KAAK,CAAQ;IACb,MAAM,CAAS;IAEf,YAAY,OAAoB,EAAE;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,OAA8B,EAAE;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,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AAI,CAAC,CAAC;SAChD;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Http, Types, Lorem, Time } from '@pawel-up/data-mock';
|
|
2
2
|
// import { randomValue } from '@pawel-up/data-mock/src/lib/Http.js';
|
|
3
3
|
import { Kind as HttpRequestKind } from '../../models/HttpRequest.js';
|
|
4
|
-
import { Kind as RequestKind } from '../../models/Request.js';
|
|
4
|
+
import { Kind as RequestKind, Request as RequestModel } from '../../models/Request.js';
|
|
5
5
|
import { Kind as RequestLogKind } from '../../models/RequestLog.js';
|
|
6
6
|
import { Response } from './Response.js';
|
|
7
7
|
export class Request {
|
|
@@ -18,14 +18,17 @@ export class Request {
|
|
|
18
18
|
this.response = new Response(init);
|
|
19
19
|
}
|
|
20
20
|
request(init) {
|
|
21
|
-
|
|
21
|
+
const schema = {
|
|
22
22
|
kind: RequestKind,
|
|
23
23
|
expects: this.httpRequest(init),
|
|
24
24
|
info: {
|
|
25
25
|
name: this.lorem.words(2),
|
|
26
26
|
description: this.lorem.paragraph(),
|
|
27
27
|
},
|
|
28
|
+
created: this.time.timestamp(),
|
|
28
29
|
};
|
|
30
|
+
const instance = new RequestModel(schema);
|
|
31
|
+
return instance.toJSON();
|
|
29
32
|
}
|
|
30
33
|
httpRequest(init) {
|
|
31
34
|
const request = this.http.request.request(init);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.js","sourceRoot":"","sources":["../../../../src/mocking/lib/Request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAmC,MAAM,qBAAqB,CAAC;AAChG,qEAAqE;AACrE,OAAO,EAAgB,IAAI,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAY,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Request.js","sourceRoot":"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CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;SACpC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -62,7 +62,7 @@ export interface IPemCertificate extends ICertificate {
|
|
|
62
62
|
*/
|
|
63
63
|
certKey: ICertificateData;
|
|
64
64
|
}
|
|
65
|
-
export declare type HttpCertificate = IP12Certificate | IPemCertificate;
|
|
65
|
+
export declare type HttpCertificate = IP12Certificate | IPemCertificate | ICertificate;
|
|
66
66
|
export interface IPemCreateOptions {
|
|
67
67
|
type: 'p12';
|
|
68
68
|
/**
|
|
@@ -115,7 +115,7 @@ export declare class Certificate {
|
|
|
115
115
|
* Timestamp when the certificate was inserted into the data store.
|
|
116
116
|
* Required when returning a result. Auto-generated when inserting, if missing.
|
|
117
117
|
*/
|
|
118
|
-
created
|
|
118
|
+
created: number;
|
|
119
119
|
/**
|
|
120
120
|
* Certificate type. Either `p12` or `pem`.
|
|
121
121
|
*/
|
|
@@ -18,7 +18,7 @@ export class Certificate {
|
|
|
18
18
|
* Timestamp when the certificate was inserted into the data store.
|
|
19
19
|
* Required when returning a result. Auto-generated when inserting, if missing.
|
|
20
20
|
*/
|
|
21
|
-
created;
|
|
21
|
+
created = 0;
|
|
22
22
|
/**
|
|
23
23
|
* Certificate type. Either `p12` or `pem`.
|
|
24
24
|
*/
|
|
@@ -51,6 +51,7 @@ export class Certificate {
|
|
|
51
51
|
key: v4(),
|
|
52
52
|
name,
|
|
53
53
|
type: 'pem',
|
|
54
|
+
created: Date.now(),
|
|
54
55
|
};
|
|
55
56
|
if (keyPassphrase) {
|
|
56
57
|
init.certKey.passphrase = keyPassphrase;
|
|
@@ -73,6 +74,7 @@ export class Certificate {
|
|
|
73
74
|
key: v4(),
|
|
74
75
|
name,
|
|
75
76
|
type: 'p12',
|
|
77
|
+
created: Date.now(),
|
|
76
78
|
};
|
|
77
79
|
if (passphrase) {
|
|
78
80
|
init.cert.passphrase = passphrase;
|
|
@@ -112,22 +114,22 @@ export class Certificate {
|
|
|
112
114
|
key: _id,
|
|
113
115
|
name,
|
|
114
116
|
type: 'p12',
|
|
117
|
+
created,
|
|
115
118
|
};
|
|
116
119
|
return new Certificate(init);
|
|
117
120
|
}
|
|
118
121
|
throw new Error(`Unable to create a certificate. Unknown type: ${type}.`);
|
|
119
122
|
}
|
|
120
123
|
constructor(certificate) {
|
|
121
|
-
const { type, cert, key = v4(), name = '', created } = certificate;
|
|
124
|
+
const { type, cert, key = v4(), name = '', created = Date.now() } = certificate;
|
|
122
125
|
this.key = key;
|
|
123
126
|
this.name = name;
|
|
124
127
|
this.type = type;
|
|
125
128
|
this.cert = Certificate.fromStore(cert);
|
|
126
|
-
|
|
127
|
-
this.created = created;
|
|
128
|
-
}
|
|
129
|
+
this.created = created;
|
|
129
130
|
if (type === 'pem') {
|
|
130
|
-
|
|
131
|
+
const typed = certificate;
|
|
132
|
+
this.certKey = Certificate.fromStore(typed.certKey);
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
/**
|
|
@@ -177,7 +179,8 @@ export class Certificate {
|
|
|
177
179
|
key: this.key,
|
|
178
180
|
cert: Certificate.toStore(this.cert),
|
|
179
181
|
name: this.name,
|
|
180
|
-
type:
|
|
182
|
+
type: this.type,
|
|
183
|
+
created: this.created,
|
|
181
184
|
};
|
|
182
185
|
if (this.type === 'pem' && this.certKey) {
|
|
183
186
|
const typed = result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientCertificate.js","sourceRoot":"","sources":["../../../src/models/ClientCertificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKhC,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC;AA2GvC;;GAEG;AACH,MAAM,OAAO,WAAW;IACtB,IAAI,GAAG,IAAI,CAAC;IACZ;;OAEG;IACH,GAAG,CAAS;IACZ;;OAEG;IACH,IAAI,CAAS;IACb;;;OAGG;IACH,OAAO,
|
|
1
|
+
{"version":3,"file":"ClientCertificate.js","sourceRoot":"","sources":["../../../src/models/ClientCertificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKhC,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC;AA2GvC;;GAEG;AACH,MAAM,OAAO,WAAW;IACtB,IAAI,GAAG,IAAI,CAAC;IACZ;;OAEG;IACH,GAAG,CAAS;IACZ;;OAEG;IACH,IAAI,CAAS;IACb;;;OAGG;IACH,OAAO,GAAG,CAAC,CAAC;IACZ;;OAEG;IACH,IAAI,CAAkB;IACtB;;OAEG;IACH,IAAI,CAAmB;IACvB;;OAEG;IACH,OAAO,CAAoB;IAE3B;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,CAAC,GAA0B,EAAE,GAA0B,EAAE,IAAI,GAAG,qBAAqB,EAAE,aAAsB;QACzH,MAAM,IAAI,GAAoB;YAC5B,IAAI,EAAE,IAAI;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,GAAG;aACV;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;YACD,GAAG,EAAE,EAAE,EAAE;YACT,IAAI;YACJ,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;SACpB,CAAC;QACF,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC;SACzC;QACD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,IAA2B,EAAE,IAAI,GAAG,qBAAqB,EAAE,UAAmB;QAC3F,MAAM,IAAI,GAAoB;YAC5B,IAAI,EAAE,IAAI;Y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