@intlayer/backend 7.5.0-canary.1 → 7.5.1
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/assets/utils/AI/askDocQuestion/embeddings/blog/en/l10n_platform_alternative/Lokalise.json +4106 -0
- package/dist/assets/utils/AI/askDocQuestion/embeddings/blog/en/l10n_platform_alternative/crowdin.json +4106 -0
- package/dist/assets/utils/AI/askDocQuestion/embeddings/blog/en/l10n_platform_alternative/phrase.json +4106 -0
- package/dist/assets/utils/AI/askDocQuestion/embeddings/docs/en/configuration.json +13340 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/routes/organization.routes.mjs +6 -0
- package/dist/esm/routes/organization.routes.mjs.map +1 -1
- package/dist/esm/schemas/organization.schema.mjs +8 -48
- package/dist/esm/schemas/organization.schema.mjs.map +1 -1
- package/dist/esm/utils/auth/getAuth.mjs +13 -4
- package/dist/esm/utils/auth/getAuth.mjs.map +1 -1
- package/dist/esm/utils/mongoDB/connectDB.mjs +12 -2
- package/dist/esm/utils/mongoDB/connectDB.mjs.map +1 -1
- package/dist/types/controllers/dictionary.controller.d.ts.map +1 -1
- package/dist/types/controllers/tag.controller.d.ts.map +1 -1
- package/dist/types/emails/InviteUserEmail.d.ts +4 -4
- package/dist/types/emails/InviteUserEmail.d.ts.map +1 -1
- package/dist/types/emails/MagicLinkEmail.d.ts +4 -4
- package/dist/types/emails/MagicLinkEmail.d.ts.map +1 -1
- package/dist/types/emails/OAuthTokenCreatedEmail.d.ts +4 -4
- package/dist/types/emails/OAuthTokenCreatedEmail.d.ts.map +1 -1
- package/dist/types/emails/PasswordChangeConfirmation.d.ts +4 -4
- package/dist/types/emails/ResetUserPassword.d.ts +4 -4
- package/dist/types/emails/ResetUserPassword.d.ts.map +1 -1
- package/dist/types/emails/SubscriptionPaymentCancellation.d.ts +4 -4
- package/dist/types/emails/SubscriptionPaymentError.d.ts +4 -4
- package/dist/types/emails/SubscriptionPaymentError.d.ts.map +1 -1
- package/dist/types/emails/SubscriptionPaymentSuccess.d.ts +4 -4
- package/dist/types/emails/ValidateUserEmail.d.ts +4 -4
- package/dist/types/emails/Welcome.d.ts +4 -4
- package/dist/types/export.d.ts +2 -2
- package/dist/types/models/dictionary.model.d.ts +4 -4
- package/dist/types/models/dictionary.model.d.ts.map +1 -1
- package/dist/types/models/discussion.model.d.ts +2 -2
- package/dist/types/models/oAuth2.model.d.ts +3 -3
- package/dist/types/routes/ai.routes.d.ts.map +1 -1
- package/dist/types/routes/eventListener.routes.d.ts.map +1 -1
- package/dist/types/routes/newsletter.routes.d.ts.map +1 -1
- package/dist/types/routes/organization.routes.d.ts +5 -0
- package/dist/types/routes/organization.routes.d.ts.map +1 -1
- package/dist/types/routes/search.routes.d.ts.map +1 -1
- package/dist/types/routes/stripe.routes.d.ts.map +1 -1
- package/dist/types/routes/tags.routes.d.ts.map +1 -1
- package/dist/types/routes/user.routes.d.ts.map +1 -1
- package/dist/types/schemas/dictionary.schema.d.ts +6 -6
- package/dist/types/schemas/discussion.schema.d.ts +6 -6
- package/dist/types/schemas/oAuth2.schema.d.ts +5 -5
- package/dist/types/schemas/oAuth2.schema.d.ts.map +1 -1
- package/dist/types/schemas/organization.schema.d.ts.map +1 -1
- package/dist/types/schemas/plans.schema.d.ts +6 -6
- package/dist/types/schemas/project.schema.d.ts +6 -6
- package/dist/types/schemas/session.schema.d.ts +6 -6
- package/dist/types/schemas/tag.schema.d.ts +6 -6
- package/dist/types/schemas/user.schema.d.ts +6 -6
- package/dist/types/services/email.service.d.ts +11 -11
- package/dist/types/types/organization.types.d.ts +9 -58
- package/dist/types/types/organization.types.d.ts.map +1 -1
- package/dist/types/utils/auth/getAuth.d.ts.map +1 -1
- package/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/mongoDB/connectDB.d.ts +8 -3
- package/dist/types/utils/mongoDB/connectDB.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -6,71 +6,22 @@ import { Document, Model, ObjectIdToString, Types } from "mongoose";
|
|
|
6
6
|
//#region src/types/organization.types.d.ts
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* SSO
|
|
9
|
+
* Note: SSO configuration is managed entirely by better-auth's SSO plugin.
|
|
10
|
+
* The organization only stores a reference to whether SSO is enabled
|
|
11
|
+
* and the domain for SSO provider lookup.
|
|
12
|
+
* See: https://www.better-auth.com/docs/plugins/sso
|
|
10
13
|
*/
|
|
11
|
-
type SSOProviderType = 'saml' | 'oidc';
|
|
12
|
-
/**
|
|
13
|
-
* SAML Configuration for SSO
|
|
14
|
-
*/
|
|
15
|
-
type SAMLConfig = {
|
|
16
|
-
/** The URL where the IdP receives SAML requests */
|
|
17
|
-
idpEntityId: string;
|
|
18
|
-
/** The URL where the IdP sends SAML responses (SSO URL) */
|
|
19
|
-
idpSSOUrl: string;
|
|
20
|
-
/** The IdP's public certificate for signature verification (PEM format) */
|
|
21
|
-
idpCertificate: string;
|
|
22
|
-
/** Optional: IdP Single Logout URL */
|
|
23
|
-
idpSLOUrl?: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* OIDC Configuration for SSO
|
|
27
|
-
*/
|
|
28
|
-
type OIDCConfig = {
|
|
29
|
-
/** The OIDC issuer URL (e.g., https://accounts.google.com) */
|
|
30
|
-
issuer: string;
|
|
31
|
-
/** OAuth2 Client ID */
|
|
32
|
-
clientId: string;
|
|
33
|
-
/** OAuth2 Client Secret */
|
|
34
|
-
clientSecret: string;
|
|
35
|
-
/** OAuth2 scopes to request */
|
|
36
|
-
scopes?: string[];
|
|
37
|
-
/** Optional: Authorization endpoint override */
|
|
38
|
-
authorizationEndpoint?: string;
|
|
39
|
-
/** Optional: Token endpoint override */
|
|
40
|
-
tokenEndpoint?: string;
|
|
41
|
-
/** Optional: User info endpoint override */
|
|
42
|
-
userinfoEndpoint?: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* SSO Configuration for an Organization
|
|
46
|
-
*/
|
|
47
|
-
type SSOConfig = {
|
|
48
|
-
/** Whether SSO is enabled for this organization */
|
|
49
|
-
enabled: boolean;
|
|
50
|
-
/** The type of SSO provider */
|
|
51
|
-
providerType?: SSOProviderType;
|
|
52
|
-
/** Unique provider ID for this organization's SSO */
|
|
53
|
-
providerId?: string;
|
|
54
|
-
/** Domain(s) associated with this SSO provider (e.g., 'company.com') */
|
|
55
|
-
domains?: string[];
|
|
56
|
-
/** SAML-specific configuration */
|
|
57
|
-
samlConfig?: SAMLConfig;
|
|
58
|
-
/** OIDC-specific configuration */
|
|
59
|
-
oidcConfig?: OIDCConfig;
|
|
60
|
-
/** Whether to enforce SSO for all users in this organization */
|
|
61
|
-
enforceSSO?: boolean;
|
|
62
|
-
/** Whether to allow users to bypass SSO with password login */
|
|
63
|
-
allowPasswordLogin?: boolean;
|
|
64
|
-
};
|
|
65
14
|
type OrganizationCreationData = {
|
|
66
15
|
name: Organization['name'];
|
|
67
|
-
ssoConfig?: SSOConfig;
|
|
68
16
|
};
|
|
69
17
|
type OrganizationData = {
|
|
70
18
|
name: string;
|
|
71
19
|
membersIds: User['id'][];
|
|
72
20
|
adminsIds: User['id'][];
|
|
73
|
-
|
|
21
|
+
/** Whether SSO is configured for this organization (managed by better-auth) */
|
|
22
|
+
ssoEnabled: boolean;
|
|
23
|
+
/** Primary domain for this organization (used for SSO provider lookup) */
|
|
24
|
+
domain: string;
|
|
74
25
|
};
|
|
75
26
|
type Organization = OrganizationData & {
|
|
76
27
|
id: Types.ObjectId;
|
|
@@ -84,5 +35,5 @@ type OrganizationSchema = RenameId<Organization>;
|
|
|
84
35
|
type OrganizationModelType = Model<Organization>;
|
|
85
36
|
type OrganizationDocument = Document<unknown, {}, Organization> & Organization;
|
|
86
37
|
//#endregion
|
|
87
|
-
export {
|
|
38
|
+
export { Organization, OrganizationAPI, OrganizationCreationData, OrganizationData, OrganizationDocument, OrganizationModelType, OrganizationSchema };
|
|
88
39
|
//# sourceMappingURL=organization.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.types.d.ts","names":[],"sources":["../../../src/types/organization.types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"organization.types.d.ts","names":[],"sources":["../../../src/types/organization.types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAYA;AAIA;AAUA;;AACY,KAfA,wBAAA,GAeA;EACC,IAAA,EAfL,YAeK,CAAA,MAAA,CAAA;CACJ;AAAI,KAbD,gBAAA,GAaC;EAKD,IAAA,EAAA,MAAA;EAEA,UAAA,EAlBE,IAkBF,CAAA,IAAkB,CAAA,EAAA;EAClB,SAAA,EAlBC,IAkBD,CAAA,IAAA,CAAA,EAAA;EACA;EAA6C,UAAA,EAAA,OAAA;EAAtB;EACjC,MAAA,EAAA,MAAA;CAAY;KAbF,YAAA,GAAe;MACrB,KAAA,CAAM;aACC;SACJ;;;;KAKG,eAAA,GAAkB,iBAAiB;KAEnC,kBAAA,GAAqB,SAAS;KAC9B,qBAAA,GAAwB,MAAM;KAC9B,oBAAA,GAAuB,sBAAsB,gBACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAuth.d.ts","names":[],"sources":["../../../../src/utils/auth/getAuth.ts"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getAuth.d.ts","names":[],"sources":["../../../../src/utils/auth/getAuth.ts"],"sourcesContent":[],"mappings":";;;;;KAiCY,IAAA,GAAO,kBAAkB;cAExB,yBAA0B,mBAAiB,OAAO;AAFnD,cAwBC,OAxBwB,EAAA,CAAA,QAAlB,EAwBe,WAxBL,EAAA,GAwBmB,IAxBnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dictionary } from "../../types/dictionary.types.js";
|
|
2
2
|
import { ResponseWithSession } from "../../middlewares/sessionAuth.middleware.js";
|
|
3
3
|
import { FiltersAndPagination } from "./getFiltersAndPaginationFromBody.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as mongoose39 from "mongoose";
|
|
5
5
|
import { RootFilterQuery } from "mongoose";
|
|
6
6
|
import { Request } from "express";
|
|
7
7
|
|
|
@@ -41,7 +41,7 @@ declare const getDictionaryFiltersAndPagination: (req: Request<FiltersAndPaginat
|
|
|
41
41
|
skip: number;
|
|
42
42
|
pageSize: number;
|
|
43
43
|
getNumberOfPages: (totalItems: number) => number;
|
|
44
|
-
filters:
|
|
44
|
+
filters: mongoose39.FilterQuery<Dictionary>;
|
|
45
45
|
sortOptions: Record<string, 1 | -1>;
|
|
46
46
|
};
|
|
47
47
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponseWithSession } from "../../middlewares/sessionAuth.middleware.js";
|
|
2
2
|
import { Discussion } from "../../types/discussion.types.js";
|
|
3
3
|
import { FiltersAndPagination } from "./getFiltersAndPaginationFromBody.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as mongoose35 from "mongoose";
|
|
5
5
|
import { RootFilterQuery } from "mongoose";
|
|
6
6
|
import { Request } from "express";
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ declare const getDiscussionFiltersAndPagination: (req: Request<FiltersAndPaginat
|
|
|
30
30
|
skip: number;
|
|
31
31
|
pageSize: number;
|
|
32
32
|
getNumberOfPages: (totalItems: number) => number;
|
|
33
|
-
filters:
|
|
33
|
+
filters: mongoose35.Types.ObjectId | mongoose35.Query<any, any, {}, unknown, "find", Record<string, never>> | mongoose35.FilterQuery<Discussion>;
|
|
34
34
|
sortOptions: Record<string, 1 | -1>;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Organization } from "../../types/organization.types.js";
|
|
2
2
|
import { ResponseWithSession } from "../../middlewares/sessionAuth.middleware.js";
|
|
3
3
|
import { FiltersAndPagination } from "./getFiltersAndPaginationFromBody.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as mongoose38 from "mongoose";
|
|
5
5
|
import { RootFilterQuery } from "mongoose";
|
|
6
6
|
import { Request } from "express";
|
|
7
7
|
|
|
@@ -37,7 +37,7 @@ declare const getOrganizationFiltersAndPagination: (req: Request<FiltersAndPagin
|
|
|
37
37
|
skip: number;
|
|
38
38
|
pageSize: number;
|
|
39
39
|
getNumberOfPages: (totalItems: number) => number;
|
|
40
|
-
filters:
|
|
40
|
+
filters: mongoose38.FilterQuery<Organization>;
|
|
41
41
|
sortOptions: Record<string, 1 | -1>;
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Project } from "../../types/project.types.js";
|
|
2
2
|
import { ResponseWithSession } from "../../middlewares/sessionAuth.middleware.js";
|
|
3
3
|
import { FiltersAndPagination } from "./getFiltersAndPaginationFromBody.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as mongoose41 from "mongoose";
|
|
5
5
|
import { RootFilterQuery } from "mongoose";
|
|
6
6
|
import { Request } from "express";
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ declare const getProjectFiltersAndPagination: (req: Request<FiltersAndPagination
|
|
|
30
30
|
skip: number;
|
|
31
31
|
pageSize: number;
|
|
32
32
|
getNumberOfPages: (totalItems: number) => number;
|
|
33
|
-
filters:
|
|
33
|
+
filters: mongoose41.FilterQuery<Project>;
|
|
34
34
|
sortOptions: Record<string, 1 | -1>;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tag } from "../../types/tag.types.js";
|
|
2
2
|
import { ResponseWithSession } from "../../middlewares/sessionAuth.middleware.js";
|
|
3
3
|
import { FiltersAndPagination } from "./getFiltersAndPaginationFromBody.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as mongoose40 from "mongoose";
|
|
5
5
|
import { RootFilterQuery } from "mongoose";
|
|
6
6
|
import { Request } from "express";
|
|
7
7
|
|
|
@@ -28,7 +28,7 @@ declare const getTagFiltersAndPagination: (req: Request<FiltersAndPagination<Tag
|
|
|
28
28
|
skip: number;
|
|
29
29
|
pageSize: number;
|
|
30
30
|
getNumberOfPages: (totalItems: number) => number;
|
|
31
|
-
filters:
|
|
31
|
+
filters: mongoose40.FilterQuery<Tag>;
|
|
32
32
|
sortOptions: Record<string, 1 | -1>;
|
|
33
33
|
};
|
|
34
34
|
//#endregion
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mongo } from "mongoose";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/mongoDB/connectDB.d.ts
|
|
4
|
-
declare const connectDB: () => Promise<MongoClient>;
|
|
4
|
+
declare const connectDB: () => Promise<mongo.MongoClient>;
|
|
5
|
+
/**
|
|
6
|
+
* Get the MongoDB client instance.
|
|
7
|
+
* Must be called after connectDB() has been executed.
|
|
8
|
+
*/
|
|
9
|
+
declare const getDBClient: () => mongo.MongoClient;
|
|
5
10
|
//#endregion
|
|
6
|
-
export { connectDB };
|
|
11
|
+
export { connectDB, getDBClient };
|
|
7
12
|
//# sourceMappingURL=connectDB.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectDB.d.ts","names":[],"sources":["../../../../src/utils/mongoDB/connectDB.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"connectDB.d.ts","names":[],"sources":["../../../../src/utils/mongoDB/connectDB.ts"],"sourcesContent":[],"mappings":";;;cAYa,iBAAsB,QAAQ,KAAA,CAAM;;AAAjD;AA+BA;;cAAa,mBAAkB,KAAA,CAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/backend",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer Backend is a an application that allow you to manage your Intlayer content and interact with the intlayer editor.",
|
|
6
6
|
"keywords": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@better-auth/core": "1.4.7",
|
|
78
78
|
"@better-auth/passkey": "1.4.7",
|
|
79
79
|
"@better-auth/sso": "1.4.7",
|
|
80
|
-
"@intlayer/ai": "7.5.
|
|
80
|
+
"@intlayer/ai": "7.5.1",
|
|
81
81
|
"@react-email/components": "1.0.1",
|
|
82
82
|
"better-auth": "1.4.7",
|
|
83
83
|
"compression": "1.8.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"cross-env": "10.1.0",
|
|
87
87
|
"dotenv": "16.6.1",
|
|
88
88
|
"express": "5.2.1",
|
|
89
|
-
"express-intlayer": "7.5.
|
|
89
|
+
"express-intlayer": "7.5.1",
|
|
90
90
|
"express-rate-limit": "8.2.1",
|
|
91
91
|
"helmet": "8.1.0",
|
|
92
92
|
"mongodb": "6.21.0",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"winston": "3.19.0"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
|
-
"@intlayer/config": "7.5.
|
|
105
|
-
"@intlayer/core": "7.5.
|
|
106
|
-
"@intlayer/docs": "7.5.
|
|
107
|
-
"@intlayer/types": "7.5.
|
|
104
|
+
"@intlayer/config": "7.5.1",
|
|
105
|
+
"@intlayer/core": "7.5.1",
|
|
106
|
+
"@intlayer/docs": "7.5.1",
|
|
107
|
+
"@intlayer/types": "7.5.1",
|
|
108
108
|
"@types/body-parser": "1.19.6",
|
|
109
109
|
"@types/compression": "1.8.1",
|
|
110
110
|
"@types/cookie-parser": "1.4.10",
|
|
@@ -112,17 +112,17 @@
|
|
|
112
112
|
"@types/crypto-js": "4.2.2",
|
|
113
113
|
"@types/csurf": "1.11.5",
|
|
114
114
|
"@types/express": "5.0.6",
|
|
115
|
-
"@types/node": "25.0.
|
|
115
|
+
"@types/node": "25.0.3",
|
|
116
116
|
"@types/oauth2-server": "3.0.18",
|
|
117
117
|
"@types/react": "19.2.7",
|
|
118
118
|
"@types/validator": "13.15.10",
|
|
119
119
|
"@utils/ts-config": "1.0.4",
|
|
120
120
|
"@utils/ts-config-types": "1.0.4",
|
|
121
121
|
"@utils/tsdown-config": "1.0.4",
|
|
122
|
-
"intlayer": "7.5.
|
|
122
|
+
"intlayer": "7.5.1",
|
|
123
123
|
"npm-run-all": "^4.1.5",
|
|
124
124
|
"rimraf": "6.1.2",
|
|
125
|
-
"tsdown": "0.18.
|
|
125
|
+
"tsdown": "0.18.1",
|
|
126
126
|
"tsx": "^4.20.6",
|
|
127
127
|
"typescript": "5.9.3",
|
|
128
128
|
"vitest": "4.0.16"
|