From 0560c0c049c090f3f41276be4d3d34c4abe4581e Mon Sep 17 00:00:00 2001 From: tjcouch-sil Date: Wed, 20 Dec 2023 16:10:01 -0600 Subject: [PATCH] Updated MandatoryProjectDataType JSDoc to match current type enforcement --- lib/papi-dts/papi.d.ts | 16 +++++++++++++++- src/shared/models/project-data-provider.model.ts | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/papi-dts/papi.d.ts b/lib/papi-dts/papi.d.ts index f267711a61..b4b4b921a7 100644 --- a/lib/papi-dts/papi.d.ts +++ b/lib/papi-dts/papi.d.ts @@ -2184,7 +2184,21 @@ declare module 'shared/models/project-data-provider.model' { */ dataQualifier: string; }; - /** All Project Data Provider data types must extend from this */ + /** + * All Project Data Provider data types must have an `ExtensionData` type. We strongly recommend all + * Project Data Provider data types extend from this type in order to standardize the + * `ExtensionData` types. + * + * Benefits of following this standard: + * + * - All PSIs that support this `projectType` can use a standardized `ExtensionData` interface + * - If an extension uses the `ExtensionData` endpoint for any project, it will likely use this + * standardized interface, so using this interface on your Project Data Provider data types + * enables your PDP to support generic extension data + * - In the future, we may enforce that callers to `ExtensionData` endpoints include `extensionName`, + * so following this interface ensures your PDP will not break if such a requirement is + * implemented. + */ export type MandatoryProjectDataType = { ExtensionData: DataProviderDataType; }; diff --git a/src/shared/models/project-data-provider.model.ts b/src/shared/models/project-data-provider.model.ts index ff4bf5ce8b..de273195f9 100644 --- a/src/shared/models/project-data-provider.model.ts +++ b/src/shared/models/project-data-provider.model.ts @@ -18,7 +18,21 @@ export type ExtensionDataScope = { dataQualifier: string; }; -/** All Project Data Provider data types must extend from this */ +/** + * All Project Data Provider data types must have an `ExtensionData` type. We strongly recommend all + * Project Data Provider data types extend from this type in order to standardize the + * `ExtensionData` types. + * + * Benefits of following this standard: + * + * - All PSIs that support this `projectType` can use a standardized `ExtensionData` interface + * - If an extension uses the `ExtensionData` endpoint for any project, it will likely use this + * standardized interface, so using this interface on your Project Data Provider data types + * enables your PDP to support generic extension data + * - In the future, we may enforce that callers to `ExtensionData` endpoints include `extensionName`, + * so following this interface ensures your PDP will not break if such a requirement is + * implemented. + */ export type MandatoryProjectDataType = { ExtensionData: DataProviderDataType; };