@powfix/core-js 0.11.11 → 0.12.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/dist/src/interfaces/browser.d.ts +4 -0
- package/dist/src/interfaces/browser.js +20 -0
- package/dist/src/interfaces/db/Hook.d.ts +8 -0
- package/dist/src/interfaces/db/Hook.js +2 -0
- package/dist/src/interfaces/db/HookFn.d.ts +4 -0
- package/dist/src/interfaces/db/HookFn.js +2 -0
- package/dist/src/interfaces/db/HookType.d.ts +3 -0
- package/dist/src/interfaces/db/HookType.js +2 -0
- package/dist/src/interfaces/db/index.d.ts +3 -0
- package/dist/src/interfaces/db/index.js +19 -0
- package/dist/src/interfaces/index.d.ts +2 -4
- package/dist/src/interfaces/index.js +2 -4
- package/dist/src/utils/backend/HookUtils.d.ts +13 -0
- package/dist/src/utils/backend/HookUtils.js +30 -0
- package/dist/src/utils/backend/base/SequelizeUtils.d.ts +3 -0
- package/dist/src/utils/backend/base/SequelizeUtils.js +16 -0
- package/dist/src/utils/backend/base/index.d.ts +1 -0
- package/dist/src/utils/backend/base/index.js +17 -0
- package/dist/src/utils/backend/index.d.ts +2 -0
- package/dist/src/utils/backend/index.js +18 -0
- package/dist/src/utils/browser.d.ts +15 -0
- package/dist/src/utils/browser.js +31 -0
- package/dist/src/utils/index.d.ts +2 -15
- package/dist/src/utils/index.js +2 -15
- package/package.json +3 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Coordinate"), exports);
|
|
18
|
+
__exportStar(require("./Point2"), exports);
|
|
19
|
+
__exportStar(require("./Point3"), exports);
|
|
20
|
+
__exportStar(require("./StorageProvider"), exports);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Hooks, SequelizeHooks } from "sequelize/types/hooks";
|
|
2
|
+
import { Attributes, CreationAttributes } from "sequelize/types/model";
|
|
3
|
+
import { HookType } from "./HookType";
|
|
4
|
+
export type HookFn = SequelizeHooks<Hooks['_model'], Attributes<Hooks>, CreationAttributes<Hooks>>[HookType];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Hook"), exports);
|
|
18
|
+
__exportStar(require("./HookFn"), exports);
|
|
19
|
+
__exportStar(require("./HookType"), exports);
|
|
@@ -14,7 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./Point3"), exports);
|
|
20
|
-
__exportStar(require("./StorageProvider"), exports);
|
|
17
|
+
__exportStar(require("./browser"), exports);
|
|
18
|
+
__exportStar(require("./db"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Hook, HookFn } from "../../interfaces";
|
|
2
|
+
import { ModelCtor } from "sequelize-typescript";
|
|
3
|
+
export declare class HookUtils {
|
|
4
|
+
static getFkChanges<T>(pFkValue: T | null | undefined, cFkValue: T | null | undefined): {
|
|
5
|
+
pFkValue: T | null;
|
|
6
|
+
cFkValue: T | null;
|
|
7
|
+
};
|
|
8
|
+
static makeModelHooks(model: ModelCtor, fns: {
|
|
9
|
+
create: HookFn;
|
|
10
|
+
update: HookFn;
|
|
11
|
+
destroy: HookFn;
|
|
12
|
+
}): Hook[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HookUtils = void 0;
|
|
4
|
+
class HookUtils {
|
|
5
|
+
static getFkChanges(pFkValue, cFkValue) {
|
|
6
|
+
const results = { pFkValue: null, cFkValue: null };
|
|
7
|
+
if (pFkValue !== undefined && cFkValue !== undefined) {
|
|
8
|
+
if (pFkValue !== cFkValue) {
|
|
9
|
+
if (pFkValue !== null) {
|
|
10
|
+
results.pFkValue = pFkValue;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (cFkValue !== null && cFkValue !== undefined) {
|
|
15
|
+
results.cFkValue = cFkValue;
|
|
16
|
+
}
|
|
17
|
+
return results;
|
|
18
|
+
}
|
|
19
|
+
static makeModelHooks(model, fns) {
|
|
20
|
+
return [
|
|
21
|
+
{ model, hookType: 'afterCreate', fn: fns.create },
|
|
22
|
+
{ model, hookType: 'afterBulkCreate', fn: fns.create },
|
|
23
|
+
{ model, hookType: 'afterUpdate', fn: fns.update },
|
|
24
|
+
{ model, hookType: 'afterBulkUpdate', fn: fns.update },
|
|
25
|
+
{ model, hookType: 'afterDestroy', fn: fns.destroy },
|
|
26
|
+
{ model, hookType: 'afterBulkDestroy', fn: fns.destroy },
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.HookUtils = HookUtils;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequelizeUtils = void 0;
|
|
4
|
+
class SequelizeUtils {
|
|
5
|
+
static decimal2Number(value) {
|
|
6
|
+
if (value === null || value === undefined) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
const parsed = Number(value);
|
|
10
|
+
if (isNaN(parsed)) {
|
|
11
|
+
throw new Error(`value(typeof=${typeof value}, value=${value}) iNaN(is not number)`);
|
|
12
|
+
}
|
|
13
|
+
return parsed;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.SequelizeUtils = SequelizeUtils;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SequelizeUtils';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SequelizeUtils"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./base"), exports);
|
|
18
|
+
__exportStar(require("./HookUtils"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './global';
|
|
2
|
+
export * from './ArrayUtils';
|
|
3
|
+
export * from './AxiosUtils';
|
|
4
|
+
export * from './StringUtils';
|
|
5
|
+
export * from './UuidUtils';
|
|
6
|
+
export * from './BooleanUtils';
|
|
7
|
+
export * from './CoordinateUtils';
|
|
8
|
+
export * from './DateUtils';
|
|
9
|
+
export * from './NumberUtils';
|
|
10
|
+
export * from './ObjectIdUtils';
|
|
11
|
+
export * from './Point3Utils';
|
|
12
|
+
export * from './RandomUtils';
|
|
13
|
+
export * from './Validator';
|
|
14
|
+
export * from './JuminNumberUtils';
|
|
15
|
+
export * from './Sequencer';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./global"), exports);
|
|
18
|
+
__exportStar(require("./ArrayUtils"), exports);
|
|
19
|
+
__exportStar(require("./AxiosUtils"), exports);
|
|
20
|
+
__exportStar(require("./StringUtils"), exports);
|
|
21
|
+
__exportStar(require("./UuidUtils"), exports);
|
|
22
|
+
__exportStar(require("./BooleanUtils"), exports);
|
|
23
|
+
__exportStar(require("./CoordinateUtils"), exports);
|
|
24
|
+
__exportStar(require("./DateUtils"), exports);
|
|
25
|
+
__exportStar(require("./NumberUtils"), exports);
|
|
26
|
+
__exportStar(require("./ObjectIdUtils"), exports);
|
|
27
|
+
__exportStar(require("./Point3Utils"), exports);
|
|
28
|
+
__exportStar(require("./RandomUtils"), exports);
|
|
29
|
+
__exportStar(require("./Validator"), exports);
|
|
30
|
+
__exportStar(require("./JuminNumberUtils"), exports);
|
|
31
|
+
__exportStar(require("./Sequencer"), exports);
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './AxiosUtils';
|
|
4
|
-
export * from './StringUtils';
|
|
5
|
-
export * from './UuidUtils';
|
|
6
|
-
export * from './BooleanUtils';
|
|
7
|
-
export * from './CoordinateUtils';
|
|
8
|
-
export * from './DateUtils';
|
|
9
|
-
export * from './NumberUtils';
|
|
10
|
-
export * from './ObjectIdUtils';
|
|
11
|
-
export * from './Point3Utils';
|
|
12
|
-
export * from './RandomUtils';
|
|
13
|
-
export * from './Validator';
|
|
14
|
-
export * from './JuminNumberUtils';
|
|
15
|
-
export * from './Sequencer';
|
|
1
|
+
export * from './browser';
|
|
2
|
+
export * from './backend';
|
package/dist/src/utils/index.js
CHANGED
|
@@ -14,18 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./AxiosUtils"), exports);
|
|
20
|
-
__exportStar(require("./StringUtils"), exports);
|
|
21
|
-
__exportStar(require("./UuidUtils"), exports);
|
|
22
|
-
__exportStar(require("./BooleanUtils"), exports);
|
|
23
|
-
__exportStar(require("./CoordinateUtils"), exports);
|
|
24
|
-
__exportStar(require("./DateUtils"), exports);
|
|
25
|
-
__exportStar(require("./NumberUtils"), exports);
|
|
26
|
-
__exportStar(require("./ObjectIdUtils"), exports);
|
|
27
|
-
__exportStar(require("./Point3Utils"), exports);
|
|
28
|
-
__exportStar(require("./RandomUtils"), exports);
|
|
29
|
-
__exportStar(require("./Validator"), exports);
|
|
30
|
-
__exportStar(require("./JuminNumberUtils"), exports);
|
|
31
|
-
__exportStar(require("./Sequencer"), exports);
|
|
17
|
+
__exportStar(require("./browser"), exports);
|
|
18
|
+
__exportStar(require("./backend"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powfix/core-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "core package",
|
|
5
5
|
"author": "Kwon Kyung-Min <powfix@gmail.com>",
|
|
6
6
|
"private": false,
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
"@types/uuid": "9.0.7",
|
|
38
38
|
"axios": "1.7.9",
|
|
39
39
|
"moment": "^2.30.1",
|
|
40
|
+
"sequelize": "^6.37.6",
|
|
41
|
+
"sequelize-typescript": "^2.1.6",
|
|
40
42
|
"ts-node": "^10.9.2",
|
|
41
43
|
"typescript": "5.1.6"
|
|
42
44
|
},
|