Skip to content

Commit ac451ef

Browse files
committedJul 4, 2023
Add values for contains
1 parent 48428de commit ac451ef

2 files changed

+46
-10
lines changed
 

‎src/get-service-account-insert-serial-operations.ts

+25-7
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ export async function getServiceAccountInsertSerialOperations(
4747
const {
4848
deep,
4949
serviceAccount,
50-
containValue,
50+
valueForContainForServiceAccount,
51+
valueForContainForUsesServiceAccount,
5152
shouldMakeActive = false
5253
} = param;
5354
const containerLinkId = param.containerLinkId !== null ? param.containerLinkId ?? deep.linkId : null;
5455
const reservedLinkIds = await getReservedLinkIds();
55-
const { containForServiceAccountLinkId: containLinkId, serviceAccountLinkId, usesServiceAccountLinkId,containForUsesServiceAccountLinkId } = reservedLinkIds;
56+
const { containForServiceAccountLinkId, serviceAccountLinkId, usesServiceAccountLinkId,containForUsesServiceAccountLinkId } = reservedLinkIds;
5657
const typeLinkIds = await getTypeLinkIds();
5758
const { containTypeLinkId, serviceAccountTypeLinkId ,usesServiceAccountTypeLinkId} = typeLinkIds;
5859
const serialOperations = [];
@@ -79,7 +80,7 @@ export async function getServiceAccountInsertSerialOperations(
7980
type: 'insert',
8081
table: 'links',
8182
objects: {
82-
id: containLinkId,
83+
id: containForServiceAccountLinkId,
8384
type_id: containTypeLinkId,
8485
from_id: containerLinkId,
8586
to_id: serviceAccountLinkId,
@@ -90,8 +91,8 @@ export async function getServiceAccountInsertSerialOperations(
9091
type: 'insert',
9192
table: 'objects',
9293
objects: {
93-
link_id: containLinkId,
94-
value: containValue,
94+
link_id: containForServiceAccountLinkId,
95+
value: valueForContainForServiceAccount,
9596
},
9697
});
9798
serialOperations.push(valueOfContainInsertSerialOperation);
@@ -121,6 +122,16 @@ export async function getServiceAccountInsertSerialOperations(
121122
}
122123
})
123124
serialOperations.push(containForUsesServiceAccountInsertSerialOperation);
125+
126+
const valueForContainInsertSerialOperation = createSerialOperation({
127+
type: 'insert',
128+
table: 'objects',
129+
objects: {
130+
link_id: containForUsesServiceAccountLinkId,
131+
value: valueForContainForUsesServiceAccount,
132+
},
133+
});
134+
serialOperations.push(valueForContainInsertSerialOperation);
124135
}
125136
}
126137

@@ -237,12 +248,19 @@ export interface GetServiceAccountInsertSerialOperationsParam {
237248
*/
238249
containerLinkId?: number | undefined | null;
239250
/**
240-
* Value of the contain link
251+
* Value for the contain link for {@link LinkName.ServiceAccount}
252+
*
253+
* @remarks
254+
* If {@link GetServiceAccountInsertSerialOperationsParam.containerLinkId} is null, this will be ignored
255+
*/
256+
valueForContainForServiceAccount?: string | undefined;
257+
/**
258+
* Value for the contain link for {@link LinkName.UsesServiceAccount}
241259
*
242260
* @remarks
243261
* If {@link GetServiceAccountInsertSerialOperationsParam.containerLinkId} is null, this will be ignored
244262
*/
245-
containValue?: string | undefined;
263+
valueForContainForUsesServiceAccount?: string | undefined;
246264
/**
247265
* If true, the link will be made active by creating a {@link LinkName.UsesServiceAccount} link pointing to it
248266
*

‎src/get-web-push-certificate-insert-serial-operations.ts

+21-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export async function getWebPushCertificateInsertSerialOperations(
4747
const {
4848
deep,
4949
webPushCertificate,
50-
containValue,
50+
valueForContainForWebPushCertificate,
51+
valueForContainForUsesWebPushCertificate,
5152
shouldMakeActive = false
5253
} = param;
5354
const containerLinkId = param.containerLinkId !== null ? param.containerLinkId ?? deep.linkId : null;
@@ -91,7 +92,7 @@ export async function getWebPushCertificateInsertSerialOperations(
9192
table: 'strings',
9293
objects: {
9394
link_id: containLinkId,
94-
value: containValue,
95+
value: valueForContainForWebPushCertificate,
9596
},
9697
});
9798
serialOperations.push(valueOfContainInsertSerialOperation);
@@ -121,6 +122,16 @@ export async function getWebPushCertificateInsertSerialOperations(
121122
}
122123
})
123124
serialOperations.push(containForUsesWebPushCertificateInsertSerialOperation);
125+
126+
const valueForContainInsertSerialOperation = createSerialOperation({
127+
type: 'insert',
128+
table: 'objects',
129+
objects: {
130+
link_id: containForUsesWebPushCertificateLinkId,
131+
value: valueForContainForUsesWebPushCertificate,
132+
},
133+
});
134+
serialOperations.push(valueForContainInsertSerialOperation);
124135
}
125136
}
126137

@@ -242,7 +253,14 @@ export interface GetWebPushCertificateInsertSerialOperationsParam {
242253
* @remarks
243254
* If {@link GetWebPushCertificateInsertSerialOperationsParam.containerLinkId} is null, this will be ignored
244255
*/
245-
containValue?: string | undefined;
256+
valueForContainForWebPushCertificate?: string | undefined;
257+
/**
258+
* Value of the contain link
259+
*
260+
* @remarks
261+
* If {@link GetWebPushCertificateInsertSerialOperationsParam.containerLinkId} is null, this will be ignored
262+
*/
263+
valueForContainForUsesWebPushCertificate?: string | undefined;
246264
/**
247265
* If true, the link will be made active by creating a {@link LinkName.UsesServiceAccount} link pointing to it
248266
*

0 commit comments

Comments
 (0)
Failed to load comments.