@solidxai/core 0.1.9-beta.2 → 0.1.9-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,7 +162,7 @@ class ComputedFieldTriggerConfig {
162
162
  exports.ComputedFieldTriggerConfig = ComputedFieldTriggerConfig;
163
163
  class CreateFieldMetadataDto {
164
164
  static _OPENAPI_METADATA_FACTORY() {
165
- return { name: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, type: { required: true, enum: require("./create-field-metadata.dto").SolidFieldType }, modelId: { required: true, type: () => Number }, ormType: { required: true, type: () => Object, enum: exports.ALL_ORM_TYPES }, length: { required: true, type: () => Number }, defaultValue: { required: true, type: () => String }, regexPattern: { required: true, type: () => String }, regexPatternNotMatchingErrorMsg: { required: true, type: () => String }, required: { required: true, type: () => Boolean }, unique: { required: true, type: () => Boolean }, encrypt: { required: true, type: () => Boolean }, encryptionType: { required: true, enum: require("./create-field-metadata.dto").EncryptionType }, decryptWhen: { required: true, enum: require("./create-field-metadata.dto").DecryptWhenType }, index: { required: true, type: () => Boolean }, max: { required: true, type: () => Number }, min: { required: true, type: () => Number }, private: { required: true, type: () => Boolean }, mediaTypes: { required: true, enum: require("./create-field-metadata.dto").MediaType, isArray: true }, mediaMaxSizeKb: { required: true, type: () => Number }, mediaStorageProviderId: { required: false, type: () => Number }, mediaStorageProviderUserKey: { required: false, type: () => String }, relationType: { required: true, enum: require("./create-field-metadata.dto").RelationType }, relationCoModelSingularName: { required: true, type: () => String }, relationCreateInverse: { required: true, type: () => Boolean }, relationCascade: { required: true, enum: require("./create-field-metadata.dto").CascadeType }, relationModelModuleName: { required: true, type: () => String }, relationCoModelFieldName: { required: true, type: () => String }, isRelationManyToManyOwner: { required: true, type: () => Boolean }, relationFieldFixedFilter: { required: true, type: () => String }, selectionDynamicProvider: { required: true, type: () => String }, selectionDynamicProviderCtxt: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => [String], pattern: "/^[\\w\\s\\d\\-\\/]+:[\\w\\s\\-\\/]+$/" }, selectionValueType: { required: true, enum: require("./create-field-metadata.dto").SelectionValueType }, computedFieldValueProvider: { required: true, type: () => String }, computedFieldValueProviderCtxt: { required: true, type: () => String }, computedFieldValueType: { required: true, enum: require("./create-field-metadata.dto").ComputedFieldValueType }, computedFieldTriggerConfig: { required: true, type: () => [require("./create-field-metadata.dto").ComputedFieldTriggerConfig] }, uuid: { required: true, type: () => String }, isSystem: { required: true, type: () => Boolean }, isMarkedForRemoval: { required: true, type: () => Boolean }, columnName: { required: true, type: () => String }, relationCoModelColumnName: { required: true, type: () => String }, isUserKey: { required: true, type: () => Boolean }, relationJoinTableName: { required: true, type: () => String }, enableAuditTracking: { required: false, type: () => Boolean }, isMultiSelect: { required: true, type: () => Boolean }, isPrimaryKey: { required: false, type: () => Boolean } };
165
+ return { name: { required: true, type: () => String }, displayName: { required: true, type: () => String }, description: { required: true, type: () => String }, type: { required: true, enum: require("./create-field-metadata.dto").SolidFieldType }, modelId: { required: true, type: () => Number }, ormType: { required: true, type: () => Object, enum: exports.ALL_ORM_TYPES }, length: { required: true, type: () => Number }, defaultValue: { required: true, type: () => String }, regexPattern: { required: true, type: () => String }, regexPatternNotMatchingErrorMsg: { required: true, type: () => String }, required: { required: true, type: () => Boolean }, unique: { required: true, type: () => Boolean }, encrypt: { required: true, type: () => Boolean }, encryptionType: { required: true, enum: require("./create-field-metadata.dto").EncryptionType }, decryptWhen: { required: true, enum: require("./create-field-metadata.dto").DecryptWhenType }, index: { required: true, type: () => Boolean }, max: { required: true, type: () => Number }, min: { required: true, type: () => Number }, private: { required: true, type: () => Boolean }, mediaTypes: { required: true, enum: require("./create-field-metadata.dto").MediaType, isArray: true }, mediaMaxSizeKb: { required: true, type: () => Number }, mediaStorageProviderId: { required: false, type: () => Number }, mediaStorageProviderUserKey: { required: false, type: () => String }, relationType: { required: true, enum: require("./create-field-metadata.dto").RelationType }, relationCoModelSingularName: { required: true, type: () => String }, relationCreateInverse: { required: true, type: () => Boolean }, relationCascade: { required: true, enum: require("./create-field-metadata.dto").CascadeType }, relationModelModuleName: { required: true, type: () => String }, relationCoModelFieldName: { required: true, type: () => String }, isRelationManyToManyOwner: { required: true, type: () => Boolean }, relationFieldFixedFilter: { required: true, type: () => String }, selectionDynamicProvider: { required: true, type: () => String }, selectionDynamicProviderCtxt: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => [String] }, selectionValueType: { required: true, enum: require("./create-field-metadata.dto").SelectionValueType }, computedFieldValueProvider: { required: true, type: () => String }, computedFieldValueProviderCtxt: { required: true, type: () => String }, computedFieldValueType: { required: true, enum: require("./create-field-metadata.dto").ComputedFieldValueType }, computedFieldTriggerConfig: { required: true, type: () => [require("./create-field-metadata.dto").ComputedFieldTriggerConfig] }, uuid: { required: true, type: () => String }, isSystem: { required: true, type: () => Boolean }, isMarkedForRemoval: { required: true, type: () => Boolean }, columnName: { required: true, type: () => String }, relationCoModelColumnName: { required: true, type: () => String }, isUserKey: { required: true, type: () => Boolean }, relationJoinTableName: { required: true, type: () => String }, enableAuditTracking: { required: false, type: () => Boolean }, isMultiSelect: { required: true, type: () => Boolean }, isPrimaryKey: { required: false, type: () => Boolean } };
166
166
  }
167
167
  }
168
168
  exports.CreateFieldMetadataDto = CreateFieldMetadataDto;
