adminforth 1.21.0-next.13 → 1.21.0-next.15

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.
@@ -14,7 +14,6 @@
14
14
  "apexcharts": "^4.4.0",
15
15
  "dayjs": "^1.11.11",
16
16
  "debounce": "^2.1.0",
17
- "flowbite": "^2.3.0",
18
17
  "flowbite-datepicker": "^1.2.6",
19
18
  "javascript-time-ago": "^2.5.11",
20
19
  "pinia": "^2.1.7",
@@ -38,6 +37,7 @@
38
37
  "eslint": "^8.57.0",
39
38
  "eslint-plugin-vue": "^9.23.0",
40
39
  "flag-icons": "^7.2.3",
40
+ "flowbite": "^3.1.2",
41
41
  "i18n-iso-countries": "^7.12.0",
42
42
  "npm-run-all2": "^6.1.2",
43
43
  "portfinder": "^1.0.32",
@@ -811,6 +811,64 @@
811
811
  "url": "https://opencollective.com/popperjs"
812
812
  }
813
813
  },
814
+ "node_modules/@rollup/plugin-node-resolve": {
815
+ "version": "15.3.1",
816
+ "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.3.1.tgz",
817
+ "integrity": "sha512-tgg6b91pAybXHJQMAAwW9VuWBO6Thi+q7BCNARLwSqlmsHz0XYURtGvh/AuwSADXSI4h/2uHbs7s4FzlZDGSGA==",
818
+ "license": "MIT",
819
+ "dependencies": {
820
+ "@rollup/pluginutils": "^5.0.1",
821
+ "@types/resolve": "1.20.2",
822
+ "deepmerge": "^4.2.2",
823
+ "is-module": "^1.0.0",
824
+ "resolve": "^1.22.1"
825
+ },
826
+ "engines": {
827
+ "node": ">=14.0.0"
828
+ },
829
+ "peerDependencies": {
830
+ "rollup": "^2.78.0||^3.0.0||^4.0.0"
831
+ },
832
+ "peerDependenciesMeta": {
833
+ "rollup": {
834
+ "optional": true
835
+ }
836
+ }
837
+ },
838
+ "node_modules/@rollup/pluginutils": {
839
+ "version": "5.1.4",
840
+ "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
841
+ "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==",
842
+ "license": "MIT",
843
+ "dependencies": {
844
+ "@types/estree": "^1.0.0",
845
+ "estree-walker": "^2.0.2",
846
+ "picomatch": "^4.0.2"
847
+ },
848
+ "engines": {
849
+ "node": ">=14.0.0"
850
+ },
851
+ "peerDependencies": {
852
+ "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
853
+ },
854
+ "peerDependenciesMeta": {
855
+ "rollup": {
856
+ "optional": true
857
+ }
858
+ }
859
+ },
860
+ "node_modules/@rollup/pluginutils/node_modules/picomatch": {
861
+ "version": "4.0.2",
862
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
863
+ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
864
+ "license": "MIT",
865
+ "engines": {
866
+ "node": ">=12"
867
+ },
868
+ "funding": {
869
+ "url": "https://github.com/sponsors/jonschlinkert"
870
+ }
871
+ },
814
872
  "node_modules/@rollup/rollup-android-arm-eabi": {
815
873
  "version": "4.17.2",
816
874
  "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz",
@@ -1090,8 +1148,7 @@
1090
1148
  "node_modules/@types/estree": {
1091
1149
  "version": "1.0.5",
1092
1150
  "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
1093
- "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
1094
- "dev": true
1151
+ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw=="
1095
1152
  },
1096
1153
  "node_modules/@types/node": {
1097
1154
  "version": "20.12.12",
@@ -1102,6 +1159,12 @@
1102
1159
  "undici-types": "~5.26.4"
1103
1160
  }
1104
1161
  },
