Skip to content

Commit 9d9e471

Browse files
committed
deploy: 65c52ac
1 parent cb0f456 commit 9d9e471

File tree

13 files changed

+245
-185
lines changed

13 files changed

+245
-185
lines changed

classes/IdentitiesUpsertService.html

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,15 @@ <h3 id="methods">
483483
<tr>
484484
<td class="col-md-4">
485485
<span class="modifier-icon icon ion-ios-reset"></span>
486-
<code>checkFingerprint(filters: FilterQuery<T>, fingerprint: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
486+
<code>checkFingerprint(filters: FilterQuery<T>, fingerprint: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, extra: literal type)</code>
487487
</td>
488488
</tr>
489489

490490

491491
<tr>
492492
<td class="col-md-4">
493-
<div class="io-line">Defined in <a href="" data-line="103"
494-
class="link-to-prism">src/management/identities/identities-upsert.service.ts:103</a></div>
493+
<div class="io-line">Defined in <a href="" data-line="108"
494+
class="link-to-prism">src/management/identities/identities-upsert.service.ts:108</a></div>
495495
</td>
496496
</tr>
497497

@@ -516,6 +516,7 @@ <h3 id="methods">
516516
<td>Name</td>
517517
<td>Type</td>
518518
<td>Optional</td>
519+
<td>Default value</td>
519520
</tr>
520521
</thead>
521522
<tbody>
@@ -529,6 +530,8 @@ <h3 id="methods">
529530
No
530531
</td>
531532

533+
<td>
534+
</td>
532535

533536
</tr>
534537
<tr>
@@ -541,6 +544,23 @@ <h3 id="methods">
541544
No
542545
</td>
543546

547+
<td>
548+
</td>
549+
550+
</tr>
551+
<tr>
552+
<td>extra</td>
553+
<td>
554+
<code>literal type</code>
555+
</td>
556+
557+
<td>
558+
No
559+
</td>
560+
561+
<td>
562+
<code>{ force: false }</code>
563+
</td>
544564

545565
</tr>
546566
</tbody>
@@ -573,7 +593,7 @@ <h3 id="methods">
573593
<tr>
574594
<td class="col-md-4">
575595
<span class="modifier-icon icon ion-ios-reset"></span>
576-
<code>upsertWithFingerprint(filters: FilterQuery<T>, data?: <a href="../classes/IdentitiesUpsertDto.html" target="_self">IdentitiesUpsertDto</a>, options?: QueryOptions<T>)</code>
596+
<code>upsertWithFingerprint(filters: FilterQuery<T>, data?: <a href="../classes/IdentitiesUpsertDto.html" target="_self">IdentitiesUpsertDto</a>, options?: QueryOptions<T>, extra?: literal type)</code>
577597
</td>
578598
</tr>
579599

@@ -644,6 +664,18 @@ <h3 id="methods">
644664
</td>
645665

646666

667+
</tr>
668+
<tr>
669+
<td>extra</td>
670+
<td>
671+
<code>literal type</code>
672+
</td>
673+
674+
<td>
675+
Yes
676+
</td>
677+
678+
647679
</tr>
648680
</tbody>
649681
</table>
@@ -2298,7 +2330,12 @@ <h3 id="methods">
22982330
filters: FilterQuery&lt;T&gt;,
22992331
data?: IdentitiesUpsertDto,
23002332
options?: QueryOptions&lt;T&gt;,
2333+
extra?: { force?: boolean },
23012334
): Promise&lt;[HttpStatus.OK | HttpStatus.CREATED, ModifyResult&lt;Query&lt;T, T, any, T&gt;&gt;]&gt; {
2335+
extra &#x3D; {
2336+
force: false,
2337+
...extra,
2338+
}
23022339
data &#x3D; this.transformNullsToString(data);
23032340
const identity &#x3D; await this.model.findOne&lt;Identities&gt;(filters).exec();
23042341
this.logger.log(&#x60;Upserting identity with filters ${JSON.stringify(filters)}&#x60;);
@@ -2350,7 +2387,7 @@ <h3 id="methods">
23502387
}),
23512388
);
23522389