@@ -359,7 +359,6 @@ __decorate([
359
359
  (0, swagger_1.ApiProperty)({ description: 'Static values for selection. Only for type=selectionStatic', }),
360
360
  (0, class_validator_1.IsArray)(),
361
361
  (0, class_validator_1.IsString)({ each: true }),
362
- (0, class_validator_1.Matches)(/^[\w\s\d\-\/]+:[\w\s\-\/]+$/, { each: true }),
363
362
  (0, class_validator_1.IsOptional)(),
364
363
  __metadata("design:type", Array)
365
364
  ], CreateFieldMetadataDto.prototype, "selectionStaticValues", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"create-field-metadata.dto.js","sourceRoot":"","sources":["../../src/dtos/create-field-metadata.dto.ts"],"names":[],"mappings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,EAAC,EAAE,WAAW,EAAE,4HAA4H,GAAG,CAAC;IAC3J,IAAA,2BAAS,GAAE;;wDACM;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4DAA4D,GAAG,CAAC;IAC3F,IAAA,2BAAS,GAAE;;kEACgB;AAK5B;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACK;AAKlB;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uCAAuC,GAAG,CAAC;IACtE,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yEACoB;AAKxB;IAHR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IAC3C,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;yDACe;AAK3B;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mCAAmC,GAAG,CAAC;IAClE,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qEACgB;AAK7B;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sCAAsC,GAAG,CAAC;IACrE,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mEACkB;AAK9B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;6DACW;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;4DACW","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { Transform, Type } from 'class-transformer';\n\nimport {\n IsArray,\n IsBoolean,\n IsEnum,\n IsIn,\n IsInt,\n IsOptional,\n IsString,\n Matches,\n ValidateIf\n} from 'class-validator';\nexport enum RelationFieldsCommand {\n set = \"set\",\n clear = \"clear\",\n link = \"link\",\n unlink = \"unlink\",\n create = \"create\",\n update = \"update\",\n delete = \"delete\"\n}\n\nexport enum SolidFieldType {\n // numeric types\n int = 'int',\n bigint = 'bigint',\n // float = 'float',\n // double = 'double',\n decimal = 'decimal',\n\n // text types\n shortText = 'shortText',\n longtext = 'longText',\n richText = 'richText',\n json = 'json',\n\n // boolean types\n boolean = 'boolean',\n\n // date\n date = 'date',\n datetime = 'datetime',\n time = 'time',\n\n // relation\n relation = 'relation',\n\n // media\n mediaSingle = 'mediaSingle',\n mediaMultiple = 'mediaMultiple',\n\n email = 'email',\n password = 'password',\n\n // selection\n selectionStatic = 'selectionStatic',\n selectionDynamic = 'selectionDynamic',\n\n computed = 'computed',\n\n uuid = 'uuid'\n}\n\nexport enum MySQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n int = 'int',\n decimal = 'decimal',\n double = 'double',\n\n // Text types\n // fieldType=shortText\n varchar = 'varchar',\n // fieldType=longText\n text = 'shortText',\n mediumtext = 'mediumtext',\n longtext = 'longtext',\n\n // Boolean types\n // fieldType=boolean\n bool = 'bool',\n boolean = 'boolean',\n\n //Date Types\n date = 'date',\n datetime = 'datetime',\n timestamp = 'timestamp',\n time = 'time',\n\n // Other types\n json = 'json',\n\n}\n\nexport enum PSQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n integer = 'integer',\n decimal = 'decimal',\n bigint = 'bigint',\n\n // Text types\n varchar = 'varchar',\n text = 'text',\n\n // Boolean types\n boolean = 'boolean',\n\n // Date types\n timestamp = 'timestamp',\n timestamptz = 'timestamptz',\n time = 'time',\n date = 'date',\n\n // Other types\n json = 'json',\n jsonb = 'jsonb',\n simplejson = 'simple-json'\n}\n\nexport enum MSSQLType {\n int = \"int\",\n bigint = \"bigint\",\n decimal = \"decimal\",\n numeric = \"numeric\",\n varchar = \"varchar\",\n nvarchar = \"nvarchar\",\n simplejson = \"simple-json\",\n text = \"text\",\n bit = \"bit\",\n date = \"date\",\n datetime = \"datetime\",\n datetime2 = \"datetime2\",\n time = \"time\",\n uniqueidentifier = \"uniqueidentifier\"\n}\n\nexport const ALL_ORM_TYPES = [\n ...Object.values(PSQLType),\n ...Object.values(MSSQLType),\n ...Object.values(MySQLType),\n] as const;\n\nexport type OrmType = typeof ALL_ORM_TYPES[number];\n\n// export type OrmType = PSQLType | MySQLType | MSSQLType;\n\nexport enum EncryptionType {\n aes128 = 'aes-128',\n aes256 = 'aes-256',\n}\n\nexport enum DecryptWhenType {\n beforeTransit = 'before-transit',\n afterTransit = 'after-transit',\n}\n\nexport enum MediaType {\n image = 'image',\n audio = 'audio',\n video = 'video',\n // document = 'document',\n file = 'file',\n}\n\nexport enum RelationType {\n manyToOne = 'many-to-one',\n manyTomany = 'many-to-many',\n oneToMany = 'one-to-many',\n}\n\nexport enum CascadeType {\n setNull = 'set null',\n restrict = 'restrict',\n cascade = 'cascade',\n}\n\n// export enum MediaStorageProviderType {\n// database = 'database',\n// file = 'file',\n// s3 = 's3',\n// }\n\nexport enum SelectionValueType {\n string = 'string',\n int = 'int',\n}\n\nexport enum ComputedFieldValueType {\n string = 'string',\n int = 'int',\n decimal = 'decimal',\n boolean = 'boolean',\n date = 'date',\n datetime = 'datetime',\n}\n\nexport enum ComputedFieldTriggerOperation {\n beforeInsert = \"before-insert\",\n afterInsert = \"after-insert\",\n beforeUpdate = \"before-update\",\n afterUpdate = \"after-update\",\n beforeRemove = \"before-delete\",\n afterRemove = \"after-delete\",\n}\n\nexport class ComputedFieldTriggerConfig {\n moduleName: string; // Name of the module where the computed field is defined\n modelName: string;\n operations: ComputedFieldTriggerOperation[]; // List of operations where this computed field should be triggered\n}\n\nexport class CreateFieldMetadataDto {\n @ApiProperty({ description: 'Name of your field, this is also the name of the column or attribute', })\n // @Matches(/[a-z]+(_[a-z]+)*/, { message: 'Field name should follow snake case conventions only with all lower case.', })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Display name of your field' })\n @IsString()\n readonly displayName: string;\n\n\n @ApiProperty({ description: 'Description of your field' })\n @IsOptional()\n @IsString()\n readonly description: string;\n\n // @ApiProperty({ description: \"Help text associated with this field\" })\n // @IsString()\n // readonly helpText: string;\n\n @ApiProperty({ description: 'Field can have types' })\n @IsEnum(SolidFieldType)\n readonly type: SolidFieldType;\n\n @ApiProperty({ description: 'Related model id' })\n @IsInt()\n @IsOptional()\n readonly modelId: number;\n\n //For all types of fields\n @ApiProperty({ description: 'Field can have orm types specific to your database', })\n @IsIn(ALL_ORM_TYPES)\n @IsOptional()\n readonly ormType: OrmType;\n\n @ApiProperty({ description: 'Length of the field. Only for type=text' })\n @IsInt()\n @IsOptional()\n readonly length: number;\n\n @ApiProperty({ description: 'Default value of the field' })\n @IsString()\n @IsOptional()\n readonly defaultValue: string;\n\n @ApiProperty({ description: 'Format regex pattern for the field. Only for type=text, longText, email, password', })\n @IsString()\n @IsOptional()\n readonly regexPattern: string;\n\n @ApiProperty({ description: 'If the regex pattern matching fails, then what is the error message to be displayed', })\n @IsString()\n @IsOptional()\n readonly regexPatternNotMatchingErrorMsg: string;\n\n @ApiProperty({ description: 'Is the field mandatory?' })\n @IsBoolean()\n readonly required: boolean;\n\n @ApiProperty({ description: 'Is the field value unique?' })\n @IsBoolean()\n @IsOptional()\n readonly unique: boolean;\n\n @ApiProperty({ description: 'Is the field symmetric encrypted?' })\n @IsBoolean()\n readonly encrypt: boolean;\n\n @ApiProperty({ description: 'Type of encryption. Only if encrypt=true' })\n @IsEnum(EncryptionType)\n @IsOptional()\n readonly encryptionType: EncryptionType;\n\n //Pending\n @ApiProperty({ description: 'At what point do we want to decrypt the data? Only if encrypt=true', })\n @IsEnum(DecryptWhenType)\n @IsOptional()\n decryptWhen: DecryptWhenType;\n\n @ApiProperty({ description: 'Is the field indexed? For all types, except:richText, longText', })\n @IsBoolean()\n index: boolean;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n max: number;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n min: number;\n\n @ApiProperty({ description: 'Is the field private?' })\n @IsBoolean()\n private: boolean;\n\n @ApiProperty({ description: 'Allowed media types for the field. Only for type=mediaSingle,mediaMultiple', })\n @IsEnum(MediaType, { each: true })\n @IsOptional()\n mediaTypes: MediaType[];\n\n @ApiProperty({ description: 'Maximum size of the media in KB. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaMaxSizeKb: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderId?: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple. When you need to specify the storage provider by name.', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderUserKey?: string;\n\n // @ApiProperty({ description: 'Is the media embedded in the entity table? Only for type=mediaSingle', })\n // @IsBoolean()\n // @IsOptional()\n // mediaEmbedded: boolean;\n\n @ApiProperty({ description: 'Relation Type. Only for type=relation' })\n @IsEnum(RelationType)\n @IsOptional()\n relationType: RelationType;\n\n @ApiProperty({ description: 'Related model for the relation. Only for type=relation' })\n @IsString()\n @IsOptional()\n relationCoModelSingularName: string;\n\n @ApiProperty({ description: 'Create inverse relation. Only for type=relation', })\n @IsBoolean()\n @IsOptional()\n relationCreateInverse: boolean;\n\n @ApiProperty({ description: 'Cascade type. Only for type=relation' })\n @IsEnum(CascadeType)\n @IsOptional()\n relationCascade: CascadeType;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation, if the related field belongs to a different module' })\n @IsOptional()\n relationModelModuleName: string;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation and relationType=many-to-many, i.e if the related many to many field belongs to a different model' })\n @IsOptional()\n relationCoModelFieldName: string;\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to set the owner of the many-to-many relation' })\n @IsOptional()\n isRelationManyToManyOwner: boolean;\n\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to store fixed filters that needs to applied on related model' })\n @IsOptional()\n relationFieldFixedFilter: string;\n\n @ApiProperty({\n description:\n 'Dynamic provider for selection. Only for type=selectionDynamic',\n })\n @IsString()\n @IsOptional()\n selectionDynamicProvider: string;\n\n @ApiProperty({ description: 'Dynamic provider Context. Only for type=selectionDynamic', })\n @IsString()\n @IsOptional()\n selectionDynamicProviderCtxt: string;\n\n @ApiProperty({ description: 'Static values for selection. Only for type=selectionStatic', })\n @IsArray()\n @IsString({ each: true })\n @Matches(/^[\\w\\s\\d\\-\\/]+:[\\w\\s\\-\\/]+$/, { each: true })\n @IsOptional()\n selectionStaticValues: string[];\n\n @ApiProperty({ description: 'Type of value for selection. Applicable for type=selectionStatic,selectionDynamic', })\n @IsEnum(SelectionValueType)\n @IsOptional()\n selectionValueType: SelectionValueType;\n\n @ApiProperty({ description: 'Computed Field Value Provider. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProvider: string;\n\n @ApiProperty({ description: 'Computed Field Value Provider Context. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProviderCtxt: string;\n\n @ApiProperty({ description: 'Computed field value type. Only for type=computed', })\n @IsEnum(ComputedFieldValueType)\n @IsOptional()\n computedFieldValueType: ComputedFieldValueType;\n\n @IsArray()\n @Type(() => ComputedFieldTriggerConfig)\n @IsOptional()\n computedFieldTriggerConfig: ComputedFieldTriggerConfig[];\n\n @IsOptional()\n @ApiProperty({ description: 'Uuid.', })\n @IsString()\n @IsOptional()\n uuid: string;\n\n @IsOptional()\n @ApiProperty({ description: 'System fields are not included in the code generation, the assumption being that system fields have manually written code.', })\n @IsBoolean()\n isSystem: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Marked for removal, this is used to soft delete the field.', })\n @IsBoolean()\n isMarkedForRemoval: boolean;\n\n @ApiProperty({ description: 'Column Name of Field', })\n @IsString()\n @IsOptional()\n columnName: string\n\n @ApiProperty({ description: 'Relation CoModel Column Name of Field', })\n @IsString()\n @IsOptional()\n relationCoModelColumnName: string\n\n @ApiProperty({ description: \"Is User Key\" })\n @IsOptional()\n @IsBoolean()\n readonly isUserKey: boolean\n\n @ApiProperty({ description: 'Relation Join Table Name of Field', })\n @IsString()\n @IsOptional()\n relationJoinTableName: string\n\n @ApiProperty({ description: 'Enable Audit Tracking for this field', })\n @IsOptional()\n @IsBoolean()\n enableAuditTracking?: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is MultiSelect Field', })\n @IsBoolean()\n isMultiSelect: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is Primary Key Field', })\n @IsBoolean()\n isPrimaryKey?: boolean;\n}"]}
