@sqrzro/addon-admins 4.0.0-alpha.3 → 4.0.0-alpha.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.
- package/dist/addon/config.d.ts +2 -1
- package/dist/addon/config.d.ts.map +1 -1
- package/dist/addon/config.js +3 -2
- package/dist/addon/defaults.d.ts +4 -0
- package/dist/addon/defaults.d.ts.map +1 -0
- package/dist/addon/defaults.js +6 -0
- package/dist/addon/index.d.ts +2 -2
- package/dist/addon/index.d.ts.map +1 -1
- package/dist/addon/index.js +4 -4
- package/dist/addon/interfaces.d.ts +2 -0
- package/dist/addon/interfaces.d.ts.map +1 -1
- package/dist/repositories/AdminRepository.d.ts.map +1 -1
- package/dist/repositories/AdminRepository.js +2 -3
- package/package.json +10 -10
package/dist/addon/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AppConfig } from '@sqrzro/config';
|
|
1
2
|
import type { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
2
3
|
import type { AdminsAddonConfigObject, BaseAdminsAddonConfigObject } from './interfaces';
|
|
3
|
-
export declare function setConfig(db: NodePgDatabase, cfg?: BaseAdminsAddonConfigObject): void;
|
|
4
|
+
export declare function setConfig(db: NodePgDatabase, appConfig: AppConfig, cfg?: Partial<BaseAdminsAddonConfigObject>): void;
|
|
4
5
|
export declare function getConfig(): AdminsAddonConfigObject;
|
|
5
6
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/addon/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/addon/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAIzF,wBAAgB,SAAS,CACrB,EAAE,EAAE,cAAc,EAClB,SAAS,EAAE,SAAS,EACpB,GAAG,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,GAC3C,IAAI,CAEN;AAED,wBAAgB,SAAS,IAAI,uBAAuB,CAKnD"}
|
package/dist/addon/config.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MissingConfigError } from '@sqrzro/addons';
|
|
2
|
+
import applyDefaults from './defaults';
|
|
2
3
|
let config = null;
|
|
3
|
-
export function setConfig(db, cfg) {
|
|
4
|
-
config = { ...cfg, db };
|
|
4
|
+
export function setConfig(db, appConfig, cfg) {
|
|
5
|
+
config = { ...applyDefaults(cfg), db, app: appConfig };
|
|
5
6
|
}
|
|
6
7
|
export function getConfig() {
|
|
7
8
|
if (!config) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/addon/defaults.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAIhE,iBAAS,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,GAAG,2BAA2B,CAEjG;AAED,eAAe,aAAa,CAAC"}
|
package/dist/addon/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AddonRegisterFunction } from '@sqrzro/addons';
|
|
2
2
|
import { BaseAdminsAddonConfigObject } from './interfaces';
|
|
3
3
|
export * from './interfaces';
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const withAdmin: AddonRegisterFunction<Partial<BaseAdminsAddonConfigObject>>;
|
|
5
|
+
export default withAdmin;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/addon/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/addon/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,cAAc,cAAc,CAAC;AAE7B,QAAA,MAAM,SAAS,EAAE,qBAAqB,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAOzE,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
package/dist/addon/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { setConfig } from './config';
|
|
2
2
|
export * from './interfaces';
|
|
3
|
-
const
|
|
4
|
-
register: (db) => {
|
|
5
|
-
setConfig(db, config);
|
|
3
|
+
const withAdmin = (config) => ({
|
|
4
|
+
register: (db, appConfig) => {
|
|
5
|
+
setConfig(db, appConfig, config);
|
|
6
6
|
},
|
|
7
7
|
schema: '@sqrzro/addon-admins/schema',
|
|
8
8
|
});
|
|
9
|
-
export default
|
|
9
|
+
export default withAdmin;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { AppConfig } from '@sqrzro/config';
|
|
1
2
|
import type { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
2
3
|
export interface BaseAdminsAddonConfigObject {
|
|
3
4
|
}
|
|
4
5
|
export interface AdminsAddonConfigObject extends BaseAdminsAddonConfigObject {
|
|
6
|
+
app: AppConfig;
|
|
5
7
|
db: NodePgDatabase;
|
|
6
8
|
}
|
|
7
9
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/addon/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,WAAW,2BAA2B;CAAG;AAE/C,MAAM,WAAW,uBAAwB,SAAQ,2BAA2B;IACxE,EAAE,EAAE,cAAc,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/addon/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,WAAW,2BAA2B;CAAG;AAE/C,MAAM,WAAW,uBAAwB,SAAQ,2BAA2B;IACxE,GAAG,EAAE,SAAS,CAAC;IACf,EAAE,EAAE,cAAc,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/AdminRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/AdminRepository.ts"],"names":[],"mappings":"AAUA,OAAO,EAAgB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAK9D,eAAO,MAAM,UAAU,MAAM,CAAC;;wBA2EA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA1B0B,OAAO;;;;;;;;YAAP,OAAO;;;;;;;;;;;;;;AAwBrE,wBAGE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { extendRepository } from '@sqrzro/addons';
|
|
2
2
|
import withAuth from '@sqrzro/addon-auth/repository';
|
|
3
|
-
import { getAppConfig } from '@sqrzro/config';
|
|
4
3
|
import { createRepository } from '@sqrzro/server/database';
|
|
5
4
|
import { generateID } from '@sqrzro/server/utility';
|
|
6
5
|
import { pick } from '@sqrzro/utility';
|
|
@@ -60,9 +59,9 @@ const BaseAdminRepository = createRepository({
|
|
|
60
59
|
prefix: ADMIN_PREFIX,
|
|
61
60
|
});
|
|
62
61
|
const AdminRepository = extendRepository(BaseAdminRepository, withAuth({ role: ADMIN_ROLE }), withOnboarding({
|
|
63
|
-
|
|
64
|
-
baseURL: getAppConfig().app.url,
|
|
62
|
+
baseURL: getConfig().app.site.url,
|
|
65
63
|
role: ADMIN_ROLE,
|
|
64
|
+
siteName: getConfig().app.site.name,
|
|
66
65
|
}));
|
|
67
66
|
export default {
|
|
68
67
|
...AdminRepository,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqrzro/addon-admins",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.5",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "ISC",
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"drizzle-orm": "^0.45.1",
|
|
27
27
|
"zod": "^4.3.6",
|
|
28
|
-
"@sqrzro/
|
|
29
|
-
"@sqrzro/
|
|
30
|
-
"@sqrzro/addon-onboarding": "^4.0.0-alpha.
|
|
31
|
-
"@sqrzro/admin": "^4.0.0-alpha.
|
|
32
|
-
"@sqrzro/config": "^4.0.0-alpha.
|
|
33
|
-
"@sqrzro/server": "^4.0.0-alpha.33",
|
|
28
|
+
"@sqrzro/addons": "^4.0.0-alpha.5",
|
|
29
|
+
"@sqrzro/addon-auth": "^4.0.0-alpha.6",
|
|
30
|
+
"@sqrzro/addon-onboarding": "^4.0.0-alpha.8",
|
|
31
|
+
"@sqrzro/admin": "^4.0.0-alpha.16",
|
|
32
|
+
"@sqrzro/config": "^4.0.0-alpha.3",
|
|
34
33
|
"@sqrzro/utility": "^4.0.0-alpha.15",
|
|
35
|
-
"@sqrzro/ui": "^4.0.0-alpha.
|
|
34
|
+
"@sqrzro/ui": "^4.0.0-alpha.41",
|
|
35
|
+
"@sqrzro/server": "^4.0.0-alpha.33"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/react": "^19.2.14",
|
|
39
39
|
"prettier": "^3.8.1",
|
|
40
40
|
"typescript": "^5.9.3",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
41
|
+
"@sqrzro/prettier-config": "^4.0.0-alpha.3",
|
|
42
|
+
"szx": "^4.0.0-alpha.5"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"next": "^16.1.6",
|