firstly 0.0.3 → 0.0.5

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 (93) 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} +4 -5
  7. package/esm/{KitFields.js → FF_Fields.js} +41 -55
  8. package/esm/ROUTES.d.ts +4 -2
  9. package/esm/ROUTES.js +4 -7
  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 +1 -0
  13. package/esm/auth/Adapter.js +10 -8
  14. package/esm/auth/{AuthController.d.ts → AuthController.server.d.ts} +2 -2
  15. package/esm/auth/{AuthController.js → AuthController.server.js} +15 -51
  16. package/esm/auth/Entities.d.ts +18 -17
  17. package/esm/auth/Entities.js +66 -63
  18. package/esm/auth/README.md +13 -0
  19. package/esm/auth/{RoleController.d.ts → RoleHelpers.d.ts} +2 -4
  20. package/esm/auth/RoleHelpers.js +43 -0
  21. package/esm/auth/client/Auth.d.ts +69 -0
  22. package/esm/auth/client/Auth.js +121 -0
  23. package/esm/auth/client/index.d.ts +2 -0
  24. package/esm/auth/client/index.js +2 -0
  25. package/esm/auth/index.d.ts +10 -11
  26. package/esm/auth/index.js +37 -21
  27. package/esm/auth/providers/github.d.ts +22 -17
  28. package/esm/auth/providers/github.js +29 -15
  29. package/esm/auth/providers/strava.d.ts +22 -17
  30. package/esm/auth/providers/strava.js +23 -15
  31. package/esm/auth/static/assets/{Page-BwHye0GW.d.ts → Page-BYzkK4q3.d.ts} +1 -1
  32. package/esm/auth/static/assets/{Page-BwHye0GW.js → Page-BYzkK4q3.js} +1 -1
  33. package/esm/auth/static/assets/Page-ByIhtXVt.d.ts +5 -0
  34. package/esm/auth/static/assets/Page-ByIhtXVt.js +8190 -0
  35. package/esm/auth/static/assets/{Page-BMOLAIFx.d.ts → Page-Do7F0Mzd.d.ts} +1 -1
  36. package/esm/auth/static/assets/{Page-BMOLAIFx.js → Page-Do7F0Mzd.js} +1 -1
  37. package/esm/auth/static/assets/index-czJ1PA1n.js +2 -0
  38. package/esm/auth/static/index.html +1 -1
  39. package/esm/bin/cmd.js +182 -83
  40. package/esm/cellsBuildor.d.ts +45 -0
  41. package/esm/{kitCellsBuildor.js → cellsBuildor.js} +24 -14
  42. package/esm/feedback/ui/DialogIssue.svelte +2 -2
  43. package/esm/formats/dates.js +2 -2
  44. package/esm/formats/strings.js +0 -11
  45. package/esm/handle/index.d.ts +1 -0
  46. package/esm/helper.d.ts +8 -10
  47. package/esm/helper.js +13 -12
  48. package/esm/index.d.ts +37 -48
  49. package/esm/index.js +29 -20
  50. package/esm/{kitStoreItem.d.ts → storeItem.d.ts} +1 -1
  51. package/esm/{kitStoreItem.js → storeItem.js} +3 -3
  52. package/esm/{kitStoreList.d.ts → storeList.d.ts} +4 -4
  53. package/esm/{kitStoreList.js → storeList.js} +1 -1
  54. package/esm/ui/Button.svelte +7 -9
  55. package/esm/ui/Button.svelte.d.ts +2 -2
  56. package/esm/ui/Field.svelte +9 -8
  57. package/esm/ui/Field.svelte.d.ts +2 -2
  58. package/esm/ui/FieldGroup.svelte +5 -3
  59. package/esm/ui/FieldGroup.svelte.d.ts +4 -4
  60. package/esm/ui/Grid.svelte.d.ts +5 -5
  61. package/esm/ui/GridPaginate.svelte +3 -6
  62. package/esm/ui/Icon.svelte +6 -7
  63. package/esm/ui/LibIcon.js +0 -2
  64. package/esm/ui/dialog/DialogForm.svelte +5 -6
  65. package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +2 -2
  66. package/esm/ui/dialog/FormEditAction.svelte.d.ts +2 -2
  67. package/esm/ui/dialog/dialog.d.ts +7 -5
  68. package/esm/ui/dialog/dialog.js +1 -0
  69. package/esm/ui/index.d.ts +2 -2
  70. package/esm/ui/internals/FieldContainer.svelte +1 -1
  71. package/esm/ui/internals/Input.svelte +1 -1
  72. package/esm/ui/internals/select/MultiSelectMelt.svelte +16 -19
  73. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +3 -3
  74. package/esm/ui/internals/select/SelectMelt.svelte +10 -14
  75. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +3 -3
  76. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +2 -2
  77. package/esm/ui/link/LinkPlus.svelte.d.ts +2 -2
  78. package/esm/utils/types.d.ts +0 -15
  79. package/esm/utils/types.js +1 -17
  80. package/esm/virtual/Customer.js +2 -2
  81. package/esm/virtual/FilterEntity.js +1 -1
  82. package/esm/virtual/StateDemoEnum.d.ts +4 -4
  83. package/esm/virtual/StateDemoEnum.js +2 -2
  84. package/esm/virtual/UIEntity.js +4 -4
  85. package/esm/vite/index.js +1 -1
  86. package/package.json +10 -5
  87. package/esm/SqlDatabase/LogToConsoleCustom.d.ts +0 -1
  88. package/esm/auth/RoleController.js +0 -57
  89. package/esm/auth/static/assets/Page-BMFREPjF.d.ts +0 -5
  90. package/esm/auth/static/assets/Page-BMFREPjF.js +0 -18
  91. package/esm/auth/static/assets/index-CKmKKRRL.js +0 -2
  92. package/esm/kitCellsBuildor.d.ts +0 -45
  93. /package/esm/auth/static/assets/{index-CKmKKRRL.d.ts → index-czJ1PA1n.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { SvelteComponent } from 'svelte';
2
2
  import type { Repository } from 'remult';
3
- import { type KitBaseItemLight, type KitCellsInput, type KitStoreItem } from '../../';
3
+ import { type BaseItemLight, type CellsInput, type StoreItem } from '../../';
4
4
  export type DialogClasses = {
5
5
  /**
6
6
  * for example `overflow-auto` to have a scrollbar in the dialog
@@ -10,10 +10,10 @@ export type DialogClasses = {
10
10
  };
11
11
  export type FormGrid = 'grid-cols-1' | 'grid-cols-2' | 'grid-cols-3' | 'grid-cols-4' | 'grid-cols-1 lg:grid-cols-4';
12
12
  export type DialogMetaData<entityType = any> = {
13
- detail?: KitBaseItemLight;
13
+ detail?: BaseItemLight;
14
14
  repo?: Repository<entityType>;
15
- store?: KitStoreItem<entityType>;
16
- cells?: KitCellsInput<entityType>;
15
+ store?: StoreItem<entityType>;
16
+ cells?: CellsInput<entityType>;
17
17
  defaults?: Partial<entityType>;
18
18
  classes?: DialogClasses;
19
19
  component?: new (...args: any[]) => SvelteComponent;
@@ -21,6 +21,7 @@ export type DialogMetaData<entityType = any> = {
21
21
  children?: any;
22
22
  noThrow?: boolean;
23
23
  wDelete?: boolean;
24
+ focusKey?: string;
24
25
  topicPrefixText?: string;
25
26
  };
26
27
  type ResultClose<entityType = any> = {
@@ -36,12 +37,13 @@ export type DialogMetaDataInternal<entityType = any> = DialogMetaData<entityType
36
37
  export declare const dialog: {
37
38
  confirm: (topic: string, text: string, icon?: string) => Promise<ResultClose<any>>;
38
39
  confirmDelete: (topic: string) => Promise<ResultClose<any>>;
39
- form: <entityType>(type: 'insert' | 'update' | 'view', topic: string, repo: Repository<entityType>, cells: KitCellsInput<entityType>, options?: {
40
+ form: <entityType>(type: 'insert' | 'update' | 'view', topic: string, repo: Repository<entityType>, cells: CellsInput<entityType>, options?: {
40
41
  defaults?: Partial<entityType>;
41
42
  classes?: DialogClasses;
42
43
  noThrow?: boolean;
43
44
  wDelete?: boolean;
44
45
  topicPrefixText?: string;
46
+ focusKey?: string;
45
47
  }) => Promise<ResultClose<any>>;
46
48
  show: (dialog: DialogMetaData) => Promise<ResultClose<any>>;
47
49
  close: (id: number, result: ResultClose) => void;
@@ -65,6 +65,7 @@ const createDialogManagement = () => {
65
65
  classes: options?.classes,
66
66
  noThrow: options?.noThrow,
67
67
  wDelete: options?.wDelete,
68
+ focusKey: options?.focusKey,
68
69
  topicPrefixText,
69
70
  };
70
71
  return show(detail, type);
package/esm/ui/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { FieldMetadata } from 'remult';
2
- import type { KitCell } from '../';
2
+ import type { Cell } from '../';
3
3
  export type Align = 'text-left' | 'text-center' | 'text-right';
4
4
  export declare const align: (f?: FieldMetadata, isSlot?: boolean) => Align;
5
- export declare const getAligns: (cells: KitCell<any>[], withAction: boolean) => Align[];
5
+ export declare const getAligns: (cells: Cell<any>[], withAction: boolean) => Align[];
@@ -12,7 +12,7 @@ export let classes = {};
12
12
  {label}{required ? ' *' : ''}
13
13
  </span>
14
14
  {#if error}
15
- <!-- TODO hover popup if too long? -->
15
+ <!-- TODO Ermin? hover popup if too long? -->
16
16
  <span class="label-text-alt text-error truncate">{error}</span>
17
17
  {/if}
18
18
  </label>
@@ -35,7 +35,7 @@ const handleInput = (e) => {
35
35
  if (e.data === "." || e.data === ",") {
36
36
  e.preventDefault();
37
37
  } else {
38
- value = +target.value;
38
+ value = target.value.toString().replaceAll(",", ".");
39
39
  }
40
40
  } else {
41
41
  value = target.value;
@@ -69,22 +69,21 @@ const debounce = (callback) => {
69
69
  );
70
70
  };
71
71
  const sync = createSync({ selected: localSelected });
72
- $:
73
- items && sync.selected(getDefaultValues(values), (v) => {
74
- const list = (v ?? []).map((c) => c.value.id);
75
- const countMap = /* @__PURE__ */ new Map();
76
- list.forEach((item) => {
77
- countMap.set(item, (countMap.get(item) || 0) + 1);
78
- });
79
- const uniqueList = list.filter((item) => countMap.get(item) === 1);
80
- const newIds = uniqueList.sort().join(",");
81
- const oldSelectedValues = (values ?? []).sort().join(",");
82
- if (newIds !== oldSelectedValues) {
83
- dispatchSelectedValues(
84
- v === void 0 ? void 0 : v.filter((c) => uniqueList.includes(c.value.id)).map((c) => c.value)
85
- );
86
- }
72
+ $: items && sync.selected(getDefaultValues(values), (v) => {
73
+ const list = (v ?? []).map((c) => c.value.id);
74
+ const countMap = /* @__PURE__ */ new Map();
75
+ list.forEach((item) => {
76
+ countMap.set(item, (countMap.get(item) || 0) + 1);
87
77
  });
78
+ const uniqueList = list.filter((item) => countMap.get(item) === 1);
79
+ const newIds = uniqueList.sort().join(",");
80
+ const oldSelectedValues = (values ?? []).sort().join(",");
81
+ if (newIds !== oldSelectedValues) {
82
+ dispatchSelectedValues(
83
+ v === void 0 ? void 0 : v.filter((c) => uniqueList.includes(c.value.id)).map((c) => c.value)
84
+ );
85
+ }
86
+ });
88
87
  const labelToDisplayInInput = (_localSelected) => {
89
88
  if (_localSelected === void 0 || _localSelected.length === 0) {
90
89
  return "";
@@ -94,8 +93,7 @@ const labelToDisplayInInput = (_localSelected) => {
94
93
  }
95
94
  return `${_localSelected.length} \xE9l\xE9ments`;
96
95
  };
97
- $:
98
- $inputValue = labelToDisplayInInput($localSelected);
96
+ $: $inputValue = labelToDisplayInInput($localSelected);
99
97
  const iconToDisplayInInput = (_localSelected) => {
100
98
  if (_localSelected === void 0 || _localSelected.length === 0) {
101
99
  return { data: LibIcon_Search };
@@ -125,8 +123,7 @@ const calcFilteredItems = (touched, str, values2) => {
125
123
  filteredItems = items;
126
124
  }
127
125
  };
128
- $:
129
- calcFilteredItems($touchedInput, $inputValue, values);
126
+ $: calcFilteredItems($touchedInput, $inputValue, values);
130
127
  </script>
131
128
 
132
129
  <div class="input input-bordered flex min-w-0 items-center">
@@ -1,13 +1,13 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItem } from '../../..';
2
+ import { type BaseItem } from '../../..';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  disabled?: boolean | undefined;
7
7
  placeholder?: string | undefined;
8
- items?: KitBaseItem[] | undefined;
8
+ items?: BaseItem[] | undefined;
9
9
  loadOptions?: ((str: string) => Promise<{
10
- items: KitBaseItem[];
10
+ items: BaseItem[];
11
11
  totalCount: number;
12
12
  }>) | undefined;
13
13
  values?: string[] | undefined;
@@ -96,19 +96,16 @@ const debounce = (callback) => {
96
96
  );
97
97
  };
98
98
  const sync = createSync({ selected: localSelected });
99
- $:
100
- items && sync.selected(getDefaultValue(value), (v) => {
101
- if (v?.value?.id !== value) {
102
- dispatchSelectedValue(v?.value);
103
- }
104
- value = v?.value?.id;
105
- });
106
- $:
107
- if (!$open) {
108
- $inputValue = $localSelected?.label ?? "";
99
+ $: items && sync.selected(getDefaultValue(value), (v) => {
100
+ if (v?.value?.id !== value) {
101
+ dispatchSelectedValue(v?.value);
109
102
  }
110
- $:
111
- filteredItems = items;
103
+ value = v?.value?.id;
104
+ });
105
+ $: if (!$open) {
106
+ $inputValue = $localSelected?.label ?? "";
107
+ }
108
+ $: filteredItems = items;
112
109
  $: {
113
110
  if (items.length === 1 && default_select_if_one_item) {
114
111
  sync.selected(toOption(items[0]));
@@ -133,8 +130,7 @@ const updateFilteredItems = async (normalizedInput) => {
133
130
  });
134
131
  }
135
132
  };
136
- $:
137
- calcFilteredItems($touchedInput, $inputValue, value);
133
+ $: calcFilteredItems($touchedInput, $inputValue, value);
138
134
  </script>
139
135
 
140
136
  <div class="input input-bordered flex min-w-0 items-center {disabled && 'opacity-40'}">
@@ -1,14 +1,14 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItem } from '../../../';
2
+ import { type BaseItem } from '../../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  disabled?: boolean | undefined;
7
7
  placeholder?: string | undefined;
8
- items?: KitBaseItem[] | undefined;
8
+ items?: BaseItem[] | undefined;
9
9
  focus?: boolean | undefined;
10
10
  loadOptions?: ((str: string) => Promise<{
11
- items: KitBaseItem[];
11
+ items: BaseItem[];
12
12
  totalCount: number;
13
13
  }>) | undefined;
14
14
  value?: string | undefined;
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import type { KitBaseItem } from '../../../';
2
+ import type { BaseItem } from '../../../';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  id: string;
6
6
  disabled?: boolean | undefined;
7
7
  placeholder?: string | undefined;
8
- items?: KitBaseItem[] | undefined;
8
+ items?: BaseItem[] | undefined;
9
9
  value?: string | number | undefined;
10
10
  };
