@apiverve/agecalculator 1.1.14 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +35 -5
  2. package/index.d.ts +50 -9
  3. package/package.json +4 -5
package/README.md CHANGED
@@ -123,14 +123,44 @@ async function makeRequest() {
123
123
  "error": null,
124
124
  "data": {
125
125
  "dob": "1990-01-01",
126
- "age_years": 35,
127
- "age_months": 421,
128
- "age_weeks": 1833,
129
- "age_days": 12834,
126
+ "age_breakdown": {
127
+ "years": 35,
128
+ "months": 431,
129
+ "weeks": 1876,
130
+ "days": 13133,
131
+ "hours": 315208,
132
+ "minutes": 18912499,
133
+ "seconds": 1134749976
134
+ },
130
135
  "age_words": {
131
136
  "years": "thirty-five",
132
137
  "ordinal": "thirty-fifth",
133
- "full": "thirty-five years old"
138
+ "full": "thirty-five years old",
139
+ "locale": "en-US"
140
+ },
141
+ "timezone": "America/Chicago",
142
+ "locale": "en-US",
143
+ "next_birthday": {
144
+ "months": 0,
145
+ "weeks": 2,
146
+ "days": 15,
147
+ "hours": 367,
148
+ "minutes": 22060,
149
+ "seconds": 1323623
150
+ },
151
+ "insights": {
152
+ "generation": "Millennial",
153
+ "zodiacSign": "Capricorn",
154
+ "chineseZodiac": "Horse",
155
+ "birthstone": "Garnet",
156
+ "dayOfWeekBorn": "Monday",
157
+ "isLeapYearBirth": false,
158
+ "milestones": {
159
+ "canVoteUS": true,
160
+ "canDrinkUS": true,
161
+ "canRentCarUS": true,
162
+ "seniorDiscount": false
163
+ }
134
164
  }
135
165
  }
136
166
  }
package/index.d.ts CHANGED
@@ -4,27 +4,68 @@ declare module '@apiverve/agecalculator' {
4
4
  secure?: boolean;
5
5
  }
6
6
 
7
+ /**
8
+ * Describes fields the current plan does not unlock. Locked fields arrive as null
9
+ * in `data`; `locked_fields` names them, using dot paths for nested fields.
10
+ * Absent when the plan unlocks everything.
11
+ */
12
+ export interface PremiumInfo {
13
+ message: string;
14
+ upgrade_url: string;
15
+ locked_fields: string[];
16
+ }
17
+
7
18
  export interface agecalculatorResponse {
8
19
  status: string;
9
20
  error: string | null;
10
21
  data: AgeCalculatorData;
11
22
  code?: number;
23
+ premium?: PremiumInfo;
12
24
  }
13
25
 
14
26
 
15
27
  interface AgeCalculatorData {
16
- dob: Date;
17
- ageYears: number;
18
- ageMonths: number;
19
- ageWeeks: number;
20
- ageDays: number;
21
- ageWords: AgeWords;
28
+ dob: Date | null;
29
+ ageBreakdown: AgeBreakdown;
30
+ ageWords: AgeWords;
31
+ timezone: null | string;
32
+ locale: null | string;
33
+ nextBirthday: AgeBreakdown;
34
+ insights: Insights;
35
+ }
36
+
37
+ interface AgeBreakdown {
38
+ years?: number | null;
39
+ months: number | null;
40
+ weeks: number | null;
41
+ days: number | null;
42
+ hours: number | null;
43
+ minutes: number | null;
44
+ seconds: number | null;
22
45
  }
23
46
 
24
47
  interface AgeWords {
25
- years: string;
26
- ordinal: string;
27
- full: string;
48
+ years: null | string;
49
+ ordinal: null | string;
50
+ full: null | string;
51
+ locale: null | string;
52
+ }
53
+
54
+ interface Insights {
55
+ generation: null | string;
56
+ zodiacSign: null | string;
57
+ chineseZodiac: null | string;
58
+ birthstone: null | string;
59
+ dayOfWeekBorn: null | string;
60
+ isLeapYearBirth: boolean | null;
61
+ milestones: Milestones;
62
+ }
63
+
64
+ interface Milestones {
65
+ canVoteUS: boolean | null;
66
+ canDrinkUS: boolean | null;
67
+ canRentCarUS: boolean | null;
68
+ seniorDiscount: boolean | null;
28
69
  }
29
70
 
30
71
  export default class agecalculatorWrapper {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@apiverve/agecalculator",
3
- "version": "1.1.14",
3
+ "version": "1.2.0",
4
4
  "description": "Age Calculator is a simple tool for calculating age from the date of birth. It returns the calculated age based on the date of birth provided.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "sideEffects": false,
8
8
  "engines": {
9
- "node": ">=14.0.0"
9
+ "node": ">=18.0.0"
10
10
  },
11
11
  "files": [
12
12
  "index.js",
@@ -41,8 +41,7 @@
41
41
  "dotenv": "^16.4.7"
42
42
  },
43
43
  "dependencies": {
44
- "node-fetch": "^3.3.2",
45
- "promise": "^8.3.0",
46
- "axios": "1.13.2"
44
+ "axios": "1.13.2",
45
+ "form-data": "^4.0.1"
47
46
  }
48
47
  }