1162
+ "node_modules/@types/resolve": {
1163
+ "version": "1.20.2",
1164
+ "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
1165
+ "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
1166
+ "license": "MIT"
1167
+ },
1105
1168
  "node_modules/@types/web-bluetooth": {
1106
1169
  "version": "0.0.20",
1107
1170
  "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
@@ -2648,22 +2711,39 @@
2648
2711
  "dev": true
2649
2712
  },
2650
2713
  "node_modules/flowbite": {
2651
- "version": "2.3.0",
2652
- "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-2.3.0.tgz",
2653
- "integrity": "sha512-pm3JRo8OIJHGfFYWgaGpPv8E+UdWy0Z3gEAGufw+G/1dusaU/P1zoBLiQpf2/+bYAi+GBQtPVG86KYlV0W+AFQ==",
2714
+ "version": "3.1.2",
2715
+ "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-3.1.2.tgz",
2716
+ "integrity": "sha512-MkwSgbbybCYgMC+go6Da5idEKUFfMqc/AmSjm/2ZbdmvoKf5frLPq/eIhXc9P+rC8t9boZtUXzHDgt5whZ6A/Q==",
2717
+ "dev": true,
2718
+ "license": "MIT",
2654
2719
  "dependencies": {
2655
2720
  "@popperjs/core": "^2.9.3",
2656
- "mini-svg-data-uri": "^1.4.3"
2721
+ "flowbite-datepicker": "^1.3.1",
2722
+ "mini-svg-data-uri": "^1.4.3",
2723
+ "postcss": "^8.5.1"
2657
2724
  }
2658
2725
  },
2659
2726
  "node_modules/flowbite-datepicker": {
2660
- "version": "1.2.6",
2661
- "resolved": "https://registry.npmjs.org/flowbite-datepicker/-/flowbite-datepicker-1.2.6.tgz",
2662
- "integrity": "sha512-UbU/xXs9HFiwWfL4M1vpwIo8EpS0NUQSOvYnp0Z9u3N118nU7lPFGoUOq7su9d0aOJy9FssXzx1SZwN8MXhE1g==",
2727
+ "version": "1.3.2",
2728
+ "resolved": "https://registry.npmjs.org/flowbite-datepicker/-/flowbite-datepicker-1.3.2.tgz",
2729
+ "integrity": "sha512-6Nfm0MCVX3mpaR7YSCjmEO2GO8CDt6CX8ZpQnGdeu03WUCWtEPQ/uy0PUiNtIJjJZWnX0Cm3H55MOhbD1g+E/g==",
2730
+ "license": "MIT",
2663
2731
  "dependencies": {
2732
+ "@rollup/plugin-node-resolve": "^15.2.3",
2664
2733
  "flowbite": "^2.0.0"
2665
2734
  }
2666
2735
  },
2736
+ "node_modules/flowbite-datepicker/node_modules/flowbite": {
2737
+ "version": "2.5.2",
2738
+ "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-2.5.2.tgz",
2739
+ "integrity": "sha512-kwFD3n8/YW4EG8GlY3Od9IoKND97kitO+/ejISHSqpn3vw2i5K/+ZI8Jm2V+KC4fGdnfi0XZ+TzYqQb4Q1LshA==",
2740
+ "license": "MIT",
2741
+ "dependencies": {
2742
+ "@popperjs/core": "^2.9.3",
2743
+ "flowbite-datepicker": "^1.3.0",
2744
+ "mini-svg-data-uri": "^1.4.3"
2745
+ }
2746
+ },
2667
2747
  "node_modules/foreground-child": {
2668
2748
  "version": "3.1.1",
2669
2749
  "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
@@ -2717,7 +2797,6 @@
2717
2797
  "version": "1.1.2",
2718
2798
  "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
2719
2799
  "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
2720
- "dev": true,
2721
2800
  "funding": {
2722
2801
  "url": "https://github.com/sponsors/ljharb"
2723
2802
  }
@@ -2840,7 +2919,6 @@
2840
2919
  "version": "2.0.2",
2841
2920
  "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
2842
2921
  "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
2843
- "dev": true,
2844
2922
  "dependencies": {
2845
2923
  "function-bind": "^1.1.2"
2846
2924
  },
@@ -2973,7 +3051,6 @@
2973
3051
  "version": "2.13.1",
2974
3052
  "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
2975
3053
  "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
2976
- "dev": true,
2977
3054
  "dependencies": {
2978
3055
  "hasown": "^2.0.0"
2979
3056
  },
@@ -3011,6 +3088,12 @@
3011
3088
  "node": ">=0.10.0"
3012
3089
  }
