@8base/utils
Advanced tools
Comparing version 2.6.6 to 2.7.0-beta.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [2.7.0-beta.0](https://github.com/8base/sdk/compare/v2.6.6...v2.7.0-beta.0) (2022-06-22) | ||
### Features | ||
* **utils:** gqlPrettify function ([73bea83](https://github.com/8base/sdk/commit/73bea833b00285a39e7d4de0d115c4dee5f1e6ee)) | ||
* **utils:** replace gqlPrettier with gqlPrettify ([d4df857](https://github.com/8base/sdk/commit/d4df8572e5045e76507e1c439b59cdd5121ad470)) | ||
## [2.6.6](https://github.com/8base/sdk/compare/v2.6.5...v2.6.6) (2022-03-18) | ||
@@ -8,0 +20,0 @@ |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.COUNTRY_CODE_OPTIONS = void 0; | ||
exports.COUNTRY_CODE_OPTIONS = [ | ||
export const COUNTRY_CODE_OPTIONS = [ | ||
{ code: 'AF', value: '93', label: '+93' }, | ||
@@ -6,0 +3,0 @@ { code: 'AL', value: '355', label: '+355' }, |
@@ -1,15 +0,3 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./schemaConstants"), exports); | ||
__exportStar(require("./countryCodes"), exports); | ||
export * from './schemaConstants'; | ||
export * from './countryCodes'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UPDATE_META_FIELDS_TO_PRESERVE = exports.TABLE_ORIGIN_TYPES = exports.FIELD_KINDS = exports.APP_TYPES = exports.APP_STATUS = exports.MUTATION_FILE_FIELDS = exports.SYSTEM_TABLES = exports.GEO_FORMATS = exports.MUTATION_TYPE = exports.DATE_FORMATS = exports.SMART_FORMATS = exports.FILE_FORMATS = exports.NUMBER_FORMATS = exports.TEXT_FORMATS = exports.SWITCH_VALUES = exports.SWITCH_FORMATS = exports.FIELD_TYPE = void 0; | ||
exports.FIELD_TYPE = { | ||
export const FIELD_TYPE = { | ||
DATE: 'DATE', | ||
@@ -18,3 +15,3 @@ FILE: 'FILE', | ||
}; | ||
exports.SWITCH_FORMATS = { | ||
export const SWITCH_FORMATS = { | ||
ACTIVE_INACTIVE: 'ACTIVE_INACTIVE', | ||
@@ -27,3 +24,3 @@ CUSTOM: 'CUSTOM', | ||
}; | ||
exports.SWITCH_VALUES = { | ||
export const SWITCH_VALUES = { | ||
ACTIVE_INACTIVE: { | ||
@@ -50,3 +47,3 @@ false: 'Inactive', | ||
}; | ||
exports.TEXT_FORMATS = { | ||
export const TEXT_FORMATS = { | ||
HTML: 'HTML', | ||
@@ -61,3 +58,3 @@ MARKDOWN: 'MARKDOWN', | ||
}; | ||
exports.NUMBER_FORMATS = { | ||
export const NUMBER_FORMATS = { | ||
CURRENCY: 'CURRENCY', | ||
@@ -69,19 +66,19 @@ FRACTION: 'FRACTION', | ||
}; | ||
exports.FILE_FORMATS = { | ||
export const FILE_FORMATS = { | ||
FILE: 'FILE', | ||
IMAGE: 'IMAGE', | ||
}; | ||
exports.SMART_FORMATS = { | ||
export const SMART_FORMATS = { | ||
ADDRESS: 'ADDRESS', | ||
PHONE: 'PHONE', | ||
}; | ||
exports.DATE_FORMATS = { | ||
export const DATE_FORMATS = { | ||
DATE: 'DATE', | ||
DATETIME: 'DATETIME', | ||
}; | ||
exports.MUTATION_TYPE = { | ||
export const MUTATION_TYPE = { | ||
CREATE: 'CREATE', | ||
UPDATE: 'UPDATE', | ||
}; | ||
exports.GEO_FORMATS = { | ||
export const GEO_FORMATS = { | ||
GEOMETRY: 'GEOMETRY', | ||
@@ -92,3 +89,3 @@ POINT: 'POINT', | ||
}; | ||
exports.SYSTEM_TABLES = { | ||
export const SYSTEM_TABLES = { | ||
API_TOKENS: 'ApiTokens', | ||
@@ -107,11 +104,11 @@ ENVIRONMENT_VARIABLES: 'EnvironmentVariables', | ||
}; | ||
exports.MUTATION_FILE_FIELDS = ['id', 'fileId', 'public', 'filename', 'meta', 'mods']; | ||
exports.APP_STATUS = { | ||
export const MUTATION_FILE_FIELDS = ['id', 'fileId', 'public', 'filename', 'meta', 'mods']; | ||
export const APP_STATUS = { | ||
ACTIVE: 'ACTIVE', | ||
INACTIVE: 'INACTIVE', | ||
}; | ||
exports.APP_TYPES = { | ||
export const APP_TYPES = { | ||
SALESFORCE: 'salesforce', | ||
}; | ||
exports.FIELD_KINDS = { | ||
export const FIELD_KINDS = { | ||
USER: 'USER', | ||
@@ -121,3 +118,3 @@ SYSTEM: 'SYSTEM', | ||
}; | ||
exports.TABLE_ORIGIN_TYPES = { | ||
export const TABLE_ORIGIN_TYPES = { | ||
LOCAL: 'LOCAL', | ||
@@ -127,5 +124,5 @@ VIEW: 'VIEW', | ||
}; | ||
exports.UPDATE_META_FIELDS_TO_PRESERVE = { | ||
export const UPDATE_META_FIELDS_TO_PRESERVE = { | ||
id: true, | ||
}; | ||
//# sourceMappingURL=schemaConstants.js.map |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ERROR_CODES = void 0; | ||
var ERROR_CODES; | ||
export var ERROR_CODES; | ||
(function (ERROR_CODES) { | ||
@@ -13,3 +10,3 @@ ERROR_CODES["MISSING_PARAMETER"] = "MissingParameter"; | ||
ERROR_CODES["PROPERTY_CONFLICT"] = "PropertyConflict"; | ||
})(ERROR_CODES = exports.ERROR_CODES || (exports.ERROR_CODES = {})); | ||
})(ERROR_CODES || (ERROR_CODES = {})); | ||
//# sourceMappingURL=codes.js.map |
@@ -1,38 +0,15 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.showWarningIfDeprecatedParameters = exports.throwIfMissingRequiredParameters = void 0; | ||
const R = __importStar(require("ramda")); | ||
const SDKError_1 = require("./SDKError"); | ||
const codes_1 = require("./codes"); | ||
import * as R from 'ramda'; | ||
import { SDKError } from './SDKError'; | ||
import { ERROR_CODES } from './codes'; | ||
const hasParameter = R.ifElse(R.is(String), R.has, R.hasPath); | ||
const stringifyPath = R.ifElse(R.is(String), (path) => path, R.join('.')); | ||
const throwIfMissingRequiredParameters = (requiredParameterPaths, packageName, parameters = {}) => { | ||
export const throwIfMissingRequiredParameters = (requiredParameterPaths, packageName, parameters = {}) => { | ||
requiredParameterPaths.forEach((parameterPath) => { | ||
const isMissing = !hasParameter(parameterPath)(parameters); | ||
if (isMissing) { | ||
throw new SDKError_1.SDKError(codes_1.ERROR_CODES.MISSING_PARAMETER, packageName, `Missing parameter: ${stringifyPath(parameterPath)}`); | ||
throw new SDKError(ERROR_CODES.MISSING_PARAMETER, packageName, `Missing parameter: ${stringifyPath(parameterPath)}`); | ||
} | ||
}); | ||
}; | ||
exports.throwIfMissingRequiredParameters = throwIfMissingRequiredParameters; | ||
const showWarningIfDeprecatedParameters = (deprecatedParameterPaths, packageName, parameters = {}) => { | ||
export const showWarningIfDeprecatedParameters = (deprecatedParameterPaths, packageName, parameters = {}) => { | ||
deprecatedParameterPaths.forEach((parameterPath) => { | ||
@@ -46,3 +23,2 @@ const isExist = hasParameter(parameterPath)(parameters); | ||
}; | ||
exports.showWarningIfDeprecatedParameters = showWarningIfDeprecatedParameters; | ||
//# sourceMappingURL=helpers.js.map |
@@ -1,13 +0,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.showWarningIfDeprecatedParameters = exports.throwIfMissingRequiredParameters = exports.PACKAGES = exports.ERROR_CODES = exports.SDKError = void 0; | ||
var SDKError_1 = require("./SDKError"); | ||
Object.defineProperty(exports, "SDKError", { enumerable: true, get: function () { return SDKError_1.SDKError; } }); | ||
var codes_1 = require("./codes"); | ||
Object.defineProperty(exports, "ERROR_CODES", { enumerable: true, get: function () { return codes_1.ERROR_CODES; } }); | ||
var packages_1 = require("./packages"); | ||
Object.defineProperty(exports, "PACKAGES", { enumerable: true, get: function () { return packages_1.PACKAGES; } }); | ||
var helpers_1 = require("./helpers"); | ||
Object.defineProperty(exports, "throwIfMissingRequiredParameters", { enumerable: true, get: function () { return helpers_1.throwIfMissingRequiredParameters; } }); | ||
Object.defineProperty(exports, "showWarningIfDeprecatedParameters", { enumerable: true, get: function () { return helpers_1.showWarningIfDeprecatedParameters; } }); | ||
export { SDKError } from './SDKError'; | ||
export { ERROR_CODES } from './codes'; | ||
export { PACKAGES } from './packages'; | ||
export { throwIfMissingRequiredParameters, showWarningIfDeprecatedParameters } from './helpers'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PACKAGES = void 0; | ||
var PACKAGES; | ||
export var PACKAGES; | ||
(function (PACKAGES) { | ||
@@ -22,3 +19,3 @@ PACKAGES["API_CLIENT"] = "@8base/api-client"; | ||
PACKAGES["WEB_COGNITO_AUTH_CLIENT"] = "@8base/web-cognito-auth-client"; | ||
})(PACKAGES = exports.PACKAGES || (exports.PACKAGES = {})); | ||
})(PACKAGES || (PACKAGES = {})); | ||
//# sourceMappingURL=packages.js.map |
@@ -1,4 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SDKError = void 0; | ||
class SDKError extends Error { | ||
@@ -24,3 +21,3 @@ constructor(code, packageName, message) { | ||
} | ||
exports.SDKError = SDKError; | ||
export { SDKError }; | ||
//# sourceMappingURL=SDKError.js.map |
@@ -1,28 +0,6 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatDataAfterQuery = void 0; | ||
const R = __importStar(require("ramda")); | ||
const selectors_1 = require("../selectors"); | ||
const verifiers_1 = require("../verifiers"); | ||
const errors_1 = require("../errors"); | ||
const constants_1 = require("../constants"); | ||
import * as R from 'ramda'; | ||
import { tableSelectors, tablesListSelectors } from '../selectors'; | ||
import { isRelationField, isFileField, isListField, isMetaField, isGeoField } from '../verifiers'; | ||
import { SDKError, ERROR_CODES, PACKAGES } from '../errors'; | ||
import { UPDATE_META_FIELDS_TO_PRESERVE } from '../constants'; | ||
/** | ||
@@ -36,12 +14,12 @@ * Remove unnecessary data after fetch entity data by query | ||
const formatDataAfterQuery = (data, { tableName, appName, schema }, options = {}) => { | ||
const tableSchema = selectors_1.tablesListSelectors.getTableByName(schema, tableName, appName); | ||
const tableSchema = tablesListSelectors.getTableByName(schema, tableName, appName); | ||
if (!tableSchema) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Table schema with ${tableName} name not found in schema.`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Table schema with ${tableName} name not found in schema.`); | ||
} | ||
const formatedData = R.reduce((result, fieldName) => { | ||
const fieldSchema = selectors_1.tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const fieldSchema = tableSelectors.getFieldByName(tableSchema, fieldName); | ||
if (!fieldSchema) { | ||
return result; | ||
} | ||
if ((verifiers_1.isRelationField(fieldSchema) || verifiers_1.isFileField(fieldSchema)) && verifiers_1.isListField(fieldSchema)) { | ||
if ((isRelationField(fieldSchema) || isFileField(fieldSchema)) && isListField(fieldSchema)) { | ||
if (data[fieldName]) { | ||
@@ -51,11 +29,11 @@ result[fieldName] = data[fieldName].items; | ||
} | ||
else if (verifiers_1.isGeoField(fieldSchema) && data[fieldName]) { | ||
else if (isGeoField(fieldSchema) && data[fieldName]) { | ||
result[fieldName] = data[fieldName].coordinates; | ||
} | ||
else if (!verifiers_1.isMetaField(fieldSchema) || constants_1.UPDATE_META_FIELDS_TO_PRESERVE[fieldName]) { | ||
else if (!isMetaField(fieldSchema) || UPDATE_META_FIELDS_TO_PRESERVE[fieldName]) { | ||
result = R.assoc(fieldName, data[fieldName], result); | ||
} | ||
if (verifiers_1.isRelationField(fieldSchema) && !verifiers_1.isFileField(fieldSchema) && result[fieldName]) { | ||
if (isRelationField(fieldSchema) && !isFileField(fieldSchema) && result[fieldName]) { | ||
if (options.formatRelationToIds) { | ||
if (verifiers_1.isListField(fieldSchema)) { | ||
if (isListField(fieldSchema)) { | ||
result = R.assoc(fieldName, result[fieldName].map && result[fieldName].map(({ id }) => id), result); | ||
@@ -68,7 +46,7 @@ } | ||
else { | ||
const relationTableSchema = selectors_1.tablesListSelectors.getTableById(schema, fieldSchema.relation.refTable.id); | ||
const relationTableSchema = tablesListSelectors.getTableById(schema, fieldSchema.relation.refTable.id); | ||
if (!relationTableSchema) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Relation table schema with ${fieldSchema.relation.refTable.id} id not found in schema.`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Relation table schema with ${fieldSchema.relation.refTable.id} id not found in schema.`); | ||
} | ||
if (verifiers_1.isListField(fieldSchema)) { | ||
if (isListField(fieldSchema)) { | ||
result[fieldName] = result[fieldName].map((item) => formatDataAfterQuery(item, { | ||
@@ -91,3 +69,3 @@ tableName: relationTableSchema.name, | ||
}; | ||
exports.formatDataAfterQuery = formatDataAfterQuery; | ||
export { formatDataAfterQuery }; | ||
//# sourceMappingURL=formatDataAfterQuery.js.map |
@@ -1,30 +0,8 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatDataForMutation = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const selectors_1 = require("../selectors"); | ||
const verifiers_1 = require("../verifiers"); | ||
const formatFieldDataForMutation_1 = require("./formatFieldDataForMutation"); | ||
const omitDeep_1 = require("./omitDeep"); | ||
const errors_1 = require("../errors"); | ||
import * as R from 'ramda'; | ||
import { MUTATION_TYPE, MUTATION_FILE_FIELDS, UPDATE_META_FIELDS_TO_PRESERVE, FIELD_TYPE } from '../constants'; | ||
import { tableSelectors, tablesListSelectors } from '../selectors'; | ||
import { isMetaField, isFileField, isRelationField, isListField, isFilesTable } from '../verifiers'; | ||
import { formatFieldDataForMutation } from './formatFieldDataForMutation'; | ||
import { omitDeep } from './omitDeep'; | ||
import { SDKError, ERROR_CODES, PACKAGES } from '../errors'; | ||
const DEFAULT_OPTIONS = { | ||
@@ -35,3 +13,3 @@ ignoreNonTableFields: true, | ||
const shouldPreserveMetaField = ({ type, fieldName }) => { | ||
return type !== constants_1.MUTATION_TYPE.UPDATE ? false : constants_1.UPDATE_META_FIELDS_TO_PRESERVE[fieldName]; | ||
return type !== MUTATION_TYPE.UPDATE ? false : UPDATE_META_FIELDS_TO_PRESERVE[fieldName]; | ||
}; | ||
@@ -50,4 +28,4 @@ const isFieldRemoved = ({ initialValue, value }) => { | ||
const formatDataForMutation = (type, data, { tableName, appName, schema, initialData }, options = {}) => { | ||
if (R.not(type in constants_1.MUTATION_TYPE)) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.INVALID_ARGUMENT, errors_1.PACKAGES.UTILS, `Invalid mutation type: ${type}`); | ||
if (R.not(type in MUTATION_TYPE)) { | ||
throw new SDKError(ERROR_CODES.INVALID_ARGUMENT, PACKAGES.UTILS, `Invalid mutation type: ${type}`); | ||
} | ||
@@ -57,5 +35,5 @@ if (R.isNil(data)) { | ||
} | ||
const tableSchema = selectors_1.tablesListSelectors.getTableByName(schema, tableName, appName); | ||
const tableSchema = tablesListSelectors.getTableByName(schema, tableName, appName); | ||
if (!tableSchema) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Table schema with ${tableName} name not found in schema.`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Table schema with ${tableName} name not found in schema.`); | ||
} | ||
@@ -67,6 +45,6 @@ options = R.mergeDeepRight(DEFAULT_OPTIONS, options); | ||
fieldName === '__typename' || | ||
(verifiers_1.isFilesTable(tableSchema) && !constants_1.MUTATION_FILE_FIELDS.includes(fieldName))) { | ||
(isFilesTable(tableSchema) && !MUTATION_FILE_FIELDS.includes(fieldName))) { | ||
return result; | ||
} | ||
const fieldSchema = selectors_1.tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const fieldSchema = tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const { skip, mutate, ignoreNonTableFields, ignorePristineValues } = options; | ||
@@ -82,7 +60,7 @@ if (!fieldSchema) { | ||
} | ||
if (fieldSchema.fieldType !== constants_1.FIELD_TYPE.ID && | ||
if (fieldSchema.fieldType !== FIELD_TYPE.ID && | ||
!R.pathOr(true, ['dataFeatures', type.toLowerCase()], fieldSchema)) { | ||
return result; | ||
} | ||
if (verifiers_1.isMetaField(fieldSchema) && !shouldPreserveMetaField({ type, fieldName })) { | ||
if (isMetaField(fieldSchema) && !shouldPreserveMetaField({ type, fieldName })) { | ||
return result; | ||
@@ -94,3 +72,3 @@ } | ||
: data[fieldName]; | ||
if ((verifiers_1.isFileField(fieldSchema) || verifiers_1.isRelationField(fieldSchema)) && verifiers_1.isListField(fieldSchema)) { | ||
if ((isFileField(fieldSchema) || isRelationField(fieldSchema)) && isListField(fieldSchema)) { | ||
if (R.isNil(formatedFieldData)) { | ||
@@ -102,7 +80,7 @@ formatedFieldData = []; | ||
} | ||
if (formatedFieldData.length === 0 && type === constants_1.MUTATION_TYPE.CREATE) { | ||
if (formatedFieldData.length === 0 && type === MUTATION_TYPE.CREATE) { | ||
return result; | ||
} | ||
} | ||
formatedFieldData = formatFieldDataForMutation_1.formatFieldDataForMutation(type, formatedFieldData, { | ||
formatedFieldData = formatFieldDataForMutation(type, formatedFieldData, { | ||
fieldSchema, | ||
@@ -126,5 +104,5 @@ schema, | ||
}, {}, dataKeys); | ||
return omitDeep_1.omitDeep(['_description', '__typename'], formatedData); | ||
return omitDeep(['_description', '__typename'], formatedData); | ||
}; | ||
exports.formatDataForMutation = formatDataForMutation; | ||
export { formatDataForMutation }; | ||
//# sourceMappingURL=formatDataForMutation.js.map |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatFieldData = void 0; | ||
const formatFieldDataListItem_1 = require("./formatFieldDataListItem"); | ||
const formatFieldData = (type, data, { fieldSchema, schema, initialData }, options) => { | ||
const nextData = formatFieldDataListItem_1.formatFieldDataListItem(type, data, { fieldSchema, schema, initialData }, options); | ||
import { formatFieldDataListItem } from './formatFieldDataListItem'; | ||
export const formatFieldData = (type, data, { fieldSchema, schema, initialData }, options) => { | ||
const nextData = formatFieldDataListItem(type, data, { fieldSchema, schema, initialData }, options); | ||
return nextData | ||
@@ -13,3 +10,2 @@ ? { | ||
}; | ||
exports.formatFieldData = formatFieldData; | ||
//# sourceMappingURL=formatFieldData.js.map |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatFieldDataForMutation = void 0; | ||
const R = __importStar(require("ramda")); | ||
const verifiers = __importStar(require("../verifiers")); | ||
const formatFieldDataList_1 = require("./formatFieldDataList"); | ||
const formatFieldData_1 = require("./formatFieldData"); | ||
import * as R from 'ramda'; | ||
import * as verifiers from '../verifiers'; | ||
import { formatFieldDataList } from './formatFieldDataList'; | ||
import { formatFieldData } from './formatFieldData'; | ||
const formatJSON = (data) => { | ||
@@ -43,6 +21,6 @@ if (typeof data === 'string' && data.length === 0) { | ||
if (verifiers.isListField(fieldSchema)) { | ||
nextData = formatFieldDataList_1.formatFieldDataList(type, data, { fieldSchema, schema, initialData }, options); | ||
nextData = formatFieldDataList(type, data, { fieldSchema, schema, initialData }, options); | ||
} | ||
else { | ||
nextData = formatFieldData_1.formatFieldData(type, data, { fieldSchema, schema, initialData }, options); | ||
nextData = formatFieldData(type, data, { fieldSchema, schema, initialData }, options); | ||
} | ||
@@ -110,3 +88,3 @@ } | ||
}; | ||
exports.formatFieldDataForMutation = formatFieldDataForMutation; | ||
export { formatFieldDataForMutation }; | ||
//# sourceMappingURL=formatFieldDataForMutation.js.map |
@@ -1,25 +0,3 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatFieldDataList = void 0; | ||
const R = __importStar(require("ramda")); | ||
const formatFieldDataListItem_1 = require("./formatFieldDataListItem"); | ||
import * as R from 'ramda'; | ||
import { formatFieldDataListItem } from './formatFieldDataListItem'; | ||
const bindDataWithInitialData = (list = [], initialList = []) => { | ||
@@ -51,6 +29,6 @@ const result = []; | ||
}; | ||
const formatFieldDataList = (type, data, { fieldSchema, schema, initialData }, options) => R.pipe((data) => bindDataWithInitialData(data, initialData), | ||
export const formatFieldDataList = (type, data, { fieldSchema, schema, initialData }, options) => R.pipe((data) => bindDataWithInitialData(data, initialData), | ||
// // @ts-ignore | ||
// data => console.log('binded data', data) || data, | ||
R.map((item) => formatFieldDataListItem_1.formatFieldDataListItem(type, item.data, { | ||
R.map((item) => formatFieldDataListItem(type, item.data, { | ||
fieldSchema, | ||
@@ -61,3 +39,2 @@ schema, | ||
}, options)), R.filter((item) => Boolean(item)), R.groupBy(R.prop('type')), R.mapObjIndexed(R.map(R.prop('data'))))(data); | ||
exports.formatFieldDataList = formatFieldDataList; | ||
//# sourceMappingURL=formatFieldDataList.js.map |
@@ -1,30 +0,8 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatFieldDataListItem = void 0; | ||
const R = __importStar(require("ramda")); | ||
const verifiers_1 = require("../verifiers"); | ||
const selectors_1 = require("../selectors"); | ||
const constants_1 = require("../constants"); | ||
const formatDataForMutation_1 = require("./formatDataForMutation"); | ||
const errors_1 = require("../errors"); | ||
const formatFieldDataListItem = (type, data, { fieldSchema, schema, initialData, initialListData }, options) => { | ||
import * as R from 'ramda'; | ||
import { isRelationField, isFileField, isListField } from '../verifiers'; | ||
import { tablesListSelectors } from '../selectors'; | ||
import { MUTATION_TYPE, SYSTEM_TABLES } from '../constants'; | ||
import { formatDataForMutation } from './formatDataForMutation'; | ||
import { SDKError, ERROR_CODES, PACKAGES } from '../errors'; | ||
export const formatFieldDataListItem = (type, data, { fieldSchema, schema, initialData, initialListData }, options) => { | ||
let nextData = data; | ||
@@ -55,3 +33,3 @@ if (R.isNil(nextData)) { | ||
} | ||
if (typeof nextData.id === 'string' && type === constants_1.MUTATION_TYPE.CREATE) { | ||
if (typeof nextData.id === 'string' && type === MUTATION_TYPE.CREATE) { | ||
return { | ||
@@ -63,13 +41,13 @@ data: { id: nextData.id }, | ||
// TODO: is it valid case? | ||
if (!R.isNil(nextData.length) && nextData.length === 0 && type === constants_1.MUTATION_TYPE.UPDATE) { | ||
if (!R.isNil(nextData.length) && nextData.length === 0 && type === MUTATION_TYPE.UPDATE) { | ||
return null; | ||
} | ||
const shouldUpdate = type === constants_1.MUTATION_TYPE.UPDATE && typeof nextData.id === 'string'; | ||
const nextFormatDataForMutationType = shouldUpdate ? constants_1.MUTATION_TYPE.UPDATE : constants_1.MUTATION_TYPE.CREATE; | ||
if (verifiers_1.isRelationField(fieldSchema)) { | ||
const relationTableSchema = selectors_1.tablesListSelectors.getTableById(schema, fieldSchema.relation.refTable.id); | ||
const shouldUpdate = type === MUTATION_TYPE.UPDATE && typeof nextData.id === 'string'; | ||
const nextFormatDataForMutationType = shouldUpdate ? MUTATION_TYPE.UPDATE : MUTATION_TYPE.CREATE; | ||
if (isRelationField(fieldSchema)) { | ||
const relationTableSchema = tablesListSelectors.getTableById(schema, fieldSchema.relation.refTable.id); | ||
if (!relationTableSchema) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Relation table schema with ${fieldSchema.relation.refTable.id} id not found in schema.`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Relation table schema with ${fieldSchema.relation.refTable.id} id not found in schema.`); | ||
} | ||
nextData = formatDataForMutation_1.formatDataForMutation(nextFormatDataForMutationType, nextData, { | ||
nextData = formatDataForMutation(nextFormatDataForMutationType, nextData, { | ||
tableName: relationTableSchema.name, | ||
@@ -80,5 +58,5 @@ schema, | ||
} | ||
if (verifiers_1.isFileField(fieldSchema)) { | ||
nextData = formatDataForMutation_1.formatDataForMutation(nextFormatDataForMutationType, nextData, { | ||
tableName: constants_1.SYSTEM_TABLES.FILES, | ||
if (isFileField(fieldSchema)) { | ||
nextData = formatDataForMutation(nextFormatDataForMutationType, nextData, { | ||
tableName: SYSTEM_TABLES.FILES, | ||
schema, | ||
@@ -91,3 +69,3 @@ initialData, | ||
type: 'update', | ||
data: verifiers_1.isListField(fieldSchema) ? { data: nextData, filter: { id: data.id } } : R.dissoc('id', nextData), | ||
data: isListField(fieldSchema) ? { data: nextData, filter: { id: data.id } } : R.dissoc('id', nextData), | ||
}; | ||
@@ -100,3 +78,2 @@ } | ||
}; | ||
exports.formatFieldDataListItem = formatFieldDataListItem; | ||
//# sourceMappingURL=formatFieldDataListItem.js.map |
@@ -1,30 +0,8 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatOptimisticResponse = void 0; | ||
const R = __importStar(require("ramda")); | ||
const schema_name_generator_1 = require("@8base/schema-name-generator"); | ||
const constants_1 = require("../constants"); | ||
const selectors_1 = require("../selectors"); | ||
const errors_1 = require("../errors"); | ||
import * as R from 'ramda'; | ||
import { SchemaNameGenerator } from '@8base/schema-name-generator'; | ||
import { MUTATION_TYPE, FIELD_TYPE } from '../constants'; | ||
import { tableSelectors, tableFieldSelectors, tablesListSelectors } from '../selectors'; | ||
import { SDKError, ERROR_CODES, PACKAGES } from '../errors'; | ||
const formatFileOptimisticResponse = (recordId, requestFieldData, fieldSchema) => { | ||
const isList = selectors_1.tableFieldSelectors.isListField(fieldSchema); | ||
const isList = tableFieldSelectors.isListField(fieldSchema); | ||
if (!isList && (R.isNil(requestFieldData) || R.isEmpty(requestFieldData))) { | ||
@@ -73,7 +51,7 @@ return null; | ||
const formatOptimisticResponse = (type, { requestData, recordId }, { tableName, appName, schema }, options = {}) => { | ||
if (R.not(type in constants_1.MUTATION_TYPE)) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.INVALID_ARGUMENT, errors_1.PACKAGES.UTILS, `Invalid mutation type: ${type}.`); | ||
if (R.not(type in MUTATION_TYPE)) { | ||
throw new SDKError(ERROR_CODES.INVALID_ARGUMENT, PACKAGES.UTILS, `Invalid mutation type: ${type}.`); | ||
} | ||
if (R.equals(type, 'CREATE')) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.NOT_IMPLEMENTED, errors_1.PACKAGES.UTILS, `${type} mutation type is not supported yet.`); | ||
throw new SDKError(ERROR_CODES.NOT_IMPLEMENTED, PACKAGES.UTILS, `${type} mutation type is not supported yet.`); | ||
} | ||
@@ -83,10 +61,10 @@ if (R.isNil(requestData)) { | ||
} | ||
const tableSchema = selectors_1.tablesListSelectors.getTableByName(schema, tableName, appName); | ||
const tableSchema = tablesListSelectors.getTableByName(schema, tableName, appName); | ||
if (!tableSchema) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Table schema with ${tableName} name is not found in schema.`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Table schema with ${tableName} name is not found in schema.`); | ||
} | ||
const formattedResponse = R.reduce((result, fieldName) => { | ||
const fieldSchema = selectors_1.tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const fieldType = selectors_1.tableFieldSelectors.getFieldType(fieldSchema); | ||
const tableName = selectors_1.tableFieldSelectors.getTableName(fieldSchema); | ||
const fieldSchema = tableSelectors.getFieldByName(tableSchema, fieldName); | ||
const fieldType = tableFieldSelectors.getFieldType(fieldSchema); | ||
const tableName = tableFieldSelectors.getTableName(fieldSchema); | ||
const { skip } = options; | ||
@@ -98,3 +76,3 @@ if (typeof skip === 'function' && skip(requestData[fieldName], fieldSchema)) { | ||
let fieldOptimisticResponse = {}; | ||
if (fieldType === constants_1.FIELD_TYPE.FILE) { | ||
if (fieldType === FIELD_TYPE.FILE) { | ||
fieldOptimisticResponse = formatFileOptimisticResponse(recordId, requestFieldData, fieldSchema); | ||
@@ -111,6 +89,6 @@ } | ||
__typename: 'Mutation', | ||
[schema_name_generator_1.SchemaNameGenerator.getUpdateItemFieldName(tableName)]: Object.assign({ __typename: schema_name_generator_1.SchemaNameGenerator.getUpdateInputName(tableName).replace('UpdateInput', ''), id: recordId }, formattedResponse), | ||
[SchemaNameGenerator.getUpdateItemFieldName(tableName)]: Object.assign({ __typename: SchemaNameGenerator.getUpdateInputName(tableName).replace('UpdateInput', ''), id: recordId }, formattedResponse), | ||
}; | ||
}; | ||
exports.formatOptimisticResponse = formatOptimisticResponse; | ||
export { formatOptimisticResponse }; | ||
//# sourceMappingURL=formatOptimisticResponse.js.map |
export { formatDataForMutation } from './formatDataForMutation'; | ||
export { formatDataAfterQuery } from './formatDataAfterQuery'; | ||
export { formatOptimisticResponse } from './formatOptimisticResponse'; | ||
export { gqlPrettify } from './gqlPrettify'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,10 +0,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatOptimisticResponse = exports.formatDataAfterQuery = exports.formatDataForMutation = void 0; | ||
var formatDataForMutation_1 = require("./formatDataForMutation"); | ||
Object.defineProperty(exports, "formatDataForMutation", { enumerable: true, get: function () { return formatDataForMutation_1.formatDataForMutation; } }); | ||
var formatDataAfterQuery_1 = require("./formatDataAfterQuery"); | ||
Object.defineProperty(exports, "formatDataAfterQuery", { enumerable: true, get: function () { return formatDataAfterQuery_1.formatDataAfterQuery; } }); | ||
var formatOptimisticResponse_1 = require("./formatOptimisticResponse"); | ||
Object.defineProperty(exports, "formatOptimisticResponse", { enumerable: true, get: function () { return formatOptimisticResponse_1.formatOptimisticResponse; } }); | ||
export { formatDataForMutation } from './formatDataForMutation'; | ||
export { formatDataAfterQuery } from './formatDataAfterQuery'; | ||
export { formatOptimisticResponse } from './formatOptimisticResponse'; | ||
export { gqlPrettify } from './gqlPrettify'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,24 +0,2 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.omitDeep = void 0; | ||
const R = __importStar(require("ramda")); | ||
import * as R from 'ramda'; | ||
const omitDeep = (omitedProps, objectForOmitting) => { | ||
@@ -48,3 +26,3 @@ if (!objectForOmitting || | ||
}; | ||
exports.omitDeep = omitDeep; | ||
export { omitDeep }; | ||
//# sourceMappingURL=omitDeep.js.map |
@@ -1,22 +0,10 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./constants"), exports); | ||
__exportStar(require("./formatters"), exports); | ||
__exportStar(require("./selectors"), exports); | ||
__exportStar(require("./verifiers"), exports); | ||
__exportStar(require("./queryGenerators"), exports); | ||
__exportStar(require("./errors"), exports); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./StorageAPI"), exports); | ||
__exportStar(require("./Publisher"), exports); | ||
export * from './constants'; | ||
export * from './formatters'; | ||
export * from './selectors'; | ||
export * from './verifiers'; | ||
export * from './queryGenerators'; | ||
export * from './errors'; | ||
export * from './types'; | ||
export * from './StorageAPI'; | ||
export * from './Publisher'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,25 +0,3 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Publisher = void 0; | ||
const R = __importStar(require("ramda")); | ||
class Publisher { | ||
import * as R from 'ramda'; | ||
export class Publisher { | ||
constructor() { | ||
@@ -60,3 +38,2 @@ this.subscribers = []; | ||
} | ||
exports.Publisher = Publisher; | ||
//# sourceMappingURL=Publisher.js.map |
@@ -1,35 +0,13 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createQueryColumnsList = void 0; | ||
const R = __importStar(require("ramda")); | ||
const selectors_1 = require("../selectors"); | ||
import * as R from 'ramda'; | ||
import { tablesListSelectors, tableFieldSelectors } from '../selectors'; | ||
const capitalizeFirstLetter = (str) => { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
}; | ||
const createQueryColumnsList = (tablesList, tableId, config = {}, prevKey = '') => { | ||
const { fields = [] } = selectors_1.tablesListSelectors.getTableById(tablesList, tableId) || {}; | ||
export const createQueryColumnsList = (tablesList, tableId, config = {}, prevKey = '') => { | ||
const { fields = [] } = tablesListSelectors.getTableById(tablesList, tableId) || {}; | ||
const { deep = 1, withMeta = true, flatten = true, includeColumns } = config; | ||
const transformedList = fields | ||
.filter((field) => { | ||
const isMeta = selectors_1.tableFieldSelectors.isMetaField(field); | ||
const isIdField = selectors_1.tableFieldSelectors.isIdField(field); | ||
const isMeta = tableFieldSelectors.isMetaField(field); | ||
const isIdField = tableFieldSelectors.isIdField(field); | ||
if (isIdField) { | ||
@@ -41,10 +19,10 @@ return false; | ||
.map((field) => { | ||
const fieldName = selectors_1.tableFieldSelectors.getFieldName(field); | ||
const fieldType = selectors_1.tableFieldSelectors.getFieldType(field); | ||
const fieldTypeAttributes = selectors_1.tableFieldSelectors.getFieldTypesAttributes(field); | ||
const isRelation = selectors_1.tableFieldSelectors.isRelationField(field); | ||
const isFile = selectors_1.tableFieldSelectors.isFileField(field); | ||
const isList = selectors_1.tableFieldSelectors.isListField(field); | ||
const refTableId = selectors_1.tableFieldSelectors.getRelationTableId(field); | ||
const refTable = selectors_1.tablesListSelectors.getTableById(tablesList, refTableId); | ||
const fieldName = tableFieldSelectors.getFieldName(field); | ||
const fieldType = tableFieldSelectors.getFieldType(field); | ||
const fieldTypeAttributes = tableFieldSelectors.getFieldTypesAttributes(field); | ||
const isRelation = tableFieldSelectors.isRelationField(field); | ||
const isFile = tableFieldSelectors.isFileField(field); | ||
const isList = tableFieldSelectors.isListField(field); | ||
const refTableId = tableFieldSelectors.getRelationTableId(field); | ||
const refTable = tablesListSelectors.getTableById(tablesList, refTableId); | ||
const currentKeyString = prevKey ? `${prevKey}.${fieldName}` : fieldName; | ||
@@ -76,3 +54,3 @@ const title = capitalizeFirstLetter(fieldName); | ||
else if (isRelation && refTableId && refTable && deep > 1) { | ||
const innerKeys = exports.createQueryColumnsList(tablesList, refTableId, { deep: deep - 1, withMeta, includeColumns }, currentKeyString); | ||
const innerKeys = createQueryColumnsList(tablesList, refTableId, { deep: deep - 1, withMeta, includeColumns }, currentKeyString); | ||
return flatten | ||
@@ -101,3 +79,2 @@ ? [...innerKeys, { name: currentKeyString, title, meta }] | ||
}; | ||
exports.createQueryColumnsList = createQueryColumnsList; | ||
//# sourceMappingURL=createQueryColumnsList.js.map |
@@ -1,32 +0,10 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createQueryString = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const selectors_1 = require("../selectors"); | ||
const errors_1 = require("../errors"); | ||
import * as R from 'ramda'; | ||
import { SYSTEM_TABLES } from '../constants'; | ||
import { tablesListSelectors, tableFieldSelectors } from '../selectors'; | ||
import { SDKError, PACKAGES, ERROR_CODES } from '../errors'; | ||
const DEFAULT_DEPTH = 1; | ||
const createQueryString = (tablesList, tableId, queryObjectConfig = {}, prevKey = '') => { | ||
const table = selectors_1.tablesListSelectors.getTableById(tablesList, tableId); | ||
export const createQueryString = (tablesList, tableId, queryObjectConfig = {}, prevKey = '') => { | ||
const table = tablesListSelectors.getTableById(tablesList, tableId); | ||
if (!table) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Table with id ${tableId} not found`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Table with id ${tableId} not found`); | ||
} | ||
@@ -38,7 +16,7 @@ const { fields, name: tableName } = table; | ||
.filter((field) => { | ||
const isMeta = selectors_1.tableFieldSelectors.isMetaField(field); | ||
const isRelation = selectors_1.tableFieldSelectors.isRelationField(field); | ||
const isMeta = tableFieldSelectors.isMetaField(field); | ||
const isRelation = tableFieldSelectors.isRelationField(field); | ||
let shouldIncludeField = withMeta ? true : !isMeta; | ||
if (isRelation) { | ||
const refTableName = selectors_1.tableFieldSelectors.getRelationTableName(field); | ||
const refTableName = tableFieldSelectors.getRelationTableName(field); | ||
const refTableAllowed = R.pathOr(true, ['data', refTableName, 'permission', 'read', 'allow'], permissions); | ||
@@ -58,15 +36,15 @@ shouldIncludeField = refTableAllowed && shouldIncludeField; | ||
let fieldContent = field.name; | ||
const isRelation = selectors_1.tableFieldSelectors.isRelationField(field); | ||
const isMissingRelation = selectors_1.tableFieldSelectors.isMissingRelationField(field); | ||
const isOneWayRelationField = selectors_1.tableFieldSelectors.isOneWayRelationField(field); | ||
const isFile = selectors_1.tableFieldSelectors.isFileField(field); | ||
const isGeo = selectors_1.tableFieldSelectors.isGeoField(field); | ||
const isSmart = selectors_1.tableFieldSelectors.isSmartField(field); | ||
const isList = selectors_1.tableFieldSelectors.isListField(field); | ||
const refTableId = selectors_1.tableFieldSelectors.getRelationTableId(field); | ||
const refTable = selectors_1.tablesListSelectors.getTableById(tablesList, refTableId); | ||
const isSettingsRefTable = selectors_1.tableFieldSelectors.isSystemField(field) && | ||
selectors_1.tableFieldSelectors.getRelationTableName(field) === constants_1.SYSTEM_TABLES.SETTINGS; | ||
const isPermissionsRefTable = selectors_1.tableFieldSelectors.isSystemField(field) && | ||
selectors_1.tableFieldSelectors.getRelationTableName(field) === constants_1.SYSTEM_TABLES.PERMISSIONS; | ||
const isRelation = tableFieldSelectors.isRelationField(field); | ||
const isMissingRelation = tableFieldSelectors.isMissingRelationField(field); | ||
const isOneWayRelationField = tableFieldSelectors.isOneWayRelationField(field); | ||
const isFile = tableFieldSelectors.isFileField(field); | ||
const isGeo = tableFieldSelectors.isGeoField(field); | ||
const isSmart = tableFieldSelectors.isSmartField(field); | ||
const isList = tableFieldSelectors.isListField(field); | ||
const refTableId = tableFieldSelectors.getRelationTableId(field); | ||
const refTable = tablesListSelectors.getTableById(tablesList, refTableId); | ||
const isSettingsRefTable = tableFieldSelectors.isSystemField(field) && | ||
tableFieldSelectors.getRelationTableName(field) === SYSTEM_TABLES.SETTINGS; | ||
const isPermissionsRefTable = tableFieldSelectors.isSystemField(field) && | ||
tableFieldSelectors.getRelationTableName(field) === SYSTEM_TABLES.PERMISSIONS; | ||
const currentKeyString = prevKey ? `${prevKey}.${field.name}` : field.name; | ||
@@ -94,3 +72,3 @@ let isNotEmptyRelation = false; | ||
const relationIncludeColumns = includeAllrelationFields ? null : includeColumns; | ||
const innerFields = exports.createQueryString(tablesList, refTableId, { | ||
const innerFields = createQueryString(tablesList, refTableId, { | ||
deep: deep - 1, | ||
@@ -102,4 +80,3 @@ includeColumns: relationIncludeColumns, | ||
fieldContent = `{ | ||
id | ||
${innerFields} | ||
id${innerFields} | ||
_description | ||
@@ -145,3 +122,12 @@ }`; | ||
else { | ||
queryObject += `\n${field.name} ${fieldContent}`; | ||
if (field.name === fieldContent) { | ||
// skip double id | ||
if (field.name !== 'id') { | ||
queryObject += `\n${field.name}`; | ||
} | ||
} | ||
else { | ||
queryObject += `\n${field.name} | ||
${fieldContent}`; | ||
} | ||
} | ||
@@ -152,3 +138,2 @@ } | ||
}; | ||
exports.createQueryString = createQueryString; | ||
//# sourceMappingURL=createQueryString.js.map |
@@ -1,17 +0,3 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createQueryColumnsList = void 0; | ||
__exportStar(require("./queryGenerators"), exports); | ||
var createQueryColumnsList_1 = require("./createQueryColumnsList"); | ||
Object.defineProperty(exports, "createQueryColumnsList", { enumerable: true, get: function () { return createQueryColumnsList_1.createQueryColumnsList; } }); | ||
export * from './queryGenerators'; | ||
export { createQueryColumnsList } from './createQueryColumnsList'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,21 +0,1 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
@@ -32,13 +12,8 @@ var t = {}; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createTableRowDeleteTag = exports.createTableRowQueryTag = exports.createTableRowUpdateTag = exports.createTableRowCreateManyTag = exports.createTableRowCreateTag = exports.createTableFilterGraphqlTag = void 0; | ||
const R = __importStar(require("ramda")); | ||
const schema_name_generator_1 = require("@8base/schema-name-generator"); | ||
const selectors_1 = require("../selectors"); | ||
const graphql_prettier_1 = __importDefault(require("graphql-prettier")); | ||
const errors_1 = require("../errors"); | ||
const createQueryString_1 = require("./createQueryString"); | ||
import * as R from 'ramda'; | ||
import { SchemaNameGenerator } from '@8base/schema-name-generator'; | ||
import { tablesListSelectors } from '../selectors'; | ||
import { gqlPrettify } from '../formatters'; | ||
import { SDKError, PACKAGES, ERROR_CODES } from '../errors'; | ||
import { createQueryString } from './createQueryString'; | ||
const upperFirst = (str) => R.toUpper(R.head(str)) + R.tail(str); | ||
@@ -55,17 +30,17 @@ const wrapInAppName = (appName, appContentName) => (queryString) => { | ||
const getTable = (tablesList, tableId) => { | ||
const table = selectors_1.tablesListSelectors.getTableById(tablesList, tableId); | ||
const table = tablesListSelectors.getTableById(tablesList, tableId); | ||
if (!table) { | ||
throw new errors_1.SDKError(errors_1.ERROR_CODES.TABLE_NOT_FOUND, errors_1.PACKAGES.UTILS, `Table schema with ${tableId} id not found.`); | ||
throw new SDKError(ERROR_CODES.TABLE_NOT_FOUND, PACKAGES.UTILS, `Table schema with ${tableId} id not found.`); | ||
} | ||
return table; | ||
}; | ||
const createTableFilterGraphqlTag = (tablesList, tableId, config = {}) => { | ||
export const createTableFilterGraphqlTag = (tablesList, tableId, config = {}) => { | ||
const table = getTable(tablesList, tableId); | ||
const appName = selectors_1.tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const appName = tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const { withResultData = true } = config, restConfig = __rest(config, ["withResultData"]); | ||
return graphql_prettier_1.default(` | ||
return gqlPrettify(` | ||
query ${upperFirst(table.name)}TableContent( | ||
$filter: ${schema_name_generator_1.SchemaNameGenerator.getFilterInputTypeName(table.name, appName)} | ||
$orderBy: [${schema_name_generator_1.SchemaNameGenerator.getOrderByInputTypeName(table.name, appName)}] | ||
$sort: [${schema_name_generator_1.SchemaNameGenerator.getSortInputTypeName(table.name, appName)}!] | ||
$filter: ${SchemaNameGenerator.getFilterInputTypeName(table.name, appName)} | ||
$orderBy: [${SchemaNameGenerator.getOrderByInputTypeName(table.name, appName)}] | ||
$sort: [${SchemaNameGenerator.getSortInputTypeName(table.name, appName)}!] | ||
$after: String | ||
@@ -78,3 +53,3 @@ $before: String | ||
${wrapInAppName(appName, config.appContentName)(` | ||
${config.tableContentName ? `${config.tableContentName}: ` : ''}${schema_name_generator_1.SchemaNameGenerator.getTableListFieldName(table.name)}( | ||
${config.tableContentName ? `${config.tableContentName}: ` : ''}${SchemaNameGenerator.getTableListFieldName(table.name)}( | ||
filter: $filter | ||
@@ -90,4 +65,3 @@ orderBy: $orderBy | ||
items { | ||
id | ||
${withResultData ? createQueryString_1.createQueryString(tablesList, table.id, Object.assign({}, restConfig)) : ''} | ||
id${withResultData ? createQueryString(tablesList, table.id, Object.assign({}, restConfig)) : ''} | ||
_description | ||
@@ -99,15 +73,13 @@ } | ||
}; | ||
exports.createTableFilterGraphqlTag = createTableFilterGraphqlTag; | ||
const createTableRowCreateTag = (tablesList, tableId, config = {}) => { | ||
export const createTableRowCreateTag = (tablesList, tableId, config = {}) => { | ||
const table = getTable(tablesList, tableId); | ||
const appName = selectors_1.tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const appName = tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const hasCreatableFields = R.pipe(R.propOr([], 'fields'), R.any(R.pathEq(['dataFeatures', 'create'], true)))(table); | ||
const { withResultData = true } = config, restConfig = __rest(config, ["withResultData"]); | ||
if (hasCreatableFields) { | ||
return graphql_prettier_1.default(` | ||
mutation ${upperFirst(table.name)}Create($data: ${schema_name_generator_1.SchemaNameGenerator.getCreateInputName(table.name, appName)}!) { | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Create($data: ${SchemaNameGenerator.getCreateInputName(table.name, appName)}!) { | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getCreateItemFieldName(table.name)}(data: $data) { | ||
id | ||
${withResultData ? createQueryString_1.createQueryString(tablesList, tableId, Object.assign({ withMeta: false }, restConfig)) : ''} | ||
${SchemaNameGenerator.getCreateItemFieldName(table.name)}(data: $data) { | ||
id${withResultData ? createQueryString(tablesList, tableId, Object.assign({ withMeta: false }, restConfig)) : ''} | ||
_description | ||
@@ -117,8 +89,7 @@ }`)} | ||
} | ||
return graphql_prettier_1.default(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Create { | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getCreateItemFieldName(table.name)} { | ||
id | ||
${withResultData ? createQueryString_1.createQueryString(tablesList, tableId, Object.assign({ withMeta: false }, restConfig)) : ''} | ||
${SchemaNameGenerator.getCreateItemFieldName(table.name)} { | ||
id${withResultData ? createQueryString(tablesList, tableId, Object.assign({ withMeta: false }, restConfig)) : ''} | ||
_description | ||
@@ -128,12 +99,11 @@ }`)} | ||
}; | ||
exports.createTableRowCreateTag = createTableRowCreateTag; | ||
const createTableRowCreateManyTag = (tablesList, tableId) => { | ||
export const createTableRowCreateManyTag = (tablesList, tableId) => { | ||
const table = getTable(tablesList, tableId); | ||
const appName = selectors_1.tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const appName = tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const hasCreatableFields = R.pipe(R.propOr([], 'fields'), R.any(R.pathEq(['dataFeatures', 'create'], true)))(table); | ||
if (hasCreatableFields) { | ||
return graphql_prettier_1.default(` | ||
mutation ${upperFirst(table.name)}CreateMany($data: [${schema_name_generator_1.SchemaNameGenerator.getCreateManyInputName(table.name, appName)}]!) { | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}CreateMany($data: [${SchemaNameGenerator.getCreateManyInputName(table.name, appName)}]!) { | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getCreateManyItemFieldName(table.name)}(data: $data) { | ||
${SchemaNameGenerator.getCreateManyItemFieldName(table.name)}(data: $data) { | ||
count | ||
@@ -146,3 +116,3 @@ }`)} | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getCreateManyItemFieldName(table.name)} { | ||
${SchemaNameGenerator.getCreateManyItemFieldName(table.name)} { | ||
count | ||
@@ -152,16 +122,14 @@ }`)} | ||
}; | ||
exports.createTableRowCreateManyTag = createTableRowCreateManyTag; | ||
const createTableRowUpdateTag = (tablesList, tableId, config = {}) => { | ||
export const createTableRowUpdateTag = (tablesList, tableId, config = {}) => { | ||
const table = getTable(tablesList, tableId); | ||
const appName = selectors_1.tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const appName = tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const { withResultData = true } = config, restConfig = __rest(config, ["withResultData"]); | ||
return graphql_prettier_1.default(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Update( | ||
$data: ${schema_name_generator_1.SchemaNameGenerator.getUpdateInputName(table.name, appName)}!, | ||
$filter: ${schema_name_generator_1.SchemaNameGenerator.getKeyFilterInputTypeName(table.name, appName)} | ||
$data: ${SchemaNameGenerator.getUpdateInputName(table.name, appName)}!, | ||
$filter: ${SchemaNameGenerator.getKeyFilterInputTypeName(table.name, appName)} | ||
) { | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getUpdateItemFieldName(table.name)}(data: $data, filter: $filter) { | ||
id | ||
${withResultData ? createQueryString_1.createQueryString(tablesList, tableId, Object.assign({ withMeta: false }, restConfig)) : ''} | ||
${SchemaNameGenerator.getUpdateItemFieldName(table.name)}(data: $data, filter: $filter) { | ||
id${withResultData ? createQueryString(tablesList, tableId, Object.assign({ withMeta: false }, restConfig)) : ''} | ||
_description | ||
@@ -171,13 +139,11 @@ }`)} | ||
}; | ||
exports.createTableRowUpdateTag = createTableRowUpdateTag; | ||
const createTableRowQueryTag = (tablesList, tableId, config = {}) => { | ||
export const createTableRowQueryTag = (tablesList, tableId, config = {}) => { | ||
const table = getTable(tablesList, tableId); | ||
const appName = selectors_1.tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const appName = tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
const { withResultData = true } = config, restConfig = __rest(config, ["withResultData"]); | ||
return graphql_prettier_1.default(` | ||
return gqlPrettify(` | ||
query ${upperFirst(table.name)}Entity($id: ID!) { | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getTableItemFieldName(table.name)}(id: $id) { | ||
id | ||
${withResultData ? createQueryString_1.createQueryString(tablesList, tableId, Object.assign({}, restConfig)) : ''} | ||
${SchemaNameGenerator.getTableItemFieldName(table.name)}(id: $id) { | ||
id${withResultData ? createQueryString(tablesList, tableId, Object.assign({}, restConfig)) : ''} | ||
_description | ||
@@ -187,10 +153,9 @@ }`)} | ||
}; | ||
exports.createTableRowQueryTag = createTableRowQueryTag; | ||
const createTableRowDeleteTag = (tablesList, tableId) => { | ||
export const createTableRowDeleteTag = (tablesList, tableId) => { | ||
const table = getTable(tablesList, tableId); | ||
const appName = selectors_1.tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
return graphql_prettier_1.default(` | ||
mutation ${upperFirst(table.name)}Delete($filter: ${schema_name_generator_1.SchemaNameGenerator.getKeyFilterInputTypeName(table.name, appName)}!, $force: Boolean) { | ||
const appName = tablesListSelectors.getTableApplicationName(tablesList, tableId); | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Delete($filter: ${SchemaNameGenerator.getKeyFilterInputTypeName(table.name, appName)}!, $force: Boolean) { | ||
${wrapInAppName(appName)(` | ||
${schema_name_generator_1.SchemaNameGenerator.getDeleteItemFieldName(table.name)}(filter: $filter, force: $force) { | ||
${SchemaNameGenerator.getDeleteItemFieldName(table.name)}(filter: $filter, force: $force) { | ||
success | ||
@@ -200,3 +165,2 @@ }`)} | ||
}; | ||
exports.createTableRowDeleteTag = createTableRowDeleteTag; | ||
//# sourceMappingURL=queryGenerators.js.map |
@@ -1,12 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getApplication = exports.hasConnectedApplications = exports.getActiveApplications = exports.getApplications = exports.getApplicationsList = void 0; | ||
const reselect_1 = require("reselect"); | ||
const constants_1 = require("../constants"); | ||
const getApplicationsList = (applicationsList) => applicationsList || []; | ||
exports.getApplicationsList = getApplicationsList; | ||
exports.getApplications = reselect_1.createSelector(exports.getApplicationsList, (applications) => applications.filter(({ name }) => name !== null)); | ||
exports.getActiveApplications = reselect_1.createSelector(exports.getApplications, (applications) => applications.filter(({ status }) => status === constants_1.APP_STATUS.ACTIVE)); | ||
exports.hasConnectedApplications = reselect_1.createSelector(exports.getActiveApplications, (applications) => applications.length > 0); | ||
exports.getApplication = reselect_1.createSelector(exports.getApplicationsList, (_, id) => id, (applications, appId) => applications.find(({ id }) => id === appId)); | ||
import { createSelector } from 'reselect'; | ||
import { APP_STATUS } from '../constants'; | ||
export const getApplicationsList = (applicationsList) => applicationsList || []; | ||
export const getApplications = createSelector(getApplicationsList, (applications) => applications.filter(({ name }) => name !== null)); | ||
export const getActiveApplications = createSelector(getApplications, (applications) => applications.filter(({ status }) => status === APP_STATUS.ACTIVE)); | ||
export const hasConnectedApplications = createSelector(getActiveApplications, (applications) => applications.length > 0); | ||
export const getApplication = createSelector(getApplicationsList, (_, id) => id, (applications, appId) => applications.find(({ id }) => id === appId)); | ||
//# sourceMappingURL=applicationsListSelectors.js.map |
@@ -1,31 +0,6 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.tablesListSelectors = exports.tableFieldSelectors = exports.applicationsListSelectors = exports.tableSelectors = void 0; | ||
const tablesListSelectors = __importStar(require("./tablesListSelectors")); | ||
exports.tablesListSelectors = tablesListSelectors; | ||
const tableSelectors = __importStar(require("./tableSelectors")); | ||
exports.tableSelectors = tableSelectors; | ||
const tableFieldSelectors = __importStar(require("./tableFieldSelectors")); | ||
exports.tableFieldSelectors = tableFieldSelectors; | ||
const applicationsListSelectors = __importStar(require("./applicationsListSelectors")); | ||
exports.applicationsListSelectors = applicationsListSelectors; | ||
import * as tablesListSelectors from './tablesListSelectors'; | ||
import * as tableSelectors from './tableSelectors'; | ||
import * as tableFieldSelectors from './tableFieldSelectors'; | ||
import * as applicationsListSelectors from './applicationsListSelectors'; | ||
export { tableSelectors, applicationsListSelectors, tableFieldSelectors, tablesListSelectors }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,61 +0,38 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFieldKind = exports.getDataFeatures = exports.getSchemaFeatures = exports.getRelationTableDisplayName = exports.getRelationTableName = exports.getRelationTableId = exports.getTableDisplayName = exports.getTableName = exports.getTableId = exports.getFieldDisplayName = exports.getFieldName = exports.getFieldId = exports.isSystemField = exports.isListField = exports.isMetaField = exports.isGeoField = exports.isIdField = exports.isSmartField = exports.isFileField = exports.isOneWayRelationField = exports.isMissingRelationField = exports.isRelationField = exports.getFieldTypesAttributes = exports.getFieldType = exports.getTableField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const reselect_1 = require("reselect"); | ||
const tablesListSelectors = __importStar(require("./tablesListSelectors")); | ||
const tableSelectors = __importStar(require("./tableSelectors")); | ||
const constants_1 = require("../constants"); | ||
const getTableField = (tableField) => tableField; | ||
exports.getTableField = getTableField; | ||
exports.getFieldType = reselect_1.createSelector(exports.getTableField, R.propOr('', 'fieldType')); | ||
exports.getFieldTypesAttributes = reselect_1.createSelector(exports.getTableField, R.propOr(null, 'fieldTypeAttributes')); | ||
exports.isRelationField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.RELATION)); | ||
exports.isMissingRelationField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.MISSING_RELATION)); | ||
exports.isOneWayRelationField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.ONE_WAY_RELATION)); | ||
exports.isFileField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.FILE)); | ||
exports.isSmartField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.SMART)); | ||
exports.isIdField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.ID)); | ||
exports.isGeoField = reselect_1.createSelector(exports.getFieldType, R.equals(constants_1.FIELD_TYPE.GEO)); | ||
exports.isMetaField = reselect_1.createSelector(exports.getTableField, R.propEq('isMeta', true)); | ||
exports.isListField = reselect_1.createSelector(exports.getTableField, R.propEq('isList', true)); | ||
exports.isSystemField = reselect_1.createSelector(exports.getTableField, R.propEq('isSystem', true)); | ||
exports.getFieldId = reselect_1.createSelector(exports.getTableField, R.propOr('', 'id')); | ||
exports.getFieldName = reselect_1.createSelector(exports.getTableField, (fieldSchema) => (fieldSchema ? fieldSchema.name : '')); | ||
exports.getFieldDisplayName = reselect_1.createSelector(exports.getTableField, R.propOr('', 'displayName')); | ||
exports.getTableId = reselect_1.createSelector(exports.getTableField, R.path(['table', 'id'])); | ||
exports.getTableName = reselect_1.createSelector(exports.getTableField, R.path(['table', 'name'])); | ||
exports.getTableDisplayName = reselect_1.createSelector(exports.getTableField, R.path(['table', 'displayName'])); | ||
exports.getRelationTableId = reselect_1.createSelector(exports.getTableField, R.path(['relation', 'refTable', 'id'])); | ||
exports.getRelationTableName = reselect_1.createSelector(exports.getTableField, R.path(['relation', 'refTable', 'name'])); | ||
exports.getRelationTableDisplayName = reselect_1.createSelector(exports.getTableField, R.path(['relation', 'refTable', 'displayName'])); | ||
exports.getSchemaFeatures = reselect_1.createSelector(exports.getTableField, R.prop('schemaFeatures')); | ||
exports.getDataFeatures = reselect_1.createSelector(exports.getTableField, R.prop('dataFeatures')); | ||
exports.getFieldKind = reselect_1.createSelector(exports.getTableId, exports.isSystemField, exports.getRelationTableId, (_, tablesSchema) => tablesSchema, (tableId, isSystem, relationTableId, tablesSchema) => { | ||
let kind = constants_1.FIELD_KINDS.USER; | ||
import * as R from 'ramda'; | ||
import { createSelector } from 'reselect'; | ||
import * as tablesListSelectors from './tablesListSelectors'; | ||
import * as tableSelectors from './tableSelectors'; | ||
import { FIELD_TYPE, FIELD_KINDS } from '../constants'; | ||
export const getTableField = (tableField) => tableField; | ||
export const getFieldType = createSelector(getTableField, R.propOr('', 'fieldType')); | ||
export const getFieldTypesAttributes = createSelector(getTableField, R.propOr(null, 'fieldTypeAttributes')); | ||
export const isRelationField = createSelector(getFieldType, R.equals(FIELD_TYPE.RELATION)); | ||
export const isMissingRelationField = createSelector(getFieldType, R.equals(FIELD_TYPE.MISSING_RELATION)); | ||
export const isOneWayRelationField = createSelector(getFieldType, R.equals(FIELD_TYPE.ONE_WAY_RELATION)); | ||
export const isFileField = createSelector(getFieldType, R.equals(FIELD_TYPE.FILE)); | ||
export const isSmartField = createSelector(getFieldType, R.equals(FIELD_TYPE.SMART)); | ||
export const isIdField = createSelector(getFieldType, R.equals(FIELD_TYPE.ID)); | ||
export const isGeoField = createSelector(getFieldType, R.equals(FIELD_TYPE.GEO)); | ||
export const isMetaField = createSelector(getTableField, R.propEq('isMeta', true)); | ||
export const isListField = createSelector(getTableField, R.propEq('isList', true)); | ||
export const isSystemField = createSelector(getTableField, R.propEq('isSystem', true)); | ||
export const getFieldId = createSelector(getTableField, R.propOr('', 'id')); | ||
export const getFieldName = createSelector(getTableField, (fieldSchema) => (fieldSchema ? fieldSchema.name : '')); | ||
export const getFieldDisplayName = createSelector(getTableField, R.propOr('', 'displayName')); | ||
export const getTableId = createSelector(getTableField, R.path(['table', 'id'])); | ||
export const getTableName = createSelector(getTableField, R.path(['table', 'name'])); | ||
export const getTableDisplayName = createSelector(getTableField, R.path(['table', 'displayName'])); | ||
export const getRelationTableId = createSelector(getTableField, R.path(['relation', 'refTable', 'id'])); | ||
export const getRelationTableName = createSelector(getTableField, R.path(['relation', 'refTable', 'name'])); | ||
export const getRelationTableDisplayName = createSelector(getTableField, R.path(['relation', 'refTable', 'displayName'])); | ||
export const getSchemaFeatures = createSelector(getTableField, R.prop('schemaFeatures')); | ||
export const getDataFeatures = createSelector(getTableField, R.prop('dataFeatures')); | ||
export const getFieldKind = createSelector(getTableId, isSystemField, getRelationTableId, (_, tablesSchema) => tablesSchema, (tableId, isSystem, relationTableId, tablesSchema) => { | ||
let kind = FIELD_KINDS.USER; | ||
const table = tablesListSelectors.getTableById(tablesSchema, tableId); | ||
if (isSystem) { | ||
kind = constants_1.FIELD_KINDS.SYSTEM; | ||
kind = FIELD_KINDS.SYSTEM; | ||
} | ||
else if (tableSelectors.isIntegrationTable(table)) { | ||
kind = constants_1.FIELD_KINDS.EXTERNAL; | ||
kind = FIELD_KINDS.EXTERNAL; | ||
} | ||
@@ -65,6 +42,6 @@ else if (relationTableId) { | ||
if (tableSelectors.isSystemTable(refTable)) { | ||
kind = constants_1.FIELD_KINDS.SYSTEM; | ||
kind = FIELD_KINDS.SYSTEM; | ||
} | ||
else if (tableSelectors.isIntegrationTable(refTable)) { | ||
kind = constants_1.FIELD_KINDS.EXTERNAL; | ||
kind = FIELD_KINDS.EXTERNAL; | ||
} | ||
@@ -71,0 +48,0 @@ } |
@@ -1,64 +0,39 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isViewTable = exports.isUserTable = exports.getDataFeatures = exports.getSchemaFeatures = exports.hasPhoneFields = exports.hasAddressFields = exports.hasSmartFields = exports.hasScalarFields = exports.hasSwitchFields = exports.hasDateFields = exports.hasFileFields = exports.hasRelationFields = exports.hasListFields = exports.hasNonMetaFields = exports.getFieldNameById = exports.isListField = exports.isMetaField = exports.isSmartField = exports.isFileField = exports.isRelationField = exports.isIntegrationTable = exports.isSystemTable = exports.getTableAppDisplayName = exports.getTableAppName = exports.getTableApplication = exports.getFieldTypeById = exports.getFieldByName = exports.getFieldById = exports.getTableOriginType = exports.getTableOrigin = exports.getTableId = exports.getTableDisplayName = exports.getTableName = exports.getTable = void 0; | ||
const R = __importStar(require("ramda")); | ||
const reselect_1 = require("reselect"); | ||
const constants_1 = require("../constants"); | ||
const getTable = (table) => table || {}; | ||
exports.getTable = getTable; | ||
exports.getTableName = reselect_1.createSelector(exports.getTable, R.prop('name')); | ||
exports.getTableDisplayName = reselect_1.createSelector(exports.getTable, R.prop('displayName')); | ||
exports.getTableId = reselect_1.createSelector(exports.getTable, R.prop('id')); | ||
exports.getTableOrigin = reselect_1.createSelector(exports.getTable, R.prop('origin')); | ||
exports.getTableOriginType = reselect_1.createSelector(exports.getTableOrigin, R.prop('type')); | ||
const getFieldById = ({ fields }, fieldId) => R.find(R.pipe(R.prop('id'), R.equals(fieldId)), fields); | ||
exports.getFieldById = getFieldById; | ||
const getFieldByName = (tableSchema, fieldName) => R.find(R.propEq('name', fieldName), tableSchema.fields); | ||
exports.getFieldByName = getFieldByName; | ||
const getFieldByIdOrEmpty = reselect_1.createSelector(exports.getFieldById, (field) => field || {}); | ||
exports.getFieldTypeById = reselect_1.createSelector(getFieldByIdOrEmpty, R.propOr('', 'fieldType')); | ||
exports.getTableApplication = reselect_1.createSelector(exports.getTable, R.propOr(null, 'application')); | ||
exports.getTableAppName = reselect_1.createSelector(exports.getTableApplication, R.propOr(null, 'name')); | ||
exports.getTableAppDisplayName = reselect_1.createSelector(exports.getTableApplication, R.propOr(null, 'displayName')); | ||
exports.isSystemTable = reselect_1.createSelector(exports.getTable, R.propEq('isSystem', true)); | ||
exports.isIntegrationTable = reselect_1.createSelector(exports.getTable, ({ application }) => !!application); | ||
exports.isRelationField = reselect_1.createSelector(exports.getFieldTypeById, R.equals(constants_1.FIELD_TYPE.RELATION)); | ||
exports.isFileField = reselect_1.createSelector(exports.getFieldTypeById, R.equals(constants_1.FIELD_TYPE.FILE)); | ||
exports.isSmartField = reselect_1.createSelector(exports.getFieldTypeById, R.equals(constants_1.FIELD_TYPE.SMART)); | ||
exports.isMetaField = reselect_1.createSelector(getFieldByIdOrEmpty, R.propEq('isMeta', true)); | ||
exports.isListField = reselect_1.createSelector(getFieldByIdOrEmpty, R.propEq('isList', true)); | ||
exports.getFieldNameById = reselect_1.createSelector(getFieldByIdOrEmpty, R.propOr('', 'name')); | ||
exports.hasNonMetaFields = R.pipe(R.propOr([], 'fields'), R.any(R.propEq('isMeta', false))); | ||
exports.hasListFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ isList }) => isList)); | ||
exports.hasRelationFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === constants_1.FIELD_TYPE.RELATION)); | ||
exports.hasFileFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === constants_1.FIELD_TYPE.FILE)); | ||
exports.hasDateFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === constants_1.FIELD_TYPE.DATE)); | ||
exports.hasSwitchFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === constants_1.FIELD_TYPE.SWITCH)); | ||
exports.hasScalarFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === constants_1.FIELD_TYPE.TEXT || fieldType === constants_1.FIELD_TYPE.NUMBER)); | ||
exports.hasSmartFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === constants_1.FIELD_TYPE.SMART)); | ||
exports.hasAddressFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldTypeAttributes = {} }) => fieldTypeAttributes && fieldTypeAttributes.format === constants_1.SMART_FORMATS.ADDRESS)); | ||
exports.hasPhoneFields = R.pipe(exports.getTable, ({ fields }) => !!fields.find(({ fieldTypeAttributes = {} }) => fieldTypeAttributes && fieldTypeAttributes.format === constants_1.SMART_FORMATS.PHONE)); | ||
exports.getSchemaFeatures = reselect_1.createSelector(exports.getTable, R.prop('schemaFeatures')); | ||
exports.getDataFeatures = reselect_1.createSelector(exports.getTable, R.prop('dataFeatures')); | ||
exports.isUserTable = reselect_1.createSelector(exports.isSystemTable, exports.getTableApplication, exports.getTableOriginType, (isSystem, application, originType) => !isSystem && !application && originType === constants_1.TABLE_ORIGIN_TYPES.LOCAL); | ||
exports.isViewTable = reselect_1.createSelector(exports.getTableOriginType, (originType) => originType === constants_1.TABLE_ORIGIN_TYPES.VIEW); | ||
import * as R from 'ramda'; | ||
import { createSelector } from 'reselect'; | ||
import { FIELD_TYPE, SMART_FORMATS, TABLE_ORIGIN_TYPES } from '../constants'; | ||
export const getTable = (table) => table || {}; | ||
export const getTableName = createSelector(getTable, R.prop('name')); | ||
export const getTableDisplayName = createSelector(getTable, R.prop('displayName')); | ||
export const getTableId = createSelector(getTable, R.prop('id')); | ||
export const getTableOrigin = createSelector(getTable, R.prop('origin')); | ||
export const getTableOriginType = createSelector(getTableOrigin, R.prop('type')); | ||
export const getFieldById = ({ fields }, fieldId) => R.find(R.pipe(R.prop('id'), R.equals(fieldId)), fields); | ||
export const getFieldByName = (tableSchema, fieldName) => R.find(R.propEq('name', fieldName), tableSchema.fields); | ||
const getFieldByIdOrEmpty = createSelector(getFieldById, (field) => field || {}); | ||
export const getFieldTypeById = createSelector(getFieldByIdOrEmpty, R.propOr('', 'fieldType')); | ||
export const getTableApplication = createSelector(getTable, R.propOr(null, 'application')); | ||
export const getTableAppName = createSelector(getTableApplication, R.propOr(null, 'name')); | ||
export const getTableAppDisplayName = createSelector(getTableApplication, R.propOr(null, 'displayName')); | ||
export const isSystemTable = createSelector(getTable, R.propEq('isSystem', true)); | ||
export const isIntegrationTable = createSelector(getTable, ({ application }) => !!application); | ||
export const isRelationField = createSelector(getFieldTypeById, R.equals(FIELD_TYPE.RELATION)); | ||
export const isFileField = createSelector(getFieldTypeById, R.equals(FIELD_TYPE.FILE)); | ||
export const isSmartField = createSelector(getFieldTypeById, R.equals(FIELD_TYPE.SMART)); | ||
export const isMetaField = createSelector(getFieldByIdOrEmpty, R.propEq('isMeta', true)); | ||
export const isListField = createSelector(getFieldByIdOrEmpty, R.propEq('isList', true)); | ||
export const getFieldNameById = createSelector(getFieldByIdOrEmpty, R.propOr('', 'name')); | ||
export const hasNonMetaFields = R.pipe(R.propOr([], 'fields'), R.any(R.propEq('isMeta', false))); | ||
export const hasListFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ isList }) => isList)); | ||
export const hasRelationFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === FIELD_TYPE.RELATION)); | ||
export const hasFileFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === FIELD_TYPE.FILE)); | ||
export const hasDateFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === FIELD_TYPE.DATE)); | ||
export const hasSwitchFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === FIELD_TYPE.SWITCH)); | ||
export const hasScalarFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === FIELD_TYPE.TEXT || fieldType === FIELD_TYPE.NUMBER)); | ||
export const hasSmartFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldType }) => fieldType === FIELD_TYPE.SMART)); | ||
export const hasAddressFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldTypeAttributes = {} }) => fieldTypeAttributes && fieldTypeAttributes.format === SMART_FORMATS.ADDRESS)); | ||
export const hasPhoneFields = R.pipe(getTable, ({ fields }) => !!fields.find(({ fieldTypeAttributes = {} }) => fieldTypeAttributes && fieldTypeAttributes.format === SMART_FORMATS.PHONE)); | ||
export const getSchemaFeatures = createSelector(getTable, R.prop('schemaFeatures')); | ||
export const getDataFeatures = createSelector(getTable, R.prop('dataFeatures')); | ||
export const isUserTable = createSelector(isSystemTable, getTableApplication, getTableOriginType, (isSystem, application, originType) => !isSystem && !application && originType === TABLE_ORIGIN_TYPES.LOCAL); | ||
export const isViewTable = createSelector(getTableOriginType, (originType) => originType === TABLE_ORIGIN_TYPES.VIEW); | ||
//# sourceMappingURL=tableSelectors.js.map |
@@ -1,44 +0,21 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hasUserTables = exports.getTablesByApplicationId = exports.getTablesByApplicationName = exports.getViewTables = exports.getApplicationTables = exports.getUserTables = exports.hasNoSystemTables = exports.getSystemTables = exports.getNoSystemTables = exports.getTableApplicationName = exports.getTableFields = exports.getTableApplication = exports.getTableByName = exports.getTableById = exports.getTableList = void 0; | ||
const reselect_1 = require("reselect"); | ||
const tableSelectors = __importStar(require("./tableSelectors")); | ||
const getTableList = (tables) => tables || []; | ||
exports.getTableList = getTableList; | ||
exports.getTableById = reselect_1.createSelector(exports.getTableList, (_, tableId) => tableId, (tables, tableId) => tables && tables.find(({ id }) => id === tableId)); | ||
exports.getTableByName = reselect_1.createSelector(exports.getTableList, (_, tableName) => tableName, (_, __, applicationName) => applicationName, (tables, tableName, appName) => tables && | ||
import { createSelector } from 'reselect'; | ||
import * as tableSelectors from './tableSelectors'; | ||
export const getTableList = (tables) => tables || []; | ||
export const getTableById = createSelector(getTableList, (_, tableId) => tableId, (tables, tableId) => tables && tables.find(({ id }) => id === tableId)); | ||
export const getTableByName = createSelector(getTableList, (_, tableName) => tableName, (_, __, applicationName) => applicationName, (tables, tableName, appName) => tables && | ||
tables | ||
.filter(({ application }) => application && appName ? application.name.toLowerCase() === appName.toLowerCase() : !appName) | ||
.find(({ name }) => name.toLowerCase() === tableName.toLowerCase())); | ||
exports.getTableApplication = reselect_1.createSelector(exports.getTableById, (table) => table && table.application); | ||
exports.getTableFields = reselect_1.createSelector(exports.getTableById, (table) => (table ? table.fields : [])); | ||
exports.getTableApplicationName = reselect_1.createSelector(exports.getTableApplication, (table) => (table ? table.name : '')); | ||
exports.getNoSystemTables = reselect_1.createSelector(exports.getTableList, (tablesList) => tablesList.filter(({ isSystem }) => !isSystem)); | ||
exports.getSystemTables = reselect_1.createSelector(exports.getTableList, (tablesList) => tablesList.filter(tableSelectors.isSystemTable)); | ||
exports.hasNoSystemTables = reselect_1.createSelector(exports.getNoSystemTables, (tables) => tables.length > 0); | ||
exports.getUserTables = reselect_1.createSelector(exports.getTableList, (tablesList) => tablesList.filter(tableSelectors.isUserTable)); | ||
exports.getApplicationTables = reselect_1.createSelector(exports.getTableList, (tablesList) => tablesList.filter(({ application }) => !!application)); | ||
exports.getViewTables = reselect_1.createSelector(exports.getTableList, (tablesList) => tablesList.filter(tableSelectors.isViewTable)); | ||
exports.getTablesByApplicationName = reselect_1.createSelector(exports.getTableList, (_, appName) => appName, (tablesList, appName) => tablesList.filter(({ application }) => application && application.name === appName)); | ||
exports.getTablesByApplicationId = reselect_1.createSelector(exports.getTableList, (_, appId) => appId, (tablesList, appId) => tablesList.filter(({ application }) => application && application.id === appId)); | ||
exports.hasUserTables = reselect_1.createSelector(exports.getUserTables, (tables) => tables.length > 0); | ||
export const getTableApplication = createSelector(getTableById, (table) => table && table.application); | ||
export const getTableFields = createSelector(getTableById, (table) => (table ? table.fields : [])); | ||
export const getTableApplicationName = createSelector(getTableApplication, (table) => (table ? table.name : '')); | ||
export const getNoSystemTables = createSelector(getTableList, (tablesList) => tablesList.filter(({ isSystem }) => !isSystem)); | ||
export const getSystemTables = createSelector(getTableList, (tablesList) => tablesList.filter(tableSelectors.isSystemTable)); | ||
export const hasNoSystemTables = createSelector(getNoSystemTables, (tables) => tables.length > 0); | ||
export const getUserTables = createSelector(getTableList, (tablesList) => tablesList.filter(tableSelectors.isUserTable)); | ||
export const getApplicationTables = createSelector(getTableList, (tablesList) => tablesList.filter(({ application }) => !!application)); | ||
export const getViewTables = createSelector(getTableList, (tablesList) => tablesList.filter(tableSelectors.isViewTable)); | ||
export const getTablesByApplicationName = createSelector(getTableList, (_, appName) => appName, (tablesList, appName) => tablesList.filter(({ application }) => application && application.name === appName)); | ||
export const getTablesByApplicationId = createSelector(getTableList, (_, appId) => appId, (tablesList, appId) => tablesList.filter(({ application }) => application && application.id === appId)); | ||
export const hasUserTables = createSelector(getUserTables, (tables) => tables.length > 0); | ||
//# sourceMappingURL=tablesListSelectors.js.map |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StorageAPI = void 0; | ||
class StorageAPI { | ||
export class StorageAPI { | ||
constructor(storage, storageKey, initialState) { | ||
@@ -25,3 +22,2 @@ this.storage = storage; | ||
} | ||
exports.StorageAPI = StorageAPI; | ||
//# sourceMappingURL=StorageAPI.js.map |
@@ -1,3 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
export {}; | ||
//# sourceMappingURL=types.js.map |
@@ -1,29 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hasIdTokenExpiredError = void 0; | ||
const error_codes_1 = __importDefault(require("@8base/error-codes")); | ||
const R = __importStar(require("ramda")); | ||
exports.hasIdTokenExpiredError = R.any(R.allPass([R.propEq('code', error_codes_1.default.TokenExpiredErrorCode), R.propEq('message', 'Token expired')])); | ||
import errorCodes from '@8base/error-codes'; | ||
import * as R from 'ramda'; | ||
export const hasIdTokenExpiredError = R.any(R.allPass([R.propEq('code', errorCodes.TokenExpiredErrorCode), R.propEq('message', 'Token expired')])); | ||
//# sourceMappingURL=hasIdTokenExpiredError.js.map |
@@ -1,32 +0,15 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isGeoField = exports.isRelationField = exports.isPhoneField = exports.isNumberField = exports.isMetaField = exports.isListField = exports.isJSONField = exports.isFilesTable = exports.isFileField = exports.isEmptyPhone = exports.isEmptyNumber = exports.isEmptyAddress = exports.isBigInt = exports.isAddressField = void 0; | ||
var isAddressField_1 = require("./isAddressField"); | ||
Object.defineProperty(exports, "isAddressField", { enumerable: true, get: function () { return isAddressField_1.isAddressField; } }); | ||
var isBigInt_1 = require("./isBigInt"); | ||
Object.defineProperty(exports, "isBigInt", { enumerable: true, get: function () { return isBigInt_1.isBigInt; } }); | ||
var isEmptyAddress_1 = require("./isEmptyAddress"); | ||
Object.defineProperty(exports, "isEmptyAddress", { enumerable: true, get: function () { return isEmptyAddress_1.isEmptyAddress; } }); | ||
var isEmptyNumber_1 = require("./isEmptyNumber"); | ||
Object.defineProperty(exports, "isEmptyNumber", { enumerable: true, get: function () { return isEmptyNumber_1.isEmptyNumber; } }); | ||
var isEmptyPhone_1 = require("./isEmptyPhone"); | ||
Object.defineProperty(exports, "isEmptyPhone", { enumerable: true, get: function () { return isEmptyPhone_1.isEmptyPhone; } }); | ||
var isFileField_1 = require("./isFileField"); | ||
Object.defineProperty(exports, "isFileField", { enumerable: true, get: function () { return isFileField_1.isFileField; } }); | ||
var isFilesTable_1 = require("./isFilesTable"); | ||
Object.defineProperty(exports, "isFilesTable", { enumerable: true, get: function () { return isFilesTable_1.isFilesTable; } }); | ||
var isJSONField_1 = require("./isJSONField"); | ||
Object.defineProperty(exports, "isJSONField", { enumerable: true, get: function () { return isJSONField_1.isJSONField; } }); | ||
var isListField_1 = require("./isListField"); | ||
Object.defineProperty(exports, "isListField", { enumerable: true, get: function () { return isListField_1.isListField; } }); | ||
var isMetaField_1 = require("./isMetaField"); | ||
Object.defineProperty(exports, "isMetaField", { enumerable: true, get: function () { return isMetaField_1.isMetaField; } }); | ||
var isNumberField_1 = require("./isNumberField"); | ||
Object.defineProperty(exports, "isNumberField", { enumerable: true, get: function () { return isNumberField_1.isNumberField; } }); | ||
var isPhoneField_1 = require("./isPhoneField"); | ||
Object.defineProperty(exports, "isPhoneField", { enumerable: true, get: function () { return isPhoneField_1.isPhoneField; } }); | ||
var isRelationField_1 = require("./isRelationField"); | ||
Object.defineProperty(exports, "isRelationField", { enumerable: true, get: function () { return isRelationField_1.isRelationField; } }); | ||
var isGeoField_1 = require("./isGeoField"); | ||
Object.defineProperty(exports, "isGeoField", { enumerable: true, get: function () { return isGeoField_1.isGeoField; } }); | ||
export { isAddressField } from './isAddressField'; | ||
export { isBigInt } from './isBigInt'; | ||
export { isEmptyAddress } from './isEmptyAddress'; | ||
export { isEmptyNumber } from './isEmptyNumber'; | ||
export { isEmptyPhone } from './isEmptyPhone'; | ||
export { isFileField } from './isFileField'; | ||
export { isFilesTable } from './isFilesTable'; | ||
export { isJSONField } from './isJSONField'; | ||
export { isListField } from './isListField'; | ||
export { isMetaField } from './isMetaField'; | ||
export { isNumberField } from './isNumberField'; | ||
export { isPhoneField } from './isPhoneField'; | ||
export { isRelationField } from './isRelationField'; | ||
export { isGeoField } from './isGeoField'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,30 +0,8 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isAddressField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE, SMART_FORMATS } from '../constants'; | ||
const isAddressField = R.allPass([ | ||
R.propEq('fieldType', constants_1.FIELD_TYPE.SMART), | ||
R.pathEq(['fieldTypeAttributes', 'format'], constants_1.SMART_FORMATS.ADDRESS), | ||
R.propEq('fieldType', FIELD_TYPE.SMART), | ||
R.pathEq(['fieldTypeAttributes', 'format'], SMART_FORMATS.ADDRESS), | ||
]); | ||
exports.isAddressField = isAddressField; | ||
export { isAddressField }; | ||
//# sourceMappingURL=isAddressField.js.map |
@@ -1,26 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isBigInt = void 0; | ||
const R = __importStar(require("ramda")); | ||
import * as R from 'ramda'; | ||
const isBigInt = R.pathEq(['fieldTypeAttributes', 'isBigInt'], true); | ||
exports.isBigInt = isBigInt; | ||
export { isBigInt }; | ||
//# sourceMappingURL=isBigInt.js.map |
@@ -1,26 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isEmptyAddress = void 0; | ||
const R = __importStar(require("ramda")); | ||
import * as R from 'ramda'; | ||
const isEmpty = R.anyPass([R.isEmpty, R.isNil]); | ||
exports.isEmptyAddress = R.anyPass([ | ||
export const isEmptyAddress = R.anyPass([ | ||
isEmpty, | ||
@@ -27,0 +5,0 @@ R.allPass([ |
@@ -1,25 +0,3 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isEmptyNumber = void 0; | ||
const R = __importStar(require("ramda")); | ||
exports.isEmptyNumber = R.anyPass([R.isEmpty, R.isNil]); | ||
import * as R from 'ramda'; | ||
export const isEmptyNumber = R.anyPass([R.isEmpty, R.isNil]); | ||
//# sourceMappingURL=isEmptyNumber.js.map |
@@ -1,26 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isEmptyPhone = void 0; | ||
const R = __importStar(require("ramda")); | ||
import * as R from 'ramda'; | ||
const isEmpty = R.anyPass([R.isEmpty, R.isNil]); | ||
exports.isEmptyPhone = R.anyPass([ | ||
export const isEmptyPhone = R.anyPass([ | ||
isEmpty, | ||
@@ -27,0 +5,0 @@ R.allPass([R.propSatisfies(isEmpty, 'code'), R.propSatisfies(isEmpty, 'number')]), |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isFileField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const isFileField = R.propEq('fieldType', constants_1.FIELD_TYPE.FILE); | ||
exports.isFileField = isFileField; | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE } from '../constants'; | ||
const isFileField = R.propEq('fieldType', FIELD_TYPE.FILE); | ||
export { isFileField }; | ||
//# sourceMappingURL=isFileField.js.map |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isFilesTable = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const isFilesTable = R.propEq('name', constants_1.SYSTEM_TABLES.FILES); | ||
exports.isFilesTable = isFilesTable; | ||
import * as R from 'ramda'; | ||
import { SYSTEM_TABLES } from '../constants'; | ||
const isFilesTable = R.propEq('name', SYSTEM_TABLES.FILES); | ||
export { isFilesTable }; | ||
//# sourceMappingURL=isFilesTable.js.map |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isGeoField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const isGeoField = R.propEq('fieldType', constants_1.FIELD_TYPE.GEO); | ||
exports.isGeoField = isGeoField; | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE } from '../constants'; | ||
const isGeoField = R.propEq('fieldType', FIELD_TYPE.GEO); | ||
export { isGeoField }; | ||
//# sourceMappingURL=isGeoField.js.map |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isJSONField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const isJSONField = R.propEq('fieldType', constants_1.FIELD_TYPE.JSON); | ||
exports.isJSONField = isJSONField; | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE } from '../constants'; | ||
const isJSONField = R.propEq('fieldType', FIELD_TYPE.JSON); | ||
export { isJSONField }; | ||
//# sourceMappingURL=isJSONField.js.map |
@@ -1,26 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isListField = void 0; | ||
const R = __importStar(require("ramda")); | ||
import * as R from 'ramda'; | ||
const isListField = R.propEq('isList', true); | ||
exports.isListField = isListField; | ||
export { isListField }; | ||
//# sourceMappingURL=isListField.js.map |
@@ -1,26 +0,4 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isMetaField = void 0; | ||
const R = __importStar(require("ramda")); | ||
import * as R from 'ramda'; | ||
const isMetaField = R.propEq('isMeta', true); | ||
exports.isMetaField = isMetaField; | ||
export { isMetaField }; | ||
//# sourceMappingURL=isMetaField.js.map |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isNumberField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const isNumberField = R.propEq('fieldType', constants_1.FIELD_TYPE.NUMBER); | ||
exports.isNumberField = isNumberField; | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE } from '../constants'; | ||
const isNumberField = R.propEq('fieldType', FIELD_TYPE.NUMBER); | ||
export { isNumberField }; | ||
//# sourceMappingURL=isNumberField.js.map |
@@ -1,30 +0,8 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isPhoneField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE, SMART_FORMATS } from '../constants'; | ||
const isPhoneField = R.allPass([ | ||
R.propEq('fieldType', constants_1.FIELD_TYPE.SMART), | ||
R.pathEq(['fieldTypeAttributes', 'format'], constants_1.SMART_FORMATS.PHONE), | ||
R.propEq('fieldType', FIELD_TYPE.SMART), | ||
R.pathEq(['fieldTypeAttributes', 'format'], SMART_FORMATS.PHONE), | ||
]); | ||
exports.isPhoneField = isPhoneField; | ||
export { isPhoneField }; | ||
//# sourceMappingURL=isPhoneField.js.map |
@@ -1,27 +0,5 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isRelationField = void 0; | ||
const R = __importStar(require("ramda")); | ||
const constants_1 = require("../constants"); | ||
const isRelationField = R.propEq('fieldType', constants_1.FIELD_TYPE.RELATION); | ||
exports.isRelationField = isRelationField; | ||
import * as R from 'ramda'; | ||
import { FIELD_TYPE } from '../constants'; | ||
const isRelationField = R.propEq('fieldType', FIELD_TYPE.RELATION); | ||
export { isRelationField }; | ||
//# sourceMappingURL=isRelationField.js.map |
{ | ||
"name": "@8base/utils", | ||
"version": "2.6.6", | ||
"version": "2.7.0-beta.0", | ||
"repository": "https://github.com/8base/sdk", | ||
@@ -17,3 +17,2 @@ "homepage": "https://github.com/8base/sdk/tree/master/packages/core/utils", | ||
"@8base/schema-name-generator": "^0.1.23", | ||
"graphql-prettier": "^1.0.6", | ||
"prettier": "^2.2.1", | ||
@@ -44,2 +43,25 @@ "ramda": "^0.27.1", | ||
], | ||
"moduleNameMapper": { | ||
"8base-sdk": "<rootDir>/../../core/8base-sdk/src/index.ts", | ||
"@8base/api-client": "<rootDir>/../../core/api-client/src/index.ts", | ||
"@8base/api-token-auth-client": "<rootDir>/../../core/api-token-auth-client/src/index.ts", | ||
"@8base/apollo-client": "<rootDir>/../../core/apollo-client/src/index.ts", | ||
"@8base/apollo-links": "<rootDir>/../../core/apollo-links/src/index.ts", | ||
"@8base/auth": "<rootDir>/../../core/auth/src/index.ts", | ||
"@8base/utils": "<rootDir>/../../core/utils/src/index.ts", | ||
"@8base/validate": "<rootDir>/../../core/validate/src/index.ts", | ||
"@8base/web-auth0-auth-client": "<rootDir>/../../core/web-auth0-auth-client/src/index.ts", | ||
"@8base/web-cognito-auth-client": "<rootDir>/../../core/web-cognito-auth-client/src/index.ts", | ||
"@8base/web-native-auth-client": "<rootDir>/../../core/web-native-auth-client/src/index.ts", | ||
"@8base/web-oauth-client": "<rootDir>/../../core/web-oauth-client/src/index.ts", | ||
"8base-react-sdk": "<rootDir>/../../react/8base-react-sdk/src/index.ts", | ||
"@8base-react/app-provider": "<rootDir>/../../react/app-provider/src/index.ts", | ||
"@8base-react/auth": "<rootDir>/../../react/auth/src/index.ts", | ||
"@8base-react/crud": "<rootDir>/../../react/crud/src/index.ts", | ||
"@8base-react/file-input": "<rootDir>/../../react/file-input/src/index.ts", | ||
"@8base-react/forms": "<rootDir>/../../react/forms/src/index.ts", | ||
"@8base-react/permissions-provider": "<rootDir>/../../react/permissions-provider/src/index.ts", | ||
"@8base-react/table-schema-provider": "<rootDir>/../../react/table-schema-provider/src/index.ts", | ||
"@8base-react/utils": "<rootDir>/../../react/utils/src/index.ts" | ||
}, | ||
"moduleFileExtensions": [ | ||
@@ -46,0 +68,0 @@ "ts", |
export { formatDataForMutation } from './formatDataForMutation'; | ||
export { formatDataAfterQuery } from './formatDataAfterQuery'; | ||
export { formatOptimisticResponse } from './formatOptimisticResponse'; | ||
export { gqlPrettify } from './gqlPrettify'; |
@@ -124,4 +124,3 @@ import * as R from 'ramda'; | ||
fieldContent = `{ | ||
id | ||
${innerFields} | ||
id${innerFields} | ||
_description | ||
@@ -166,3 +165,11 @@ }`; | ||
} else { | ||
queryObject += `\n${field.name} ${fieldContent}`; | ||
if (field.name === fieldContent) { | ||
// skip double id | ||
if (field.name !== 'id') { | ||
queryObject += `\n${field.name}`; | ||
} | ||
} else { | ||
queryObject += `\n${field.name} | ||
${fieldContent}`; | ||
} | ||
} | ||
@@ -169,0 +176,0 @@ } |
import * as R from 'ramda'; | ||
import { SchemaNameGenerator } from '@8base/schema-name-generator'; | ||
import { tablesListSelectors } from '../selectors'; | ||
import gqlPrettier from 'graphql-prettier'; | ||
import * as tableSelectors from '../selectors/tableSelectors'; | ||
import { TableSchema, QueryGeneratorConfig } from '../types'; | ||
import { gqlPrettify } from '../formatters'; | ||
import { SDKError, PACKAGES, ERROR_CODES } from '../errors'; | ||
@@ -47,3 +47,3 @@ import { createQueryString } from './createQueryString'; | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
query ${upperFirst(table.name)}TableContent( | ||
@@ -76,4 +76,3 @@ $filter: ${SchemaNameGenerator.getFilterInputTypeName(table.name, appName)} | ||
items { | ||
id | ||
${withResultData ? createQueryString(tablesList, table.id, { ...restConfig }) : ''} | ||
id${withResultData ? createQueryString(tablesList, table.id, { ...restConfig }) : ''} | ||
_description | ||
@@ -99,8 +98,7 @@ } | ||
if (hasCreatableFields) { | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Create($data: ${SchemaNameGenerator.getCreateInputName(table.name, appName)}!) { | ||
${wrapInAppName(appName)(` | ||
${SchemaNameGenerator.getCreateItemFieldName(table.name)}(data: $data) { | ||
id | ||
${withResultData ? createQueryString(tablesList, tableId, { withMeta: false, ...restConfig }) : ''} | ||
id${withResultData ? createQueryString(tablesList, tableId, { withMeta: false, ...restConfig }) : ''} | ||
_description | ||
@@ -111,8 +109,7 @@ }`)} | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Create { | ||
${wrapInAppName(appName)(` | ||
${SchemaNameGenerator.getCreateItemFieldName(table.name)} { | ||
id | ||
${withResultData ? createQueryString(tablesList, tableId, { withMeta: false, ...restConfig }) : ''} | ||
id${withResultData ? createQueryString(tablesList, tableId, { withMeta: false, ...restConfig }) : ''} | ||
_description | ||
@@ -130,3 +127,3 @@ }`)} | ||
if (hasCreatableFields) { | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}CreateMany($data: [${SchemaNameGenerator.getCreateManyInputName( | ||
@@ -161,5 +158,5 @@ table.name, | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Update( | ||
$data: ${SchemaNameGenerator.getUpdateInputName(table.name, appName)}!, | ||
$data: ${SchemaNameGenerator.getUpdateInputName(table.name, appName)}!, | ||
$filter: ${SchemaNameGenerator.getKeyFilterInputTypeName(table.name, appName)} | ||
@@ -169,4 +166,3 @@ ) { | ||
${SchemaNameGenerator.getUpdateItemFieldName(table.name)}(data: $data, filter: $filter) { | ||
id | ||
${withResultData ? createQueryString(tablesList, tableId, { withMeta: false, ...restConfig }) : ''} | ||
id${withResultData ? createQueryString(tablesList, tableId, { withMeta: false, ...restConfig }) : ''} | ||
_description | ||
@@ -186,8 +182,7 @@ }`)} | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
query ${upperFirst(table.name)}Entity($id: ID!) { | ||
${wrapInAppName(appName)(` | ||
${SchemaNameGenerator.getTableItemFieldName(table.name)}(id: $id) { | ||
id | ||
${withResultData ? createQueryString(tablesList, tableId, { ...restConfig }) : ''} | ||
id${withResultData ? createQueryString(tablesList, tableId, { ...restConfig }) : ''} | ||
_description | ||
@@ -202,3 +197,3 @@ }`)} | ||
return gqlPrettier(` | ||
return gqlPrettify(` | ||
mutation ${upperFirst(table.name)}Delete($filter: ${SchemaNameGenerator.getKeyFilterInputTypeName( | ||
@@ -205,0 +200,0 @@ table.name, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
239
294802
4515
1
- Removedgraphql-prettier@^1.0.6
- Removedgraphql@14.7.0(transitive)
- Removedgraphql-prettier@1.0.6(transitive)
- Removediterall@1.3.0(transitive)