jcc-express-mvc 1.9.1 → 1.9.2
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/index.d.ts +2 -4
- package/index.d.ts.map +10 -1
- package/index.js +194 -29
- package/lib/Application/ApplicationBuilder.d.ts +2 -1
- package/lib/Application/ApplicationBuilder.d.ts.map +1 -1
- package/lib/Application/ApplicationBuilder.js +2 -1
- package/lib/Cloudinary/CloudinaryServiceProvider.d.ts +5 -0
- package/lib/Cloudinary/CloudinaryServiceProvider.d.ts.map +1 -0
- package/lib/Cloudinary/CloudinaryServiceProvider.js +17 -0
- package/lib/Cloudinary/index.d.ts +20 -0
- package/lib/Cloudinary/index.d.ts.map +1 -0
- package/lib/Cloudinary/index.js +42 -0
- package/lib/Cloudinary/interface.d.ts +43 -0
- package/lib/Cloudinary/interface.d.ts.map +1 -0
- package/lib/Cloudinary/interface.js +2 -0
- package/lib/Cloudinary/type.d.ts +2 -0
- package/lib/Cloudinary/type.d.ts.map +1 -0
- package/lib/Cloudinary/type.js +2 -0
- package/lib/Command-Line/NodeArtisanCommand.js +3 -3
- package/lib/Command-Line/PublishCommand.d.ts.map +1 -1
- package/lib/Command-Line/PublishCommand.js +143 -6
- package/lib/Command-Line/files/CloudinaryConfigStub.d.ts +3 -0
- package/lib/Command-Line/files/CloudinaryConfigStub.d.ts.map +1 -0
- package/lib/Command-Line/files/CloudinaryConfigStub.js +22 -0
- package/lib/Command-Line/files/Controller.d.ts.map +1 -1
- package/lib/Command-Line/files/Controller.js +53 -51
- package/lib/Command-Line/files/Request.d.ts.map +1 -1
- package/lib/Command-Line/files/Request.js +0 -1
- package/lib/Error/FileException/index.d.ts +4 -0
- package/lib/Error/FileException/index.d.ts.map +1 -0
- package/lib/Error/FileException/index.js +9 -0
- package/lib/Interface/index.d.ts +17 -1
- package/lib/Interface/index.d.ts.map +1 -1
- package/lib/Middleware/index.d.ts +1 -0
- package/lib/Middleware/index.d.ts.map +1 -1
- package/lib/Middleware/index.js +7 -2
- package/lib/Monitor/Collectors/MailCollector.d.ts.map +1 -1
- package/lib/Monitor/Collectors/MailCollector.js +0 -1
- package/lib/Request/FormRequest.d.ts +13 -6
- package/lib/Request/FormRequest.d.ts.map +1 -1
- package/lib/Request/FormRequest.js +18 -7
- package/lib/Request/request.d.ts +2 -1
- package/lib/Request/request.d.ts.map +1 -1
- package/lib/Request/request.js +19 -0
- package/lib/Type/index.js +1 -0
- package/lib/util/index.d.ts +1 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +31 -30
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
export { Authentication as Auth } from "./lib/Auth";
|
|
4
4
|
export { config } from "./lib/Config/Config";
|
|
5
|
+
export { SessionServiceProvider, SessionManager } from "./Core";
|
|
6
|
+
export type { SessionConfig } from "./lib/Interface";
|
|
5
7
|
export type {
|
|
6
8
|
AppRequest as Request,
|
|
7
9
|
AppResponse as Response,
|
|
8
10
|
AppNext as Next,
|
|
9
11
|
} from "./lib/Interface";
|
|
10
|
-
import { HttpContext as AppHttpContext } from "./lib/Interface";
|
|
11
12
|
export {
|
|
12
13
|
bcrypt,
|
|
13
14
|
verifyHash,
|
|
@@ -17,9 +18,7 @@ export {
|
|
|
17
18
|
assertProductionJwtSecret,
|
|
18
19
|
authSessionCookieOptions,
|
|
19
20
|
checkJwtAccessTokenPayload,
|
|
20
|
-
saveImage,
|
|
21
21
|
asyncHandler,
|
|
22
|
-
cloudinaryUpload,
|
|
23
22
|
rootPath,
|
|
24
23
|
} from "./lib/util";
|
|
25
24
|
export type { JwtAccessTokenPayloadResult } from "./lib/util";
|
|
@@ -57,5 +56,4 @@ export declare const auth: (
|
|
|
57
56
|
res: import("./lib/Interface").AppResponse,
|
|
58
57
|
next: import("./lib/Interface").AppNext,
|
|
59
58
|
) => Promise<void>;
|
|
60
|
-
export declare const httpContext: AppHttpContext;
|
|
61
59
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "index.d.ts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"../jcc-express-mvc/index.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAGA,OAAO,EAAE,cAAc,IAAI,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EACV,UAAU,IAAI,OAAO,EACrB,WAAW,IAAI,QAAQ,EACvB,OAAO,IAAI,IAAI,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,YAAY,EACZ,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,YAAY,EACZ,QAAQ,GACT,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,2FAA2F;AAC3F,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAE9E,eAAO,MAAM,KAAK,yIAAuB,CAAC;AAC1C,eAAO,MAAM,OAAO,gMAAyB,CAAC;AAC9C,eAAO,MAAM,IAAI,mJAAsB,CAAC"
|
|
10
|
+
}
|
package/index.js
CHANGED
|
@@ -1,43 +1,208 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/// <reference path="./global.d.ts" />
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.auth =
|
|
5
|
+
exports.apiAuth =
|
|
6
|
+
exports.guest =
|
|
7
|
+
exports.SocialiteOAuthUser =
|
|
8
|
+
exports.SlackProvider =
|
|
9
|
+
exports.TwitterProvider =
|
|
10
|
+
exports.GitLabProvider =
|
|
11
|
+
exports.FacebookProvider =
|
|
12
|
+
exports.GitHubProvider =
|
|
13
|
+
exports.GoogleProvider =
|
|
14
|
+
exports.resolveSocialiteConfig =
|
|
15
|
+
exports.SocialiteProvider =
|
|
16
|
+
exports.AbstractProvider =
|
|
17
|
+
exports.Socialite =
|
|
18
|
+
exports.registerRateLimit =
|
|
19
|
+
exports.loginRateLimit =
|
|
20
|
+
exports.rootPath =
|
|
21
|
+
exports.asyncHandler =
|
|
22
|
+
exports.checkJwtAccessTokenPayload =
|
|
23
|
+
exports.authSessionCookieOptions =
|
|
24
|
+
exports.assertProductionJwtSecret =
|
|
25
|
+
exports.jwtTokenType =
|
|
26
|
+
exports.jwtVerify =
|
|
27
|
+
exports.jwtSign =
|
|
28
|
+
exports.verifyHash =
|
|
29
|
+
exports.bcrypt =
|
|
30
|
+
exports.SessionManager =
|
|
31
|
+
exports.SessionServiceProvider =
|
|
32
|
+
exports.config =
|
|
33
|
+
exports.Auth =
|
|
34
|
+
void 0;
|
|
5
35
|
const AuthMiddleware_1 = require("./lib/Auth/AuthMiddleware");
|
|
6
36
|
var Auth_1 = require("./lib/Auth");
|
|
7
|
-
Object.defineProperty(exports, "Auth", {
|
|
37
|
+
Object.defineProperty(exports, "Auth", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return Auth_1.Authentication;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
8
43
|
var Config_1 = require("./lib/Config/Config");
|
|
9
|
-
Object.defineProperty(exports, "config", {
|
|
44
|
+
Object.defineProperty(exports, "config", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return Config_1.config;
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
var Core_1 = require("./Core");
|
|
51
|
+
Object.defineProperty(exports, "SessionServiceProvider", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return Core_1.SessionServiceProvider;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "SessionManager", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () {
|
|
60
|
+
return Core_1.SessionManager;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
10
63
|
var util_1 = require("./lib/util");
|
|
11
|
-
Object.defineProperty(exports, "bcrypt", {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
64
|
+
Object.defineProperty(exports, "bcrypt", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return util_1.bcrypt;
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "verifyHash", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () {
|
|
73
|
+
return util_1.verifyHash;
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "jwtSign", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return util_1.jwtSign;
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "jwtVerify", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return util_1.jwtVerify;
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "jwtTokenType", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () {
|
|
91
|
+
return util_1.jwtTokenType;
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "assertProductionJwtSecret", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () {
|
|
97
|
+
return util_1.assertProductionJwtSecret;
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(exports, "authSessionCookieOptions", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () {
|
|
103
|
+
return util_1.authSessionCookieOptions;
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "checkJwtAccessTokenPayload", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () {
|
|
109
|
+
return util_1.checkJwtAccessTokenPayload;
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(exports, "asyncHandler", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function () {
|
|
115
|
+
return util_1.asyncHandler;
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "rootPath", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return util_1.rootPath;
|
|
122
|
+
},
|
|
123
|
+
});
|
|
23
124
|
var loginRateLimit_1 = require("./lib/Auth/loginRateLimit");
|
|
24
|
-
Object.defineProperty(exports, "loginRateLimit", {
|
|
25
|
-
|
|
125
|
+
Object.defineProperty(exports, "loginRateLimit", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: function () {
|
|
128
|
+
return loginRateLimit_1.loginRateLimit;
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(exports, "registerRateLimit", {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return loginRateLimit_1.registerRateLimit;
|
|
135
|
+
},
|
|
136
|
+
});
|
|
26
137
|
var Socialite_1 = require("./lib/Socialite");
|
|
27
|
-
Object.defineProperty(exports, "Socialite", {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
138
|
+
Object.defineProperty(exports, "Socialite", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return Socialite_1.Socialite;
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "AbstractProvider", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return Socialite_1.AbstractProvider;
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "SocialiteProvider", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return Socialite_1.SocialiteProvider;
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "resolveSocialiteConfig", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return Socialite_1.resolveSocialiteConfig;
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "GoogleProvider", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return Socialite_1.GoogleProvider;
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "GitHubProvider", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return Socialite_1.GitHubProvider;
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "FacebookProvider", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return Socialite_1.FacebookProvider;
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "GitLabProvider", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return Socialite_1.GitLabProvider;
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "TwitterProvider", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return Socialite_1.TwitterProvider;
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "SlackProvider", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return Socialite_1.SlackProvider;
|
|
196
|
+
},
|
|
197
|
+
});
|
|
37
198
|
/** Laravel Socialite-style OAuth user profile (class with getters + `toPlainObject()`). */
|
|
38
199
|
var SocialUser_1 = require("./lib/Socialite/SocialUser");
|
|
39
|
-
Object.defineProperty(exports, "SocialiteOAuthUser", {
|
|
200
|
+
Object.defineProperty(exports, "SocialiteOAuthUser", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function () {
|
|
203
|
+
return SocialUser_1.SocialUser;
|
|
204
|
+
},
|
|
205
|
+
});
|
|
40
206
|
exports.guest = AuthMiddleware_1.authMiddleware.guest;
|
|
41
207
|
exports.apiAuth = AuthMiddleware_1.authMiddleware.apiAuth;
|
|
42
208
|
exports.auth = AuthMiddleware_1.authMiddleware.auth;
|
|
43
|
-
exports.httpContext = {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Application } from "./Application";
|
|
2
2
|
import { ServiceProvider } from "../Providers/ServiceProvider";
|
|
3
3
|
import { RouteConfig } from "../Interface";
|
|
4
|
+
import { RequestHandler } from "express";
|
|
4
5
|
export declare class ApplicationBuilder {
|
|
5
6
|
app: Application;
|
|
6
7
|
constructor(app: Application);
|
|
@@ -11,7 +12,7 @@ export declare class ApplicationBuilder {
|
|
|
11
12
|
private withEvents;
|
|
12
13
|
private withBroadcasting;
|
|
13
14
|
withConsole(): this;
|
|
14
|
-
withMiddleware(): this;
|
|
15
|
+
withMiddleware(beforeAppMiddlewares?: RequestHandler[]): this;
|
|
15
16
|
create(): Application;
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=ApplicationBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationBuilder.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Application/ApplicationBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationBuilder.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Application/ApplicationBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAU3C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,kBAAkB;IACtB,GAAG,EAAE,WAAW,CAAC;gBAEZ,GAAG,EAAE,WAAW;IAIrB,UAAU,CAAC,MAAM,EAAE,GAAG;IAKtB,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMtC,WAAW,CAAC,WAAW,EAAE,WAAW,EAAE;IAOtC,aAAa,CAClB,SAAS,EAAE,KAAK,CAAC,KAAK,GAAG,EAAE,WAAW,KAAK,eAAe,CAAC;IA2B7D,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,gBAAgB;IAIjB,WAAW;IAKX,cAAc,CAAC,oBAAoB,GAAE,cAAc,EAAO;IAY1D,MAAM;CAKd"}
|
|
@@ -61,10 +61,11 @@ class ApplicationBuilder {
|
|
|
61
61
|
this.app.bind("ConsoleKernel", NodeArtisanCommand_1.ConsoleKernel);
|
|
62
62
|
return this;
|
|
63
63
|
}
|
|
64
|
-
withMiddleware() {
|
|
64
|
+
withMiddleware(beforeAppMiddlewares = []) {
|
|
65
65
|
//
|
|
66
66
|
const kernel = this.app.resolve("HttpKernel");
|
|
67
67
|
const middleware = new Middleware_1.Middleware(this.app);
|
|
68
|
+
middleware.runBeforeExpressMiddleware(beforeAppMiddlewares);
|
|
68
69
|
middleware.loadStaticFiles();
|
|
69
70
|
middleware.use(kernel.middlewares);
|
|
70
71
|
return this;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudinaryServiceProvider.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cloudinary/CloudinaryServiceProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,qBAAa,yBAA0B,SAAQ,eAAe;IAE5D,QAAQ,IAAI,IAAI;CAQjB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloudinaryServiceProvider = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const ServiceProvider_1 = require("../Providers/ServiceProvider");
|
|
6
|
+
class CloudinaryServiceProvider extends ServiceProvider_1.ServiceProvider {
|
|
7
|
+
//
|
|
8
|
+
register() {
|
|
9
|
+
//
|
|
10
|
+
const config = this.app.config.cloudinary;
|
|
11
|
+
if (!config) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.app.singleton(_1.Cloudinary.name, () => new _1.Cloudinary(config));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CloudinaryServiceProvider = CloudinaryServiceProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UploadApiOptions, UploadApiResponse } from "cloudinary";
|
|
2
|
+
import { CloudinaryConfig, CloudinaryImageOptions } from "./interface";
|
|
3
|
+
export declare class Cloudinary {
|
|
4
|
+
constructor(config: CloudinaryConfig);
|
|
5
|
+
/**
|
|
6
|
+
* Upload file to Cloudinary
|
|
7
|
+
*/
|
|
8
|
+
upload(path: string, option?: UploadApiOptions): Promise<UploadApiResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Returns ONLY the URL (no HTML)
|
|
11
|
+
*/
|
|
12
|
+
url(publicId: string, options?: CloudinaryImageOptions): string;
|
|
13
|
+
/**
|
|
14
|
+
* Returns HTML <img> tag
|
|
15
|
+
*/
|
|
16
|
+
image(publicId: string, options?: CloudinaryImageOptions): string;
|
|
17
|
+
videoUrl(publicId: string, options?: CloudinaryImageOptions): string;
|
|
18
|
+
video(publicId: string, options?: any): string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cloudinary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEvE,qBAAa,UAAU;gBACT,MAAM,EAAE,gBAAgB;IASpC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI3E;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAI/D;;OAEG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAIjE,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAOpE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,MAAM;CAG/C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Cloudinary = void 0;
|
|
4
|
+
const cloudinary_1 = require("cloudinary");
|
|
5
|
+
class Cloudinary {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
cloudinary_1.v2.config({
|
|
8
|
+
cloud_name: config.cloud_name,
|
|
9
|
+
api_key: config.api_key,
|
|
10
|
+
api_secret: config.api_secret,
|
|
11
|
+
secure: true,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Upload file to Cloudinary
|
|
16
|
+
*/
|
|
17
|
+
upload(path, option) {
|
|
18
|
+
return cloudinary_1.v2.uploader.upload(path, option);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns ONLY the URL (no HTML)
|
|
22
|
+
*/
|
|
23
|
+
url(publicId, options) {
|
|
24
|
+
return cloudinary_1.v2.url(publicId, options);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns HTML <img> tag
|
|
28
|
+
*/
|
|
29
|
+
image(publicId, options) {
|
|
30
|
+
return cloudinary_1.v2.image(publicId, options);
|
|
31
|
+
}
|
|
32
|
+
videoUrl(publicId, options) {
|
|
33
|
+
return cloudinary_1.v2.url(publicId, {
|
|
34
|
+
resource_type: "video",
|
|
35
|
+
...options,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
video(publicId, options) {
|
|
39
|
+
return cloudinary_1.v2.video(publicId, options);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.Cloudinary = Cloudinary;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CropType } from "./type";
|
|
2
|
+
export interface Transformation {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
crop?: CropType;
|
|
6
|
+
gravity?: string;
|
|
7
|
+
quality?: string | number;
|
|
8
|
+
format?: string;
|
|
9
|
+
radius?: number | string;
|
|
10
|
+
effect?: string;
|
|
11
|
+
dpr?: number | string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface ImageTagAttributes {
|
|
15
|
+
alt?: string;
|
|
16
|
+
class?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
loading?: "lazy" | "eager";
|
|
19
|
+
title?: string;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
export interface CloudinaryConfigOverrides {
|
|
23
|
+
cloud_name?: string;
|
|
24
|
+
secure?: boolean;
|
|
25
|
+
version?: string | number;
|
|
26
|
+
}
|
|
27
|
+
export interface CloudinaryImageOptions extends Transformation, CloudinaryConfigOverrides, ImageTagAttributes {
|
|
28
|
+
/**
|
|
29
|
+
* Full transformation object (preferred modern way)
|
|
30
|
+
*/
|
|
31
|
+
transformation?: Transformation | Transformation[];
|
|
32
|
+
/**
|
|
33
|
+
* Raw transformation string (advanced usage)
|
|
34
|
+
*/
|
|
35
|
+
raw_transformation?: string;
|
|
36
|
+
}
|
|
37
|
+
export type CloudinaryConfig = {
|
|
38
|
+
cloud_name: string;
|
|
39
|
+
api_key: string;
|
|
40
|
+
api_secret: string;
|
|
41
|
+
secure: boolean;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cloudinary/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBACf,SAAQ,cAAc,EAAE,yBAAyB,EAAE,kBAAkB;IACrE;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;IAEnD;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cloudinary/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,GACP,OAAO,CAAC"}
|
|
@@ -229,8 +229,8 @@ class ConsoleKernel {
|
|
|
229
229
|
// ─── publish ────────────────────────────────────────────────────────
|
|
230
230
|
this.defineCommand("publish")
|
|
231
231
|
.description("Publish a framework component (config, providers, routes). " +
|
|
232
|
-
"
|
|
233
|
-
"e.g. `publish Monitor react`.")
|
|
232
|
+
"Tags: Monitor (optional view: jsblade, react, vue), Cloudinary — " +
|
|
233
|
+
"e.g. `publish Monitor react` or `publish Cloudinary`.")
|
|
234
234
|
.action(this.runAction((firstArg, secondArg, thirdArg) => {
|
|
235
235
|
// Support both `publish Monitor` and `publish=Monitor` shorthand
|
|
236
236
|
// (in which case commander gives us "publish=Monitor" as the cmd
|
|
@@ -323,7 +323,7 @@ class ConsoleKernel {
|
|
|
323
323
|
console.log(section("🌐 Inertia Commands:"));
|
|
324
324
|
console.log(line("inertia:start-ssr", "Start the Inertia.js SSR server\n"));
|
|
325
325
|
console.log(section("📦 Publish Commands:"));
|
|
326
|
-
console.log(line("publish [tag] [view] [force=true]", "Publish a framework component (e.g. publish Monitor)"));
|
|
326
|
+
console.log(line("publish [tag] [view] [force=true]", "Publish a framework component (e.g. publish Monitor, publish Cloudinary)"));
|
|
327
327
|
console.log(line("", "Monitor views: jsblade (default), react, vue — e.g. publish Monitor vue\n"));
|
|
328
328
|
if (this.customCommands.length > 0) {
|
|
329
329
|
console.log(section("ℹ️ Custom:"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublishCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/PublishCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PublishCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/PublishCommand.ts"],"names":[],"mappings":"AAgIA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,sCAAuC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,eAAO,MAAM,oBAAoB,EAAE,WAAuB,CAAC;AAa3D,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG;IACtD,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAMA;AAkTD,qBAAa,cAAc;IACb,OAAO,CAAC,IAAI;gBAAJ,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO;IAEjE,MAAM,CAAC,aAAa,IAAI,MAAM,EAAE;IAIhC,IAAI,IAAI,IAAI;IAsBZ,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IA2E1B,OAAO,CAAC,QAAQ;IAehB,OAAO,CAAC,WAAW;IA8BnB,OAAO,CAAC,WAAW;CAkBpB"}
|