3013
3090
  },
3091
+ "node_modules/is-module": {
3092
+ "version": "1.0.0",
3093
+ "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
3094
+ "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==",
3095
+ "license": "MIT"
3096
+ },
3014
3097
  "node_modules/is-number": {
3015
3098
  "version": "7.0.0",
3016
3099
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
@@ -3327,15 +3410,16 @@
3327
3410
  }
3328
3411
  },
3329
3412
  "node_modules/nanoid": {
3330
- "version": "3.3.7",
3331
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
3332
- "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
3413
+ "version": "3.3.11",
3414
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
3415
+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
3333
3416
  "funding": [
3334
3417
  {
3335
3418
  "type": "github",
3336
3419
  "url": "https://github.com/sponsors/ai"
3337
3420
  }
3338
3421
  ],
3422
+ "license": "MIT",
3339
3423
  "bin": {
3340
3424
  "nanoid": "bin/nanoid.cjs"
3341
3425
  },
@@ -3558,8 +3642,7 @@
3558
3642
  "node_modules/path-parse": {
3559
3643
  "version": "1.0.7",
3560
3644
  "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
3561
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
3562
- "dev": true
3645
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
3563
3646
  },
3564
3647
  "node_modules/path-scurry": {
3565
3648
  "version": "1.11.1",
@@ -3710,9 +3793,9 @@
3710
3793
  }
3711
3794
  },
