File tree Expand file tree Collapse file tree 12 files changed +26
-27
lines changed Expand file tree Collapse file tree 12 files changed +26
-27
lines changed Original file line number Diff line number Diff line change 1- import {
2- DynamoDBClient ,
3- GetItemCommand ,
4- QueryCommand ,
5- } from "@aws-sdk/client-dynamodb" ;
1+ import { DynamoDBClient , GetItemCommand } from "@aws-sdk/client-dynamodb" ;
62import { unmarshall } from "@aws-sdk/util-dynamodb" ;
73import { genericConfig } from "../../common/config.js" ;
84import { DatabaseFetchError } from "../../common/errors/index.js" ;
Original file line number Diff line number Diff line change 66 officersGroupTestingId ,
77} from "../../common/config.js" ;
88import {
9- BaseError ,
109 EntraFetchError ,
1110 EntraGroupError ,
1211 EntraInvitationError ,
@@ -19,7 +18,6 @@ import {
1918 EntraGroupActions ,
2019 EntraInvitationResponse ,
2120} from "../../common/types/iam.js" ;
22- import { FastifyInstance } from "fastify" ;
2321import { UserProfileDataBase } from "common/types/msGraphApi.js" ;
2422import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager" ;
2523import { DynamoDBClient } from "@aws-sdk/client-dynamodb" ;
Original file line number Diff line number Diff line change 1- import { FastifyBaseLogger , FastifyInstance } from "fastify" ;
1+ import { FastifyBaseLogger } from "fastify" ;
22
33export async function checkPaidMembership (
44 endpoint : string ,
@@ -11,7 +11,13 @@ export async function checkPaidMembership(
1111 log . trace ( `Got Membership API Payload for ${ netId } : ${ membershipApiPayload } ` ) ;
1212 try {
1313 return membershipApiPayload [ "isPaidMember" ] ;
14- } catch ( e : any ) {
14+ } catch ( e : unknown ) {
15+ if ( ! ( e instanceof Error ) ) {
16+ log . error (
17+ "Failed to get response from membership API (unknown error type.)" ,
18+ ) ;
19+ throw e ;
20+ }
1521 log . error ( `Failed to get response from membership API: ${ e . toString ( ) } ` ) ;
1622 throw e ;
1723 }
Original file line number Diff line number Diff line change @@ -2,15 +2,12 @@ import { getSecretValue } from "../plugins/auth.js";
22import {
33 ConfigType ,
44 genericConfig ,
5- GenericConfigType ,
65 SecretConfig ,
76} from "../../common/config.js" ;
87import {
98 InternalServerError ,
109 UnauthorizedError ,
1110} from "../../common/errors/index.js" ;
12- import { FastifyInstance , FastifyRequest } from "fastify" ;
13- // these make sure that esbuild includes the files
1411import icon from "../resources/MembershipPass.pkpass/icon.png" ;
1512import logo from "../resources/MembershipPass.pkpass/logo.png" ;
1613import strip from "../resources/MembershipPass.pkpass/strip.png" ;
Original file line number Diff line number Diff line change 1- import { FastifyBaseLogger } from "fastify" ;
21import Stripe from "stripe" ;
32
43export type StripeLinkCreateParams = {
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import {
1515} from "../../common/errors/index.js" ;
1616import { genericConfig , SecretConfig } from "../../common/config.js" ;
1717import { getGroupRoles , getUserRoles } from "../functions/authorization.js" ;
18- import { DynamoDBClient } from "@aws-sdk/client-dynamodb" ;
1918
2019function intersection < T > ( setA : Set < T > , setB : Set < T > ) : Set < T > {
2120 const _intersection = new Set < T > ( ) ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-explicit-any */
2+
13declare module "*.png" {
24 const value : string ;
35 export default value ;
Original file line number Diff line number Diff line change 11import { FastifyPluginAsync } from "fastify" ;
2- import { allAppRoles , AppRoles } from "../../common/roles.js" ;
2+ import { AppRoles } from "../../common/roles.js" ;
33import { zodToJsonSchema } from "zod-to-json-schema" ;
44import {
55 addToTenant ,
@@ -16,13 +16,9 @@ import {
1616 InternalServerError ,
1717 NotFoundError ,
1818} from "../../common/errors/index.js" ;
19- import {
20- DynamoDBClient ,
21- GetItemCommand ,
22- PutItemCommand ,
23- } from "@aws-sdk/client-dynamodb" ;
19+ import { PutItemCommand } from "@aws-sdk/client-dynamodb" ;
2420import { genericConfig } from "../../common/config.js" ;
25- import { marshall , unmarshall } from "@aws-sdk/util-dynamodb" ;
21+ import { marshall } from "@aws-sdk/util-dynamodb" ;
2622import {
2723 InviteUserPostRequest ,
2824 invitePostRequestSchema ,
Original file line number Diff line number Diff line change 11import { FastifyPluginAsync } from "fastify" ;
22import {
3- DynamoDBClient ,
43 QueryCommand ,
54 QueryCommandInput ,
65 ScanCommand ,
Original file line number Diff line number Diff line change 11import { FastifyPluginAsync } from "fastify" ;
22import { z } from "zod" ;
33import {
4- DynamoDBClient ,
54 QueryCommand ,
65 ScanCommand ,
76 UpdateItemCommand ,
You can’t perform that action at this time.
0 commit comments