@autofleet/sadot 1.0.35 → 1.1.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/CustomFieldDefinition.d.cts +31 -2
- package/dist/models/CustomFieldDefinition.d.ts +30 -3
- package/dist/models/CustomFieldEntries.d.cts +16 -0
- package/dist/models/CustomFieldEntries.d.ts +16 -2
- package/dist/models/CustomFieldValue.d.cts +22 -1
- package/dist/models/CustomFieldValue.d.ts +21 -2
- package/dist/models/CustomValidator.d.ts +1 -1
- package/dist/models/index.d.cts +3 -2
- package/dist/models/index.d.ts +3 -3
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./utils/logger/index.cjs`),t=require(`./utils/constants/index.cjs`),n=require(`./models/
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./utils/logger/index.cjs`),t=require(`./utils/constants/index.cjs`),n=require(`./models/CustomFieldDefinition.cjs`),r=require(`./models/CustomFieldValue.cjs`),i=require(`./models/CustomFieldEntries.cjs`),a=require(`./models/index.cjs`),o=require(`./api/index.cjs`),s=require(`./utils/db/index.cjs`),c=require(`./utils/helpers/index.cjs`),l=require(`./scopes/filter.cjs`),u=require(`./utils/init.cjs`),d=require(`./utils/validations/schema/custom-fields.cjs`),f=async(t,n,r)=>{e.tryAddingTraceIdMiddleware();let{models:i,useCustomFieldsEntries:c}=r;t&&t.use(`/api`,o.default);let l=r.sequelize??s.default(r.databaseConfig);return process.env.NODE_ENV===`test`&&await a.initTestModels(l),u.addHooks(i,n,{useCustomFieldsEntries:c}),await a.initTables(l,r.getUser,{useCustomFieldsEntries:c}),u.addScopes(i,n,{useCustomFieldsEntries:c}),u.applyCustomAssociation(i),e.default.debug(`sadot - custom fields finished initializing with models`,i),l};var p=f;const m=(e,t)=>{u.removeHooks(e,t)};exports.CUSTOM_FIELDS_FILTER_SCOPE=t.CUSTOM_FIELDS_FILTER_SCOPE,exports.CustomFieldDefinition=n.default,exports.CustomFieldDefinitionType=t.CustomFieldDefinitionType,exports.CustomFieldEntries=i.default,exports.CustomFieldValue=r.default,exports.CustomFieldsSchema=d.CustomFieldsSchema,exports.customFieldsSortScope=l.customFieldsSortScope,exports.default=p,exports.disableCustomFields=m,exports.generateCustomFieldSearchQueryPayload=c.generateCustomFieldSearchQueryPayload,exports.generateRandomString=c.generateRandomString,exports.supportedEntities=t.supportedEntities;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["api","initDB","initTestModels","initTables"],"sources":["../src/index.ts"],"sourcesContent":["import type { Application } from 'express';\nimport type { Sequelize } from 'sequelize-typescript';\nimport {\n initTables, initTestModels,\n} from './models';\nimport api from './api';\nimport initDB from './utils/db';\nimport logger, { tryAddingTraceIdMiddleware } from './utils/logger';\nimport type { CustomFieldOptions, ModelFetcher, Models } from './types';\nimport {\n addHooks, addScopes, applyCustomAssociation, removeHooks,\n} from './utils/init';\n\nexport * from './utils/validations/schema/custom-fields';\n\nexport * from './utils/constants';\n\nexport * from './utils/helpers';\n\nexport { customFieldsSortScope } from './scopes/filter';\n\n/**\n * Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file\n * @see {@link 'custom-fields/config'} for configurations\n */\nconst useCustomFields = async (\n app: Pick<Application, 'use'> | null,\n getModel: ModelFetcher,\n options: CustomFieldOptions,\n): Promise<Sequelize> => {\n tryAddingTraceIdMiddleware();\n const { models, useCustomFieldsEntries } = options;\n if (app) {\n app.use('/api', api);\n }\n const sequelize = options.sequelize ?? initDB(options.databaseConfig);\n if (process.env.NODE_ENV === 'test') {\n await initTestModels(sequelize);\n }\n // The order is important\n addHooks(models, getModel, { useCustomFieldsEntries });\n await initTables(sequelize, options.getUser, { useCustomFieldsEntries });\n addScopes(models, getModel, { useCustomFieldsEntries });\n applyCustomAssociation(models);\n\n logger.debug('sadot - custom fields finished initializing with models', models);\n return sequelize;\n};\n\nexport default useCustomFields;\n\nexport const disableCustomFields = (models: Models[], getModel: ModelFetcher): void => {\n removeHooks(models, getModel);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["api","initDB","initTestModels","initTables"],"sources":["../src/index.ts"],"sourcesContent":["import type { Application } from 'express';\nimport type { Sequelize } from 'sequelize-typescript';\nimport {\n initTables, initTestModels,\n} from './models';\nimport api from './api';\nimport initDB from './utils/db';\nimport logger, { tryAddingTraceIdMiddleware } from './utils/logger';\nimport type { CustomFieldOptions, ModelFetcher, Models } from './types';\nimport {\n addHooks, addScopes, applyCustomAssociation, removeHooks,\n} from './utils/init';\n\nexport * from './utils/validations/schema/custom-fields';\n\nexport * from './utils/constants';\n\nexport * from './utils/helpers';\n\nexport { customFieldsSortScope } from './scopes/filter';\nexport {\n CustomFieldDefinition,\n CustomFieldEntries,\n CustomFieldValue,\n} from './models';\n\n/**\n * Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file\n * @see {@link 'custom-fields/config'} for configurations\n */\nconst useCustomFields = async (\n app: Pick<Application, 'use'> | null,\n getModel: ModelFetcher,\n options: CustomFieldOptions,\n): Promise<Sequelize> => {\n tryAddingTraceIdMiddleware();\n const { models, useCustomFieldsEntries } = options;\n if (app) {\n app.use('/api', api);\n }\n const sequelize = options.sequelize ?? initDB(options.databaseConfig);\n if (process.env.NODE_ENV === 'test') {\n await initTestModels(sequelize);\n }\n // The order is important\n addHooks(models, getModel, { useCustomFieldsEntries });\n await initTables(sequelize, options.getUser, { useCustomFieldsEntries });\n addScopes(models, getModel, { useCustomFieldsEntries });\n applyCustomAssociation(models);\n\n logger.debug('sadot - custom fields finished initializing with models', models);\n return sequelize;\n};\n\nexport default useCustomFields;\n\nexport const disableCustomFields = (models: Models[], getModel: ModelFetcher): void => {\n removeHooks(models, getModel);\n};\n"],"mappings":"mhBA8BM,EAAkB,MACtB,EACA,EACA,IACuB,CACvB,EAAA,4BAA4B,CAC5B,GAAM,CAAE,SAAQ,0BAA2B,EACvC,GACF,EAAI,IAAI,OAAQA,EAAAA,QAAI,CAEtB,IAAM,EAAY,EAAQ,WAAaC,EAAAA,QAAO,EAAQ,eAAe,CAWrE,OAVI,QAAQ,IAAI,WAAa,QAC3B,MAAMC,EAAAA,eAAe,EAAU,CAGjC,EAAA,SAAS,EAAQ,EAAU,CAAE,yBAAwB,CAAC,CACtD,MAAMC,EAAAA,WAAW,EAAW,EAAQ,QAAS,CAAE,yBAAwB,CAAC,CACxE,EAAA,UAAU,EAAQ,EAAU,CAAE,yBAAwB,CAAC,CACvD,EAAA,uBAAuB,EAAO,CAE9B,EAAA,QAAO,MAAM,0DAA2D,EAAO,CACxE,GAGT,IAAA,EAAe,EAEf,MAAa,GAAuB,EAAkB,IAAiC,CACrF,EAAA,YAAY,EAAQ,EAAS"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinitionType, supportedEntities } from "./utils/constants/index.cjs";
|
|
2
|
+
import { CustomFieldValue } from "./models/CustomFieldValue.cjs";
|
|
3
|
+
import { CustomFieldEntries } from "./models/CustomFieldEntries.cjs";
|
|
4
|
+
import "./models/index.cjs";
|
|
5
|
+
import { CustomFieldDefinition } from "./models/CustomFieldDefinition.cjs";
|
|
2
6
|
import { CustomFieldOptions, ModelFetcher, Models } from "./types/index.cjs";
|
|
3
7
|
import { CustomFieldsSchema } from "./utils/validations/schema/custom-fields.cjs";
|
|
4
8
|
import { generateCustomFieldSearchQueryPayload, generateRandomString } from "./utils/helpers/index.cjs";
|
|
@@ -7,7 +11,6 @@ import { Application } from "express";
|
|
|
7
11
|
import { Sequelize } from "sequelize-typescript";
|
|
8
12
|
|
|
9
13
|
//#region src/index.d.ts
|
|
10
|
-
|
|
11
14
|
/**
|
|
12
15
|
* Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file
|
|
13
16
|
* @see {@link 'custom-fields/config'} for configurations
|
|
@@ -15,5 +18,5 @@ import { Sequelize } from "sequelize-typescript";
|
|
|
15
18
|
declare const useCustomFields: (app: Pick<Application, "use"> | null, getModel: ModelFetcher, options: CustomFieldOptions) => Promise<Sequelize>;
|
|
16
19
|
declare const disableCustomFields: (models: Models[], getModel: ModelFetcher) => void;
|
|
17
20
|
//#endregion
|
|
18
|
-
export { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinitionType, CustomFieldsSchema, customFieldsSortScope, useCustomFields as default, disableCustomFields, generateCustomFieldSearchQueryPayload, generateRandomString, supportedEntities };
|
|
21
|
+
export { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinition, CustomFieldDefinitionType, CustomFieldEntries, CustomFieldValue, CustomFieldsSchema, customFieldsSortScope, useCustomFields as default, disableCustomFields, generateCustomFieldSearchQueryPayload, generateRandomString, supportedEntities };
|
|
19
22
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinitionType, supportedEntities } from "./utils/constants/index.js";
|
|
2
|
+
import { CustomFieldValue } from "./models/CustomFieldValue.js";
|
|
3
|
+
import { CustomFieldEntries } from "./models/CustomFieldEntries.js";
|
|
4
|
+
import "./models/index.js";
|
|
5
|
+
import { CustomFieldDefinition } from "./models/CustomFieldDefinition.js";
|
|
2
6
|
import { CustomFieldOptions, ModelFetcher, Models } from "./types/index.js";
|
|
3
7
|
import { CustomFieldsSchema } from "./utils/validations/schema/custom-fields.js";
|
|
4
8
|
import { generateCustomFieldSearchQueryPayload, generateRandomString } from "./utils/helpers/index.js";
|
|
@@ -7,7 +11,6 @@ import { Sequelize } from "sequelize-typescript";
|
|
|
7
11
|
import { Application } from "express";
|
|
8
12
|
|
|
9
13
|
//#region src/index.d.ts
|
|
10
|
-
|
|
11
14
|
/**
|
|
12
15
|
* Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file
|
|
13
16
|
* @see {@link 'custom-fields/config'} for configurations
|
|
@@ -15,5 +18,5 @@ import { Application } from "express";
|
|
|
15
18
|
declare const useCustomFields: (app: Pick<Application, "use"> | null, getModel: ModelFetcher, options: CustomFieldOptions) => Promise<Sequelize>;
|
|
16
19
|
declare const disableCustomFields: (models: Models[], getModel: ModelFetcher) => void;
|
|
17
20
|
//#endregion
|
|
18
|
-
export { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinitionType, CustomFieldsSchema, customFieldsSortScope, useCustomFields as default, disableCustomFields, generateCustomFieldSearchQueryPayload, generateRandomString, supportedEntities };
|
|
21
|
+
export { CUSTOM_FIELDS_FILTER_SCOPE, CustomFieldDefinition, CustomFieldDefinitionType, CustomFieldEntries, CustomFieldValue, CustomFieldsSchema, customFieldsSortScope, useCustomFields as default, disableCustomFields, generateCustomFieldSearchQueryPayload, generateRandomString, supportedEntities };
|
|
19
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{tryAddingTraceIdMiddleware as t}from"./utils/logger/index.js";import{CUSTOM_FIELDS_FILTER_SCOPE as n,CustomFieldDefinitionType as r,supportedEntities as i}from"./utils/constants/index.js";import{initTables as
|
|
1
|
+
import e,{tryAddingTraceIdMiddleware as t}from"./utils/logger/index.js";import{CUSTOM_FIELDS_FILTER_SCOPE as n,CustomFieldDefinitionType as r,supportedEntities as i}from"./utils/constants/index.js";import a from"./models/CustomFieldDefinition.js";import o from"./models/CustomFieldValue.js";import s from"./models/CustomFieldEntries.js";import{initTables as c,initTestModels as l}from"./models/index.js";import u from"./api/index.js";import d from"./utils/db/index.js";import{generateCustomFieldSearchQueryPayload as f,generateRandomString as p}from"./utils/helpers/index.js";import{customFieldsSortScope as m}from"./scopes/filter.js";import{addHooks as h,addScopes as g,applyCustomAssociation as _,removeHooks as v}from"./utils/init.js";import{CustomFieldsSchema as y}from"./utils/validations/schema/custom-fields.js";var b=async(n,r,i)=>{t();let{models:a,useCustomFieldsEntries:o}=i;n&&n.use(`/api`,u);let s=i.sequelize??d(i.databaseConfig);return process.env.NODE_ENV===`test`&&await l(s),h(a,r,{useCustomFieldsEntries:o}),await c(s,i.getUser,{useCustomFieldsEntries:o}),g(a,r,{useCustomFieldsEntries:o}),_(a),e.debug(`sadot - custom fields finished initializing with models`,a),s};const x=(e,t)=>{v(e,t)};export{n as CUSTOM_FIELDS_FILTER_SCOPE,a as CustomFieldDefinition,r as CustomFieldDefinitionType,s as CustomFieldEntries,o as CustomFieldValue,y as CustomFieldsSchema,m as customFieldsSortScope,b as default,x as disableCustomFields,f as generateCustomFieldSearchQueryPayload,p as generateRandomString,i as supportedEntities};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["api","initDB"],"sources":["../src/index.ts"],"sourcesContent":["import type { Application } from 'express';\nimport type { Sequelize } from 'sequelize-typescript';\nimport {\n initTables, initTestModels,\n} from './models';\nimport api from './api';\nimport initDB from './utils/db';\nimport logger, { tryAddingTraceIdMiddleware } from './utils/logger';\nimport type { CustomFieldOptions, ModelFetcher, Models } from './types';\nimport {\n addHooks, addScopes, applyCustomAssociation, removeHooks,\n} from './utils/init';\n\nexport * from './utils/validations/schema/custom-fields';\n\nexport * from './utils/constants';\n\nexport * from './utils/helpers';\n\nexport { customFieldsSortScope } from './scopes/filter';\n\n/**\n * Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file\n * @see {@link 'custom-fields/config'} for configurations\n */\nconst useCustomFields = async (\n app: Pick<Application, 'use'> | null,\n getModel: ModelFetcher,\n options: CustomFieldOptions,\n): Promise<Sequelize> => {\n tryAddingTraceIdMiddleware();\n const { models, useCustomFieldsEntries } = options;\n if (app) {\n app.use('/api', api);\n }\n const sequelize = options.sequelize ?? initDB(options.databaseConfig);\n if (process.env.NODE_ENV === 'test') {\n await initTestModels(sequelize);\n }\n // The order is important\n addHooks(models, getModel, { useCustomFieldsEntries });\n await initTables(sequelize, options.getUser, { useCustomFieldsEntries });\n addScopes(models, getModel, { useCustomFieldsEntries });\n applyCustomAssociation(models);\n\n logger.debug('sadot - custom fields finished initializing with models', models);\n return sequelize;\n};\n\nexport default useCustomFields;\n\nexport const disableCustomFields = (models: Models[], getModel: ModelFetcher): void => {\n removeHooks(models, getModel);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["api","initDB"],"sources":["../src/index.ts"],"sourcesContent":["import type { Application } from 'express';\nimport type { Sequelize } from 'sequelize-typescript';\nimport {\n initTables, initTestModels,\n} from './models';\nimport api from './api';\nimport initDB from './utils/db';\nimport logger, { tryAddingTraceIdMiddleware } from './utils/logger';\nimport type { CustomFieldOptions, ModelFetcher, Models } from './types';\nimport {\n addHooks, addScopes, applyCustomAssociation, removeHooks,\n} from './utils/init';\n\nexport * from './utils/validations/schema/custom-fields';\n\nexport * from './utils/constants';\n\nexport * from './utils/helpers';\n\nexport { customFieldsSortScope } from './scopes/filter';\nexport {\n CustomFieldDefinition,\n CustomFieldEntries,\n CustomFieldValue,\n} from './models';\n\n/**\n * Adding custom fields enrichment to the models inside the MODELS_FILE_NAME json file\n * @see {@link 'custom-fields/config'} for configurations\n */\nconst useCustomFields = async (\n app: Pick<Application, 'use'> | null,\n getModel: ModelFetcher,\n options: CustomFieldOptions,\n): Promise<Sequelize> => {\n tryAddingTraceIdMiddleware();\n const { models, useCustomFieldsEntries } = options;\n if (app) {\n app.use('/api', api);\n }\n const sequelize = options.sequelize ?? initDB(options.databaseConfig);\n if (process.env.NODE_ENV === 'test') {\n await initTestModels(sequelize);\n }\n // The order is important\n addHooks(models, getModel, { useCustomFieldsEntries });\n await initTables(sequelize, options.getUser, { useCustomFieldsEntries });\n addScopes(models, getModel, { useCustomFieldsEntries });\n applyCustomAssociation(models);\n\n logger.debug('sadot - custom fields finished initializing with models', models);\n return sequelize;\n};\n\nexport default useCustomFields;\n\nexport const disableCustomFields = (models: Models[], getModel: ModelFetcher): void => {\n removeHooks(models, getModel);\n};\n"],"mappings":"mzBAsDA,IAAA,EAxBwB,MACtB,EACA,EACA,IACuB,CACvB,GAA4B,CAC5B,GAAM,CAAE,SAAQ,0BAA2B,EACvC,GACF,EAAI,IAAI,OAAQA,EAAI,CAEtB,IAAM,EAAY,EAAQ,WAAaC,EAAO,EAAQ,eAAe,CAWrE,OAVI,QAAQ,IAAI,WAAa,QAC3B,MAAM,EAAe,EAAU,CAGjC,EAAS,EAAQ,EAAU,CAAE,yBAAwB,CAAC,CACtD,MAAM,EAAW,EAAW,EAAQ,QAAS,CAAE,yBAAwB,CAAC,CACxE,EAAU,EAAQ,EAAU,CAAE,yBAAwB,CAAC,CACvD,EAAuB,EAAO,CAE9B,EAAO,MAAM,0DAA2D,EAAO,CACxE,GAKT,MAAa,GAAuB,EAAkB,IAAiC,CACrF,EAAY,EAAQ,EAAS"}
|
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import "../utils/constants/index.cjs";
|
|
2
|
-
import "./
|
|
1
|
+
import { CustomFieldDefinitionType } from "../utils/constants/index.cjs";
|
|
2
|
+
import { CustomFieldValue } from "./CustomFieldValue.cjs";
|
|
3
|
+
import "./index.cjs";
|
|
4
|
+
import { Model } from "sequelize-typescript";
|
|
5
|
+
import { CreateOptions } from "sequelize";
|
|
6
|
+
|
|
7
|
+
//#region src/models/CustomFieldDefinition.d.ts
|
|
8
|
+
declare class CustomFieldDefinition extends Model {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
displayName?: string;
|
|
12
|
+
fieldType: CustomFieldDefinitionType;
|
|
13
|
+
validation?: any;
|
|
14
|
+
entityId: string;
|
|
15
|
+
entityType: string;
|
|
16
|
+
modelType: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
defaultValue?: any;
|
|
21
|
+
createdAt?: Date;
|
|
22
|
+
updatedAt?: Date;
|
|
23
|
+
deletedAt?: Date;
|
|
24
|
+
blockEditingFromUI: boolean;
|
|
25
|
+
values: CustomFieldValue[];
|
|
26
|
+
static displayNameDefaultValue(instance: CustomFieldDefinition): void;
|
|
27
|
+
static afterSaveHandler(instance: CustomFieldDefinition, options: CreateOptions): void;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { CustomFieldDefinition };
|
|
31
|
+
//# sourceMappingURL=CustomFieldDefinition.d.cts.map
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import "../utils/constants/index.js";
|
|
1
|
+
import { CustomFieldDefinitionType } from "../utils/constants/index.js";
|
|
2
|
+
import { CustomFieldValue } from "./CustomFieldValue.js";
|
|
2
3
|
import "./index.js";
|
|
3
|
-
import "sequelize";
|
|
4
|
-
import { Model } from "sequelize-typescript";
|
|
4
|
+
import { CreateOptions } from "sequelize";
|
|
5
|
+
import { Model } from "sequelize-typescript";
|
|
6
|
+
|
|
7
|
+
//#region src/models/CustomFieldDefinition.d.ts
|
|
8
|
+
declare class CustomFieldDefinition extends Model {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
displayName?: string;
|
|
12
|
+
fieldType: CustomFieldDefinitionType;
|
|
13
|
+
validation?: any;
|
|
14
|
+
entityId: string;
|
|
15
|
+
entityType: string;
|
|
16
|
+
modelType: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
defaultValue?: any;
|
|
21
|
+
createdAt?: Date;
|
|
22
|
+
updatedAt?: Date;
|
|
23
|
+
deletedAt?: Date;
|
|
24
|
+
blockEditingFromUI: boolean;
|
|
25
|
+
values: CustomFieldValue[];
|
|
26
|
+
static displayNameDefaultValue(instance: CustomFieldDefinition): void;
|
|
27
|
+
static afterSaveHandler(instance: CustomFieldDefinition, options: CreateOptions): void;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { CustomFieldDefinition };
|
|
31
|
+
//# sourceMappingURL=CustomFieldDefinition.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Model } from "sequelize-typescript";
|
|
2
|
+
import { CreateOptions } from "sequelize";
|
|
3
|
+
|
|
4
|
+
//#region src/models/CustomFieldEntries.d.ts
|
|
5
|
+
declare class CustomFieldEntries extends Model {
|
|
6
|
+
modelId: string;
|
|
7
|
+
entityId: string;
|
|
8
|
+
customFields: Record<string, any>;
|
|
9
|
+
modelType: string;
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
updatedAt?: Date;
|
|
12
|
+
static afterSaveHandler(instance: CustomFieldEntries[], options: CreateOptions): void;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CustomFieldEntries };
|
|
16
|
+
//# sourceMappingURL=CustomFieldEntries.d.cts.map
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import "sequelize";
|
|
2
|
-
import { Model } from "sequelize-typescript";
|
|
1
|
+
import { CreateOptions } from "sequelize";
|
|
2
|
+
import { Model } from "sequelize-typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/models/CustomFieldEntries.d.ts
|
|
5
|
+
declare class CustomFieldEntries extends Model {
|
|
6
|
+
modelId: string;
|
|
7
|
+
entityId: string;
|
|
8
|
+
customFields: Record<string, any>;
|
|
9
|
+
modelType: string;
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
updatedAt?: Date;
|
|
12
|
+
static afterSaveHandler(instance: CustomFieldEntries[], options: CreateOptions): void;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CustomFieldEntries };
|
|
16
|
+
//# sourceMappingURL=CustomFieldEntries.d.ts.map
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
import "./index.cjs";
|
|
1
|
+
import "./index.cjs";
|
|
2
|
+
import { CustomFieldDefinition } from "./CustomFieldDefinition.cjs";
|
|
3
|
+
import { Model } from "sequelize-typescript";
|
|
4
|
+
import { CreateOptions } from "sequelize";
|
|
5
|
+
|
|
6
|
+
//#region src/models/CustomFieldValue.d.ts
|
|
7
|
+
declare class CustomFieldValue extends Model {
|
|
8
|
+
modelId: string;
|
|
9
|
+
customFieldDefinitionId: string;
|
|
10
|
+
value: any;
|
|
11
|
+
createdAt?: Date;
|
|
12
|
+
updatedAt?: Date;
|
|
13
|
+
deletedAt?: Date;
|
|
14
|
+
customFieldDefinition: CustomFieldDefinition;
|
|
15
|
+
private static validateValueAgainstDefinition;
|
|
16
|
+
static validateCustomFieldValues(instances: CustomFieldValue[]): Promise<void>;
|
|
17
|
+
static validateCustomFieldValue(instance: CustomFieldValue): Promise<void>;
|
|
18
|
+
static afterSaveHandler(instance: CustomFieldValue[], options: CreateOptions): void;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { CustomFieldValue };
|
|
22
|
+
//# sourceMappingURL=CustomFieldValue.d.cts.map
|
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
import "./index.js";
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
2
|
+
import { CustomFieldDefinition } from "./CustomFieldDefinition.js";
|
|
3
|
+
import { CreateOptions } from "sequelize";
|
|
4
|
+
import { Model } from "sequelize-typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/models/CustomFieldValue.d.ts
|
|
7
|
+
declare class CustomFieldValue extends Model {
|
|
8
|
+
modelId: string;
|
|
9
|
+
customFieldDefinitionId: string;
|
|
10
|
+
value: any;
|
|
11
|
+
createdAt?: Date;
|
|
12
|
+
updatedAt?: Date;
|
|
13
|
+
deletedAt?: Date;
|
|
14
|
+
customFieldDefinition: CustomFieldDefinition;
|
|
15
|
+
private static validateValueAgainstDefinition;
|
|
16
|
+
static validateCustomFieldValues(instances: CustomFieldValue[]): Promise<void>;
|
|
17
|
+
static validateCustomFieldValue(instance: CustomFieldValue): Promise<void>;
|
|
18
|
+
static afterSaveHandler(instance: CustomFieldValue[], options: CreateOptions): void;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { CustomFieldValue };
|
|
22
|
+
//# sourceMappingURL=CustomFieldValue.d.ts.map
|
package/dist/models/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "./CustomFieldValue.cjs";
|
|
2
|
-
import "./
|
|
1
|
+
import { CustomFieldValue } from "./CustomFieldValue.cjs";
|
|
2
|
+
import { CustomFieldEntries } from "./CustomFieldEntries.cjs";
|
|
3
|
+
import { CustomFieldDefinition } from "./CustomFieldDefinition.cjs";
|
|
3
4
|
import "../types/index.cjs";
|
|
4
5
|
import { Sequelize } from "sequelize-typescript";
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./CustomFieldValue.js";
|
|
2
|
-
import "./CustomFieldEntries.js";
|
|
1
|
+
import { CustomFieldValue } from "./CustomFieldValue.js";
|
|
2
|
+
import { CustomFieldEntries } from "./CustomFieldEntries.js";
|
|
3
3
|
import "./CustomValidator.js";
|
|
4
|
-
import "./CustomFieldDefinition.js";
|
|
4
|
+
import { CustomFieldDefinition } from "./CustomFieldDefinition.js";
|
|
5
5
|
import "../types/index.js";
|
|
6
6
|
import { Sequelize } from "sequelize-typescript";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/sadot",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"reflect-metadata": "^0.1.13",
|
|
46
46
|
"sequelize": "^6.37.7",
|
|
47
47
|
"sequelize-typescript": "^2.1.6",
|
|
48
|
-
"@autofleet/events": "^5.2.
|
|
48
|
+
"@autofleet/events": "^5.2.23"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/express": "^4.17.17",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"supertest": "^7.0.0",
|
|
55
55
|
"@autofleet/errors": "^3.1.31",
|
|
56
56
|
"@autofleet/logger": "^4.2.36",
|
|
57
|
-
"@autofleet/
|
|
58
|
-
"@autofleet/
|
|
57
|
+
"@autofleet/node-common": "^4.2.13",
|
|
58
|
+
"@autofleet/zehut": "^4.5.12"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@autofleet/errors": "^3",
|