3712
3795
  "node_modules/postcss": {
3713
- "version": "8.4.47",
3714
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz",
3715
- "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==",
3796
+ "version": "8.5.3",
3797
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
3798
+ "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
3716
3799
  "funding": [
3717
3800
  {
3718
3801
  "type": "opencollective",
@@ -3729,8 +3812,8 @@
3729
3812
  ],
3730
3813
  "license": "MIT",
3731
3814
  "dependencies": {
3732
- "nanoid": "^3.3.7",
3733
- "picocolors": "^1.1.0",
3815
+ "nanoid": "^3.3.8",
3816
+ "picocolors": "^1.1.1",
3734
3817
  "source-map-js": "^1.2.1"
3735
3818
  },
3736
3819
  "engines": {
@@ -3936,7 +4019,6 @@
3936
4019
  "version": "1.22.8",
3937
4020
  "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
3938
4021
  "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
3939
- "dev": true,
3940
4022
  "dependencies": {
3941
4023
  "is-core-module": "^2.13.0",
3942
4024
  "path-parse": "^1.0.7",
@@ -3987,7 +4069,7 @@
3987
4069
  "version": "4.17.2",
3988
4070
  "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz",
3989
4071
  "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==",
3990
- "dev": true,
4072
+ "devOptional": true,
3991
4073
  "dependencies": {
3992
4074
  "@types/estree": "1.0.5"
3993
4075
  },
@@ -4312,7 +4394,6 @@
4312
4394
  "version": "1.0.0",
4313
4395
  "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
4314
4396
  "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
4315
- "dev": true,
4316
4397
  "engines": {
4317
4398
  "node": ">= 0.4"
4318
4399
  },
@@ -19,7 +19,6 @@
19
19
  "apexcharts": "^4.4.0",
20
20
  "dayjs": "^1.11.11",
21
21
  "debounce": "^2.1.0",
22
- "flowbite": "^2.3.0",
23
22
  "flowbite-datepicker": "^1.2.6",
24
23
  "javascript-time-ago": "^2.5.11",
25
24
  "pinia": "^2.1.7",
@@ -43,6 +42,7 @@
43
42
  "eslint": "^8.57.0",
44
43
  "eslint-plugin-vue": "^9.23.0",
45
44
  "flag-icons": "^7.2.3",
45
+ "flowbite": "^3.1.2",
46
46
  "i18n-iso-countries": "^7.12.0",
47
47
  "npm-run-all2": "^6.1.2",
48
48
  "portfinder": "^1.0.32",
@@ -1,6 +1,19 @@
1
1
  export interface EmailAdapter {
2
+
3
+ /**
4
+ * This method is called to validate the configuration of the adapter
5
+ * and should throw a clear user-readbale error if the configuration is invalid.
6
+ */
2
7
  validate(): Promise<void>;
3
8
 
9
+ /**
10
+ * This method should send an email using the adapter
11
+ * @param from - The sender's email address
12
+ * @param to - The recipient's email address
13
+ * @param text - The plain text version of the email
14
+ * @param html - The HTML version of the email
15
+ * @param subject - The subject of the email
16
+ */
4
17
  sendEmail(
5
18
  from: string,
6
19
  to: string,
@@ -15,8 +28,19 @@ export interface EmailAdapter {
15
28
 
16
29
  export interface CompletionAdapter {
17
30
 
31
+ /**
32
+ * This method is called to validate the configuration of the adapter
33
+ * and should throw a clear user-readbale error if the configuration is invalid.
34
+ */
18
35
  validate(): void;
19
36
 
37
+ /**
38
+ * This method should return a text completion based on the provided content and stop sequence.
39
+ * @param content - The input text to complete
40
+ * @param stop - An array of stop sequences to indicate where to stop the completion
41
+ * @param maxTokens - The maximum number of tokens to generate
42
+ * @returns A promise that resolves to an object containing the completed text and other metadata
43
+ */
20
44
  complete(
21
45
  content: string,
22
46
  stop: string[],
@@ -30,10 +54,14 @@ export interface CompletionAdapter {
30
54
 
31
55
  export interface ImageGenerationAdapter {
32
56
 
57
+ /**
58
+ * This method is called to validate the configuration of the adapter
59
+ * and should throw a clear user-readbale error if the configuration is invalid.
60
+ */
33
61
  validate(): void;
34
62
 
35
63
  /**
36
- * Return 1 or 10, or Infinity if the adapter supports multiple images
64
+ * Return max number of images which model can generate in one request
37
65
  */
38
66
  outputImagesMaxCountSupported(): number;
39
67
 
@@ -47,6 +75,14 @@ export interface ImageGenerationAdapter {
47
75
  */
48
76
  inputFileExtensionSupported(): string[];
49
77
 
78
+ /**
79
+ * This method should generate an image based on the provided prompt and input files.
80
+ * @param prompt - The prompt to generate the image
81
+ * @param inputFiles - An array of input file paths (optional)
82
+ * @param n - The number of images to generate (default is 1)
83
+ * @param size - The size of the generated image (default is the lowest dimension supported)
84
+ * @returns A promise that resolves to an object containing the generated image URLs and any error message
85
+ */
50
86
  generate({
51
87
  prompt,
52
88
  inputFiles,
@@ -68,11 +104,76 @@ export interface ImageGenerationAdapter {
68
104
  }
69
105
 
70
106
 
71
-
107
+ /**
108
+ * This interface is used to implement OAuth2 authentication adapters.
109
+ */
72
110
  export interface OAuth2Adapter {
111
+ /**
112
+ * This method should return navigatable URL to the OAuth2 provider authentication page.
113
+ */
73
114
  getAuthUrl(): string;
115
+
116
+ /**
117
+ * This method should return the token from the OAuth2 provider using the provided code and redirect URI.
118
+ * @param code - The authorization code received from the OAuth2 provider
119
+ * @param redirect_uri - The redirect URI used in the authentication request
120
+ * @returns A promise that resolves to an object containing the email address of the authenticated user
121
+ */
74
122
  getTokenFromCode(code: string, redirect_uri: string): Promise<{ email: string }>;
123
+
124
+ /**
125
+ * This method should return text (content) of SVG icon which will be used in the UI.
126
+ * Use official SVG icons with simplest possible conent, omit icons which have base64 encoded raster images inside.
127
+ */
75
128
  getIcon(): string;
129
+
130
+ /**
131
+ * This method should return the text to be displayed on the button in the UI
132
+ */
76
133
  getButtonText?(): string;
134
+
135
+ /**
136
+ * This method should return the name of the adapter
137
+ */
77
138
  getName?(): string;
78
139
  }
140
+
141
+
142
+ export interface StorageAdapter {
143
+ /**
144
+ * This method should return the presigned URL for the given key capable of upload.
145
+ * The PUT method should fail if the file already exists.
146
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
147
+ * @param expiresIn - The expiration time in seconds for the presigned URL
148
+ */
149
+ getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
150
+
151
+ /**
152
+ * This method should return the presigned URL for the given key capable of download
153
+ * @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
154
+ * @param expiresIn - The expiration time in seconds for the presigned URL
155
+ */
156
+ getDownloadSignedUrl(key: string, expiresIn?: number): Promise<string>;
157
+
158
+ /**
159
+ * This method should mark the file for deletion.
160
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
161
+ */
162
+ markKeyForDeletation(key: string): Promise<string>;
163
+
164
+
165
+ /**
166
+ * This method should return the list of files in the storage.
167
+ * @param key
168
+ */
169
+ markKeyForNotDeletation(key: string): Promise<string>;
170
+
171
+
172
+ /**
173
+ * THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
174
+ */
175
+ setupLifecycle(): Promise<void>;
176
+
177
+ }
178
+
179
+
@@ -1,12 +1,35 @@
1
1
  export interface EmailAdapter {
2
+ /**
3
+ * This method is called to validate the configuration of the adapter
4
+ * and should throw a clear user-readbale error if the configuration is invalid.
5
+ */
2
6
  validate(): Promise<void>;
7
+ /**
8
+ * This method should send an email using the adapter
9
+ * @param from - The sender's email address
10
+ * @param to - The recipient's email address
11
+ * @param text - The plain text version of the email
12
+ * @param html - The HTML version of the email
13
+ * @param subject - The subject of the email
14
+ */
3
15
  sendEmail(from: string, to: string, text: string, html: string, subject: string): Promise<{
4
16
  error?: string;
5
17
  ok?: boolean;
6
18
  }>;
7
19
  }
8
20
  export interface CompletionAdapter {
21
+ /**
22
+ * This method is called to validate the configuration of the adapter
23
+ * and should throw a clear user-readbale error if the configuration is invalid.
24
+ */
9
25
  validate(): void;
26
+ /**
27
+ * This method should return a text completion based on the provided content and stop sequence.
28
+ * @param content - The input text to complete
29
+ * @param stop - An array of stop sequences to indicate where to stop the completion
30
+ * @param maxTokens - The maximum number of tokens to generate
31
+ * @returns A promise that resolves to an object containing the completed text and other metadata
32
+ */
10
33
  complete(content: string, stop: string[], maxTokens: number): Promise<{
11
34
  content?: string;
12
35
  finishReason?: string;
@@ -14,9 +37,13 @@ export interface CompletionAdapter {
14
37
  }>;
15
38
  }
16
39
  export interface ImageGenerationAdapter {
40
+ /**
41
+ * This method is called to validate the configuration of the adapter
42
+ * and should throw a clear user-readbale error if the configuration is invalid.
43
+ */
17
44
  validate(): void;
18
45
  /**
19
- * Return 1 or 10, or Infinity if the adapter supports multiple images
46
+ * Return max number of images which model can generate in one request
20
47
  */
21
48
  outputImagesMaxCountSupported(): number;
22
49
  /**
@@ -27,6 +54,14 @@ export interface ImageGenerationAdapter {
27
54
  * Input file extension supported
28
55
  */
29
56
  inputFileExtensionSupported(): string[];
57
+ /**
58
+ * This method should generate an image based on the provided prompt and input files.
59
+ * @param prompt - The prompt to generate the image
60
+ * @param inputFiles - An array of input file paths (optional)
61
+ * @param n - The number of images to generate (default is 1)
62
+ * @param size - The size of the generated image (default is the lowest dimension supported)
63
+ * @returns A promise that resolves to an object containing the generated image URLs and any error message
64
+ */
30
65
  generate({ prompt, inputFiles, n, size, }: {
31
66
  prompt: string;
32
67
  inputFiles: string[];
@@ -37,13 +72,64 @@ export interface ImageGenerationAdapter {
37
72
  error?: string;
38
73
  }>;
39
74
  }
75
+ /**
76
+ * This interface is used to implement OAuth2 authentication adapters.
77
+ */
40
78
  export interface OAuth2Adapter {
79
+ /**
80
+ * This method should return navigatable URL to the OAuth2 provider authentication page.
81
+ */
41
82
  getAuthUrl(): string;
83
+ /**
84
+ * This method should return the token from the OAuth2 provider using the provided code and redirect URI.
85
+ * @param code - The authorization code received from the OAuth2 provider
86
+ * @param redirect_uri - The redirect URI used in the authentication request
87
+ * @returns A promise that resolves to an object containing the email address of the authenticated user
88
+ */
42
89
  getTokenFromCode(code: string, redirect_uri: string): Promise<{
43
90
  email: string;
44
91
  }>;
92
+ /**
93
+ * This method should return text (content) of SVG icon which will be used in the UI.
94
+ * Use official SVG icons with simplest possible conent, omit icons which have base64 encoded raster images inside.
95
+ */
45
96
  getIcon(): string;
97
+ /**
98
+ * This method should return the text to be displayed on the button in the UI
99
+ */
46
100
  getButtonText?(): string;
101
+ /**
102
+ * This method should return the name of the adapter
103
+ */
47
104
  getName?(): string;
48
105
  }
106
+ export interface StorageAdapter {
107
+ /**
108
+ * This method should return the presigned URL for the given key capable of upload.
109
+ * The PUT method should fail if the file already exists.
110
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
111
+ * @param expiresIn - The expiration time in seconds for the presigned URL
112
+ */
113
+ getUploadSignedUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
114
+ /**
115
+ * This method should return the presigned URL for the given key capable of download
116
+ * @param key - The key of the file to be downloaded e.g. "uploads/file.txt"
117
+ * @param expiresIn - The expiration time in seconds for the presigned URL
118
+ */
119
+ getDownloadSignedUrl(key: string, expiresIn?: number): Promise<string>;
120
+ /**
121
+ * This method should mark the file for deletion.
122
+ * @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
123
+ */
124
+ markKeyForDeletation(key: string): Promise<string>;
125
+ /**
126
+ * This method should return the list of files in the storage.
127
+ * @param key
128
+ */
129
+ markKeyForNotDeletation(key: string): Promise<string>;
130
+ /**
131
+ * THis method can start needed schedullers, cron jobs, etc. to clean up the storage.
132
+ */
133
+ setupLifecycle(): Promise<void>;
134
+ }
49
135
  //# sourceMappingURL=Adapters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Adapters.d.ts","sourceRoot":"","sources":["../../types/Adapters.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B,SAAS,CACP,IAAI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ue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",