corebasic 1.0.244 → 1.0.246
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/libs/schemas.js +15 -0
- package/libs/dip.ts +0 -12
- package/libs/schemas.ts +34 -0
- package/package.json +1 -1
package/dist/libs/schemas.js
CHANGED
|
@@ -14,6 +14,21 @@ const REMOTES_DIR = `${Utils.PROJECT_ROOT_PATH}/types/remotes`;
|
|
|
14
14
|
const g_this = globalThis;
|
|
15
15
|
g_this.Schemas ??= {};
|
|
16
16
|
g_this.Types ??= { Remotes: {} };
|
|
17
|
+
function init(partial) {
|
|
18
|
+
return {
|
|
19
|
+
created: 0,
|
|
20
|
+
updated: 0,
|
|
21
|
+
createdBy: "",
|
|
22
|
+
updatedBy: "",
|
|
23
|
+
createdByUser: "",
|
|
24
|
+
updatedByUser: "",
|
|
25
|
+
company: "",
|
|
26
|
+
outlet: "",
|
|
27
|
+
...partial,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
g_this.Schemas.Default = { init };
|
|
31
|
+
// ================
|
|
17
32
|
async function load(path) {
|
|
18
33
|
let files;
|
|
19
34
|
try {
|
package/libs/dip.ts
CHANGED
|
@@ -117,18 +117,6 @@ export const idip = async (meta: Elabase.DipMeta, txn: string, callback: (idip:
|
|
|
117
117
|
await doCleanup(IDip)
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
declare global {
|
|
121
|
-
type DefaultSchema = {
|
|
122
|
-
created: number
|
|
123
|
-
updated: number
|
|
124
|
-
createdBy: string
|
|
125
|
-
updatedBy: string
|
|
126
|
-
createdByUser: string
|
|
127
|
-
updatedByUser: string
|
|
128
|
-
company: string
|
|
129
|
-
outlet: string
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
120
|
|
|
133
121
|
export const insertKeys = (message: DipMessage, meta: Elabase.DipMeta) => {
|
|
134
122
|
if (!isDipMeta(meta)) throw new Error('Error: Provided meta is not an instance of DipMeta in Dip.insertKeys()')
|
package/libs/schemas.ts
CHANGED
|
@@ -9,6 +9,40 @@ const g_this: any = globalThis as any
|
|
|
9
9
|
g_this.Schemas ??= {};
|
|
10
10
|
g_this.Types ??= {Remotes: {}};
|
|
11
11
|
|
|
12
|
+
|
|
13
|
+
// ================
|
|
14
|
+
type DefaultSchema = {
|
|
15
|
+
created: number
|
|
16
|
+
updated: number
|
|
17
|
+
createdBy: string
|
|
18
|
+
updatedBy: string
|
|
19
|
+
createdByUser: string
|
|
20
|
+
updatedByUser: string
|
|
21
|
+
company: string
|
|
22
|
+
outlet: string
|
|
23
|
+
}
|
|
24
|
+
function init(partial: Partial<DefaultSchema>): DefaultSchema {
|
|
25
|
+
return {
|
|
26
|
+
created: 0,
|
|
27
|
+
updated: 0,
|
|
28
|
+
createdBy: "",
|
|
29
|
+
updatedBy: "",
|
|
30
|
+
createdByUser: "",
|
|
31
|
+
updatedByUser: "",
|
|
32
|
+
company: "",
|
|
33
|
+
outlet: "",
|
|
34
|
+
...partial,
|
|
35
|
+
} as DefaultSchema
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
namespace Schemas {
|
|
39
|
+
type Default = DefaultSchema;
|
|
40
|
+
const Default: { init: typeof init };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
g_this.Schemas.Default = { init }
|
|
44
|
+
// ================
|
|
45
|
+
|
|
12
46
|
async function load(path: string) {
|
|
13
47
|
let files: string[]
|
|
14
48
|
try {
|