imgflip.com 3.4.7 → 3.5.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/dist/Imgflip.d.ts +2 -2
- package/dist/Imgflip.js +42 -12
- package/package.json +8 -7
package/dist/Imgflip.d.ts
CHANGED
package/dist/Imgflip.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,8 +43,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
43
|
};
|
|
11
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
45
|
exports.Imgflip = void 0;
|
|
13
|
-
const
|
|
14
|
-
const qs = require("qs");
|
|
46
|
+
const api_client_1 = require("@ffflorian/api-client");
|
|
47
|
+
const qs = __importStar(require("qs"));
|
|
15
48
|
const Endpoints_1 = require("./Endpoints");
|
|
16
49
|
class Imgflip {
|
|
17
50
|
constructor(apiUrl) {
|
|
@@ -22,20 +55,17 @@ class Imgflip {
|
|
|
22
55
|
headers: {
|
|
23
56
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
24
57
|
},
|
|
25
|
-
method: '
|
|
26
|
-
url: endpoint,
|
|
58
|
+
method: 'POST',
|
|
27
59
|
};
|
|
28
|
-
const
|
|
29
|
-
return
|
|
60
|
+
const response = yield this.apiClient.request(endpoint, config);
|
|
61
|
+
return response.json();
|
|
30
62
|
});
|
|
31
63
|
this.getMemes = () => __awaiter(this, void 0, void 0, function* () {
|
|
32
64
|
const endpoint = Endpoints_1.Endpoint.getMemes();
|
|
33
65
|
const { data } = yield this.apiClient.get(endpoint);
|
|
34
66
|
return data;
|
|
35
67
|
});
|
|
36
|
-
this.apiClient =
|
|
37
|
-
baseURL: apiUrl || Imgflip.BASE_URL,
|
|
38
|
-
});
|
|
68
|
+
this.apiClient = new api_client_1.APIClient(apiUrl || Imgflip.BASE_URL);
|
|
39
69
|
this.api = {
|
|
40
70
|
captionImage: this.captionImage,
|
|
41
71
|
getMemes: this.getMemes,
|
|
@@ -43,10 +73,10 @@ class Imgflip {
|
|
|
43
73
|
}
|
|
44
74
|
/**
|
|
45
75
|
* Set a new API URL.
|
|
46
|
-
* @param
|
|
76
|
+
* @param newURL The new API url
|
|
47
77
|
*/
|
|
48
|
-
setApiUrl(
|
|
49
|
-
this.apiClient.
|
|
78
|
+
setApiUrl(newURL) {
|
|
79
|
+
this.apiClient.setBaseURL(newURL);
|
|
50
80
|
}
|
|
51
81
|
}
|
|
52
82
|
exports.Imgflip = Imgflip;
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"
|
|
4
|
+
"@ffflorian/api-client": "2.1.2",
|
|
5
5
|
"qs": "6.14.0"
|
|
6
6
|
},
|
|
7
7
|
"description": "A imgflip.com API client",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@types/node": "~24",
|
|
10
10
|
"@types/qs": "6.14.0",
|
|
11
|
-
"
|
|
11
|
+
"rimraf": "6.1.0",
|
|
12
|
+
"typedoc": "0.28.14",
|
|
12
13
|
"typescript": "5.9.3"
|
|
13
14
|
},
|
|
14
15
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
16
|
+
"node": ">= 21"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
18
19
|
"dist"
|
|
@@ -28,12 +29,12 @@
|
|
|
28
29
|
"name": "imgflip.com",
|
|
29
30
|
"repository": "https://github.com/ffflorian/api-clients/tree/main/packages/imgflip.com",
|
|
30
31
|
"scripts": {
|
|
31
|
-
"build:ts": "tsc",
|
|
32
|
-
"build:docs": "typedoc --options ../../typedoc.json --out ../../docs/packages/imgflip.com src/index.ts",
|
|
32
|
+
"build:ts": "tsc -p tsconfig.build.json",
|
|
33
|
+
"build:docs": "typedoc --tsconfig tsconfig.build.json --options ../../typedoc.json --out ../../docs/packages/imgflip.com src/index.ts",
|
|
33
34
|
"clean": "rimraf dist",
|
|
34
35
|
"dist": "yarn clean && yarn build:ts",
|
|
35
36
|
"test": "exit 0"
|
|
36
37
|
},
|
|
37
|
-
"version": "3.
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"version": "3.5.0",
|
|
39
|
+
"gitHead": "b6392f3b78cc68d334526b7ebd5f1375511c769f"
|
|
39
40
|
}
|