@pc-nexus/core 0.5.0 → 0.8.0-next.0
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/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +2 -2
- package/lib/handler.d.ts +5 -5
- package/lib/handler.d.ts.map +1 -1
- package/lib/i18n/main.d.ts.map +1 -1
- package/lib/i18n/main.js +3 -3
- package/lib/i18n/types.d.ts.map +1 -1
- package/lib/i18n/types.js +1 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { EnvironmentType,
|
|
1
|
+
export { EnvironmentType, NexusError, NexusHttpStatusCode, NexusInnerError, NexusInnerErrorCode, Resolver, type Extension, type EventHandler, type EventHandlerEvent, type NexusAppContext, type ResolverFunction, type Team, type User, type WebhookEventResult, } from "@pc-nexus/internal";
|
|
2
2
|
export * from "./lib/authorize.js";
|
|
3
|
-
export * from "./lib/common.js";
|
|
4
3
|
export * from "./lib/handler.js";
|
|
4
|
+
export { app } from "./lib/common.js";
|
|
5
5
|
export * from "./lib/i18n/index.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,kBAAkB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { EnvironmentType,
|
|
1
|
+
export { EnvironmentType, NexusError, NexusHttpStatusCode, NexusInnerError, NexusInnerErrorCode, Resolver, } from "@pc-nexus/internal";
|
|
2
2
|
export * from "./lib/authorize.js";
|
|
3
|
-
export * from "./lib/common.js";
|
|
4
3
|
export * from "./lib/handler.js";
|
|
4
|
+
export { app } from "./lib/common.js";
|
|
5
5
|
export * from "./lib/i18n/index.js";
|
package/lib/handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
1
|
+
import { EventHandler, LifecycleEventPayload, ScheduledEventPayload, SystemEventPayload, WebhookEventResult, WebhookEventPayload } from "@pc-nexus/internal";
|
|
2
|
+
export type SystemEventHandler = EventHandler<SystemEventPayload, void>;
|
|
3
|
+
export type LifecycleEventHandler = EventHandler<LifecycleEventPayload, void>;
|
|
4
|
+
export type WebhookEventHandler = EventHandler<WebhookEventPayload, WebhookEventResult>;
|
|
5
|
+
export type ScheduledEventHandler = EventHandler<ScheduledEventPayload, void>;
|
|
6
6
|
//# sourceMappingURL=handler.d.ts.map
|
package/lib/handler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/lib/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/lib/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;AAExF,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC"}
|
package/lib/i18n/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuD,qBAAqB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGzI,cAAM,IAAI;;;IAMO,eAAe,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAK7E,gBAAgB,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuD,qBAAqB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGzI,cAAM,IAAI;;;IAMO,eAAe,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAK7E,gBAAgB,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;CAkDnF;AAED,eAAO,MAAM,IAAI,MAAa,CAAC"}
|
package/lib/i18n/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NexusInnerError, NexusInnerErrorCode } from "@pc-nexus/internal";
|
|
2
2
|
import { TranslationLoader } from "./translation-loader.js";
|
|
3
3
|
import { SUPPORTED_LOCALE_CODES } from "./types.js";
|
|
4
4
|
import _ from "lodash";
|
|
@@ -22,7 +22,7 @@ class I18n {
|
|
|
22
22
|
}
|
|
23
23
|
#translate(key, translations, params) {
|
|
24
24
|
if (!key) {
|
|
25
|
-
throw new NexusInnerError(
|
|
25
|
+
throw new NexusInnerError(NexusInnerErrorCode.I18nTranslationKeyRequired, `"key" is required in i18n translate.`);
|
|
26
26
|
}
|
|
27
27
|
let value = _.get(translations, key);
|
|
28
28
|
if (value == null) {
|
|
@@ -45,7 +45,7 @@ class I18n {
|
|
|
45
45
|
#validateLocale(locale) {
|
|
46
46
|
if (locale) {
|
|
47
47
|
if (!SUPPORTED_LOCALE_CODES.includes(locale)) {
|
|
48
|
-
throw new NexusInnerError(
|
|
48
|
+
throw new NexusInnerError(NexusInnerErrorCode.I18nTranslationLocaleInvalid, `locale "${locale}" is not supported`);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
package/lib/i18n/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,6BAA8B,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,CAAC,OAAO,WAAW,qBAAqB;IAC1C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,YAAY,EAAE,2BAA2B,GAAG,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,2BAA2B;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,2BAA2B,CAAC;CACvD;AAED,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,2BAA2B,GAAG,MAAM,CAAC;CAClG"}
|
package/lib/i18n/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pc-nexus/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"type": "module",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@pc-nexus/internal": "0.
|
|
32
|
+
"@pc-nexus/internal": "0.8.0-next.0",
|
|
33
33
|
"lodash": "^4.17.21"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {},
|