nucleus-core-ts 0.10.137 → 0.10.138
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/.build-ok
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.10.
|
|
1
|
+
0.10.138
|
|
@@ -61,8 +61,23 @@ type EntityMethodMap = {
|
|
|
61
61
|
DELETE: 'DELETE';
|
|
62
62
|
};
|
|
63
63
|
type Singularize<S extends string> = S extends `${infer Base}ies` ? `${Base}y` : S extends `${infer Base}ses` ? `${Base}s` : S extends `${infer Base}s` ? Base : S;
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
type LowerAlpha = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';
|
|
65
|
+
type UpperAlpha = Uppercase<LowerAlpha>;
|
|
66
|
+
/**
|
|
67
|
+
* The type-level twin of the generator's `toUpperSnakeCase`: an underscore
|
|
68
|
+
* where a lower-case letter meets an upper-case one, then upper case.
|
|
69
|
+
*
|
|
70
|
+
* The key used to be `Uppercase<TTableName>`, which agrees with the runtime
|
|
71
|
+
* only for snake_case names. For a camelCase system table the two split:
|
|
72
|
+
* `verificationInstances` was typed `GET_VERIFICATIONINSTANCES` while the
|
|
73
|
+
* generator registers `GET_VERIFICATION_INSTANCES`. Measured on a host: a
|
|
74
|
+
* screen called `actions.GET_VERIFICATIONINSTANCES`, type-checked green, and
|
|
75
|
+
* got `undefined` at runtime on every open — "Onay kayıtları okunamadı" with
|
|
76
|
+
* no request ever sent.
|
|
77
|
+
*/
|
|
78
|
+
export type ToUpperSnake<S extends string, Prev extends string = ''> = S extends `${infer C}${infer Rest}` ? `${Prev extends LowerAlpha ? (C extends UpperAlpha ? '_' : '') : ''}${C extends ' ' | '-' ? '_' : Uppercase<C>}${ToUpperSnake<Rest, C>}` : '';
|
|
79
|
+
export type EntityEndpointKey<TTableName extends string, TMethod extends keyof EntityMethodMap> = TMethod extends 'GET' ? `GET_${ToUpperSnake<TTableName>}` : `${EntityMethodMap[TMethod]}_${ToUpperSnake<Singularize<TTableName>>}`;
|
|
80
|
+
export type BulkEndpointKey<TTableName extends string, TMethod extends 'POST' | 'PUT' | 'DELETE'> = `BULK_${EntityMethodMap[TMethod]}_${ToUpperSnake<TTableName>}`;
|
|
66
81
|
export interface LoginPayload {
|
|
67
82
|
email: string;
|
|
68
83
|
password: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nucleus-core-ts",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.138",
|
|
4
4
|
"description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
|
|
5
5
|
"author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|