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.
Files changed (88) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/esm/{KitBaseEnum.d.ts → BaseEnum.d.ts} +18 -9
  3. package/esm/{KitBaseEnum.js → BaseEnum.js} +2 -13
  4. package/esm/{KitEntity.d.ts → FF_Entity.d.ts} +1 -1
  5. package/esm/{KitEntity.js → FF_Entity.js} +9 -9
  6. package/esm/{KitFields.d.ts → FF_Fields.d.ts} +2 -3
  7. package/esm/{KitFields.js → FF_Fields.js} +13 -9
  8. package/esm/ROUTES.d.ts +3 -1
  9. package/esm/ROUTES.js +2 -1
  10. package/esm/SqlDatabase/FF_LogToConsole.d.ts +1 -0
  11. package/esm/SqlDatabase/{LogToConsoleCustom.js → FF_LogToConsole.js} +1 -1
  12. package/esm/api/index.d.ts +2 -1
  13. package/esm/auth/AuthController.server.js +59 -18
  14. package/esm/auth/Entities.d.ts +18 -17
  15. package/esm/auth/Entities.js +66 -63
  16. package/esm/auth/RoleHelpers.d.ts +2 -2
  17. package/esm/auth/RoleHelpers.js +1 -1
  18. package/esm/auth/client/Auth.js +1 -1
  19. package/esm/auth/index.d.ts +14 -17
  20. package/esm/auth/index.js +59 -52
  21. package/esm/auth/providers/github.d.ts +22 -17
  22. package/esm/auth/providers/github.js +29 -15
  23. package/esm/auth/providers/strava.d.ts +22 -17
  24. package/esm/auth/providers/strava.js +23 -15
  25. package/esm/auth/static/assets/Page-BGTO8LC5.css +1 -0
  26. package/esm/auth/static/assets/Page-DBWJjlEQ.d.ts +4 -0
  27. package/esm/auth/static/assets/Page-DBWJjlEQ.js +1 -0
  28. package/esm/auth/static/assets/Page-RIbXHuZG.d.ts +4 -0
  29. package/esm/auth/static/assets/Page-RIbXHuZG.js +1 -0
  30. package/esm/auth/static/assets/Page-apb_xgZT.d.ts +6 -0
  31. package/esm/auth/static/assets/Page-apb_xgZT.js +18 -0
  32. package/esm/auth/static/assets/{index-R27C_TlP.css → index-CR_3yNaJ.css} +1 -1
  33. package/esm/auth/static/assets/index-qfq98Nyd.d.ts +63 -0
  34. package/esm/auth/static/assets/index-qfq98Nyd.js +2 -0
  35. package/esm/auth/static/index.html +2 -2
  36. package/esm/auth/types.d.ts +16 -22
  37. package/esm/bin/cmd.js +181 -83
  38. package/esm/{kitCellsBuildor.d.ts → cellsBuildor.d.ts} +9 -9
  39. package/esm/{kitCellsBuildor.js → cellsBuildor.js} +9 -9
  40. package/esm/feedback/ui/DialogIssue.svelte +2 -2
  41. package/esm/formats/dates.js +2 -2
  42. package/esm/handle/index.d.ts +1 -0
  43. package/esm/helper.d.ts +8 -10
  44. package/esm/helper.js +13 -8
  45. package/esm/index.d.ts +38 -49
  46. package/esm/index.js +30 -27
  47. package/esm/mail/index.d.ts +23 -4
  48. package/esm/mail/index.js +38 -15
  49. package/esm/mail/templates/DefaultMail.svelte +66 -0
  50. package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -0
  51. package/esm/{kitStoreItem.d.ts → storeItem.d.ts} +1 -1
  52. package/esm/{kitStoreItem.js → storeItem.js} +1 -1
  53. package/esm/{kitStoreList.d.ts → storeList.d.ts} +4 -4
  54. package/esm/{kitStoreList.js → storeList.js} +1 -1
  55. package/esm/ui/Button.svelte +1 -1
  56. package/esm/ui/Button.svelte.d.ts +2 -2
  57. package/esm/ui/Field.svelte.d.ts +2 -2
  58. package/esm/ui/FieldGroup.svelte +2 -2
  59. package/esm/ui/FieldGroup.svelte.d.ts +4 -4
  60. package/esm/ui/Grid.svelte.d.ts +5 -5
  61. package/esm/ui/dialog/DialogForm.svelte +4 -4
  62. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +2 -2
  63. package/esm/ui/dialog/FormEditAction.svelte.d.ts +2 -2
  64. package/esm/ui/dialog/dialog.d.ts +5 -5
  65. package/esm/ui/index.d.ts +2 -2
  66. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +3 -3
  67. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +3 -3
  68. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +2 -2
  69. package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
  70. package/esm/utils/types.d.ts +3 -15
  71. package/esm/utils/types.js +1 -17
  72. package/esm/virtual/Customer.js +2 -2
  73. package/esm/virtual/FilterEntity.js +1 -1
  74. package/esm/virtual/StateDemoEnum.d.ts +4 -4
  75. package/esm/virtual/StateDemoEnum.js +2 -2
  76. package/esm/virtual/UIEntity.js +4 -4
  77. package/esm/vite/index.js +1 -1
  78. package/package.json +5 -3
  79. package/esm/SqlDatabase/LogToConsoleCustom.d.ts +0 -1
  80. package/esm/auth/static/assets/Page-BYzkK4q3.d.ts +0 -5
  81. package/esm/auth/static/assets/Page-BYzkK4q3.js +0 -1
  82. package/esm/auth/static/assets/Page-ByIhtXVt.d.ts +0 -5
  83. package/esm/auth/static/assets/Page-ByIhtXVt.js +0 -18
  84. package/esm/auth/static/assets/Page-Do7F0Mzd.d.ts +0 -5
  85. package/esm/auth/static/assets/Page-Do7F0Mzd.js +0 -1
  86. package/esm/auth/static/assets/Page-gV58jf2r.css +0 -1
  87. package/esm/auth/static/assets/index-czJ1PA1n.d.ts +0 -53
  88. package/esm/auth/static/assets/index-czJ1PA1n.js +0 -2
