@greatapps/common 1.1.802 → 1.1.803
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/modules/whitelabel/actions/find-whitelabel.action.mjs +3 -1
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +1 -1
- package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs +3 -1
- package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs.map +1 -1
- package/package.json +9 -10
- package/src/modules/whitelabel/actions/find-whitelabel.action.ts +4 -1
- package/src/modules/whitelabel/actions/revalidate-whitelabel.action.ts +4 -1
|
@@ -12,7 +12,9 @@ const findWhitelabel = async () => {
|
|
|
12
12
|
if (!host) {
|
|
13
13
|
throw new ApiError("Host header not found", "HOST_NOT_FOUND", 400);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
const whitelabel = await findWhitelabelByHost(host);
|
|
16
|
+
Object.defineProperty(whitelabel, "token", { enumerable: false });
|
|
17
|
+
return whitelabel;
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
20
|
findWhitelabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/whitelabel/actions/find-whitelabel.action.ts"],"sourcesContent":["'use server';\n\n\nimport { headers } from \"next/headers\";\nimport { whitelabelService } from \"../services/whitelabel.service\";\nimport { ApiError } from \"../../../infra/api/types\";\nimport { cache } from \"react\";\n\nconst findWhitelabelByHost = cache(async (host: string) => {\n return whitelabelService.getTokenByDomain(host);\n});\n\nexport const findWhitelabel = async () => {\n const headersList = await headers();\n const host = headersList.get('host');\n\n if (!host) {\n throw new ApiError('Host header not found', 'HOST_NOT_FOUND', 400);\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/whitelabel/actions/find-whitelabel.action.ts"],"sourcesContent":["'use server';\n\n\nimport { headers } from \"next/headers\";\nimport { whitelabelService } from \"../services/whitelabel.service\";\nimport { ApiError } from \"../../../infra/api/types\";\nimport { cache } from \"react\";\n\nconst findWhitelabelByHost = cache(async (host: string) => {\n return whitelabelService.getTokenByDomain(host);\n});\n\nexport const findWhitelabel = async () => {\n const headersList = await headers();\n const host = headersList.get('host');\n\n if (!host) {\n throw new ApiError('Host header not found', 'HOST_NOT_FOUND', 400);\n }\n\n const whitelabel = await findWhitelabelByHost(host);\n Object.defineProperty(whitelabel, 'token', { enumerable: false });\n\n return whitelabel;\n};\n"],"mappings":";AAGA,SAAS,eAAe;AACxB,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,aAAa;AAEtB,MAAM,uBAAuB,MAAM,OAAO,SAAiB;AACvD,SAAO,kBAAkB,iBAAiB,IAAI;AAClD,CAAC;AAEM,MAAM,iBAAiB,YAAY;AACtC,QAAM,cAAc,MAAM,QAAQ;AAClC,QAAM,OAAO,YAAY,IAAI,MAAM;AAEnC,MAAI,CAAC,MAAM;AACP,UAAM,IAAI,SAAS,yBAAyB,kBAAkB,GAAG;AAAA,EACrE;AAEA,QAAM,aAAa,MAAM,qBAAqB,IAAI;AAClD,SAAO,eAAe,YAAY,SAAS,EAAE,YAAY,MAAM,CAAC;AAEhE,SAAO;AACX;","names":[]}
|
|
@@ -10,7 +10,9 @@ async function revalidateWhitelabelAction() {
|
|
|
10
10
|
if (!host) {
|
|
11
11
|
throw new ApiError("Host header not found", "HOST_NOT_FOUND", 400);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
const whitelabel = await whitelabelService.revalidateByDomain(host);
|
|
14
|
+
Object.defineProperty(whitelabel, "token", { enumerable: false });
|
|
15
|
+
return whitelabel;
|
|
14
16
|
});
|
|
15
17
|
}
|
|
16
18
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/whitelabel/actions/revalidate-whitelabel.action.ts"],"sourcesContent":["'use server';\n\nimport { headers } from 'next/headers';\nimport { whitelabelService } from '../services/whitelabel.service';\nimport { ApiError } from '../../../infra/api/types';\nimport { safeServerAction } from '../../../utils/safeServerAction';\n\nexport async function revalidateWhitelabelAction() {\n return safeServerAction(async () => {\n const headersList = await headers();\n const host = headersList.get('host');\n\n if (!host) {\n throw new ApiError('Host header not found', 'HOST_NOT_FOUND', 400);\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/whitelabel/actions/revalidate-whitelabel.action.ts"],"sourcesContent":["'use server';\n\nimport { headers } from 'next/headers';\nimport { whitelabelService } from '../services/whitelabel.service';\nimport { ApiError } from '../../../infra/api/types';\nimport { safeServerAction } from '../../../utils/safeServerAction';\n\nexport async function revalidateWhitelabelAction() {\n return safeServerAction(async () => {\n const headersList = await headers();\n const host = headersList.get('host');\n\n if (!host) {\n throw new ApiError('Host header not found', 'HOST_NOT_FOUND', 400);\n }\n\n const whitelabel = await whitelabelService.revalidateByDomain(host);\n Object.defineProperty(whitelabel, 'token', { enumerable: false });\n\n return whitelabel;\n });\n}\n"],"mappings":";AAEA,SAAS,eAAe;AACxB,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AAEjC,eAAsB,6BAA6B;AACjD,SAAO,iBAAiB,YAAY;AAClC,UAAM,cAAc,MAAM,QAAQ;AAClC,UAAM,OAAO,YAAY,IAAI,MAAM;AAEnC,QAAI,CAAC,MAAM;AACT,YAAM,IAAI,SAAS,yBAAyB,kBAAkB,GAAG;AAAA,IACnE;AAEA,UAAM,aAAa,MAAM,kBAAkB,mBAAmB,IAAI;AAClE,WAAO,eAAe,YAAY,SAAS,EAAE,YAAY,MAAM,CAAC;AAEhE,WAAO;AAAA,EACT,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greatapps/common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.803",
|
|
4
4
|
"description": "Shared library for GreatApps frontend applications",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -46,14 +46,6 @@
|
|
|
46
46
|
"dist",
|
|
47
47
|
"src"
|
|
48
48
|
],
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "tsup",
|
|
51
|
-
"dev": "tsup --watch",
|
|
52
|
-
"typecheck": "tsc --noEmit",
|
|
53
|
-
"test": "vitest run",
|
|
54
|
-
"test:watch": "vitest",
|
|
55
|
-
"prepublishOnly": "npm run build"
|
|
56
|
-
},
|
|
57
49
|
"keywords": [],
|
|
58
50
|
"author": "",
|
|
59
51
|
"license": "ISC",
|
|
@@ -150,5 +142,12 @@
|
|
|
150
142
|
"@faker-js/faker": {
|
|
151
143
|
"optional": true
|
|
152
144
|
}
|
|
145
|
+
},
|
|
146
|
+
"scripts": {
|
|
147
|
+
"build": "tsup",
|
|
148
|
+
"dev": "tsup --watch",
|
|
149
|
+
"typecheck": "tsc --noEmit",
|
|
150
|
+
"test": "vitest run",
|
|
151
|
+
"test:watch": "vitest"
|
|
153
152
|
}
|
|
154
|
-
}
|
|
153
|
+
}
|
|
@@ -18,5 +18,8 @@ export const findWhitelabel = async () => {
|
|
|
18
18
|
throw new ApiError('Host header not found', 'HOST_NOT_FOUND', 400);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const whitelabel = await findWhitelabelByHost(host);
|
|
22
|
+
Object.defineProperty(whitelabel, 'token', { enumerable: false });
|
|
23
|
+
|
|
24
|
+
return whitelabel;
|
|
22
25
|
};
|
|
@@ -14,6 +14,9 @@ export async function revalidateWhitelabelAction() {
|
|
|
14
14
|
throw new ApiError('Host header not found', 'HOST_NOT_FOUND', 400);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const whitelabel = await whitelabelService.revalidateByDomain(host);
|
|
18
|
+
Object.defineProperty(whitelabel, 'token', { enumerable: false });
|
|
19
|
+
|
|
20
|
+
return whitelabel;
|
|
18
21
|
});
|
|
19
22
|
}
|