@yadsh/dsh-qa-integrations 0.6.0 → 0.7.0
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/README.md +309 -288
- package/lib/broker.js +12 -0
- package/lib/broker.js.map +1 -1
- package/lib/client/bitrix24.js +66 -5
- package/lib/client/bitrix24.js.map +1 -1
- package/lib/client/confluence.js +97 -129
- package/lib/client/confluence.js.map +1 -1
- package/lib/client/gitlab.js +1 -1
- package/lib/client/gitlab.js.map +1 -1
- package/lib/client/index.js +25 -5
- package/lib/client/index.js.map +1 -1
- package/lib/client/integrations.js +1 -1
- package/lib/client/integrations.js.map +1 -1
- package/lib/client/jira.js +95 -127
- package/lib/client/jira.js.map +1 -1
- package/lib/client/operator-card.js +537 -0
- package/lib/client/operator-card.js.map +1 -0
- package/lib/client/operator-controls.js +232 -0
- package/lib/client/operator-controls.js.map +1 -0
- package/lib/client/styles.js +60 -0
- package/lib/client/styles.js.map +1 -1
- package/lib/client/testit.js +39 -3
- package/lib/client/testit.js.map +1 -1
- package/lib/client/weblate.js +38 -3
- package/lib/client/weblate.js.map +1 -1
- package/lib/client.js +2825 -785
- package/lib/client.js.map +1 -1
- package/lib/index.js +192 -51
- package/lib/index.js.map +1 -1
- package/lib/providers/bitrix24/catalog.js +138 -8
- package/lib/providers/bitrix24/catalog.js.map +1 -1
- package/lib/providers/bitrix24/config.js +85 -14
- package/lib/providers/bitrix24/config.js.map +1 -1
- package/lib/providers/bitrix24/index.js +113 -0
- package/lib/providers/bitrix24/index.js.map +1 -1
- package/lib/providers/confluence/catalog.js +51 -3
- package/lib/providers/confluence/catalog.js.map +1 -1
- package/lib/providers/confluence/index.js +293 -35
- package/lib/providers/confluence/index.js.map +1 -1
- package/lib/providers/confluence/operations.js +1 -1
- package/lib/providers/confluence/operations.js.map +1 -1
- package/lib/providers/jira/catalog.js +73 -3
- package/lib/providers/jira/catalog.js.map +1 -1
- package/lib/providers/jira/index.js +266 -12
- package/lib/providers/jira/index.js.map +1 -1
- package/lib/providers/testit/catalog.js +77 -0
- package/lib/providers/testit/catalog.js.map +1 -1
- package/lib/providers/testit/index.js +277 -3
- package/lib/providers/testit/index.js.map +1 -1
- package/lib/providers/weblate/catalog.js +103 -9
- package/lib/providers/weblate/catalog.js.map +1 -1
- package/lib/providers/weblate/index.js +243 -5
- package/lib/providers/weblate/index.js.map +1 -1
- package/lib/shared/settings.js +14 -0
- package/lib/shared/settings.js.map +1 -0
- package/lib/typert.host.js +148 -56
- package/lib/typert.remote-client.d.ts +13 -11
- package/lib/typert.remote-client.js +89 -50
- package/lib/types/broker.d.ts +11 -3
- package/lib/types/client/bitrix24.d.ts +24 -2
- package/lib/types/client/confluence.d.ts +19 -3
- package/lib/types/client/index.d.ts +7 -6
- package/lib/types/client/integrations.d.ts +2 -2
- package/lib/types/client/jira.d.ts +20 -3
- package/lib/types/client/operator-card.d.ts +22 -0
- package/lib/types/client/operator-controls.d.ts +135 -0
- package/lib/types/client/testit.d.ts +14 -1
- package/lib/types/client/weblate.d.ts +14 -1
- package/lib/types/index.d.ts +81 -13
- package/lib/types/providers/bitrix24/catalog.d.ts +8 -0
- package/lib/types/providers/bitrix24/config.d.ts +14 -23
- package/lib/types/providers/bitrix24/index.d.ts +36 -1
- package/lib/types/providers/confluence/catalog.d.ts +11 -3
- package/lib/types/providers/confluence/index.d.ts +61 -7
- package/lib/types/providers/confluence/operations.d.ts +2 -0
- package/lib/types/providers/jira/catalog.d.ts +13 -0
- package/lib/types/providers/jira/index.d.ts +48 -1
- package/lib/types/providers/testit/catalog.d.ts +12 -0
- package/lib/types/providers/testit/index.d.ts +61 -2
- package/lib/types/providers/weblate/catalog.d.ts +19 -2
- package/lib/types/providers/weblate/index.d.ts +43 -1
- package/lib/types/shared/settings.d.ts +14 -0
- package/package.json +4 -4
package/lib/client.js
CHANGED
|
@@ -4843,6 +4843,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4843
4843
|
}
|
|
4844
4844
|
//#endregion
|
|
4845
4845
|
//#region lib/typert.remote-client.js
|
|
4846
|
+
const _yadsh_dsh_qa_integrations_qaIntegrations_bitrix24Instances_parameter_0$schema = string();
|
|
4847
|
+
const _yadsh_dsh_qa_integrations_qaIntegrations_bitrix24Instances_result$schema = array(object({
|
|
4848
|
+
"id": string().readonly(),
|
|
4849
|
+
"label": string().readonly(),
|
|
4850
|
+
"baseUrl": string().readonly(),
|
|
4851
|
+
"service": union([literal(null), object({ "label": string().readonly() })]).readonly()
|
|
4852
|
+
}));
|
|
4846
4853
|
const _yadsh_dsh_qa_integrations_qaIntegrations_confluenceSites_parameter_0$schema = string();
|
|
4847
4854
|
const _yadsh_dsh_qa_integrations_qaIntegrations_confluenceSites_result$schema = array(object({
|
|
4848
4855
|
"id": string().readonly(),
|
|
@@ -5673,8 +5680,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5673
5680
|
}));
|
|
5674
5681
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putBitrix24Credential_parameter_0$schema = string();
|
|
5675
5682
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putBitrix24Credential_parameter_1$schema = object({
|
|
5683
|
+
"instanceId": string().readonly(),
|
|
5676
5684
|
"token": string().readonly(),
|
|
5677
|
-
"
|
|
5685
|
+
"useServiceCredential": union([
|
|
5686
|
+
_undefined(),
|
|
5687
|
+
literal(false),
|
|
5688
|
+
literal(true)
|
|
5689
|
+
]).readonly().optional()
|
|
5678
5690
|
});
|
|
5679
5691
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putBitrix24Credential_result$schema = object({
|
|
5680
5692
|
"provider": string().readonly(),
|
|
@@ -5722,7 +5734,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5722
5734
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putConfluenceCredential_parameter_1$schema = object({
|
|
5723
5735
|
"instanceId": string().readonly(),
|
|
5724
5736
|
"email": string().readonly(),
|
|
5725
|
-
"token": string().readonly()
|
|
5737
|
+
"token": string().readonly(),
|
|
5738
|
+
"useServiceCredential": union([
|
|
5739
|
+
_undefined(),
|
|
5740
|
+
literal(false),
|
|
5741
|
+
literal(true)
|
|
5742
|
+
]).readonly().optional()
|
|
5726
5743
|
});
|
|
5727
5744
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putConfluenceCredential_result$schema = object({
|
|
5728
5745
|
"provider": string().readonly(),
|
|
@@ -5822,7 +5839,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5822
5839
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putJiraCredential_parameter_1$schema = object({
|
|
5823
5840
|
"siteId": string().readonly(),
|
|
5824
5841
|
"email": string().readonly(),
|
|
5825
|
-
"token": string().readonly()
|
|
5842
|
+
"token": string().readonly(),
|
|
5843
|
+
"useServiceCredential": union([
|
|
5844
|
+
_undefined(),
|
|
5845
|
+
literal(false),
|
|
5846
|
+
literal(true)
|
|
5847
|
+
]).readonly().optional()
|
|
5826
5848
|
});
|
|
5827
5849
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putJiraCredential_result$schema = object({
|
|
5828
5850
|
"provider": string().readonly(),
|
|
@@ -5920,7 +5942,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5920
5942
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putTestitCredential_parameter_0$schema = string();
|
|
5921
5943
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putTestitCredential_parameter_1$schema = object({
|
|
5922
5944
|
"instanceId": string().readonly(),
|
|
5923
|
-
"token": string().readonly()
|
|
5945
|
+
"token": string().readonly(),
|
|
5946
|
+
"useServiceCredential": union([
|
|
5947
|
+
_undefined(),
|
|
5948
|
+
literal(false),
|
|
5949
|
+
literal(true)
|
|
5950
|
+
]).readonly().optional()
|
|
5924
5951
|
});
|
|
5925
5952
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putTestitCredential_result$schema = object({
|
|
5926
5953
|
"provider": string().readonly(),
|
|
@@ -5967,7 +5994,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5967
5994
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putWeblateCredential_parameter_0$schema = string();
|
|
5968
5995
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putWeblateCredential_parameter_1$schema = object({
|
|
5969
5996
|
"instanceId": string().readonly(),
|
|
5970
|
-
"token": string().readonly()
|
|
5997
|
+
"token": string().readonly(),
|
|
5998
|
+
"useServiceCredential": union([
|
|
5999
|
+
_undefined(),
|
|
6000
|
+
literal(false),
|
|
6001
|
+
literal(true)
|
|
6002
|
+
]).readonly().optional()
|
|
5971
6003
|
});
|
|
5972
6004
|
const _yadsh_dsh_qa_integrations_qaIntegrations_putWeblateCredential_result$schema = object({
|
|
5973
6005
|
"provider": string().readonly(),
|
|
@@ -6403,6 +6435,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6403
6435
|
const TYPERT_REMOTE = {
|
|
6404
6436
|
package: "@yadsh/dsh-qa-integrations",
|
|
6405
6437
|
descriptors: [
|
|
6438
|
+
{
|
|
6439
|
+
id: "@yadsh/dsh-qa-integrations#qaIntegrations/bitrix24Instances",
|
|
6440
|
+
service: "qaIntegrations",
|
|
6441
|
+
namespace: "qaIntegrations",
|
|
6442
|
+
method: "bitrix24Instances",
|
|
6443
|
+
invocation: { kind: "direct" },
|
|
6444
|
+
parameters: [{
|
|
6445
|
+
name: "token",
|
|
6446
|
+
wire: "token",
|
|
6447
|
+
source: "json",
|
|
6448
|
+
codec: {
|
|
6449
|
+
mode: "strict",
|
|
6450
|
+
typeSymbol: "@yadsh/dsh-qa-integrations#qaIntegrations/bitrix24Instances:token",
|
|
6451
|
+
schema: _yadsh_dsh_qa_integrations_qaIntegrations_bitrix24Instances_parameter_0$schema
|
|
6452
|
+
}
|
|
6453
|
+
}],
|
|
6454
|
+
result: {
|
|
6455
|
+
mode: "strict",
|
|
6456
|
+
typeSymbol: "@yadsh/dsh-qa-integrations#qaIntegrations/bitrix24Instances:result",
|
|
6457
|
+
schema: _yadsh_dsh_qa_integrations_qaIntegrations_bitrix24Instances_result$schema
|
|
6458
|
+
},
|
|
6459
|
+
sourceLocation: {
|
|
6460
|
+
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6461
|
+
"line": 488,
|
|
6462
|
+
"column": 3
|
|
6463
|
+
}
|
|
6464
|
+
},
|
|
6406
6465
|
{
|
|
6407
6466
|
id: "@yadsh/dsh-qa-integrations#qaIntegrations/confluenceSites",
|
|
6408
6467
|
service: "qaIntegrations",
|
|
@@ -6426,7 +6485,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6426
6485
|
},
|
|
6427
6486
|
sourceLocation: {
|
|
6428
6487
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6429
|
-
"line":
|
|
6488
|
+
"line": 580,
|
|
6430
6489
|
"column": 3
|
|
6431
6490
|
}
|
|
6432
6491
|
},
|
|
@@ -6462,7 +6521,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6462
6521
|
},
|
|
6463
6522
|
sourceLocation: {
|
|
6464
6523
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6465
|
-
"line":
|
|
6524
|
+
"line": 914,
|
|
6466
6525
|
"column": 9
|
|
6467
6526
|
}
|
|
6468
6527
|
},
|
|
@@ -6480,7 +6539,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6480
6539
|
},
|
|
6481
6540
|
sourceLocation: {
|
|
6482
6541
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6483
|
-
"line":
|
|
6542
|
+
"line": 437,
|
|
6484
6543
|
"column": 3
|
|
6485
6544
|
}
|
|
6486
6545
|
},
|
|
@@ -6507,7 +6566,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6507
6566
|
},
|
|
6508
6567
|
sourceLocation: {
|
|
6509
6568
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6510
|
-
"line":
|
|
6569
|
+
"line": 507,
|
|
6511
6570
|
"column": 3
|
|
6512
6571
|
}
|
|
6513
6572
|
},
|
|
@@ -6534,7 +6593,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6534
6593
|
},
|
|
6535
6594
|
sourceLocation: {
|
|
6536
6595
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6537
|
-
"line":
|
|
6596
|
+
"line": 635,
|
|
6538
6597
|
"column": 3
|
|
6539
6598
|
}
|
|
6540
6599
|
},
|
|
@@ -6561,7 +6620,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6561
6620
|
},
|
|
6562
6621
|
sourceLocation: {
|
|
6563
6622
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6564
|
-
"line":
|
|
6623
|
+
"line": 568,
|
|
6565
6624
|
"column": 3
|
|
6566
6625
|
}
|
|
6567
6626
|
},
|
|
@@ -6588,7 +6647,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6588
6647
|
},
|
|
6589
6648
|
sourceLocation: {
|
|
6590
6649
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6591
|
-
"line":
|
|
6650
|
+
"line": 764,
|
|
6592
6651
|
"column": 3
|
|
6593
6652
|
}
|
|
6594
6653
|
},
|
|
@@ -6615,7 +6674,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6615
6674
|
},
|
|
6616
6675
|
sourceLocation: {
|
|
6617
6676
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6618
|
-
"line":
|
|
6677
|
+
"line": 699,
|
|
6619
6678
|
"column": 3
|
|
6620
6679
|
}
|
|
6621
6680
|
},
|
|
@@ -6642,7 +6701,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6642
6701
|
},
|
|
6643
6702
|
sourceLocation: {
|
|
6644
6703
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6645
|
-
"line":
|
|
6704
|
+
"line": 825,
|
|
6646
6705
|
"column": 3
|
|
6647
6706
|
}
|
|
6648
6707
|
},
|
|
@@ -6669,7 +6728,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6669
6728
|
},
|
|
6670
6729
|
sourceLocation: {
|
|
6671
6730
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6672
|
-
"line":
|
|
6731
|
+
"line": 886,
|
|
6673
6732
|
"column": 3
|
|
6674
6733
|
}
|
|
6675
6734
|
},
|
|
@@ -6696,7 +6755,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6696
6755
|
},
|
|
6697
6756
|
sourceLocation: {
|
|
6698
6757
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6699
|
-
"line":
|
|
6758
|
+
"line": 458,
|
|
6700
6759
|
"column": 3
|
|
6701
6760
|
}
|
|
6702
6761
|
},
|
|
@@ -6723,7 +6782,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6723
6782
|
},
|
|
6724
6783
|
sourceLocation: {
|
|
6725
6784
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6726
|
-
"line":
|
|
6785
|
+
"line": 585,
|
|
6727
6786
|
"column": 3
|
|
6728
6787
|
}
|
|
6729
6788
|
},
|
|
@@ -6750,7 +6809,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6750
6809
|
},
|
|
6751
6810
|
sourceLocation: {
|
|
6752
6811
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6753
|
-
"line":
|
|
6812
|
+
"line": 524,
|
|
6754
6813
|
"column": 3
|
|
6755
6814
|
}
|
|
6756
6815
|
},
|
|
@@ -6777,7 +6836,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6777
6836
|
},
|
|
6778
6837
|
sourceLocation: {
|
|
6779
6838
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6780
|
-
"line":
|
|
6839
|
+
"line": 717,
|
|
6781
6840
|
"column": 3
|
|
6782
6841
|
}
|
|
6783
6842
|
},
|
|
@@ -6804,7 +6863,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6804
6863
|
},
|
|
6805
6864
|
sourceLocation: {
|
|
6806
6865
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6807
|
-
"line":
|
|
6866
|
+
"line": 642,
|
|
6808
6867
|
"column": 3
|
|
6809
6868
|
}
|
|
6810
6869
|
},
|
|
@@ -6831,7 +6890,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6831
6890
|
},
|
|
6832
6891
|
sourceLocation: {
|
|
6833
6892
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6834
|
-
"line":
|
|
6893
|
+
"line": 781,
|
|
6835
6894
|
"column": 3
|
|
6836
6895
|
}
|
|
6837
6896
|
},
|
|
@@ -6858,7 +6917,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6858
6917
|
},
|
|
6859
6918
|
sourceLocation: {
|
|
6860
6919
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6861
|
-
"line":
|
|
6920
|
+
"line": 842,
|
|
6862
6921
|
"column": 3
|
|
6863
6922
|
}
|
|
6864
6923
|
},
|
|
@@ -6885,7 +6944,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6885
6944
|
},
|
|
6886
6945
|
sourceLocation: {
|
|
6887
6946
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6888
|
-
"line":
|
|
6947
|
+
"line": 519,
|
|
6889
6948
|
"column": 3
|
|
6890
6949
|
}
|
|
6891
6950
|
},
|
|
@@ -6912,7 +6971,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6912
6971
|
},
|
|
6913
6972
|
sourceLocation: {
|
|
6914
6973
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6915
|
-
"line":
|
|
6974
|
+
"line": 712,
|
|
6916
6975
|
"column": 3
|
|
6917
6976
|
}
|
|
6918
6977
|
},
|
|
@@ -6939,7 +6998,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6939
6998
|
},
|
|
6940
6999
|
sourceLocation: {
|
|
6941
7000
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6942
|
-
"line":
|
|
7001
|
+
"line": 453,
|
|
6943
7002
|
"column": 3
|
|
6944
7003
|
}
|
|
6945
7004
|
},
|
|
@@ -6966,7 +7025,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6966
7025
|
},
|
|
6967
7026
|
sourceLocation: {
|
|
6968
7027
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
6969
|
-
"line":
|
|
7028
|
+
"line": 898,
|
|
6970
7029
|
"column": 3
|
|
6971
7030
|
}
|
|
6972
7031
|
},
|
|
@@ -7002,7 +7061,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7002
7061
|
},
|
|
7003
7062
|
sourceLocation: {
|
|
7004
7063
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7005
|
-
"line":
|
|
7064
|
+
"line": 500,
|
|
7006
7065
|
"column": 3
|
|
7007
7066
|
}
|
|
7008
7067
|
},
|
|
@@ -7038,7 +7097,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7038
7097
|
},
|
|
7039
7098
|
sourceLocation: {
|
|
7040
7099
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7041
|
-
"line":
|
|
7100
|
+
"line": 628,
|
|
7042
7101
|
"column": 3
|
|
7043
7102
|
}
|
|
7044
7103
|
},
|
|
@@ -7074,7 +7133,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7074
7133
|
},
|
|
7075
7134
|
sourceLocation: {
|
|
7076
7135
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7077
|
-
"line":
|
|
7136
|
+
"line": 561,
|
|
7078
7137
|
"column": 3
|
|
7079
7138
|
}
|
|
7080
7139
|
},
|
|
@@ -7110,7 +7169,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7110
7169
|
},
|
|
7111
7170
|
sourceLocation: {
|
|
7112
7171
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7113
|
-
"line":
|
|
7172
|
+
"line": 757,
|
|
7114
7173
|
"column": 3
|
|
7115
7174
|
}
|
|
7116
7175
|
},
|
|
@@ -7146,7 +7205,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7146
7205
|
},
|
|
7147
7206
|
sourceLocation: {
|
|
7148
7207
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7149
|
-
"line":
|
|
7208
|
+
"line": 692,
|
|
7150
7209
|
"column": 3
|
|
7151
7210
|
}
|
|
7152
7211
|
},
|
|
@@ -7182,7 +7241,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7182
7241
|
},
|
|
7183
7242
|
sourceLocation: {
|
|
7184
7243
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7185
|
-
"line":
|
|
7244
|
+
"line": 818,
|
|
7186
7245
|
"column": 3
|
|
7187
7246
|
}
|
|
7188
7247
|
},
|
|
@@ -7218,7 +7277,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7218
7277
|
},
|
|
7219
7278
|
sourceLocation: {
|
|
7220
7279
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7221
|
-
"line":
|
|
7280
|
+
"line": 879,
|
|
7222
7281
|
"column": 3
|
|
7223
7282
|
}
|
|
7224
7283
|
},
|
|
@@ -7245,7 +7304,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7245
7304
|
},
|
|
7246
7305
|
sourceLocation: {
|
|
7247
7306
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7248
|
-
"line":
|
|
7307
|
+
"line": 448,
|
|
7249
7308
|
"column": 3
|
|
7250
7309
|
}
|
|
7251
7310
|
},
|
|
@@ -7270,7 +7329,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7270
7329
|
source: "json",
|
|
7271
7330
|
codec: {
|
|
7272
7331
|
mode: "strict",
|
|
7273
|
-
typeSymbol: "@yadsh/dsh-qa-integrations/
|
|
7332
|
+
typeSymbol: "@yadsh/dsh-qa-integrations#qaIntegrations/putBitrix24Credential:input",
|
|
7274
7333
|
schema: _yadsh_dsh_qa_integrations_qaIntegrations_putBitrix24Credential_parameter_1$schema
|
|
7275
7334
|
}
|
|
7276
7335
|
}],
|
|
@@ -7281,7 +7340,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7281
7340
|
},
|
|
7282
7341
|
sourceLocation: {
|
|
7283
7342
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7284
|
-
"line":
|
|
7343
|
+
"line": 465,
|
|
7285
7344
|
"column": 9
|
|
7286
7345
|
}
|
|
7287
7346
|
},
|
|
@@ -7317,7 +7376,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7317
7376
|
},
|
|
7318
7377
|
sourceLocation: {
|
|
7319
7378
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7320
|
-
"line":
|
|
7379
|
+
"line": 597,
|
|
7321
7380
|
"column": 9
|
|
7322
7381
|
}
|
|
7323
7382
|
},
|
|
@@ -7353,7 +7412,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7353
7412
|
},
|
|
7354
7413
|
sourceLocation: {
|
|
7355
7414
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7356
|
-
"line":
|
|
7415
|
+
"line": 531,
|
|
7357
7416
|
"column": 9
|
|
7358
7417
|
}
|
|
7359
7418
|
},
|
|
@@ -7389,7 +7448,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7389
7448
|
},
|
|
7390
7449
|
sourceLocation: {
|
|
7391
7450
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7392
|
-
"line":
|
|
7451
|
+
"line": 724,
|
|
7393
7452
|
"column": 9
|
|
7394
7453
|
}
|
|
7395
7454
|
},
|
|
@@ -7425,7 +7484,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7425
7484
|
},
|
|
7426
7485
|
sourceLocation: {
|
|
7427
7486
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7428
|
-
"line":
|
|
7487
|
+
"line": 655,
|
|
7429
7488
|
"column": 9
|
|
7430
7489
|
}
|
|
7431
7490
|
},
|
|
@@ -7461,7 +7520,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7461
7520
|
},
|
|
7462
7521
|
sourceLocation: {
|
|
7463
7522
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7464
|
-
"line":
|
|
7523
|
+
"line": 788,
|
|
7465
7524
|
"column": 9
|
|
7466
7525
|
}
|
|
7467
7526
|
},
|
|
@@ -7497,7 +7556,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7497
7556
|
},
|
|
7498
7557
|
sourceLocation: {
|
|
7499
7558
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7500
|
-
"line":
|
|
7559
|
+
"line": 849,
|
|
7501
7560
|
"column": 9
|
|
7502
7561
|
}
|
|
7503
7562
|
},
|
|
@@ -7533,7 +7592,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7533
7592
|
},
|
|
7534
7593
|
sourceLocation: {
|
|
7535
7594
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7536
|
-
"line":
|
|
7595
|
+
"line": 932,
|
|
7537
7596
|
"column": 3
|
|
7538
7597
|
}
|
|
7539
7598
|
},
|
|
@@ -7569,7 +7628,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7569
7628
|
},
|
|
7570
7629
|
sourceLocation: {
|
|
7571
7630
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7572
|
-
"line":
|
|
7631
|
+
"line": 953,
|
|
7573
7632
|
"column": 3
|
|
7574
7633
|
}
|
|
7575
7634
|
},
|
|
@@ -7596,7 +7655,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7596
7655
|
},
|
|
7597
7656
|
sourceLocation: {
|
|
7598
7657
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7599
|
-
"line":
|
|
7658
|
+
"line": 680,
|
|
7600
7659
|
"column": 3
|
|
7601
7660
|
}
|
|
7602
7661
|
},
|
|
@@ -7623,7 +7682,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7623
7682
|
},
|
|
7624
7683
|
sourceLocation: {
|
|
7625
7684
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7626
|
-
"line":
|
|
7685
|
+
"line": 493,
|
|
7627
7686
|
"column": 9
|
|
7628
7687
|
}
|
|
7629
7688
|
},
|
|
@@ -7650,7 +7709,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7650
7709
|
},
|
|
7651
7710
|
sourceLocation: {
|
|
7652
7711
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7653
|
-
"line":
|
|
7712
|
+
"line": 621,
|
|
7654
7713
|
"column": 9
|
|
7655
7714
|
}
|
|
7656
7715
|
},
|
|
@@ -7677,7 +7736,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7677
7736
|
},
|
|
7678
7737
|
sourceLocation: {
|
|
7679
7738
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7680
|
-
"line":
|
|
7739
|
+
"line": 554,
|
|
7681
7740
|
"column": 9
|
|
7682
7741
|
}
|
|
7683
7742
|
},
|
|
@@ -7704,7 +7763,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7704
7763
|
},
|
|
7705
7764
|
sourceLocation: {
|
|
7706
7765
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7707
|
-
"line":
|
|
7766
|
+
"line": 776,
|
|
7708
7767
|
"column": 3
|
|
7709
7768
|
}
|
|
7710
7769
|
},
|
|
@@ -7731,7 +7790,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7731
7790
|
},
|
|
7732
7791
|
sourceLocation: {
|
|
7733
7792
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7734
|
-
"line":
|
|
7793
|
+
"line": 750,
|
|
7735
7794
|
"column": 9
|
|
7736
7795
|
}
|
|
7737
7796
|
},
|
|
@@ -7758,7 +7817,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7758
7817
|
},
|
|
7759
7818
|
sourceLocation: {
|
|
7760
7819
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7761
|
-
"line":
|
|
7820
|
+
"line": 685,
|
|
7762
7821
|
"column": 9
|
|
7763
7822
|
}
|
|
7764
7823
|
},
|
|
@@ -7785,7 +7844,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7785
7844
|
},
|
|
7786
7845
|
sourceLocation: {
|
|
7787
7846
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7788
|
-
"line":
|
|
7847
|
+
"line": 811,
|
|
7789
7848
|
"column": 9
|
|
7790
7849
|
}
|
|
7791
7850
|
},
|
|
@@ -7812,7 +7871,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7812
7871
|
},
|
|
7813
7872
|
sourceLocation: {
|
|
7814
7873
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7815
|
-
"line":
|
|
7874
|
+
"line": 872,
|
|
7816
7875
|
"column": 9
|
|
7817
7876
|
}
|
|
7818
7877
|
},
|
|
@@ -7839,7 +7898,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7839
7898
|
},
|
|
7840
7899
|
sourceLocation: {
|
|
7841
7900
|
"file": "packages/dsh-qa-integrations/src/index.ts",
|
|
7842
|
-
"line":
|
|
7901
|
+
"line": 837,
|
|
7843
7902
|
"column": 3
|
|
7844
7903
|
}
|
|
7845
7904
|
}
|
|
@@ -8181,6 +8240,67 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8181
8240
|
}) : null]
|
|
8182
8241
|
});
|
|
8183
8242
|
}
|
|
8243
|
+
function noop() {}
|
|
8244
|
+
/**
|
|
8245
|
+
* Inject one stylesheet tag for the plugin's card CSS. The tag carries
|
|
8246
|
+
* `data-plugin="<pluginName>"` and is guarded against double injection; the
|
|
8247
|
+
* returned disposer removes the tag when this call created it. No-op in
|
|
8248
|
+
* non-DOM environments (headless bundles, module probes).
|
|
8249
|
+
*/
|
|
8250
|
+
function injectCardStyles(pluginName, css) {
|
|
8251
|
+
if (typeof document === "undefined") return noop;
|
|
8252
|
+
const selector = `style[data-plugin="${pluginName}"]`;
|
|
8253
|
+
if (typeof document.querySelector === "function" && document.querySelector(selector) !== null) return noop;
|
|
8254
|
+
const tag = document.createElement("style");
|
|
8255
|
+
tag.dataset.plugin = pluginName;
|
|
8256
|
+
tag.textContent = css;
|
|
8257
|
+
document.head.appendChild(tag);
|
|
8258
|
+
return () => {
|
|
8259
|
+
tag.remove();
|
|
8260
|
+
};
|
|
8261
|
+
}
|
|
8262
|
+
/**
|
|
8263
|
+
* Register the card component into the shared settings-plugins slot. Returns
|
|
8264
|
+
* the registration disposer. Use this variant when the plugin drives the
|
|
8265
|
+
* slot's inject-factory itself (e.g. to dispose a form controller alongside).
|
|
8266
|
+
*/
|
|
8267
|
+
function registerSettingsSlot(host, options) {
|
|
8268
|
+
const slotOptions = {
|
|
8269
|
+
name: options.slotName ?? "settings.plugin.item",
|
|
8270
|
+
key: options.key,
|
|
8271
|
+
...options.locale === void 0 ? {} : { locale: options.locale },
|
|
8272
|
+
...options.inject === void 0 ? {} : { inject: options.inject }
|
|
8273
|
+
};
|
|
8274
|
+
return host.slots.register(slotOptions, options.component);
|
|
8275
|
+
}
|
|
8276
|
+
/**
|
|
8277
|
+
* Full bootstrap: inject {@link options.styles} once (when provided), then
|
|
8278
|
+
* mount the card into the settings-plugins slot. Returns a disposer removing
|
|
8279
|
+
* the slot effect and the injected stylesheet.
|
|
8280
|
+
*/
|
|
8281
|
+
function registerSettingsCard(host, options) {
|
|
8282
|
+
const removeStyles = options.styles === void 0 || options.pluginName === void 0 ? void 0 : injectCardStyles(options.pluginName, options.styles);
|
|
8283
|
+
const slotName = options.slotName ?? "settings.plugin.item";
|
|
8284
|
+
const disposeEffect = host.slots.inject(slotName, () => registerSettingsSlot(host, options));
|
|
8285
|
+
return () => {
|
|
8286
|
+
disposeEffect();
|
|
8287
|
+
removeStyles?.();
|
|
8288
|
+
};
|
|
8289
|
+
}
|
|
8290
|
+
//#endregion
|
|
8291
|
+
//#region ../../packages/plugin-kit/lib/client/settings-store.js
|
|
8292
|
+
/**
|
|
8293
|
+
* React calls external-store callbacks as plain functions, while
|
|
8294
|
+
* SettingsScope's methods depend on their receiver. Forwarding the methods
|
|
8295
|
+
* directly loses `this` and crashes while reading the internal store, so
|
|
8296
|
+
* bind them through stable wrappers.
|
|
8297
|
+
*/
|
|
8298
|
+
function bindSettingsExternalStore(scope) {
|
|
8299
|
+
return {
|
|
8300
|
+
subscribe: (listener) => scope.subscribe(listener),
|
|
8301
|
+
getSnapshot: () => scope.getSnapshot()
|
|
8302
|
+
};
|
|
8303
|
+
}
|
|
8184
8304
|
//#endregion
|
|
8185
8305
|
//#region src/client/copy.ts
|
|
8186
8306
|
/**
|
|
@@ -8662,7 +8782,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8662
8782
|
ProviderUnavailable: "Bitrix24 сейчас недоступен. Попробуйте позже.",
|
|
8663
8783
|
IntegrationNotConnected: "Интеграция не подключена.",
|
|
8664
8784
|
CredentialExpired: "Срок действия подключения истёк. Замените токен.",
|
|
8665
|
-
CredentialRevoked: "Подключение больше не действует. Замените токен."
|
|
8785
|
+
CredentialRevoked: "Подключение больше не действует. Замените токен.",
|
|
8786
|
+
ServiceCredentialUnavailable: "Для этого портала администратор не настроил сервисный токен.",
|
|
8787
|
+
ServiceCredentialDisabled: "Сервисный токен этого портала отключён администратором.",
|
|
8788
|
+
ServiceCredentialInvalid: "Сервисный токен не подходит для выбранного портала. Сообщите администратору.",
|
|
8789
|
+
PersonalCredentialRequired: "Личный вебхук не сохранён: подключите его, чтобы вернуться к личному аккаунту.",
|
|
8790
|
+
ServiceResourceNotAllowed: "Сервисный токен не работает на этом портале. Подключите личный аккаунт.",
|
|
8791
|
+
SensitiveReadRequiresPersonalCredential: "Эта операция может содержать личные или чувствительные данные. Подключите личный аккаунт, чтобы использовать её.",
|
|
8792
|
+
OperationNotAllowedWithServiceCredential: "Сервисный режим — только безопасное чтение: изменения недоступны."
|
|
8666
8793
|
};
|
|
8667
8794
|
function createBitrix24Card(remote) {
|
|
8668
8795
|
return createProviderCard({
|
|
@@ -8672,54 +8799,142 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8672
8799
|
errorCopy: ERROR_COPY$6,
|
|
8673
8800
|
notGrantedText: "Нет разрешения Bitrix24",
|
|
8674
8801
|
futurePermissions: ["Отправлять сообщения", "Изменять CRM"],
|
|
8675
|
-
useExtra: () =>
|
|
8676
|
-
|
|
8802
|
+
useExtra: () => {
|
|
8803
|
+
const [instances, setInstances] = (0, react.useState)([]);
|
|
8804
|
+
const [instanceId, setInstanceId] = (0, react.useState)("");
|
|
8805
|
+
return {
|
|
8806
|
+
instances,
|
|
8807
|
+
setInstances,
|
|
8808
|
+
instanceId,
|
|
8809
|
+
setInstanceId
|
|
8810
|
+
};
|
|
8811
|
+
},
|
|
8812
|
+
load: async ({ token, extra, accept, fail }) => {
|
|
8813
|
+
const list = await remote.bitrix24Instances(token);
|
|
8814
|
+
if (list.ok) {
|
|
8815
|
+
extra.setInstances(list.value);
|
|
8816
|
+
extra.setInstanceId(list.value.length === 1 ? list.value[0]?.id ?? "" : "");
|
|
8817
|
+
} else fail(list.error);
|
|
8677
8818
|
accept(await remote.getBitrix24(token));
|
|
8678
8819
|
},
|
|
8679
8820
|
calls: {
|
|
8680
|
-
save: (token, credential) => remote.putBitrix24Credential(token, {
|
|
8821
|
+
save: (token, credential, extra, options) => remote.putBitrix24Credential(token, {
|
|
8822
|
+
instanceId: extra.instanceId,
|
|
8823
|
+
token: credential,
|
|
8824
|
+
useServiceCredential: options.useServiceCredential
|
|
8825
|
+
}),
|
|
8681
8826
|
test: (token) => remote.testBitrix24(token),
|
|
8682
8827
|
patch: (token, patch) => remote.patchBitrix24Policy(token, patch),
|
|
8683
|
-
disconnect: (token) => remote.disconnectBitrix24(token)
|
|
8828
|
+
disconnect: (token) => remote.disconnectBitrix24(token),
|
|
8829
|
+
setSource: (token, source) => remote.credentialSource(token, {
|
|
8830
|
+
provider: "bitrix24",
|
|
8831
|
+
source
|
|
8832
|
+
}),
|
|
8833
|
+
setBoundary: (token, selection) => remote.serviceBoundary(token, {
|
|
8834
|
+
provider: "bitrix24",
|
|
8835
|
+
selection
|
|
8836
|
+
})
|
|
8684
8837
|
},
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8838
|
+
serviceBinding: (extra) => {
|
|
8839
|
+
if (extra.instanceId === "") return extra.instances.length === 1 ? extra.instances[0]?.service ?? null : null;
|
|
8840
|
+
return extra.instances.find((instance) => instance.id === extra.instanceId)?.service ?? null;
|
|
8841
|
+
},
|
|
8842
|
+
serviceDefault: async (token) => {
|
|
8843
|
+
const result = await remote.managedServiceCredentials(token);
|
|
8844
|
+
return result.ok ? result.value.enabled && result.value.defaultForNewConnections : false;
|
|
8845
|
+
},
|
|
8846
|
+
credentialSection: (state, help) => {
|
|
8847
|
+
const { instances, instanceId } = state.extra;
|
|
8848
|
+
if (!(instances.length > 0)) return null;
|
|
8849
|
+
const needsChoice = instances.length > 1;
|
|
8850
|
+
const service = serviceConnectOption(state);
|
|
8851
|
+
const instancePicker = needsChoice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
8852
|
+
className: "dsh-qa-integrations__field",
|
|
8853
|
+
children: ["Портал Bitrix24", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
8854
|
+
className: "dsh-qa-integrations__input",
|
|
8855
|
+
value: instanceId,
|
|
8856
|
+
disabled: state.busy,
|
|
8857
|
+
onChange: (event) => state.extra.setInstanceId(event.currentTarget.value),
|
|
8858
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
8859
|
+
value: "",
|
|
8860
|
+
children: "Выберите портал"
|
|
8861
|
+
}), instances.map((instance) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
8862
|
+
value: instance.id,
|
|
8863
|
+
children: instance.label
|
|
8864
|
+
}, instance.id))]
|
|
8865
|
+
})]
|
|
8866
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8867
|
+
className: "dsh-qa-integrations__muted",
|
|
8868
|
+
children: ["Портал: ", instances[0]?.label ?? ""]
|
|
8869
|
+
});
|
|
8870
|
+
if (state.useService) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8871
|
+
className: "dsh-qa-integrations__section",
|
|
8872
|
+
children: [
|
|
8873
|
+
instancePicker,
|
|
8874
|
+
service,
|
|
8875
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8876
|
+
className: "dsh-qa-integrations__actions",
|
|
8877
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
8878
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
8879
|
+
type: "button",
|
|
8880
|
+
disabled: state.busy || needsChoice && instanceId === "",
|
|
8881
|
+
onClick: state.save,
|
|
8882
|
+
children: "Подключить сервисный токен"
|
|
8883
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
8884
|
+
className: "dsh-qa-integrations__button",
|
|
8885
|
+
type: "button",
|
|
8886
|
+
disabled: state.busy,
|
|
8887
|
+
onClick: state.cancelCredential,
|
|
8888
|
+
children: "Отмена"
|
|
8889
|
+
}) : null]
|
|
8890
|
+
})
|
|
8891
|
+
]
|
|
8892
|
+
});
|
|
8893
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8894
|
+
className: "dsh-qa-integrations__section",
|
|
8895
|
+
children: [
|
|
8896
|
+
service,
|
|
8897
|
+
instancePicker,
|
|
8898
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
8899
|
+
className: "dsh-qa-integrations__field",
|
|
8900
|
+
children: ["URL входящего вебхука Bitrix24", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8901
|
+
className: "dsh-qa-integrations__input",
|
|
8902
|
+
type: "password",
|
|
8903
|
+
autoComplete: "new-password",
|
|
8904
|
+
value: state.credential,
|
|
8905
|
+
disabled: state.busy,
|
|
8906
|
+
onChange: (event) => state.setCredential(event.currentTarget.value),
|
|
8907
|
+
placeholder: "https://company.bitrix24.ru/rest/…"
|
|
8908
|
+
})]
|
|
8909
|
+
}),
|
|
8910
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredentialHelpNote, { help }),
|
|
8911
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8912
|
+
className: "dsh-qa-integrations__hint",
|
|
8913
|
+
children: "Токен хранится в зашифрованном виде и после сохранения больше не отображается."
|
|
8914
|
+
}),
|
|
8915
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8916
|
+
className: "dsh-qa-integrations__actions",
|
|
8917
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
8918
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
8919
|
+
type: "button",
|
|
8920
|
+
disabled: state.busy || state.credential.trim() === "" || needsChoice && instanceId === "",
|
|
8921
|
+
onClick: state.save,
|
|
8922
|
+
children: "Сохранить и проверить"
|
|
8923
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
8924
|
+
className: "dsh-qa-integrations__button",
|
|
8925
|
+
type: "button",
|
|
8926
|
+
disabled: state.busy,
|
|
8927
|
+
onClick: state.cancelCredential,
|
|
8928
|
+
children: "Отмена"
|
|
8929
|
+
}) : null]
|
|
8930
|
+
})
|
|
8931
|
+
]
|
|
8932
|
+
});
|
|
8933
|
+
},
|
|
8934
|
+
notConfiguredHint: (state) => state.extra.instances.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8935
|
+
className: "dsh-qa-integrations__hint",
|
|
8936
|
+
children: "Оператор не настроил ни одного портала Bitrix24, подключать нечего."
|
|
8937
|
+
}) : null
|
|
8723
8938
|
});
|
|
8724
8939
|
}
|
|
8725
8940
|
//#endregion
|
|
@@ -8734,307 +8949,179 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8734
8949
|
ResourceNotFound: "Confluence не нашёл страницу или аккаунт её не видит.",
|
|
8735
8950
|
RateLimited: "Слишком много запросов. Попробуйте позже.",
|
|
8736
8951
|
ResultTooLarge: "Ответ Confluence слишком большой для одного запроса.",
|
|
8737
|
-
OperationDeniedByPolicy: "Пространство вне списка, разрешённого оператором стенда."
|
|
8952
|
+
OperationDeniedByPolicy: "Пространство вне списка, разрешённого оператором стенда.",
|
|
8953
|
+
ServiceCredentialUnavailable: "Для этого сайта администратор не настроил сервисный токен.",
|
|
8954
|
+
ServiceCredentialDisabled: "Сервисный токен этого сайта отключён администратором.",
|
|
8955
|
+
ServiceCredentialInvalid: "Сервисный токен не подходит для выбранного сайта. Сообщите администратору.",
|
|
8956
|
+
PersonalCredentialRequired: "Личный токен не сохранён: подключите его, чтобы вернуться к личному аккаунту.",
|
|
8957
|
+
ServiceResourceNotAllowed: "Сервисный режим читает только пространства из списка доступа. Сузьте запрос или подключите личный аккаунт.",
|
|
8958
|
+
SensitiveReadRequiresPersonalCredential: "Эта операция может содержать личные или чувствительные данные. Подключите личный аккаунт, чтобы использовать её.",
|
|
8959
|
+
OperationNotAllowedWithServiceCredential: "Сервисный режим — только безопасное чтение: изменения недоступны."
|
|
8738
8960
|
};
|
|
8739
8961
|
function createConfluenceCard(remote) {
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
}
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
setSummary(void 0);
|
|
8828
|
-
setConfirmDisconnect(false);
|
|
8829
|
-
await load();
|
|
8830
|
-
} else fail(result.error);
|
|
8831
|
-
} catch (cause) {
|
|
8832
|
-
fail(cause);
|
|
8833
|
-
} finally {
|
|
8834
|
-
setBusy(false);
|
|
8835
|
-
}
|
|
8836
|
-
};
|
|
8837
|
-
const connected = summary?.status !== "not_connected" && summary !== void 0;
|
|
8838
|
-
const showCredential = !connected || replace;
|
|
8839
|
-
const configured = sites.length > 0;
|
|
8840
|
-
const needsChoice = configured && sites.length > 1;
|
|
8841
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
8842
|
-
className: "dsh-qa-integrations__card",
|
|
8843
|
-
children: [
|
|
8844
|
-
error === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8845
|
-
className: "dsh-qa-integrations__error",
|
|
8846
|
-
role: "alert",
|
|
8847
|
-
children: error
|
|
8848
|
-
}),
|
|
8849
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8850
|
-
className: "dsh-qa-integrations__card-head",
|
|
8851
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
8852
|
-
className: "dsh-qa-integrations__provider",
|
|
8853
|
-
children: "Confluence"
|
|
8854
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8855
|
-
className: "dsh-qa-integrations__portal",
|
|
8856
|
-
children: summary?.portal ?? "База знаний и документация вашей команды"
|
|
8857
|
-
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8858
|
-
className: `dsh-qa-integrations__status${summary?.status === "connected" ? " dsh-qa-integrations__status--ok" : ""}`,
|
|
8859
|
-
children: summary?.status === "connected" ? "Подключено" : summary?.status === "error" ? "Нужна проверка" : "Не подключено"
|
|
8860
|
-
})]
|
|
8861
|
-
}),
|
|
8862
|
-
connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8863
|
-
className: "dsh-qa-integrations__section",
|
|
8864
|
-
children: [
|
|
8865
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: summary.externalAccountName ?? "Пользователь Atlassian" }),
|
|
8866
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8867
|
-
className: "dsh-qa-integrations__muted",
|
|
8868
|
-
children: ["Последняя успешная проверка: ", dateTime(summary.lastValidatedAt)]
|
|
8869
|
-
}),
|
|
8870
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8871
|
-
className: "dsh-qa-integrations__muted",
|
|
8872
|
-
children: ["Токен настроен · обновлён ", dateTime(summary.credentialUpdatedAt)]
|
|
8873
|
-
})
|
|
8874
|
-
]
|
|
8875
|
-
}) : null,
|
|
8876
|
-
showCredential && configured ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8877
|
-
className: "dsh-qa-integrations__section",
|
|
8878
|
-
children: [
|
|
8879
|
-
needsChoice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
8880
|
-
className: "dsh-qa-integrations__field",
|
|
8881
|
-
children: ["Сайт Confluence", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
8882
|
-
className: "dsh-qa-integrations__input",
|
|
8883
|
-
value: instanceId,
|
|
8884
|
-
disabled: busy,
|
|
8885
|
-
onChange: (event) => setInstanceId(event.currentTarget.value),
|
|
8886
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
8887
|
-
value: "",
|
|
8888
|
-
children: "Выберите сайт"
|
|
8889
|
-
}), sites.map((site) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
8890
|
-
value: site.id,
|
|
8891
|
-
children: site.label
|
|
8892
|
-
}, site.id))]
|
|
8893
|
-
})]
|
|
8894
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8895
|
-
className: "dsh-qa-integrations__muted",
|
|
8896
|
-
children: ["Сайт: ", sites[0]?.label ?? ""]
|
|
8897
|
-
}),
|
|
8898
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
8899
|
-
className: "dsh-qa-integrations__field",
|
|
8900
|
-
children: ["Почта аккаунта Atlassian", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8901
|
-
className: "dsh-qa-integrations__input",
|
|
8902
|
-
type: "email",
|
|
8903
|
-
autoComplete: "off",
|
|
8904
|
-
value: email,
|
|
8905
|
-
disabled: busy,
|
|
8906
|
-
onChange: (event) => setEmail(event.currentTarget.value),
|
|
8907
|
-
placeholder: "user@example.com"
|
|
8908
|
-
})]
|
|
8909
|
-
}),
|
|
8910
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
8911
|
-
className: "dsh-qa-integrations__field",
|
|
8912
|
-
children: ["Atlassian API token", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8913
|
-
className: "dsh-qa-integrations__input",
|
|
8914
|
-
type: "password",
|
|
8915
|
-
autoComplete: "new-password",
|
|
8916
|
-
value: credential,
|
|
8917
|
-
disabled: busy,
|
|
8918
|
-
onChange: (event) => setCredential(event.currentTarget.value),
|
|
8919
|
-
placeholder: "ATATT…"
|
|
8920
|
-
})]
|
|
8921
|
-
}),
|
|
8922
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredentialHelpNote, { help }),
|
|
8923
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8924
|
-
className: "dsh-qa-integrations__hint",
|
|
8925
|
-
children: "Почта и токен хранятся в зашифрованном виде и после сохранения больше не отображаются."
|
|
8926
|
-
}),
|
|
8927
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8928
|
-
className: "dsh-qa-integrations__actions",
|
|
8929
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
8930
|
-
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
8931
|
-
type: "button",
|
|
8932
|
-
disabled: busy || credential.trim() === "" || email.trim() === "" || needsChoice && instanceId === "",
|
|
8933
|
-
onClick: () => void save(),
|
|
8934
|
-
children: "Сохранить и проверить"
|
|
8935
|
-
}), connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
8936
|
-
className: "dsh-qa-integrations__button",
|
|
8937
|
-
type: "button",
|
|
8938
|
-
disabled: busy,
|
|
8939
|
-
onClick: () => {
|
|
8940
|
-
setCredential("");
|
|
8941
|
-
setEmail("");
|
|
8942
|
-
setReplace(false);
|
|
8943
|
-
},
|
|
8944
|
-
children: "Отмена"
|
|
8945
|
-
}) : null]
|
|
8946
|
-
})
|
|
8947
|
-
]
|
|
8948
|
-
}) : null,
|
|
8949
|
-
!configured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
8950
|
-
className: "dsh-qa-integrations__hint",
|
|
8951
|
-
children: "Оператор не настроил ни одного сайта Confluence, подключать нечего."
|
|
8952
|
-
}) : null,
|
|
8953
|
-
connected && !showCredential ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
8954
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8955
|
-
className: "dsh-qa-integrations__section",
|
|
8956
|
-
children: [
|
|
8957
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { children: "Доступ агента" }),
|
|
8958
|
-
Object.entries(summary.capabilityInfo).map(([capability, info]) => {
|
|
8959
|
-
const granted = summary.capabilities.includes(capability);
|
|
8960
|
-
const mode = summary.policy.find((entry) => entry.capability === capability)?.mode;
|
|
8961
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8962
|
-
className: "dsh-qa-integrations__permission",
|
|
8963
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8964
|
-
type: "checkbox",
|
|
8965
|
-
checked: mode === "allow",
|
|
8966
|
-
disabled: busy || !granted,
|
|
8967
|
-
onChange: (event) => void patch(capability, event.currentTarget.checked)
|
|
8968
|
-
}), info.label] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8969
|
-
className: "dsh-qa-integrations__muted",
|
|
8970
|
-
title: info.hint,
|
|
8971
|
-
children: granted ? "Доступно" : "Выключено оператором стенда"
|
|
8972
|
-
})]
|
|
8973
|
-
}, capability);
|
|
8974
|
-
}),
|
|
8975
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8976
|
-
className: "dsh-qa-integrations__permission",
|
|
8977
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8978
|
-
type: "checkbox",
|
|
8979
|
-
disabled: true
|
|
8980
|
-
}), " Создание и правка страниц, комментарии на запись"] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8981
|
-
className: "dsh-qa-integrations__muted",
|
|
8982
|
-
children: "Появится позже"
|
|
8983
|
-
})]
|
|
8984
|
-
})
|
|
8985
|
-
]
|
|
8986
|
-
}),
|
|
8962
|
+
const credentialSource = remote.credentialSource;
|
|
8963
|
+
const serviceBoundary = remote.serviceBoundary;
|
|
8964
|
+
const managedServiceCredentials = remote.managedServiceCredentials;
|
|
8965
|
+
return createProviderCard({
|
|
8966
|
+
title: "Confluence",
|
|
8967
|
+
portalFallback: "База знаний и документация вашей команды",
|
|
8968
|
+
accountFallback: "Пользователь Atlassian",
|
|
8969
|
+
errorCopy: ERROR_COPY$5,
|
|
8970
|
+
notGrantedText: "Выключено оператором стенда",
|
|
8971
|
+
futurePermissions: ["Создание и правка страниц, комментарии на запись"],
|
|
8972
|
+
useExtra: () => {
|
|
8973
|
+
const [sites, setSites] = (0, react.useState)([]);
|
|
8974
|
+
const [instanceId, setInstanceId] = (0, react.useState)("");
|
|
8975
|
+
const [email, setEmail] = (0, react.useState)("");
|
|
8976
|
+
return {
|
|
8977
|
+
sites,
|
|
8978
|
+
setSites,
|
|
8979
|
+
instanceId,
|
|
8980
|
+
setInstanceId,
|
|
8981
|
+
email,
|
|
8982
|
+
setEmail
|
|
8983
|
+
};
|
|
8984
|
+
},
|
|
8985
|
+
load: async ({ token, extra, accept, fail }) => {
|
|
8986
|
+
const list = await remote.confluenceSites(token);
|
|
8987
|
+
if (list.ok) {
|
|
8988
|
+
extra.setSites(list.value);
|
|
8989
|
+
extra.setInstanceId(list.value.length === 1 ? list.value[0]?.id ?? "" : "");
|
|
8990
|
+
} else fail(list.error);
|
|
8991
|
+
accept(await remote.getConfluence(token));
|
|
8992
|
+
},
|
|
8993
|
+
calls: {
|
|
8994
|
+
save: (token, credential, extra, options) => remote.putConfluenceCredential(token, {
|
|
8995
|
+
instanceId: extra.instanceId,
|
|
8996
|
+
email: extra.email,
|
|
8997
|
+
token: credential,
|
|
8998
|
+
...options.useServiceCredential ? { useServiceCredential: true } : {}
|
|
8999
|
+
}),
|
|
9000
|
+
test: (token) => remote.testConfluence(token),
|
|
9001
|
+
patch: (token, patch) => remote.patchConfluencePolicy(token, patch),
|
|
9002
|
+
disconnect: (token) => remote.disconnectConfluence(token),
|
|
9003
|
+
setSource: credentialSource === void 0 ? void 0 : (token, source) => credentialSource(token, {
|
|
9004
|
+
provider: "confluence",
|
|
9005
|
+
source
|
|
9006
|
+
}),
|
|
9007
|
+
setBoundary: serviceBoundary === void 0 ? void 0 : (token, selection) => serviceBoundary(token, {
|
|
9008
|
+
provider: "confluence",
|
|
9009
|
+
selection
|
|
9010
|
+
})
|
|
9011
|
+
},
|
|
9012
|
+
serviceBinding: (extra) => {
|
|
9013
|
+
if (extra.instanceId === "") return extra.sites.length === 1 ? extra.sites[0]?.service ?? null : null;
|
|
9014
|
+
return extra.sites.find((site) => site.id === extra.instanceId)?.service ?? null;
|
|
9015
|
+
},
|
|
9016
|
+
serviceDefault: managedServiceCredentials === void 0 ? void 0 : async (token) => {
|
|
9017
|
+
const result = await managedServiceCredentials(token);
|
|
9018
|
+
return result.ok && result.value.enabled && result.value.defaultForNewConnections;
|
|
9019
|
+
},
|
|
9020
|
+
credentialSection: (state, help) => {
|
|
9021
|
+
const { sites, instanceId, email } = state.extra;
|
|
9022
|
+
if (!(sites.length > 0)) return null;
|
|
9023
|
+
const needsChoice = sites.length > 1;
|
|
9024
|
+
const service = serviceConnectOption(state);
|
|
9025
|
+
const sitePicker = needsChoice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9026
|
+
className: "dsh-qa-integrations__field",
|
|
9027
|
+
children: ["Сайт Confluence", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
9028
|
+
className: "dsh-qa-integrations__input",
|
|
9029
|
+
value: instanceId,
|
|
9030
|
+
disabled: state.busy,
|
|
9031
|
+
onChange: (event) => state.extra.setInstanceId(event.currentTarget.value),
|
|
9032
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9033
|
+
value: "",
|
|
9034
|
+
children: "Выберите сайт"
|
|
9035
|
+
}), sites.map((site) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9036
|
+
value: site.id,
|
|
9037
|
+
children: site.label
|
|
9038
|
+
}, site.id))]
|
|
9039
|
+
})]
|
|
9040
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
9041
|
+
className: "dsh-qa-integrations__muted",
|
|
9042
|
+
children: ["Сайт: ", sites[0]?.label ?? ""]
|
|
9043
|
+
});
|
|
9044
|
+
if (state.useService) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9045
|
+
className: "dsh-qa-integrations__section",
|
|
9046
|
+
children: [
|
|
9047
|
+
sitePicker,
|
|
9048
|
+
service,
|
|
8987
9049
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8988
9050
|
className: "dsh-qa-integrations__actions",
|
|
8989
|
-
children: [
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9051
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9052
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9053
|
+
type: "button",
|
|
9054
|
+
disabled: state.busy || needsChoice && instanceId === "",
|
|
9055
|
+
onClick: state.save,
|
|
9056
|
+
children: "Подключить сервисный токен"
|
|
9057
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9058
|
+
className: "dsh-qa-integrations__button",
|
|
9059
|
+
type: "button",
|
|
9060
|
+
disabled: state.busy,
|
|
9061
|
+
onClick: state.cancelCredential,
|
|
9062
|
+
children: "Отмена"
|
|
9063
|
+
}) : null]
|
|
9064
|
+
})
|
|
9065
|
+
]
|
|
9066
|
+
});
|
|
9067
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9068
|
+
className: "dsh-qa-integrations__section",
|
|
9069
|
+
children: [
|
|
9070
|
+
service,
|
|
9071
|
+
sitePicker,
|
|
9072
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9073
|
+
className: "dsh-qa-integrations__field",
|
|
9074
|
+
children: ["Почта аккаунта Atlassian", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9075
|
+
className: "dsh-qa-integrations__input",
|
|
9076
|
+
type: "email",
|
|
9077
|
+
autoComplete: "off",
|
|
9078
|
+
value: email,
|
|
9079
|
+
disabled: state.busy,
|
|
9080
|
+
onChange: (event) => state.extra.setEmail(event.currentTarget.value),
|
|
9081
|
+
placeholder: "user@example.com"
|
|
9082
|
+
})]
|
|
9012
9083
|
}),
|
|
9013
|
-
|
|
9014
|
-
className: "dsh-qa-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
onClick: () => void disconnect(),
|
|
9024
|
-
children: "Да, отключить"
|
|
9025
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9026
|
-
className: "dsh-qa-integrations__button",
|
|
9027
|
-
type: "button",
|
|
9028
|
-
disabled: busy,
|
|
9029
|
-
onClick: () => setConfirmDisconnect(false),
|
|
9030
|
-
children: "Отмена"
|
|
9031
|
-
})]
|
|
9084
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9085
|
+
className: "dsh-qa-integrations__field",
|
|
9086
|
+
children: ["Atlassian API token", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9087
|
+
className: "dsh-qa-integrations__input",
|
|
9088
|
+
type: "password",
|
|
9089
|
+
autoComplete: "new-password",
|
|
9090
|
+
value: state.credential,
|
|
9091
|
+
disabled: state.busy,
|
|
9092
|
+
onChange: (event) => state.setCredential(event.currentTarget.value),
|
|
9093
|
+
placeholder: "ATATT…"
|
|
9032
9094
|
})]
|
|
9033
|
-
})
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9095
|
+
}),
|
|
9096
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredentialHelpNote, { help }),
|
|
9097
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9098
|
+
className: "dsh-qa-integrations__hint",
|
|
9099
|
+
children: "Почта и токен хранятся в зашифрованном виде и после сохранения больше не отображаются."
|
|
9100
|
+
}),
|
|
9101
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9102
|
+
className: "dsh-qa-integrations__actions",
|
|
9103
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9104
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9105
|
+
type: "button",
|
|
9106
|
+
disabled: state.busy || state.credential.trim() === "" || email.trim() === "" || needsChoice && instanceId === "",
|
|
9107
|
+
onClick: state.save,
|
|
9108
|
+
children: "Сохранить и проверить"
|
|
9109
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9110
|
+
className: "dsh-qa-integrations__button",
|
|
9111
|
+
type: "button",
|
|
9112
|
+
disabled: state.busy,
|
|
9113
|
+
onClick: state.cancelCredential,
|
|
9114
|
+
children: "Отмена"
|
|
9115
|
+
}) : null]
|
|
9116
|
+
})
|
|
9117
|
+
]
|
|
9118
|
+
});
|
|
9119
|
+
},
|
|
9120
|
+
notConfiguredHint: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9121
|
+
className: "dsh-qa-integrations__hint",
|
|
9122
|
+
children: "Оператор не настроил ни одного сайта Confluence, подключать нечего."
|
|
9123
|
+
})
|
|
9124
|
+
});
|
|
9038
9125
|
}
|
|
9039
9126
|
//#endregion
|
|
9040
9127
|
//#region src/client/gitlab.tsx
|
|
@@ -9199,10 +9286,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9199
9286
|
]
|
|
9200
9287
|
});
|
|
9201
9288
|
},
|
|
9202
|
-
notConfiguredHint: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9289
|
+
notConfiguredHint: (state) => state.extra.instances.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9203
9290
|
className: "dsh-qa-integrations__hint",
|
|
9204
9291
|
children: "Оператор не настроил ни одного инстанса GitLab, подключать нечего."
|
|
9205
|
-
})
|
|
9292
|
+
}) : null
|
|
9206
9293
|
});
|
|
9207
9294
|
}
|
|
9208
9295
|
//#endregion
|
|
@@ -9219,311 +9306,190 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9219
9306
|
RateLimited: "Слишком много запросов к Jira. Попробуйте позже.",
|
|
9220
9307
|
ResultTooLarge: "Ответ Jira слишком большой для одного запроса.",
|
|
9221
9308
|
UpstreamTimeout: "Jira не ответила вовремя. Попробуйте ещё раз.",
|
|
9222
|
-
TlsFailure: "Сертификат сайта Jira не принят стендом. Нужен сертификат, которому доверяет сервер."
|
|
9223
|
-
|
|
9309
|
+
TlsFailure: "Сертификат сайта Jira не принят стендом. Нужен сертификат, которому доверяет сервер.",
|
|
9310
|
+
ServiceCredentialUnavailable: "Для этого сайта администратор не настроил сервисный токен.",
|
|
9311
|
+
ServiceCredentialDisabled: "Сервисный токен этого сайта отключён администратором.",
|
|
9312
|
+
ServiceCredentialInvalid: "Сервисный токен не подходит для выбранного сайта. Сообщите администратору.",
|
|
9313
|
+
PersonalCredentialRequired: "Личный токен не сохранён: подключите его, чтобы вернуться к личному аккаунту.",
|
|
9314
|
+
ServiceResourceNotAllowed: "Сервисный токен не даёт доступа к этому проекту. Сузьте доступ в списке или подключите личный аккаунт.",
|
|
9315
|
+
SensitiveReadRequiresPersonalCredential: "Эта операция может содержать личные или чувствительные данные. Подключите личный аккаунт, чтобы использовать её.",
|
|
9316
|
+
OperationNotAllowedWithServiceCredential: "Сервисный режим — только безопасное чтение: изменения недоступны."
|
|
9317
|
+
};
|
|
9224
9318
|
function createJiraCard(remote) {
|
|
9225
|
-
return
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
}
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
token
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
}
|
|
9278
|
-
} catch (cause) {
|
|
9279
|
-
fail(cause);
|
|
9280
|
-
} finally {
|
|
9281
|
-
setBusy(false);
|
|
9282
|
-
}
|
|
9283
|
-
};
|
|
9284
|
-
const test = async () => {
|
|
9285
|
-
setBusy(true);
|
|
9286
|
-
try {
|
|
9287
|
-
accept(await remote.testJira(token));
|
|
9288
|
-
} catch (cause) {
|
|
9289
|
-
fail(cause);
|
|
9290
|
-
} finally {
|
|
9291
|
-
setBusy(false);
|
|
9292
|
-
}
|
|
9293
|
-
};
|
|
9294
|
-
const patch = async (capability, allowed) => {
|
|
9295
|
-
setBusy(true);
|
|
9296
|
-
try {
|
|
9297
|
-
accept(await remote.patchJiraPolicy(token, {
|
|
9298
|
-
operation: capability,
|
|
9299
|
-
mode: allowed ? "allow" : "deny"
|
|
9300
|
-
}));
|
|
9301
|
-
} catch (cause) {
|
|
9302
|
-
fail(cause);
|
|
9303
|
-
} finally {
|
|
9304
|
-
setBusy(false);
|
|
9305
|
-
}
|
|
9306
|
-
};
|
|
9307
|
-
const disconnect = async () => {
|
|
9308
|
-
setBusy(true);
|
|
9309
|
-
try {
|
|
9310
|
-
const result = await remote.disconnectJira(token);
|
|
9311
|
-
if (result.ok) {
|
|
9312
|
-
setSummary(void 0);
|
|
9313
|
-
setConfirmDisconnect(false);
|
|
9314
|
-
await load();
|
|
9315
|
-
} else fail(result.error);
|
|
9316
|
-
} catch (cause) {
|
|
9317
|
-
fail(cause);
|
|
9318
|
-
} finally {
|
|
9319
|
-
setBusy(false);
|
|
9319
|
+
return createProviderCard({
|
|
9320
|
+
title: "Jira",
|
|
9321
|
+
portalFallback: "Задачи, комментарии и вложения вашей Jira",
|
|
9322
|
+
accountFallback: "Пользователь Jira",
|
|
9323
|
+
errorCopy: ERROR_COPY$3,
|
|
9324
|
+
notGrantedText: "Выключено оператором стенда",
|
|
9325
|
+
futurePermissions: ["Создание и правка задач, комментарии, переходы"],
|
|
9326
|
+
useExtra: () => {
|
|
9327
|
+
const [sites, setSites] = (0, react.useState)([]);
|
|
9328
|
+
const [siteId, setSiteId] = (0, react.useState)("");
|
|
9329
|
+
const [email, setEmail] = (0, react.useState)("");
|
|
9330
|
+
return {
|
|
9331
|
+
sites,
|
|
9332
|
+
setSites,
|
|
9333
|
+
siteId,
|
|
9334
|
+
setSiteId,
|
|
9335
|
+
email,
|
|
9336
|
+
setEmail
|
|
9337
|
+
};
|
|
9338
|
+
},
|
|
9339
|
+
load: async ({ token, extra, accept, fail }) => {
|
|
9340
|
+
const list = await remote.jiraSites(token);
|
|
9341
|
+
if (list.ok) {
|
|
9342
|
+
extra.setSites(list.value);
|
|
9343
|
+
extra.setSiteId(list.value.length === 1 ? list.value[0]?.id ?? "" : "");
|
|
9344
|
+
} else fail(list.error);
|
|
9345
|
+
accept(await remote.getJira(token));
|
|
9346
|
+
},
|
|
9347
|
+
calls: {
|
|
9348
|
+
save: (token, credential, extra, options) => remote.putJiraCredential(token, {
|
|
9349
|
+
siteId: extra.siteId,
|
|
9350
|
+
email: extra.email,
|
|
9351
|
+
token: credential,
|
|
9352
|
+
useServiceCredential: options.useServiceCredential || void 0
|
|
9353
|
+
}),
|
|
9354
|
+
test: (token) => remote.testJira(token),
|
|
9355
|
+
patch: (token, patch) => remote.patchJiraPolicy(token, patch),
|
|
9356
|
+
disconnect: (token) => remote.disconnectJira(token),
|
|
9357
|
+
setSource: (token, source) => {
|
|
9358
|
+
const call = remote.credentialSource;
|
|
9359
|
+
if (call === void 0) return Promise.reject(/* @__PURE__ */ new Error("This deployment does not offer service mode for Jira"));
|
|
9360
|
+
return call(token, {
|
|
9361
|
+
provider: "jira",
|
|
9362
|
+
source
|
|
9363
|
+
});
|
|
9364
|
+
},
|
|
9365
|
+
setBoundary: (token, selection) => {
|
|
9366
|
+
const call = remote.serviceBoundary;
|
|
9367
|
+
if (call === void 0) return Promise.reject(/* @__PURE__ */ new Error("This deployment does not offer service mode for Jira"));
|
|
9368
|
+
return call(token, {
|
|
9369
|
+
provider: "jira",
|
|
9370
|
+
selection
|
|
9371
|
+
});
|
|
9320
9372
|
}
|
|
9321
|
-
}
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
className: "dsh-qa-integrations__field",
|
|
9366
|
-
children: ["Сайт Jira", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
9367
|
-
className: "dsh-qa-integrations__input",
|
|
9368
|
-
value: siteId,
|
|
9369
|
-
disabled: busy,
|
|
9370
|
-
onChange: (event) => setSiteId(event.currentTarget.value),
|
|
9371
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9372
|
-
value: "",
|
|
9373
|
-
children: "Выберите сайт"
|
|
9374
|
-
}), sites.map((site) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9375
|
-
value: site.id,
|
|
9376
|
-
children: site.label
|
|
9377
|
-
}, site.id))]
|
|
9378
|
-
})]
|
|
9379
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
9380
|
-
className: "dsh-qa-integrations__muted",
|
|
9381
|
-
children: [
|
|
9382
|
-
"Сайт: ",
|
|
9383
|
-
sites[0]?.label ?? "",
|
|
9384
|
-
" — задан оператором стенда"
|
|
9385
|
-
]
|
|
9386
|
-
}),
|
|
9387
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9388
|
-
className: "dsh-qa-integrations__field",
|
|
9389
|
-
children: ["Аккаунт Atlassian (e-mail)", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9390
|
-
className: "dsh-qa-integrations__input",
|
|
9391
|
-
type: "email",
|
|
9392
|
-
autoComplete: "off",
|
|
9393
|
-
value: email,
|
|
9394
|
-
disabled: busy,
|
|
9395
|
-
onChange: (event) => setEmail(event.currentTarget.value),
|
|
9396
|
-
placeholder: "ivan@example.com"
|
|
9397
|
-
})]
|
|
9398
|
-
}),
|
|
9399
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9400
|
-
className: "dsh-qa-integrations__field",
|
|
9401
|
-
children: ["API-токен Jira", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9402
|
-
className: "dsh-qa-integrations__input",
|
|
9403
|
-
type: "password",
|
|
9404
|
-
autoComplete: "new-password",
|
|
9405
|
-
value: credential,
|
|
9406
|
-
disabled: busy,
|
|
9407
|
-
onChange: (event) => setCredential(event.currentTarget.value),
|
|
9408
|
-
placeholder: "ATATT…"
|
|
9409
|
-
})]
|
|
9410
|
-
}),
|
|
9411
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredentialHelpNote, { help }),
|
|
9412
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9413
|
-
className: "dsh-qa-integrations__hint",
|
|
9414
|
-
children: "Токен и e-mail хранятся в зашифрованном виде и после сохранения не отображаются."
|
|
9415
|
-
}),
|
|
9416
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9417
|
-
className: "dsh-qa-integrations__actions",
|
|
9418
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9419
|
-
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9420
|
-
type: "button",
|
|
9421
|
-
disabled: busy || credential.trim() === "" || email.trim() === "" || needsChoice && siteId === "",
|
|
9422
|
-
onClick: () => void save(),
|
|
9423
|
-
children: "Сохранить и проверить"
|
|
9424
|
-
}), connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9425
|
-
className: "dsh-qa-integrations__button",
|
|
9426
|
-
type: "button",
|
|
9427
|
-
disabled: busy,
|
|
9428
|
-
onClick: () => {
|
|
9429
|
-
setCredential("");
|
|
9430
|
-
setEmail("");
|
|
9431
|
-
setReplace(false);
|
|
9432
|
-
},
|
|
9433
|
-
children: "Отмена"
|
|
9434
|
-
}) : null]
|
|
9435
|
-
})
|
|
9436
|
-
]
|
|
9437
|
-
}) : null,
|
|
9438
|
-
!configured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9439
|
-
className: "dsh-qa-integrations__hint",
|
|
9440
|
-
children: "Оператор не настроил ни одного сайта Jira, подключать нечего. Адреса сайтов задаются в конфигурации развёртывания."
|
|
9441
|
-
}) : null,
|
|
9442
|
-
connected && !showCredential ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
9443
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9444
|
-
className: "dsh-qa-integrations__section",
|
|
9445
|
-
children: [
|
|
9446
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", { children: "Доступ агента" }),
|
|
9447
|
-
Object.entries(summary.capabilityInfo).map(([capability, info]) => {
|
|
9448
|
-
const granted = summary.capabilities.includes(capability);
|
|
9449
|
-
const mode = summary.policy.find((entry) => entry.capability === capability)?.mode;
|
|
9450
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9451
|
-
className: "dsh-qa-integrations__permission",
|
|
9452
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9453
|
-
type: "checkbox",
|
|
9454
|
-
checked: mode === "allow",
|
|
9455
|
-
disabled: busy || !granted,
|
|
9456
|
-
onChange: (event) => void patch(capability, event.currentTarget.checked)
|
|
9457
|
-
}), info.label] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
9458
|
-
className: "dsh-qa-integrations__muted",
|
|
9459
|
-
title: info.hint,
|
|
9460
|
-
children: granted ? "Доступно" : "Выключено оператором стенда"
|
|
9461
|
-
})]
|
|
9462
|
-
}, capability);
|
|
9463
|
-
}),
|
|
9464
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9465
|
-
className: "dsh-qa-integrations__permission",
|
|
9466
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9467
|
-
type: "checkbox",
|
|
9468
|
-
disabled: true
|
|
9469
|
-
}), " Создание и правка задач, комментарии, переходы"] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
9470
|
-
className: "dsh-qa-integrations__muted",
|
|
9471
|
-
children: "Появится позже"
|
|
9472
|
-
})]
|
|
9473
|
-
})
|
|
9474
|
-
]
|
|
9475
|
-
}),
|
|
9373
|
+
},
|
|
9374
|
+
serviceBinding: (extra) => {
|
|
9375
|
+
if (extra.siteId === "") return extra.sites.length === 1 ? extra.sites[0]?.service ?? null : null;
|
|
9376
|
+
return extra.sites.find((site) => site.id === extra.siteId)?.service ?? null;
|
|
9377
|
+
},
|
|
9378
|
+
serviceDefault: async (token) => {
|
|
9379
|
+
const call = remote.managedServiceCredentials;
|
|
9380
|
+
if (call === void 0) return false;
|
|
9381
|
+
const result = await call(token);
|
|
9382
|
+
return result.ok ? result.value.enabled && result.value.defaultForNewConnections : false;
|
|
9383
|
+
},
|
|
9384
|
+
credentialSection: (state, help) => {
|
|
9385
|
+
const { sites, siteId, email } = state.extra;
|
|
9386
|
+
if (!(sites.length > 0)) return null;
|
|
9387
|
+
const needsChoice = sites.length > 1;
|
|
9388
|
+
const service = serviceConnectOption(state);
|
|
9389
|
+
const sitePicker = needsChoice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9390
|
+
className: "dsh-qa-integrations__field",
|
|
9391
|
+
children: ["Сайт Jira", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
9392
|
+
className: "dsh-qa-integrations__input",
|
|
9393
|
+
value: siteId,
|
|
9394
|
+
disabled: state.busy,
|
|
9395
|
+
onChange: (event) => state.extra.setSiteId(event.currentTarget.value),
|
|
9396
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9397
|
+
value: "",
|
|
9398
|
+
children: "Выберите сайт"
|
|
9399
|
+
}), sites.map((site) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9400
|
+
value: site.id,
|
|
9401
|
+
children: site.label
|
|
9402
|
+
}, site.id))]
|
|
9403
|
+
})]
|
|
9404
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
9405
|
+
className: "dsh-qa-integrations__muted",
|
|
9406
|
+
children: [
|
|
9407
|
+
"Сайт: ",
|
|
9408
|
+
sites[0]?.label ?? "",
|
|
9409
|
+
" — задан оператором стенда"
|
|
9410
|
+
]
|
|
9411
|
+
});
|
|
9412
|
+
if (state.useService) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9413
|
+
className: "dsh-qa-integrations__section",
|
|
9414
|
+
children: [
|
|
9415
|
+
sitePicker,
|
|
9416
|
+
service,
|
|
9476
9417
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9477
9418
|
className: "dsh-qa-integrations__actions",
|
|
9478
|
-
children: [
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9419
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9420
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9421
|
+
type: "button",
|
|
9422
|
+
disabled: state.busy || needsChoice && siteId === "",
|
|
9423
|
+
onClick: state.save,
|
|
9424
|
+
children: "Подключить сервисный токен"
|
|
9425
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9426
|
+
className: "dsh-qa-integrations__button",
|
|
9427
|
+
type: "button",
|
|
9428
|
+
disabled: state.busy,
|
|
9429
|
+
onClick: state.cancelCredential,
|
|
9430
|
+
children: "Отмена"
|
|
9431
|
+
}) : null]
|
|
9432
|
+
})
|
|
9433
|
+
]
|
|
9434
|
+
});
|
|
9435
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9436
|
+
className: "dsh-qa-integrations__section",
|
|
9437
|
+
children: [
|
|
9438
|
+
service,
|
|
9439
|
+
sitePicker,
|
|
9440
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9441
|
+
className: "dsh-qa-integrations__field",
|
|
9442
|
+
children: ["Аккаунт Atlassian (e-mail)", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9443
|
+
className: "dsh-qa-integrations__input",
|
|
9444
|
+
type: "email",
|
|
9445
|
+
autoComplete: "off",
|
|
9446
|
+
value: email,
|
|
9447
|
+
disabled: state.busy,
|
|
9448
|
+
onChange: (event) => state.extra.setEmail(event.currentTarget.value),
|
|
9449
|
+
placeholder: "ivan@example.com"
|
|
9450
|
+
})]
|
|
9501
9451
|
}),
|
|
9502
|
-
|
|
9503
|
-
className: "dsh-qa-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
onClick: () => void disconnect(),
|
|
9513
|
-
children: "Да, отключить"
|
|
9514
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9515
|
-
className: "dsh-qa-integrations__button",
|
|
9516
|
-
type: "button",
|
|
9517
|
-
disabled: busy,
|
|
9518
|
-
onClick: () => setConfirmDisconnect(false),
|
|
9519
|
-
children: "Отмена"
|
|
9520
|
-
})]
|
|
9452
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9453
|
+
className: "dsh-qa-integrations__field",
|
|
9454
|
+
children: ["API-токен Jira", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
9455
|
+
className: "dsh-qa-integrations__input",
|
|
9456
|
+
type: "password",
|
|
9457
|
+
autoComplete: "new-password",
|
|
9458
|
+
value: state.credential,
|
|
9459
|
+
disabled: state.busy,
|
|
9460
|
+
onChange: (event) => state.setCredential(event.currentTarget.value),
|
|
9461
|
+
placeholder: "ATATT…"
|
|
9521
9462
|
})]
|
|
9522
|
-
})
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9463
|
+
}),
|
|
9464
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredentialHelpNote, { help }),
|
|
9465
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9466
|
+
className: "dsh-qa-integrations__hint",
|
|
9467
|
+
children: "Токен и e-mail хранятся в зашифрованном виде и после сохранения не отображаются."
|
|
9468
|
+
}),
|
|
9469
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9470
|
+
className: "dsh-qa-integrations__actions",
|
|
9471
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9472
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9473
|
+
type: "button",
|
|
9474
|
+
disabled: state.busy || state.credential.trim() === "" || email.trim() === "" || needsChoice && siteId === "",
|
|
9475
|
+
onClick: state.save,
|
|
9476
|
+
children: "Сохранить и проверить"
|
|
9477
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9478
|
+
className: "dsh-qa-integrations__button",
|
|
9479
|
+
type: "button",
|
|
9480
|
+
disabled: state.busy,
|
|
9481
|
+
onClick: state.cancelCredential,
|
|
9482
|
+
children: "Отмена"
|
|
9483
|
+
}) : null]
|
|
9484
|
+
})
|
|
9485
|
+
]
|
|
9486
|
+
});
|
|
9487
|
+
},
|
|
9488
|
+
notConfiguredHint: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9489
|
+
className: "dsh-qa-integrations__hint",
|
|
9490
|
+
children: "Оператор не настроил ни одного сайта Jira, подключать нечего. Адреса сайтов задаются в конфигурации развёртывания."
|
|
9491
|
+
})
|
|
9492
|
+
});
|
|
9527
9493
|
}
|
|
9528
9494
|
//#endregion
|
|
9529
9495
|
//#region src/client/teamcity.tsx
|
|
@@ -9689,7 +9655,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9689
9655
|
RateLimited: "Слишком много запросов. Попробуйте позже.",
|
|
9690
9656
|
ResultTooLarge: "Ответ Test IT слишком большой для одного запроса. Сузьте фильтр или лимит.",
|
|
9691
9657
|
UpstreamTimeout: "Test IT не ответил вовремя. Попробуйте ещё раз.",
|
|
9692
|
-
TlsFailure: "Сертификат Test IT не принят стендом. Нужен сертификат, которому доверяет сервер."
|
|
9658
|
+
TlsFailure: "Сертификат Test IT не принят стендом. Нужен сертификат, которому доверяет сервер.",
|
|
9659
|
+
ServiceCredentialUnavailable: "Для этой инсталляции администратор не настроил сервисный токен.",
|
|
9660
|
+
ServiceCredentialDisabled: "Сервисный токен этой инсталляции отключён администратором.",
|
|
9661
|
+
ServiceCredentialInvalid: "Сервисный токен не подходит для выбранной инсталляции. Сообщите администратору.",
|
|
9662
|
+
PersonalCredentialRequired: "Личный токен не сохранён: подключите его, чтобы вернуться к личному аккаунту.",
|
|
9663
|
+
ServiceResourceNotAllowed: "Сервисный токен не даёт доступа к этому проекту. Сузьте доступ в списке или подключите личный аккаунт.",
|
|
9664
|
+
SensitiveReadRequiresPersonalCredential: "Эта операция может содержать личные или чувствительные данные. Подключите личный аккаунт, чтобы использовать её.",
|
|
9665
|
+
OperationNotAllowedWithServiceCredential: "Сервисный режим — только безопасное чтение: изменения недоступны."
|
|
9693
9666
|
};
|
|
9694
9667
|
function createTestitCard(remote) {
|
|
9695
9668
|
return createProviderCard({
|
|
@@ -9718,40 +9691,83 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9718
9691
|
accept(await remote.getTestit(token));
|
|
9719
9692
|
},
|
|
9720
9693
|
calls: {
|
|
9721
|
-
save: (token, credential, extra) => remote.putTestitCredential(token, {
|
|
9694
|
+
save: (token, credential, extra, options) => remote.putTestitCredential(token, {
|
|
9722
9695
|
instanceId: extra.instanceId,
|
|
9723
|
-
token: credential
|
|
9696
|
+
token: credential,
|
|
9697
|
+
useServiceCredential: options.useServiceCredential
|
|
9724
9698
|
}),
|
|
9725
9699
|
test: (token) => remote.testTestit(token),
|
|
9726
9700
|
patch: (token, patch) => remote.patchTestitPolicy(token, patch),
|
|
9727
|
-
disconnect: (token) => remote.disconnectTestit(token)
|
|
9701
|
+
disconnect: (token) => remote.disconnectTestit(token),
|
|
9702
|
+
setSource: (token, source) => remote.credentialSource(token, {
|
|
9703
|
+
provider: "testit",
|
|
9704
|
+
source
|
|
9705
|
+
}),
|
|
9706
|
+
setBoundary: (token, selection) => remote.serviceBoundary(token, {
|
|
9707
|
+
provider: "testit",
|
|
9708
|
+
selection
|
|
9709
|
+
})
|
|
9710
|
+
},
|
|
9711
|
+
serviceBinding: (extra) => {
|
|
9712
|
+
if (extra.instanceId === "") return extra.instances.length === 1 ? extra.instances[0]?.service ?? null : null;
|
|
9713
|
+
return extra.instances.find((instance) => instance.id === extra.instanceId)?.service ?? null;
|
|
9714
|
+
},
|
|
9715
|
+
serviceDefault: async (token) => {
|
|
9716
|
+
const result = await remote.managedServiceCredentials(token);
|
|
9717
|
+
return result.ok ? result.value.enabled && result.value.defaultForNewConnections : false;
|
|
9728
9718
|
},
|
|
9729
9719
|
credentialSection: (state, help) => {
|
|
9730
9720
|
const { instances, instanceId } = state.extra;
|
|
9731
9721
|
if (!(instances.length > 0)) return null;
|
|
9732
9722
|
const needsChoice = instances.length > 1;
|
|
9733
|
-
|
|
9723
|
+
const service = serviceConnectOption(state);
|
|
9724
|
+
const instancePicker = needsChoice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9725
|
+
className: "dsh-qa-integrations__field",
|
|
9726
|
+
children: ["Инсталляция Test IT", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
9727
|
+
className: "dsh-qa-integrations__input",
|
|
9728
|
+
value: instanceId,
|
|
9729
|
+
disabled: state.busy,
|
|
9730
|
+
onChange: (event) => state.extra.setInstanceId(event.currentTarget.value),
|
|
9731
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9732
|
+
value: "",
|
|
9733
|
+
children: "Выберите инсталляцию"
|
|
9734
|
+
}), instances.map((instance) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9735
|
+
value: instance.id,
|
|
9736
|
+
children: instance.label
|
|
9737
|
+
}, instance.id))]
|
|
9738
|
+
})]
|
|
9739
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
9740
|
+
className: "dsh-qa-integrations__muted",
|
|
9741
|
+
children: ["Инсталляция: ", instances[0]?.label ?? ""]
|
|
9742
|
+
});
|
|
9743
|
+
if (state.useService) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9734
9744
|
className: "dsh-qa-integrations__section",
|
|
9735
9745
|
children: [
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9746
|
+
instancePicker,
|
|
9747
|
+
service,
|
|
9748
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9749
|
+
className: "dsh-qa-integrations__actions",
|
|
9750
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9751
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9752
|
+
type: "button",
|
|
9753
|
+
disabled: state.busy || needsChoice && instanceId === "",
|
|
9754
|
+
onClick: state.save,
|
|
9755
|
+
children: "Подключить сервисный токен"
|
|
9756
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9757
|
+
className: "dsh-qa-integrations__button",
|
|
9758
|
+
type: "button",
|
|
9741
9759
|
disabled: state.busy,
|
|
9742
|
-
|
|
9743
|
-
children:
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
children: ["Инсталляция: ", instances[0]?.label ?? ""]
|
|
9754
|
-
}),
|
|
9760
|
+
onClick: state.cancelCredential,
|
|
9761
|
+
children: "Отмена"
|
|
9762
|
+
}) : null]
|
|
9763
|
+
})
|
|
9764
|
+
]
|
|
9765
|
+
});
|
|
9766
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9767
|
+
className: "dsh-qa-integrations__section",
|
|
9768
|
+
children: [
|
|
9769
|
+
service,
|
|
9770
|
+
instancePicker,
|
|
9755
9771
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9756
9772
|
className: "dsh-qa-integrations__field",
|
|
9757
9773
|
children: ["API-токен Test IT", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
@@ -9808,7 +9824,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9808
9824
|
RateLimited: "Слишком много запросов. Попробуйте позже.",
|
|
9809
9825
|
ResultTooLarge: "Ответ Weblate слишком большой для одного запроса.",
|
|
9810
9826
|
UpstreamTimeout: "Weblate не ответил вовремя. Попробуйте ещё раз.",
|
|
9811
|
-
TlsFailure: "Сертификат Weblate не принят стендом. Нужен сертификат, которому доверяет сервер."
|
|
9827
|
+
TlsFailure: "Сертификат Weblate не принят стендом. Нужен сертификат, которому доверяет сервер.",
|
|
9828
|
+
ServiceCredentialUnavailable: "Для этого инстанса администратор не настроил сервисный токен.",
|
|
9829
|
+
ServiceCredentialDisabled: "Сервисный токен этого инстанса отключён администратором.",
|
|
9830
|
+
ServiceCredentialInvalid: "Сервисный токен не подходит для выбранного инстанса. Сообщите администратору.",
|
|
9831
|
+
PersonalCredentialRequired: "Личный токен не сохранён: подключите его, чтобы вернуться к личному аккаунту.",
|
|
9832
|
+
ServiceResourceNotAllowed: "Сервисный токен не даёт доступа к этому проекту. Сузьте доступ в списке или подключите личный аккаунт.",
|
|
9833
|
+
SensitiveReadRequiresPersonalCredential: "Эта операция может содержать личные или чувствительные данные. Подключите личный аккаунт, чтобы использовать её.",
|
|
9834
|
+
OperationNotAllowedWithServiceCredential: "Сервисный режим — только безопасное чтение: изменения недоступны."
|
|
9812
9835
|
};
|
|
9813
9836
|
function createWeblateCard(remote) {
|
|
9814
9837
|
return createProviderCard({
|
|
@@ -9842,40 +9865,83 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9842
9865
|
accept(await remote.getWeblate(token));
|
|
9843
9866
|
},
|
|
9844
9867
|
calls: {
|
|
9845
|
-
save: (token, credential, extra) => remote.putWeblateCredential(token, {
|
|
9868
|
+
save: (token, credential, extra, options) => remote.putWeblateCredential(token, {
|
|
9846
9869
|
instanceId: extra.instanceId,
|
|
9847
|
-
token: credential
|
|
9870
|
+
token: credential,
|
|
9871
|
+
useServiceCredential: options.useServiceCredential
|
|
9848
9872
|
}),
|
|
9849
9873
|
test: (token) => remote.testWeblate(token),
|
|
9850
9874
|
patch: (token, patch) => remote.patchWeblatePolicy(token, patch),
|
|
9851
|
-
disconnect: (token) => remote.disconnectWeblate(token)
|
|
9875
|
+
disconnect: (token) => remote.disconnectWeblate(token),
|
|
9876
|
+
setSource: (token, source) => remote.credentialSource(token, {
|
|
9877
|
+
provider: "weblate",
|
|
9878
|
+
source
|
|
9879
|
+
}),
|
|
9880
|
+
setBoundary: (token, selection) => remote.serviceBoundary(token, {
|
|
9881
|
+
provider: "weblate",
|
|
9882
|
+
selection
|
|
9883
|
+
})
|
|
9884
|
+
},
|
|
9885
|
+
serviceBinding: (extra) => {
|
|
9886
|
+
if (extra.instanceId === "") return extra.instances.length === 1 ? extra.instances[0]?.service ?? null : null;
|
|
9887
|
+
return extra.instances.find((instance) => instance.id === extra.instanceId)?.service ?? null;
|
|
9888
|
+
},
|
|
9889
|
+
serviceDefault: async (token) => {
|
|
9890
|
+
const result = await remote.managedServiceCredentials(token);
|
|
9891
|
+
return result.ok ? result.value.enabled && result.value.defaultForNewConnections : false;
|
|
9852
9892
|
},
|
|
9853
9893
|
credentialSection: (state, help) => {
|
|
9854
9894
|
const { instances, instanceId } = state.extra;
|
|
9855
9895
|
if (!(instances.length > 0)) return null;
|
|
9856
9896
|
const needsChoice = instances.length > 1;
|
|
9857
|
-
|
|
9897
|
+
const service = serviceConnectOption(state);
|
|
9898
|
+
const instancePicker = needsChoice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9899
|
+
className: "dsh-qa-integrations__field",
|
|
9900
|
+
children: ["Инстанс Weblate", /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
9901
|
+
className: "dsh-qa-integrations__input",
|
|
9902
|
+
value: instanceId,
|
|
9903
|
+
disabled: state.busy,
|
|
9904
|
+
onChange: (event) => state.extra.setInstanceId(event.currentTarget.value),
|
|
9905
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9906
|
+
value: "",
|
|
9907
|
+
children: "Выберите инстанс"
|
|
9908
|
+
}), instances.map((instance) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
9909
|
+
value: instance.id,
|
|
9910
|
+
children: instance.label
|
|
9911
|
+
}, instance.id))]
|
|
9912
|
+
})]
|
|
9913
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
9914
|
+
className: "dsh-qa-integrations__muted",
|
|
9915
|
+
children: ["Инстанс: ", instances[0]?.label ?? ""]
|
|
9916
|
+
});
|
|
9917
|
+
if (state.useService) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9858
9918
|
className: "dsh-qa-integrations__section",
|
|
9859
9919
|
children: [
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9920
|
+
instancePicker,
|
|
9921
|
+
service,
|
|
9922
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9923
|
+
className: "dsh-qa-integrations__actions",
|
|
9924
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9925
|
+
className: "dsh-qa-integrations__button dsh-qa-integrations__button--primary",
|
|
9926
|
+
type: "button",
|
|
9927
|
+
disabled: state.busy || needsChoice && instanceId === "",
|
|
9928
|
+
onClick: state.save,
|
|
9929
|
+
children: "Подключить сервисный токен"
|
|
9930
|
+
}), state.connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9931
|
+
className: "dsh-qa-integrations__button",
|
|
9932
|
+
type: "button",
|
|
9865
9933
|
disabled: state.busy,
|
|
9866
|
-
|
|
9867
|
-
children:
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
children: ["Инстанс: ", instances[0]?.label ?? ""]
|
|
9878
|
-
}),
|
|
9934
|
+
onClick: state.cancelCredential,
|
|
9935
|
+
children: "Отмена"
|
|
9936
|
+
}) : null]
|
|
9937
|
+
})
|
|
9938
|
+
]
|
|
9939
|
+
});
|
|
9940
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9941
|
+
className: "dsh-qa-integrations__section",
|
|
9942
|
+
children: [
|
|
9943
|
+
service,
|
|
9944
|
+
instancePicker,
|
|
9879
9945
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
9880
9946
|
className: "dsh-qa-integrations__field",
|
|
9881
9947
|
children: ["API-токен Weblate", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
@@ -10024,55 +10090,1944 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10024
10090
|
});
|
|
10025
10091
|
};
|
|
10026
10092
|
}
|
|
10027
|
-
//#endregion
|
|
10028
|
-
//#region src/client/card.tsx
|
|
10029
|
-
/** What the card shows while no QA account is signed in. */
|
|
10030
|
-
function gateCopy(stage) {
|
|
10031
|
-
switch (stage) {
|
|
10032
|
-
case "checking": return "Проверяем вход в QA Surface…";
|
|
10033
|
-
case "anonymous": return "Войдите в QA Surface, чтобы подключать свои сервисы: подключение принадлежит вашему аккаунту, а не стенду.";
|
|
10034
|
-
default: return "";
|
|
10093
|
+
//#endregion
|
|
10094
|
+
//#region src/client/card.tsx
|
|
10095
|
+
/** What the card shows while no QA account is signed in. */
|
|
10096
|
+
function gateCopy(stage) {
|
|
10097
|
+
switch (stage) {
|
|
10098
|
+
case "checking": return "Проверяем вход в QA Surface…";
|
|
10099
|
+
case "anonymous": return "Войдите в QA Surface, чтобы подключать свои сервисы: подключение принадлежит вашему аккаунту, а не стенду.";
|
|
10100
|
+
default: return "";
|
|
10101
|
+
}
|
|
10102
|
+
}
|
|
10103
|
+
/**
|
|
10104
|
+
* The Integrations card shown inside the plugin-owned host settings tab.
|
|
10105
|
+
*
|
|
10106
|
+
* A connection belongs to a QA account, and the token of that account is the
|
|
10107
|
+
* only credential the principal-scoped remotes accept, so the card renders the
|
|
10108
|
+
* provider cards only once the QA session service reports a signed-in account —
|
|
10109
|
+
* and says so instead of showing forms that could only fail.
|
|
10110
|
+
*/
|
|
10111
|
+
function createIntegrationsCard(remote, providers, session) {
|
|
10112
|
+
const ProviderCards = createProviderCards(remote);
|
|
10113
|
+
return function IntegrationsCard() {
|
|
10114
|
+
const snapshot = (0, react.useSyncExternalStore)(session.subscribe, session.getSnapshot, session.getSnapshot);
|
|
10115
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardShell, {
|
|
10116
|
+
title: "Интеграции",
|
|
10117
|
+
description: "Свои рабочие сервисы: подключения принадлежат вашему аккаунту QA.",
|
|
10118
|
+
label: (open) => open ? "Свернуть настройки интеграций" : "Развернуть настройки интеграций",
|
|
10119
|
+
bodyClassName: "dsh-qa-integrations__body",
|
|
10120
|
+
children: snapshot.stage === "authed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderCards, {
|
|
10121
|
+
token: snapshot.token,
|
|
10122
|
+
providers
|
|
10123
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10124
|
+
className: "dsh-qa-integrations__notice",
|
|
10125
|
+
children: INTEGRATIONS_DISCLOSURE
|
|
10126
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10127
|
+
className: "dsh-qa-integrations__hint",
|
|
10128
|
+
children: gateCopy(snapshot.stage)
|
|
10129
|
+
})
|
|
10130
|
+
});
|
|
10131
|
+
};
|
|
10132
|
+
}
|
|
10133
|
+
/** Host tab wrapper that preserves the card shell's direct ul > li contract. */
|
|
10134
|
+
function createIntegrationsHostTab(remote, providers, session) {
|
|
10135
|
+
const IntegrationsCard = createIntegrationsCard(remote, providers, session);
|
|
10136
|
+
return function IntegrationsHostTab() {
|
|
10137
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
10138
|
+
className: "dsh-qa-integrations__host-tab",
|
|
10139
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IntegrationsCard, {})
|
|
10140
|
+
});
|
|
10141
|
+
};
|
|
10142
|
+
}
|
|
10143
|
+
//#endregion
|
|
10144
|
+
//#region src/client/operator-controls.tsx
|
|
10145
|
+
/**
|
|
10146
|
+
* Shared controls of the operator card body.
|
|
10147
|
+
*
|
|
10148
|
+
* Every control edits the settings namespace through a path-addressed write,
|
|
10149
|
+
* and text, number and list drafts commit on blur or Enter rather than per
|
|
10150
|
+
* keystroke: a half-typed value is one the Host refuses, and a refusal
|
|
10151
|
+
* mid-typing would clear the field the operator is still editing. Structured
|
|
10152
|
+
* values (instance lists, records, credential profiles) commit as a whole at
|
|
10153
|
+
* the parent path, because the Host stores the user layer per section path.
|
|
10154
|
+
*/
|
|
10155
|
+
function OverriddenMark(props) {
|
|
10156
|
+
if (!props.shown) return null;
|
|
10157
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10158
|
+
className: "qai-op__overridden",
|
|
10159
|
+
children: "переопределено"
|
|
10160
|
+
});
|
|
10161
|
+
}
|
|
10162
|
+
/** The control's DOM id, derived from its settings path: one per field. */
|
|
10163
|
+
function fieldId(path) {
|
|
10164
|
+
return `qai-op-${path.join("-")}`;
|
|
10165
|
+
}
|
|
10166
|
+
function FieldFrame(props) {
|
|
10167
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10168
|
+
className: "qai-op__field",
|
|
10169
|
+
children: [
|
|
10170
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10171
|
+
className: "qai-op__label",
|
|
10172
|
+
htmlFor: fieldId(props.path),
|
|
10173
|
+
children: [props.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverriddenMark, { shown: props.overridden })]
|
|
10174
|
+
}),
|
|
10175
|
+
props.children,
|
|
10176
|
+
props.hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10177
|
+
className: "qai-op__hint",
|
|
10178
|
+
children: props.hint
|
|
10179
|
+
})
|
|
10180
|
+
]
|
|
10181
|
+
});
|
|
10182
|
+
}
|
|
10183
|
+
/** Two-state control with a label and an explanatory hint. */
|
|
10184
|
+
function Toggle(props) {
|
|
10185
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10186
|
+
className: "qai-op__toggle-row",
|
|
10187
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10188
|
+
className: "qai-op__toggle-copy",
|
|
10189
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("strong", { children: [props.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverriddenMark, { shown: props.overridden === true })] }), props.hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: props.hint })]
|
|
10190
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10191
|
+
className: "qai-op__toggle",
|
|
10192
|
+
type: "checkbox",
|
|
10193
|
+
checked: props.value,
|
|
10194
|
+
disabled: props.disabled,
|
|
10195
|
+
onChange: (event) => {
|
|
10196
|
+
props.write(props.path, event.currentTarget.checked);
|
|
10197
|
+
}
|
|
10198
|
+
})]
|
|
10199
|
+
});
|
|
10200
|
+
}
|
|
10201
|
+
/** Whole-number control; the draft commits on blur and on Enter. */
|
|
10202
|
+
function NumberField(props) {
|
|
10203
|
+
const [draft, setDraft] = (0, react.useState)(props.value === void 0 ? "" : String(props.value));
|
|
10204
|
+
(0, react.useEffect)(() => {
|
|
10205
|
+
setDraft(props.value === void 0 ? "" : String(props.value));
|
|
10206
|
+
}, [props.value]);
|
|
10207
|
+
const commit = () => {
|
|
10208
|
+
const text = draft.trim();
|
|
10209
|
+
if (text === "") {
|
|
10210
|
+
if (props.value !== void 0) props.unset(props.path);
|
|
10211
|
+
return;
|
|
10212
|
+
}
|
|
10213
|
+
const next = Number(text);
|
|
10214
|
+
if (!Number.isFinite(next) || next === props.value) return;
|
|
10215
|
+
props.write(props.path, next);
|
|
10216
|
+
};
|
|
10217
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldFrame, {
|
|
10218
|
+
label: props.label,
|
|
10219
|
+
path: props.path,
|
|
10220
|
+
overridden: props.overridden(props.path),
|
|
10221
|
+
hint: props.hint,
|
|
10222
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10223
|
+
id: fieldId(props.path),
|
|
10224
|
+
className: "qai-op__input",
|
|
10225
|
+
type: "text",
|
|
10226
|
+
inputMode: "numeric",
|
|
10227
|
+
value: draft,
|
|
10228
|
+
disabled: props.disabled,
|
|
10229
|
+
onChange: (event) => {
|
|
10230
|
+
setDraft(event.currentTarget.value);
|
|
10231
|
+
},
|
|
10232
|
+
onBlur: commit,
|
|
10233
|
+
onKeyDown: (event) => {
|
|
10234
|
+
if (event.key === "Enter") {
|
|
10235
|
+
event.preventDefault();
|
|
10236
|
+
commit();
|
|
10237
|
+
}
|
|
10238
|
+
}
|
|
10239
|
+
})
|
|
10240
|
+
});
|
|
10241
|
+
}
|
|
10242
|
+
/** Free-text control; the draft commits on blur and on Enter. */
|
|
10243
|
+
function TextField(props) {
|
|
10244
|
+
const [draft, setDraft] = (0, react.useState)(props.value ?? "");
|
|
10245
|
+
(0, react.useEffect)(() => {
|
|
10246
|
+
setDraft(props.value ?? "");
|
|
10247
|
+
}, [props.value]);
|
|
10248
|
+
const commit = () => {
|
|
10249
|
+
const next = draft.trim();
|
|
10250
|
+
if (next === "") {
|
|
10251
|
+
if (props.value !== void 0 && props.value !== "") props.unset(props.path);
|
|
10252
|
+
return;
|
|
10253
|
+
}
|
|
10254
|
+
if (next === props.value) return;
|
|
10255
|
+
props.write(props.path, next);
|
|
10256
|
+
};
|
|
10257
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldFrame, {
|
|
10258
|
+
label: props.label,
|
|
10259
|
+
path: props.path,
|
|
10260
|
+
overridden: props.overridden(props.path),
|
|
10261
|
+
hint: props.hint,
|
|
10262
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10263
|
+
id: fieldId(props.path),
|
|
10264
|
+
className: "qai-op__input",
|
|
10265
|
+
type: "text",
|
|
10266
|
+
value: draft,
|
|
10267
|
+
placeholder: props.placeholder,
|
|
10268
|
+
disabled: props.disabled,
|
|
10269
|
+
onChange: (event) => {
|
|
10270
|
+
setDraft(event.currentTarget.value);
|
|
10271
|
+
},
|
|
10272
|
+
onBlur: commit,
|
|
10273
|
+
onKeyDown: (event) => {
|
|
10274
|
+
if (event.key === "Enter") {
|
|
10275
|
+
event.preventDefault();
|
|
10276
|
+
commit();
|
|
10277
|
+
}
|
|
10278
|
+
}
|
|
10279
|
+
})
|
|
10280
|
+
});
|
|
10281
|
+
}
|
|
10282
|
+
/** Fixed-option control for the schema's string unions. */
|
|
10283
|
+
function SelectField(props) {
|
|
10284
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldFrame, {
|
|
10285
|
+
label: props.label,
|
|
10286
|
+
path: props.path,
|
|
10287
|
+
overridden: props.overridden(props.path),
|
|
10288
|
+
hint: props.hint,
|
|
10289
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
10290
|
+
id: fieldId(props.path),
|
|
10291
|
+
className: "qai-op__input",
|
|
10292
|
+
value: props.value,
|
|
10293
|
+
disabled: props.disabled,
|
|
10294
|
+
onChange: (event) => {
|
|
10295
|
+
props.write(props.path, event.currentTarget.value);
|
|
10296
|
+
},
|
|
10297
|
+
children: props.options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
10298
|
+
value: option.value,
|
|
10299
|
+
children: option.label
|
|
10300
|
+
}, option.value))
|
|
10301
|
+
})
|
|
10302
|
+
});
|
|
10303
|
+
}
|
|
10304
|
+
/**
|
|
10305
|
+
* List of strings; every committed value replaces the whole array at the
|
|
10306
|
+
* parent path, which is the granularity the namespace stores.
|
|
10307
|
+
*/
|
|
10308
|
+
function StringListField(props) {
|
|
10309
|
+
const [draft, setDraft] = (0, react.useState)("");
|
|
10310
|
+
const commit = (next) => {
|
|
10311
|
+
if (next.length === 0) props.unset(props.path);
|
|
10312
|
+
else props.write(props.path, next);
|
|
10313
|
+
};
|
|
10314
|
+
const add = () => {
|
|
10315
|
+
const value = draft.trim();
|
|
10316
|
+
if (value === "" || props.values.includes(value)) return;
|
|
10317
|
+
commit([...props.values, value]);
|
|
10318
|
+
setDraft("");
|
|
10319
|
+
};
|
|
10320
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FieldFrame, {
|
|
10321
|
+
label: props.label,
|
|
10322
|
+
path: props.path,
|
|
10323
|
+
overridden: props.overridden(props.path),
|
|
10324
|
+
hint: props.hint,
|
|
10325
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
10326
|
+
className: "qai-op__rows",
|
|
10327
|
+
children: props.values.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
10328
|
+
className: "qai-op__row",
|
|
10329
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10330
|
+
className: "qai-op__row-value",
|
|
10331
|
+
children: row
|
|
10332
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10333
|
+
type: "button",
|
|
10334
|
+
className: "qai-op__row-remove",
|
|
10335
|
+
disabled: props.disabled,
|
|
10336
|
+
onClick: () => {
|
|
10337
|
+
commit(props.values.filter((_, at) => at !== index));
|
|
10338
|
+
},
|
|
10339
|
+
children: "убрать"
|
|
10340
|
+
})]
|
|
10341
|
+
}, `${index}:${row}`))
|
|
10342
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10343
|
+
className: "qai-op__row-add",
|
|
10344
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10345
|
+
className: "qai-op__input",
|
|
10346
|
+
type: "text",
|
|
10347
|
+
value: draft,
|
|
10348
|
+
placeholder: props.placeholder,
|
|
10349
|
+
disabled: props.disabled,
|
|
10350
|
+
onChange: (event) => {
|
|
10351
|
+
setDraft(event.currentTarget.value);
|
|
10352
|
+
},
|
|
10353
|
+
onKeyDown: (event) => {
|
|
10354
|
+
if (event.key === "Enter") {
|
|
10355
|
+
event.preventDefault();
|
|
10356
|
+
add();
|
|
10357
|
+
}
|
|
10358
|
+
}
|
|
10359
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10360
|
+
type: "button",
|
|
10361
|
+
className: "qai-op__button",
|
|
10362
|
+
disabled: props.disabled || draft.trim() === "",
|
|
10363
|
+
onClick: add,
|
|
10364
|
+
children: "добавить"
|
|
10365
|
+
})]
|
|
10366
|
+
})]
|
|
10367
|
+
});
|
|
10368
|
+
}
|
|
10369
|
+
/**
|
|
10370
|
+
* Deployment instances (GitLab, Confluence, Jira sites, Test IT, Weblate): a
|
|
10371
|
+
* row edits id, label and address, and every committed edit writes the whole
|
|
10372
|
+
* list, because a partially stored row would fail the resolvers anyway.
|
|
10373
|
+
*/
|
|
10374
|
+
function InstanceListField(props) {
|
|
10375
|
+
const [drafts, setDrafts] = (0, react.useState)(() => props.instances.map((row) => ({ ...row })));
|
|
10376
|
+
(0, react.useEffect)(() => {
|
|
10377
|
+
setDrafts(props.instances.map((row) => ({ ...row })));
|
|
10378
|
+
}, [props.instances]);
|
|
10379
|
+
const commit = (next) => {
|
|
10380
|
+
setDrafts(next);
|
|
10381
|
+
if (next.length === 0) props.unset(props.path);
|
|
10382
|
+
else props.write(props.path, next.map((row) => ({ ...row })));
|
|
10383
|
+
};
|
|
10384
|
+
const edit = (index, patch) => {
|
|
10385
|
+
commit(props.instances.map((row, at) => at === index ? {
|
|
10386
|
+
...row,
|
|
10387
|
+
...patch
|
|
10388
|
+
} : row));
|
|
10389
|
+
};
|
|
10390
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FieldFrame, {
|
|
10391
|
+
label: props.label,
|
|
10392
|
+
path: props.path,
|
|
10393
|
+
overridden: props.overridden(props.path),
|
|
10394
|
+
hint: props.hint,
|
|
10395
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
10396
|
+
className: "qai-op__instances",
|
|
10397
|
+
children: props.instances.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
10398
|
+
className: "qai-op__instance",
|
|
10399
|
+
children: [
|
|
10400
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10401
|
+
className: "qai-op__instance-cell",
|
|
10402
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10403
|
+
className: "qai-op__instance-key",
|
|
10404
|
+
children: "id"
|
|
10405
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10406
|
+
className: "qai-op__input",
|
|
10407
|
+
type: "text",
|
|
10408
|
+
value: drafts[index]?.id ?? "",
|
|
10409
|
+
placeholder: "corp",
|
|
10410
|
+
disabled: props.disabled,
|
|
10411
|
+
onChange: (event) => {
|
|
10412
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
10413
|
+
...draft,
|
|
10414
|
+
id: event.currentTarget.value
|
|
10415
|
+
} : draft));
|
|
10416
|
+
},
|
|
10417
|
+
onBlur: () => {
|
|
10418
|
+
const id = drafts[index]?.id.trim() ?? "";
|
|
10419
|
+
if (id !== "" && id !== row.id) edit(index, { id });
|
|
10420
|
+
}
|
|
10421
|
+
})]
|
|
10422
|
+
}),
|
|
10423
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10424
|
+
className: "qai-op__instance-cell",
|
|
10425
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10426
|
+
className: "qai-op__instance-key",
|
|
10427
|
+
children: "название"
|
|
10428
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10429
|
+
className: "qai-op__input",
|
|
10430
|
+
type: "text",
|
|
10431
|
+
value: drafts[index]?.label ?? "",
|
|
10432
|
+
placeholder: "Корпоративный GitLab",
|
|
10433
|
+
disabled: props.disabled,
|
|
10434
|
+
onChange: (event) => {
|
|
10435
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
10436
|
+
...draft,
|
|
10437
|
+
label: event.currentTarget.value
|
|
10438
|
+
} : draft));
|
|
10439
|
+
},
|
|
10440
|
+
onBlur: () => {
|
|
10441
|
+
const label = drafts[index]?.label.trim() ?? "";
|
|
10442
|
+
if (label !== "" && label !== row.label) edit(index, { label });
|
|
10443
|
+
}
|
|
10444
|
+
})]
|
|
10445
|
+
}),
|
|
10446
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10447
|
+
className: "qai-op__instance-cell qai-op__instance-cell--wide",
|
|
10448
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10449
|
+
className: "qai-op__instance-key",
|
|
10450
|
+
children: "адрес"
|
|
10451
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10452
|
+
className: "qai-op__input",
|
|
10453
|
+
type: "text",
|
|
10454
|
+
value: drafts[index]?.baseUrl ?? "",
|
|
10455
|
+
placeholder: "https://gitlab.example.corp",
|
|
10456
|
+
disabled: props.disabled,
|
|
10457
|
+
onChange: (event) => {
|
|
10458
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
10459
|
+
...draft,
|
|
10460
|
+
baseUrl: event.currentTarget.value
|
|
10461
|
+
} : draft));
|
|
10462
|
+
},
|
|
10463
|
+
onBlur: () => {
|
|
10464
|
+
const baseUrl = drafts[index]?.baseUrl.trim() ?? "";
|
|
10465
|
+
if (baseUrl !== "" && baseUrl !== row.baseUrl) edit(index, { baseUrl });
|
|
10466
|
+
}
|
|
10467
|
+
})]
|
|
10468
|
+
}),
|
|
10469
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10470
|
+
type: "button",
|
|
10471
|
+
className: "qai-op__row-remove",
|
|
10472
|
+
disabled: props.disabled,
|
|
10473
|
+
onClick: () => {
|
|
10474
|
+
commit(props.instances.filter((_, at) => at !== index));
|
|
10475
|
+
},
|
|
10476
|
+
children: "убрать"
|
|
10477
|
+
})
|
|
10478
|
+
]
|
|
10479
|
+
}, `${index}:${row.id}`))
|
|
10480
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10481
|
+
type: "button",
|
|
10482
|
+
className: "qai-op__button",
|
|
10483
|
+
disabled: props.disabled,
|
|
10484
|
+
onClick: () => {
|
|
10485
|
+
commit([...props.instances, {
|
|
10486
|
+
id: "",
|
|
10487
|
+
label: "",
|
|
10488
|
+
baseUrl: ""
|
|
10489
|
+
}]);
|
|
10490
|
+
},
|
|
10491
|
+
children: "добавить"
|
|
10492
|
+
}) })]
|
|
10493
|
+
});
|
|
10494
|
+
}
|
|
10495
|
+
/**
|
|
10496
|
+
* Mapping control for `fieldAliases`, credential resources and deny policy:
|
|
10497
|
+
* rows of a key and its value, committed as one record at the parent path.
|
|
10498
|
+
* A new entry is typed into the key (and value) inputs and lands in the
|
|
10499
|
+
* record on «добавить»; an existing value commits on blur.
|
|
10500
|
+
*/
|
|
10501
|
+
function RecordField(props) {
|
|
10502
|
+
const [keyDraft, setKeyDraft] = (0, react.useState)("");
|
|
10503
|
+
const [valueDraft, setValueDraft] = (0, react.useState)("");
|
|
10504
|
+
const commit = (next) => {
|
|
10505
|
+
if (next.length === 0) {
|
|
10506
|
+
props.unset(props.path);
|
|
10507
|
+
return;
|
|
10508
|
+
}
|
|
10509
|
+
const record = {};
|
|
10510
|
+
for (const [key, value] of next) record[key] = props.fixedValue ?? value;
|
|
10511
|
+
props.write(props.path, record);
|
|
10512
|
+
};
|
|
10513
|
+
const add = () => {
|
|
10514
|
+
const key = keyDraft.trim();
|
|
10515
|
+
if (key === "" || props.entries.some(([rowKey]) => rowKey === key)) return;
|
|
10516
|
+
const value = props.fixedValue ?? valueDraft.trim();
|
|
10517
|
+
if (value === "") return;
|
|
10518
|
+
commit([...props.entries, [key, value]]);
|
|
10519
|
+
setKeyDraft("");
|
|
10520
|
+
setValueDraft("");
|
|
10521
|
+
};
|
|
10522
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FieldFrame, {
|
|
10523
|
+
label: props.label,
|
|
10524
|
+
path: props.path,
|
|
10525
|
+
overridden: props.overridden(props.path),
|
|
10526
|
+
hint: props.hint,
|
|
10527
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
10528
|
+
className: "qai-op__rows",
|
|
10529
|
+
children: props.entries.map(([key, value]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
10530
|
+
className: "qai-op__row",
|
|
10531
|
+
children: [
|
|
10532
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10533
|
+
className: "qai-op__row-key",
|
|
10534
|
+
children: key
|
|
10535
|
+
}),
|
|
10536
|
+
props.fixedValue === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10537
|
+
className: "qai-op__input",
|
|
10538
|
+
type: "text",
|
|
10539
|
+
defaultValue: value,
|
|
10540
|
+
placeholder: props.valuePlaceholder,
|
|
10541
|
+
disabled: props.disabled,
|
|
10542
|
+
onBlur: (event) => {
|
|
10543
|
+
const next = event.currentTarget.value.trim();
|
|
10544
|
+
if (next !== "" && next !== value) commit(props.entries.map((row) => row[0] === key ? [key, next] : row));
|
|
10545
|
+
},
|
|
10546
|
+
onKeyDown: (event) => {
|
|
10547
|
+
if (event.key === "Enter") {
|
|
10548
|
+
event.preventDefault();
|
|
10549
|
+
event.currentTarget.blur();
|
|
10550
|
+
}
|
|
10551
|
+
}
|
|
10552
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10553
|
+
className: "qai-op__row-value",
|
|
10554
|
+
children: value
|
|
10555
|
+
}),
|
|
10556
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10557
|
+
type: "button",
|
|
10558
|
+
className: "qai-op__row-remove",
|
|
10559
|
+
disabled: props.disabled,
|
|
10560
|
+
onClick: () => {
|
|
10561
|
+
commit(props.entries.filter(([rowKey]) => rowKey !== key));
|
|
10562
|
+
},
|
|
10563
|
+
children: "убрать"
|
|
10564
|
+
})
|
|
10565
|
+
]
|
|
10566
|
+
}, key))
|
|
10567
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10568
|
+
className: "qai-op__row-add",
|
|
10569
|
+
children: [
|
|
10570
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10571
|
+
className: "qai-op__input",
|
|
10572
|
+
type: "text",
|
|
10573
|
+
value: keyDraft,
|
|
10574
|
+
placeholder: props.keyPlaceholder,
|
|
10575
|
+
disabled: props.disabled,
|
|
10576
|
+
onChange: (event) => {
|
|
10577
|
+
setKeyDraft(event.currentTarget.value);
|
|
10578
|
+
},
|
|
10579
|
+
onKeyDown: (event) => {
|
|
10580
|
+
if (event.key === "Enter") {
|
|
10581
|
+
event.preventDefault();
|
|
10582
|
+
add();
|
|
10583
|
+
}
|
|
10584
|
+
}
|
|
10585
|
+
}),
|
|
10586
|
+
props.fixedValue === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10587
|
+
className: "qai-op__input",
|
|
10588
|
+
type: "text",
|
|
10589
|
+
value: valueDraft,
|
|
10590
|
+
placeholder: props.valuePlaceholder,
|
|
10591
|
+
disabled: props.disabled,
|
|
10592
|
+
onChange: (event) => {
|
|
10593
|
+
setValueDraft(event.currentTarget.value);
|
|
10594
|
+
},
|
|
10595
|
+
onKeyDown: (event) => {
|
|
10596
|
+
if (event.key === "Enter") {
|
|
10597
|
+
event.preventDefault();
|
|
10598
|
+
add();
|
|
10599
|
+
}
|
|
10600
|
+
}
|
|
10601
|
+
}) : null,
|
|
10602
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10603
|
+
type: "button",
|
|
10604
|
+
className: "qai-op__button",
|
|
10605
|
+
disabled: props.disabled || keyDraft.trim() === "",
|
|
10606
|
+
onClick: add,
|
|
10607
|
+
children: "добавить"
|
|
10608
|
+
})
|
|
10609
|
+
]
|
|
10610
|
+
})]
|
|
10611
|
+
});
|
|
10612
|
+
}
|
|
10613
|
+
//#endregion
|
|
10614
|
+
//#region src/client/operator-card.tsx
|
|
10615
|
+
function rawObject(value) {
|
|
10616
|
+
return typeof value === "object" && value !== null ? value : {};
|
|
10617
|
+
}
|
|
10618
|
+
function rawArray(value) {
|
|
10619
|
+
return Array.isArray(value) ? value : [];
|
|
10620
|
+
}
|
|
10621
|
+
function rawString(value) {
|
|
10622
|
+
return typeof value === "string" ? value : "";
|
|
10623
|
+
}
|
|
10624
|
+
function rawNumber(value) {
|
|
10625
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
10626
|
+
}
|
|
10627
|
+
function rawStringList(value) {
|
|
10628
|
+
return rawArray(value).filter((row) => typeof row === "string");
|
|
10629
|
+
}
|
|
10630
|
+
function rawRecord(value) {
|
|
10631
|
+
return Object.entries(rawObject(value)).filter((entry) => typeof entry[1] === "string");
|
|
10632
|
+
}
|
|
10633
|
+
function rawBool(value, fallback) {
|
|
10634
|
+
return typeof value === "boolean" ? value : fallback;
|
|
10635
|
+
}
|
|
10636
|
+
/** Resource rows as `kind: v1, v2` text pairs for the record editor. */
|
|
10637
|
+
function resourceRows(value) {
|
|
10638
|
+
return Object.entries(rawObject(value)).map(([kind, values]) => [kind, rawArray(values).map(String).join(", ")]);
|
|
10639
|
+
}
|
|
10640
|
+
/** `{ kind: ["a", "b"] }` from the editor's `kind: "a, b"` rows. */
|
|
10641
|
+
function resourceRecord(rows) {
|
|
10642
|
+
const record = {};
|
|
10643
|
+
for (const [kind, values] of rows) {
|
|
10644
|
+
const list = values.split(",").map((row) => row.trim()).filter((row) => row !== "");
|
|
10645
|
+
if (list.length > 0) record[kind] = list;
|
|
10646
|
+
}
|
|
10647
|
+
return record;
|
|
10648
|
+
}
|
|
10649
|
+
function displayError(error) {
|
|
10650
|
+
if (error instanceof Error) return error.message;
|
|
10651
|
+
if (typeof error === "string") return error;
|
|
10652
|
+
return "Хост отклонил значение.";
|
|
10653
|
+
}
|
|
10654
|
+
/** Whether the raw user layer carries the path (an object walk; lists whole). */
|
|
10655
|
+
function isOverridden(user, path) {
|
|
10656
|
+
let cursor = user;
|
|
10657
|
+
for (const segment of path) {
|
|
10658
|
+
if (typeof cursor !== "object" || cursor === null) return false;
|
|
10659
|
+
cursor = cursor[segment];
|
|
10660
|
+
if (cursor === void 0) return false;
|
|
10661
|
+
}
|
|
10662
|
+
return true;
|
|
10663
|
+
}
|
|
10664
|
+
/** Top-level keys the user layer overrides; what «reset» clears. */
|
|
10665
|
+
function overriddenKeys(user) {
|
|
10666
|
+
return Object.keys(rawObject(user));
|
|
10667
|
+
}
|
|
10668
|
+
function Section(props) {
|
|
10669
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
10670
|
+
className: "qai-op__section",
|
|
10671
|
+
open: props.open,
|
|
10672
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", {
|
|
10673
|
+
className: "qai-op__section-summary",
|
|
10674
|
+
children: [
|
|
10675
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10676
|
+
className: "qai-op__section-title",
|
|
10677
|
+
children: props.title
|
|
10678
|
+
}),
|
|
10679
|
+
props.state === void 0 || props.state === "" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10680
|
+
className: "qai-op__section-state",
|
|
10681
|
+
children: props.state
|
|
10682
|
+
}),
|
|
10683
|
+
props.hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10684
|
+
className: "qai-op__hint",
|
|
10685
|
+
children: props.hint
|
|
10686
|
+
})
|
|
10687
|
+
]
|
|
10688
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10689
|
+
className: "qai-op__section-body",
|
|
10690
|
+
children: props.children
|
|
10691
|
+
})]
|
|
10692
|
+
});
|
|
10693
|
+
}
|
|
10694
|
+
/**
|
|
10695
|
+
* A labelled block inside one section: switches that describe the provider,
|
|
10696
|
+
* the connections it reads through, the surface it opens to the agent, and the
|
|
10697
|
+
* tuning knobs folded away at the end. The fields stay the same controls in the
|
|
10698
|
+
* same paths — only the headings that say what belongs with what change.
|
|
10699
|
+
*/
|
|
10700
|
+
function Group(props) {
|
|
10701
|
+
const className = [
|
|
10702
|
+
"qai-op__group",
|
|
10703
|
+
props.kind === "checks" ? "qai-op__group--checks" : "",
|
|
10704
|
+
props.wide === true ? "qai-op__group--wide" : ""
|
|
10705
|
+
].filter((part) => part !== "").join(" ");
|
|
10706
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
10707
|
+
className,
|
|
10708
|
+
children: [
|
|
10709
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
10710
|
+
className: "qai-op__group-title",
|
|
10711
|
+
children: props.title
|
|
10712
|
+
}),
|
|
10713
|
+
props.hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10714
|
+
className: "qai-op__group-hint",
|
|
10715
|
+
children: props.hint
|
|
10716
|
+
}),
|
|
10717
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10718
|
+
className: "qai-op__grid",
|
|
10719
|
+
children: props.children
|
|
10720
|
+
})
|
|
10721
|
+
]
|
|
10722
|
+
});
|
|
10723
|
+
}
|
|
10724
|
+
/** The tuning knobs of one provider, folded away until someone needs them. */
|
|
10725
|
+
function LimitsGroup(props) {
|
|
10726
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
10727
|
+
className: "qai-op__group qai-op__group--limits",
|
|
10728
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", {
|
|
10729
|
+
className: "qai-op__group-summary",
|
|
10730
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10731
|
+
className: "qai-op__group-title",
|
|
10732
|
+
children: "Ограничения и повторы"
|
|
10733
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10734
|
+
className: "qai-op__group-hint",
|
|
10735
|
+
children: props.hint ?? "потолки ответов и повторы при ошибках провайдера"
|
|
10736
|
+
})]
|
|
10737
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10738
|
+
className: "qai-op__grid",
|
|
10739
|
+
children: props.children
|
|
10740
|
+
})]
|
|
10741
|
+
});
|
|
10742
|
+
}
|
|
10743
|
+
/** `1 инстанс`, `3 инстанса`, `11 инстансов`. */
|
|
10744
|
+
function plural(count, forms) {
|
|
10745
|
+
const mod10 = count % 10;
|
|
10746
|
+
const mod100 = count % 100;
|
|
10747
|
+
const [one, few, many] = forms;
|
|
10748
|
+
if (mod10 === 1 && mod100 !== 11) return `${count} ${one}`;
|
|
10749
|
+
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) return `${count} ${few}`;
|
|
10750
|
+
return `${count} ${many}`;
|
|
10751
|
+
}
|
|
10752
|
+
/** One line describing a collapsed provider: on/off, connections, surface. */
|
|
10753
|
+
function providerState(provider, shape = {}) {
|
|
10754
|
+
const parts = [];
|
|
10755
|
+
if (shape.enabled === true) parts.push(rawBool(provider.enabled, true) ? "включён" : "выключен");
|
|
10756
|
+
for (const entry of shape.counts ?? []) {
|
|
10757
|
+
const list = provider[entry.path];
|
|
10758
|
+
const size = Array.isArray(list) ? list.length : 0;
|
|
10759
|
+
if (size > 0) parts.push(plural(size, entry.forms));
|
|
10760
|
+
}
|
|
10761
|
+
const capabilities = shape.capabilities ?? [];
|
|
10762
|
+
if (capabilities.length > 0) {
|
|
10763
|
+
const on = capabilities.filter(([key, fallback]) => rawBool(provider[key], fallback)).length;
|
|
10764
|
+
parts.push(`доступно ${on} из ${capabilities.length}`);
|
|
10035
10765
|
}
|
|
10766
|
+
return parts.join(" · ");
|
|
10767
|
+
}
|
|
10768
|
+
function instanceRows(value) {
|
|
10769
|
+
return rawArray(value).map(rawObject).map((row) => ({
|
|
10770
|
+
id: rawString(row.id),
|
|
10771
|
+
label: rawString(row.label),
|
|
10772
|
+
baseUrl: rawString(row.baseUrl)
|
|
10773
|
+
}));
|
|
10774
|
+
}
|
|
10775
|
+
function profileDrafts(value) {
|
|
10776
|
+
return rawArray(value).map(rawObject).map((row) => {
|
|
10777
|
+
const credential = rawObject(row.credential);
|
|
10778
|
+
return {
|
|
10779
|
+
id: rawString(row.id),
|
|
10780
|
+
provider: rawString(row.provider),
|
|
10781
|
+
instance: rawString(row.instance),
|
|
10782
|
+
label: rawString(row.label),
|
|
10783
|
+
enabled: rawBool(row.enabled, true),
|
|
10784
|
+
secretFile: rawString(credential.secretFile),
|
|
10785
|
+
secretEnv: rawString(credential.secretEnv),
|
|
10786
|
+
resources: resourceRows(row.resources),
|
|
10787
|
+
policy: rawRecord(row.policy)
|
|
10788
|
+
};
|
|
10789
|
+
});
|
|
10790
|
+
}
|
|
10791
|
+
const PROVIDER_IDS = [
|
|
10792
|
+
"bitrix24",
|
|
10793
|
+
"confluence",
|
|
10794
|
+
"gitlab",
|
|
10795
|
+
"teamcity",
|
|
10796
|
+
"jira",
|
|
10797
|
+
"testit",
|
|
10798
|
+
"weblate"
|
|
10799
|
+
];
|
|
10800
|
+
function profileWire(draft) {
|
|
10801
|
+
const wire = {
|
|
10802
|
+
id: draft.id.trim(),
|
|
10803
|
+
provider: draft.provider.trim(),
|
|
10804
|
+
instance: draft.instance.trim(),
|
|
10805
|
+
label: draft.label.trim(),
|
|
10806
|
+
enabled: draft.enabled
|
|
10807
|
+
};
|
|
10808
|
+
const secretFile = draft.secretFile.trim();
|
|
10809
|
+
const secretEnv = draft.secretEnv.trim();
|
|
10810
|
+
if (secretFile !== "" || secretEnv !== "") wire.credential = {
|
|
10811
|
+
...secretFile === "" ? {} : { secretFile },
|
|
10812
|
+
...secretEnv === "" ? {} : { secretEnv }
|
|
10813
|
+
};
|
|
10814
|
+
if (draft.resources.length > 0) wire.resources = resourceRecord(draft.resources);
|
|
10815
|
+
if (draft.policy.length > 0) wire.policy = Object.fromEntries(draft.policy.map(([operation]) => [operation, "deny"]));
|
|
10816
|
+
return wire;
|
|
10036
10817
|
}
|
|
10037
10818
|
/**
|
|
10038
|
-
* The
|
|
10039
|
-
*
|
|
10040
|
-
*
|
|
10041
|
-
* only credential the principal-scoped remotes accept, so the card renders the
|
|
10042
|
-
* provider cards only once the QA session service reports a signed-in account —
|
|
10043
|
-
* and says so instead of showing forms that could only fail.
|
|
10819
|
+
* The managed-credential profile list. Every field edit commits the whole
|
|
10820
|
+
* array at the parent path, so a row can never be half-stored; the drafts
|
|
10821
|
+
* reset from the stored list when the Host accepts or refuels it.
|
|
10044
10822
|
*/
|
|
10045
|
-
function
|
|
10046
|
-
const
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10823
|
+
function ServiceProfilesField(props) {
|
|
10824
|
+
const [drafts, setDrafts] = (0, react.useState)(props.profiles);
|
|
10825
|
+
(0, react.useEffect)(() => {
|
|
10826
|
+
setDrafts(props.profiles);
|
|
10827
|
+
}, [props.profiles]);
|
|
10828
|
+
const commit = (next) => {
|
|
10829
|
+
setDrafts(next);
|
|
10830
|
+
if (next.length === 0) {
|
|
10831
|
+
props.unset(["managedServiceCredentials", "profiles"]);
|
|
10832
|
+
return;
|
|
10833
|
+
}
|
|
10834
|
+
props.write(["managedServiceCredentials", "profiles"], next.map(profileWire));
|
|
10835
|
+
};
|
|
10836
|
+
const edit = (index, patch) => {
|
|
10837
|
+
commit(props.profiles.map((row, at) => at === index ? {
|
|
10838
|
+
...row,
|
|
10839
|
+
...patch
|
|
10840
|
+
} : row));
|
|
10841
|
+
};
|
|
10842
|
+
const commitRecord = (index, key, rows) => {
|
|
10843
|
+
if (rows.length === 0) {
|
|
10844
|
+
commit(props.profiles.map((row, at) => at === index ? {
|
|
10845
|
+
...row,
|
|
10846
|
+
[key]: []
|
|
10847
|
+
} : row));
|
|
10848
|
+
return;
|
|
10849
|
+
}
|
|
10850
|
+
commit(props.profiles.map((row, at) => at === index ? {
|
|
10851
|
+
...row,
|
|
10852
|
+
[key]: key === "resources" ? resourceRecord(rows) : Object.fromEntries(rows.map(([operation]) => [operation, "deny"]))
|
|
10853
|
+
} : row));
|
|
10854
|
+
};
|
|
10855
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10856
|
+
className: "qai-op__field",
|
|
10857
|
+
children: [
|
|
10858
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10859
|
+
className: "qai-op__label",
|
|
10860
|
+
children: ["Профили доступов", props.overridden(["managedServiceCredentials", "profiles"]) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10861
|
+
className: "qai-op__overridden",
|
|
10862
|
+
children: "переопределено"
|
|
10863
|
+
}) : null]
|
|
10864
|
+
}),
|
|
10865
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
10866
|
+
className: "qai-op__profiles",
|
|
10867
|
+
children: props.profiles.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
10868
|
+
className: "qai-op__profile",
|
|
10869
|
+
children: [
|
|
10870
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10871
|
+
className: "qai-op__profile-head",
|
|
10872
|
+
children: [
|
|
10873
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: row.label || row.id || "новый профиль" }),
|
|
10874
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
10875
|
+
className: "qai-op__toggle-row qai-op__toggle-row--inline",
|
|
10876
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10877
|
+
className: "qai-op__toggle",
|
|
10878
|
+
type: "checkbox",
|
|
10879
|
+
checked: row.enabled,
|
|
10880
|
+
disabled: props.disabled,
|
|
10881
|
+
onChange: (event) => {
|
|
10882
|
+
edit(index, { enabled: event.currentTarget.checked });
|
|
10883
|
+
}
|
|
10884
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "включён" })]
|
|
10885
|
+
}),
|
|
10886
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10887
|
+
type: "button",
|
|
10888
|
+
className: "qai-op__row-remove",
|
|
10889
|
+
disabled: props.disabled,
|
|
10890
|
+
onClick: () => {
|
|
10891
|
+
commit(props.profiles.filter((_, at) => at !== index));
|
|
10892
|
+
},
|
|
10893
|
+
children: "убрать"
|
|
10894
|
+
})
|
|
10895
|
+
]
|
|
10896
|
+
}),
|
|
10897
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10898
|
+
className: "qai-op__profile-grid",
|
|
10899
|
+
children: [
|
|
10900
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10901
|
+
className: "qai-op__instance-cell",
|
|
10902
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10903
|
+
className: "qai-op__instance-key",
|
|
10904
|
+
children: "id"
|
|
10905
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10906
|
+
className: "qai-op__input",
|
|
10907
|
+
type: "text",
|
|
10908
|
+
value: row.id,
|
|
10909
|
+
placeholder: "qa-gitlab-readonly",
|
|
10910
|
+
disabled: props.disabled,
|
|
10911
|
+
onChange: (event) => {
|
|
10912
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
10913
|
+
...draft,
|
|
10914
|
+
id: event.currentTarget.value
|
|
10915
|
+
} : draft));
|
|
10916
|
+
},
|
|
10917
|
+
onBlur: () => {
|
|
10918
|
+
const id = row.id.trim();
|
|
10919
|
+
const next = drafts[index]?.id.trim() ?? "";
|
|
10920
|
+
if (next !== "" && next !== id) edit(index, { id: next });
|
|
10921
|
+
}
|
|
10922
|
+
})]
|
|
10923
|
+
}),
|
|
10924
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10925
|
+
className: "qai-op__instance-cell",
|
|
10926
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10927
|
+
className: "qai-op__instance-key",
|
|
10928
|
+
children: "провайдер"
|
|
10929
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
10930
|
+
className: "qai-op__input",
|
|
10931
|
+
value: row.provider,
|
|
10932
|
+
disabled: props.disabled,
|
|
10933
|
+
onChange: (event) => {
|
|
10934
|
+
edit(index, { provider: event.currentTarget.value });
|
|
10935
|
+
},
|
|
10936
|
+
children: PROVIDER_IDS.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
10937
|
+
value: id,
|
|
10938
|
+
children: id
|
|
10939
|
+
}, id))
|
|
10940
|
+
})]
|
|
10941
|
+
}),
|
|
10942
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10943
|
+
className: "qai-op__instance-cell",
|
|
10944
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10945
|
+
className: "qai-op__instance-key",
|
|
10946
|
+
children: "инстанс"
|
|
10947
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10948
|
+
className: "qai-op__input",
|
|
10949
|
+
type: "text",
|
|
10950
|
+
value: row.instance,
|
|
10951
|
+
placeholder: "corp",
|
|
10952
|
+
disabled: props.disabled,
|
|
10953
|
+
onChange: (event) => {
|
|
10954
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
10955
|
+
...draft,
|
|
10956
|
+
instance: event.currentTarget.value
|
|
10957
|
+
} : draft));
|
|
10958
|
+
},
|
|
10959
|
+
onBlur: () => {
|
|
10960
|
+
const instance = row.instance.trim();
|
|
10961
|
+
const next = drafts[index]?.instance.trim() ?? "";
|
|
10962
|
+
if (next !== "" && next !== instance) edit(index, { instance: next });
|
|
10963
|
+
}
|
|
10964
|
+
})]
|
|
10965
|
+
}),
|
|
10966
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10967
|
+
className: "qai-op__instance-cell",
|
|
10968
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10969
|
+
className: "qai-op__instance-key",
|
|
10970
|
+
children: "название"
|
|
10971
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10972
|
+
className: "qai-op__input",
|
|
10973
|
+
type: "text",
|
|
10974
|
+
value: row.label,
|
|
10975
|
+
placeholder: "QA GitLab Read-only",
|
|
10976
|
+
disabled: props.disabled,
|
|
10977
|
+
onChange: (event) => {
|
|
10978
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
10979
|
+
...draft,
|
|
10980
|
+
label: event.currentTarget.value
|
|
10981
|
+
} : draft));
|
|
10982
|
+
},
|
|
10983
|
+
onBlur: () => {
|
|
10984
|
+
const label = row.label.trim();
|
|
10985
|
+
const next = drafts[index]?.label.trim() ?? "";
|
|
10986
|
+
if (next !== "" && next !== label) edit(index, { label: next });
|
|
10987
|
+
}
|
|
10988
|
+
})]
|
|
10989
|
+
}),
|
|
10990
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
10991
|
+
className: "qai-op__instance-cell",
|
|
10992
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
10993
|
+
className: "qai-op__instance-key",
|
|
10994
|
+
children: "файл секрета"
|
|
10995
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
10996
|
+
className: "qai-op__input",
|
|
10997
|
+
type: "text",
|
|
10998
|
+
value: row.secretFile,
|
|
10999
|
+
placeholder: "/run/secrets/…",
|
|
11000
|
+
disabled: props.disabled,
|
|
11001
|
+
onChange: (event) => {
|
|
11002
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
11003
|
+
...draft,
|
|
11004
|
+
secretFile: event.currentTarget.value
|
|
11005
|
+
} : draft));
|
|
11006
|
+
},
|
|
11007
|
+
onBlur: () => {
|
|
11008
|
+
const secretFile = row.secretFile.trim();
|
|
11009
|
+
const next = drafts[index]?.secretFile.trim() ?? "";
|
|
11010
|
+
if (next !== "" && next !== secretFile) edit(index, { secretFile: next });
|
|
11011
|
+
}
|
|
11012
|
+
})]
|
|
11013
|
+
}),
|
|
11014
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
11015
|
+
className: "qai-op__instance-cell",
|
|
11016
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11017
|
+
className: "qai-op__instance-key",
|
|
11018
|
+
children: "переменная секрета"
|
|
11019
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
11020
|
+
className: "qai-op__input",
|
|
11021
|
+
type: "text",
|
|
11022
|
+
value: row.secretEnv,
|
|
11023
|
+
placeholder: "QA_GITLAB_TOKEN",
|
|
11024
|
+
disabled: props.disabled,
|
|
11025
|
+
onChange: (event) => {
|
|
11026
|
+
setDrafts(drafts.map((draft, at) => at === index ? {
|
|
11027
|
+
...draft,
|
|
11028
|
+
secretEnv: event.currentTarget.value
|
|
11029
|
+
} : draft));
|
|
11030
|
+
},
|
|
11031
|
+
onBlur: () => {
|
|
11032
|
+
const secretEnv = row.secretEnv.trim();
|
|
11033
|
+
const next = drafts[index]?.secretEnv.trim() ?? "";
|
|
11034
|
+
if (next !== "" && next !== secretEnv) edit(index, { secretEnv: next });
|
|
11035
|
+
}
|
|
11036
|
+
})]
|
|
11037
|
+
})
|
|
11038
|
+
]
|
|
11039
|
+
}),
|
|
11040
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecordField, {
|
|
11041
|
+
label: "Ресурсы (вид: значения через запятую)",
|
|
11042
|
+
path: ["managedServiceCredentials", "profiles"],
|
|
11043
|
+
entries: row.resources,
|
|
11044
|
+
keyPlaceholder: "projects",
|
|
11045
|
+
valuePlaceholder: "group/repo, group/other",
|
|
11046
|
+
disabled: props.disabled,
|
|
11047
|
+
write: (_path, value) => {
|
|
11048
|
+
commitRecord(index, "resources", Object.entries(value).map(([kind, values]) => [kind, values.join(", ")]));
|
|
11049
|
+
},
|
|
11050
|
+
unset: () => {
|
|
11051
|
+
commitRecord(index, "resources", []);
|
|
11052
|
+
},
|
|
11053
|
+
overridden: props.overridden
|
|
11054
|
+
}),
|
|
11055
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecordField, {
|
|
11056
|
+
label: "Запрещённые операции",
|
|
11057
|
+
hint: "каждая запись всегда хранит значение deny",
|
|
11058
|
+
path: ["managedServiceCredentials", "profiles"],
|
|
11059
|
+
entries: row.policy,
|
|
11060
|
+
keyPlaceholder: "mergeRequest.create",
|
|
11061
|
+
valuePlaceholder: "",
|
|
11062
|
+
fixedValue: "deny",
|
|
11063
|
+
disabled: props.disabled,
|
|
11064
|
+
write: (_path, value) => {
|
|
11065
|
+
commitRecord(index, "policy", Object.keys(value).map((operation) => [operation, "deny"]));
|
|
11066
|
+
},
|
|
11067
|
+
unset: () => {
|
|
11068
|
+
commitRecord(index, "policy", []);
|
|
11069
|
+
},
|
|
11070
|
+
overridden: props.overridden
|
|
11071
|
+
})
|
|
11072
|
+
]
|
|
11073
|
+
}, `${index}:${row.id}`))
|
|
11074
|
+
}),
|
|
11075
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
11076
|
+
type: "button",
|
|
11077
|
+
className: "qai-op__button",
|
|
11078
|
+
disabled: props.disabled,
|
|
11079
|
+
onClick: () => {
|
|
11080
|
+
commit([...props.profiles, {
|
|
11081
|
+
id: "",
|
|
11082
|
+
provider: "gitlab",
|
|
11083
|
+
instance: "",
|
|
11084
|
+
label: "",
|
|
11085
|
+
enabled: true,
|
|
11086
|
+
secretFile: "",
|
|
11087
|
+
secretEnv: "",
|
|
11088
|
+
resources: [],
|
|
11089
|
+
policy: []
|
|
11090
|
+
}]);
|
|
11091
|
+
},
|
|
11092
|
+
children: "добавить профиль"
|
|
11093
|
+
}) })
|
|
11094
|
+
]
|
|
11095
|
+
});
|
|
11096
|
+
}
|
|
11097
|
+
/** One provider's credential-help override: every field optional, every miss keeps the built-in help. */
|
|
11098
|
+
function CredentialHelpSection(props) {
|
|
11099
|
+
const base = ["credentialHelp", props.provider];
|
|
11100
|
+
const control = {
|
|
11101
|
+
disabled: props.disabled,
|
|
11102
|
+
write: props.write,
|
|
11103
|
+
unset: props.unset,
|
|
11104
|
+
overridden: props.overridden
|
|
10065
11105
|
};
|
|
11106
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
11107
|
+
className: "qai-op__subsection",
|
|
11108
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", {
|
|
11109
|
+
className: "qai-op__section-summary",
|
|
11110
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11111
|
+
className: "qai-op__section-title",
|
|
11112
|
+
children: props.provider
|
|
11113
|
+
}), Object.keys(props.override).length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11114
|
+
className: "qai-op__hint",
|
|
11115
|
+
children: "встроенная подсказка"
|
|
11116
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11117
|
+
className: "qai-op__overridden",
|
|
11118
|
+
children: "переопределено"
|
|
11119
|
+
})]
|
|
11120
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11121
|
+
className: "qai-op__section-body",
|
|
11122
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11123
|
+
className: "qai-op__grid",
|
|
11124
|
+
children: [
|
|
11125
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toggle, {
|
|
11126
|
+
label: "Подсказка показывается",
|
|
11127
|
+
path: [...base, "enabled"],
|
|
11128
|
+
value: rawBool(props.override.enabled, true),
|
|
11129
|
+
disabled: props.disabled,
|
|
11130
|
+
write: props.write
|
|
11131
|
+
}),
|
|
11132
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11133
|
+
label: "Механизм (kind)",
|
|
11134
|
+
path: [...base, "kind"],
|
|
11135
|
+
value: rawString(props.override.kind),
|
|
11136
|
+
...control
|
|
11137
|
+
}),
|
|
11138
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11139
|
+
label: "Название",
|
|
11140
|
+
path: [...base, "label"],
|
|
11141
|
+
value: rawString(props.override.label),
|
|
11142
|
+
...control
|
|
11143
|
+
}),
|
|
11144
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11145
|
+
label: "Где получить токен (адрес)",
|
|
11146
|
+
path: [...base, "obtainUrl"],
|
|
11147
|
+
value: rawString(props.override.obtainUrl),
|
|
11148
|
+
placeholder: "https://wiki.example.corp/tokens",
|
|
11149
|
+
...control
|
|
11150
|
+
}),
|
|
11151
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11152
|
+
label: "Где получить токен (подпись)",
|
|
11153
|
+
path: [...base, "obtainLabel"],
|
|
11154
|
+
value: rawString(props.override.obtainLabel),
|
|
11155
|
+
...control
|
|
11156
|
+
}),
|
|
11157
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11158
|
+
label: "Документация (адрес)",
|
|
11159
|
+
path: [...base, "docsUrl"],
|
|
11160
|
+
value: rawString(props.override.docsUrl),
|
|
11161
|
+
...control
|
|
11162
|
+
}),
|
|
11163
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11164
|
+
label: "Документация (подпись)",
|
|
11165
|
+
path: [...base, "docsLabel"],
|
|
11166
|
+
value: rawString(props.override.docsLabel),
|
|
11167
|
+
...control
|
|
11168
|
+
}),
|
|
11169
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11170
|
+
label: "Инструкция",
|
|
11171
|
+
path: [...base, "instructions"],
|
|
11172
|
+
value: rawString(props.override.instructions),
|
|
11173
|
+
...control
|
|
11174
|
+
}),
|
|
11175
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11176
|
+
label: "Ключ локализации инструкции",
|
|
11177
|
+
path: [...base, "instructionsLocaleKey"],
|
|
11178
|
+
value: rawString(props.override.instructionsLocaleKey),
|
|
11179
|
+
...control
|
|
11180
|
+
}),
|
|
11181
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11182
|
+
label: "Скоупы",
|
|
11183
|
+
path: [...base, "scopes"],
|
|
11184
|
+
values: rawStringList(props.override.scopes),
|
|
11185
|
+
placeholder: "read_user",
|
|
11186
|
+
...control
|
|
11187
|
+
}),
|
|
11188
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11189
|
+
label: "Заметки",
|
|
11190
|
+
path: [...base, "notes"],
|
|
11191
|
+
values: rawStringList(props.override.notes),
|
|
11192
|
+
placeholder: "токен живёт один год",
|
|
11193
|
+
...control
|
|
11194
|
+
}),
|
|
11195
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toggle, {
|
|
11196
|
+
label: "Self-hosted",
|
|
11197
|
+
path: [...base, "selfHosted"],
|
|
11198
|
+
value: rawBool(props.override.selfHosted, false),
|
|
11199
|
+
disabled: props.disabled,
|
|
11200
|
+
write: props.write
|
|
11201
|
+
})
|
|
11202
|
+
]
|
|
11203
|
+
})
|
|
11204
|
+
})]
|
|
11205
|
+
});
|
|
10066
11206
|
}
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
const
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
11207
|
+
function OperatorCard({ scope }) {
|
|
11208
|
+
const store = (0, react.useMemo)(() => bindSettingsExternalStore(scope), [scope]);
|
|
11209
|
+
const settings = (0, react.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
11210
|
+
const [error, setError] = (0, react.useState)(null);
|
|
11211
|
+
const config = rawObject(settings.value);
|
|
11212
|
+
const writable = settings.status === "ready" && settings.writable;
|
|
11213
|
+
const write = (0, react.useCallback)((path, value) => {
|
|
11214
|
+
const ops = [{
|
|
11215
|
+
op: "set",
|
|
11216
|
+
path: [...path],
|
|
11217
|
+
value
|
|
11218
|
+
}];
|
|
11219
|
+
scope.mutate(ops).catch((cause) => {
|
|
11220
|
+
setError(displayError(cause));
|
|
10074
11221
|
});
|
|
11222
|
+
}, [scope]);
|
|
11223
|
+
const unset = (0, react.useCallback)((path) => {
|
|
11224
|
+
const ops = [{
|
|
11225
|
+
op: "unset",
|
|
11226
|
+
path: [...path]
|
|
11227
|
+
}];
|
|
11228
|
+
scope.mutate(ops).catch((cause) => {
|
|
11229
|
+
setError(displayError(cause));
|
|
11230
|
+
});
|
|
11231
|
+
}, [scope]);
|
|
11232
|
+
const overridden = (0, react.useCallback)((path) => isOverridden(settings.user, path), [settings.user]);
|
|
11233
|
+
const keys = overriddenKeys(settings.user);
|
|
11234
|
+
const resetAll = (0, react.useCallback)(() => {
|
|
11235
|
+
const ops = keys.map((key) => ({
|
|
11236
|
+
op: "unset",
|
|
11237
|
+
path: [key]
|
|
11238
|
+
}));
|
|
11239
|
+
scope.mutate(ops).catch((cause) => {
|
|
11240
|
+
setError(displayError(cause));
|
|
11241
|
+
});
|
|
11242
|
+
}, [keys, scope]);
|
|
11243
|
+
if (settings.status === "unavailable") return null;
|
|
11244
|
+
const control = {
|
|
11245
|
+
disabled: !writable,
|
|
11246
|
+
write,
|
|
11247
|
+
unset,
|
|
11248
|
+
overridden
|
|
10075
11249
|
};
|
|
11250
|
+
const msc = rawObject(config.managedServiceCredentials);
|
|
11251
|
+
/** Capability toggle: reads default on, deny-listed switches default off. */
|
|
11252
|
+
const tg = (label, path, value, hint) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toggle, {
|
|
11253
|
+
label,
|
|
11254
|
+
hint,
|
|
11255
|
+
path,
|
|
11256
|
+
value,
|
|
11257
|
+
disabled: !writable,
|
|
11258
|
+
write,
|
|
11259
|
+
overridden: overridden(path)
|
|
11260
|
+
});
|
|
11261
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardShell, {
|
|
11262
|
+
title: "Интеграции — конфигурация",
|
|
11263
|
+
description: "Операторские настройки подключений: провайдеры, адреса, возможности и сервисные доступы. Правка применяется к запущенному сервису сразу.",
|
|
11264
|
+
badge: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11265
|
+
className: "dsh-plugin-card__badge",
|
|
11266
|
+
children: keys.length === 0 ? "по умолчанию" : `переопределено: ${keys.length}`
|
|
11267
|
+
}),
|
|
11268
|
+
label: (open) => open ? "Свернуть конфигурацию интеграций" : "Развернуть конфигурацию интеграций",
|
|
11269
|
+
bodyClassName: "qai-op__body",
|
|
11270
|
+
children: settings.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11271
|
+
className: "qai-op__muted",
|
|
11272
|
+
children: "Загружаем конфигурацию интеграций…"
|
|
11273
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
11274
|
+
error !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
11275
|
+
className: "qai-op__error",
|
|
11276
|
+
children: error
|
|
11277
|
+
}) : null,
|
|
11278
|
+
!writable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11279
|
+
className: "qai-op__muted",
|
|
11280
|
+
children: "Хост не принимает правки из этого браузера — значения показаны только для чтения."
|
|
11281
|
+
}) : null,
|
|
11282
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11283
|
+
className: "qai-op__toolbar",
|
|
11284
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
11285
|
+
className: "qai-op__hint",
|
|
11286
|
+
children: "Слой правок поверх конфигурации профиля: очищенная настройка возвращается к значению из yaml."
|
|
11287
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
11288
|
+
type: "button",
|
|
11289
|
+
className: "qai-op__button",
|
|
11290
|
+
disabled: !writable || keys.length === 0,
|
|
11291
|
+
onClick: resetAll,
|
|
11292
|
+
children: [
|
|
11293
|
+
"Сбросить переопределения (",
|
|
11294
|
+
keys.length,
|
|
11295
|
+
")"
|
|
11296
|
+
]
|
|
11297
|
+
})]
|
|
11298
|
+
}),
|
|
11299
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11300
|
+
title: "Общие",
|
|
11301
|
+
open: true,
|
|
11302
|
+
children: [
|
|
11303
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11304
|
+
title: "Плагин",
|
|
11305
|
+
children: tg("Плагин включён", ["enabled"], rawBool(config.enabled, false), "выключенный плагин не регистрирует инструменты и прячет пользовательские страницы")
|
|
11306
|
+
}),
|
|
11307
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11308
|
+
title: "Хранилище и ключи",
|
|
11309
|
+
wide: true,
|
|
11310
|
+
hint: "пути читаются хостом при старте: правка действует со следующего рестарта",
|
|
11311
|
+
children: [
|
|
11312
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11313
|
+
label: "Файл хранилища подключений",
|
|
11314
|
+
hint: "применяется со следующим рестартом хоста",
|
|
11315
|
+
path: ["dataPath"],
|
|
11316
|
+
value: rawString(config.dataPath),
|
|
11317
|
+
...control
|
|
11318
|
+
}),
|
|
11319
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11320
|
+
label: "Файл мастер-ключа",
|
|
11321
|
+
hint: "применяется со следующим рестартом хоста",
|
|
11322
|
+
path: ["masterKeyPath"],
|
|
11323
|
+
value: rawString(config.masterKeyPath),
|
|
11324
|
+
...control
|
|
11325
|
+
}),
|
|
11326
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11327
|
+
label: "Версия мастер-ключа",
|
|
11328
|
+
path: ["masterKeyVersion"],
|
|
11329
|
+
value: rawNumber(config.masterKeyVersion),
|
|
11330
|
+
...control
|
|
11331
|
+
})
|
|
11332
|
+
]
|
|
11333
|
+
}),
|
|
11334
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11335
|
+
title: "Домены подключений",
|
|
11336
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11337
|
+
label: "Суффиксы порталов Bitrix24",
|
|
11338
|
+
hint: "хосты, на которые может указывать вебхук; каждый с точки",
|
|
11339
|
+
path: ["allowedPortalSuffixes"],
|
|
11340
|
+
values: rawStringList(config.allowedPortalSuffixes),
|
|
11341
|
+
placeholder: ".bitrix24.example",
|
|
11342
|
+
...control
|
|
11343
|
+
})
|
|
11344
|
+
}),
|
|
11345
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, {
|
|
11346
|
+
hint: "потолки ответов провайдеров и срок хранения аудита",
|
|
11347
|
+
children: [
|
|
11348
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11349
|
+
label: "Таймаут запроса, мс",
|
|
11350
|
+
path: ["timeoutMs"],
|
|
11351
|
+
value: rawNumber(config.timeoutMs),
|
|
11352
|
+
...control
|
|
11353
|
+
}),
|
|
11354
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11355
|
+
label: "Потолок ответа провайдера, байт",
|
|
11356
|
+
path: ["maxResponseBytes"],
|
|
11357
|
+
value: rawNumber(config.maxResponseBytes),
|
|
11358
|
+
...control
|
|
11359
|
+
}),
|
|
11360
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11361
|
+
label: "Хранение аудита, дней",
|
|
11362
|
+
path: ["auditRetentionDays"],
|
|
11363
|
+
value: rawNumber(config.auditRetentionDays),
|
|
11364
|
+
...control
|
|
11365
|
+
})
|
|
11366
|
+
]
|
|
11367
|
+
})
|
|
11368
|
+
]
|
|
11369
|
+
}),
|
|
11370
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11371
|
+
title: "Bitrix24",
|
|
11372
|
+
state: providerState(rawObject(config.bitrix24), {
|
|
11373
|
+
enabled: true,
|
|
11374
|
+
capabilities: [
|
|
11375
|
+
["crmRead", true],
|
|
11376
|
+
["crmCommentWrite", false],
|
|
11377
|
+
["chatRead", true],
|
|
11378
|
+
["openlinesRead", true],
|
|
11379
|
+
["userRead", true],
|
|
11380
|
+
["departmentRead", true],
|
|
11381
|
+
["tasksRead", true],
|
|
11382
|
+
["calendarRead", true],
|
|
11383
|
+
["diskRead", true]
|
|
11384
|
+
]
|
|
11385
|
+
}),
|
|
11386
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11387
|
+
title: "Провайдер",
|
|
11388
|
+
children: tg("Провайдер включён", ["bitrix24", "enabled"], rawBool(rawObject(config.bitrix24).enabled, true))
|
|
11389
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11390
|
+
title: "Что доступно агенту",
|
|
11391
|
+
kind: "checks",
|
|
11392
|
+
children: [
|
|
11393
|
+
tg("CRM: чтение", ["bitrix24", "crmRead"], rawBool(rawObject(config.bitrix24).crmRead, true)),
|
|
11394
|
+
tg("CRM: комментарий таймлайна (запись)", ["bitrix24", "crmCommentWrite"], rawBool(rawObject(config.bitrix24).crmCommentWrite, false), "единственный инструмент записи; выключен по умолчанию"),
|
|
11395
|
+
tg("Чаты: чтение", ["bitrix24", "chatRead"], rawBool(rawObject(config.bitrix24).chatRead, true)),
|
|
11396
|
+
tg("Открытые линии: чтение", ["bitrix24", "openlinesRead"], rawBool(rawObject(config.bitrix24).openlinesRead, true)),
|
|
11397
|
+
tg("Пользователи: чтение", ["bitrix24", "userRead"], rawBool(rawObject(config.bitrix24).userRead, true)),
|
|
11398
|
+
tg("Структура компании: чтение", ["bitrix24", "departmentRead"], rawBool(rawObject(config.bitrix24).departmentRead, true)),
|
|
11399
|
+
tg("Задачи: чтение", ["bitrix24", "tasksRead"], rawBool(rawObject(config.bitrix24).tasksRead, true)),
|
|
11400
|
+
tg("Календарь: чтение", ["bitrix24", "calendarRead"], rawBool(rawObject(config.bitrix24).calendarRead, true)),
|
|
11401
|
+
tg("Диск: чтение", ["bitrix24", "diskRead"], rawBool(rawObject(config.bitrix24).diskRead, true))
|
|
11402
|
+
]
|
|
11403
|
+
})]
|
|
11404
|
+
}),
|
|
11405
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11406
|
+
title: "Confluence",
|
|
11407
|
+
state: providerState(rawObject(config.confluence), {
|
|
11408
|
+
enabled: true,
|
|
11409
|
+
capabilities: [
|
|
11410
|
+
["identityRead", true],
|
|
11411
|
+
["spacesRead", true],
|
|
11412
|
+
["searchRead", true],
|
|
11413
|
+
["contentRead", true],
|
|
11414
|
+
["commentsRead", true],
|
|
11415
|
+
["attachmentsRead", true],
|
|
11416
|
+
["versionsRead", true]
|
|
11417
|
+
],
|
|
11418
|
+
counts: [{
|
|
11419
|
+
path: "instances",
|
|
11420
|
+
forms: [
|
|
11421
|
+
"сайт",
|
|
11422
|
+
"сайта",
|
|
11423
|
+
"сайтов"
|
|
11424
|
+
]
|
|
11425
|
+
}]
|
|
11426
|
+
}),
|
|
11427
|
+
children: [
|
|
11428
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11429
|
+
title: "Провайдер",
|
|
11430
|
+
children: [tg("Провайдер включён", ["confluence", "enabled"], rawBool(rawObject(config.confluence).enabled, true)), tg("Разрешить http", ["confluence", "allowInsecureHttp"], rawBool(rawObject(config.confluence).allowInsecureHttp, false), "только для dev-стенда")]
|
|
11431
|
+
}),
|
|
11432
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11433
|
+
title: "Подключение",
|
|
11434
|
+
wide: true,
|
|
11435
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstanceListField, {
|
|
11436
|
+
label: "Сайты Confluence",
|
|
11437
|
+
hint: "пользователь выбирает сайт из списка и вводит e-mail с токеном",
|
|
11438
|
+
path: ["confluence", "instances"],
|
|
11439
|
+
instances: instanceRows(rawObject(config.confluence).instances),
|
|
11440
|
+
...control
|
|
11441
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11442
|
+
label: "Разрешённые пространства",
|
|
11443
|
+
hint: "пусто — все пространства, доступные подключённому аккаунту",
|
|
11444
|
+
path: ["confluence", "allowedSpaces"],
|
|
11445
|
+
values: rawStringList(rawObject(config.confluence).allowedSpaces),
|
|
11446
|
+
placeholder: "PROJ",
|
|
11447
|
+
...control
|
|
11448
|
+
})]
|
|
11449
|
+
}),
|
|
11450
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11451
|
+
title: "Что доступно агенту",
|
|
11452
|
+
kind: "checks",
|
|
11453
|
+
children: [
|
|
11454
|
+
tg("Профиль: чтение", ["confluence", "identityRead"], rawBool(rawObject(config.confluence).identityRead, true)),
|
|
11455
|
+
tg("Пространства: чтение", ["confluence", "spacesRead"], rawBool(rawObject(config.confluence).spacesRead, true)),
|
|
11456
|
+
tg("Поиск: чтение", ["confluence", "searchRead"], rawBool(rawObject(config.confluence).searchRead, true)),
|
|
11457
|
+
tg("Страницы: чтение", ["confluence", "contentRead"], rawBool(rawObject(config.confluence).contentRead, true)),
|
|
11458
|
+
tg("Комментарии: чтение", ["confluence", "commentsRead"], rawBool(rawObject(config.confluence).commentsRead, true)),
|
|
11459
|
+
tg("Вложения: чтение", ["confluence", "attachmentsRead"], rawBool(rawObject(config.confluence).attachmentsRead, true)),
|
|
11460
|
+
tg("Версии: чтение", ["confluence", "versionsRead"], rawBool(rawObject(config.confluence).versionsRead, true))
|
|
11461
|
+
]
|
|
11462
|
+
}),
|
|
11463
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, { children: [
|
|
11464
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11465
|
+
label: "Тело страницы по умолчанию, знаков",
|
|
11466
|
+
path: ["confluence", "defaultBodyChars"],
|
|
11467
|
+
value: rawNumber(rawObject(config.confluence).defaultBodyChars),
|
|
11468
|
+
...control
|
|
11469
|
+
}),
|
|
11470
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11471
|
+
label: "Потолок тела страницы, знаков",
|
|
11472
|
+
path: ["confluence", "maxBodyChars"],
|
|
11473
|
+
value: rawNumber(rawObject(config.confluence).maxBodyChars),
|
|
11474
|
+
...control
|
|
11475
|
+
}),
|
|
11476
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11477
|
+
label: "Строк на страницу списка",
|
|
11478
|
+
path: ["confluence", "maxResults"],
|
|
11479
|
+
value: rawNumber(rawObject(config.confluence).maxResults),
|
|
11480
|
+
...control
|
|
11481
|
+
}),
|
|
11482
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11483
|
+
label: "Родителей комментариев на вызов",
|
|
11484
|
+
path: ["confluence", "maxReplyParents"],
|
|
11485
|
+
value: rawNumber(rawObject(config.confluence).maxReplyParents),
|
|
11486
|
+
...control
|
|
11487
|
+
}),
|
|
11488
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11489
|
+
label: "Повторы при 429/5xx",
|
|
11490
|
+
path: ["confluence", "retries"],
|
|
11491
|
+
value: rawNumber(rawObject(config.confluence).retries),
|
|
11492
|
+
...control
|
|
11493
|
+
})
|
|
11494
|
+
] })
|
|
11495
|
+
]
|
|
11496
|
+
}),
|
|
11497
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11498
|
+
title: "GitLab",
|
|
11499
|
+
state: providerState(rawObject(config.gitlab), {
|
|
11500
|
+
enabled: true,
|
|
11501
|
+
capabilities: [
|
|
11502
|
+
["identityRead", true],
|
|
11503
|
+
["projectsRead", true],
|
|
11504
|
+
["repositoryRead", true],
|
|
11505
|
+
["searchRead", true],
|
|
11506
|
+
["issuesRead", true],
|
|
11507
|
+
["mergeRequestsRead", true],
|
|
11508
|
+
["ciRead", true]
|
|
11509
|
+
],
|
|
11510
|
+
counts: [{
|
|
11511
|
+
path: "instances",
|
|
11512
|
+
forms: [
|
|
11513
|
+
"инстанс",
|
|
11514
|
+
"инстанса",
|
|
11515
|
+
"инстансов"
|
|
11516
|
+
]
|
|
11517
|
+
}]
|
|
11518
|
+
}),
|
|
11519
|
+
children: [
|
|
11520
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11521
|
+
title: "Провайдер",
|
|
11522
|
+
children: [tg("Провайдер включён", ["gitlab", "enabled"], rawBool(rawObject(config.gitlab).enabled, true)), tg("Разрешить http", ["gitlab", "allowInsecureHttp"], rawBool(rawObject(config.gitlab).allowInsecureHttp, false), "только для dev-стенда")]
|
|
11523
|
+
}),
|
|
11524
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11525
|
+
title: "Подключение",
|
|
11526
|
+
wide: true,
|
|
11527
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstanceListField, {
|
|
11528
|
+
label: "Инстансы GitLab",
|
|
11529
|
+
hint: "пользователь выбирает инстанс из списка, произвольный хост ввести нельзя",
|
|
11530
|
+
path: ["gitlab", "instances"],
|
|
11531
|
+
instances: instanceRows(rawObject(config.gitlab).instances),
|
|
11532
|
+
...control
|
|
11533
|
+
})
|
|
11534
|
+
}),
|
|
11535
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11536
|
+
title: "Что доступно агенту",
|
|
11537
|
+
kind: "checks",
|
|
11538
|
+
children: [
|
|
11539
|
+
tg("Профиль: чтение", ["gitlab", "identityRead"], rawBool(rawObject(config.gitlab).identityRead, true)),
|
|
11540
|
+
tg("Проекты: чтение", ["gitlab", "projectsRead"], rawBool(rawObject(config.gitlab).projectsRead, true)),
|
|
11541
|
+
tg("Репозиторий: чтение", ["gitlab", "repositoryRead"], rawBool(rawObject(config.gitlab).repositoryRead, true)),
|
|
11542
|
+
tg("Поиск: чтение", ["gitlab", "searchRead"], rawBool(rawObject(config.gitlab).searchRead, true)),
|
|
11543
|
+
tg("Задачи: чтение", ["gitlab", "issuesRead"], rawBool(rawObject(config.gitlab).issuesRead, true)),
|
|
11544
|
+
tg("MR: чтение", ["gitlab", "mergeRequestsRead"], rawBool(rawObject(config.gitlab).mergeRequestsRead, true)),
|
|
11545
|
+
tg("CI: чтение", ["gitlab", "ciRead"], rawBool(rawObject(config.gitlab).ciRead, true))
|
|
11546
|
+
]
|
|
11547
|
+
}),
|
|
11548
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, { children: [
|
|
11549
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11550
|
+
label: "Потолок файла, байт",
|
|
11551
|
+
path: ["gitlab", "maxFileBytes"],
|
|
11552
|
+
value: rawNumber(rawObject(config.gitlab).maxFileBytes),
|
|
11553
|
+
...control
|
|
11554
|
+
}),
|
|
11555
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11556
|
+
label: "Потолок лога задачи CI, байт",
|
|
11557
|
+
path: ["gitlab", "maxJobLogBytes"],
|
|
11558
|
+
value: rawNumber(rawObject(config.gitlab).maxJobLogBytes),
|
|
11559
|
+
...control
|
|
11560
|
+
}),
|
|
11561
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11562
|
+
label: "Потолок результатов поиска",
|
|
11563
|
+
path: ["gitlab", "maxSearchResults"],
|
|
11564
|
+
value: rawNumber(rawObject(config.gitlab).maxSearchResults),
|
|
11565
|
+
...control
|
|
11566
|
+
}),
|
|
11567
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11568
|
+
label: "Повторы при 429/5xx",
|
|
11569
|
+
path: ["gitlab", "retries"],
|
|
11570
|
+
value: rawNumber(rawObject(config.gitlab).retries),
|
|
11571
|
+
...control
|
|
11572
|
+
})
|
|
11573
|
+
] })
|
|
11574
|
+
]
|
|
11575
|
+
}),
|
|
11576
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11577
|
+
title: "TeamCity",
|
|
11578
|
+
state: providerState(rawObject(config.teamcity), {
|
|
11579
|
+
enabled: true,
|
|
11580
|
+
capabilities: [
|
|
11581
|
+
["identityRead", true],
|
|
11582
|
+
["projectsRead", true],
|
|
11583
|
+
["buildConfigsRead", true],
|
|
11584
|
+
["buildsRead", true],
|
|
11585
|
+
["failuresRead", true],
|
|
11586
|
+
["logsRead", true],
|
|
11587
|
+
["queueRead", true],
|
|
11588
|
+
["investigationsRead", true],
|
|
11589
|
+
["agentsRead", true],
|
|
11590
|
+
["artifactsRead", true]
|
|
11591
|
+
]
|
|
11592
|
+
}),
|
|
11593
|
+
children: [
|
|
11594
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11595
|
+
title: "Провайдер",
|
|
11596
|
+
children: [tg("Провайдер включён", ["teamcity", "enabled"], rawBool(rawObject(config.teamcity).enabled, true)), tg("Разрешить http", [
|
|
11597
|
+
"teamcity",
|
|
11598
|
+
"network",
|
|
11599
|
+
"allowHttp"
|
|
11600
|
+
], rawBool(rawObject(rawObject(config.teamcity).network).allowHttp, false), "незащищённые адреса TeamCity")]
|
|
11601
|
+
}),
|
|
11602
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11603
|
+
title: "Подключение",
|
|
11604
|
+
wide: true,
|
|
11605
|
+
children: [
|
|
11606
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextField, {
|
|
11607
|
+
label: "Адрес сервера TeamCity",
|
|
11608
|
+
hint: "один на весь стенд; пользователь вводит только токен",
|
|
11609
|
+
placeholder: "https://teamcity.example.corp",
|
|
11610
|
+
path: ["teamcity", "serverUrl"],
|
|
11611
|
+
value: rawString(rawObject(config.teamcity).serverUrl),
|
|
11612
|
+
...control
|
|
11613
|
+
}),
|
|
11614
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectField, {
|
|
11615
|
+
label: "Режим сетевой политики",
|
|
11616
|
+
path: [
|
|
11617
|
+
"teamcity",
|
|
11618
|
+
"network",
|
|
11619
|
+
"mode"
|
|
11620
|
+
],
|
|
11621
|
+
value: rawString(rawObject(rawObject(config.teamcity).network).mode) || "allowlist",
|
|
11622
|
+
options: [{
|
|
11623
|
+
value: "allowlist",
|
|
11624
|
+
label: "allowlist — только перечисленные адреса"
|
|
11625
|
+
}, {
|
|
11626
|
+
value: "trusted-private",
|
|
11627
|
+
label: "trusted-private — любой хост, приватные диапазоны разрешены"
|
|
11628
|
+
}],
|
|
11629
|
+
disabled: !writable,
|
|
11630
|
+
write,
|
|
11631
|
+
overridden
|
|
11632
|
+
}),
|
|
11633
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11634
|
+
label: "Разрешённые хосты",
|
|
11635
|
+
hint: "точные имена или *.суффикс; опечатка падает при записи",
|
|
11636
|
+
path: [
|
|
11637
|
+
"teamcity",
|
|
11638
|
+
"network",
|
|
11639
|
+
"allowedHosts"
|
|
11640
|
+
],
|
|
11641
|
+
values: rawStringList(rawObject(rawObject(config.teamcity).network).allowedHosts),
|
|
11642
|
+
placeholder: "teamcity.example.corp",
|
|
11643
|
+
...control
|
|
11644
|
+
}),
|
|
11645
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11646
|
+
label: "Разрешённые CIDR",
|
|
11647
|
+
hint: "только для адресов, записанных цифрами",
|
|
11648
|
+
path: [
|
|
11649
|
+
"teamcity",
|
|
11650
|
+
"network",
|
|
11651
|
+
"allowedCidrs"
|
|
11652
|
+
],
|
|
11653
|
+
values: rawStringList(rawObject(rawObject(config.teamcity).network).allowedCidrs),
|
|
11654
|
+
placeholder: "10.20.0.0/16",
|
|
11655
|
+
...control
|
|
11656
|
+
}),
|
|
11657
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
11658
|
+
label: "Разрешённые порты",
|
|
11659
|
+
hint: "пусто — только порт схемы",
|
|
11660
|
+
path: [
|
|
11661
|
+
"teamcity",
|
|
11662
|
+
"network",
|
|
11663
|
+
"allowedPorts"
|
|
11664
|
+
],
|
|
11665
|
+
values: rawStringList(rawObject(rawObject(config.teamcity).network).allowedPorts),
|
|
11666
|
+
placeholder: "8111",
|
|
11667
|
+
...control
|
|
11668
|
+
})
|
|
11669
|
+
]
|
|
11670
|
+
}),
|
|
11671
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11672
|
+
title: "Что доступно агенту",
|
|
11673
|
+
kind: "checks",
|
|
11674
|
+
children: [
|
|
11675
|
+
["identityRead", "Профиль: чтение"],
|
|
11676
|
+
["projectsRead", "Проекты: чтение"],
|
|
11677
|
+
["buildConfigsRead", "Конфигурации сборок: чтение"],
|
|
11678
|
+
["buildsRead", "Сборки: чтение"],
|
|
11679
|
+
["failuresRead", "Провалы: чтение"],
|
|
11680
|
+
["logsRead", "Логи сборок: чтение"],
|
|
11681
|
+
["queueRead", "Очередь: чтение"],
|
|
11682
|
+
["investigationsRead", "Расследования: чтение"],
|
|
11683
|
+
["agentsRead", "Агенты: чтение"],
|
|
11684
|
+
["artifactsRead", "Артефакты: чтение"]
|
|
11685
|
+
].map(([key, label]) => tg(label, ["teamcity", key], rawBool(rawObject(config.teamcity)[key], true)))
|
|
11686
|
+
}),
|
|
11687
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, { children: [
|
|
11688
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11689
|
+
label: "Строк в ответе лога",
|
|
11690
|
+
path: ["teamcity", "maxLogLines"],
|
|
11691
|
+
value: rawNumber(rawObject(config.teamcity).maxLogLines),
|
|
11692
|
+
...control
|
|
11693
|
+
}),
|
|
11694
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11695
|
+
label: "Скачивать лога, байт",
|
|
11696
|
+
path: ["teamcity", "maxLogBytes"],
|
|
11697
|
+
value: rawNumber(rawObject(config.teamcity).maxLogBytes),
|
|
11698
|
+
...control
|
|
11699
|
+
}),
|
|
11700
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11701
|
+
label: "Артефакт по умолчанию, байт",
|
|
11702
|
+
path: ["teamcity", "defaultArtifactBytes"],
|
|
11703
|
+
value: rawNumber(rawObject(config.teamcity).defaultArtifactBytes),
|
|
11704
|
+
...control
|
|
11705
|
+
}),
|
|
11706
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11707
|
+
label: "Потолок артефакта, байт",
|
|
11708
|
+
path: ["teamcity", "maxArtifactBytes"],
|
|
11709
|
+
value: rawNumber(rawObject(config.teamcity).maxArtifactBytes),
|
|
11710
|
+
...control
|
|
11711
|
+
}),
|
|
11712
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11713
|
+
label: "Таймаут логов и артефактов, мс",
|
|
11714
|
+
path: ["teamcity", "streamTimeoutMs"],
|
|
11715
|
+
value: rawNumber(rawObject(config.teamcity).streamTimeoutMs),
|
|
11716
|
+
...control
|
|
11717
|
+
}),
|
|
11718
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11719
|
+
label: "Повторы при 429/5xx",
|
|
11720
|
+
path: ["teamcity", "retries"],
|
|
11721
|
+
value: rawNumber(rawObject(config.teamcity).retries),
|
|
11722
|
+
...control
|
|
11723
|
+
})
|
|
11724
|
+
] })
|
|
11725
|
+
]
|
|
11726
|
+
}),
|
|
11727
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11728
|
+
title: "Jira",
|
|
11729
|
+
state: providerState(rawObject(config.jira), {
|
|
11730
|
+
enabled: true,
|
|
11731
|
+
capabilities: [
|
|
11732
|
+
["identityRead", true],
|
|
11733
|
+
["issuesRead", true],
|
|
11734
|
+
["commentsRead", true],
|
|
11735
|
+
["attachmentsRead", true],
|
|
11736
|
+
["transitionsRead", true],
|
|
11737
|
+
["projectsRead", true],
|
|
11738
|
+
["fieldsRead", true]
|
|
11739
|
+
],
|
|
11740
|
+
counts: [{
|
|
11741
|
+
path: "sites",
|
|
11742
|
+
forms: [
|
|
11743
|
+
"сайт",
|
|
11744
|
+
"сайта",
|
|
11745
|
+
"сайтов"
|
|
11746
|
+
]
|
|
11747
|
+
}]
|
|
11748
|
+
}),
|
|
11749
|
+
children: [
|
|
11750
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11751
|
+
title: "Провайдер",
|
|
11752
|
+
children: [tg("Провайдер включён", ["jira", "enabled"], rawBool(rawObject(config.jira).enabled, true)), tg("Разрешить http", ["jira", "allowInsecureHttp"], rawBool(rawObject(config.jira).allowInsecureHttp, false), "только для dev-стенда")]
|
|
11753
|
+
}),
|
|
11754
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11755
|
+
title: "Подключение",
|
|
11756
|
+
wide: true,
|
|
11757
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstanceListField, {
|
|
11758
|
+
label: "Сайты Jira Cloud",
|
|
11759
|
+
hint: "пользователь выбирает сайт из списка, произвольный хост ввести нельзя",
|
|
11760
|
+
path: ["jira", "sites"],
|
|
11761
|
+
instances: instanceRows(rawObject(config.jira).sites),
|
|
11762
|
+
...control
|
|
11763
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecordField, {
|
|
11764
|
+
label: "Псевдонимы полей",
|
|
11765
|
+
hint: "имя поля Jira по бизнес-термину",
|
|
11766
|
+
path: ["jira", "fieldAliases"],
|
|
11767
|
+
entries: rawRecord(rawObject(config.jira).fieldAliases),
|
|
11768
|
+
keyPlaceholder: "продукт",
|
|
11769
|
+
valuePlaceholder: "customfield_10000",
|
|
11770
|
+
...control
|
|
11771
|
+
})]
|
|
11772
|
+
}),
|
|
11773
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11774
|
+
title: "Что доступно агенту",
|
|
11775
|
+
kind: "checks",
|
|
11776
|
+
children: [
|
|
11777
|
+
["identityRead", "Профиль: чтение"],
|
|
11778
|
+
["issuesRead", "Задачи: чтение"],
|
|
11779
|
+
["commentsRead", "Комментарии: чтение"],
|
|
11780
|
+
["attachmentsRead", "Вложения: чтение"],
|
|
11781
|
+
["transitionsRead", "Переходы: чтение"],
|
|
11782
|
+
["projectsRead", "Проекты: чтение"],
|
|
11783
|
+
["fieldsRead", "Схема полей: чтение"]
|
|
11784
|
+
].map(([key, label]) => tg(label, ["jira", key], rawBool(rawObject(config.jira)[key], true)))
|
|
11785
|
+
}),
|
|
11786
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, { children: [
|
|
11787
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11788
|
+
label: "Строк поиска по умолчанию",
|
|
11789
|
+
path: ["jira", "defaultSearchLimit"],
|
|
11790
|
+
value: rawNumber(rawObject(config.jira).defaultSearchLimit),
|
|
11791
|
+
...control
|
|
11792
|
+
}),
|
|
11793
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11794
|
+
label: "Потолок строк поиска",
|
|
11795
|
+
path: ["jira", "maxSearchLimit"],
|
|
11796
|
+
value: rawNumber(rawObject(config.jira).maxSearchLimit),
|
|
11797
|
+
...control
|
|
11798
|
+
}),
|
|
11799
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11800
|
+
label: "Потолок страницы комментариев",
|
|
11801
|
+
path: ["jira", "maxCommentLimit"],
|
|
11802
|
+
value: rawNumber(rawObject(config.jira).maxCommentLimit),
|
|
11803
|
+
...control
|
|
11804
|
+
}),
|
|
11805
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11806
|
+
label: "Знаков текста в ответе",
|
|
11807
|
+
path: ["jira", "maxTextChars"],
|
|
11808
|
+
value: rawNumber(rawObject(config.jira).maxTextChars),
|
|
11809
|
+
...control
|
|
11810
|
+
}),
|
|
11811
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11812
|
+
label: "Повторы при 429/5xx",
|
|
11813
|
+
path: ["jira", "retries"],
|
|
11814
|
+
value: rawNumber(rawObject(config.jira).retries),
|
|
11815
|
+
...control
|
|
11816
|
+
})
|
|
11817
|
+
] })
|
|
11818
|
+
]
|
|
11819
|
+
}),
|
|
11820
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11821
|
+
title: "Test IT",
|
|
11822
|
+
state: providerState(rawObject(config.testit), {
|
|
11823
|
+
enabled: true,
|
|
11824
|
+
capabilities: [
|
|
11825
|
+
["projectsRead", true],
|
|
11826
|
+
["sectionsRead", true],
|
|
11827
|
+
["workItemsRead", true],
|
|
11828
|
+
["historyRead", true],
|
|
11829
|
+
["commentsRead", true],
|
|
11830
|
+
["testPlansRead", true],
|
|
11831
|
+
["testRunsRead", true],
|
|
11832
|
+
["testResultsRead", true],
|
|
11833
|
+
["autoTestsRead", true],
|
|
11834
|
+
["attachmentsRead", true],
|
|
11835
|
+
["configurationsRead", true]
|
|
11836
|
+
],
|
|
11837
|
+
counts: [{
|
|
11838
|
+
path: "instances",
|
|
11839
|
+
forms: [
|
|
11840
|
+
"инстанс",
|
|
11841
|
+
"инстанса",
|
|
11842
|
+
"инстансов"
|
|
11843
|
+
]
|
|
11844
|
+
}]
|
|
11845
|
+
}),
|
|
11846
|
+
children: [
|
|
11847
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11848
|
+
title: "Провайдер",
|
|
11849
|
+
children: [tg("Провайдер включён", ["testit", "enabled"], rawBool(rawObject(config.testit).enabled, true)), tg("Разрешить http", ["testit", "allowInsecureHttp"], rawBool(rawObject(config.testit).allowInsecureHttp, false), "только для dev-стенда")]
|
|
11850
|
+
}),
|
|
11851
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11852
|
+
title: "Подключение",
|
|
11853
|
+
wide: true,
|
|
11854
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstanceListField, {
|
|
11855
|
+
label: "Инсталляции Test IT",
|
|
11856
|
+
path: ["testit", "instances"],
|
|
11857
|
+
instances: instanceRows(rawObject(config.testit).instances),
|
|
11858
|
+
...control
|
|
11859
|
+
})
|
|
11860
|
+
}),
|
|
11861
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11862
|
+
title: "Что доступно агенту",
|
|
11863
|
+
kind: "checks",
|
|
11864
|
+
children: [
|
|
11865
|
+
["projectsRead", "Проекты: чтение"],
|
|
11866
|
+
["sectionsRead", "Секции: чтение"],
|
|
11867
|
+
["workItemsRead", "Work items: чтение"],
|
|
11868
|
+
["historyRead", "История: чтение"],
|
|
11869
|
+
["commentsRead", "Комментарии: чтение"],
|
|
11870
|
+
["testPlansRead", "Планы: чтение"],
|
|
11871
|
+
["testRunsRead", "Прогоны: чтение"],
|
|
11872
|
+
["testResultsRead", "Результаты: чтение"],
|
|
11873
|
+
["autoTestsRead", "Автотесты: чтение"],
|
|
11874
|
+
["attachmentsRead", "Вложения: чтение"],
|
|
11875
|
+
["configurationsRead", "Конфигурации: чтение"]
|
|
11876
|
+
].map(([key, label]) => tg(label, ["testit", key], rawBool(rawObject(config.testit)[key], true)))
|
|
11877
|
+
}),
|
|
11878
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, { children: [
|
|
11879
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11880
|
+
label: "Строк по умолчанию",
|
|
11881
|
+
path: ["testit", "defaultResults"],
|
|
11882
|
+
value: rawNumber(rawObject(config.testit).defaultResults),
|
|
11883
|
+
...control
|
|
11884
|
+
}),
|
|
11885
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11886
|
+
label: "Потолок строк списка",
|
|
11887
|
+
path: ["testit", "maxResults"],
|
|
11888
|
+
value: rawNumber(rawObject(config.testit).maxResults),
|
|
11889
|
+
...control
|
|
11890
|
+
}),
|
|
11891
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11892
|
+
label: "Вложение по умолчанию, байт",
|
|
11893
|
+
path: ["testit", "defaultAttachmentBytes"],
|
|
11894
|
+
value: rawNumber(rawObject(config.testit).defaultAttachmentBytes),
|
|
11895
|
+
...control
|
|
11896
|
+
}),
|
|
11897
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11898
|
+
label: "Потолок вложения, байт",
|
|
11899
|
+
path: ["testit", "maxAttachmentBytes"],
|
|
11900
|
+
value: rawNumber(rawObject(config.testit).maxAttachmentBytes),
|
|
11901
|
+
...control
|
|
11902
|
+
}),
|
|
11903
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11904
|
+
label: "Таймаут вложения, мс",
|
|
11905
|
+
path: ["testit", "attachmentTimeoutMs"],
|
|
11906
|
+
value: rawNumber(rawObject(config.testit).attachmentTimeoutMs),
|
|
11907
|
+
...control
|
|
11908
|
+
}),
|
|
11909
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11910
|
+
label: "Повторы при 429/5xx",
|
|
11911
|
+
path: ["testit", "retries"],
|
|
11912
|
+
value: rawNumber(rawObject(config.testit).retries),
|
|
11913
|
+
...control
|
|
11914
|
+
})
|
|
11915
|
+
] })
|
|
11916
|
+
]
|
|
11917
|
+
}),
|
|
11918
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11919
|
+
title: "Weblate",
|
|
11920
|
+
state: providerState(rawObject(config.weblate), {
|
|
11921
|
+
enabled: true,
|
|
11922
|
+
capabilities: [
|
|
11923
|
+
["identityRead", true],
|
|
11924
|
+
["projectsRead", true],
|
|
11925
|
+
["componentsRead", true],
|
|
11926
|
+
["translationsRead", true],
|
|
11927
|
+
["unitsRead", true],
|
|
11928
|
+
["checksRead", true],
|
|
11929
|
+
["commentsRead", true],
|
|
11930
|
+
["suggestionsRead", true],
|
|
11931
|
+
["changesRead", true],
|
|
11932
|
+
["statisticsRead", true],
|
|
11933
|
+
["screenshotsRead", true]
|
|
11934
|
+
],
|
|
11935
|
+
counts: [{
|
|
11936
|
+
path: "instances",
|
|
11937
|
+
forms: [
|
|
11938
|
+
"инстанс",
|
|
11939
|
+
"инстанса",
|
|
11940
|
+
"инстансов"
|
|
11941
|
+
]
|
|
11942
|
+
}]
|
|
11943
|
+
}),
|
|
11944
|
+
children: [
|
|
11945
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
11946
|
+
title: "Провайдер",
|
|
11947
|
+
children: [tg("Провайдер включён", ["weblate", "enabled"], rawBool(rawObject(config.weblate).enabled, true)), tg("Разрешить http", ["weblate", "allowInsecureHttp"], rawBool(rawObject(config.weblate).allowInsecureHttp, false), "только для dev-стенда")]
|
|
11948
|
+
}),
|
|
11949
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11950
|
+
title: "Подключение",
|
|
11951
|
+
wide: true,
|
|
11952
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstanceListField, {
|
|
11953
|
+
label: "Инстансы Weblate",
|
|
11954
|
+
path: ["weblate", "instances"],
|
|
11955
|
+
instances: instanceRows(rawObject(config.weblate).instances),
|
|
11956
|
+
...control
|
|
11957
|
+
})
|
|
11958
|
+
}),
|
|
11959
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
11960
|
+
title: "Что доступно агенту",
|
|
11961
|
+
kind: "checks",
|
|
11962
|
+
children: [
|
|
11963
|
+
["identityRead", "Профиль: чтение"],
|
|
11964
|
+
["projectsRead", "Проекты: чтение"],
|
|
11965
|
+
["componentsRead", "Компоненты: чтение"],
|
|
11966
|
+
["translationsRead", "Переводы: чтение"],
|
|
11967
|
+
["unitsRead", "Единицы: чтение"],
|
|
11968
|
+
["checksRead", "Проверки: чтение"],
|
|
11969
|
+
["commentsRead", "Комментарии: чтение"],
|
|
11970
|
+
["suggestionsRead", "Предложения: чтение"],
|
|
11971
|
+
["changesRead", "Изменения: чтение"],
|
|
11972
|
+
["statisticsRead", "Статистика: чтение"],
|
|
11973
|
+
["screenshotsRead", "Скриншоты: чтение"]
|
|
11974
|
+
].map(([key, label]) => tg(label, ["weblate", key], rawBool(rawObject(config.weblate)[key], true)))
|
|
11975
|
+
}),
|
|
11976
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LimitsGroup, { children: [
|
|
11977
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11978
|
+
label: "Знаков строки в ответе",
|
|
11979
|
+
path: ["weblate", "maxTextChars"],
|
|
11980
|
+
value: rawNumber(rawObject(config.weblate).maxTextChars),
|
|
11981
|
+
...control
|
|
11982
|
+
}),
|
|
11983
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11984
|
+
label: "Строк на страницу",
|
|
11985
|
+
path: ["weblate", "maxPageSize"],
|
|
11986
|
+
value: rawNumber(rawObject(config.weblate).maxPageSize),
|
|
11987
|
+
...control
|
|
11988
|
+
}),
|
|
11989
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberField, {
|
|
11990
|
+
label: "Повторы при 429/5xx",
|
|
11991
|
+
path: ["weblate", "retries"],
|
|
11992
|
+
value: rawNumber(rawObject(config.weblate).retries),
|
|
11993
|
+
...control
|
|
11994
|
+
})
|
|
11995
|
+
] })
|
|
11996
|
+
]
|
|
11997
|
+
}),
|
|
11998
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Section, {
|
|
11999
|
+
title: "Сервисные доступы",
|
|
12000
|
+
hint: "общие read-only креденшалы, которыми владеет развёртывание",
|
|
12001
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
|
|
12002
|
+
title: "Режим",
|
|
12003
|
+
children: [tg("Сервисные доступы включены", ["managedServiceCredentials", "enabled"], rawBool(msc.enabled, false)), tg("Новое подключение стартует в сервисном режиме", ["managedServiceCredentials", "defaultForNewConnections"], rawBool(msc.defaultForNewConnections, true))]
|
|
12004
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
|
|
12005
|
+
title: "Профили доступа",
|
|
12006
|
+
wide: true,
|
|
12007
|
+
hint: "read-only аккаунт, которым развёртывание подключается вместо гостя",
|
|
12008
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ServiceProfilesField, {
|
|
12009
|
+
profiles: profileDrafts(msc.profiles),
|
|
12010
|
+
disabled: !writable,
|
|
12011
|
+
write,
|
|
12012
|
+
unset,
|
|
12013
|
+
overridden
|
|
12014
|
+
})
|
|
12015
|
+
})]
|
|
12016
|
+
}),
|
|
12017
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Section, {
|
|
12018
|
+
title: "Подсказки получения доступа",
|
|
12019
|
+
hint: "замена встроенных ссылок провайдеров своими",
|
|
12020
|
+
children: PROVIDER_IDS.map((provider) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredentialHelpSection, {
|
|
12021
|
+
provider,
|
|
12022
|
+
override: rawObject(rawObject(config.credentialHelp)[provider]),
|
|
12023
|
+
disabled: !writable,
|
|
12024
|
+
write,
|
|
12025
|
+
unset,
|
|
12026
|
+
overridden
|
|
12027
|
+
}, provider))
|
|
12028
|
+
})
|
|
12029
|
+
] })
|
|
12030
|
+
});
|
|
10076
12031
|
}
|
|
10077
12032
|
//#endregion
|
|
10078
12033
|
//#region src/client/styles.ts
|
|
@@ -10111,21 +12066,98 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10111
12066
|
.dsh-qa-integrations__notice{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:10px;padding:12px;font-size:12px;line-height:1.55;color:var(--dsw-alias-label-secondary)}
|
|
10112
12067
|
.dsh-qa-integrations__check{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}
|
|
10113
12068
|
.dsh-qa-integrations__hint code{background:var(--dsw-alias-bg-layer-2);border-radius:4px;padding:0 4px;font-size:12px}
|
|
12069
|
+
.qai-op__body{display:flex;flex-direction:column;gap:14px;padding:14px 0 8px}
|
|
12070
|
+
.qai-op__muted{margin:0;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}
|
|
12071
|
+
.qai-op__error{border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;padding:9px 11px;color:var(--dsw-alias-state-error-primary);font-size:13px}
|
|
12072
|
+
.qai-op__toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
|
|
12073
|
+
.qai-op__section{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2)}
|
|
12074
|
+
.qai-op__section-summary{display:flex;align-items:center;gap:10px;padding:11px 14px;cursor:pointer;list-style:none;user-select:none}
|
|
12075
|
+
.qai-op__section-summary::-webkit-details-marker{display:none}
|
|
12076
|
+
.qai-op__section-summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}
|
|
12077
|
+
.qai-op__section-title{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
12078
|
+
.qai-op__section-summary::before{content:"";width:8px;height:8px;flex:none;border-right:1.5px solid var(--dsw-alias-label-tertiary);border-bottom:1.5px solid var(--dsw-alias-label-tertiary);transform:rotate(-45deg);transition:transform .16s}
|
|
12079
|
+
.qai-op__section[open]>.qai-op__section-summary::before{transform:rotate(45deg)}
|
|
12080
|
+
.qai-op__section-body{display:flex;flex-direction:column;gap:12px;padding:2px 14px 14px;border-top:1px solid var(--dsw-alias-border-l2)}
|
|
12081
|
+
.qai-op__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px 18px}
|
|
12082
|
+
.qai-op__section-state{margin-left:auto;color:var(--dsw-alias-label-secondary);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
12083
|
+
.qai-op__group{display:flex;flex-direction:column;gap:8px;padding-top:10px;border-top:1px solid var(--dsw-alias-border-l2)}
|
|
12084
|
+
.qai-op__section-body>.qai-op__group:first-child{padding-top:0;border-top:0}
|
|
12085
|
+
.qai-op__group-title{margin:0;color:var(--dsw-alias-label-secondary);font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
|
|
12086
|
+
.qai-op__group-hint{margin:0;color:var(--dsw-alias-label-tertiary);font-size:11.5px;line-height:1.45}
|
|
12087
|
+
.qai-op__group--wide>.qai-op__grid{grid-template-columns:minmax(0,1fr)}
|
|
12088
|
+
.qai-op__group--checks>.qai-op__grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:2px 18px}
|
|
12089
|
+
.qai-op__group--checks .qai-op__toggle-row{flex-direction:row-reverse;justify-content:flex-end;align-items:center;gap:9px;padding:3px 0;text-align:left}
|
|
12090
|
+
.qai-op__group--checks .qai-op__toggle-copy span{padding-left:25px}
|
|
12091
|
+
.qai-op__group--limits{border-top:1px solid var(--dsw-alias-border-l2);padding-top:10px}
|
|
12092
|
+
.qai-op__group-summary{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;cursor:pointer;list-style:none;user-select:none}
|
|
12093
|
+
.qai-op__group-summary::-webkit-details-marker{display:none}
|
|
12094
|
+
.qai-op__group-summary::before{content:"";width:6px;height:6px;flex:none;align-self:center;border-right:1.5px solid var(--dsw-alias-label-tertiary);border-bottom:1.5px solid var(--dsw-alias-label-tertiary);transform:rotate(-45deg);transition:transform .16s}
|
|
12095
|
+
.qai-op__group--limits[open]>.qai-op__group-summary::before{transform:rotate(45deg)}
|
|
12096
|
+
.qai-op__group-summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}
|
|
12097
|
+
.qai-op__group--limits>.qai-op__grid{padding-top:10px}
|
|
12098
|
+
.qai-op__field{display:flex;flex-direction:column;gap:6px;font-size:13px;min-width:0}
|
|
12099
|
+
.qai-op__label{display:flex;align-items:center;gap:6px;font-weight:600;color:var(--dsw-alias-label-primary);font-size:12.5px}
|
|
12100
|
+
.qai-op__hint{color:var(--dsw-alias-label-tertiary);font-size:11.5px;line-height:1.45;font-weight:400}
|
|
12101
|
+
.qai-op__overridden{border-radius:999px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);padding:0 7px;font-size:10.5px;font-weight:500;white-space:nowrap}
|
|
12102
|
+
.qai-op__input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border-radius:8px;padding:7px 10px;font:inherit;font-size:13px;width:100%;min-width:0;box-sizing:border-box}
|
|
12103
|
+
.qai-op__input:focus-visible,.qai-op__button:focus-visible,.qai-op__section-summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}
|
|
12104
|
+
.qai-op__button{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);border-radius:8px;padding:7px 12px;font:inherit;font-size:12.5px;cursor:pointer;white-space:nowrap}
|
|
12105
|
+
.qai-op__button:disabled{cursor:not-allowed;opacity:.55}
|
|
12106
|
+
.qai-op__toggle-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;font-size:12.5px;padding:4px 0}
|
|
12107
|
+
.qai-op__toggle-row--inline{align-items:center;padding:0}
|
|
12108
|
+
.qai-op__toggle-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
12109
|
+
.qai-op__toggle-copy strong{display:flex;align-items:center;gap:6px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
12110
|
+
.qai-op__toggle-copy span{color:var(--dsw-alias-label-tertiary);font-size:11.5px;line-height:1.45}
|
|
12111
|
+
.qai-op__toggle{width:16px;height:16px;flex:none;accent-color:var(--dsw-alias-brand-primary);margin-top:2px}
|
|
12112
|
+
.qai-op__rows{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}
|
|
12113
|
+
.qai-op__row{display:flex;align-items:center;gap:8px;font-size:12.5px}
|
|
12114
|
+
.qai-op__row-key{color:var(--dsw-alias-label-secondary);font-size:12px;flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
12115
|
+
.qai-op__row-value{color:var(--dsw-alias-label-primary);font-size:12.5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
12116
|
+
.qai-op__row-add{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
|
|
12117
|
+
.qai-op__row-add .qai-op__input{width:auto;flex:1;min-width:120px}
|
|
12118
|
+
.qai-op__row-remove{border:0;background:0 0;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:11.5px;cursor:pointer;padding:2px 4px;flex:none}
|
|
12119
|
+
.qai-op__row-remove:hover{color:var(--dsw-alias-state-error-primary)}
|
|
12120
|
+
.qai-op__instances,.qai-op__profiles{display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none}
|
|
12121
|
+
.qai-op__instance,.qai-op__profile{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-3);padding:10px;display:flex;flex-direction:column;gap:8px}
|
|
12122
|
+
.qai-op__instance{flex-direction:row;align-items:flex-end;flex-wrap:wrap}
|
|
12123
|
+
.qai-op__instance-cell{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--dsw-alias-label-tertiary);flex:1;min-width:110px}
|
|
12124
|
+
.qai-op__instance-cell--wide{flex:2}
|
|
12125
|
+
.qai-op__instance-key{font-size:11px;color:var(--dsw-alias-label-tertiary)}
|
|
12126
|
+
.qai-op__profile-head{display:flex;align-items:center;gap:10px}
|
|
12127
|
+
.qai-op__profile-head strong{font-size:13px;color:var(--dsw-alias-label-primary);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
12128
|
+
.qai-op__profile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:8px 12px}
|
|
10114
12129
|
`}`;
|
|
12130
|
+
//#endregion
|
|
12131
|
+
//#region src/shared/settings.ts
|
|
12132
|
+
/**
|
|
12133
|
+
* Identity shared by the Host plugin and its operator card.
|
|
12134
|
+
*
|
|
12135
|
+
* This module must stay dependency-free: the card bundle inlines it, and a
|
|
12136
|
+
* browser build must not pull the Host config surface (schemastery) into the
|
|
12137
|
+
* page just to learn the namespace name.
|
|
12138
|
+
*/
|
|
12139
|
+
/**
|
|
12140
|
+
* Settings namespace the plugin owns and its operator card binds to. The
|
|
12141
|
+
* namespace carries the deployment configuration the card edits; the profile
|
|
12142
|
+
* composition row stays the base layer an override reverts to.
|
|
12143
|
+
*/
|
|
12144
|
+
const QA_INTEGRATIONS_SETTINGS_NAMESPACE = "qa-integrations";
|
|
10115
12145
|
//#endregion
|
|
10116
12146
|
//#region src/client/index.tsx
|
|
10117
12147
|
const inject = [
|
|
10118
12148
|
"remote",
|
|
10119
12149
|
"qaUserSettingsSections",
|
|
10120
12150
|
"qaUserSession",
|
|
12151
|
+
"settingsScope",
|
|
10121
12152
|
"slots"
|
|
10122
12153
|
];
|
|
10123
12154
|
/**
|
|
10124
|
-
*
|
|
10125
|
-
*
|
|
10126
|
-
*
|
|
10127
|
-
*
|
|
10128
|
-
*
|
|
12155
|
+
* All three mounts of this one bundle: the operator card in the Host's
|
|
12156
|
+
* "Plugin configuration" tab, which edits the plugin's settings namespace, the
|
|
12157
|
+
* page of the signed-in user's QA settings dialog, where the account gate
|
|
12158
|
+
* lives, and the feature-owned tab in the host's Plugins settings, which
|
|
12159
|
+
* reaches the same account through the `qaUserSession` service without
|
|
12160
|
+
* depending on the Host settings directory.
|
|
10129
12161
|
*/
|
|
10130
12162
|
async function apply(ctx) {
|
|
10131
12163
|
const disposeRemote = await ctx.remote.$mount(TYPERT_REMOTE);
|
|
@@ -10134,6 +12166,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10134
12166
|
"remote.qaIntegrations",
|
|
10135
12167
|
"qaUserSettingsSections",
|
|
10136
12168
|
"qaUserSession",
|
|
12169
|
+
"settingsScope",
|
|
10137
12170
|
"slots"
|
|
10138
12171
|
], (injected) => {
|
|
10139
12172
|
const face = injected;
|
|
@@ -10147,6 +12180,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10147
12180
|
document.head.append(style);
|
|
10148
12181
|
return () => style.remove();
|
|
10149
12182
|
}, "dsh-qa-integrations: styles");
|
|
12183
|
+
const removeCard = registerSettingsCard(face, {
|
|
12184
|
+
key: QA_INTEGRATIONS_SETTINGS_NAMESPACE,
|
|
12185
|
+
pluginName: "@yadsh/dsh-qa-integrations",
|
|
12186
|
+
component: OperatorCard,
|
|
12187
|
+
inject: () => ({ scope: face.settingsScope.bind({ namespace: QA_INTEGRATIONS_SETTINGS_NAMESPACE }) })
|
|
12188
|
+
});
|
|
10150
12189
|
(async () => {
|
|
10151
12190
|
const description = await face.remote.qaIntegrations.describe();
|
|
10152
12191
|
if (cancelled || !description.ok || !description.value.enabled) return;
|
|
@@ -10169,6 +12208,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10169
12208
|
cancelled = true;
|
|
10170
12209
|
removeSection?.();
|
|
10171
12210
|
removeHostTab?.();
|
|
12211
|
+
removeCard?.();
|
|
10172
12212
|
};
|
|
10173
12213
|
});
|
|
10174
12214
|
} catch (error) {
|