dn-react-router-toolkit 0.2.7 → 0.3.1
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/api/create_handler.d.mts +13 -0
- package/dist/api/create_handler.d.ts +13 -0
- package/dist/api/create_handler.js +276 -0
- package/dist/api/create_handler.mjs +282 -0
- package/dist/api/index.d.mts +4 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +276 -0
- package/dist/api/index.mjs +282 -0
- package/dist/auth/client/index.d.mts +3 -0
- package/dist/auth/client/index.d.ts +3 -0
- package/dist/{date.js → auth/client/index.js} +25 -32
- package/dist/auth/client/index.mjs +21 -0
- package/dist/auth/client/redirect_page.d.mts +1 -0
- package/dist/auth/client/redirect_page.d.ts +1 -0
- package/dist/auth/index.d.mts +4 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.js +116 -0
- package/dist/auth/index.mjs +89 -0
- package/dist/auth/server/index.d.mts +1 -0
- package/dist/auth/server/index.d.ts +1 -0
- package/dist/{slug.js → auth/server/index.js} +6 -14
- package/dist/auth/server/index.mjs +2 -0
- package/dist/auth/with_auth.d.mts +2 -6
- package/dist/auth/with_auth.d.ts +2 -6
- package/dist/auth/with_auth.js +3 -0
- package/dist/auth/with_auth.mjs +3 -0
- package/dist/{components → client}/client_env.d.mts +1 -1
- package/dist/{components → client}/client_env.d.ts +1 -1
- package/dist/{components → client}/client_env.js +6 -2
- package/dist/{components → client}/client_env.mjs +2 -2
- package/dist/client/index.d.mts +3 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/{auth/client/google_login_button.js → client/index.js} +30 -33
- package/dist/client/index.mjs +31 -0
- package/dist/client/use_user_agent.d.mts +8 -0
- package/dist/client/use_user_agent.d.ts +8 -0
- package/dist/{file/client/format_size.js → client/use_user_agent.js} +14 -14
- package/dist/client/use_user_agent.mjs +13 -0
- package/dist/file/client/index.d.mts +1 -0
- package/dist/file/client/index.d.ts +1 -0
- package/dist/file/{cdn.js → client/index.js} +6 -16
- package/dist/file/client/index.mjs +2 -0
- package/dist/file/index.d.mts +1 -0
- package/dist/file/index.d.ts +1 -0
- package/dist/{cn.js → file/index.js} +6 -14
- package/dist/file/index.mjs +2 -0
- package/dist/file/server/index.d.mts +1 -0
- package/dist/file/server/index.d.ts +1 -0
- package/dist/file/server/index.js +24 -0
- package/dist/file/server/index.mjs +2 -0
- package/dist/http/index.d.mts +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.js +3 -90
- package/dist/http/index.mjs +2 -68
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +3 -79
- package/dist/index.mjs +2 -58
- package/dist/modal/index.d.mts +1 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/{sleep.js → modal/index.js} +6 -14
- package/dist/modal/index.mjs +2 -0
- package/dist/seo/index.d.mts +4 -0
- package/dist/seo/index.d.ts +4 -0
- package/dist/seo/index.js +304 -0
- package/dist/seo/index.mjs +267 -0
- package/dist/text_editor/index.d.mts +1 -0
- package/dist/text_editor/index.d.ts +1 -0
- package/dist/text_editor/index.js +24 -0
- package/dist/text_editor/index.mjs +2 -0
- package/package.json +58 -32
- package/dist/auth/apple_auth.d.mts +0 -38
- package/dist/auth/apple_auth.d.ts +0 -38
- package/dist/auth/apple_auth.js +0 -88
- package/dist/auth/apple_auth.mjs +0 -63
- package/dist/auth/auth_repository.d.mts +0 -41
- package/dist/auth/auth_repository.d.ts +0 -41
- package/dist/auth/auth_repository.js +0 -18
- package/dist/auth/auth_repository.mjs +0 -0
- package/dist/auth/auth_service.d.mts +0 -63
- package/dist/auth/auth_service.d.ts +0 -63
- package/dist/auth/auth_service.js +0 -210
- package/dist/auth/auth_service.mjs +0 -171
- package/dist/auth/client/google_login_button.d.mts +0 -7
- package/dist/auth/client/google_login_button.d.ts +0 -7
- package/dist/auth/client/google_login_button.mjs +0 -37
- package/dist/auth/client/provider.d.mts +0 -24
- package/dist/auth/client/provider.d.ts +0 -24
- package/dist/auth/client/provider.js +0 -154
- package/dist/auth/client/provider.mjs +0 -118
- package/dist/auth/google_auth.d.mts +0 -33
- package/dist/auth/google_auth.d.ts +0 -33
- package/dist/auth/google_auth.js +0 -135
- package/dist/auth/google_auth.mjs +0 -108
- package/dist/auth/handlers/find_auth.d.mts +0 -13
- package/dist/auth/handlers/find_auth.d.ts +0 -13
- package/dist/auth/handlers/find_auth.js +0 -82
- package/dist/auth/handlers/find_auth.mjs +0 -55
- package/dist/auth/handlers/login.d.mts +0 -13
- package/dist/auth/handlers/login.d.ts +0 -13
- package/dist/auth/handlers/login.js +0 -107
- package/dist/auth/handlers/login.mjs +0 -80
- package/dist/auth/handlers/login_with_thirdparty.d.mts +0 -15
- package/dist/auth/handlers/login_with_thirdparty.d.ts +0 -15
- package/dist/auth/handlers/login_with_thirdparty.js +0 -98
- package/dist/auth/handlers/login_with_thirdparty.mjs +0 -71
- package/dist/auth/handlers/logout.d.mts +0 -13
- package/dist/auth/handlers/logout.d.ts +0 -13
- package/dist/auth/handlers/logout.js +0 -102
- package/dist/auth/handlers/logout.mjs +0 -75
- package/dist/auth/handlers/refresh.d.mts +0 -13
- package/dist/auth/handlers/refresh.d.ts +0 -13
- package/dist/auth/handlers/refresh.js +0 -92
- package/dist/auth/handlers/refresh.mjs +0 -65
- package/dist/auth/handlers/request_password_reset.d.mts +0 -10
- package/dist/auth/handlers/request_password_reset.d.ts +0 -10
- package/dist/auth/handlers/request_password_reset.js +0 -87
- package/dist/auth/handlers/request_password_reset.mjs +0 -60
- package/dist/auth/handlers/reset_password.d.mts +0 -10
- package/dist/auth/handlers/reset_password.d.ts +0 -10
- package/dist/auth/handlers/reset_password.js +0 -88
- package/dist/auth/handlers/reset_password.mjs +0 -61
- package/dist/auth/handlers/signup.d.mts +0 -15
- package/dist/auth/handlers/signup.d.ts +0 -15
- package/dist/auth/handlers/signup.js +0 -147
- package/dist/auth/handlers/signup.mjs +0 -112
- package/dist/auth/handlers/signup_with_thirdparty.d.mts +0 -17
- package/dist/auth/handlers/signup_with_thirdparty.d.ts +0 -17
- package/dist/auth/handlers/signup_with_thirdparty.js +0 -123
- package/dist/auth/handlers/signup_with_thirdparty.mjs +0 -98
- package/dist/auth/handlers/thirdparty_auth_callback.d.mts +0 -16
- package/dist/auth/handlers/thirdparty_auth_callback.d.ts +0 -16
- package/dist/auth/handlers/thirdparty_auth_callback.js +0 -129
- package/dist/auth/handlers/thirdparty_auth_callback.mjs +0 -102
- package/dist/auth/jwt_manager.d.mts +0 -38
- package/dist/auth/jwt_manager.d.ts +0 -38
- package/dist/auth/jwt_manager.js +0 -90
- package/dist/auth/jwt_manager.mjs +0 -65
- package/dist/auth/kakao_auth.d.mts +0 -27
- package/dist/auth/kakao_auth.d.ts +0 -27
- package/dist/auth/kakao_auth.js +0 -56
- package/dist/auth/kakao_auth.mjs +0 -31
- package/dist/auth/password_recovery.d.mts +0 -34
- package/dist/auth/password_recovery.d.ts +0 -34
- package/dist/auth/password_recovery.js +0 -169
- package/dist/auth/password_recovery.mjs +0 -134
- package/dist/auth/thirdparty_auth.d.mts +0 -41
- package/dist/auth/thirdparty_auth.d.ts +0 -41
- package/dist/auth/thirdparty_auth.js +0 -113
- package/dist/auth/thirdparty_auth.mjs +0 -86
- package/dist/cn.d.mts +0 -3
- package/dist/cn.d.ts +0 -3
- package/dist/cn.mjs +0 -7
- package/dist/components/index.d.mts +0 -5
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.js +0 -261
- package/dist/components/index.mjs +0 -219
- package/dist/components/modal/fullscreen_container.d.mts +0 -7
- package/dist/components/modal/fullscreen_container.d.ts +0 -7
- package/dist/components/modal/fullscreen_container.js +0 -102
- package/dist/components/modal/fullscreen_container.mjs +0 -68
- package/dist/components/modal/hooks.d.mts +0 -18
- package/dist/components/modal/hooks.d.ts +0 -18
- package/dist/components/modal/hooks.js +0 -236
- package/dist/components/modal/hooks.mjs +0 -204
- package/dist/components/modal/index.d.mts +0 -4
- package/dist/components/modal/index.d.ts +0 -4
- package/dist/components/modal/index.js +0 -238
- package/dist/components/modal/index.mjs +0 -203
- package/dist/components/modal/modal.d.mts +0 -13
- package/dist/components/modal/modal.d.ts +0 -13
- package/dist/components/modal/modal.js +0 -155
- package/dist/components/modal/modal.mjs +0 -130
- package/dist/components/styles.d.mts +0 -9
- package/dist/components/styles.d.ts +0 -9
- package/dist/components/styles.js +0 -48
- package/dist/components/styles.mjs +0 -17
- package/dist/date.d.mts +0 -5
- package/dist/date.d.ts +0 -5
- package/dist/date.mjs +0 -29
- package/dist/file/cdn.d.mts +0 -6
- package/dist/file/cdn.d.ts +0 -6
- package/dist/file/cdn.mjs +0 -9
- package/dist/file/client/drop_file_input.d.mts +0 -36
- package/dist/file/client/drop_file_input.d.ts +0 -36
- package/dist/file/client/drop_file_input.js +0 -323
- package/dist/file/client/drop_file_input.mjs +0 -294
- package/dist/file/client/file_upload_button.d.mts +0 -10
- package/dist/file/client/file_upload_button.d.ts +0 -10
- package/dist/file/client/file_upload_button.js +0 -89
- package/dist/file/client/file_upload_button.mjs +0 -58
- package/dist/file/client/file_uploader.d.mts +0 -13
- package/dist/file/client/file_uploader.d.ts +0 -13
- package/dist/file/client/file_uploader.js +0 -163
- package/dist/file/client/file_uploader.mjs +0 -136
- package/dist/file/client/format_size.d.mts +0 -3
- package/dist/file/client/format_size.d.ts +0 -3
- package/dist/file/client/format_size.mjs +0 -13
- package/dist/file/client/metadata.d.mts +0 -7
- package/dist/file/client/metadata.d.ts +0 -7
- package/dist/file/client/metadata.js +0 -85
- package/dist/file/client/metadata.mjs +0 -60
- package/dist/file/file_repository.d.mts +0 -16
- package/dist/file/file_repository.d.ts +0 -16
- package/dist/file/file_repository.js +0 -18
- package/dist/file/file_repository.mjs +0 -0
- package/dist/file/file_service.d.mts +0 -32
- package/dist/file/file_service.d.ts +0 -32
- package/dist/file/file_service.js +0 -66
- package/dist/file/file_service.mjs +0 -41
- package/dist/file/handlers/delete_file.d.mts +0 -17
- package/dist/file/handlers/delete_file.d.ts +0 -17
- package/dist/file/handlers/delete_file.js +0 -99
- package/dist/file/handlers/delete_file.mjs +0 -72
- package/dist/file/handlers/upload_file.d.mts +0 -16
- package/dist/file/handlers/upload_file.d.ts +0 -16
- package/dist/file/handlers/upload_file.js +0 -106
- package/dist/file/handlers/upload_file.mjs +0 -79
- package/dist/file/object_storage.d.mts +0 -20
- package/dist/file/object_storage.d.ts +0 -20
- package/dist/file/object_storage.js +0 -90
- package/dist/file/object_storage.mjs +0 -70
- package/dist/file/responsive_image.d.mts +0 -20
- package/dist/file/responsive_image.d.ts +0 -20
- package/dist/file/responsive_image.js +0 -132
- package/dist/file/responsive_image.mjs +0 -96
- package/dist/http/response.d.mts +0 -19
- package/dist/http/response.d.ts +0 -19
- package/dist/http/response.js +0 -109
- package/dist/http/response.mjs +0 -68
- package/dist/route/api.d.mts +0 -21
- package/dist/route/api.d.ts +0 -21
- package/dist/route/api.js +0 -584
- package/dist/route/api.mjs +0 -547
- package/dist/singleton.d.mts +0 -3
- package/dist/singleton.d.ts +0 -3
- package/dist/singleton.js +0 -37
- package/dist/singleton.mjs +0 -12
- package/dist/sleep.d.mts +0 -3
- package/dist/sleep.d.ts +0 -3
- package/dist/sleep.mjs +0 -7
- package/dist/slug.d.mts +0 -3
- package/dist/slug.d.ts +0 -3
- package/dist/slug.mjs +0 -7
- package/dist/text_editor/attach_media.d.mts +0 -16
- package/dist/text_editor/attach_media.d.ts +0 -16
- package/dist/text_editor/attach_media.js +0 -237
- package/dist/text_editor/attach_media.mjs +0 -210
- package/dist/text_editor/plugins/drag_and_drop.d.mts +0 -13
- package/dist/text_editor/plugins/drag_and_drop.d.ts +0 -13
- package/dist/text_editor/plugins/drag_and_drop.js +0 -59
- package/dist/text_editor/plugins/drag_and_drop.mjs +0 -34
- package/dist/text_editor/plugins/keymap.d.mts +0 -5
- package/dist/text_editor/plugins/keymap.d.ts +0 -5
- package/dist/text_editor/plugins/keymap.js +0 -40
- package/dist/text_editor/plugins/keymap.mjs +0 -15
- package/dist/text_editor/plugins/placehoder.d.mts +0 -5
- package/dist/text_editor/plugins/placehoder.d.ts +0 -5
- package/dist/text_editor/plugins/placehoder.js +0 -112
- package/dist/text_editor/plugins/placehoder.mjs +0 -87
- package/dist/text_editor/plugins/trailing_paragraph.d.mts +0 -5
- package/dist/text_editor/plugins/trailing_paragraph.d.ts +0 -5
- package/dist/text_editor/plugins/trailing_paragraph.js +0 -46
- package/dist/text_editor/plugins/trailing_paragraph.mjs +0 -21
- package/dist/text_editor/plugins/upload_placeholder.d.mts +0 -7
- package/dist/text_editor/plugins/upload_placeholder.d.ts +0 -7
- package/dist/text_editor/plugins/upload_placeholder.js +0 -94
- package/dist/text_editor/plugins/upload_placeholder.mjs +0 -68
- package/dist/text_editor/schema.d.mts +0 -9
- package/dist/text_editor/schema.d.ts +0 -9
- package/dist/text_editor/schema.js +0 -354
- package/dist/text_editor/schema.mjs +0 -319
- package/dist/text_editor/text_editor.d.mts +0 -45
- package/dist/text_editor/text_editor.d.ts +0 -45
- package/dist/text_editor/text_editor.js +0 -834
- package/dist/text_editor/text_editor.mjs +0 -806
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dn-react-router-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,40 +10,65 @@
|
|
|
10
10
|
"import": "./dist/index.mjs",
|
|
11
11
|
"require": "./dist/index.js"
|
|
12
12
|
},
|
|
13
|
-
"./auth
|
|
14
|
-
"types": "./dist/auth
|
|
15
|
-
"import": "./dist/auth
|
|
16
|
-
"require": "./dist/auth
|
|
13
|
+
"./auth": {
|
|
14
|
+
"types": "./dist/auth/index.d.ts",
|
|
15
|
+
"import": "./dist/auth/index.mjs",
|
|
16
|
+
"require": "./dist/auth/index.js"
|
|
17
17
|
},
|
|
18
|
-
"./
|
|
19
|
-
"types": "./dist/
|
|
20
|
-
"import": "./dist/
|
|
21
|
-
"require": "./dist/
|
|
18
|
+
"./auth/server": {
|
|
19
|
+
"types": "./dist/auth/server/index.d.ts",
|
|
20
|
+
"import": "./dist/auth/server/index.mjs",
|
|
21
|
+
"require": "./dist/auth/server/index.js"
|
|
22
22
|
},
|
|
23
|
-
"./
|
|
24
|
-
"types": "./dist/
|
|
25
|
-
"import": "./dist/
|
|
26
|
-
"require": "./dist/
|
|
23
|
+
"./auth/client": {
|
|
24
|
+
"types": "./dist/auth/client/index.d.ts",
|
|
25
|
+
"import": "./dist/auth/client/index.mjs",
|
|
26
|
+
"require": "./dist/auth/client/index.js"
|
|
27
27
|
},
|
|
28
|
-
"./
|
|
29
|
-
"types": "./dist/
|
|
30
|
-
"import": "./dist/
|
|
31
|
-
"require": "./dist/
|
|
28
|
+
"./file": {
|
|
29
|
+
"types": "./dist/file/index.d.ts",
|
|
30
|
+
"import": "./dist/file/index.mjs",
|
|
31
|
+
"require": "./dist/file/index.js"
|
|
32
32
|
},
|
|
33
|
-
"./
|
|
34
|
-
"types": "./dist/
|
|
35
|
-
"import": "./dist/
|
|
36
|
-
"require": "./dist/
|
|
33
|
+
"./file/server": {
|
|
34
|
+
"types": "./dist/file/server/index.d.ts",
|
|
35
|
+
"import": "./dist/file/server/index.mjs",
|
|
36
|
+
"require": "./dist/file/server/index.js"
|
|
37
37
|
},
|
|
38
|
-
"./
|
|
39
|
-
"types": "./dist/
|
|
40
|
-
"import": "./dist/
|
|
41
|
-
"require": "./dist/
|
|
38
|
+
"./file/client": {
|
|
39
|
+
"types": "./dist/file/client/index.d.ts",
|
|
40
|
+
"import": "./dist/file/client/index.mjs",
|
|
41
|
+
"require": "./dist/file/client/index.js"
|
|
42
42
|
},
|
|
43
|
-
"./
|
|
44
|
-
"types": "./dist/
|
|
45
|
-
"import": "./dist/
|
|
46
|
-
"require": "./dist/
|
|
43
|
+
"./api": {
|
|
44
|
+
"types": "./dist/api/index.d.ts",
|
|
45
|
+
"import": "./dist/api/index.mjs",
|
|
46
|
+
"require": "./dist/api/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./client": {
|
|
49
|
+
"types": "./dist/client/index.d.ts",
|
|
50
|
+
"import": "./dist/client/index.mjs",
|
|
51
|
+
"require": "./dist/client/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./modal": {
|
|
54
|
+
"types": "./dist/modal/index.d.ts",
|
|
55
|
+
"import": "./dist/modal/index.mjs",
|
|
56
|
+
"require": "./dist/modal/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./http": {
|
|
59
|
+
"types": "./dist/http/index.d.ts",
|
|
60
|
+
"import": "./dist/http/index.mjs",
|
|
61
|
+
"require": "./dist/http/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./seo": {
|
|
64
|
+
"types": "./dist/seo/index.d.ts",
|
|
65
|
+
"import": "./dist/seo/index.mjs",
|
|
66
|
+
"require": "./dist/seo/index.js"
|
|
67
|
+
},
|
|
68
|
+
"./text_editor": {
|
|
69
|
+
"types": "./dist/text_editor/index.d.ts",
|
|
70
|
+
"import": "./dist/text_editor/index.mjs",
|
|
71
|
+
"require": "./dist/text_editor/index.js"
|
|
47
72
|
}
|
|
48
73
|
},
|
|
49
74
|
"scripts": {
|
|
@@ -75,18 +100,19 @@
|
|
|
75
100
|
"@aws-sdk/client-s3": "^3.940.0",
|
|
76
101
|
"@aws-sdk/s3-request-presigner": "^3.940.0",
|
|
77
102
|
"bcryptjs": "^3.0.3",
|
|
103
|
+
"dn-react-toolkit": "0.2.0",
|
|
78
104
|
"jose": "^6.1.2",
|
|
79
105
|
"moment-timezone": "^0.6.0",
|
|
80
106
|
"nodemailer": "^7.0.11",
|
|
81
|
-
"react-icons": "^5.5.0",
|
|
82
|
-
"uuid": "^13.0.0",
|
|
83
107
|
"prosemirror-commands": "^1.7.1",
|
|
84
108
|
"prosemirror-history": "^1.5.0",
|
|
85
109
|
"prosemirror-keymap": "^1.2.3",
|
|
86
110
|
"prosemirror-model": "^1.25.4",
|
|
87
111
|
"prosemirror-schema-list": "^1.5.1",
|
|
88
112
|
"prosemirror-state": "^1.4.4",
|
|
89
|
-
"prosemirror-view": "^1.41.3"
|
|
113
|
+
"prosemirror-view": "^1.41.3",
|
|
114
|
+
"react-icons": "^5.5.0",
|
|
115
|
+
"uuid": "^13.0.0"
|
|
90
116
|
},
|
|
91
117
|
"peerDependencies": {
|
|
92
118
|
"drizzle-orm": "^0.44",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ThirdpartyAuth, ThirdpartyAuthService } from './thirdparty_auth.mjs';
|
|
2
|
-
import './auth_service.mjs';
|
|
3
|
-
import 'jose';
|
|
4
|
-
import './jwt_manager.mjs';
|
|
5
|
-
import 'react-router';
|
|
6
|
-
import '../file/object_storage.mjs';
|
|
7
|
-
import '@aws-sdk/client-s3';
|
|
8
|
-
import './auth_repository.mjs';
|
|
9
|
-
|
|
10
|
-
declare class AppleAuth implements ThirdpartyAuth {
|
|
11
|
-
thirdpartyAuth: ThirdpartyAuthService;
|
|
12
|
-
appleAuthKey: string;
|
|
13
|
-
appleClientId: string;
|
|
14
|
-
appleTeamId: string;
|
|
15
|
-
appleKeyId: string;
|
|
16
|
-
appleServiceId: string;
|
|
17
|
-
constructor({ thirdpartyAuth, appleAuthKey, appleClientId, appleTeamId, appleKeyId, appleServiceId, }: {
|
|
18
|
-
thirdpartyAuth: ThirdpartyAuthService;
|
|
19
|
-
appleAuthKey: string;
|
|
20
|
-
appleClientId: string;
|
|
21
|
-
appleTeamId: string;
|
|
22
|
-
appleKeyId: string;
|
|
23
|
-
appleServiceId: string;
|
|
24
|
-
});
|
|
25
|
-
login(code: string, type?: "web" | "app"): Promise<{
|
|
26
|
-
user: {
|
|
27
|
-
id: string;
|
|
28
|
-
role: string;
|
|
29
|
-
name: string;
|
|
30
|
-
refreshToken: string | null;
|
|
31
|
-
};
|
|
32
|
-
accessToken: string;
|
|
33
|
-
refreshToken: string;
|
|
34
|
-
}>;
|
|
35
|
-
private generateAppleClientSecret;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { AppleAuth };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ThirdpartyAuth, ThirdpartyAuthService } from './thirdparty_auth.js';
|
|
2
|
-
import './auth_service.js';
|
|
3
|
-
import 'jose';
|
|
4
|
-
import './jwt_manager.js';
|
|
5
|
-
import 'react-router';
|
|
6
|
-
import '../file/object_storage.js';
|
|
7
|
-
import '@aws-sdk/client-s3';
|
|
8
|
-
import './auth_repository.js';
|
|
9
|
-
|
|
10
|
-
declare class AppleAuth implements ThirdpartyAuth {
|
|
11
|
-
thirdpartyAuth: ThirdpartyAuthService;
|
|
12
|
-
appleAuthKey: string;
|
|
13
|
-
appleClientId: string;
|
|
14
|
-
appleTeamId: string;
|
|
15
|
-
appleKeyId: string;
|
|
16
|
-
appleServiceId: string;
|
|
17
|
-
constructor({ thirdpartyAuth, appleAuthKey, appleClientId, appleTeamId, appleKeyId, appleServiceId, }: {
|
|
18
|
-
thirdpartyAuth: ThirdpartyAuthService;
|
|
19
|
-
appleAuthKey: string;
|
|
20
|
-
appleClientId: string;
|
|
21
|
-
appleTeamId: string;
|
|
22
|
-
appleKeyId: string;
|
|
23
|
-
appleServiceId: string;
|
|
24
|
-
});
|
|
25
|
-
login(code: string, type?: "web" | "app"): Promise<{
|
|
26
|
-
user: {
|
|
27
|
-
id: string;
|
|
28
|
-
role: string;
|
|
29
|
-
name: string;
|
|
30
|
-
refreshToken: string | null;
|
|
31
|
-
};
|
|
32
|
-
accessToken: string;
|
|
33
|
-
refreshToken: string;
|
|
34
|
-
}>;
|
|
35
|
-
private generateAppleClientSecret;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { AppleAuth };
|
package/dist/auth/apple_auth.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/auth/apple_auth.ts
|
|
21
|
-
var apple_auth_exports = {};
|
|
22
|
-
__export(apple_auth_exports, {
|
|
23
|
-
AppleAuth: () => AppleAuth
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(apple_auth_exports);
|
|
26
|
-
var import_jose = require("jose");
|
|
27
|
-
var AppleAuth = class {
|
|
28
|
-
thirdpartyAuth;
|
|
29
|
-
appleAuthKey;
|
|
30
|
-
appleClientId;
|
|
31
|
-
appleTeamId;
|
|
32
|
-
appleKeyId;
|
|
33
|
-
appleServiceId;
|
|
34
|
-
constructor({
|
|
35
|
-
thirdpartyAuth,
|
|
36
|
-
appleAuthKey,
|
|
37
|
-
appleClientId,
|
|
38
|
-
appleTeamId,
|
|
39
|
-
appleKeyId,
|
|
40
|
-
appleServiceId
|
|
41
|
-
}) {
|
|
42
|
-
this.thirdpartyAuth = thirdpartyAuth;
|
|
43
|
-
this.appleAuthKey = appleAuthKey;
|
|
44
|
-
this.appleClientId = appleClientId;
|
|
45
|
-
this.appleTeamId = appleTeamId;
|
|
46
|
-
this.appleKeyId = appleKeyId;
|
|
47
|
-
this.appleServiceId = appleServiceId;
|
|
48
|
-
}
|
|
49
|
-
async login(code, type = "web") {
|
|
50
|
-
const url = "https://appleid.apple.com/auth/token";
|
|
51
|
-
const client_secret = await this.generateAppleClientSecret(type);
|
|
52
|
-
const res = await fetch(url, {
|
|
53
|
-
method: "POST",
|
|
54
|
-
headers: {
|
|
55
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
56
|
-
},
|
|
57
|
-
body: new URLSearchParams({
|
|
58
|
-
client_id: type === "web" ? this.appleServiceId : this.appleClientId,
|
|
59
|
-
client_secret,
|
|
60
|
-
code,
|
|
61
|
-
grant_type: "authorization_code"
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
if (!res.ok) {
|
|
65
|
-
console.error(await res.text());
|
|
66
|
-
throw new Error("Apple \uC778\uC99D\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.");
|
|
67
|
-
}
|
|
68
|
-
const data = await res.json();
|
|
69
|
-
const { id_token } = data;
|
|
70
|
-
const appleAuth = (0, import_jose.decodeJwt)(id_token);
|
|
71
|
-
const { sub, email, name } = appleAuth;
|
|
72
|
-
const payload = {
|
|
73
|
-
id: sub,
|
|
74
|
-
email,
|
|
75
|
-
name
|
|
76
|
-
};
|
|
77
|
-
return this.thirdpartyAuth.issueTokensIfUserFound("apple", payload);
|
|
78
|
-
}
|
|
79
|
-
async generateAppleClientSecret(type = "web") {
|
|
80
|
-
const clientId = type === "web" ? this.appleServiceId : this.appleClientId;
|
|
81
|
-
const keyObject = await (0, import_jose.importPKCS8)(this.appleAuthKey, "ES256");
|
|
82
|
-
return new import_jose.SignJWT().setProtectedHeader({ alg: "ES256", kid: this.appleKeyId }).setIssuedAt().setIssuer(this.appleTeamId).setExpirationTime("1h").setAudience("https://appleid.apple.com").setSubject(clientId).sign(keyObject);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
-
0 && (module.exports = {
|
|
87
|
-
AppleAuth
|
|
88
|
-
});
|
package/dist/auth/apple_auth.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/auth/apple_auth.ts
|
|
2
|
-
import { decodeJwt, importPKCS8, SignJWT } from "jose";
|
|
3
|
-
var AppleAuth = class {
|
|
4
|
-
thirdpartyAuth;
|
|
5
|
-
appleAuthKey;
|
|
6
|
-
appleClientId;
|
|
7
|
-
appleTeamId;
|
|
8
|
-
appleKeyId;
|
|
9
|
-
appleServiceId;
|
|
10
|
-
constructor({
|
|
11
|
-
thirdpartyAuth,
|
|
12
|
-
appleAuthKey,
|
|
13
|
-
appleClientId,
|
|
14
|
-
appleTeamId,
|
|
15
|
-
appleKeyId,
|
|
16
|
-
appleServiceId
|
|
17
|
-
}) {
|
|
18
|
-
this.thirdpartyAuth = thirdpartyAuth;
|
|
19
|
-
this.appleAuthKey = appleAuthKey;
|
|
20
|
-
this.appleClientId = appleClientId;
|
|
21
|
-
this.appleTeamId = appleTeamId;
|
|
22
|
-
this.appleKeyId = appleKeyId;
|
|
23
|
-
this.appleServiceId = appleServiceId;
|
|
24
|
-
}
|
|
25
|
-
async login(code, type = "web") {
|
|
26
|
-
const url = "https://appleid.apple.com/auth/token";
|
|
27
|
-
const client_secret = await this.generateAppleClientSecret(type);
|
|
28
|
-
const res = await fetch(url, {
|
|
29
|
-
method: "POST",
|
|
30
|
-
headers: {
|
|
31
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
32
|
-
},
|
|
33
|
-
body: new URLSearchParams({
|
|
34
|
-
client_id: type === "web" ? this.appleServiceId : this.appleClientId,
|
|
35
|
-
client_secret,
|
|
36
|
-
code,
|
|
37
|
-
grant_type: "authorization_code"
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
if (!res.ok) {
|
|
41
|
-
console.error(await res.text());
|
|
42
|
-
throw new Error("Apple \uC778\uC99D\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4.");
|
|
43
|
-
}
|
|
44
|
-
const data = await res.json();
|
|
45
|
-
const { id_token } = data;
|
|
46
|
-
const appleAuth = decodeJwt(id_token);
|
|
47
|
-
const { sub, email, name } = appleAuth;
|
|
48
|
-
const payload = {
|
|
49
|
-
id: sub,
|
|
50
|
-
email,
|
|
51
|
-
name
|
|
52
|
-
};
|
|
53
|
-
return this.thirdpartyAuth.issueTokensIfUserFound("apple", payload);
|
|
54
|
-
}
|
|
55
|
-
async generateAppleClientSecret(type = "web") {
|
|
56
|
-
const clientId = type === "web" ? this.appleServiceId : this.appleClientId;
|
|
57
|
-
const keyObject = await importPKCS8(this.appleAuthKey, "ES256");
|
|
58
|
-
return new SignJWT().setProtectedHeader({ alg: "ES256", kid: this.appleKeyId }).setIssuedAt().setIssuer(this.appleTeamId).setExpirationTime("1h").setAudience("https://appleid.apple.com").setSubject(clientId).sign(keyObject);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
export {
|
|
62
|
-
AppleAuth
|
|
63
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
interface AuthRepository<TFile = unknown> {
|
|
2
|
-
findCredentialById(id: string): Promise<{
|
|
3
|
-
id: string;
|
|
4
|
-
password: string;
|
|
5
|
-
userId: string;
|
|
6
|
-
} | undefined>;
|
|
7
|
-
createCredential(params: {
|
|
8
|
-
id: string;
|
|
9
|
-
password: string;
|
|
10
|
-
userId: string;
|
|
11
|
-
}): Promise<void>;
|
|
12
|
-
updatePassword(id: string, hashedPassword: string): Promise<void>;
|
|
13
|
-
findUserById(userId: string): Promise<{
|
|
14
|
-
id: string;
|
|
15
|
-
role: string;
|
|
16
|
-
name: string;
|
|
17
|
-
refreshToken: string | null;
|
|
18
|
-
} | undefined>;
|
|
19
|
-
updateUserRefreshToken(userId: string, hashedRefreshToken: string | null): Promise<void>;
|
|
20
|
-
createUser(userData: {
|
|
21
|
-
id: string;
|
|
22
|
-
role: string;
|
|
23
|
-
name: string;
|
|
24
|
-
email: string;
|
|
25
|
-
profileImage?: TFile;
|
|
26
|
-
}): Promise<{
|
|
27
|
-
id: string;
|
|
28
|
-
role: string;
|
|
29
|
-
name: string;
|
|
30
|
-
}>;
|
|
31
|
-
findThirdPartyAuth(provider: string, providerId: string): Promise<{
|
|
32
|
-
userId: string;
|
|
33
|
-
} | undefined>;
|
|
34
|
-
createThirdPartyAuth(params: {
|
|
35
|
-
id: string;
|
|
36
|
-
provider: string;
|
|
37
|
-
userId: string;
|
|
38
|
-
}): Promise<void>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type { AuthRepository };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
interface AuthRepository<TFile = unknown> {
|
|
2
|
-
findCredentialById(id: string): Promise<{
|
|
3
|
-
id: string;
|
|
4
|
-
password: string;
|
|
5
|
-
userId: string;
|
|
6
|
-
} | undefined>;
|
|
7
|
-
createCredential(params: {
|
|
8
|
-
id: string;
|
|
9
|
-
password: string;
|
|
10
|
-
userId: string;
|
|
11
|
-
}): Promise<void>;
|
|
12
|
-
updatePassword(id: string, hashedPassword: string): Promise<void>;
|
|
13
|
-
findUserById(userId: string): Promise<{
|
|
14
|
-
id: string;
|
|
15
|
-
role: string;
|
|
16
|
-
name: string;
|
|
17
|
-
refreshToken: string | null;
|
|
18
|
-
} | undefined>;
|
|
19
|
-
updateUserRefreshToken(userId: string, hashedRefreshToken: string | null): Promise<void>;
|
|
20
|
-
createUser(userData: {
|
|
21
|
-
id: string;
|
|
22
|
-
role: string;
|
|
23
|
-
name: string;
|
|
24
|
-
email: string;
|
|
25
|
-
profileImage?: TFile;
|
|
26
|
-
}): Promise<{
|
|
27
|
-
id: string;
|
|
28
|
-
role: string;
|
|
29
|
-
name: string;
|
|
30
|
-
}>;
|
|
31
|
-
findThirdPartyAuth(provider: string, providerId: string): Promise<{
|
|
32
|
-
userId: string;
|
|
33
|
-
} | undefined>;
|
|
34
|
-
createThirdPartyAuth(params: {
|
|
35
|
-
id: string;
|
|
36
|
-
provider: string;
|
|
37
|
-
userId: string;
|
|
38
|
-
}): Promise<void>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type { AuthRepository };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/auth/auth_repository.ts
|
|
17
|
-
var auth_repository_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(auth_repository_exports);
|
|
File without changes
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as jose from 'jose';
|
|
2
|
-
import { JWTManager, AccessTokenPayload } from './jwt_manager.mjs';
|
|
3
|
-
import * as react_router from 'react-router';
|
|
4
|
-
import { ObjectStorage } from '../file/object_storage.mjs';
|
|
5
|
-
import { AuthRepository } from './auth_repository.mjs';
|
|
6
|
-
import '@aws-sdk/client-s3';
|
|
7
|
-
|
|
8
|
-
declare const ACCESS_TOKEN_KEY = "access_token";
|
|
9
|
-
declare const REFRESH_TOKEN_KEY = "refresh_token";
|
|
10
|
-
declare const ACCESS_TOKEN_COOKIE: react_router.Cookie;
|
|
11
|
-
declare const REFRESH_TOKEN_COOKIE: react_router.Cookie;
|
|
12
|
-
declare class AuthService<TFile = unknown> {
|
|
13
|
-
authRepository: AuthRepository<TFile>;
|
|
14
|
-
jwtManager: JWTManager;
|
|
15
|
-
objectStorage: ObjectStorage;
|
|
16
|
-
constructor({ authRepository, jwtManager, objectStorage, }: {
|
|
17
|
-
authRepository: AuthRepository<TFile>;
|
|
18
|
-
jwtManager: JWTManager;
|
|
19
|
-
objectStorage: ObjectStorage;
|
|
20
|
-
});
|
|
21
|
-
verify(request: Request): Promise<AccessTokenPayload | undefined>;
|
|
22
|
-
verifyOrRefresh(request: Request): Promise<jose.JWTPayload | AccessTokenPayload | undefined>;
|
|
23
|
-
getAccessTokenFromRequest(request: Request): Promise<any>;
|
|
24
|
-
getAccessTokenFromCookies(request: Request): Promise<any>;
|
|
25
|
-
getRefreshTokenFromCookies(request: Request): Promise<any>;
|
|
26
|
-
refresh(request: Request): Promise<jose.JWTPayload | undefined>;
|
|
27
|
-
login({ id, password }: {
|
|
28
|
-
id: string;
|
|
29
|
-
password: string;
|
|
30
|
-
}): Promise<{
|
|
31
|
-
accessToken: string;
|
|
32
|
-
refreshToken: string;
|
|
33
|
-
}>;
|
|
34
|
-
issueAccessToken(user: {
|
|
35
|
-
id: string;
|
|
36
|
-
role: string;
|
|
37
|
-
name: string;
|
|
38
|
-
}): Promise<string>;
|
|
39
|
-
issueTokenPair(user: {
|
|
40
|
-
id: string;
|
|
41
|
-
role: string;
|
|
42
|
-
name: string;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
refreshToken: string;
|
|
45
|
-
accessToken: string;
|
|
46
|
-
}>;
|
|
47
|
-
refreshAccessToken(refreshToken: string): Promise<string>;
|
|
48
|
-
getAccessTokenSetCookie(accessToken: string | null): Promise<string>;
|
|
49
|
-
getRefreshTokenSetCookie(refreshToken: string | null): Promise<string>;
|
|
50
|
-
findUser(provider: string, info: {
|
|
51
|
-
id: string;
|
|
52
|
-
email: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
picture?: string;
|
|
55
|
-
}): Promise<{
|
|
56
|
-
id: string;
|
|
57
|
-
role: string;
|
|
58
|
-
name: string;
|
|
59
|
-
refreshToken: string | null;
|
|
60
|
-
} | undefined>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { ACCESS_TOKEN_COOKIE, ACCESS_TOKEN_KEY, AuthService, REFRESH_TOKEN_COOKIE, REFRESH_TOKEN_KEY };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as jose from 'jose';
|
|
2
|
-
import { JWTManager, AccessTokenPayload } from './jwt_manager.js';
|
|
3
|
-
import * as react_router from 'react-router';
|
|
4
|
-
import { ObjectStorage } from '../file/object_storage.js';
|
|
5
|
-
import { AuthRepository } from './auth_repository.js';
|
|
6
|
-
import '@aws-sdk/client-s3';
|
|
7
|
-
|
|
8
|
-
declare const ACCESS_TOKEN_KEY = "access_token";
|
|
9
|
-
declare const REFRESH_TOKEN_KEY = "refresh_token";
|
|
10
|
-
declare const ACCESS_TOKEN_COOKIE: react_router.Cookie;
|
|
11
|
-
declare const REFRESH_TOKEN_COOKIE: react_router.Cookie;
|
|
12
|
-
declare class AuthService<TFile = unknown> {
|
|
13
|
-
authRepository: AuthRepository<TFile>;
|
|
14
|
-
jwtManager: JWTManager;
|
|
15
|
-
objectStorage: ObjectStorage;
|
|
16
|
-
constructor({ authRepository, jwtManager, objectStorage, }: {
|
|
17
|
-
authRepository: AuthRepository<TFile>;
|
|
18
|
-
jwtManager: JWTManager;
|
|
19
|
-
objectStorage: ObjectStorage;
|
|
20
|
-
});
|
|
21
|
-
verify(request: Request): Promise<AccessTokenPayload | undefined>;
|
|
22
|
-
verifyOrRefresh(request: Request): Promise<jose.JWTPayload | AccessTokenPayload | undefined>;
|
|
23
|
-
getAccessTokenFromRequest(request: Request): Promise<any>;
|
|
24
|
-
getAccessTokenFromCookies(request: Request): Promise<any>;
|
|
25
|
-
getRefreshTokenFromCookies(request: Request): Promise<any>;
|
|
26
|
-
refresh(request: Request): Promise<jose.JWTPayload | undefined>;
|
|
27
|
-
login({ id, password }: {
|
|
28
|
-
id: string;
|
|
29
|
-
password: string;
|
|
30
|
-
}): Promise<{
|
|
31
|
-
accessToken: string;
|
|
32
|
-
refreshToken: string;
|
|
33
|
-
}>;
|
|
34
|
-
issueAccessToken(user: {
|
|
35
|
-
id: string;
|
|
36
|
-
role: string;
|
|
37
|
-
name: string;
|
|
38
|
-
}): Promise<string>;
|
|
39
|
-
issueTokenPair(user: {
|
|
40
|
-
id: string;
|
|
41
|
-
role: string;
|
|
42
|
-
name: string;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
refreshToken: string;
|
|
45
|
-
accessToken: string;
|
|
46
|
-
}>;
|
|
47
|
-
refreshAccessToken(refreshToken: string): Promise<string>;
|
|
48
|
-
getAccessTokenSetCookie(accessToken: string | null): Promise<string>;
|
|
49
|
-
getRefreshTokenSetCookie(refreshToken: string | null): Promise<string>;
|
|
50
|
-
findUser(provider: string, info: {
|
|
51
|
-
id: string;
|
|
52
|
-
email: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
picture?: string;
|
|
55
|
-
}): Promise<{
|
|
56
|
-
id: string;
|
|
57
|
-
role: string;
|
|
58
|
-
name: string;
|
|
59
|
-
refreshToken: string | null;
|
|
60
|
-
} | undefined>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { ACCESS_TOKEN_COOKIE, ACCESS_TOKEN_KEY, AuthService, REFRESH_TOKEN_COOKIE, REFRESH_TOKEN_KEY };
|