1
+ {"version":3,"file":"create-field-metadata.dto.js","sourceRoot":"","sources":["../../src/dtos/create-field-metadata.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yDAAoD;AAEpD,qDAUyB;AACzB,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;AACnB,CAAC,EARW,qBAAqB,qCAArB,qBAAqB,QAQhC;AAED,IAAY,cAuCX;AAvCD,WAAY,cAAc;IAExB,6BAAW,CAAA;IACX,mCAAiB,CAAA;IAGjB,qCAAmB,CAAA;IAGnB,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IAGb,qCAAmB,CAAA;IAGnB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB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HC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mCAAmC,GAAG,CAAC;IAClE,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qEACgB;AAK7B;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sCAAsC,GAAG,CAAC;IACrE,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mEACkB;AAK9B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;6DACW;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,GAAG,CAAC;IACrD,IAAA,2BAAS,GAAE;;4DACW","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { Transform, Type } from 'class-transformer';\n\nimport {\n IsArray,\n IsBoolean,\n IsEnum,\n IsIn,\n IsInt,\n IsOptional,\n IsString,\n Matches,\n ValidateIf\n} from 'class-validator';\nexport enum RelationFieldsCommand {\n set = \"set\",\n clear = \"clear\",\n link = \"link\",\n unlink = \"unlink\",\n create = \"create\",\n update = \"update\",\n delete = \"delete\"\n}\n\nexport enum SolidFieldType {\n // numeric types\n int = 'int',\n bigint = 'bigint',\n // float = 'float',\n // double = 'double',\n decimal = 'decimal',\n\n // text types\n shortText = 'shortText',\n longtext = 'longText',\n richText = 'richText',\n json = 'json',\n\n // boolean types\n boolean = 'boolean',\n\n // date\n date = 'date',\n datetime = 'datetime',\n time = 'time',\n\n // relation\n relation = 'relation',\n\n // media\n mediaSingle = 'mediaSingle',\n mediaMultiple = 'mediaMultiple',\n\n email = 'email',\n password = 'password',\n\n // selection\n selectionStatic = 'selectionStatic',\n selectionDynamic = 'selectionDynamic',\n\n computed = 'computed',\n\n uuid = 'uuid'\n}\n\nexport enum MySQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n int = 'int',\n decimal = 'decimal',\n double = 'double',\n\n // Text types\n // fieldType=shortText\n varchar = 'varchar',\n // fieldType=longText\n text = 'shortText',\n mediumtext = 'mediumtext',\n longtext = 'longtext',\n\n // Boolean types\n // fieldType=boolean\n bool = 'bool',\n boolean = 'boolean',\n\n //Date Types\n date = 'date',\n datetime = 'datetime',\n timestamp = 'timestamp',\n time = 'time',\n\n // Other types\n json = 'json',\n\n}\n\nexport enum PSQLType { //FIXME Currently this type is being used in the definition, Need to use OrmType instead\n // Numeric types\n integer = 'integer',\n decimal = 'decimal',\n bigint = 'bigint',\n\n // Text types\n varchar = 'varchar',\n text = 'text',\n\n // Boolean types\n boolean = 'boolean',\n\n // Date types\n timestamp = 'timestamp',\n timestamptz = 'timestamptz',\n time = 'time',\n date = 'date',\n\n // Other types\n json = 'json',\n jsonb = 'jsonb',\n simplejson = 'simple-json'\n}\n\nexport enum MSSQLType {\n int = \"int\",\n bigint = \"bigint\",\n decimal = \"decimal\",\n numeric = \"numeric\",\n varchar = \"varchar\",\n nvarchar = \"nvarchar\",\n simplejson = \"simple-json\",\n text = \"text\",\n bit = \"bit\",\n date = \"date\",\n datetime = \"datetime\",\n datetime2 = \"datetime2\",\n time = \"time\",\n uniqueidentifier = \"uniqueidentifier\"\n}\n\nexport const ALL_ORM_TYPES = [\n ...Object.values(PSQLType),\n ...Object.values(MSSQLType),\n ...Object.values(MySQLType),\n] as const;\n\nexport type OrmType = typeof ALL_ORM_TYPES[number];\n\n// export type OrmType = PSQLType | MySQLType | MSSQLType;\n\nexport enum EncryptionType {\n aes128 = 'aes-128',\n aes256 = 'aes-256',\n}\n\nexport enum DecryptWhenType {\n beforeTransit = 'before-transit',\n afterTransit = 'after-transit',\n}\n\nexport enum MediaType {\n image = 'image',\n audio = 'audio',\n video = 'video',\n // document = 'document',\n file = 'file',\n}\n\nexport enum RelationType {\n manyToOne = 'many-to-one',\n manyTomany = 'many-to-many',\n oneToMany = 'one-to-many',\n}\n\nexport enum CascadeType {\n setNull = 'set null',\n restrict = 'restrict',\n cascade = 'cascade',\n}\n\n// export enum MediaStorageProviderType {\n// database = 'database',\n// file = 'file',\n// s3 = 's3',\n// }\n\nexport enum SelectionValueType {\n string = 'string',\n int = 'int',\n}\n\nexport enum ComputedFieldValueType {\n string = 'string',\n int = 'int',\n decimal = 'decimal',\n boolean = 'boolean',\n date = 'date',\n datetime = 'datetime',\n}\n\nexport enum ComputedFieldTriggerOperation {\n beforeInsert = \"before-insert\",\n afterInsert = \"after-insert\",\n beforeUpdate = \"before-update\",\n afterUpdate = \"after-update\",\n beforeRemove = \"before-delete\",\n afterRemove = \"after-delete\",\n}\n\nexport class ComputedFieldTriggerConfig {\n moduleName: string; // Name of the module where the computed field is defined\n modelName: string;\n operations: ComputedFieldTriggerOperation[]; // List of operations where this computed field should be triggered\n}\n\nexport class CreateFieldMetadataDto {\n @ApiProperty({ description: 'Name of your field, this is also the name of the column or attribute', })\n // @Matches(/[a-z]+(_[a-z]+)*/, { message: 'Field name should follow snake case conventions only with all lower case.', })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Display name of your field' })\n @IsString()\n readonly displayName: string;\n\n\n @ApiProperty({ description: 'Description of your field' })\n @IsOptional()\n @IsString()\n readonly description: string;\n\n // @ApiProperty({ description: \"Help text associated with this field\" })\n // @IsString()\n // readonly helpText: string;\n\n @ApiProperty({ description: 'Field can have types' })\n @IsEnum(SolidFieldType)\n readonly type: SolidFieldType;\n\n @ApiProperty({ description: 'Related model id' })\n @IsInt()\n @IsOptional()\n readonly modelId: number;\n\n //For all types of fields\n @ApiProperty({ description: 'Field can have orm types specific to your database', })\n @IsIn(ALL_ORM_TYPES)\n @IsOptional()\n readonly ormType: OrmType;\n\n @ApiProperty({ description: 'Length of the field. Only for type=text' })\n @IsInt()\n @IsOptional()\n readonly length: number;\n\n @ApiProperty({ description: 'Default value of the field' })\n @IsString()\n @IsOptional()\n readonly defaultValue: string;\n\n @ApiProperty({ description: 'Format regex pattern for the field. Only for type=text, longText, email, password', })\n @IsString()\n @IsOptional()\n readonly regexPattern: string;\n\n @ApiProperty({ description: 'If the regex pattern matching fails, then what is the error message to be displayed', })\n @IsString()\n @IsOptional()\n readonly regexPatternNotMatchingErrorMsg: string;\n\n @ApiProperty({ description: 'Is the field mandatory?' })\n @IsBoolean()\n readonly required: boolean;\n\n @ApiProperty({ description: 'Is the field value unique?' })\n @IsBoolean()\n @IsOptional()\n readonly unique: boolean;\n\n @ApiProperty({ description: 'Is the field symmetric encrypted?' })\n @IsBoolean()\n readonly encrypt: boolean;\n\n @ApiProperty({ description: 'Type of encryption. Only if encrypt=true' })\n @IsEnum(EncryptionType)\n @IsOptional()\n readonly encryptionType: EncryptionType;\n\n //Pending\n @ApiProperty({ description: 'At what point do we want to decrypt the data? Only if encrypt=true', })\n @IsEnum(DecryptWhenType)\n @IsOptional()\n decryptWhen: DecryptWhenType;\n\n @ApiProperty({ description: 'Is the field indexed? For all types, except:richText, longText', })\n @IsBoolean()\n index: boolean;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n max: number;\n\n @ApiProperty({ description: 'for text fields, this is length. for numeric fields, this is the range of values allowed. Only for type=shortText,longText,richText,json,int,decimal,date,dateTime,time', })\n @IsInt()\n @IsOptional()\n min: number;\n\n @ApiProperty({ description: 'Is the field private?' })\n @IsBoolean()\n private: boolean;\n\n @ApiProperty({ description: 'Allowed media types for the field. Only for type=mediaSingle,mediaMultiple', })\n @IsEnum(MediaType, { each: true })\n @IsOptional()\n mediaTypes: MediaType[];\n\n @ApiProperty({ description: 'Maximum size of the media in KB. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaMaxSizeKb: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderId?: number;\n\n @ApiProperty({ description: 'Configured Media storage provider. Only for type=mediaSingle,mediaMultiple. When you need to specify the storage provider by name.', })\n @IsInt()\n @IsOptional()\n mediaStorageProviderUserKey?: string;\n\n // @ApiProperty({ description: 'Is the media embedded in the entity table? Only for type=mediaSingle', })\n // @IsBoolean()\n // @IsOptional()\n // mediaEmbedded: boolean;\n\n @ApiProperty({ description: 'Relation Type. Only for type=relation' })\n @IsEnum(RelationType)\n @IsOptional()\n relationType: RelationType;\n\n @ApiProperty({ description: 'Related model for the relation. Only for type=relation' })\n @IsString()\n @IsOptional()\n relationCoModelSingularName: string;\n\n @ApiProperty({ description: 'Create inverse relation. Only for type=relation', })\n @IsBoolean()\n @IsOptional()\n relationCreateInverse: boolean;\n\n @ApiProperty({ description: 'Cascade type. Only for type=relation' })\n @IsEnum(CascadeType)\n @IsOptional()\n relationCascade: CascadeType;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation, if the related field belongs to a different module' })\n @IsOptional()\n relationModelModuleName: string;\n\n @ApiProperty({ description: 'Related field module. Only required for type=relation and relationType=many-to-many, i.e if the related many to many field belongs to a different model' })\n @IsOptional()\n relationCoModelFieldName: string;\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to set the owner of the many-to-many relation' })\n @IsOptional()\n isRelationManyToManyOwner: boolean;\n\n\n @ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to store fixed filters that needs to applied on related model' })\n @IsOptional()\n relationFieldFixedFilter: string;\n\n @ApiProperty({\n description:\n 'Dynamic provider for selection. Only for type=selectionDynamic',\n })\n @IsString()\n @IsOptional()\n selectionDynamicProvider: string;\n\n @ApiProperty({ description: 'Dynamic provider Context. Only for type=selectionDynamic', })\n @IsString()\n @IsOptional()\n selectionDynamicProviderCtxt: string;\n\n @ApiProperty({ description: 'Static values for selection. Only for type=selectionStatic', })\n @IsArray()\n @IsString({ each: true })\n // @Matches(/^[\\w\\s\\d\\-\\/]+:[\\w\\s\\-\\/]+$/, { each: true })\n @IsOptional()\n selectionStaticValues: string[];\n\n @ApiProperty({ description: 'Type of value for selection. Applicable for type=selectionStatic,selectionDynamic', })\n @IsEnum(SelectionValueType)\n @IsOptional()\n selectionValueType: SelectionValueType;\n\n @ApiProperty({ description: 'Computed Field Value Provider. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProvider: string;\n\n @ApiProperty({ description: 'Computed Field Value Provider Context. Only for type=computed', })\n @IsString()\n @IsOptional()\n computedFieldValueProviderCtxt: string;\n\n @ApiProperty({ description: 'Computed field value type. Only for type=computed', })\n @IsEnum(ComputedFieldValueType)\n @IsOptional()\n computedFieldValueType: ComputedFieldValueType;\n\n @IsArray()\n @Type(() => ComputedFieldTriggerConfig)\n @IsOptional()\n computedFieldTriggerConfig: ComputedFieldTriggerConfig[];\n\n @IsOptional()\n @ApiProperty({ description: 'Uuid.', })\n @IsString()\n @IsOptional()\n uuid: string;\n\n @IsOptional()\n @ApiProperty({ description: 'System fields are not included in the code generation, the assumption being that system fields have manually written code.', })\n @IsBoolean()\n isSystem: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Marked for removal, this is used to soft delete the field.', })\n @IsBoolean()\n isMarkedForRemoval: boolean;\n\n @ApiProperty({ description: 'Column Name of Field', })\n @IsString()\n @IsOptional()\n columnName: string\n\n @ApiProperty({ description: 'Relation CoModel Column Name of Field', })\n @IsString()\n @IsOptional()\n relationCoModelColumnName: string\n\n @ApiProperty({ description: \"Is User Key\" })\n @IsOptional()\n @IsBoolean()\n readonly isUserKey: boolean\n\n @ApiProperty({ description: 'Relation Join Table Name of Field', })\n @IsString()\n @IsOptional()\n relationJoinTableName: string\n\n @ApiProperty({ description: 'Enable Audit Tracking for this field', })\n @IsOptional()\n @IsBoolean()\n enableAuditTracking?: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is MultiSelect Field', })\n @IsBoolean()\n isMultiSelect: boolean;\n\n @IsOptional()\n @ApiProperty({ description: 'Is Primary Key Field', })\n @IsBoolean()\n isPrimaryKey?: boolean;\n}"]}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_1 = require("@playwright/test");
4
+ const env_1 = require("../helpers/env");
5
+ const baseURL = process.env.API_BASE_URL ?? "http://localhost:3000";
6
+ const TEST_USER_EMAIL = (0, env_1.getRequiredEnv)("TEST_USER_EMAIL");
7
+ const TEST_USER_PASSWORD = (0, env_1.getRequiredEnv)("TEST_USER_PASSWORD");
8
+ function base64UrlDecode(input) {
9
+ const normalized = input.replace(/-/g, "+").replace(/_/g, "/");
10
+ const padded = normalized.length % 4 === 0
11
+ ? normalized
12
+ : normalized.padEnd(normalized.length + (4 - (normalized.length % 4)), "=");
13
+ return Buffer.from(padded, "base64").toString("utf-8");
14
+ }
15
+ function validateJwt(token) {
16
+ const parts = token.split(".");
17
+ if (parts.length !== 3) {
18
+ throw new Error("JWT must have three dot-separated parts.");
19
+ }
20
+ const headerJson = JSON.parse(base64UrlDecode(parts[0]));
21
+ const payloadJson = JSON.parse(base64UrlDecode(parts[1]));
22
+ if (!headerJson || typeof headerJson !== "object") {
23
+ throw new Error("JWT header must be a JSON object.");
24
+ }
25
+ if (!payloadJson || typeof payloadJson !== "object") {
26
+ throw new Error("JWT payload must be a JSON object.");
27
+ }
28
+ if (typeof payloadJson.exp !== "number") {
29
+ throw new Error("JWT payload.exp must be a number.");
30
+ }
31
+ return payloadJson;
32
+ }
33
+ (0, test_1.test)("API: authenticate succeeds with valid credentials", async () => {
34
+ const api = await test_1.request.newContext({
35
+ baseURL,
36
+ extraHTTPHeaders: {
37
+ accept: "*/*",
38
+ "content-type": "application/json",
39
+ },
40
+ });
41
+ try {
42
+ const res = await api.post("/api/iam/authenticate", {
43
+ data: {
44
+ email: TEST_USER_EMAIL,
45
+ username: "",
46
+ password: TEST_USER_PASSWORD,
47
+ },
48
+ });
49
+ (0, test_1.expect)(res.status()).toBe(200);
50
+ const json = await res.json();
51
+ (0, test_1.expect)(json.statusCode).toBe(200);
52
+ (0, test_1.expect)(Array.isArray(json.message)).toBe(true);
53
+ (0, test_1.expect)(json.message.length).toBe(0);
54
+ (0, test_1.expect)(json.error).toBe("");
55
+ const user = json.data?.user;
56
+ (0, test_1.expect)(user, "Expected data.user to be an object.").toBeTruthy();
57
+ (0, test_1.expect)(typeof user).toBe("object");
58
+ const email = user?.email;
59
+ (0, test_1.expect)(typeof email).toBe("string");
60
+ if (email === TEST_USER_EMAIL) {
61
+ (0, test_1.expect)(email).toBe(TEST_USER_EMAIL);
62
+ }
63
+ else {
64
+ (0, test_1.expect)(email.length).toBeGreaterThan(0);
65
+ }
66
+ (0, test_1.expect)(typeof user?.mobile).toBe("string");
67
+ (0, test_1.expect)(typeof user?.username).toBe("string");
68
+ (0, test_1.expect)(typeof user?.forcePasswordChange).toBe("boolean");
69
+ (0, test_1.expect)(typeof user?.id).toBe("number");
70
+ const roles = user?.roles;
71
+ (0, test_1.expect)(Array.isArray(roles)).toBe(true);
72
+ if (Array.isArray(roles)) {
73
+ (0, test_1.expect)(roles.every((role) => typeof role === "string")).toBe(true);
74
+ (0, test_1.expect)(roles).toContain("Admin");
75
+ }
76
+ const accessToken = json.data?.accessToken;
77
+ const refreshToken = json.data?.refreshToken;
78
+ (0, test_1.expect)(typeof accessToken).toBe("string");
79
+ (0, test_1.expect)(typeof refreshToken).toBe("string");
80
+ const accessPayload = validateJwt(accessToken);
81
+ const refreshPayload = validateJwt(refreshToken);
82
+ (0, test_1.expect)(typeof accessPayload.exp).toBe("number");
83
+ (0, test_1.expect)(typeof refreshPayload.exp).toBe("number");
84
+ }
85
+ finally {
86
+ await api.dispose();
87
+ }
88
+ });
89
+ (0, test_1.test)("API: authenticate fails with wrong password", async () => {
90
+ const api = await test_1.request.newContext({
91
+ baseURL,
92
+ extraHTTPHeaders: {
93
+ accept: "*/*",
94
+ "content-type": "application/json",
95
+ },
96
+ });
97
+ try {
98
+ const res = await api.post("/api/iam/authenticate", {
99
+ data: {
100
+ email: TEST_USER_EMAIL,
101
+ username: "",
102
+ password: `${TEST_USER_PASSWORD}__wrong`,
103
+ },
104
+ });
105
+ (0, test_1.expect)(res.status()).toBe(401);
106
+ const json = await res.json();
107
+ (0, test_1.expect)(json.statusCode).toBe(401);
108
+ (0, test_1.expect)(json.statusCodeMessage).toBe("Unauthorized");
109
+ (0, test_1.expect)(json.message).toBe("Invalid credentials");
110
+ (0, test_1.expect)(json.error).toBe("Invalid credentials");
111
+ (0, test_1.expect)(json.data?.statusCode).toBe(401);
112
+ (0, test_1.expect)(json.data?.error).toBe("Unauthorized");
113
+ (0, test_1.expect)(json.data?.message).toBe("Invalid credentials");
114
+ }
115
+ finally {
116
+ await api.dispose();
117
+ }
118
+ });
119
+ //# sourceMappingURL=authenticate.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticate.spec.js","sourceRoot":"","sources":["../../tests/api/authenticate.spec.ts"],"names":[],"mappings":";;AAAA,2CAAyD;AACzD,wCAAgD;AAOhD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,uBAAuB,CAAC;AACpE,MAAM,eAAe,GAAG,IAAA,oBAAc,EAAC,iBAAiB,CAAC,CAAC;AAC1D,MAAM,kBAAkB,GAAG,IAAA,oBAAc,EAAC,oBAAoB,CAAC,CAAC;AAEhE,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,MAAM,GACV,UAAU,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC;QACzB,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,UAAU,CAAC,MAAM,CACjB,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EACjD,GAAG,CACJ,CAAC;IACN,OAAO,MAAM,CAAC,IAAI,CAAC,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U,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxC,IAAA,aAAM,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9C,IAAA,aAAM,EAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACzD,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { expect, request, test } from \"@playwright/test\";\nimport { getRequiredEnv } from \"../helpers/env\";\n\ntype JwtPayload = {\n exp?: number;\n [key: string]: unknown;\n};\n\nconst baseURL = process.env.API_BASE_URL ?? \"http://localhost:3000\";\nconst TEST_USER_EMAIL = getRequiredEnv(\"TEST_USER_EMAIL\");\nconst TEST_USER_PASSWORD = getRequiredEnv(\"TEST_USER_PASSWORD\");\n\nfunction base64UrlDecode(input: string): string {\n const normalized = input.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded =\n normalized.length % 4 === 0\n ? normalized\n : normalized.padEnd(\n normalized.length + (4 - (normalized.length % 4)),\n \"=\"\n );\n return Buffer.from(padded, \"base64\").toString(\"utf-8\");\n}\n\nfunction validateJwt(token: string): JwtPayload {\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"JWT must have three dot-separated parts.\");\n }\n\n const headerJson = JSON.parse(base64UrlDecode(parts[0]));\n const payloadJson = JSON.parse(base64UrlDecode(parts[1]));\n\n if (!headerJson || typeof headerJson !== \"object\") {\n throw new Error(\"JWT header must be a JSON object.\");\n }\n\n if (!payloadJson || typeof payloadJson !== \"object\") {\n throw new Error(\"JWT payload must be a JSON object.\");\n }\n\n if (typeof payloadJson.exp !== \"number\") {\n throw new Error(\"JWT payload.exp must be a number.\");\n }\n\n return payloadJson as JwtPayload;\n}\n\ntest(\"API: authenticate succeeds with valid credentials\", async () => {\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: {\n accept: \"*/*\",\n \"content-type\": \"application/json\",\n },\n });\n\n try {\n const res = await api.post(\"/api/iam/authenticate\", {\n data: {\n email: TEST_USER_EMAIL,\n username: \"\",\n password: TEST_USER_PASSWORD,\n },\n });\n\n expect(res.status()).toBe(200);\n const json = await res.json();\n\n expect(json.statusCode).toBe(200);\n expect(Array.isArray(json.message)).toBe(true);\n expect(json.message.length).toBe(0);\n expect(json.error).toBe(\"\");\n\n const user = json.data?.user as Record<string, unknown> | undefined;\n expect(user, \"Expected data.user to be an object.\").toBeTruthy();\n expect(typeof user).toBe(\"object\");\n\n const email = user?.email;\n expect(typeof email).toBe(\"string\");\n if (email === TEST_USER_EMAIL) {\n expect(email).toBe(TEST_USER_EMAIL);\n } else {\n // If your API returns a fixed system email, replace this with an exact match.\n expect((email as string).length).toBeGreaterThan(0);\n }\n\n expect(typeof user?.mobile).toBe(\"string\");\n expect(typeof user?.username).toBe(\"string\");\n expect(typeof user?.forcePasswordChange).toBe(\"boolean\");\n expect(typeof user?.id).toBe(\"number\");\n\n const roles = user?.roles;\n expect(Array.isArray(roles)).toBe(true);\n if (Array.isArray(roles)) {\n expect(roles.every((role) => typeof role === \"string\")).toBe(true);\n expect(roles).toContain(\"Admin\");\n }\n\n const accessToken = json.data?.accessToken;\n const refreshToken = json.data?.refreshToken;\n expect(typeof accessToken).toBe(\"string\");\n expect(typeof refreshToken).toBe(\"string\");\n\n const accessPayload = validateJwt(accessToken as string);\n const refreshPayload = validateJwt(refreshToken as string);\n\n expect(typeof accessPayload.exp).toBe(\"number\");\n expect(typeof refreshPayload.exp).toBe(\"number\");\n } finally {\n await api.dispose();\n }\n});\n\ntest(\"API: authenticate fails with wrong password\", async () => {\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: {\n accept: \"*/*\",\n \"content-type\": \"application/json\",\n },\n });\n\n try {\n const res = await api.post(\"/api/iam/authenticate\", {\n data: {\n email: TEST_USER_EMAIL,\n username: \"\",\n password: `${TEST_USER_PASSWORD}__wrong`,\n },\n });\n\n expect(res.status()).toBe(401);\n const json = await res.json();\n\n expect(json.statusCode).toBe(401);\n expect(json.statusCodeMessage).toBe(\"Unauthorized\");\n expect(json.message).toBe(\"Invalid credentials\");\n expect(json.error).toBe(\"Invalid credentials\");\n expect(json.data?.statusCode).toBe(401);\n expect(json.data?.error).toBe(\"Unauthorized\");\n expect(json.data?.message).toBe(\"Invalid credentials\");\n } finally {\n await api.dispose();\n }\n});\n"]}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_1 = require("@playwright/test");
4
+ const auth_1 = require("../helpers/auth");
5
+ const baseURL = process.env.API_BASE_URL ?? "http://localhost:3000";
6
+ async function getCityByName(name) {
7
+ const api = await test_1.request.newContext({
8
+ baseURL,
9
+ extraHTTPHeaders: await (0, auth_1.getAuthHeaders)(baseURL),
10
+ });
11
+ try {
12
+ const res = await api.get(`/api/city-master?filters[name][$eq]=${encodeURIComponent(name)}&limit=1&offset=0`);
13
+ (0, test_1.expect)(res.status()).toBe(200);
14
+ const json = await res.json();
15
+ const record = json?.data?.records?.[0];
16
+ (0, test_1.expect)(record, `Expected city '${name}' in testData`).toBeTruthy();
17
+ (0, test_1.expect)(record.id, "Expected record to have id").toBeTruthy();
18
+ return record;
19
+ }
20
+ finally {
21
+ await api.dispose();
22
+ }
23
+ }
24
+ test_1.test.describe("CRUDService.findOne (cityMaster)", () => {
25
+ (0, test_1.test)("returns a city by id", async () => {
26
+ const city = await getCityByName("Mumbai");
27
+ const api = await test_1.request.newContext({
28
+ baseURL,
29
+ extraHTTPHeaders: await (0, auth_1.getAuthHeaders)(baseURL),
30
+ });
31
+ try {
32
+ const res = await api.get(`/api/city-master/${city.id}`);
33
+ (0, test_1.expect)(res.status()).toBe(200);
34
+ const json = await res.json();
35
+ (0, test_1.expect)(json?.data?.id).toBe(city.id);
36
+ (0, test_1.expect)(json?.data?.name).toBe("Mumbai");
37
+ (0, test_1.expect)(json?.data?.description).toBe("Mumbai city");
38
+ }
39
+ finally {
40
+ await api.dispose();
41
+ }
42
+ });
43
+ (0, test_1.test)("supports fields[] selection", async () => {
44
+ const city = await getCityByName("Pune");
45
+ const api = await test_1.request.newContext({
46
+ baseURL,
47
+ extraHTTPHeaders: await (0, auth_1.getAuthHeaders)(baseURL),
48
+ });
49
+ try {
50
+ const res = await api.get(`/api/city-master/${city.id}?fields[]=id&fields[]=name`);
51
+ (0, test_1.expect)(res.status()).toBe(200);
52
+ const json = await res.json();
53
+ (0, test_1.expect)(json?.data?.id).toBe(city.id);
54
+ (0, test_1.expect)(json?.data?.name).toBe("Pune");
55
+ (0, test_1.expect)(json?.data?.description).toBeUndefined();
56
+ (0, test_1.expect)(json?.data?.state).toBeUndefined();
57
+ }
58
+ finally {
59
+ await api.dispose();
60
+ }
61
+ });
62
+ (0, test_1.test)("supports populate=state", async () => {
63
+ const city = await getCityByName("Bengaluru");
64
+ const api = await test_1.request.newContext({
65
+ baseURL,
66
+ extraHTTPHeaders: await (0, auth_1.getAuthHeaders)(baseURL),
67
+ });
68
+ try {
69
+ const res = await api.get(`/api/city-master/${city.id}?populate=state`);
70
+ (0, test_1.expect)(res.status()).toBe(200);
71
+ const json = await res.json();
72
+ (0, test_1.expect)(json?.data?.name).toBe("Bengaluru");
73
+ (0, test_1.expect)(json?.data?.state).toBeTruthy();
74
+ (0, test_1.expect)(json?.data?.state?.name).toBe("Karnataka");
75
+ }
76
+ finally {
77
+ await api.dispose();
78
+ }
79
+ });
80
+ (0, test_1.test)("returns 404 for missing id", async () => {
81
+ const api = await test_1.request.newContext({
82
+ baseURL,
83
+ extraHTTPHeaders: await (0, auth_1.getAuthHeaders)(baseURL),
84
+ });
85
+ try {
86
+ const res = await api.get(`/api/city-master/99999999`);
87
+ (0, test_1.expect)(res.status()).toBe(404);
88
+ const json = await res.json();
89
+ (0, test_1.expect)(String(json?.message)).toContain("cityMaster");
90
+ (0, test_1.expect)(String(json?.message)).toContain("not found");
91
+ }
92
+ finally {
93
+ await api.dispose();
94
+ }
95
+ });
96
+ });
97
+ //# sourceMappingURL=crud-service.findOne.cityMaster.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crud-service.findOne.cityMaster.spec.js","sourceRoot":"","sources":["../../tests/api/crud-service.findOne.cityMaster.spec.ts"],"names":[],"mappings":";;AAAA,2CAAyD;AACzD,0CAAiD;AAEjD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,uBAAuB,CAAC;AAEpE,KAAK,UAAU,aAAa,CAAC,IAAY;IACvC,MAAM,GAAG,GAAG,MAAM,cAAO,CAAC,UAAU,CAAC;QACnC,OAAO;QACP,gBAAgB,EAAE,MAAM,IAAA,qBAAc,EAAC,OAAO,CAAC;KAChD,CAAC,CAAC;IACH,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,CACvB,uCAAuC,kBAAkB,CAAC,IAAI,CAAC,mBAAmB,CACnF,CAAC;QACF,IAAA,aAAM,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAE9B,MAAM,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,IAAA,aAAM,EAAC,MAAM,EAAE,kBAAkB,IAAI,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;QACnE,IAAA,aAAM,EAAC,MAAM,CAAC,EAAE,EAAE,4BAA4B,CAAC,CAAC,UAAU,EAAE,CAAC;QAE7D,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;AACH,CAAC;AAED,WAAI,CAAC,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;I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URL = process.env.API_BASE_URL ?? \"http://localhost:3000\";\n\nasync function getCityByName(name: string) {\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: await getAuthHeaders(baseURL),\n });\n try {\n const res = await api.get(\n `/api/city-master?filters[name][$eq]=${encodeURIComponent(name)}&limit=1&offset=0`\n );\n expect(res.status()).toBe(200);\n const json = await res.json();\n\n const record = json?.data?.records?.[0];\n expect(record, `Expected city '${name}' in testData`).toBeTruthy();\n expect(record.id, \"Expected record to have id\").toBeTruthy();\n\n return record;\n } finally {\n await api.dispose();\n }\n}\n\ntest.describe(\"CRUDService.findOne (cityMaster)\", () => {\n test(\"returns a city by id\", async () => {\n const city = await getCityByName(\"Mumbai\");\n\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: await getAuthHeaders(baseURL),\n });\n try {\n const res = await api.get(`/api/city-master/${city.id}`);\n expect(res.status()).toBe(200);\n\n const json = await res.json();\n expect(json?.data?.id).toBe(city.id);\n expect(json?.data?.name).toBe(\"Mumbai\");\n expect(json?.data?.description).toBe(\"Mumbai city\");\n } finally {\n await api.dispose();\n }\n });\n\n test(\"supports fields[] selection\", async () => {\n const city = await getCityByName(\"Pune\");\n\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: await getAuthHeaders(baseURL),\n });\n try {\n const res = await api.get(\n `/api/city-master/${city.id}?fields[]=id&fields[]=name`\n );\n expect(res.status()).toBe(200);\n\n const json = await res.json();\n expect(json?.data?.id).toBe(city.id);\n expect(json?.data?.name).toBe(\"Pune\");\n expect(json?.data?.description).toBeUndefined();\n expect(json?.data?.state).toBeUndefined();\n } finally {\n await api.dispose();\n }\n });\n\n test(\"supports populate=state\", async () => {\n const city = await getCityByName(\"Bengaluru\");\n\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: await getAuthHeaders(baseURL),\n });\n try {\n const res = await api.get(`/api/city-master/${city.id}?populate=state`);\n expect(res.status()).toBe(200);\n\n const json = await res.json();\n expect(json?.data?.name).toBe(\"Bengaluru\");\n expect(json?.data?.state).toBeTruthy();\n expect(json?.data?.state?.name).toBe(\"Karnataka\");\n } finally {\n await api.dispose();\n }\n });\n\n test(\"returns 404 for missing id\", async () => {\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: await getAuthHeaders(baseURL),\n });\n try {\n const res = await api.get(`/api/city-master/99999999`);\n expect(res.status()).toBe(404);\n\n const json = await res.json();\n expect(String(json?.message)).toContain(\"cityMaster\");\n expect(String(json?.message)).toContain(\"not found\");\n } finally {\n await api.dispose();\n }\n });\n});\n"]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_1 = require("@playwright/test");
4
+ (0, test_1.test)("GET /api/ping returns pong", async () => {
5
+ const baseURL = process.env.BASE_URL || "http://localhost:3000";
6
+ if (!baseURL) {
7
+ throw new Error("baseURL is not configured. Set API_BASE_URL or use the default.");
8
+ }
9
+ const api = await test_1.request.newContext({ baseURL });
10
+ const res = await api.get("/api/ping");
11
+ (0, test_1.expect)(res.status()).toBe(200);
12
+ const body = await res.json();
13
+ (0, test_1.expect)(body).toEqual({
14
+ statusCode: 200,
15
+ message: [],
16
+ error: "",
17
+ data: { pong: "v1.0.2" },
18
+ });
19
+ await api.dispose();
20
+ });
21
+ //# sourceMappingURL=ping.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ping.spec.js","sourceRoot":"","sources":["../../tests/api/ping.spec.ts"],"names":[],"mappings":";;AAAA,2CAAyD;AAEzD,IAAA,WAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,uBAAuB,CAAC;IAChE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACrF,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,cAAO,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAElD,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEvC,IAAA,aAAM,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE/B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACzB,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC","sourcesContent":["import { expect, request, test } from \"@playwright/test\";\n\ntest(\"GET /api/ping returns pong\", async () => {\n const baseURL = process.env.BASE_URL || \"http://localhost:3000\";\n if (!baseURL) {\n throw new Error(\"baseURL is not configured. Set API_BASE_URL or use the default.\");\n }\n const api = await request.newContext({ baseURL });\n\n const res = await api.get(\"/api/ping\");\n\n expect(res.status()).toBe(200);\n\n const body = await res.json();\n expect(body).toEqual({\n statusCode: 200,\n message: [],\n error: \"\",\n data: { pong: \"v1.0.2\" },\n });\n\n await api.dispose();\n});\n"]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAccessToken = getAccessToken;
4
+ exports.getAuthHeaders = getAuthHeaders;
5
+ const test_1 = require("@playwright/test");
6
+ const env_1 = require("./env");
7
+ async function getAccessToken(baseURL) {
8
+ const TEST_USER_EMAIL = (0, env_1.getRequiredEnv)("TEST_USER_EMAIL");
9
+ const TEST_USER_PASSWORD = (0, env_1.getRequiredEnv)("TEST_USER_PASSWORD");
10
+ const api = await test_1.request.newContext({
11
+ baseURL,
12
+ extraHTTPHeaders: {
13
+ accept: "*/*",
14
+ "content-type": "application/json",
15
+ },
16
+ });
17
+ try {
18
+ const res = await api.post("/api/iam/authenticate", {
19
+ data: {
20
+ email: TEST_USER_EMAIL,
21
+ username: "",
22
+ password: TEST_USER_PASSWORD,
23
+ },
24
+ });
25
+ (0, test_1.expect)(res.status()).toBe(200);
26
+ const json = await res.json();
27
+ const token = json?.data?.accessToken;
28
+ (0, test_1.expect)(token, "Expected access token from authenticate endpoint.").toBeTruthy();
29
+ return token;
30
+ }
31
+ finally {
32
+ await api.dispose();
33
+ }
34
+ }
35
+ async function getAuthHeaders(baseURL) {
36
+ const token = await getAccessToken(baseURL);
37
+ return {
38
+ authorization: `Bearer ${token}`,
39
+ };
40
+ }
41
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../tests/helpers/auth.ts"],"names":[],"mappings":";;AAGA,wCA6BC;AAED,wCAKC;AAvCD,2CAAmD;AACnD,+BAAuC;AAEhC,KAAK,UAAU,cAAc,CAAC,OAAe;IAClD,MAAM,eAAe,GAAG,IAAA,oBAAc,EAAC,iBAAiB,CAAC,CAAC;IAC1D,MAAM,kBAAkB,GAAG,IAAA,oBAAc,EAAC,oBAAoB,CAAC,CAAC;IAEhE,MAAM,GAAG,GAAG,MAAM,cAAO,CAAC,UAAU,CAAC;QACnC,OAAO;QACP,gBAAgB,EAAE;YAChB,MAAM,EAAE,KAAK;YACb,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAClD,IAAI,EAAE;gBACJ,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,kBAAkB;aAC7B;SACF,CAAC,CAAC;QAEH,IAAA,aAAM,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,IAAI,EAAE,IAAI,EAAE,WAAiC,CAAC;QAC5D,IAAA,aAAM,EAAC,KAAK,EAAE,mDAAmD,CAAC,CAAC,UAAU,EAAE,CAAC;QAChF,OAAO,KAAe,CAAC;IACzB,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,OAAe;IAClD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO;QACL,aAAa,EAAE,UAAU,KAAK,EAAE;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import { expect, request } from \"@playwright/test\";\nimport { getRequiredEnv } from \"./env\";\n\nexport async function getAccessToken(baseURL: string) {\n const TEST_USER_EMAIL = getRequiredEnv(\"TEST_USER_EMAIL\");\n const TEST_USER_PASSWORD = getRequiredEnv(\"TEST_USER_PASSWORD\");\n\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: {\n accept: \"*/*\",\n \"content-type\": \"application/json\",\n },\n });\n\n try {\n const res = await api.post(\"/api/iam/authenticate\", {\n data: {\n email: TEST_USER_EMAIL,\n username: \"\",\n password: TEST_USER_PASSWORD,\n },\n });\n\n expect(res.status()).toBe(200);\n const json = await res.json();\n const token = json?.data?.accessToken as string | undefined;\n expect(token, \"Expected access token from authenticate endpoint.\").toBeTruthy();\n return token as string;\n } finally {\n await api.dispose();\n }\n}\n\nexport async function getAuthHeaders(baseURL: string) {\n const token = await getAccessToken(baseURL);\n return {\n authorization: `Bearer ${token}`,\n };\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRequiredEnv = getRequiredEnv;
4
+ function getRequiredEnv(name) {
5
+ const value = process.env[name];
6
+ if (!value) {
7
+ throw new Error(`Missing required env var: ${name}`);
8
+ }
9
+ return value;
10
+ }
11
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../tests/helpers/env.ts"],"names":[],"mappings":";;AAAA,wCAMC;AAND,SAAgB,cAAc,CAAC,IAAY;IACzC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["export function getRequiredEnv(name: string): string {\n const value = process.env[name];\n if (!value) {\n throw new Error(`Missing required env var: ${name}`);\n }\n return value;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidxai/core",
3
- "version": "0.1.9-beta.2",
3
+ "version": "0.1.9-beta.4",
4
4
  "description": "This module is a NestJS module containing all the required core providers required by a Solid application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -385,7 +385,7 @@ export class CreateFieldMetadataDto {
385
385
  @ApiProperty({ description: 'Static values for selection. Only for type=selectionStatic', })
386
386
  @IsArray()
387
387
  @IsString({ each: true })
388
- @Matches(/^[\w\s\d\-\/]+:[\w\s\-\/]+$/, { each: true })
388
+ // @Matches(/^[\w\s\d\-\/]+:[\w\s\-\/]+$/, { each: true })
389
389
  @IsOptional()
390
390
  selectionStaticValues: string[];
391
391
 
@@ -1,15 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(node -e:*)",
5
- "WebFetch(domain:docs.solidxai.com)",
6
- "WebFetch(domain:github.com)",
7
- "Read(//Users/oswald/projects/Solid_Starters/solidctl/**)",
8
- "Read(//Users/oswald/projects/Solid_Starters/**)",
9
- "Bash(find /Users/oswald/projects/Solid_Starters/solid-core-module -type d -name migration* -o -name *database*)"
10
- ],
11
- "additionalDirectories": [
12
- "/Users/oswald/projects/Solid_Starters/solidctl"
13
- ]
14
- }
15
- }
package/src/services/1.js DELETED
@@ -1,6 +0,0 @@
1
- 1. Do i need to create a storeStreams method for aws service too?
2
- - Handle later
3
- 2. queues handling -> if queues is enabled by default, i.e triggerExport(exportTransactionEntity.id).
4
- - startExport should either return the data or return the transaction id
5
- 3. How to handle scenarios wherein, nested related exist.(do i need to only get the userkey)
6
- - show the userKey