@@ -1,25 +1,30 @@
1
1
  import { Strava } from 'arctic';
2
- import { type KitOAuth2Provider } from '../';
2
+ import { type FFOAuth2Provider } from '../';
3
3
  /**
4
- * Strava OAuth2 provider
4
+ * ## Strava OAuth2 provider
5
5
  *
6
- * In Strava, set your callback url to
7
- * - dev: `http://localhost:5173/api/auth_callback`
8
- * - prod: `https://MY_SUPER_SITE/api/auth_callback`
9
- *
10
- * In your project add a `.env` file with the following:
11
- *
12
- * ```env
13
- * STRAVA_CLIENT_ID= 'your-client-id'
14
- * STRAVA_CLIENT_SECRET= 'your-client-secret'
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
- * _FYI: STRAVA_REDIRECT_URI is optional as auth module will default to "${origin}/api/auth_callback"._
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: string;
21
- STRAVA_CLIENT_SECRET: string;
25
+ STRAVA_CLIENT_ID?: string;
26
+ STRAVA_CLIENT_SECRET?: string;
22
27
  STRAVA_REDIRECT_URI?: string;
23
- authorizationURLOptions?: ReturnType<KitOAuth2Provider<'strava', Strava>['authorizationURLOptions']>;
28
+ authorizationURLOptions?: ReturnType<FFOAuth2Provider<'strava', Strava>['authorizationURLOptions']>;
24
29
  log?: boolean;
25
- }): KitOAuth2Provider<'strava', Strava>;
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
- * In Strava, set your callback url to
9
- * - dev: `http://localhost:5173/api/auth_callback`
10
- * - prod: `https://MY_SUPER_SITE/api/auth_callback`
11
- *
12
- * In your project add a `.env` file with the following:
13
- *
14
- * ```env
15
- * STRAVA_CLIENT_ID= 'your-client-id'
16
- * STRAVA_CLIENT_SECRET= 'your-client-secret'
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
- * _FYI: STRAVA_REDIRECT_URI is optional as auth module will default to "${origin}/api/auth_callback"._
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 || `${remult.context.url.origin}/api/auth_callback`;
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,4 @@
1
+ export { v as default };
2
+ declare class v extends l {
3
+ }
4
+ import { S as l } from "./index-qfq98Nyd.js";
@@ -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,4 @@
1
+ export { v as default };
2
+ declare class v extends l {
3
+ }
4
+ import { S as l } from "./index-qfq98Nyd.js";
@@ -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};
@@ -0,0 +1,6 @@
1
+ export { Oa as default };
2
+ declare class Oa extends et {
3
+ set firstlyData(e: void);
4
+ get firstlyData(): void;
5
+ }
6
+ import { S as et } from "./index-qfq98Nyd.js";