diff --git a/packages/sample-server/package.json b/packages/sample-server/package.json index 6c43a3c..db6f2dc 100644 --- a/packages/sample-server/package.json +++ b/packages/sample-server/package.json @@ -19,7 +19,7 @@ "@fastify/autoload": "~5.7.1", "env-var": "~7.3.0", "fastify": "~4.15.0", - "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.8.13" + "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.8.14" }, "devDependencies": { "@jest/globals": "~29.5.0", diff --git a/packages/sample-server/test/initalization.test.ts b/packages/sample-server/test/initalization.test.ts index 06d9fc0..93418a8 100644 --- a/packages/sample-server/test/initalization.test.ts +++ b/packages/sample-server/test/initalization.test.ts @@ -17,6 +17,7 @@ import VCLJwtSignService from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src/api import VCLJwtDescriptor from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src/api/entities/VCLJwtDescriptor"; import VCLJwt from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src/api/entities/VCLJwt"; import VCLJwtVerifyService from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src/api/jwt/VCLJwtVerifyService"; +import { Nullish } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src/api/Nullish"; describe("initalization flow", () => { let appInstance: FastifyInstance; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index e606adc..bd66ae1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@velocitycareerlabs/vnf-nodejs-wallet-sdk", - "version": "0.8.13", + "version": "0.8.14", "description": "VNF Wallet SDK Nodejs", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/sdk/src/api/VCL.ts b/packages/sdk/src/api/VCL.ts index d2a22c6..db258cf 100644 --- a/packages/sdk/src/api/VCL.ts +++ b/packages/sdk/src/api/VCL.ts @@ -26,6 +26,7 @@ import VCLSubmissionResult from "./entities/VCLSubmissionResult"; import VCLToken from "./entities/VCLToken"; import VCLVerifiedProfile from "./entities/VCLVerifiedProfile"; import VCLVerifiedProfileDescriptor from "./entities/VCLVerifiedProfileDescriptor"; +import { Nullish } from "../types"; export default interface VCL { initialize( diff --git a/packages/sdk/src/api/entities/VCLCountries.ts b/packages/sdk/src/api/entities/VCLCountries.ts index d5452e7..20df5a6 100644 --- a/packages/sdk/src/api/entities/VCLCountries.ts +++ b/packages/sdk/src/api/entities/VCLCountries.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLCountry from "./VCLCountry"; class VCLCountries { diff --git a/packages/sdk/src/api/entities/VCLCountry.ts b/packages/sdk/src/api/entities/VCLCountry.ts index 6c9848d..63cb6ee 100644 --- a/packages/sdk/src/api/entities/VCLCountry.ts +++ b/packages/sdk/src/api/entities/VCLCountry.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLPlace from "./VCLPlace"; import VCLRegions from "./VCLRegions"; diff --git a/packages/sdk/src/api/entities/VCLCredentialManifest.ts b/packages/sdk/src/api/entities/VCLCredentialManifest.ts index 4d92dc1..5aaa083 100644 --- a/packages/sdk/src/api/entities/VCLCredentialManifest.ts +++ b/packages/sdk/src/api/entities/VCLCredentialManifest.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLJwt from "./VCLJwt"; import VCLVerifiedProfile from "./VCLVerifiedProfile"; diff --git a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptor.ts b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptor.ts index 2d5f2ad..36a13a7 100644 --- a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptor.ts +++ b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptor.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLIssuingType from "./VCLIssuingType"; import VCLPushDelegate from "./VCLPushDelegate"; diff --git a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts index 28b7fb2..ccf74ad 100644 --- a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts +++ b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLCredentialManifestDescriptor from "./VCLCredentialManifestDescriptor"; import VCLDeepLink from "./VCLDeepLink"; import VCLIssuingType from "./VCLIssuingType"; diff --git a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByService.ts b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByService.ts index fb50aab..99e7ba7 100644 --- a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByService.ts +++ b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorByService.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLCredentialManifestDescriptor from "./VCLCredentialManifestDescriptor"; import VCLIssuingType from "./VCLIssuingType"; import VCLPushDelegate from "./VCLPushDelegate"; diff --git a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorRefresh.ts b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorRefresh.ts index 5ef284e..d688e60 100644 --- a/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorRefresh.ts +++ b/packages/sdk/src/api/entities/VCLCredentialManifestDescriptorRefresh.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLCredentialManifestDescriptor from "./VCLCredentialManifestDescriptor"; import VCLIssuingType from "./VCLIssuingType"; import VCLService from "./VCLService"; diff --git a/packages/sdk/src/api/entities/VCLCredentialType.ts b/packages/sdk/src/api/entities/VCLCredentialType.ts index 5c125c6..5977e69 100644 --- a/packages/sdk/src/api/entities/VCLCredentialType.ts +++ b/packages/sdk/src/api/entities/VCLCredentialType.ts @@ -1,3 +1,5 @@ +import { Nullish } from "../../types"; + export default class VCLCredentialType { constructor( public payload: JSONObject, diff --git a/packages/sdk/src/api/entities/VCLCredentialTypes.ts b/packages/sdk/src/api/entities/VCLCredentialTypes.ts index e57e945..e3e2b80 100644 --- a/packages/sdk/src/api/entities/VCLCredentialTypes.ts +++ b/packages/sdk/src/api/entities/VCLCredentialTypes.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLCredentialType from "./VCLCredentialType"; export default class VCLCredentialTypes { diff --git a/packages/sdk/src/api/entities/VCLDeepLink.ts b/packages/sdk/src/api/entities/VCLDeepLink.ts index 9710b36..b38f676 100644 --- a/packages/sdk/src/api/entities/VCLDeepLink.ts +++ b/packages/sdk/src/api/entities/VCLDeepLink.ts @@ -1,4 +1,5 @@ import "../../impl/extensions/StringExtensions"; +import { Nullish } from "../../types"; export default class VCLDeepLink { public requestUri: Nullish; diff --git a/packages/sdk/src/api/entities/VCLGenerateOffersDescriptor.ts b/packages/sdk/src/api/entities/VCLGenerateOffersDescriptor.ts index 2a26e45..1ec5b6c 100644 --- a/packages/sdk/src/api/entities/VCLGenerateOffersDescriptor.ts +++ b/packages/sdk/src/api/entities/VCLGenerateOffersDescriptor.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLCredentialManifest from "./VCLCredentialManifest"; import VCLVerifiableCredential from "./VCLVerifiableCredential"; diff --git a/packages/sdk/src/api/entities/VCLJwt.ts b/packages/sdk/src/api/entities/VCLJwt.ts index 6dbb819..766f00b 100644 --- a/packages/sdk/src/api/entities/VCLJwt.ts +++ b/packages/sdk/src/api/entities/VCLJwt.ts @@ -1,4 +1,4 @@ -import { JWK, base64url } from "jose"; +import { Nullish } from "../../types"; export default class VCLJwt { public encodedJwt: Nullish; diff --git a/packages/sdk/src/api/entities/VCLJwtDescriptor.ts b/packages/sdk/src/api/entities/VCLJwtDescriptor.ts index 2085aeb..1e05f45 100644 --- a/packages/sdk/src/api/entities/VCLJwtDescriptor.ts +++ b/packages/sdk/src/api/entities/VCLJwtDescriptor.ts @@ -1,5 +1,6 @@ import { randomUUID } from "crypto"; import VCLDidJwk from "./VCLDidJwk"; +import { Nullish } from "../../types"; export default class VCLJwtDescriptor { constructor( diff --git a/packages/sdk/src/api/entities/VCLOrganizationsSearchDescriptor.ts b/packages/sdk/src/api/entities/VCLOrganizationsSearchDescriptor.ts index 60b2355..177f2b0 100644 --- a/packages/sdk/src/api/entities/VCLOrganizationsSearchDescriptor.ts +++ b/packages/sdk/src/api/entities/VCLOrganizationsSearchDescriptor.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLServiceTypes from "./VCLServiceTypes"; export default class VCLOrganizationsSearchDescriptor { diff --git a/packages/sdk/src/api/entities/VCLPresentationRequest.ts b/packages/sdk/src/api/entities/VCLPresentationRequest.ts index c776928..35142fd 100644 --- a/packages/sdk/src/api/entities/VCLPresentationRequest.ts +++ b/packages/sdk/src/api/entities/VCLPresentationRequest.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLDeepLink from "./VCLDeepLink"; import VCLJwt from "./VCLJwt"; import VCLPushDelegate from "./VCLPushDelegate"; diff --git a/packages/sdk/src/api/entities/VCLPresentationRequestDescriptor.ts b/packages/sdk/src/api/entities/VCLPresentationRequestDescriptor.ts index 94b1422..040747d 100644 --- a/packages/sdk/src/api/entities/VCLPresentationRequestDescriptor.ts +++ b/packages/sdk/src/api/entities/VCLPresentationRequestDescriptor.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLDeepLink from "./VCLDeepLink"; import VCLPushDelegate from "./VCLPushDelegate"; diff --git a/packages/sdk/src/api/entities/VCLResult.ts b/packages/sdk/src/api/entities/VCLResult.ts index 52c364b..167a9e0 100644 --- a/packages/sdk/src/api/entities/VCLResult.ts +++ b/packages/sdk/src/api/entities/VCLResult.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLError from "./error/VCLError"; export default class VCLResult { diff --git a/packages/sdk/src/api/entities/VCLServiceCredentialAgentIssuer.ts b/packages/sdk/src/api/entities/VCLServiceCredentialAgentIssuer.ts index 6d70982..bcb41a0 100644 --- a/packages/sdk/src/api/entities/VCLServiceCredentialAgentIssuer.ts +++ b/packages/sdk/src/api/entities/VCLServiceCredentialAgentIssuer.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLService from "./VCLService"; export default class VCLServiceCredentialAgentIssuer extends VCLService { diff --git a/packages/sdk/src/api/entities/VCLSubmission.ts b/packages/sdk/src/api/entities/VCLSubmission.ts index 849605d..20b4d69 100644 --- a/packages/sdk/src/api/entities/VCLSubmission.ts +++ b/packages/sdk/src/api/entities/VCLSubmission.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLJwt from "./VCLJwt"; import VCLPushDelegate from "./VCLPushDelegate"; import VCLVerifiableCredential from "./VCLVerifiableCredential"; diff --git a/packages/sdk/src/api/entities/VCLToken.ts b/packages/sdk/src/api/entities/VCLToken.ts index c812c64..27d219c 100644 --- a/packages/sdk/src/api/entities/VCLToken.ts +++ b/packages/sdk/src/api/entities/VCLToken.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import VCLJwt from "./VCLJwt" export default class VCLToken { diff --git a/packages/sdk/src/api/entities/VCLVerifiedProfile.ts b/packages/sdk/src/api/entities/VCLVerifiedProfile.ts index 814e207..66ab8db 100644 --- a/packages/sdk/src/api/entities/VCLVerifiedProfile.ts +++ b/packages/sdk/src/api/entities/VCLVerifiedProfile.ts @@ -22,6 +22,7 @@ data class VCLVerifiedProfile(val payload: JSONObject) { } */ +import { Nullish } from "../../types"; import VCLServiceType from "./VCLServiceType"; import VCLServiceTypes from "./VCLServiceTypes"; diff --git a/packages/sdk/src/api/entities/error/VCLError.ts b/packages/sdk/src/api/entities/error/VCLError.ts index e654035..f991973 100644 --- a/packages/sdk/src/api/entities/error/VCLError.ts +++ b/packages/sdk/src/api/entities/error/VCLError.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLErrorCode from "./VCLErrorCode"; export default class VCLError extends Error { diff --git a/packages/sdk/src/api/jwt/VCLJwtSignService.ts b/packages/sdk/src/api/jwt/VCLJwtSignService.ts index 6cc436e..2f99b65 100644 --- a/packages/sdk/src/api/jwt/VCLJwtSignService.ts +++ b/packages/sdk/src/api/jwt/VCLJwtSignService.ts @@ -9,6 +9,7 @@ interface VCLJwtSignService { ) }*/ +import { Nullish } from "../../types"; import VCLDidJwk from "../entities/VCLDidJwk"; import VCLJwt from "../entities/VCLJwt"; import VCLJwtDescriptor from "../entities/VCLJwtDescriptor"; diff --git a/packages/sdk/src/global.ts b/packages/sdk/src/global.ts index d27abab..b4bd7ba 100644 --- a/packages/sdk/src/global.ts +++ b/packages/sdk/src/global.ts @@ -1,11 +1,9 @@ -declare type Nullish = T | null | undefined; - declare type JSONObject = any; interface String { getQueryParameters(): Map; appendQueryParams(queryParams: string): string; - getUrlSubPath(subPathPrefix: string): Nullish; + getUrlSubPath(subPathPrefix: string): string | null | undefined; randomString(length: number): string; } diff --git a/packages/sdk/src/impl/VCLImpl.ts b/packages/sdk/src/impl/VCLImpl.ts index b4e7b43..0cabb48 100644 --- a/packages/sdk/src/impl/VCLImpl.ts +++ b/packages/sdk/src/impl/VCLImpl.ts @@ -58,6 +58,7 @@ import OrganizationsUseCase from "./domain/usecases/OrganizationsUseCase"; import CredentialTypesUIFormSchemaUseCase from "./domain/usecases/CredentialTypesUIFormSchemaUseCase"; import VCLDidJwkDescriptor from "../api/entities/VCLDidJwkDescriptor"; import KeyServiceUseCase from "./domain/usecases/KeyServiceUseCase"; +import { Nullish } from "../types"; export class VCLImpl implements VCL { static TAG = VCLImpl.name; diff --git a/packages/sdk/src/impl/data/infrastructure/network/NetworkServiceImpl.ts b/packages/sdk/src/impl/data/infrastructure/network/NetworkServiceImpl.ts index 9a4fcaa..90b3012 100644 --- a/packages/sdk/src/impl/data/infrastructure/network/NetworkServiceImpl.ts +++ b/packages/sdk/src/impl/data/infrastructure/network/NetworkServiceImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../../types"; import VCLResult from "../../../../api/entities/VCLResult"; import NetworkService from "../../../domain/infrastructure/network/NetworkService"; import VCLLog from "../../../utils/VCLLog"; diff --git a/packages/sdk/src/impl/data/infrastructure/network/Request.ts b/packages/sdk/src/impl/data/infrastructure/network/Request.ts index afee43d..86a9a67 100644 --- a/packages/sdk/src/impl/data/infrastructure/network/Request.ts +++ b/packages/sdk/src/impl/data/infrastructure/network/Request.ts @@ -1,3 +1,5 @@ +import { Nullish } from "../../../../types"; + export enum HttpMethod { GET = "GET", POST = "POST", diff --git a/packages/sdk/src/impl/data/models/CountriesModelImpl.ts b/packages/sdk/src/impl/data/models/CountriesModelImpl.ts index 06aa820..43886fa 100644 --- a/packages/sdk/src/impl/data/models/CountriesModelImpl.ts +++ b/packages/sdk/src/impl/data/models/CountriesModelImpl.ts @@ -3,6 +3,7 @@ import VCLError from "../../../api/entities/error/VCLError"; import VCLResult from "../../../api/entities/VCLResult"; import CountriesModel from "../../domain/models/CountriesModel"; import CountriesUseCase from "../../domain/usecases/CountriesModelUseCase"; +import { Nullish } from "../../../types"; export default class CountriesModelImpl implements CountriesModel { constructor(private readonly countriesUseCase: CountriesUseCase) {} diff --git a/packages/sdk/src/impl/data/models/CredentialTypeSchemasModelImpl.ts b/packages/sdk/src/impl/data/models/CredentialTypeSchemasModelImpl.ts index ca044f6..662d0c3 100644 --- a/packages/sdk/src/impl/data/models/CredentialTypeSchemasModelImpl.ts +++ b/packages/sdk/src/impl/data/models/CredentialTypeSchemasModelImpl.ts @@ -3,6 +3,7 @@ import VCLError from "../../../api/entities/error/VCLError"; import VCLResult from "../../../api/entities/VCLResult"; import CredentialTypeSchemasModel from "../../domain/models/CredentialTypeSchemasModel"; import CredentialTypeSchemasUseCase from "../../domain/usecases/CredentialTypeSchemasUseCase"; +import { Nullish } from "../../../types"; export default class CredentialTypeSchemasModelImpl implements CredentialTypeSchemasModel diff --git a/packages/sdk/src/impl/data/models/CredentialTypesModelImpl.ts b/packages/sdk/src/impl/data/models/CredentialTypesModelImpl.ts index 1807de8..c5be2ce 100644 --- a/packages/sdk/src/impl/data/models/CredentialTypesModelImpl.ts +++ b/packages/sdk/src/impl/data/models/CredentialTypesModelImpl.ts @@ -3,6 +3,7 @@ import VCLError from "../../../api/entities/error/VCLError"; import VCLResult from "../../../api/entities/VCLResult"; import CredentialTypesModel from "../../domain/models/CredentialTypesModel"; import { CredentialTypesUseCase } from "../../domain/usecases/CredentialTypesUseCase"; +import { Nullish } from "../../../types"; export default class CredentialTypesModelImpl implements CredentialTypesModel { constructor( diff --git a/packages/sdk/src/impl/data/repositories/CountriesRepositoryImpl.ts b/packages/sdk/src/impl/data/repositories/CountriesRepositoryImpl.ts index f94dbce..e51dda8 100644 --- a/packages/sdk/src/impl/data/repositories/CountriesRepositoryImpl.ts +++ b/packages/sdk/src/impl/data/repositories/CountriesRepositoryImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLCountries from "../../../api/entities/VCLCountries"; import VCLCountry from "../../../api/entities/VCLCountry"; import VCLRegion from "../../../api/entities/VCLRegion"; diff --git a/packages/sdk/src/impl/data/repositories/CredentialTypesUIFormSchemaRepositoryImpl.ts b/packages/sdk/src/impl/data/repositories/CredentialTypesUIFormSchemaRepositoryImpl.ts index c596d18..befa682 100644 --- a/packages/sdk/src/impl/data/repositories/CredentialTypesUIFormSchemaRepositoryImpl.ts +++ b/packages/sdk/src/impl/data/repositories/CredentialTypesUIFormSchemaRepositoryImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLCountries from "../../../api/entities/VCLCountries"; import VCLCredentialTypesUIFormSchema from "../../../api/entities/VCLCredentialTypesUIFormSchema"; import VCLCredentialTypesUIFormSchemaDescriptor from "../../../api/entities/VCLCredentialTypesUIFormSchemaDescriptor"; diff --git a/packages/sdk/src/impl/data/repositories/FinalizeOffersRepositoryImpl.ts b/packages/sdk/src/impl/data/repositories/FinalizeOffersRepositoryImpl.ts index 4bb8235..37b0aeb 100644 --- a/packages/sdk/src/impl/data/repositories/FinalizeOffersRepositoryImpl.ts +++ b/packages/sdk/src/impl/data/repositories/FinalizeOffersRepositoryImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLError from "../../../api/entities/error/VCLError"; import VCLFinalizeOffersDescriptor from "../../../api/entities/VCLFinalizeOffersDescriptor"; import VCLJwt from "../../../api/entities/VCLJwt"; diff --git a/packages/sdk/src/impl/data/repositories/JwtServiceRepositoryImpl.ts b/packages/sdk/src/impl/data/repositories/JwtServiceRepositoryImpl.ts index 725116c..4fea6b1 100644 --- a/packages/sdk/src/impl/data/repositories/JwtServiceRepositoryImpl.ts +++ b/packages/sdk/src/impl/data/repositories/JwtServiceRepositoryImpl.ts @@ -8,6 +8,7 @@ import VCLResult from "../../../api/entities/VCLResult"; import JwtServiceRepository from "../../domain/repositories/JwtServiceRepository"; import VCLJwtSignService from "../../../api/jwt/VCLJwtSignService"; import VCLJwtVerifyService from "../../../api/jwt/VCLJwtVerifyService"; +import { Nullish } from "../../../types"; export default class JwtServiceRepositoryImpl implements JwtServiceRepository { constructor( diff --git a/packages/sdk/src/impl/data/repositories/OrganizationsRepositoryImpl.ts b/packages/sdk/src/impl/data/repositories/OrganizationsRepositoryImpl.ts index 087ea7d..a2a4aec 100644 --- a/packages/sdk/src/impl/data/repositories/OrganizationsRepositoryImpl.ts +++ b/packages/sdk/src/impl/data/repositories/OrganizationsRepositoryImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../..//types"; import VCLError from "../../../api/entities/error/VCLError"; import VCLOrganization from "../../../api/entities/VCLOrganization"; import VCLOrganizations from "../../../api/entities/VCLOrganizations"; diff --git a/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts b/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts index 2d9df99..1b7d162 100644 --- a/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts +++ b/packages/sdk/src/impl/data/usecases/FinalizeOffersUseCaseImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLError from "../../../api/entities/error/VCLError"; import VCLDidJwk from "../../../api/entities/VCLDidJwk"; import VCLFinalizeOffersDescriptor from "../../../api/entities/VCLFinalizeOffersDescriptor"; diff --git a/packages/sdk/src/impl/data/usecases/JwtServiceUseCaseImpl.ts b/packages/sdk/src/impl/data/usecases/JwtServiceUseCaseImpl.ts index 0ec67fd..82fd59f 100644 --- a/packages/sdk/src/impl/data/usecases/JwtServiceUseCaseImpl.ts +++ b/packages/sdk/src/impl/data/usecases/JwtServiceUseCaseImpl.ts @@ -6,6 +6,7 @@ import VCLJwtDescriptor from "../../../api/entities/VCLJwtDescriptor"; import VCLResult from "../../../api/entities/VCLResult"; import JwtServiceRepository from "../../domain/repositories/JwtServiceRepository"; import JwtServiceUseCase from "../../domain/usecases/JwtServiceUseCase"; +import { Nullish } from "../../../types"; export default class JwtServiceUseCaseImpl implements JwtServiceUseCase { constructor(private readonly jwtServiceRepository: JwtServiceRepository) {} diff --git a/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts b/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts index 4bc2dd3..65ca470 100644 --- a/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts +++ b/packages/sdk/src/impl/data/usecases/SubmissionUseCaseImpl.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLDidJwk from "../../../api/entities/VCLDidJwk"; import VCLJwt from "../../../api/entities/VCLJwt"; import VCLJwtDescriptor from "../../../api/entities/VCLJwtDescriptor"; diff --git a/packages/sdk/src/impl/domain/infrastructure/db/SecretStoreService.ts b/packages/sdk/src/impl/domain/infrastructure/db/SecretStoreService.ts index 469ca57..e03c713 100644 --- a/packages/sdk/src/impl/domain/infrastructure/db/SecretStoreService.ts +++ b/packages/sdk/src/impl/domain/infrastructure/db/SecretStoreService.ts @@ -1,5 +1,5 @@ import { KeyPairKeyObjectResult } from "crypto"; -import { JWK } from "jose"; +import { Nullish } from "../../../../types"; export default interface SecretStoreService { storeKey(keyId: string, key: KeyPairKeyObjectResult): void; diff --git a/packages/sdk/src/impl/domain/infrastructure/network/NetworkService.ts b/packages/sdk/src/impl/domain/infrastructure/network/NetworkService.ts index 03d9d32..6701b6a 100644 --- a/packages/sdk/src/impl/domain/infrastructure/network/NetworkService.ts +++ b/packages/sdk/src/impl/domain/infrastructure/network/NetworkService.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../../types"; import VCLResult from "../../../../api/entities/VCLResult"; import Request, { HttpMethod, diff --git a/packages/sdk/src/impl/domain/models/Model.ts b/packages/sdk/src/impl/domain/models/Model.ts index 917af66..4effe8f 100644 --- a/packages/sdk/src/impl/domain/models/Model.ts +++ b/packages/sdk/src/impl/domain/models/Model.ts @@ -1,3 +1,5 @@ +import { Nullish } from "../../../types"; + export default interface Model { data: Nullish; } diff --git a/packages/sdk/src/impl/domain/repositories/JwtServiceRepository.ts b/packages/sdk/src/impl/domain/repositories/JwtServiceRepository.ts index f7d33ce..39c941b 100644 --- a/packages/sdk/src/impl/domain/repositories/JwtServiceRepository.ts +++ b/packages/sdk/src/impl/domain/repositories/JwtServiceRepository.ts @@ -6,6 +6,7 @@ import VCLPublicJwk from "../../../api/entities/VCLPublicJwk"; import VCLJwt from "../../../api/entities/VCLJwt"; import VCLJwtDescriptor from "../../../api/entities/VCLJwtDescriptor"; import VCLResult from "../../../api/entities/VCLResult"; +import { Nullish } from "../../../types"; export default interface JwtServiceRepository { decode(encodedJwt: string): Promise>; diff --git a/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts b/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts index 80e2f6a..76a074f 100644 --- a/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts +++ b/packages/sdk/src/impl/domain/usecases/FinalizeOffersUseCase.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLDidJwk from "../../../api/entities/VCLDidJwk"; import VCLFinalizeOffersDescriptor from "../../../api/entities/VCLFinalizeOffersDescriptor"; import VCLJwtVerifiableCredentials from "../../../api/entities/VCLJwtVerifiableCredentials"; diff --git a/packages/sdk/src/impl/domain/usecases/JwtServiceUseCase.ts b/packages/sdk/src/impl/domain/usecases/JwtServiceUseCase.ts index e59d5b5..839de9a 100644 --- a/packages/sdk/src/impl/domain/usecases/JwtServiceUseCase.ts +++ b/packages/sdk/src/impl/domain/usecases/JwtServiceUseCase.ts @@ -4,6 +4,7 @@ import VCLPublicJwk from "../../../api/entities/VCLPublicJwk"; import VCLJwt from "../../../api/entities/VCLJwt"; import VCLJwtDescriptor from "../../../api/entities/VCLJwtDescriptor"; import VCLResult from "../../../api/entities/VCLResult"; +import { Nullish } from "../../../types"; export default interface JwtServiceUseCase { verifyJwt( diff --git a/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts b/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts index 2120d1d..bd304b8 100644 --- a/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts +++ b/packages/sdk/src/impl/domain/usecases/SubmissionUseCase.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../../types"; import VCLDidJwk from "../../../api/entities/VCLDidJwk"; import VCLResult from "../../../api/entities/VCLResult"; import VCLSubmission from "../../../api/entities/VCLSubmission"; diff --git a/packages/sdk/src/impl/extensions/StringExtensions.ts b/packages/sdk/src/impl/extensions/StringExtensions.ts index 069e4e4..3607818 100644 --- a/packages/sdk/src/impl/extensions/StringExtensions.ts +++ b/packages/sdk/src/impl/extensions/StringExtensions.ts @@ -30,7 +30,7 @@ String.prototype.appendQueryParams = function (queryParams: string): string { String.prototype.getUrlSubPath = function ( subPathPrefix: string -): Nullish { +): string | null | undefined { return decodeURI(this.valueOf()) .split("/") .find((item) => item.startsWith(subPathPrefix)); diff --git a/packages/sdk/src/impl/utils/VCLLog.ts b/packages/sdk/src/impl/utils/VCLLog.ts index e3bffea..d397a0e 100644 --- a/packages/sdk/src/impl/utils/VCLLog.ts +++ b/packages/sdk/src/impl/utils/VCLLog.ts @@ -1,3 +1,4 @@ +import { Nullish } from "../../types"; import GlobalConfig from "../GlobalConfig"; export default class VCLLog { diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index f37531b..3f2efdd 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -53,6 +53,8 @@ import VCLErrorCode from "./api/entities/error/VCLErrorCode"; import VCLKeyService from "./api/keys/VCLKeyService"; import VCLJwtSignService from "./api/jwt/VCLJwtSignService"; import VCLJwtVerifyService from "./api/jwt/VCLJwtVerifyService"; +import VCLResult from "./api/entities/VCLResult"; +import { Nullish } from "./types"; export { VCL, @@ -111,6 +113,8 @@ export { VCLKeyService, VCLJwtSignService, VCLJwtVerifyService, + VCLResult, + Nullish, }; // export type { diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts new file mode 100644 index 0000000..d47ede7 --- /dev/null +++ b/packages/sdk/src/types.ts @@ -0,0 +1 @@ +export type Nullish = T | null | undefined; \ No newline at end of file diff --git a/packages/sdk/test/NetworkServiceSuccess.ts b/packages/sdk/test/NetworkServiceSuccess.ts index 7816679..8187385 100644 --- a/packages/sdk/test/NetworkServiceSuccess.ts +++ b/packages/sdk/test/NetworkServiceSuccess.ts @@ -4,6 +4,7 @@ import Request, { HttpMethod, } from "../src/impl/data/infrastructure/network/Request"; import Response from "../src/impl/data/infrastructure/network/Response"; +import { Nullish } from "../src/types"; export default class NetworkServiceSuccess implements NetworkService { constructor(private readonly validResponse: JSONObject) {} diff --git a/packages/sdk/tsconfig.json b/packages/sdk/tsconfig.json index ace7a3b..ad083c2 100644 --- a/packages/sdk/tsconfig.json +++ b/packages/sdk/tsconfig.json @@ -25,9 +25,7 @@ }, }, "include": [ - "./src/**/*", - "global.d.ts", - "index.d.ts" + "./src/**/*" ], "exclude": [ "node_modules", diff --git a/yarn.lock b/yarn.lock index 4c4e6bb..17a7126 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3311,9 +3311,9 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-sta integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-json-stringify@^5.7.0: - version "5.15.0" - resolved "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.15.0.tgz#79ea7203c8e541c744e1d59a4fb17133688c181a" - integrity sha512-BUEAAyDKb64u+kmkINYfXUUiKjBKerSmVu/dzotfaWSHBxR44JFrOZgkhMO6VxDhDfiuAoi8mx4drd5nvNdA4Q== + version "5.15.1" + resolved "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.15.1.tgz#1348b89c174cd771467e017cf61c75a796154c45" + integrity sha512-JopGtkvvguRqrS4gHXSSA2jf4pDgOZkeBAkLO1LbzOpiOMo7/kugoR+KiWifpLpluaVeYDkAuxCJOj4Gyc6L9A== dependencies: "@fastify/merge-json-schemas" "^0.1.0" ajv "^8.10.0"