2353-
await this.checkFingerprint(filters, fingerprint);
2390+
await this.checkFingerprint(filters, fingerprint, extra);
23542391

23552392
this.logger.verbose(&#x27;identities upsert data: &#x27; + JSON.stringify({
23562393
$setOnInsert: {
@@ -2388,7 +2425,11 @@ <h3 id="methods">
23882425
public async checkFingerprint&lt;T extends AbstractSchema | Document&gt;(
23892426
filters: FilterQuery&lt;T&gt;,
23902427
fingerprint: string,
2428+
extra: { force?: boolean } &#x3D; { force: false },
23912429
): Promise&lt;void&gt; {
2430+
if (extra.force) {
2431+
return;
2432+
}
23922433
const identity &#x3D; await this.model
23932434
.findOne(
23942435
{ ...filters, fingerprint },

controllers/IdentitiesUpsertController.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ <h3 id="methods">
195195
<tr>
196196
<td class="col-md-4">
197197
<span class="modifier-icon icon ion-ios-reset"></span>
198-
<code>upsert(res: Response, body: <a href="../classes/IdentitiesUpsertDto.html" target="_self">IdentitiesUpsertDto</a>, filtersQuery: literal type[], errorOnNotFound: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, upsert: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
198+
<code>upsert(res: Response, body: <a href="../classes/IdentitiesUpsertDto.html" target="_self">IdentitiesUpsertDto</a>, filtersQuery: literal type[], forceString: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, errorOnNotFound: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, upsert: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
199199
</td>
200200
</tr>
201201

@@ -273,6 +273,20 @@ <h3 id="methods">
273273
<code>[]</code>
274274
</td>
275275

276+
</tr>
277+
<tr>
278+
<td>forceString</td>
279+
<td>
280+
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
281+
</td>
282+
283+
<td>
284+
No
285+
</td>
286+
287+
<td>
288+
</td>
289+
276290
</tr>
277291
<tr>
278292
<td>errorOnNotFound</td>
@@ -351,8 +365,8 @@ <h3 id="methods">
351365

352366
<tr>
353367
<td class="col-md-4">
354-
<div class="io-line">Defined in <a href="" data-line="113"
355-
class="link-to-prism">src/management/identities/identities-upsert.controller.ts:113</a></div>
368+
<div class="io-line">Defined in <a href="" data-line="118"
369+
class="link-to-prism">src/management/identities/identities-upsert.controller.ts:118</a></div>
356370
</td>
357371
</tr>
358372

@@ -505,6 +519,7 @@ <h3 id="methods">
505519
filtersQuery: {
506520
[key: string]: string;
507521
}[] &#x3D; [],
522+
@Query(&#x27;force&#x27;) forceString: string,
508523
@Query(&#x27;errorOnNotFound&#x27;) errorOnNotFound: string &#x3D; &#x27;false&#x27;,
509524
@Query(&#x27;upsert&#x27;) upsert: string &#x3D; &#x27;true&#x27;,
510525
): Promise&lt;
@@ -515,6 +530,10 @@ <h3 id="methods">
515530
validations?: MixedValue;
516531
}&gt;
517532
&gt; {
533+
const force &#x3D; /true|on|yes|1/i.test(forceString);
534+
if (force) {
535+
this.logger.warn(&#x27;Upserting with force mode enabled.&#x27;);
536+
}
518537
const filters &#x3D; {};
519538
if (filtersQuery.length &#x3D;&#x3D;&#x3D; 0) {
520539
throw new BadRequestException(&#x27;Missing filters array&#x27;);
@@ -528,7 +547,7 @@ <h3 id="methods">
528547
const [code, data] &#x3D; await this._service.upsertWithFingerprint&lt;Identities&gt;(filters, body, {
529548
errorOnNotFound: /true|on|yes|1/i.test(errorOnNotFound),
530549
upsert: /true|on|yes|1/i.test(upsert),
531-
});
550+
}, {force});
532551

533552
// If the state is TO_COMPLETE, the identity is created but additional fields are missing or invalid
534553
// Else the state is TO_VALIDATE, we return a 201 status code

js/search/search_index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/BackendsModule.html

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -119,93 +119,93 @@
119119
</g>
120120
<g id="clust4" class="cluster">
121121
<title>cluster_BackendsModule_exports</title>
122-
<polygon fill="none" stroke="black" points="226,-208 226,-260 358,-260 358,-208 226,-208"/>
123-
</g>
124-
<g id="clust6" class="cluster">
125-
<title>cluster_BackendsModule_providers</title>
126-
<polygon fill="none" stroke="black" points="481,-78 481,-130 653,-130 653,-78 481,-78"/>
122+
<polygon fill="none" stroke="black" points="290,-208 290,-260 422,-260 422,-208 290,-208"/>
127123
</g>
128124
<g id="clust3" class="cluster">
129125
<title>cluster_BackendsModule_imports</title>
130-
<polygon fill="none" stroke="black" points="16,-78 16,-130 473,-130 473,-78 16,-78"/>
126+
<polygon fill="none" stroke="black" points="196,-78 196,-130 653,-130 653,-78 196,-78"/>
127+
</g>
128+
<g id="clust6" class="cluster">
129+
<title>cluster_BackendsModule_providers</title>
130+
<polygon fill="none" stroke="black" points="16,-78 16,-130 188,-130 188,-78 16,-78"/>
131131
</g>
132132
<!-- AgentsModule -->
133133
<g id="node1" class="node">
134134
<title>AgentsModule</title>
135-
<polygon fill="#8dd3c7" stroke="black" points="464.71,-122 461.71,-126 440.71,-126 437.71,-122 365.29,-122 365.29,-86 464.71,-86 464.71,-122"/>
136-
<text text-anchor="middle" x="415" y="-99.8" font-family="Times,serif" font-size="14.00">AgentsModule</text>
135+
<polygon fill="#8dd3c7" stroke="black" points="644.71,-122 641.71,-126 620.71,-126 617.71,-122 545.29,-122 545.29,-86 644.71,-86 644.71,-122"/>
136+
<text text-anchor="middle" x="595" y="-99.8" font-family="Times,serif" font-size="14.00">AgentsModule</text>
137137
</g>
138138
<!-- BackendsModule -->
139139
<g id="node5" class="node">
140140
<title>BackendsModule</title>
141-
<polygon fill="#8dd3c7" stroke="black" points="348.97,-187 345.97,-191 324.97,-191 321.97,-187 235.03,-187 235.03,-151 348.97,-151 348.97,-187"/>
142-
<text text-anchor="middle" x="292" y="-164.8" font-family="Times,serif" font-size="14.00">BackendsModule</text>
141+
<polygon fill="#8dd3c7" stroke="black" points="412.97,-187 409.97,-191 388.97,-191 385.97,-187 299.03,-187 299.03,-151 412.97,-151 412.97,-187"/>
142+
<text text-anchor="middle" x="356" y="-164.8" font-family="Times,serif" font-size="14.00">BackendsModule</text>
143143
</g>
144144
<!-- AgentsModule&#45;&gt;BackendsModule -->
145145
<g id="edge1" class="edge">
146146
<title>AgentsModule&#45;&gt;BackendsModule</title>
147-
<path fill="none" stroke="black" d="M415,-122.02C415,-139.37 415,-163 415,-163 415,-163 359.18,-163 359.18,-163"/>
148-
<polygon fill="black" stroke="black" points="359.18,-159.5 349.18,-163 359.18,-166.5 359.18,-159.5"/>
147+
<path fill="none" stroke="black" d="M595,-122.11C595,-141.34 595,-169 595,-169 595,-169 423.25,-169 423.25,-169"/>
148+
<polygon fill="black" stroke="black" points="423.25,-165.5 413.25,-169 423.25,-172.5 423.25,-165.5"/>
149149
</g>
150150
<!-- IdentitiesModule -->
151151
<g id="node2" class="node">
152152
<title>IdentitiesModule</title>
153-
<polygon fill="#8dd3c7" stroke="black" points="347.65,-122 344.65,-126 323.65,-126 320.65,-122 236.35,-122 236.35,-86 347.65,-86 347.65,-122"/>
154-
<text text-anchor="middle" x="292" y="-99.8" font-family="Times,serif" font-size="14.00">IdentitiesModule</text>
153+
<polygon fill="#8dd3c7" stroke="black" points="527.65,-122 524.65,-126 503.65,-126 500.65,-122 416.35,-122 416.35,-86 527.65,-86 527.65,-122"/>
154+
<text text-anchor="middle" x="472" y="-99.8" font-family="Times,serif" font-size="14.00">IdentitiesModule</text>
155155
</g>
156156
<!-- IdentitiesModule&#45;&gt;BackendsModule -->
157157
<g id="edge2" class="edge">
158158
<title>IdentitiesModule&#45;&gt;BackendsModule</title>
159-
<path fill="none" stroke="black" d="M292,-122.11C292,-122.11 292,-140.99 292,-140.99"/>
160-
<polygon fill="black" stroke="black" points="288.5,-140.99 292,-150.99 295.5,-140.99 288.5,-140.99"/>
159+
<path fill="none" stroke="black" d="M416.27,-104C409.88,-104 405.6,-104 405.6,-104 405.6,-104 405.6,-140.89 405.6,-140.89"/>
160+
<polygon fill="black" stroke="black" points="402.1,-140.89 405.6,-150.89 409.1,-140.89 402.1,-140.89"/>
161161
</g>
162162
<!-- JobsModule -->
163163
<g id="node3" class="node">
164164
<title>JobsModule</title>
165-
<polygon fill="#8dd3c7" stroke="black" points="218.44,-122 215.44,-126 194.44,-126 191.44,-122 133.56,-122 133.56,-86 218.44,-86 218.44,-122"/>
166-
<text text-anchor="middle" x="176" y="-99.8" font-family="Times,serif" font-size="14.00">JobsModule</text>
165+
<polygon fill="#8dd3c7" stroke="black" points="398.44,-122 395.44,-126 374.44,-126 371.44,-122 313.56,-122 313.56,-86 398.44,-86 398.44,-122"/>
166+
<text text-anchor="middle" x="356" y="-99.8" font-family="Times,serif" font-size="14.00">JobsModule</text>
167167
</g>
168168
<!-- JobsModule&#45;&gt;BackendsModule -->
169169
<g id="edge3" class="edge">
170170
<title>JobsModule&#45;&gt;BackendsModule</title>
171-
<path fill="none" stroke="black" d="M176,-122.02C176,-139.37 176,-163 176,-163 176,-163 225.02,-163 225.02,-163"/>
172-
<polygon fill="black" stroke="black" points="225.02,-166.5 235.02,-163 225.02,-159.5 225.02,-166.5"/>
171+
<path fill="none" stroke="black" d="M356,-122.11C356,-122.11 356,-140.99 356,-140.99"/>
172+
<polygon fill="black" stroke="black" points="352.5,-140.99 356,-150.99 359.5,-140.99 352.5,-140.99"/>
173173
</g>
174174
<!-- TasksModule -->
175175
<g id="node4" class="node">
176176
<title>TasksModule</title>
177-
<polygon fill="#8dd3c7" stroke="black" points="116.21,-122 113.21,-126 92.21,-126 89.21,-122 23.79,-122 23.79,-86 116.21,-86 116.21,-122"/>
178-
<text text-anchor="middle" x="70" y="-99.8" font-family="Times,serif" font-size="14.00">TasksModule</text>
177+
<polygon fill="#8dd3c7" stroke="black" points="296.21,-122 293.21,-126 272.21,-126 269.21,-122 203.79,-122 203.79,-86 296.21,-86 296.21,-122"/>
178+
<text text-anchor="middle" x="250" y="-99.8" font-family="Times,serif" font-size="14.00">TasksModule</text>
179179
</g>
180180
<!-- TasksModule&#45;&gt;BackendsModule -->
181181
<g id="edge4" class="edge">
182182
<title>TasksModule&#45;&gt;BackendsModule</title>
183-
<path fill="none" stroke="black" d="M70,-122.28C70,-143.32 70,-175 70,-175 70,-175 224.83,-175 224.83,-175"/>
184-
<polygon fill="black" stroke="black" points="224.83,-178.5 234.83,-175 224.83,-171.5 224.83,-178.5"/>
183+
<path fill="none" stroke="black" d="M296.31,-104C302.3,-104 306.4,-104 306.4,-104 306.4,-104 306.4,-140.89 306.4,-140.89"/>
184+
<polygon fill="black" stroke="black" points="302.9,-140.89 306.4,-150.89 309.9,-140.89 302.9,-140.89"/>
185185
</g>
186186
<!-- BackendsService -->
187187
<g id="node6" class="node">
188188
<title>BackendsService </title>
189-
<polygon fill="#fb8072" stroke="black" points="349.9,-252 234.1,-252 234.1,-216 349.9,-216 349.9,-252"/>
190-
<text text-anchor="middle" x="292" y="-229.8" font-family="Times,serif" font-size="14.00">BackendsService </text>
189+
<polygon fill="#fb8072" stroke="black" points="413.9,-252 298.1,-252 298.1,-216 413.9,-216 413.9,-252"/>
190+
<text text-anchor="middle" x="356" y="-229.8" font-family="Times,serif" font-size="14.00">BackendsService </text>
191191
</g>
192192
<!-- BackendsModule&#45;&gt;BackendsService -->
193193
<g id="edge5" class="edge">
194194
<title>BackendsModule&#45;&gt;BackendsService </title>
195-
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M292,-187.11C292,-187.11 292,-205.99 292,-205.99"/>
196-
<polygon fill="black" stroke="black" points="288.5,-205.99 292,-215.99 295.5,-205.99 288.5,-205.99"/>
195+
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M356,-187.11C356,-187.11 356,-205.99 356,-205.99"/>
196+
<polygon fill="black" stroke="black" points="352.5,-205.99 356,-215.99 359.5,-205.99 352.5,-205.99"/>
197197
</g>
198198
<!-- BackendsService -->
199199
<g id="node7" class="node">
200200
<title>BackendsService</title>
201-
<ellipse fill="#fdb462" stroke="black" cx="567" cy="-104" rx="77.57" ry="18"/>
202-
<text text-anchor="middle" x="567" y="-99.8" font-family="Times,serif" font-size="14.00">BackendsService</text>
201+
<ellipse fill="#fdb462" stroke="black" cx="102" cy="-104" rx="77.57" ry="18"/>
202+
<text text-anchor="middle" x="102" y="-99.8" font-family="Times,serif" font-size="14.00">BackendsService</text>
203203
</g>
204204
<!-- BackendsService&#45;&gt;BackendsModule -->
205205
<g id="edge6" class="edge">
206206
<title>BackendsService&#45;&gt;BackendsModule</title>
207-
<path fill="none" stroke="black" d="M567,-122.28C567,-143.32 567,-175 567,-175 567,-175 358.98,-175 358.98,-175"/>
208-
<polygon fill="black" stroke="black" points="358.98,-171.5 348.98,-175 358.98,-178.5 358.98,-171.5"/>
207+
<path fill="none" stroke="black" d="M102,-122.11C102,-141.34 102,-169 102,-169 102,-169 289,-169 289,-169"/>
208+
<polygon fill="black" stroke="black" points="289,-172.5 299,-169 289,-165.5 289,-172.5"/>
209209
</g>
210210
</g>
211211
</svg>

0 commit comments

Comments
 (0)