Skip to content

Commit d7a66c7

Browse files
Jiaming Youmeta-codesync[bot]
authored andcommitted
Export PII_DATA_TYPE
Summary: Export PII_DATA_TYPE Differential Revision: D104723153 fbshipit-source-id: 59cc46e407aa589c73f3169199969b62a013f67f
1 parent a975fc9 commit d7a66c7

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

nodejs/capi-param-builder/index.d.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
/**
10+
* Supported PII data types for normalization and hashing
11+
*/
12+
export declare const PII_DATA_TYPE: {
13+
readonly PHONE: 'phone';
14+
readonly EMAIL: 'email';
15+
readonly FIRST_NAME: 'first_name';
16+
readonly LAST_NAME: 'last_name';
17+
readonly DATE_OF_BIRTH: 'date_of_birth';
18+
readonly GENDER: 'gender';
19+
readonly CITY: 'city';
20+
readonly STATE: 'state';
21+
readonly ZIP_CODE: 'zip_code';
22+
readonly COUNTRY: 'country';
23+
readonly EXTERNAL_ID: 'external_id';
24+
};
25+
26+
export type PiiDataType = typeof PII_DATA_TYPE[keyof typeof PII_DATA_TYPE];
27+
928
/**
1029
* Cookie settings for setting browser cookies
1130
*/
@@ -122,7 +141,7 @@ export declare class ParamBuilder {
122141
* @param dataType The type of PII data (e.g., 'email', 'phone', 'first_name')
123142
* @returns The normalized and hashed PII value, or null if invalid
124143
*/
125-
getNormalizedAndHashedPII(piiValue: string, dataType: string): string | null;
144+
getNormalizedAndHashedPII(piiValue: string, dataType: PiiDataType | string): string | null;
126145

127146
// Internal used privat methods
128147
private _buildParamConfigs(existing_payload: string, query: string, prefix: string, value: string): string;

nodejs/capi-param-builder/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88
const {ParamBuilder, CookieSettings} = require('./src/ParamBuilder');
9+
const Constants = require('./src/model/Constants');
910

1011
module.exports = {
1112
ParamBuilder,
1213
CookieSettings,
14+
PII_DATA_TYPE: Constants.PII_DATA_TYPE,
1315
}

0 commit comments

Comments
 (0)