@apiverve/anagrampuzzle 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.
- package/README.md +36 -29
- package/index.d.ts +27 -8
- package/index.js +1 -1
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -62,7 +62,8 @@ Using the API is simple. All you have to do is make a request. The API will retu
|
|
|
62
62
|
var query = {
|
|
63
63
|
word: "listen",
|
|
64
64
|
count: 1,
|
|
65
|
-
difficulty: "medium"
|
|
65
|
+
difficulty: "medium",
|
|
66
|
+
image: false
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
api.execute(query, function (error, data) {
|
|
@@ -84,7 +85,8 @@ You can also use promises to make requests. The API returns a promise that you c
|
|
|
84
85
|
var query = {
|
|
85
86
|
word: "listen",
|
|
86
87
|
count: 1,
|
|
87
|
-
difficulty: "medium"
|
|
88
|
+
difficulty: "medium",
|
|
89
|
+
image: false
|
|
88
90
|
};
|
|
89
91
|
|
|
90
92
|
api.execute(query)
|
|
@@ -107,7 +109,8 @@ async function makeRequest() {
|
|
|
107
109
|
var query = {
|
|
108
110
|
word: "listen",
|
|
109
111
|
count: 1,
|
|
110
|
-
difficulty: "medium"
|
|
112
|
+
difficulty: "medium",
|
|
113
|
+
image: false
|
|
111
114
|
};
|
|
112
115
|
|
|
113
116
|
try {
|
|
@@ -130,54 +133,58 @@ async function makeRequest() {
|
|
|
130
133
|
"data": {
|
|
131
134
|
"puzzles": [
|
|
132
135
|
{
|
|
133
|
-
"original": "
|
|
134
|
-
"scrambled": "
|
|
136
|
+
"original": "DESPAIR",
|
|
137
|
+
"scrambled": "PDAISRE",
|
|
135
138
|
"anagrams": [
|
|
136
|
-
"
|
|
139
|
+
"ASPIRED",
|
|
140
|
+
"DIAPERS"
|
|
137
141
|
],
|
|
138
|
-
"letterCount":
|
|
139
|
-
"hint": "A strap for tightening a saddle girth. [Western U. S. & Sp. Amer.]"
|
|
142
|
+
"letterCount": 7
|
|
140
143
|
},
|
|
141
144
|
{
|
|
142
|
-
"original": "
|
|
143
|
-
"scrambled": "
|
|
145
|
+
"original": "GREATS",
|
|
146
|
+
"scrambled": "RSGETA",
|
|
144
147
|
"anagrams": [
|
|
145
|
-
"
|
|
148
|
+
"GASTER",
|
|
149
|
+
"GATERS",
|
|
150
|
+
"GRATES"
|
|
146
151
|
],
|
|
147
|
-
"letterCount": 6
|
|
148
|
-
"hint": "To stud as with stars. [R.] \"A golden throne instarred with gems.\" J. Barlow."
|
|
152
|
+
"letterCount": 6
|
|
149
153
|
},
|
|
150
154
|
{
|
|
151
|
-
"original": "
|
|
152
|
-
"scrambled": "
|
|
155
|
+
"original": "GROANS",
|
|
156
|
+
"scrambled": "SOGNRA",
|
|
153
157
|
"anagrams": [
|
|
154
|
-
"
|
|
158
|
+
"ARGONS"
|
|
155
159
|
],
|
|
156
|
-
"letterCount": 6
|
|
157
|
-
"hint": "To protect from the effects of; hence, to cure; to heal. [Obs.] My brother shall"
|
|
160
|
+
"letterCount": 6
|
|
158
161
|
},
|
|
159
162
|
{
|
|
160
|
-
"original": "
|
|
161
|
-
"scrambled": "
|
|
163
|
+
"original": "BARGEES",
|
|
164
|
+
"scrambled": "ABEREGS",
|
|
162
165
|
"anagrams": [
|
|
163
|
-
"
|
|
166
|
+
"BAREGES"
|
|
164
167
|
],
|
|
165
|
-
"letterCount": 7
|
|
166
|
-
"hint": "Resembling iron, as in taste. Wood."
|
|
168
|
+
"letterCount": 7
|
|
167
169
|
},
|
|
168
170
|
{
|
|
169
|
-
"original": "
|
|
170
|
-
"scrambled": "
|
|
171
|
+
"original": "CANINES",
|
|
172
|
+
"scrambled": "NISNCEA",
|
|
171
173
|
"anagrams": [
|
|
172
|
-
"
|
|
174
|
+
"ENCINAS"
|
|
173
175
|
],
|
|
174
|
-
"letterCount": 7
|
|
175
|
-
"hint": "1. Consisting of rays, and light. [R.] Berkeley. 2. Radiating; radiant. [Obs.] G"
|
|
176
|
+
"letterCount": 7
|
|
176
177
|
}
|
|
177
178
|
],
|
|
178
179
|
"count": 5,
|
|
179
180
|
"difficulty": "medium",
|
|
180
|
-
"html": "<html><head><title>Anagram Puzzle</title><style>body {font-family: Arial, sans-serif; padding: 20px; max-width: 700px; margin: 0 auto;}h1 {text-align: center;}.puzzle {background: #f5f5f5; padding: 25px; margin: 20px 0; border-radius: 10px;}.scrambled {font-size: 32px; font-weight: bold; letter-spacing: 8px; color: #9C27B0; text-align: center; margin: 15px 0;}.letters {display: flex; justify-content: center; gap: 5px; margin: 15px 0;}.letter {width: 40px; height: 40px; background: #fff; border: 2px solid #9C27B0; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold;}.hint {font-size: 14px; color: #666; font-style: italic; margin-top: 15px;}.info {font-size: 12px; color: #999; margin-top: 10px;}.answer-area {margin-top: 15px; padding: 10px; border: 2px dashed #ccc; border-radius: 5px; min-height: 30px;}</style></head><body><h1>Anagram Puzzle</h1><p style='text-align:center;'>Rearrange the letters to form a word</p><div class='puzzle'><div class='info'>#1 -
|
|
181
|
+
"html": "<html><head><title>Anagram Puzzle</title><style>body {font-family: Arial, sans-serif; padding: 20px; max-width: 700px; margin: 0 auto;}h1 {text-align: center;}.puzzle {background: #f5f5f5; padding: 25px; margin: 20px 0; border-radius: 10px;}.scrambled {font-size: 32px; font-weight: bold; letter-spacing: 8px; color: #9C27B0; text-align: center; margin: 15px 0;}.letters {display: flex; justify-content: center; gap: 5px; margin: 15px 0;}.letter {width: 40px; height: 40px; background: #fff; border: 2px solid #9C27B0; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold;}.hint {font-size: 14px; color: #666; font-style: italic; margin-top: 15px;}.info {font-size: 12px; color: #999; margin-top: 10px;}.answer-area {margin-top: 15px; padding: 10px; border: 2px dashed #ccc; border-radius: 5px; min-height: 30px;}</style></head><body><h1>Anagram Puzzle</h1><p style='text-align:center;'>Rearrange the letters to form a word</p><div class='puzzle'><div class='info'>#1 - 7 letters</div><div class='letters'><div class='letter'>P</div><div class='letter'>D</div><div class='letter'>A</div><div class='letter'>I</div><div class='letter'>S</div><div class='letter'>R</div><div class='letter'>E</div></div><div class='answer-area'></div><div class='info'>Bonus: This word has 2 anagram(s)!</div></div><div class='puzzle'><div class='info'>#2 - 6 letters</div><div class='letters'><div class='letter'>R</div><div class='letter'>S</div><div class='letter'>G</div><div class='letter'>E</div><div class='letter'>T</div><div class='letter'>A</div></div><div class='answer-area'></div><div class='info'>Bonus: This word has 3 anagram(s)!</div></div><div class='puzzle'><div class='info'>#3 - 6 letters</div><div class='letters'><div class='letter'>S</div><div class='letter'>O</div><div class='letter'>G</div><div class='letter'>N</div><div class='letter'>R</div><div class='letter'>A</div></div><div class='answer-area'></div><div class='info'>Bonus: This word has 1 anagram(s)!</div></div><div class='puzzle'><div class='info'>#4 - 7 letters</div><div class='letters'><div class='letter'>A</div><div class='letter'>B</div><div class='letter'>E</div><div class='letter'>R</div><div class='letter'>E</div><div class='letter'>G</div><div class='letter'>S</div></div><div class='answer-area'></div><div class='info'>Bonus: This word has 1 anagram(s)!</div></div><div class='puzzle'><div class='info'>#5 - 7 letters</div><div class='letters'><div class='letter'>N</div><div class='letter'>I</div><div class='letter'>S</div><div class='letter'>N</div><div class='letter'>C</div><div class='letter'>E</div><div class='letter'>A</div></div><div class='answer-area'></div><div class='info'>Bonus: This word has 1 anagram(s)!</div></div></body></html>",
|
|
182
|
+
"image": {
|
|
183
|
+
"imageName": "d52a76c7-fe99-498f-b616-ab376cc920a5_anagram.png",
|
|
184
|
+
"format": ".png",
|
|
185
|
+
"downloadURL": "https://storage.googleapis.com/apiverve/APIData/anagrampuzzle/d52a76c7-fe99-498f-b616-ab376cc920a5_anagram.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766009991&Signature=cHugsZLx%2BpnY0TrRpTdO%2Bfh48%2Bw8E1zzZt3SNLI2dNgM%2BZj%2FiC%2FZZjvoyahZdBlBkz6pHxuLRX55%2FLszTxTxyhNLJzUcjDOCjoATtWKevbzyLmwaEyFXLDjdzikxUWjVt9g8MyiPEKSFK6%2BpgY6WCvvSeI%2Fox%2B6lQawatWFMB7k0OKSTr9FO%2Fhqqu5M4%2B37bW0zvBuNtcORufXKayE7Z2KcW%2F2wkk9YwGXrVIvn2xLcOYjdY49GAQ2HW0qxRHLDtYYMY6T32jKz1KC6KBLZzrji7v3N%2FVkxfbECzXNgZB5WcCisCoHrUyj7BO14lLr7ZC4XttlYe70ak4QTqa3qNCw%3D%3D",
|
|
186
|
+
"expires": 1766009991438
|
|
187
|
+
}
|
|
181
188
|
}
|
|
182
189
|
}
|
|
183
190
|
```
|
package/index.d.ts
CHANGED
|
@@ -4,27 +4,46 @@ declare module '@apiverve/anagrampuzzle' {
|
|
|
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 anagrampuzzleResponse {
|
|
8
19
|
status: string;
|
|
9
20
|
error: string | null;
|
|
10
21
|
data: AnagramPuzzleGeneratorData;
|
|
11
22
|
code?: number;
|
|
23
|
+
premium?: PremiumInfo;
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
|
|
15
27
|
interface AnagramPuzzleGeneratorData {
|
|
16
28
|
puzzles: Puzzle[];
|
|
17
|
-
count: number;
|
|
18
|
-
difficulty: string;
|
|
19
|
-
html: string;
|
|
29
|
+
count: number | null;
|
|
30
|
+
difficulty: null | string;
|
|
31
|
+
html: null | string;
|
|
32
|
+
image: Image;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Image {
|
|
36
|
+
imageName: null | string;
|
|
37
|
+
format: null | string;
|
|
38
|
+
downloadURL: null | string;
|
|
39
|
+
expires: number | null;
|
|
20
40
|
}
|
|
21
41
|
|
|
22
42
|
interface Puzzle {
|
|
23
|
-
original: string;
|
|
24
|
-
scrambled: string;
|
|
25
|
-
anagrams: string[];
|
|
26
|
-
letterCount: number;
|
|
27
|
-
hint: string;
|
|
43
|
+
original: null | string;
|
|
44
|
+
scrambled: null | string;
|
|
45
|
+
anagrams: (null | string)[];
|
|
46
|
+
letterCount: number | null;
|
|
28
47
|
}
|
|
29
48
|
|
|
30
49
|
export default class anagrampuzzleWrapper {
|
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@ class anagrampuzzleWrapper {
|
|
|
30
30
|
this.baseURL = 'https://api.apiverve.com/v1/anagrampuzzle';
|
|
31
31
|
|
|
32
32
|
// Validation rules for parameters (generated from schema)
|
|
33
|
-
this.validationRules = {"word":{"type":"string","required":false},"count":{"type":"integer","required":false,"min":1,"max":20,"default":1},"difficulty":{"type":"string","required":false,"default":"medium"}};
|
|
33
|
+
this.validationRules = {"word":{"type":"string","required":false},"count":{"type":"integer","required":false,"min":1,"max":20,"default":1},"difficulty":{"type":"string","required":false,"default":"medium"},"image":{"type":"boolean","required":false,"default":false}};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apiverve/anagrampuzzle",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Anagram Puzzle Generator creates word puzzles where players rearrange scrambled letters to form valid words, with optional hints.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=18.0.0"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"directory": "npm"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
|
-
""
|
|
26
|
+
"anagram", "word puzzle", "rearrange letters", "word game", "vocabulary"
|
|
27
27
|
],
|
|
28
28
|
"author": {
|
|
29
29
|
"name": "APIVerve",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
"dotenv": "^16.4.7"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"axios": "1.13.2"
|
|
44
|
+
"axios": "1.13.2",
|
|
45
|
+
"form-data": "^4.0.1"
|
|
47
46
|
}
|
|
48
47
|
}
|