@equinor/roma-framework 0.0.7-BETA.3 → 0.0.7-BETA.5
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/dev-portal/lib/api/roma/api/setting-controller/setting-controller.d.ts +117 -148
- package/dev-portal/lib/api/roma/model/settingDto.d.ts +3 -0
- package/dev-portal/lib/api/roma/use-client.d.ts +1 -1
- package/dev-portal/package.json +1 -1
- package/dev-portal/roma-framework.umd.js +12 -6
- package/lib/api/roma/api/setting-controller/setting-controller.d.ts +117 -148
- package/lib/api/roma/model/settingDto.d.ts +3 -0
- package/lib/api/roma/use-client.d.ts +1 -1
- package/package.json +1 -1
- package/roma-framework.mjs +195 -241
package/roma-framework.mjs
CHANGED
|
@@ -5274,13 +5274,13 @@ const createUrlParamsFromObject = (obj) => {
|
|
|
5274
5274
|
});
|
|
5275
5275
|
return params;
|
|
5276
5276
|
};
|
|
5277
|
-
class HttpError extends Error {
|
|
5277
|
+
let HttpError$1 = class HttpError extends Error {
|
|
5278
5278
|
constructor(message, response) {
|
|
5279
5279
|
super(message);
|
|
5280
5280
|
this.message = message;
|
|
5281
5281
|
this.response = response;
|
|
5282
5282
|
}
|
|
5283
|
-
}
|
|
5283
|
+
};
|
|
5284
5284
|
const handleJsonRequest = async (req) => {
|
|
5285
5285
|
if (req.status >= 400) {
|
|
5286
5286
|
let msg;
|
|
@@ -5303,7 +5303,7 @@ const handleJsonRequest = async (req) => {
|
|
|
5303
5303
|
headers: req.headers,
|
|
5304
5304
|
url: req.url
|
|
5305
5305
|
};
|
|
5306
|
-
throw new HttpError(req.statusText, error);
|
|
5306
|
+
throw new HttpError$1(req.statusText, error);
|
|
5307
5307
|
}
|
|
5308
5308
|
return await req.json();
|
|
5309
5309
|
};
|
|
@@ -5375,312 +5375,280 @@ const useCustomClient = () => {
|
|
|
5375
5375
|
// Add body if data is provided
|
|
5376
5376
|
}
|
|
5377
5377
|
);
|
|
5378
|
+
let value;
|
|
5378
5379
|
if (response.headers.get("content-length") === "0" || response.status === 204) {
|
|
5379
|
-
|
|
5380
|
+
value = await response.text();
|
|
5381
|
+
} else {
|
|
5382
|
+
value = await response.json();
|
|
5383
|
+
}
|
|
5384
|
+
if (response.status >= 400) {
|
|
5385
|
+
const error = {
|
|
5386
|
+
status: response.status,
|
|
5387
|
+
statusText: response.statusText,
|
|
5388
|
+
ok: false,
|
|
5389
|
+
headers: response.headers,
|
|
5390
|
+
url: response.url,
|
|
5391
|
+
message: value
|
|
5392
|
+
};
|
|
5393
|
+
throw new HttpError2(
|
|
5394
|
+
typeof value === "string" ? value : error.statusText,
|
|
5395
|
+
error
|
|
5396
|
+
);
|
|
5380
5397
|
}
|
|
5381
|
-
return
|
|
5398
|
+
return value;
|
|
5382
5399
|
};
|
|
5383
5400
|
};
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5401
|
+
class HttpError2 extends Error {
|
|
5402
|
+
constructor(message, response) {
|
|
5403
|
+
super(message);
|
|
5404
|
+
this.message = message;
|
|
5405
|
+
this.response = response;
|
|
5406
|
+
}
|
|
5407
|
+
}
|
|
5408
|
+
const useGetSettingByUserAndIdHook = () => {
|
|
5409
|
+
const getSettingByUserAndId = useCustomClient();
|
|
5410
|
+
return (userId, id, signal) => {
|
|
5411
|
+
return getSettingByUserAndId({
|
|
5412
|
+
url: `/api/settings/user/${userId}/id/${id}`,
|
|
5389
5413
|
method: "get",
|
|
5390
5414
|
signal
|
|
5391
5415
|
});
|
|
5392
5416
|
};
|
|
5393
5417
|
};
|
|
5394
|
-
const
|
|
5395
|
-
return [`/api/settings/user/${userId}/
|
|
5418
|
+
const getGetSettingByUserAndIdQueryKey = (userId, id) => {
|
|
5419
|
+
return [`/api/settings/user/${userId}/id/${id}`];
|
|
5396
5420
|
};
|
|
5397
|
-
const
|
|
5421
|
+
const useGetSettingByUserAndIdQueryOptions = (userId, id, options) => {
|
|
5398
5422
|
const { query: queryOptions } = options ?? {};
|
|
5399
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ??
|
|
5400
|
-
const
|
|
5401
|
-
const queryFn = ({ signal }) =>
|
|
5423
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetSettingByUserAndIdQueryKey(userId, id);
|
|
5424
|
+
const getSettingByUserAndId = useGetSettingByUserAndIdHook();
|
|
5425
|
+
const queryFn = ({ signal }) => getSettingByUserAndId(userId, id, signal);
|
|
5402
5426
|
return {
|
|
5403
5427
|
queryKey,
|
|
5404
5428
|
queryFn,
|
|
5405
|
-
enabled: !!(userId &&
|
|
5429
|
+
enabled: !!(userId && id),
|
|
5406
5430
|
...queryOptions
|
|
5407
5431
|
};
|
|
5408
5432
|
};
|
|
5409
|
-
const
|
|
5410
|
-
const queryOptions =
|
|
5433
|
+
const useGetSettingByUserAndId = (userId, id, options) => {
|
|
5434
|
+
const queryOptions = useGetSettingByUserAndIdQueryOptions(
|
|
5411
5435
|
userId,
|
|
5412
|
-
|
|
5436
|
+
id,
|
|
5413
5437
|
options
|
|
5414
5438
|
);
|
|
5415
5439
|
const query = useQuery(queryOptions);
|
|
5416
5440
|
query.queryKey = queryOptions.queryKey;
|
|
5417
5441
|
return query;
|
|
5418
5442
|
};
|
|
5419
|
-
const
|
|
5420
|
-
const
|
|
5421
|
-
return (userId,
|
|
5422
|
-
return
|
|
5423
|
-
url: `/api/settings/user/${userId}/
|
|
5424
|
-
method: "
|
|
5443
|
+
const useUpdateByUserIdAndIdHook = () => {
|
|
5444
|
+
const updateByUserIdAndId = useCustomClient();
|
|
5445
|
+
return (userId, id, settingDto) => {
|
|
5446
|
+
return updateByUserIdAndId({
|
|
5447
|
+
url: `/api/settings/user/${userId}/id/${id}`,
|
|
5448
|
+
method: "put",
|
|
5425
5449
|
headers: { "Content-Type": "application/json" },
|
|
5426
5450
|
data: settingDto
|
|
5427
5451
|
});
|
|
5428
5452
|
};
|
|
5429
5453
|
};
|
|
5430
|
-
const
|
|
5454
|
+
const useUpdateByUserIdAndIdMutationOptions = (options) => {
|
|
5431
5455
|
const { mutation: mutationOptions } = options ?? {};
|
|
5432
|
-
const
|
|
5456
|
+
const updateByUserIdAndId = useUpdateByUserIdAndIdHook();
|
|
5433
5457
|
const mutationFn = (props) => {
|
|
5434
|
-
const { userId,
|
|
5435
|
-
return
|
|
5458
|
+
const { userId, id, data } = props ?? {};
|
|
5459
|
+
return updateByUserIdAndId(userId, id, data);
|
|
5436
5460
|
};
|
|
5437
5461
|
return { mutationFn, ...mutationOptions };
|
|
5438
5462
|
};
|
|
5439
|
-
const
|
|
5440
|
-
const mutationOptions =
|
|
5463
|
+
const useUpdateByUserIdAndId = (options) => {
|
|
5464
|
+
const mutationOptions = useUpdateByUserIdAndIdMutationOptions(options);
|
|
5441
5465
|
return useMutation(mutationOptions);
|
|
5442
5466
|
};
|
|
5443
|
-
const
|
|
5444
|
-
const
|
|
5445
|
-
return (userId,
|
|
5446
|
-
return
|
|
5447
|
-
url: `/api/settings/user/${userId}/
|
|
5467
|
+
const useDeletePrivateSettingByIdHook = () => {
|
|
5468
|
+
const deletePrivateSettingById = useCustomClient();
|
|
5469
|
+
return (userId, id) => {
|
|
5470
|
+
return deletePrivateSettingById({
|
|
5471
|
+
url: `/api/settings/user/${userId}/id/${id}`,
|
|
5448
5472
|
method: "delete"
|
|
5449
5473
|
});
|
|
5450
5474
|
};
|
|
5451
5475
|
};
|
|
5452
|
-
const
|
|
5476
|
+
const useDeletePrivateSettingByIdMutationOptions = (options) => {
|
|
5453
5477
|
const { mutation: mutationOptions } = options ?? {};
|
|
5454
|
-
const
|
|
5478
|
+
const deletePrivateSettingById = useDeletePrivateSettingByIdHook();
|
|
5455
5479
|
const mutationFn = (props) => {
|
|
5456
|
-
const { userId,
|
|
5457
|
-
return
|
|
5480
|
+
const { userId, id } = props ?? {};
|
|
5481
|
+
return deletePrivateSettingById(userId, id);
|
|
5458
5482
|
};
|
|
5459
5483
|
return { mutationFn, ...mutationOptions };
|
|
5460
5484
|
};
|
|
5461
|
-
const
|
|
5462
|
-
const mutationOptions =
|
|
5485
|
+
const useDeletePrivateSettingById = (options) => {
|
|
5486
|
+
const mutationOptions = useDeletePrivateSettingByIdMutationOptions(options);
|
|
5463
5487
|
return useMutation(mutationOptions);
|
|
5464
5488
|
};
|
|
5465
|
-
const
|
|
5466
|
-
const
|
|
5467
|
-
return (
|
|
5468
|
-
return
|
|
5469
|
-
url: `/api/settings/
|
|
5489
|
+
const useGetPublicSettingByUserAndIdHook = () => {
|
|
5490
|
+
const getPublicSettingByUserAndId = useCustomClient();
|
|
5491
|
+
return (appShortName, id, signal) => {
|
|
5492
|
+
return getPublicSettingByUserAndId({
|
|
5493
|
+
url: `/api/settings/application/${appShortName}/id/${id}`,
|
|
5470
5494
|
method: "get",
|
|
5471
5495
|
signal
|
|
5472
5496
|
});
|
|
5473
5497
|
};
|
|
5474
5498
|
};
|
|
5475
|
-
const
|
|
5476
|
-
return [
|
|
5477
|
-
`/api/settings/user/${userId}/application/${appShortName}/setting/${settingKey}`
|
|
5478
|
-
];
|
|
5499
|
+
const getGetPublicSettingByUserAndIdQueryKey = (appShortName, id) => {
|
|
5500
|
+
return [`/api/settings/application/${appShortName}/id/${id}`];
|
|
5479
5501
|
};
|
|
5480
|
-
const
|
|
5502
|
+
const useGetPublicSettingByUserAndIdQueryOptions = (appShortName, id, options) => {
|
|
5481
5503
|
const { query: queryOptions } = options ?? {};
|
|
5482
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ??
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
settingKey
|
|
5486
|
-
);
|
|
5487
|
-
const getSettingByUserAndAppShortNameAndSetttingKey = useGetSettingByUserAndAppShortNameAndSetttingKeyHook();
|
|
5488
|
-
const queryFn = ({ signal }) => getSettingByUserAndAppShortNameAndSetttingKey(
|
|
5489
|
-
userId,
|
|
5490
|
-
appShortName,
|
|
5491
|
-
settingKey,
|
|
5492
|
-
signal
|
|
5493
|
-
);
|
|
5504
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetPublicSettingByUserAndIdQueryKey(appShortName, id);
|
|
5505
|
+
const getPublicSettingByUserAndId = useGetPublicSettingByUserAndIdHook();
|
|
5506
|
+
const queryFn = ({ signal }) => getPublicSettingByUserAndId(appShortName, id, signal);
|
|
5494
5507
|
return {
|
|
5495
5508
|
queryKey,
|
|
5496
5509
|
queryFn,
|
|
5497
|
-
enabled: !!(
|
|
5510
|
+
enabled: !!(appShortName && id),
|
|
5498
5511
|
...queryOptions
|
|
5499
5512
|
};
|
|
5500
5513
|
};
|
|
5501
|
-
const
|
|
5502
|
-
const queryOptions =
|
|
5503
|
-
userId,
|
|
5514
|
+
const useGetPublicSettingByUserAndId = (appShortName, id, options) => {
|
|
5515
|
+
const queryOptions = useGetPublicSettingByUserAndIdQueryOptions(
|
|
5504
5516
|
appShortName,
|
|
5505
|
-
|
|
5517
|
+
id,
|
|
5506
5518
|
options
|
|
5507
5519
|
);
|
|
5508
5520
|
const query = useQuery(queryOptions);
|
|
5509
5521
|
query.queryKey = queryOptions.queryKey;
|
|
5510
5522
|
return query;
|
|
5511
5523
|
};
|
|
5512
|
-
const
|
|
5513
|
-
const
|
|
5514
|
-
return (
|
|
5515
|
-
return
|
|
5516
|
-
url: `/api/settings/
|
|
5517
|
-
method: "
|
|
5524
|
+
const useUpdatePublicSettingByAppShortNameAndIdHook = () => {
|
|
5525
|
+
const updatePublicSettingByAppShortNameAndId = useCustomClient();
|
|
5526
|
+
return (appShortName, id, settingDto) => {
|
|
5527
|
+
return updatePublicSettingByAppShortNameAndId({
|
|
5528
|
+
url: `/api/settings/application/${appShortName}/id/${id}`,
|
|
5529
|
+
method: "put",
|
|
5518
5530
|
headers: { "Content-Type": "application/json" },
|
|
5519
5531
|
data: settingDto
|
|
5520
5532
|
});
|
|
5521
5533
|
};
|
|
5522
5534
|
};
|
|
5523
|
-
const
|
|
5535
|
+
const useUpdatePublicSettingByAppShortNameAndIdMutationOptions = (options) => {
|
|
5524
5536
|
const { mutation: mutationOptions } = options ?? {};
|
|
5525
|
-
const
|
|
5537
|
+
const updatePublicSettingByAppShortNameAndId = useUpdatePublicSettingByAppShortNameAndIdHook();
|
|
5526
5538
|
const mutationFn = (props) => {
|
|
5527
|
-
const {
|
|
5528
|
-
return
|
|
5529
|
-
userId,
|
|
5530
|
-
appShortName,
|
|
5531
|
-
settingKey,
|
|
5532
|
-
data
|
|
5533
|
-
);
|
|
5539
|
+
const { appShortName, id, data } = props ?? {};
|
|
5540
|
+
return updatePublicSettingByAppShortNameAndId(appShortName, id, data);
|
|
5534
5541
|
};
|
|
5535
5542
|
return { mutationFn, ...mutationOptions };
|
|
5536
5543
|
};
|
|
5537
|
-
const
|
|
5538
|
-
const mutationOptions =
|
|
5539
|
-
options
|
|
5540
|
-
);
|
|
5544
|
+
const useUpdatePublicSettingByAppShortNameAndId = (options) => {
|
|
5545
|
+
const mutationOptions = useUpdatePublicSettingByAppShortNameAndIdMutationOptions(options);
|
|
5541
5546
|
return useMutation(mutationOptions);
|
|
5542
5547
|
};
|
|
5543
|
-
const
|
|
5544
|
-
const
|
|
5545
|
-
return (
|
|
5546
|
-
return
|
|
5547
|
-
url: `/api/settings/
|
|
5548
|
+
const useDeletePublicSettingByIdHook = () => {
|
|
5549
|
+
const deletePublicSettingById = useCustomClient();
|
|
5550
|
+
return (appShortName, id) => {
|
|
5551
|
+
return deletePublicSettingById({
|
|
5552
|
+
url: `/api/settings/application/${appShortName}/id/${id}`,
|
|
5548
5553
|
method: "delete"
|
|
5549
5554
|
});
|
|
5550
5555
|
};
|
|
5551
5556
|
};
|
|
5552
|
-
const
|
|
5557
|
+
const useDeletePublicSettingByIdMutationOptions = (options) => {
|
|
5553
5558
|
const { mutation: mutationOptions } = options ?? {};
|
|
5554
|
-
const
|
|
5559
|
+
const deletePublicSettingById = useDeletePublicSettingByIdHook();
|
|
5555
5560
|
const mutationFn = (props) => {
|
|
5556
|
-
const {
|
|
5557
|
-
return
|
|
5558
|
-
userId,
|
|
5559
|
-
appShortName,
|
|
5560
|
-
settingKey
|
|
5561
|
-
);
|
|
5561
|
+
const { appShortName, id } = props ?? {};
|
|
5562
|
+
return deletePublicSettingById(appShortName, id);
|
|
5562
5563
|
};
|
|
5563
5564
|
return { mutationFn, ...mutationOptions };
|
|
5564
5565
|
};
|
|
5565
|
-
const
|
|
5566
|
-
const mutationOptions =
|
|
5566
|
+
const useDeletePublicSettingById = (options) => {
|
|
5567
|
+
const mutationOptions = useDeletePublicSettingByIdMutationOptions(options);
|
|
5567
5568
|
return useMutation(mutationOptions);
|
|
5568
5569
|
};
|
|
5569
|
-
const
|
|
5570
|
-
const
|
|
5571
|
-
return (
|
|
5572
|
-
return
|
|
5573
|
-
url: `/api/settings/
|
|
5570
|
+
const useGetSettingsByUserIdHook = () => {
|
|
5571
|
+
const getSettingsByUserId = useCustomClient();
|
|
5572
|
+
return (userId, signal) => {
|
|
5573
|
+
return getSettingsByUserId({
|
|
5574
|
+
url: `/api/settings/user/${userId}`,
|
|
5574
5575
|
method: "get",
|
|
5575
5576
|
signal
|
|
5576
5577
|
});
|
|
5577
5578
|
};
|
|
5578
5579
|
};
|
|
5579
|
-
const
|
|
5580
|
-
return [
|
|
5581
|
-
`/api/settings/application/${appShortName}/setting/${settingKey}`
|
|
5582
|
-
];
|
|
5580
|
+
const getGetSettingsByUserIdQueryKey = (userId) => {
|
|
5581
|
+
return [`/api/settings/user/${userId}`];
|
|
5583
5582
|
};
|
|
5584
|
-
const
|
|
5583
|
+
const useGetSettingsByUserIdQueryOptions = (userId, options) => {
|
|
5585
5584
|
const { query: queryOptions } = options ?? {};
|
|
5586
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ??
|
|
5587
|
-
const
|
|
5588
|
-
const queryFn = ({ signal }) =>
|
|
5585
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetSettingsByUserIdQueryKey(userId);
|
|
5586
|
+
const getSettingsByUserId = useGetSettingsByUserIdHook();
|
|
5587
|
+
const queryFn = ({ signal }) => getSettingsByUserId(userId, signal);
|
|
5589
5588
|
return {
|
|
5590
5589
|
queryKey,
|
|
5591
5590
|
queryFn,
|
|
5592
|
-
enabled: !!
|
|
5591
|
+
enabled: !!userId,
|
|
5593
5592
|
...queryOptions
|
|
5594
5593
|
};
|
|
5595
5594
|
};
|
|
5596
|
-
const
|
|
5597
|
-
const queryOptions =
|
|
5598
|
-
appShortName,
|
|
5599
|
-
settingKey,
|
|
5600
|
-
options
|
|
5601
|
-
);
|
|
5595
|
+
const useGetSettingsByUserId = (userId, options) => {
|
|
5596
|
+
const queryOptions = useGetSettingsByUserIdQueryOptions(userId, options);
|
|
5602
5597
|
const query = useQuery(queryOptions);
|
|
5603
5598
|
query.queryKey = queryOptions.queryKey;
|
|
5604
5599
|
return query;
|
|
5605
5600
|
};
|
|
5606
|
-
const
|
|
5607
|
-
const
|
|
5608
|
-
return (
|
|
5609
|
-
return
|
|
5610
|
-
url: `/api/settings/
|
|
5601
|
+
const useCreateSettingByUserIdHook = () => {
|
|
5602
|
+
const createSettingByUserId = useCustomClient();
|
|
5603
|
+
return (userId, settingDto) => {
|
|
5604
|
+
return createSettingByUserId({
|
|
5605
|
+
url: `/api/settings/user/${userId}`,
|
|
5611
5606
|
method: "post",
|
|
5612
5607
|
headers: { "Content-Type": "application/json" },
|
|
5613
5608
|
data: settingDto
|
|
5614
5609
|
});
|
|
5615
5610
|
};
|
|
5616
5611
|
};
|
|
5617
|
-
const
|
|
5612
|
+
const useCreateSettingByUserIdMutationOptions = (options) => {
|
|
5618
5613
|
const { mutation: mutationOptions } = options ?? {};
|
|
5619
|
-
const
|
|
5614
|
+
const createSettingByUserId = useCreateSettingByUserIdHook();
|
|
5620
5615
|
const mutationFn = (props) => {
|
|
5621
|
-
const {
|
|
5622
|
-
return
|
|
5623
|
-
appShortName,
|
|
5624
|
-
settingKey,
|
|
5625
|
-
data
|
|
5626
|
-
);
|
|
5616
|
+
const { userId, data } = props ?? {};
|
|
5617
|
+
return createSettingByUserId(userId, data);
|
|
5627
5618
|
};
|
|
5628
5619
|
return { mutationFn, ...mutationOptions };
|
|
5629
5620
|
};
|
|
5630
|
-
const
|
|
5631
|
-
const mutationOptions =
|
|
5621
|
+
const useCreateSettingByUserId = (options) => {
|
|
5622
|
+
const mutationOptions = useCreateSettingByUserIdMutationOptions(options);
|
|
5632
5623
|
return useMutation(mutationOptions);
|
|
5633
5624
|
};
|
|
5634
|
-
const
|
|
5635
|
-
const
|
|
5636
|
-
return (appShortName,
|
|
5637
|
-
return
|
|
5638
|
-
url: `/api/settings/application/${appShortName}
|
|
5639
|
-
method: "delete"
|
|
5640
|
-
});
|
|
5641
|
-
};
|
|
5642
|
-
};
|
|
5643
|
-
const useDeleteAppShortNameAndSettingKeyMutationOptions = (options) => {
|
|
5644
|
-
const { mutation: mutationOptions } = options ?? {};
|
|
5645
|
-
const deleteAppShortNameAndSettingKey = useDeleteAppShortNameAndSettingKeyHook();
|
|
5646
|
-
const mutationFn = (props) => {
|
|
5647
|
-
const { appShortName, settingKey } = props ?? {};
|
|
5648
|
-
return deleteAppShortNameAndSettingKey(appShortName, settingKey);
|
|
5649
|
-
};
|
|
5650
|
-
return { mutationFn, ...mutationOptions };
|
|
5651
|
-
};
|
|
5652
|
-
const useDeleteAppShortNameAndSettingKey = (options) => {
|
|
5653
|
-
const mutationOptions = useDeleteAppShortNameAndSettingKeyMutationOptions(options);
|
|
5654
|
-
return useMutation(mutationOptions);
|
|
5655
|
-
};
|
|
5656
|
-
const useGetSettingByUserAndAppShortNameHook = () => {
|
|
5657
|
-
const getSettingByUserAndAppShortName = useCustomClient();
|
|
5658
|
-
return (userId, appShortName, signal) => {
|
|
5659
|
-
return getSettingByUserAndAppShortName({
|
|
5660
|
-
url: `/api/settings/user/${userId}/application/${appShortName}`,
|
|
5625
|
+
const useGetSettingsByAppShortNameHook = () => {
|
|
5626
|
+
const getSettingsByAppShortName = useCustomClient();
|
|
5627
|
+
return (appShortName, signal) => {
|
|
5628
|
+
return getSettingsByAppShortName({
|
|
5629
|
+
url: `/api/settings/application/${appShortName}`,
|
|
5661
5630
|
method: "get",
|
|
5662
5631
|
signal
|
|
5663
5632
|
});
|
|
5664
5633
|
};
|
|
5665
5634
|
};
|
|
5666
|
-
const
|
|
5667
|
-
return [`/api/settings/
|
|
5635
|
+
const getGetSettingsByAppShortNameQueryKey = (appShortName) => {
|
|
5636
|
+
return [`/api/settings/application/${appShortName}`];
|
|
5668
5637
|
};
|
|
5669
|
-
const
|
|
5638
|
+
const useGetSettingsByAppShortNameQueryOptions = (appShortName, options) => {
|
|
5670
5639
|
const { query: queryOptions } = options ?? {};
|
|
5671
|
-
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ??
|
|
5672
|
-
const
|
|
5673
|
-
const queryFn = ({ signal }) =>
|
|
5640
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetSettingsByAppShortNameQueryKey(appShortName);
|
|
5641
|
+
const getSettingsByAppShortName = useGetSettingsByAppShortNameHook();
|
|
5642
|
+
const queryFn = ({ signal }) => getSettingsByAppShortName(appShortName, signal);
|
|
5674
5643
|
return {
|
|
5675
5644
|
queryKey,
|
|
5676
5645
|
queryFn,
|
|
5677
|
-
enabled: !!
|
|
5646
|
+
enabled: !!appShortName,
|
|
5678
5647
|
...queryOptions
|
|
5679
5648
|
};
|
|
5680
5649
|
};
|
|
5681
|
-
const
|
|
5682
|
-
const queryOptions =
|
|
5683
|
-
userId,
|
|
5650
|
+
const useGetSettingsByAppShortName = (appShortName, options) => {
|
|
5651
|
+
const queryOptions = useGetSettingsByAppShortNameQueryOptions(
|
|
5684
5652
|
appShortName,
|
|
5685
5653
|
options
|
|
5686
5654
|
);
|
|
@@ -5688,39 +5656,29 @@ const useGetSettingByUserAndAppShortName = (userId, appShortName, options) => {
|
|
|
5688
5656
|
query.queryKey = queryOptions.queryKey;
|
|
5689
5657
|
return query;
|
|
5690
5658
|
};
|
|
5691
|
-
const
|
|
5692
|
-
const
|
|
5693
|
-
return (appShortName,
|
|
5694
|
-
return
|
|
5659
|
+
const useCreatePublicSettingByUserIdHook = () => {
|
|
5660
|
+
const createPublicSettingByUserId = useCustomClient();
|
|
5661
|
+
return (appShortName, settingDto) => {
|
|
5662
|
+
return createPublicSettingByUserId({
|
|
5695
5663
|
url: `/api/settings/application/${appShortName}`,
|
|
5696
|
-
method: "
|
|
5697
|
-
|
|
5664
|
+
method: "post",
|
|
5665
|
+
headers: { "Content-Type": "application/json" },
|
|
5666
|
+
data: settingDto
|
|
5698
5667
|
});
|
|
5699
5668
|
};
|
|
5700
5669
|
};
|
|
5701
|
-
const
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
const
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
const getSettingsAppShortName = useGetSettingsAppShortNameHook();
|
|
5708
|
-
const queryFn = ({ signal }) => getSettingsAppShortName(appShortName, signal);
|
|
5709
|
-
return {
|
|
5710
|
-
queryKey,
|
|
5711
|
-
queryFn,
|
|
5712
|
-
enabled: !!appShortName,
|
|
5713
|
-
...queryOptions
|
|
5670
|
+
const useCreatePublicSettingByUserIdMutationOptions = (options) => {
|
|
5671
|
+
const { mutation: mutationOptions } = options ?? {};
|
|
5672
|
+
const createPublicSettingByUserId = useCreatePublicSettingByUserIdHook();
|
|
5673
|
+
const mutationFn = (props) => {
|
|
5674
|
+
const { appShortName, data } = props ?? {};
|
|
5675
|
+
return createPublicSettingByUserId(appShortName, data);
|
|
5714
5676
|
};
|
|
5677
|
+
return { mutationFn, ...mutationOptions };
|
|
5715
5678
|
};
|
|
5716
|
-
const
|
|
5717
|
-
const
|
|
5718
|
-
|
|
5719
|
-
options
|
|
5720
|
-
);
|
|
5721
|
-
const query = useQuery(queryOptions);
|
|
5722
|
-
query.queryKey = queryOptions.queryKey;
|
|
5723
|
-
return query;
|
|
5679
|
+
const useCreatePublicSettingByUserId = (options) => {
|
|
5680
|
+
const mutationOptions = useCreatePublicSettingByUserIdMutationOptions(options);
|
|
5681
|
+
return useMutation(mutationOptions);
|
|
5724
5682
|
};
|
|
5725
5683
|
const useGetAllAppsHook = () => {
|
|
5726
5684
|
const getAllApps = useCustomClient();
|
|
@@ -6275,15 +6233,14 @@ export {
|
|
|
6275
6233
|
getGetAllRomaConfigurationTypesQueryKey,
|
|
6276
6234
|
getGetAllServicesQueryKey,
|
|
6277
6235
|
getGetAppByKeyQueryKey,
|
|
6278
|
-
getGetByAppShortNameAndSettingKeyQueryKey,
|
|
6279
6236
|
getGetCategoryByIdQueryKey,
|
|
6280
6237
|
getGetCurrentEnvironmentQueryKey,
|
|
6238
|
+
getGetPublicSettingByUserAndIdQueryKey,
|
|
6281
6239
|
getGetRomaConfigurationByIdQueryKey,
|
|
6282
6240
|
getGetServiceByKeyQueryKey,
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
getGetSettingsAppShortNameQueryKey,
|
|
6241
|
+
getGetSettingByUserAndIdQueryKey,
|
|
6242
|
+
getGetSettingsByAppShortNameQueryKey,
|
|
6243
|
+
getGetSettingsByUserIdQueryKey,
|
|
6287
6244
|
getStreamEventsQueryKey,
|
|
6288
6245
|
makeComponent,
|
|
6289
6246
|
useAddRomaConfiguration,
|
|
@@ -6293,42 +6250,36 @@ export {
|
|
|
6293
6250
|
useCreateOrUpdateApp,
|
|
6294
6251
|
useCreateOrUpdateAppHook,
|
|
6295
6252
|
useCreateOrUpdateAppMutationOptions,
|
|
6296
|
-
useCreateOrUpdateAppShortNameAndSettingKey,
|
|
6297
|
-
useCreateOrUpdateAppShortNameAndSettingKeyHook,
|
|
6298
|
-
useCreateOrUpdateAppShortNameAndSettingKeyMutationOptions,
|
|
6299
6253
|
useCreateOrUpdateCategory,
|
|
6300
6254
|
useCreateOrUpdateCategoryHook,
|
|
6301
6255
|
useCreateOrUpdateCategoryMutationOptions,
|
|
6302
6256
|
useCreateOrUpdateService,
|
|
6303
6257
|
useCreateOrUpdateServiceHook,
|
|
6304
6258
|
useCreateOrUpdateServiceMutationOptions,
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6259
|
+
useCreatePublicSettingByUserId,
|
|
6260
|
+
useCreatePublicSettingByUserIdHook,
|
|
6261
|
+
useCreatePublicSettingByUserIdMutationOptions,
|
|
6262
|
+
useCreateSettingByUserId,
|
|
6263
|
+
useCreateSettingByUserIdHook,
|
|
6264
|
+
useCreateSettingByUserIdMutationOptions,
|
|
6311
6265
|
useDeleteAppByKey,
|
|
6312
6266
|
useDeleteAppByKeyHook,
|
|
6313
6267
|
useDeleteAppByKeyMutationOptions,
|
|
6314
|
-
useDeleteAppShortNameAndSettingKey,
|
|
6315
|
-
useDeleteAppShortNameAndSettingKeyHook,
|
|
6316
|
-
useDeleteAppShortNameAndSettingKeyMutationOptions,
|
|
6317
6268
|
useDeleteCategoryById,
|
|
6318
6269
|
useDeleteCategoryByIdHook,
|
|
6319
6270
|
useDeleteCategoryByIdMutationOptions,
|
|
6271
|
+
useDeletePrivateSettingById,
|
|
6272
|
+
useDeletePrivateSettingByIdHook,
|
|
6273
|
+
useDeletePrivateSettingByIdMutationOptions,
|
|
6274
|
+
useDeletePublicSettingById,
|
|
6275
|
+
useDeletePublicSettingByIdHook,
|
|
6276
|
+
useDeletePublicSettingByIdMutationOptions,
|
|
6320
6277
|
useDeleteRomaConfiguration,
|
|
6321
6278
|
useDeleteRomaConfigurationHook,
|
|
6322
6279
|
useDeleteRomaConfigurationMutationOptions,
|
|
6323
6280
|
useDeleteServiceByKey,
|
|
6324
6281
|
useDeleteServiceByKeyHook,
|
|
6325
6282
|
useDeleteServiceByKeyMutationOptions,
|
|
6326
|
-
useDeleteSettingByUserAndAppShortNameAndSettingKey,
|
|
6327
|
-
useDeleteSettingByUserAndAppShortNameAndSettingKeyHook,
|
|
6328
|
-
useDeleteSettingByUserAndAppShortNameAndSettingKeyMutationOptions,
|
|
6329
|
-
useDeleteSettingByUserAndSettingKey,
|
|
6330
|
-
useDeleteSettingByUserAndSettingKeyHook,
|
|
6331
|
-
useDeleteSettingByUserAndSettingKeyMutationOptions,
|
|
6332
6283
|
useDownloadRecap,
|
|
6333
6284
|
useGetAllApps,
|
|
6334
6285
|
useGetAllAppsHook,
|
|
@@ -6351,9 +6302,6 @@ export {
|
|
|
6351
6302
|
useGetAppByKey,
|
|
6352
6303
|
useGetAppByKeyHook,
|
|
6353
6304
|
useGetAppByKeyQueryOptions,
|
|
6354
|
-
useGetByAppShortNameAndSettingKey,
|
|
6355
|
-
useGetByAppShortNameAndSettingKeyHook,
|
|
6356
|
-
useGetByAppShortNameAndSettingKeyQueryOptions,
|
|
6357
6305
|
useGetCategoryById,
|
|
6358
6306
|
useGetCategoryByIdHook,
|
|
6359
6307
|
useGetCategoryByIdQueryOptions,
|
|
@@ -6361,6 +6309,9 @@ export {
|
|
|
6361
6309
|
useGetCurrentEnvironmentHook,
|
|
6362
6310
|
useGetCurrentEnvironmentQueryOptions,
|
|
6363
6311
|
useGetDeals,
|
|
6312
|
+
useGetPublicSettingByUserAndId,
|
|
6313
|
+
useGetPublicSettingByUserAndIdHook,
|
|
6314
|
+
useGetPublicSettingByUserAndIdQueryOptions,
|
|
6364
6315
|
useGetRecap,
|
|
6365
6316
|
useGetRomaConfigurationById,
|
|
6366
6317
|
useGetRomaConfigurationByIdHook,
|
|
@@ -6368,21 +6319,24 @@ export {
|
|
|
6368
6319
|
useGetServiceByKey,
|
|
6369
6320
|
useGetServiceByKeyHook,
|
|
6370
6321
|
useGetServiceByKeyQueryOptions,
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
useGetSettingsAppShortName,
|
|
6381
|
-
useGetSettingsAppShortNameHook,
|
|
6382
|
-
useGetSettingsAppShortNameQueryOptions,
|
|
6322
|
+
useGetSettingByUserAndId,
|
|
6323
|
+
useGetSettingByUserAndIdHook,
|
|
6324
|
+
useGetSettingByUserAndIdQueryOptions,
|
|
6325
|
+
useGetSettingsByAppShortName,
|
|
6326
|
+
useGetSettingsByAppShortNameHook,
|
|
6327
|
+
useGetSettingsByAppShortNameQueryOptions,
|
|
6328
|
+
useGetSettingsByUserId,
|
|
6329
|
+
useGetSettingsByUserIdHook,
|
|
6330
|
+
useGetSettingsByUserIdQueryOptions,
|
|
6383
6331
|
useStreamEvents,
|
|
6384
6332
|
useStreamEventsHook,
|
|
6385
6333
|
useStreamEventsQueryOptions,
|
|
6334
|
+
useUpdateByUserIdAndId,
|
|
6335
|
+
useUpdateByUserIdAndIdHook,
|
|
6336
|
+
useUpdateByUserIdAndIdMutationOptions,
|
|
6337
|
+
useUpdatePublicSettingByAppShortNameAndId,
|
|
6338
|
+
useUpdatePublicSettingByAppShortNameAndIdHook,
|
|
6339
|
+
useUpdatePublicSettingByAppShortNameAndIdMutationOptions,
|
|
6386
6340
|
useUpdateRomaConfiguration,
|
|
6387
6341
|
useUpdateRomaConfigurationHook,
|
|
6388
6342
|
useUpdateRomaConfigurationMutationOptions,
|