Skip to content

Commit 27aefcc

Browse files
vaibhavbhalla2505Vaibhav  Bhalla
andauthored
refactor(chore): dist added (#2343)
BREAKING CHANGE: YES GH-2323-dist Co-authored-by: Vaibhav Bhalla <vaibhav.bhalla@SFSupports-MacBook-Air.local>
1 parent 376d38e commit 27aefcc

18 files changed

Lines changed: 169 additions & 0 deletions

File tree

packages/cache/src/services/cache.service.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,22 @@ export class CacheService implements ICacheService {
224224
return this.store.set(insertionKey, insertionValue, this.configuration.ttl);
225225
}
226226

227+
/**
228+
* The function `verifyInsertionTime` checks if an insertion is valid based on insertion and deletion
229+
* markers and tag deletion times.
230+
* @param {string} prefix - The `prefix` parameter in the `verifyInsertionTime` function is a string
231+
* that represents a prefix used in building keys for data storage.
232+
* @param {string} key - The `key` parameter in the `verifyInsertionTime` function is a string that
233+
* represents a unique identifier for the data being inserted. It is used to build keys for insertion
234+
* and deletion markers in the data store.
235+
* @param {string[]} tags - The `tags` parameter in the `verifyInsertionTime` function is an array of
236+
* strings representing tags associated with a key.
237+
* @returns The function `verifyInsertionTime` returns a boolean value. It returns `false` under the
238+
* following conditions:
239+
* 1. If `insertionValue` is falsy (null, undefined, 0, false).
240+
* 2. If any of the `tagDeletionTimes` is not falsy and greater than or equal to `insertionValue`.
241+
* 3. If `deletionValue` is
242+
*/
227243
private async verifyInsertionTime(
228244
prefix: string,
229245
key: string,

packages/core/src/components/bearer-verifier/providers/facades-bearer-token-verify.provider.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ export class FacadesBearerTokenVerifyProvider
2929
public authUserModel?: Constructor<EntityWithIdentifier & IAuthUser>,
3030
) {}
3131

32+
/**
33+
* The function verifies a bearer token, checks for token revocation, expiration, and password
34+
* expiry, and returns the authenticated user.
35+
* @returns The `value()` function returns a BearerFn function that verifies a token. Inside the
36+
* function, it first checks if the token is revoked, then verifies the token using a JWT secret key.
37+
* If the token is valid, it checks for password expiry and returns either an instance of
38+
* `authUserModel` or the user object based on the availability of `authUserModel`.
39+
*/
3240
value(): VerifyFunction.BearerFn {
3341
return async (token: string, req?: Request) => {
3442
try {

packages/feature-toggle/src/providers/feature-flag-action.provider.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,18 @@ export class FeatureFlagActionProvider implements Provider<FeatureFlagFn> {
152152
return true;
153153
}
154154

155+
/**
156+
* The `getStrategy` function returns a filtering strategy based on the specified `operator` or
157+
* defaults to an OR strategy.
158+
* @param {FilterType | undefined} operator - The `operator` parameter in the `getStrategy` function
159+
* is of type `FilterType | undefined`. It is used to determine the filtering strategy based on the
160+
* specified `FilterType`. If no `operator` is provided, the function will default to using the OR
161+
* filter strategy.
162+
* @returns The `getStrategy` function returns a filtering strategy based on the `operator` specified
163+
* in the decorator. It uses the `filterStrategyMapping` array to map the `FilterType` to the
164+
* corresponding `FilterStrategy`. If the specified `operator` is found in the mapping, the
165+
* corresponding strategy is returned. If not found, it defaults to using the `OrFilterStrategy`.
166+
*/
155167
getStrategy(operator: FilterType | undefined) {
156168
/* Filtering strategy based on the `operator` specified in the decorator. It uses the
157169
`filterStrategyMapping` array to map the `FilterType` to the corresponding `FilterStrategy`.

packages/file-utils/src/services/file-metadata.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export class FileMetadataProvider
2020
private readonly methodName: string,
2121
) {}
2222

23+
/**
24+
* This function retrieves file request metadata for a controller class method, ensuring only one
25+
* file decorator is allowed.
26+
* @returns The `value()` method returns an `IFileRequestMetadata` object or `undefined`.
27+
*/
2328
value(): IFileRequestMetadata | undefined {
2429
if (!this.controllerClass || !this.methodName) return;
2530
const metadata = getFileMetadata(this.controllerClass, this.methodName);

services/authentication-service/src/services/active-user-fliter-builder.service.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ export class ActiveUserFilterBuilderService {
1717
public userTenantRepo: UserTenantRepository,
1818
) {}
1919

20+
/**
21+
* The function `buildActiveUsersFilter` asynchronously builds a filter based on active users,
22+
* considering different user identities and inclusion/exclusion criteria.
23+
* @param {ActiveUsersFilter} filter - The `buildActiveUsersFilter` function takes in a parameter
24+
* `filter` of type `ActiveUsersFilter`. This filter object contains information about the users to
25+
* be included or excluded from the filter.
26+
* @returns The function `buildActiveUsersFilter` returns an object with the key "actor" containing
27+
* an array of actor IDs based on the provided `ActiveUsersFilter` input. The array of actor IDs is
28+
* determined based on the conditions specified in the function, including the user identity type,
29+
* actor key, and inclusion/exclusion criteria.
30+
*/
2031
async buildActiveUsersFilter(filter: ActiveUsersFilter): Promise<AnyObject> {
2132
let actorIds: string[] = [];
2233
// sonarignore:start

services/bpmn-service/src/providers/execution-input-validator.provider.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ import Ajv from 'ajv';
1111
export class ExecutionInputValidationProvider
1212
implements Provider<ExecutionInputValidator>
1313
{
14+
/**
15+
* The function `value` returns an asynchronous input validator that uses Ajv to validate input
16+
* against a schema and throws an error if validation fails.
17+
* @returns An asynchronous function that acts as an execution input validator. The function uses the
18+
* Ajv library to compile and validate input data against a given schema. If the input is valid, the
19+
* function returns `true`. If the input is invalid, it throws an error with a message indicating the
20+
* validation errors.
21+
*/
1422
value(): ExecutionInputValidator {
1523
return async (schema, input) => {
1624
const ajv = new Ajv();

services/chat-service/src/controllers/message-recipient-message.controller.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export class MessageRecipientMessageController {
4040
},
4141
},
4242
})
43+
/**
44+
* This async function retrieves a message by its recipient ID.
45+
* @param id - The `id` parameter is a string representing the unique identifier of a message
46+
* recipient.
47+
* @returns A Promise that resolves to a Message object.
48+
*/
4349
async getMessage(
4450
@param.path.string('id') id: typeof MessageRecipient.prototype.id,
4551
): Promise<Message> {

services/feature-toggle-service/src/controllers/feature-values.controller.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ export class FeatureValuesController {
5656
},
5757
},
5858
})
59+
/**
60+
* This function creates a new instance of FeatureValues and returns it after saving it to the
61+
* database.
62+
* @param {FeatureValues} featureValues - The `featureValues` parameter in the `create` function is
63+
* of type `FeatureValues`. It is being passed as the request body and is used to create a new
64+
* instance of `FeatureValues` in the database using the `featureValuesRepository.create` method.
65+
* @returns The `create` method is returning a Promise that resolves to a `FeatureValues` object.
66+
*/
5967
async create(
6068
@requestBody({
6169
content: {

services/in-mail-service/src/controllers/collector.controller.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@ export class CollectorController {
9090
[STATUS_CODE.BAD_REQUEST]: {description: NOT_FOUND_MESSAGE},
9191
},
9292
})
93+
/**
94+
* This function fetches a thread by its ID, retrieves related messages, updates group visibility,
95+
* and returns the thread view along with the message count.
96+
* @param {string} threadId - The `threadId` parameter is a string that represents the unique
97+
* identifier of a thread. It is used to fetch information related to a specific thread in the
98+
* system.
99+
* @param filter - The `filter` parameter in the `fetchThreadById` function is of type
100+
* `Partial<Thread>`, which means it is an object that may contain some properties of the `Thread`
101+
* type. This parameter is used to filter the threads based on certain criteria specified in the
102+
* object. You can pass
103+
* @returns The function `fetchThreadById` is returning an object with two properties: `items` and
104+
* `messageCount`. The `items` property contains an array of thread views fetched from the
105+
* `threadViewRepository`, while the `messageCount` property contains the length of the `threadView`
106+
* array.
107+
*/
93108
async fetchThreadById(
94109
@param.path.string('threadId') threadId: string,
95110
@param.query.object('filter') filter: Partial<Thread>,

services/notification-service/src/providers/channel-manager.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import {IChannelManager} from '../types';
77

88
@bind({scope: BindingScope.TRANSIENT})
99
export class ChannelManagerProvider implements Provider<IChannelManager> {
10+
/**
11+
* The function `value` returns an object with a method `isChannelAccessAllowed` that always returns
12+
* `true`.
13+
* @returns The `value()` function is returning an object with a property `isChannelAccessAllowed`
14+
* which is a function that always returns `true`.
15+
*/
1016
value() {
1117
return {
1218
isChannelAccessAllowed: () => true,

0 commit comments

Comments
 (0)