firstly 0.0.4 → 0.0.6
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/CHANGELOG.md +21 -0
- package/esm/{KitBaseEnum.d.ts → BaseEnum.d.ts} +18 -9
- package/esm/{KitBaseEnum.js → BaseEnum.js} +2 -13
- package/esm/{KitEntity.d.ts → FF_Entity.d.ts} +1 -1
- package/esm/{KitEntity.js → FF_Entity.js} +9 -9
- package/esm/{KitFields.d.ts → FF_Fields.d.ts} +2 -3
- package/esm/{KitFields.js → FF_Fields.js} +13 -9
- package/esm/ROUTES.d.ts +3 -1
- package/esm/ROUTES.js +2 -1
- package/esm/SqlDatabase/FF_LogToConsole.d.ts +1 -0
- package/esm/SqlDatabase/{LogToConsoleCustom.js → FF_LogToConsole.js} +1 -1
- package/esm/api/index.d.ts +2 -1
- package/esm/auth/AuthController.server.js +59 -18
- package/esm/auth/Entities.d.ts +18 -17
- package/esm/auth/Entities.js +66 -63
- package/esm/auth/RoleHelpers.d.ts +2 -2
- package/esm/auth/RoleHelpers.js +1 -1
- package/esm/auth/client/Auth.js +1 -1
- package/esm/auth/index.d.ts +14 -17
- package/esm/auth/index.js +59 -52
- package/esm/auth/providers/github.d.ts +22 -17
- package/esm/auth/providers/github.js +29 -15
- package/esm/auth/providers/strava.d.ts +22 -17
- package/esm/auth/providers/strava.js +23 -15
- package/esm/auth/static/assets/Page-BGTO8LC5.css +1 -0
- package/esm/auth/static/assets/Page-DBWJjlEQ.d.ts +4 -0
- package/esm/auth/static/assets/Page-DBWJjlEQ.js +1 -0
- package/esm/auth/static/assets/Page-RIbXHuZG.d.ts +4 -0
- package/esm/auth/static/assets/Page-RIbXHuZG.js +1 -0
- package/esm/auth/static/assets/Page-apb_xgZT.d.ts +6 -0
- package/esm/auth/static/assets/Page-apb_xgZT.js +18 -0
- package/esm/auth/static/assets/{index-R27C_TlP.css → index-CR_3yNaJ.css} +1 -1
- package/esm/auth/static/assets/index-qfq98Nyd.d.ts +63 -0
- package/esm/auth/static/assets/index-qfq98Nyd.js +2 -0
- package/esm/auth/static/index.html +2 -2
- package/esm/auth/types.d.ts +16 -22
- package/esm/bin/cmd.js +181 -83
- package/esm/{kitCellsBuildor.d.ts → cellsBuildor.d.ts} +9 -9
- package/esm/{kitCellsBuildor.js → cellsBuildor.js} +9 -9
- package/esm/feedback/ui/DialogIssue.svelte +2 -2
- package/esm/formats/dates.js +2 -2
- package/esm/handle/index.d.ts +1 -0
- package/esm/helper.d.ts +8 -10
- package/esm/helper.js +13 -8
- package/esm/index.d.ts +38 -49
- package/esm/index.js +30 -27
- package/esm/mail/index.d.ts +23 -4
- package/esm/mail/index.js +38 -15
- package/esm/mail/templates/DefaultMail.svelte +66 -0
- package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -0
- package/esm/{kitStoreItem.d.ts → storeItem.d.ts} +1 -1
- package/esm/{kitStoreItem.js → storeItem.js} +1 -1
- package/esm/{kitStoreList.d.ts → storeList.d.ts} +4 -4
- package/esm/{kitStoreList.js → storeList.js} +1 -1
- package/esm/ui/Button.svelte +1 -1
- package/esm/ui/Button.svelte.d.ts +2 -2
- package/esm/ui/Field.svelte.d.ts +2 -2
- package/esm/ui/FieldGroup.svelte +2 -2
- package/esm/ui/FieldGroup.svelte.d.ts +4 -4
- package/esm/ui/Grid.svelte.d.ts +5 -5
- package/esm/ui/dialog/DialogForm.svelte +4 -4
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +2 -2
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +2 -2
- package/esm/ui/dialog/dialog.d.ts +5 -5
- package/esm/ui/index.d.ts +2 -2
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +3 -3
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +3 -3
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +2 -2
- package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
- package/esm/utils/types.d.ts +3 -15
- package/esm/utils/types.js +1 -17
- package/esm/virtual/Customer.js +2 -2
- package/esm/virtual/FilterEntity.js +1 -1
- package/esm/virtual/StateDemoEnum.d.ts +4 -4
- package/esm/virtual/StateDemoEnum.js +2 -2
- package/esm/virtual/UIEntity.js +4 -4
- package/esm/vite/index.js +1 -1
- package/package.json +5 -3
- package/esm/SqlDatabase/LogToConsoleCustom.d.ts +0 -1
- package/esm/auth/static/assets/Page-BYzkK4q3.d.ts +0 -5
- package/esm/auth/static/assets/Page-BYzkK4q3.js +0 -1
- package/esm/auth/static/assets/Page-ByIhtXVt.d.ts +0 -5
- package/esm/auth/static/assets/Page-ByIhtXVt.js +0 -18
- package/esm/auth/static/assets/Page-Do7F0Mzd.d.ts +0 -5
- package/esm/auth/static/assets/Page-Do7F0Mzd.js +0 -1
- package/esm/auth/static/assets/Page-gV58jf2r.css +0 -1
- package/esm/auth/static/assets/index-czJ1PA1n.d.ts +0 -53
- package/esm/auth/static/assets/index-czJ1PA1n.js +0 -2
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { Strava } from 'arctic';
|
|
2
|
-
import { type
|
|
2
|
+
import { type FFOAuth2Provider } from '../';
|
|
3
3
|
/**
|
|
4
|
-
* Strava OAuth2 provider
|
|
4
|
+
* ## Strava OAuth2 provider
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
10
|
-
* In your project add a `.env` file with the following:
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
6
|
+
* 1. Get your **id** & **secret** from [Strava (direct link)](https://www.strava.com/settings/api).
|
|
7
|
+
* 2. In Strava, set your callback url to
|
|
8
|
+
* - [ ] dev: `http://localhost:5173/api/auth_callback`
|
|
9
|
+
* - [ ] prod: `https://MY_SUPER_SITE/api/auth_callback`
|
|
10
|
+
* 3. In your project add a `.env` file with the following:
|
|
11
|
+
* ```bash
|
|
12
|
+
* STRAVA_CLIENT_ID = 'your-client-id'
|
|
13
|
+
* STRAVA_CLIENT_SECRET = 'your-client-secret'
|
|
14
|
+
* # STRAVA_REDIRECT_URI = '' # optional, will default to "${origin}/api/auth_callback"
|
|
15
15
|
* ```
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* 4. In your frontend, under a button click call something like:
|
|
17
|
+
* ```ts
|
|
18
|
+
* async function oauth() {
|
|
19
|
+
* window.location.href = await Auth.signInOAuthGetUrl({ provider: 'strava', redirect: window.location.pathname })
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
* 5. Enjoy 🥳
|
|
18
23
|
*/
|
|
19
24
|
export declare function strava(options?: {
|
|
20
|
-
STRAVA_CLIENT_ID
|
|
21
|
-
STRAVA_CLIENT_SECRET
|
|
25
|
+
STRAVA_CLIENT_ID?: string;
|
|
26
|
+
STRAVA_CLIENT_SECRET?: string;
|
|
22
27
|
STRAVA_REDIRECT_URI?: string;
|
|
23
|
-
authorizationURLOptions?: ReturnType<
|
|
28
|
+
authorizationURLOptions?: ReturnType<FFOAuth2Provider<'strava', Strava>['authorizationURLOptions']>;
|
|
24
29
|
log?: boolean;
|
|
25
|
-
}):
|
|
30
|
+
}): FFOAuth2Provider<'strava', Strava>;
|
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
import { Strava } from 'arctic';
|
|
2
2
|
import { remult } from 'remult';
|
|
3
|
+
import { env } from '$env/dynamic/private';
|
|
3
4
|
import { checkOAuthConfig } from '.';
|
|
4
5
|
import { logAuth } from '../';
|
|
5
6
|
/**
|
|
6
|
-
* Strava OAuth2 provider
|
|
7
|
+
* ## Strava OAuth2 provider
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* In your project add a `.env` file with the following:
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
9
|
+
* 1. Get your **id** & **secret** from [Strava (direct link)](https://www.strava.com/settings/api).
|
|
10
|
+
* 2. In Strava, set your callback url to
|
|
11
|
+
* - [ ] dev: `http://localhost:5173/api/auth_callback`
|
|
12
|
+
* - [ ] prod: `https://MY_SUPER_SITE/api/auth_callback`
|
|
13
|
+
* 3. In your project add a `.env` file with the following:
|
|
14
|
+
* ```bash
|
|
15
|
+
* STRAVA_CLIENT_ID = 'your-client-id'
|
|
16
|
+
* STRAVA_CLIENT_SECRET = 'your-client-secret'
|
|
17
|
+
* # STRAVA_REDIRECT_URI = '' # optional, will default to "${origin}/api/auth_callback"
|
|
17
18
|
* ```
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* 4. In your frontend, under a button click call something like:
|
|
20
|
+
* ```ts
|
|
21
|
+
* async function oauth() {
|
|
22
|
+
* window.location.href = await Auth.signInOAuthGetUrl({ provider: 'strava', redirect: window.location.pathname })
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
* 5. Enjoy 🥳
|
|
20
26
|
*/
|
|
21
27
|
export function strava(options) {
|
|
22
28
|
const name = 'strava';
|
|
23
|
-
const clientID = options?.STRAVA_CLIENT_ID ?? '';
|
|
24
|
-
const secret = options?.STRAVA_CLIENT_SECRET ?? '';
|
|
29
|
+
const clientID = options?.STRAVA_CLIENT_ID ?? env.STRAVA_CLIENT_ID ?? '';
|
|
30
|
+
const secret = options?.STRAVA_CLIENT_SECRET ?? env.STRAVA_CLIENT_SECRET ?? '';
|
|
25
31
|
const urlForKeys = 'https://www.strava.com/settings/api';
|
|
26
32
|
checkOAuthConfig(name, clientID, secret, urlForKeys, false);
|
|
27
33
|
return {
|
|
28
34
|
name,
|
|
29
35
|
isPKCE: false,
|
|
30
36
|
getArcticProvider: () => {
|
|
31
|
-
const redirectURI = options?.STRAVA_REDIRECT_URI
|
|
37
|
+
const redirectURI = options?.STRAVA_REDIRECT_URI ??
|
|
38
|
+
env.STRAVA_REDIRECT_URI ??
|
|
39
|
+
`${remult.context.url.origin}/api/auth_callback`;
|
|
32
40
|
checkOAuthConfig(name, clientID, secret, urlForKeys, true);
|
|
33
41
|
return new Strava(clientID, secret, redirectURI);
|
|
34
42
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
form.s-KT008SdmQprk,form.s-N0DaQgJ_T5_C,form.s-85Tmcm64bnMI{display:flex;flex-direction:column}.message.s-85Tmcm64bnMI:empty{display:none}.message.s-85Tmcm64bnMI{background:var(--pico-muted-border-color);padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border-radius:var(--pico-border-radius);margin-bottom:calc(var(--pico-typography-spacing-vertical) * 2)}.message.error.s-85Tmcm64bnMI{background:var(--pico-del-color);color:#4c1513}form.s-FRwn6sVlvC6z{display:flex;flex-direction:column}.message.s-FRwn6sVlvC6z:empty{display:none}.message.s-FRwn6sVlvC6z{background:var(--pico-muted-border-color);padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border-radius:var(--pico-border-radius);margin-bottom:calc(var(--pico-typography-spacing-vertical) * 2)}.message.error.s-FRwn6sVlvC6z{background:var(--pico-del-color);color:#4c1513}.wrapper.s-NO-a_LAEXXH5{min-height:100vh;display:flex;justify-content:center;align-items:center;margin:0 auto}.form.s-NO-a_LAEXXH5{padding:1rem;max-width:360px;width:100%}.form-footer.s-NO-a_LAEXXH5{margin-top:1rem;display:flex;flex-direction:column;justify-content:center;align-items:center}.fallback.s-NO-a_LAEXXH5{display:flex;justify-content:center;align-items:center}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as l,b as d,a as f,d as i,h as m,M as p,t as u,n as r,z as h}from"./index-qfq98Nyd.js";function c(a){let e;const n={c:function(){e=p("Hello from files")},l:function(t){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(t,o){u(t,e,o)},p:r,i:r,o:r,d:function(t){t&&h(e)}};return i("SvelteRegisterBlock",{block:n,id:c.name,type:"component",source:"",ctx:a}),n}function w(a,e){let{$$slots:n={},$$scope:s}=e;m("Page",n,[]);const t=[];return Object.keys(e).forEach(o=>{!~t.indexOf(o)&&o.slice(0,2)!=="$$"&&o!=="slot"&&console.warn(`<Page> was created with unknown prop '${o}'`)}),[]}class v extends l{constructor(e){super(e),d(this,e,w,c,f,{}),i("SvelteRegisterComponent",{component:this,tagName:"Page",options:e,id:c.name})}}export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as l,b as d,a as f,d as i,h as m,M as p,t as u,n as r,z as h}from"./index-qfq98Nyd.js";function c(s){let e;const n={c:function(){e=p("Hello from admin")},l:function(t){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(t,o){u(t,e,o)},p:r,i:r,o:r,d:function(t){t&&h(e)}};return i("SvelteRegisterBlock",{block:n,id:c.name,type:"component",source:"",ctx:s}),n}function w(s,e){let{$$slots:n={},$$scope:a}=e;m("Page",n,[]);const t=[];return Object.keys(e).forEach(o=>{!~t.indexOf(o)&&o.slice(0,2)!=="$$"&&o!=="slot"&&console.warn(`<Page> was created with unknown prop '${o}'`)}),[]}class v extends l{constructor(e){super(e),d(this,e,w,c,f,{}),i("SvelteRegisterComponent",{component:this,tagName:"Page",options:e,id:c.name})}}export{v as default};
|