11
11
  events: {
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type KitBaseItemLight } from '../..';
2
+ import { type BaseItemLight } from '../..';
3
3
  declare const __propDef: {
4
4
  props: {
5
- item: KitBaseItemLight | undefined;
5
+ item: BaseItemLight | undefined;
6
6
  noIcon?: boolean | undefined;
7
7
  captionSubStyle?: "none" | "under" | "inline" | undefined;
8
8
  };
@@ -1,17 +1,2 @@
1
- /**
2
- *
3
- * ```ts
4
- * type KnownTypes = 'password' | 'otp' | 'oAuths' | 'demo'
5
- *
6
- * // literal or string
7
- * const knownType = litOrStr<KnownTypes>('demo')
8
- * const escapedType = litOrStr('coucou')
9
- *
10
- * // literal[] or string[]
11
- * const knownType = litOrStr<KnownTypes[]>(['demo', 'oAuths'])
12
- * const escapedType = litOrStr(['hello', 'coucou'])
13
- * ```
14
- */
15
- export declare function litOrStr<T extends string | string[]>(value: T): T;
16
1
  export type ResolvedType<T> = T extends Promise<infer R> ? R : T;
17
2
  export type UnArray<T extends any[]> = T extends (infer U)[] ? U : never;
@@ -1,17 +1 @@
1
- /**
2
- *
3
- * ```ts
4
- * type KnownTypes = 'password' | 'otp' | 'oAuths' | 'demo'
5
- *
6
- * // literal or string
7
- * const knownType = litOrStr<KnownTypes>('demo')
8
- * const escapedType = litOrStr('coucou')
9
- *
10
- * // literal[] or string[]
11
- * const knownType = litOrStr<KnownTypes[]>(['demo', 'oAuths'])
12
- * const escapedType = litOrStr(['hello', 'coucou'])
13
- * ```
14
- */
15
- export function litOrStr(value) {
16
- return value;
17
- }
1
+ export {};
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Entity, Fields } from 'remult';
8
- import { KitFields } from '../KitFields';
8
+ import { FF_Fields } from '../FF_Fields';
9
9
  let Customer = class Customer {
10
10
  id;
11
11
  name;
@@ -14,7 +14,7 @@ __decorate([
14
14
  Fields.cuid()
15
15
  ], Customer.prototype, "id", void 0);
16
16
  __decorate([
17
- KitFields.string({ caption: 'Nom de la société', placeholder: 'Dynamic Process' })
17
+ FF_Fields.string({ caption: 'Nom de la société', placeholder: 'Dynamic Process' })
18
18
  ], Customer.prototype, "name", void 0);
19
19
  Customer = __decorate([
20
20
  Entity('customers', {
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Entity, Fields } from 'remult';
8
- // import { KitFields } from '../KitFields.js'
8
+ // import { FF_Fields } from '../FF_Fields.js'
9
9
  let FilterEntity = class FilterEntity {
10
10
  search = '';
11
11
  title = '';
@@ -1,9 +1,9 @@
1
- import { KitBaseEnum } from '../KitBaseEnum';
2
- import type { KitBaseEnumOptions } from '../KitBaseEnum';
1
+ import { BaseEnum } from '../BaseEnum';
2
+ import type { BaseEnumOptions } from '../BaseEnum';
3
3
  import '../ui/LibIcon';
4
- export declare class StateDemoEnum extends KitBaseEnum {
4
+ export declare class StateDemoEnum extends BaseEnum {
5
5
  static CHECK: StateDemoEnum;
6
6
  static EDIT: StateDemoEnum;
7
7
  static DELETE: StateDemoEnum;
8
- constructor(id: string, options?: KitBaseEnumOptions<StateDemoEnum>);
8
+ constructor(id: string, options?: BaseEnumOptions<StateDemoEnum>);
9
9
  }
@@ -6,10 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  var StateDemoEnum_1;
8
8
  import { ValueListFieldType } from 'remult';
9
- import { KitBaseEnum } from '../KitBaseEnum';
9
+ import { BaseEnum } from '../BaseEnum';
10
10
  import '../ui/LibIcon';
11
11
  import { LibIcon_Add, LibIcon_Delete, LibIcon_Edit } from '../ui/LibIcon';
12
- let StateDemoEnum = class StateDemoEnum extends KitBaseEnum {
12
+ let StateDemoEnum = class StateDemoEnum extends BaseEnum {
13
13
  static { StateDemoEnum_1 = this; }
14
14
  static CHECK = new StateDemoEnum_1('CHECK', {
15
15
  caption: 'Check',
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Entity, Field, Fields } from 'remult';
8
- import { KitFields } from '../KitFields.js';
8
+ import { FF_Fields } from '../FF_Fields.js';
9
9
  import { StateDemoEnum } from './StateDemoEnum.js';
10
10
  let UIEntity = class UIEntity {
11
11
  id;
@@ -39,13 +39,13 @@ __decorate([
39
39
  Fields.updatedAt()
40
40
  ], UIEntity.prototype, "updatedAt", void 0);
41
41
  __decorate([
42
- KitFields.string({ caption: "Nom de l'utilisateur", placeholder: 'Jean-Yves', suffix: 'sdsd' })
42
+ FF_Fields.string({ caption: "Nom de l'utilisateur", placeholder: 'Jean-Yves', suffix: 'sdsd' })
43
43
  ], UIEntity.prototype, "username", void 0);
44
44
  __decorate([
45
45
  Fields.string({ caption: 'E Mail', inputType: 'email', placeholder: 'prénom.nom@se.com' })
46
46
  ], UIEntity.prototype, "email", void 0);
47
47
  __decorate([
48
- KitFields.string({
48
+ FF_Fields.string({
49
49
  caption: 'Mot de passe',
50
50
  inputType: 'password',
51
51
  placeholder: '********',
@@ -73,7 +73,7 @@ __decorate([
73
73
  Fields.date({ allowNull: true, allowApiUpdate: false })
74
74
  ], UIEntity.prototype, "arrivalDate", void 0);
75
75
  __decorate([
76
- KitFields.dateOnly({ allowNull: true })
76
+ FF_Fields.dateOnly({ allowNull: true })
77
77
  ], UIEntity.prototype, "arrivalDateOnly", void 0);
78
78
  UIEntity = __decorate([
79
79
  Entity('uiEntities', {
package/esm/vite/index.js CHANGED
@@ -2,7 +2,7 @@ import { mergeConfig } from 'vite';
2
2
  import { kitRoutes } from 'vite-plugin-kit-routes';
3
3
  import { stripper } from 'vite-plugin-stripper';
4
4
  // import { Log } from '@kitql/helpers'
5
- const toRemove = ['oslo/password', 'oslo', '@kitql/internals', '$env/dynamic/private'];
5
+ const toRemove = ['oslo/password', 'oslo'];
6
6
  export function firstly(options) {
7
7
  // const log = new Log('firstly')
8
8
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firstly",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "description": "Firstly, an opinionated Remult setup!",
6
6
  "repository": {
@@ -14,11 +14,12 @@
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@sveltejs/kit": ">=1.0.0 <3.0.0",
17
- "remult": "0.26.15",
18
- "svelte": ">=4.0.1"
17
+ "remult": "0.27.4",
18
+ "svelte": ">=4.2.18"
19
19
  },
20
20
  "dependencies": {
21
21
  "@clack/prompts": "^0.7.0",
22
+ "@kitql/internals": "0.9.8",
22
23
  "@mdi/js": "^7.4.47",
23
24
  "@melt-ui/svelte": "^0.81.0",
24
25
  "@types/nodemailer": "^6.4.15",
@@ -32,8 +33,8 @@
32
33
  "oslo": "^1.2.0",
33
34
  "tailwind-merge": "^2.3.0",
34
35
  "tailwindcss": "^3.4.3",
35
- "vite": "^5.2.10",
36
- "vite-plugin-kit-routes": "^0.6.2",
36
+ "vite": "^5.4.1",
37
+ "vite-plugin-kit-routes": "^0.6.5",
37
38
  "vite-plugin-stripper": "^0.5.0"
38
39
  },
39
40
  "sideEffects": false,
@@ -67,6 +68,10 @@
67
68
  "types": "./esm/auth/index.d.ts",
68
69
  "default": "./esm/auth/index.js"
69
70
  },
71
+ "./auth/client": {
72
+ "types": "./esm/auth/client/index.d.ts",
73
+ "default": "./esm/auth/client/index.js"
74
+ },
70
75
  "./auth/providers": {
71
76
  "types": "./esm/auth/providers/index.d.ts",
72
77
  "default": "./esm/auth/providers/index.js"
@@ -1 +0,0 @@
1
- export declare const LogToConsoleCustom: (duration: number, query: string, args: Record<string, any>, short?: boolean) => string | undefined;
@@ -1,57 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BackendMethod, repo } from 'remult';
8
- import { cyan, green, Log, yellow } from '@kitql/helpers';
9
- import { KitAuthUser } from './Entities';
10
- /**
11
- * will merge the roles and remove duplicates
12
- * will return a new array & a status if the array was changed
13
- */
14
- export const mergeRoles = (existing, newOnes) => {
15
- const result = new Set(existing);
16
- let changed = false;
17
- for (const role of newOnes ?? []) {
18
- if (!result.has(role)) {
19
- result.add(role);
20
- changed = true;
21
- }
22
- }
23
- return { roles: Array.from(result), changed };
24
- };
25
- export class RoleController {
26
- // @ts-ignore (for pnpm check)
27
- static initRoleFromEnv = async (log, userEntity, envKey, role) => {
28
- // @ts-ignore (for pnpm check)
29
- const { env } = await import('$env/dynamic/private');
30
- const names = env[envKey] === undefined ? [] : (env[envKey] ?? '').split(',');
31
- for (let i = 0; i < names.length; i++) {
32
- const name = names[i].trim();
33
- if (name !== '') {
34
- let user = await repo(userEntity).findFirst({ name });
35
- if (!user) {
36
- user = repo(userEntity).create({ name, roles: [role] });
37
- await repo(userEntity).save(user);
38
- }
39
- else {
40
- if (!user.roles.includes(role)) {
41
- user.roles.push(role);
42
- await repo(userEntity).save(user);
43
- }
44
- }
45
- }
46
- }
47
- if (names.length > 0) {
48
- log.info(`${cyan(role)}: ${names.map((c) => green(c.trim())).join(', ')} added via ${yellow(envKey)}.`);
49
- }
50
- else {
51
- log.info(`${cyan(role)}: No users added via ${yellow(envKey)}.`);
52
- }
53
- };
54
- }
55
- __decorate([
56
- BackendMethod({ allowed: false })
57
- ], RoleController, "initRoleFromEnv", void 0);
@@ -1,5 +0,0 @@
1
- export { no as default };
2
- declare class no extends Je {
3
- constructor(e: any);
4
- }
5
- import { S as Je } from "./index-CKmKKRRL.js";