Skip to content

Commit

Permalink
feat: Adjusting enum generation
Browse files Browse the repository at this point in the history
  • Loading branch information
iquirino committed Jul 5, 2023
1 parent e3edf5b commit 5c0ea25
Show file tree
Hide file tree
Showing 97 changed files with 672 additions and 675 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-wallet",
"version": "1.0.13",
"version": "1.0.14",
"description": "",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -32,8 +32,7 @@
"scripts": {
"generate": "ts-node --esm scripts/generate.ts",
"build": "make",
"prepack": "make",
"prepublishOnly": "npm run build"
"prepack": "make"
},
"keywords": [],
"author": "",
Expand Down
4 changes: 1 addition & 3 deletions scripts/generator/typescriptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ const generateEnum = (item: EnumItem) => {
if (item.deprecated) doc.push("\t * @deprecated");
doc.push("\t */");

return `${item.deprecated || cleanDescription ? doc.join("\r\n") + "\r\n" : ""}\t${
item.name
},`;
return `${item.deprecated || cleanDescription ? doc.join("\r\n") + "\r\n" : ""}\t${item.name} = "${item.name}",`;
};
6 changes: 3 additions & 3 deletions src/types/generic/AnimationType.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export enum AnimationTypeEnum {
ANIMATION_UNSPECIFIED,
FOIL_SHIMMER,
ANIMATION_UNSPECIFIED = "ANIMATION_UNSPECIFIED",
FOIL_SHIMMER = "FOIL_SHIMMER",
/**
* This item is deprecated!
* @deprecated
*/
foilShimmer,
foilShimmer = "foilShimmer",
}
4 changes: 2 additions & 2 deletions src/types/generic/BarcodeRenderEncoding.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum BarcodeRenderEncodingEnum {
RENDER_ENCODING_UNSPECIFIED,
UTF_8,
RENDER_ENCODING_UNSPECIFIED = "RENDER_ENCODING_UNSPECIFIED",
UTF_8 = "UTF_8",
}
56 changes: 28 additions & 28 deletions src/types/generic/BarcodeType.ts
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
export enum BarcodeTypeEnum {
BARCODE_TYPE_UNSPECIFIED,
AZTEC,
BARCODE_TYPE_UNSPECIFIED = "BARCODE_TYPE_UNSPECIFIED",
AZTEC = "AZTEC",
/**
* This item is deprecated!
* @deprecated
*/
aztec,
CODE_39,
aztec = "aztec",
CODE_39 = "CODE_39",
/**
* This item is deprecated!
* @deprecated
*/
code39,
CODE_128,
code39 = "code39",
CODE_128 = "CODE_128",
/**
* This item is deprecated!
* @deprecated
*/
code128,
CODABAR,
code128 = "code128",
CODABAR = "CODABAR",
/**
* This item is deprecated!
* @deprecated
*/
codabar,
DATA_MATRIX,
codabar = "codabar",
DATA_MATRIX = "DATA_MATRIX",
/**
* This item is deprecated!
* @deprecated
*/
dataMatrix,
EAN_8,
dataMatrix = "dataMatrix",
EAN_8 = "EAN_8",
/**
* This item is deprecated!
* @deprecated
*/
ean8,
EAN_13,
ean8 = "ean8",
EAN_13 = "EAN_13",
/**
* This item is deprecated!
* @deprecated
*/
ean13,
ean13 = "ean13",
/**
* This item is deprecated!
* @deprecated
*/
EAN13,
ITF_14,
EAN13 = "EAN13",
ITF_14 = "ITF_14",
/**
* This item is deprecated!
* @deprecated
*/
itf14,
PDF_417,
itf14 = "itf14",
PDF_417 = "PDF_417",
/**
* This item is deprecated!
* @deprecated
*/
pdf417,
pdf417 = "pdf417",
/**
* This item is deprecated!
* @deprecated
*/
PDF417,
QR_CODE,
PDF417 = "PDF417",
QR_CODE = "QR_CODE",
/**
* This item is deprecated!
* @deprecated
*/
qrCode,
qrCode = "qrCode",
/**
* This item is deprecated!
* @deprecated
*/
qrcode,
UPC_A,
qrcode = "qrcode",
UPC_A = "UPC_A",
/**
* This item is deprecated!
* @deprecated
*/
upcA,
TEXT_ONLY,
upcA = "upcA",
TEXT_ONLY = "TEXT_ONLY",
/**
* This item is deprecated!
* @deprecated
*/
textOnly,
textOnly = "textOnly",
}
22 changes: 11 additions & 11 deletions src/types/generic/DateFormat.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
export enum DateFormatEnum {
DATE_FORMAT_UNSPECIFIED,
DATE_TIME,
DATE_FORMAT_UNSPECIFIED = "DATE_FORMAT_UNSPECIFIED",
DATE_TIME = "DATE_TIME",
/**
* This item is deprecated!
* @deprecated
*/
dateTime,
DATE_ONLY,
dateTime = "dateTime",
DATE_ONLY = "DATE_ONLY",
/**
* This item is deprecated!
* @deprecated
*/
dateOnly,
TIME_ONLY,
dateOnly = "dateOnly",
TIME_ONLY = "TIME_ONLY",
/**
* This item is deprecated!
* @deprecated
*/
timeOnly,
DATE_TIME_YEAR,
timeOnly = "timeOnly",
DATE_TIME_YEAR = "DATE_TIME_YEAR",
/**
* This item is deprecated!
* @deprecated
*/
dateTimeYear,
DATE_YEAR,
dateTimeYear = "dateTimeYear",
DATE_YEAR = "DATE_YEAR",
/**
* This item is deprecated!
* @deprecated
*/
dateYear,
dateYear = "dateYear",
}
26 changes: 13 additions & 13 deletions src/types/generic/GenericType.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export enum GenericTypeEnum {
GENERIC_TYPE_UNSPECIFIED,
GENERIC_SEASON_PASS,
GENERIC_UTILITY_BILLS,
GENERIC_PARKING_PASS,
GENERIC_VOUCHER,
GENERIC_GYM_MEMBERSHIP,
GENERIC_LIBRARY_MEMBERSHIP,
GENERIC_RESERVATIONS,
GENERIC_AUTO_INSURANCE,
GENERIC_HOME_INSURANCE,
GENERIC_ENTRY_TICKET,
GENERIC_RECEIPT,
GENERIC_OTHER,
GENERIC_TYPE_UNSPECIFIED = "GENERIC_TYPE_UNSPECIFIED",
GENERIC_SEASON_PASS = "GENERIC_SEASON_PASS",
GENERIC_UTILITY_BILLS = "GENERIC_UTILITY_BILLS",
GENERIC_PARKING_PASS = "GENERIC_PARKING_PASS",
GENERIC_VOUCHER = "GENERIC_VOUCHER",
GENERIC_GYM_MEMBERSHIP = "GENERIC_GYM_MEMBERSHIP",
GENERIC_LIBRARY_MEMBERSHIP = "GENERIC_LIBRARY_MEMBERSHIP",
GENERIC_RESERVATIONS = "GENERIC_RESERVATIONS",
GENERIC_AUTO_INSURANCE = "GENERIC_AUTO_INSURANCE",
GENERIC_HOME_INSURANCE = "GENERIC_HOME_INSURANCE",
GENERIC_ENTRY_TICKET = "GENERIC_ENTRY_TICKET",
GENERIC_RECEIPT = "GENERIC_RECEIPT",
GENERIC_OTHER = "GENERIC_OTHER",
}
14 changes: 7 additions & 7 deletions src/types/generic/MultipleDevicesAndHoldersAllowedStatus.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export enum MultipleDevicesAndHoldersAllowedStatusEnum {
STATUS_UNSPECIFIED,
MULTIPLE_HOLDERS,
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
MULTIPLE_HOLDERS = "MULTIPLE_HOLDERS",
/**
* This item is deprecated!
* @deprecated
*/
multipleHolders,
ONE_USER_ALL_DEVICES,
multipleHolders = "multipleHolders",
ONE_USER_ALL_DEVICES = "ONE_USER_ALL_DEVICES",
/**
* This item is deprecated!
* @deprecated
*/
oneUserAllDevices,
ONE_USER_ONE_DEVICE,
oneUserAllDevices = "oneUserAllDevices",
ONE_USER_ONE_DEVICE = "ONE_USER_ONE_DEVICE",
/**
* This item is deprecated!
* @deprecated
*/
oneUserOneDevice,
oneUserOneDevice = "oneUserOneDevice",
}
6 changes: 3 additions & 3 deletions src/types/generic/NfcConstraint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export enum NfcConstraintEnum {
NFC_CONSTRAINT_UNSPECIFIED,
BLOCK_PAYMENT,
BLOCK_CLOSED_LOOP_TRANSIT,
NFC_CONSTRAINT_UNSPECIFIED = "NFC_CONSTRAINT_UNSPECIFIED",
BLOCK_PAYMENT = "BLOCK_PAYMENT",
BLOCK_CLOSED_LOOP_TRANSIT = "BLOCK_CLOSED_LOOP_TRANSIT",
}
10 changes: 5 additions & 5 deletions src/types/generic/PredefinedItem.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export enum PredefinedItemEnum {
PREDEFINED_ITEM_UNSPECIFIED,
FREQUENT_FLYER_PROGRAM_NAME_AND_NUMBER,
PREDEFINED_ITEM_UNSPECIFIED = "PREDEFINED_ITEM_UNSPECIFIED",
FREQUENT_FLYER_PROGRAM_NAME_AND_NUMBER = "FREQUENT_FLYER_PROGRAM_NAME_AND_NUMBER",
/**
* This item is deprecated!
* @deprecated
*/
frequentFlyerProgramNameAndNumber,
FLIGHT_NUMBER_AND_OPERATING_FLIGHT_NUMBER,
frequentFlyerProgramNameAndNumber = "frequentFlyerProgramNameAndNumber",
FLIGHT_NUMBER_AND_OPERATING_FLIGHT_NUMBER = "FLIGHT_NUMBER_AND_OPERATING_FLIGHT_NUMBER",
/**
* This item is deprecated!
* @deprecated
*/
flightNumberAndOperatingFlightNumber,
flightNumberAndOperatingFlightNumber = "flightNumberAndOperatingFlightNumber",
}
6 changes: 3 additions & 3 deletions src/types/generic/ScreenshotEligibility.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export enum ScreenshotEligibilityEnum {
SCREENSHOT_ELIGIBILITY_UNSPECIFIED,
ELIGIBLE,
INELIGIBLE,
SCREENSHOT_ELIGIBILITY_UNSPECIFIED = "SCREENSHOT_ELIGIBILITY_UNSPECIFIED",
ELIGIBLE = "ELIGIBLE",
INELIGIBLE = "INELIGIBLE",
}
18 changes: 9 additions & 9 deletions src/types/generic/State.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
export enum StateEnum {
STATE_UNSPECIFIED,
ACTIVE,
STATE_UNSPECIFIED = "STATE_UNSPECIFIED",
ACTIVE = "ACTIVE",
/**
* This item is deprecated!
* @deprecated
*/
active,
COMPLETED,
active = "active",
COMPLETED = "COMPLETED",
/**
* This item is deprecated!
* @deprecated
*/
completed,
EXPIRED,
completed = "completed",
EXPIRED = "EXPIRED",
/**
* This item is deprecated!
* @deprecated
*/
expired,
INACTIVE,
expired = "expired",
INACTIVE = "INACTIVE",
/**
* This item is deprecated!
* @deprecated
*/
inactive,
inactive = "inactive",
}
4 changes: 2 additions & 2 deletions src/types/generic/TotpAlgorithm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum TotpAlgorithmEnum {
TOTP_ALGORITHM_UNSPECIFIED,
TOTP_SHA1,
TOTP_ALGORITHM_UNSPECIFIED = "TOTP_ALGORITHM_UNSPECIFIED",
TOTP_SHA1 = "TOTP_SHA1",
}
14 changes: 7 additions & 7 deletions src/types/generic/TransitOption.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export enum TransitOptionEnum {
TRANSIT_OPTION_UNSPECIFIED,
ORIGIN_AND_DESTINATION_NAMES,
TRANSIT_OPTION_UNSPECIFIED = "TRANSIT_OPTION_UNSPECIFIED",
ORIGIN_AND_DESTINATION_NAMES = "ORIGIN_AND_DESTINATION_NAMES",
/**
* This item is deprecated!
* @deprecated
*/
originAndDestinationNames,
ORIGIN_AND_DESTINATION_CODES,
originAndDestinationNames = "originAndDestinationNames",
ORIGIN_AND_DESTINATION_CODES = "ORIGIN_AND_DESTINATION_CODES",
/**
* This item is deprecated!
* @deprecated
*/
originAndDestinationCodes,
ORIGIN_NAME,
originAndDestinationCodes = "originAndDestinationCodes",
ORIGIN_NAME = "ORIGIN_NAME",
/**
* This item is deprecated!
* @deprecated
*/
originName,
originName = "originName",
}
6 changes: 3 additions & 3 deletions src/types/generic/ViewUnlockRequirement.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export enum ViewUnlockRequirementEnum {
VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED,
UNLOCK_NOT_REQUIRED,
VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED = "VIEW_UNLOCK_REQUIREMENT_UNSPECIFIED",
UNLOCK_NOT_REQUIRED = "UNLOCK_NOT_REQUIRED",
/**
* If the user removes their device lock after saving the pass, then they will be prompted to create a device lock before the pass can be viewed.
*/
UNLOCK_REQUIRED_TO_VIEW,
UNLOCK_REQUIRED_TO_VIEW = "UNLOCK_REQUIRED_TO_VIEW",
}
Loading

0 comments on commit 5c0ea25

Please sign in to comment.