Skip to content

Commit 071c14d

Browse files
committed
fix some typos
1 parent 6b5c0de commit 071c14d

14 files changed

Lines changed: 36 additions & 29 deletions

File tree

packages/internal/postgres/src/postgres-database-pool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class PostgresDatabasePool implements CommonQueryMethods {
148148
maybeOneFirst: methods.maybeOneFirst,
149149
anyFirst: methods.anyFirst,
150150
one: methods.one,
151-
transaction<T>(_name: string, handler: (methods: CommonQueryMethods) => Promise<T>) {
151+
transaction<T>(name: string, handler: (methods: CommonQueryMethods) => Promise<T>) {
152152
// We just mark this as a virtual transaction, it still runs as part of the current one.
153153
const span = tracer.startSpan(`Virtual PG Transaction: ${name}`, {
154154
kind: SpanKind.INTERNAL,

packages/services/api/src/modules/oidc-integrations/providers/oidc-integrations.provider.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class OIDCIntegrationsProvider {
147147
const userinfoEndpointResult = OAuthAPIUrlModel.safeParse(args.userinfoEndpoint);
148148
const authorizationEndpointResult = OAuthAPIUrlModel.safeParse(args.authorizationEndpoint);
149149
const additionalScopesResult = OIDCAdditionalScopesModel.safeParse(args.additionalScopes);
150-
const userIdClaimResult = OIDCScopeModel.nullable().safeParse(args.userIdClaim);
150+
const userIdClaimResult = OIDCClaimModel.nullable().safeParse(args.userIdClaim);
151151

152152
if (
153153
clientIdResult.success &&
@@ -272,7 +272,7 @@ export class OIDCIntegrationsProvider {
272272
const additionalScopesResult = maybe(OIDCAdditionalScopesModel).safeParse(
273273
args.additionalScopes,
274274
);
275-
const userIdClaimResult = maybe(OIDCScopeModel).safeParse(args.userIdClaim);
275+
const userIdClaimResult = maybe(OIDCClaimModel).safeParse(args.userIdClaim);
276276

277277
if (
278278
clientIdResult.success &&
@@ -898,6 +898,13 @@ const OIDCScopeModel = zod
898898
.max(50, 'Can not be longer than 50 characters.')
899899
.regex(/^[a-z0-9](?:[a-z0-9.:/_-]*[a-z0-9])?$/, 'Must be a valid scope.');
900900

901+
const OIDCClaimModel = zod
902+
.string()
903+
.trim()
904+
.nonempty('Must not be empty.')
905+
.max(50, 'Can not be longer than 50 characters.')
906+
.regex(/^[a-z0-9](?:[a-z0-9.:/_-]*[a-z0-9])?$/, 'Must be a valid scope.');
907+
901908
const OIDCAdditionalScopesModel = zod
902909
.array(OIDCScopeModel)
903910
.max(20, 'Can not be more than 20 items.');

packages/services/api/src/modules/operations/module.graphql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ export default gql`
388388
subgraphs: [String!]
389389
"""
390390
Wether the trace is successful.
391-
A trace is a success if no GraphQL errors occured and the HTTP status code is in the 2XX to 3XX range.
391+
A trace is a success if no GraphQL errors occurred and the HTTP status code is in the 2XX to 3XX range.
392392
"""
393393
success: Boolean!
394394
"""
@@ -449,7 +449,7 @@ export default gql`
449449
traceIds: [ID!]
450450
"""
451451
Filter based on whether the operation is a success.
452-
A operation is successful if no GraphQL error has occured and the result is within the 2XX or 3XX range.
452+
A operation is successful if no GraphQL error has occurred and the result is within the 2XX or 3XX range.
453453
"""
454454
success: [Boolean!]
455455
"""

packages/services/api/src/modules/organization/providers/group-store.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class GroupStore {
7272
}
7373

7474
async getGroupByOrganizationIdAndDisplayName(organizationId: string, displayName: string) {
75-
const query = psql` /* getGroupById (batch) */
75+
const query = psql` /* getGroupByOrganizationIdAndDisplayName (batch) */
7676
SELECT
7777
${groupFields}
7878
FROM
@@ -102,16 +102,16 @@ export class GroupStore {
102102

103103
async getGroupByOrganizationIdAndExternalGroupId(
104104
organizationId: string,
105-
externaGrouplId: string,
105+
externalGroupId: string,
106106
) {
107-
const query = psql` /* getGroupById (batch) */
107+
const query = psql` /* getGroupByOrganizationIdAndExternalGroupId */
108108
SELECT
109109
${groupFields}
110110
FROM
111111
"groups"
112112
WHERE
113113
"organization_id" = ${organizationId}
114-
AND "external_id" = ${externaGrouplId}
114+
AND "external_id" = ${externalGroupId}
115115
`;
116116

117117
return await this.pool.maybeOne(query).then(GroupModel.nullable().parse);
@@ -124,7 +124,7 @@ export class GroupStore {
124124
count: number;
125125
},
126126
) {
127-
const query = psql` /* getGroupById (batch) */
127+
const query = psql` /* getOffsetPaginatedGroupsForOrganizationId */
128128
SELECT
129129
${groupFields}
130130
FROM

packages/services/api/src/modules/organization/providers/provisioned-users-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export class ProvisionedUsersStore {
207207
});
208208
}
209209

210-
async enabledUser(userId: string, trx: CommonQueryMethods) {
210+
async enableUser(userId: string, trx: CommonQueryMethods) {
211211
const query = psql`
212212
UPDATE "users"
213213
SET "deactivated_at" = NULL

packages/services/api/src/modules/support/providers/support-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export class SupportManager {
357357
);
358358
} else {
359359
this.logger.debug(
360-
'An unexpected error occured while connecting the user to the zendesk organization. (err=%s, organization: %s, user: %s, zendeskUserId: %d, zendeskOrganizationId: %d)',
360+
'An unexpected error occurred while connecting the user to the zendesk organization. (err=%s, organization: %s, user: %s, zendeskUserId: %d, zendeskOrganizationId: %d)',
361361
String(err),
362362
input.organizationId,
363363
input.userId,

packages/services/server/src/graphql-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const graphqlHandler = (options: GraphQLHandlerOptions): RouteHandlerMeth
196196
plugins: [
197197
useArmor(),
198198
useHiveErrorHandler(err => {
199-
options.logger.error(err, 'Unexpected error occured while handling exception.');
199+
options.logger.error(err, 'Unexpected error occurred while handling exception.');
200200
}),
201201
useExtendContext(async context => ({
202202
session: await options.authN.authenticate(context),

packages/services/server/src/public-graphql-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const createPublicGraphQLHandler = (
4848
session: await args.authN.authenticate(context),
4949
})),
5050
useHiveErrorHandler(err => {
51-
args.logger.error(err, 'Unexpected error occured while handling exception.');
51+
args.logger.error(err, 'Unexpected error occurred while handling exception.');
5252
}),
5353
useHive({
5454
debug: true,

packages/services/server/src/scim.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export const createSCIMPlugin =
363363
if (user.deactivatedAt === null && !updates.active) {
364364
user = await usersStore.disableUser(user.id, trx);
365365
} else if (user.deactivatedAt !== null && updates.active) {
366-
user = await usersStore.enabledUser(user.id, trx);
366+
user = await usersStore.enableUser(user.id, trx);
367367
}
368368
}
369369
if (email) {
@@ -491,14 +491,14 @@ export const createSCIMPlugin =
491491
};
492492
}
493493

494-
if (!group.externalId && !group.displayName) {
494+
if (!properties.externalId && !properties.displayName) {
495495
return {
496496
type: 'success' as const,
497497
group,
498498
};
499499
}
500500

501-
return await trx.transaction('update group prperties', async () => {
501+
return await trx.transaction('update group properties', async () => {
502502
const result = await groupStore.updateGroupPropertiesByOrganizationIdAndGroupId(
503503
group.organizationId,
504504
group.id,
@@ -581,7 +581,7 @@ export const createSCIMPlugin =
581581
return reply.status(500).send(
582582
createSCIMError({
583583
status: 500,
584-
detail: 'An unexpected error occured.',
584+
detail: 'An unexpected error occurred.',
585585
}),
586586
);
587587
});
@@ -938,7 +938,7 @@ export const createSCIMPlugin =
938938
for (const operation of body.data.Operations) {
939939
if (operation.op !== 'replace') {
940940
auth.logger.debug(
941-
'unsupported operation received. we aonly support replace for patch for now',
941+
'unsupported operation received. we only support replace and patch for now',
942942
operation.op,
943943
);
944944
continue;
@@ -1092,7 +1092,7 @@ export const createSCIMPlugin =
10921092
'id',
10931093
]);
10941094
if (filterParseResult.type === 'error') {
1095-
return reply.status(400).send(auth.error);
1095+
return reply.status(400).send(filterParseResult.error);
10961096
}
10971097

10981098
const { property, value } = filterParseResult;

packages/services/server/src/supertokens-at-home.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ export async function registerSupertokensAtHome(
14621462
req.log.debug('received non 200 status from token endpoint %d', grantResponse.status);
14631463
broadcastLog(
14641464
oidcIntegration.id,
1465-
`an unexpected error occured while calling your token endoint '${oidcIntegration.tokenEndpoint}'. HTTP Status: ${grantResponse.status} Body: ${await grantResponse.text()}.`,
1465+
`an unexpected error occurred while calling your token endoint '${oidcIntegration.tokenEndpoint}'. HTTP Status: ${grantResponse.status} Body: ${await grantResponse.text()}.`,
14661466
);
14671467

14681468
return rep.status(200).send({
@@ -1522,7 +1522,7 @@ export async function registerSupertokensAtHome(
15221522
);
15231523
broadcastLog(
15241524
oidcIntegration.id,
1525-
`an unexpected error occured while calling the user info endoint '${oidcIntegration.userinfoEndpoint}'. HTTP Status: ${userInfoResponse.status} HTTP Body: ${userInfoBodyRaw}.`,
1525+
`an unexpected error occurred while calling the user info endoint '${oidcIntegration.userinfoEndpoint}'. HTTP Status: ${userInfoResponse.status} HTTP Body: ${userInfoBodyRaw}.`,
15261526
);
15271527

15281528
return rep.status(200).send({

0 commit comments

Comments
 (0)