How to use nullable method in wpt

Best JavaScript code snippet using wpt

graphql.ts

Source:graphql.ts Github

copy

Full Screen

1/*2 * -------------------------------------------------------3 * THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)4 * -------------------------------------------------------5 */6/* tslint:disable */7/* eslint-disable */8export enum CommonLangDir {9 LTR = "LTR",10 RTL = "RTL"11}12export interface CommonCreateAdministrativeAreaLevel1Input {13 id: string;14 countryId: string;15 code: GraphQLString;16 customCode?: Nullable<GraphQLString>;17 name: GraphQLString;18 slug: GraphQLString;19 latitude?: Nullable<GraphQLFloat>;20 longitude?: Nullable<GraphQLFloat>;21 zoom?: Nullable<GraphQLInt>;22}23export interface CommonUpdateAdministrativeAreaLevel1ByIdInput {24 id: string;25 countryId?: Nullable<string>;26 code?: Nullable<GraphQLString>;27 customCode?: Nullable<GraphQLString>;28 name?: Nullable<GraphQLString>;29 slug?: Nullable<GraphQLString>;30 latitude?: Nullable<GraphQLFloat>;31 longitude?: Nullable<GraphQLFloat>;32 zoom?: Nullable<GraphQLInt>;33}34export interface CommonUpdateAdministrativeAreasLevel1Input {35 id?: Nullable<string>;36 countryId?: Nullable<string>;37 code?: Nullable<GraphQLString>;38 customCode?: Nullable<GraphQLString>;39 name?: Nullable<GraphQLString>;40 slug?: Nullable<GraphQLString>;41 latitude?: Nullable<GraphQLFloat>;42 longitude?: Nullable<GraphQLFloat>;43 zoom?: Nullable<GraphQLInt>;44}45export interface CommonCreateAdministrativeAreaLevel2Input {46 id: string;47 countryId: string;48 administrativeAreaLevel1Id: string;49 code: GraphQLString;50 customCode?: Nullable<GraphQLString>;51 name: GraphQLString;52 slug: GraphQLString;53 latitude?: Nullable<GraphQLFloat>;54 longitude?: Nullable<GraphQLFloat>;55 zoom?: Nullable<GraphQLInt>;56}57export interface CommonUpdateAdministrativeAreaLevel2ByIdInput {58 id: string;59 countryId?: Nullable<string>;60 administrativeAreaLevel1Id?: Nullable<string>;61 code?: Nullable<GraphQLString>;62 customCode?: Nullable<GraphQLString>;63 name?: Nullable<GraphQLString>;64 slug?: Nullable<GraphQLString>;65 latitude?: Nullable<GraphQLFloat>;66 longitude?: Nullable<GraphQLFloat>;67 zoom?: Nullable<GraphQLInt>;68}69export interface CommonUpdateAdministrativeAreasLevel2Input {70 id?: Nullable<string>;71 countryId?: Nullable<string>;72 administrativeAreaLevel1Id?: Nullable<string>;73 code?: Nullable<GraphQLString>;74 customCode?: Nullable<GraphQLString>;75 name?: Nullable<GraphQLString>;76 slug?: Nullable<GraphQLString>;77 latitude?: Nullable<GraphQLFloat>;78 longitude?: Nullable<GraphQLFloat>;79 zoom?: Nullable<GraphQLInt>;80}81export interface CommonCreateAdministrativeAreaLevel3Input {82 id: string;83 countryId: string;84 administrativeAreaLevel1Id: string;85 administrativeAreaLevel2Id: string;86 code: GraphQLString;87 customCode?: Nullable<GraphQLString>;88 name: GraphQLString;89 slug: GraphQLString;90 latitude?: Nullable<GraphQLFloat>;91 longitude?: Nullable<GraphQLFloat>;92 zoom?: Nullable<GraphQLInt>;93}94export interface CommonUpdateAdministrativeAreaLevel3ByIdInput {95 id: string;96 countryId?: Nullable<string>;97 administrativeAreaLevel1Id?: Nullable<string>;98 administrativeAreaLevel2Id?: Nullable<string>;99 code?: Nullable<GraphQLString>;100 customCode?: Nullable<GraphQLString>;101 name?: Nullable<GraphQLString>;102 slug?: Nullable<GraphQLString>;103 latitude?: Nullable<GraphQLFloat>;104 longitude?: Nullable<GraphQLFloat>;105 zoom?: Nullable<GraphQLInt>;106}107export interface CommonUpdateAdministrativeAreasLevel3Input {108 id?: Nullable<string>;109 countryId?: Nullable<string>;110 administrativeAreaLevel1Id?: Nullable<string>;111 administrativeAreaLevel2Id?: Nullable<string>;112 code?: Nullable<GraphQLString>;113 customCode?: Nullable<GraphQLString>;114 name?: Nullable<GraphQLString>;115 slug?: Nullable<GraphQLString>;116 latitude?: Nullable<GraphQLFloat>;117 longitude?: Nullable<GraphQLFloat>;118 zoom?: Nullable<GraphQLInt>;119}120export interface CommonCreateCountryInput {121 id: string;122 iso3166Alpha2: GraphQLString;123 iso3166Alpha3: GraphQLString;124 iso3166Numeric: GraphQLString;125 customCode?: Nullable<GraphQLString>;126 prefix?: Nullable<GraphQLString>;127 image?: Nullable<GraphQLString>;128 sort?: Nullable<GraphQLInt>;129 administrativeAreas?: Nullable<JSON>;130 latitude?: Nullable<GraphQLFloat>;131 longitude?: Nullable<GraphQLFloat>;132 zoom?: Nullable<GraphQLInt>;133 dataLang?: Nullable<JSON>;134 langId: string;135 name: GraphQLString;136 slug: GraphQLString;137 administrativeAreaLevel1?: Nullable<GraphQLString>;138 administrativeAreaLevel2?: Nullable<GraphQLString>;139 administrativeAreaLevel3?: Nullable<GraphQLString>;140}141export interface CommonUpdateCountryByIdInput {142 id: string;143 iso3166Alpha2?: Nullable<GraphQLString>;144 iso3166Alpha3?: Nullable<GraphQLString>;145 iso3166Numeric?: Nullable<GraphQLString>;146 customCode?: Nullable<GraphQLString>;147 prefix?: Nullable<GraphQLString>;148 image?: Nullable<GraphQLString>;149 sort?: Nullable<GraphQLInt>;150 administrativeAreas?: Nullable<JSON>;151 latitude?: Nullable<GraphQLFloat>;152 longitude?: Nullable<GraphQLFloat>;153 zoom?: Nullable<GraphQLInt>;154 dataLang?: Nullable<JSON>;155 langId?: Nullable<string>;156 name?: Nullable<GraphQLString>;157 slug?: Nullable<GraphQLString>;158 administrativeAreaLevel1?: Nullable<GraphQLString>;159 administrativeAreaLevel2?: Nullable<GraphQLString>;160 administrativeAreaLevel3?: Nullable<GraphQLString>;161}162export interface CommonUpdateCountriesInput {163 id?: Nullable<string>;164 iso3166Alpha2?: Nullable<GraphQLString>;165 iso3166Alpha3?: Nullable<GraphQLString>;166 iso3166Numeric?: Nullable<GraphQLString>;167 customCode?: Nullable<GraphQLString>;168 prefix?: Nullable<GraphQLString>;169 image?: Nullable<GraphQLString>;170 sort?: Nullable<GraphQLInt>;171 administrativeAreas?: Nullable<JSON>;172 latitude?: Nullable<GraphQLFloat>;173 longitude?: Nullable<GraphQLFloat>;174 zoom?: Nullable<GraphQLInt>;175 dataLang?: Nullable<JSON>;176 langId?: Nullable<string>;177 name?: Nullable<GraphQLString>;178 slug?: Nullable<GraphQLString>;179 administrativeAreaLevel1?: Nullable<GraphQLString>;180 administrativeAreaLevel2?: Nullable<GraphQLString>;181 administrativeAreaLevel3?: Nullable<GraphQLString>;182}183export interface CommonCreateLangInput {184 id: string;185 name: GraphQLString;186 image?: Nullable<GraphQLString>;187 iso6392: GraphQLString;188 iso6393: GraphQLString;189 ietf: GraphQLString;190 customCode?: Nullable<GraphQLString>;191 dir: CommonLangDir;192 sort?: Nullable<GraphQLInt>;193 isActive: GraphQLBoolean;194}195export interface CommonUpdateLangByIdInput {196 id: string;197 name?: Nullable<GraphQLString>;198 image?: Nullable<GraphQLString>;199 iso6392?: Nullable<GraphQLString>;200 iso6393?: Nullable<GraphQLString>;201 ietf?: Nullable<GraphQLString>;202 customCode?: Nullable<GraphQLString>;203 dir?: Nullable<CommonLangDir>;204 sort?: Nullable<GraphQLInt>;205 isActive?: Nullable<GraphQLBoolean>;206}207export interface CommonUpdateLangsInput {208 id?: Nullable<string>;209 name?: Nullable<GraphQLString>;210 image?: Nullable<GraphQLString>;211 iso6392?: Nullable<GraphQLString>;212 iso6393?: Nullable<GraphQLString>;213 ietf?: Nullable<GraphQLString>;214 customCode?: Nullable<GraphQLString>;215 dir?: Nullable<CommonLangDir>;216 sort?: Nullable<GraphQLInt>;217 isActive?: Nullable<GraphQLBoolean>;218}219export interface QueryStatement {220 where?: Nullable<JSON>;221 include?: Nullable<Nullable<GraphQLString>[]>;222 order?: Nullable<JSON>;223 limit?: Nullable<GraphQLInt>;224 offset?: Nullable<GraphQLInt>;225}226export interface CommonAdministrativeAreaLevel1 {227 id: string;228 countryId: string;229 country?: Nullable<CommonCountry>;230 code: GraphQLString;231 customCode?: Nullable<GraphQLString>;232 name: GraphQLString;233 slug: GraphQLString;234 latitude?: Nullable<GraphQLFloat>;235 longitude?: Nullable<GraphQLFloat>;236 zoom?: Nullable<GraphQLInt>;237 createdAt?: Nullable<GraphQLTimestamp>;238 updatedAt?: Nullable<GraphQLTimestamp>;239 deletedAt?: Nullable<GraphQLTimestamp>;240}241export interface IQuery {242 commonFindAdministrativeAreaLevel1(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1> | Promise<Nullable<CommonAdministrativeAreaLevel1>>;243 commonFindAdministrativeAreaLevel1ById(id?: Nullable<string>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1> | Promise<Nullable<CommonAdministrativeAreaLevel1>>;244 commonGetAdministrativeAreasLevel1(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1>[] | Promise<Nullable<CommonAdministrativeAreaLevel1>[]>;245 commonPaginateAdministrativeAreasLevel1(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Pagination | Promise<Pagination>;246 commonFindAdministrativeAreaLevel2(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2> | Promise<Nullable<CommonAdministrativeAreaLevel2>>;247 commonFindAdministrativeAreaLevel2ById(id?: Nullable<string>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2> | Promise<Nullable<CommonAdministrativeAreaLevel2>>;248 commonGetAdministrativeAreasLevel2(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2>[] | Promise<Nullable<CommonAdministrativeAreaLevel2>[]>;249 commonPaginateAdministrativeAreasLevel2(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Pagination | Promise<Pagination>;250 commonFindAdministrativeAreaLevel3(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3> | Promise<Nullable<CommonAdministrativeAreaLevel3>>;251 commonFindAdministrativeAreaLevel3ById(id?: Nullable<string>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3> | Promise<Nullable<CommonAdministrativeAreaLevel3>>;252 commonGetAdministrativeAreasLevel3(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3>[] | Promise<Nullable<CommonAdministrativeAreaLevel3>[]>;253 commonPaginateAdministrativeAreasLevel3(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Pagination | Promise<Pagination>;254 commonFindCountry(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry> | Promise<Nullable<CommonCountry>>;255 commonFindCountryById(id?: Nullable<string>, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry> | Promise<Nullable<CommonCountry>>;256 commonGetCountries(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry>[] | Promise<Nullable<CommonCountry>[]>;257 commonPaginateCountries(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Pagination | Promise<Pagination>;258 commonFindLang(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonLang> | Promise<Nullable<CommonLang>>;259 commonFindLangById(id?: Nullable<string>, constraint?: Nullable<QueryStatement>): Nullable<CommonLang> | Promise<Nullable<CommonLang>>;260 commonGetLangs(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonLang>[] | Promise<Nullable<CommonLang>[]>;261 commonPaginateLangs(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Pagination | Promise<Pagination>;262 hello(): Nullable<string> | Promise<Nullable<string>>;263}264export interface IMutation {265 commonCreateAdministrativeAreaLevel1(payload: CommonCreateAdministrativeAreaLevel1Input): Nullable<CommonAdministrativeAreaLevel1> | Promise<Nullable<CommonAdministrativeAreaLevel1>>;266 commonCreateAdministrativeAreasLevel1(payload: Nullable<CommonCreateAdministrativeAreaLevel1Input>[]): boolean | Promise<boolean>;267 commonUpdateAdministrativeAreaLevel1ById(payload: CommonUpdateAdministrativeAreaLevel1ByIdInput, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1> | Promise<Nullable<CommonAdministrativeAreaLevel1>>;268 commonUpdateAdministrativeAreasLevel1(payload: CommonUpdateAdministrativeAreasLevel1Input, query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1>[] | Promise<Nullable<CommonAdministrativeAreaLevel1>[]>;269 commonDeleteAdministrativeAreaLevel1ById(id: string, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1> | Promise<Nullable<CommonAdministrativeAreaLevel1>>;270 commonDeleteAdministrativeAreasLevel1(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel1>[] | Promise<Nullable<CommonAdministrativeAreaLevel1>[]>;271 commonCreateAdministrativeAreaLevel2(payload: CommonCreateAdministrativeAreaLevel2Input): Nullable<CommonAdministrativeAreaLevel2> | Promise<Nullable<CommonAdministrativeAreaLevel2>>;272 commonCreateAdministrativeAreasLevel2(payload: Nullable<CommonCreateAdministrativeAreaLevel2Input>[]): boolean | Promise<boolean>;273 commonUpdateAdministrativeAreaLevel2ById(payload: CommonUpdateAdministrativeAreaLevel2ByIdInput, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2> | Promise<Nullable<CommonAdministrativeAreaLevel2>>;274 commonUpdateAdministrativeAreasLevel2(payload: CommonUpdateAdministrativeAreasLevel2Input, query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2>[] | Promise<Nullable<CommonAdministrativeAreaLevel2>[]>;275 commonDeleteAdministrativeAreaLevel2ById(id: string, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2> | Promise<Nullable<CommonAdministrativeAreaLevel2>>;276 commonDeleteAdministrativeAreasLevel2(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel2>[] | Promise<Nullable<CommonAdministrativeAreaLevel2>[]>;277 commonCreateAdministrativeAreaLevel3(payload: CommonCreateAdministrativeAreaLevel3Input): Nullable<CommonAdministrativeAreaLevel3> | Promise<Nullable<CommonAdministrativeAreaLevel3>>;278 commonCreateAdministrativeAreasLevel3(payload: Nullable<CommonCreateAdministrativeAreaLevel3Input>[]): boolean | Promise<boolean>;279 commonUpdateAdministrativeAreaLevel3ById(payload: CommonUpdateAdministrativeAreaLevel3ByIdInput, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3> | Promise<Nullable<CommonAdministrativeAreaLevel3>>;280 commonUpdateAdministrativeAreasLevel3(payload: CommonUpdateAdministrativeAreasLevel3Input, query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3>[] | Promise<Nullable<CommonAdministrativeAreaLevel3>[]>;281 commonDeleteAdministrativeAreaLevel3ById(id: string, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3> | Promise<Nullable<CommonAdministrativeAreaLevel3>>;282 commonDeleteAdministrativeAreasLevel3(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonAdministrativeAreaLevel3>[] | Promise<Nullable<CommonAdministrativeAreaLevel3>[]>;283 commonCreateCountry(payload: CommonCreateCountryInput): Nullable<CommonCountry> | Promise<Nullable<CommonCountry>>;284 commonCreateCountries(payload: Nullable<CommonCreateCountryInput>[]): boolean | Promise<boolean>;285 commonUpdateCountryById(payload: CommonUpdateCountryByIdInput, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry> | Promise<Nullable<CommonCountry>>;286 commonUpdateCountries(payload: CommonUpdateCountriesInput, query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry>[] | Promise<Nullable<CommonCountry>[]>;287 commonDeleteCountryById(id: string, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry> | Promise<Nullable<CommonCountry>>;288 commonDeleteCountries(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonCountry>[] | Promise<Nullable<CommonCountry>[]>;289 commonCreateLang(payload: CommonCreateLangInput): Nullable<CommonLang> | Promise<Nullable<CommonLang>>;290 commonCreateLangs(payload: Nullable<CommonCreateLangInput>[]): boolean | Promise<boolean>;291 commonUpdateLangById(payload: CommonUpdateLangByIdInput, constraint?: Nullable<QueryStatement>): Nullable<CommonLang> | Promise<Nullable<CommonLang>>;292 commonUpdateLangs(payload: CommonUpdateLangsInput, query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonLang>[] | Promise<Nullable<CommonLang>[]>;293 commonDeleteLangById(id: string, constraint?: Nullable<QueryStatement>): Nullable<CommonLang> | Promise<Nullable<CommonLang>>;294 commonDeleteLangs(query?: Nullable<QueryStatement>, constraint?: Nullable<QueryStatement>): Nullable<CommonLang>[] | Promise<Nullable<CommonLang>[]>;295}296export interface CommonAdministrativeAreaLevel2 {297 id: string;298 countryId: string;299 country?: Nullable<CommonCountry>;300 administrativeAreaLevel1Id: string;301 administrativeAreaLevel1?: Nullable<CommonAdministrativeAreaLevel1>;302 code: GraphQLString;303 customCode?: Nullable<GraphQLString>;304 name: GraphQLString;305 slug: GraphQLString;306 latitude?: Nullable<GraphQLFloat>;307 longitude?: Nullable<GraphQLFloat>;308 zoom?: Nullable<GraphQLInt>;309 createdAt?: Nullable<GraphQLTimestamp>;310 updatedAt?: Nullable<GraphQLTimestamp>;311 deletedAt?: Nullable<GraphQLTimestamp>;312}313export interface CommonAdministrativeAreaLevel3 {314 id: string;315 countryId: string;316 country?: Nullable<CommonCountry>;317 administrativeAreaLevel1Id: string;318 administrativeAreaLevel1?: Nullable<CommonAdministrativeAreaLevel1>;319 administrativeAreaLevel2Id: string;320 administrativeAreaLevel2?: Nullable<CommonAdministrativeAreaLevel2>;321 code: GraphQLString;322 customCode?: Nullable<GraphQLString>;323 name: GraphQLString;324 slug: GraphQLString;325 latitude?: Nullable<GraphQLFloat>;326 longitude?: Nullable<GraphQLFloat>;327 zoom?: Nullable<GraphQLInt>;328 createdAt?: Nullable<GraphQLTimestamp>;329 updatedAt?: Nullable<GraphQLTimestamp>;330 deletedAt?: Nullable<GraphQLTimestamp>;331}332export interface CommonCountry {333 id: string;334 iso3166Alpha2: GraphQLString;335 iso3166Alpha3: GraphQLString;336 iso3166Numeric: GraphQLString;337 customCode?: Nullable<GraphQLString>;338 prefix?: Nullable<GraphQLString>;339 image?: Nullable<GraphQLString>;340 sort?: Nullable<GraphQLInt>;341 administrativeAreas?: Nullable<JSON>;342 latitude?: Nullable<GraphQLFloat>;343 longitude?: Nullable<GraphQLFloat>;344 zoom?: Nullable<GraphQLInt>;345 dataLang?: Nullable<JSON>;346 createdAt?: Nullable<GraphQLTimestamp>;347 updatedAt?: Nullable<GraphQLTimestamp>;348 deletedAt?: Nullable<GraphQLTimestamp>;349 langId: string;350 lang?: Nullable<CommonLang>;351 name: GraphQLString;352 slug: GraphQLString;353 administrativeAreaLevel1?: Nullable<GraphQLString>;354 administrativeAreaLevel2?: Nullable<GraphQLString>;355 administrativeAreaLevel3?: Nullable<GraphQLString>;356}357export interface CommonLang {358 id: string;359 name: GraphQLString;360 image?: Nullable<GraphQLString>;361 iso6392: GraphQLString;362 iso6393: GraphQLString;363 ietf: GraphQLString;364 customCode?: Nullable<GraphQLString>;365 dir: CommonLangDir;366 sort?: Nullable<GraphQLInt>;367 isActive: GraphQLBoolean;368 createdAt?: Nullable<GraphQLTimestamp>;369 updatedAt?: Nullable<GraphQLTimestamp>;370 deletedAt?: Nullable<GraphQLTimestamp>;371}372export interface Pagination {373 total: GraphQLInt;374 count: GraphQLInt;375 rows: Nullable<JSON>[];376}377export type JSON = any;378export type Any = any;379export type Upload = any;380export type GraphQLString = any;381export type GraphQLInt = any;382export type GraphQLFloat = any;383export type GraphQLBoolean = any;384export type GraphQLISODateTime = any;385export type GraphQLTimestamp = any;386export type GraphQLUpload = any;...

Full Screen

Full Screen

business.d.ts

Source:business.d.ts Github

copy

Full Screen

1/**2 * 业务相关的通用类型, inteface3 */4// ======== 以下 query dto 的 interface ==============5// 排序6export interface MySortI {7 // * 排序字段 对象写法 eq: 'boy.name' 即为 boy对象的name字段, 'name' 即为该对象的name字段8 prop: string;9 // * 排序类型 asc 升序 desc 降序 不区分大小写10 dir: string;11}12// 分页13export interface MyPageI {14 pageNum: number; // 之前是 page15 pageSize: number;16}17// 单个查询条件18export interface MyQueryDtoI {19 param: string;20 type: string;21 value?: (string | number | undefined)[];22}23// 导出 excel 的 dto24export interface ExportExcelDtoI {25 fileName: string;26 sheetName: string;27 ifShowTotal?: boolean;28 listDataColumn: ExportColumnTypeI[];29}30// 查询参数31export interface HqlQueryDtoI {32 hqlPageAndSortSumDto: {33 ifCustomHql?: boolean; // 默认 true34 sorts?: MySort[];35 // 不传分页,获取所有36 page?: Nullable<MyPageI>;37 // 查询条件38 queryList: MyQueryDtoI[];39 // 要合计的字段40 sumList?: string[];41 // 表名42 dataFieldList: string[];43 // 导出 excel44 exportExcelDto?: ExportExcelDtoI;45 };46}47// 查询参数48export interface SqlQueryDtoI {49 sqlPageAndSortSumDto: {50 ifCustomSql?: boolean; // 默认 true51 sorts?: MySort[];52 // 不传分页,获取所有53 page?: Nullable<MyPageI>;54 // 查询条件55 queryList: MyQueryDtoI[];56 // 要合计的字段57 sumList?: string[];58 // 表名,可以空59 dataFieldList?: string[];60 };61}62// ======== 以下 分页接口返回的 interface ==============63// 返回结果的分页结构64export interface MyPageInfo<T> {65 content: T[];66 totalElementAmount?: number;67 [key: string]: any;68}69// 返回 结果 结构70export interface HqlRespI<T> {71 // 合计 map72 mapListSumAmount?: { [key: string]: number };73 page: MyPageInfo<T>;74 [key: string]: any;75}76export interface ParentMenu<T> {77 // 合计 map78 id?: number;79}80// 单个菜单81export interface MenuObj {82 component: string;83 hidden: boolean;84 ifShowDigitalReminder: number;85 menuOrder: number;86 menuType: number;87 parentMenu: ParentMenu<T> | null;88 path: string;89 shiroKey: string;90 tagModule: number | null;91 title: string;92 useMark: number;93}94/**95 * 导出列的 interface96 */97export interface ExportColumnTypeI {98 // { dataName: 'proName', dataType: 'String', dataTitle: '项目名称', width: 3000 },99 dataName: string;100 dataType: 'String' | 'BigDecimal' | 'Date' | 'DateTime';101 dataTitle: string;102 width: number;103}104// 标段105export interface BidSectionI {106 id?: Nullable<number>;107 project?: ProjectI;108 sort?: Nullable<number>;109 proName?: Nullable<string>;110 organizationalForm?: DictionaryI;111 procurementMethod?: DictionaryI;112 quoteEndTime?: Nullable<number | string | Date>;113 proNumber?: Nullable<string>;114 budgetAmount?: Nullable<number>;115 bidWinningAmount?: Nullable<number>;116 biddingCompany?: any;117 ifUploadProcurementDocuments?: Nullable<number>;118 status?: DictionaryI;119 processId?: Nullable<string>;120 participants?: Nullable<string>;121 ifAbandonedBid?: Nullable<number>;122 resultNotice?: Nullable<string>;123 resultNoticeUrl?: Nullable<string>;124 upLoader?: Nullable<number>;125 ifDelete?: Nullable<number>;126 addDateTime?: Nullable<number | string | Date>;127 updateDateTime?: Nullable<number | string | Date>;128 verificateeInformation?: Nullable<string>;129 remainingAmount?: Nullable<number>;130 bidWinner?: any;131 [key: string]: any;132}133// 项目134export interface ProjectI {135 id?: Nullable<number>;136 proName?: Nullable<string>;137 purchaseNumber?: Nullable<string>;138 serviceContent?: Nullable<string>;139 servicePeriod?: Nullable<number>;140 countryOfOrigin?: Nullable<string>;141 budgetAmount?: Nullable<number>;142 fundsCategoryId?: Nullable<number>;143 fundsDepId?: Nullable<number>;144 fundsUserId?: Nullable<number>;145 relevantDepId?: Nullable<number>;146 relevantUserId?: Nullable<number>;147 natureFunds?: any;148 sourceFunds?: any;149 engineeringProperties?: any;150 useDirection?: any;151 planUseTime?: Nullable<number | string | Date>;152 planPurchaseTime?: Nullable<number | string | Date>;153 projectType?: any;154 ifGovProcurement?: Nullable<number>;155 ifLargeEquipment?: Nullable<number>;156 ifImportedEquipment?: Nullable<number>;157 ifSingleSource?: Nullable<number>;158 proposedTransactionUnit?: Nullable<string>;159 proChargeDepId?: Nullable<number>;160 proChargeUserId?: Nullable<number>;161 biddingDepartmentId?: Nullable<number>;162 BiddingUserId?: Nullable<number>;163 assignorUserId?: Nullable<number>;164 projectOverview?: Nullable<string>;165 initiationDate?: Nullable<number | string | Date>;166 initiationMethod?: Nullable<string>;167 otherInitiationMethod?: Nullable<string>;168 projectDesc?: Nullable<string>;169 intentionPublicEndTime?: Nullable<number | string | Date>;170 declareDept?: any;171 addUser?: any;172 currencyType?: any;173 bidWinningAmount?: Nullable<number>;174 projectAdditionPhase?: Nullable<number>;175 mainFunctionalObjectives?: Nullable<string>;176 basicRequirements?: Nullable<string>;177 qualityRequirements?: Nullable<string>;178 serviceRequirements?: Nullable<string>;179 safetyRequirements?: Nullable<string>;180 timeLimitRequirements?: Nullable<string>;181 status?: DictionaryI;182 ifMultiBidSection?: Nullable<number>;183 multiBidSectionAdditionPhase?: Nullable<number>;184 biddingCompanyId?: Nullable<number>;185 planOrganizationalForm?: Nullable<DictionaryI>;186 organizationalForm?: Nullable<DictionaryI>;187 planProcurementMethod?: Nullable<DictionaryI>;188 procurementMethod?: Nullable<DictionaryI>;189 decentralizedPurchaseMethod?: Nullable<number>;190 releaseDate?: Nullable<number | string | Date>;191 quoteStartTime?: Nullable<number | string | Date>;192 quoteEndTime?: Nullable<number | string | Date>;193 quaRequire?: Nullable<string>;194 remark?: Nullable<string>;195 processId?: Nullable<string>;196 ifDelete?: Nullable<number>;197 addDateTime?: Nullable<number | string | Date>;198 updateDateTime?: Nullable<number | string | Date>;199 dateOfDelivery?: Nullable<string>;200 verificateFailedMsg?: Nullable<string>;201 auditRecords?: any;202 proReviewNode?: any;203 ifInitiateMethodAttachment?: Nullable<number>;204 ProjectTypeId?: Nullable<number>;205 fundsUserIdMsg?: Nullable<string>;206 relevantUserIdMsg?: Nullable<string>;207 ifHandle?: Nullable<number>;208 [key: string]: any;209}210// 字典211export interface DictionaryI {212 id?: number;213 parentId?: Nullable<number>;214 name?: Nullable<string>;215 code?: Nullable<string>;216 addDateTime?: Nullable<number | string | Date>;217 updateDateTime?: Nullable<number | string | Date>;218 ifDelete?: Nullable<number>;219 sort?: Nullable<number>;220 node?: Nullable<string>;221 useMark?: Nullable<number>;222 menuNumber?: Nullable<number>;223 [key: string]: any;224}225// 通知226export interface NoticeI {227 id?: number;228 title?: string;229 content?: Nullable<string>;230 systemModule?: Nullable<number>;231 role?: Nullable<number>;232 viewingTimes?: Nullable<number>;233 ifIndexShow?: Nullable<number>;234 pic?: Nullable<string>;235 addUserId?: any;236 addDateTime?: Nullable<number | string | Date>;237 ifDelete?: Nullable<number>;238 useMark?: Nullable<number>;239 updateDateTime?: Nullable<number | string | Date>;240 [key: string]: any;241}242export interface UserI {243 id?: number;244 orgId?: Nullable<number>;245 orgName?: Nullable<string>;246 department?: Nullable<DepartmentI>;247 account?: Nullable<string>;248 password?: Nullable<string>;249 perName?: Nullable<string>;250 sexCode?: Nullable<number>;251 mobile?: Nullable<string>;252 citId?: Nullable<string>;253 ifDepHead?: Nullable<number>;254 ifChargeDirector?: Nullable<number>;255 ifChargeLeader?: Nullable<number>;256 ifFullAccess?: Nullable<number>;257 pic?: Nullable<string>;258 skin?: Nullable<string>;259 signature?: Nullable<string>;260 openId?: Nullable<string>;261 unionId?: Nullable<string>;262 roleIds?: Nullable<string>;263 role?: Nullable<number>;264 ifSchoolExpert?: Nullable<number>;265 approveStatus?: Nullable<number>;266 authorizeDepIds?: Nullable<string>;267 processAuthorizeDepIds?: Nullable<string>;268 lastLogin?: Nullable<number | string | Date>;269 addDateTime?: Nullable<number | string | Date>;270 ifDelete?: Nullable<number>;271 useMark?: Nullable<number>;272 sessionId?: Nullable<string>;273 systemType?: Nullable<number>;274 roleCode?: Nullable<string>;275 depId?: Nullable<number>;276 depName?: Nullable<string>;277 researchAreaNames?: Nullable<string>;278 ifSupplier?: Nullable<number>;279 ifRepairer?: Nullable<number>;280 companyName?: Nullable<string>;281 approveSuggestion?: Nullable<string>;282 [key: string]: any;283}284export interface DepartmentI {285 id?: number;286 name?: Nullable<string>;287 attribute?: Nullable<DictionaryI>;288 code?: Nullable<string>;289 parent?: any;290 organization?: any;291 ifCentralized?: Nullable<number>;292 ifMgt?: Nullable<number>;293 ifAccounting?: Nullable<number>;294 ifDirector?: Nullable<number>;295 ifControl?: Nullable<number>;296 ifPurOrg?: Nullable<number>; // 是否组织部门297 ifConDirector?: Nullable<number>;298 ifDelete?: Nullable<number>;299 useMark?: Nullable<number>;300 addDateTime?: Nullable<number | string | Date>;301 updateDateTime?: Nullable<number | string | Date>;302 parentId?: Nullable<number>;303 [key: string]: any;304}305export interface ProcessWaitDealI {306 ID_?: string;307 REV_?: number;308 EXECUTION_ID_?: string;309 PROC_INST_ID_?: string;310 PROC_DEF_ID_?: string;311 TASK_DEF_ID_?: any;312 SCOPE_ID_?: any;313 SUB_SCOPE_ID_?: any;314 SCOPE_TYPE_?: any;315 SCOPE_DEFINITION_ID_?: any;316 PROPAGATED_STAGE_INST_ID_?: any;317 NAME_?: string;318 PARENT_TASK_ID_?: any;319 DESCRIPTION_?: any;320 TASK_DEF_KEY_?: string;321 OWNER_?: any;322 ASSIGNEE_?: string;323 DELEGATION_?: any;324 PRIORITY_?: number;325 CREATE_TIME_?: string;326 DUE_DATE_?: any;327 CATEGORY_?: any;328 SUSPENSION_STATE_?: number;329 TENANT_ID_?: string;330 FORM_KEY_?: any;331 CLAIM_TIME_?: any;332 IS_COUNT_ENABLED_?: number;333 VAR_COUNT_?: number;334 ID_LINK_COUNT_?: number;335 SUB_TASK_COUNT_?: number;336 IF_POSTPONEMENT?: number;337 PNAME_?: string;338 DEPLOYMENT_ID_?: string;339 DGRM_RESOURCE_NAME_?: string;340 processObjectName?: string;341 processObjectCode?: string;342 applyObjectType?: '' | '' | '';343 organizationalFormName?: any;344 procurementMethodName?: any;345 amount?: string;346 projectCategoryName?: any;347 processObjectId?: string;348 proCode?: any;349 addDepId?: string;350 addDepName?: string;351 INITATOR?: string;352 processDescription?: string;353 currencyTypeName?: string;354 planUseTime?: string;355 addUserPerName?: string;356 addUserMobile?: string;357 addDateTime?: string;358 code?: string;359 perName?: string;360 tagModuleId?: string;361 [key: string]: any;362}363export interface ProcessAlreadyDoneI {364 ID_?: string;365 REV_?: number;366 PROC_DEF_ID_?: string;367 TASK_DEF_ID_?: any;368 TASK_DEF_KEY_?: string;369 PROC_INST_ID_?: string;370 EXECUTION_ID_?: string;371 SCOPE_ID_?: any;372 SUB_SCOPE_ID_?: any;373 SCOPE_TYPE_?: any;374 SCOPE_DEFINITION_ID_?: any;375 PROPAGATED_STAGE_INST_ID_?: any;376 NAME_?: string;377 PARENT_TASK_ID_?: any;378 DESCRIPTION_?: any;379 OWNER_?: any;380 ASSIGNEE_?: string;381 START_TIME_?: string;382 CLAIM_TIME_?: any;383 END_TIME_?: string;384 DURATION_?: number;385 DELETE_REASON_?: any;386 PRIORITY_?: number;387 DUE_DATE_?: any;388 FORM_KEY_?: any;389 CATEGORY_?: any;390 TENANT_ID_?: string;391 LAST_UPDATED_TIME_?: string;392 PNAME_?: string;393 DEPLOYMENT_ID_?: string;394 DGRM_RESOURCE_NAME_?: string;395 processObjectName?: string;396 processObjectCode?: string;397 applyObjectType?: string;398 organizationalFormName?: any;399 procurementMethodName?: any;400 amount?: string;401 projectCategoryName?: any;402 processObjectId?: string;403 proCode?: any;404 addDepId?: string;405 addDepName?: string;406 processDescription?: string;407 currencyTypeName?: string;408 planUseTime?: string;409 addUserPerName?: string;410 addUserMobile?: string;411 addDateTime?: string;412 code?: any;413 INITATOR?: string;414 perName?: string;415 tagModuleId?: string;416 [key: string]: any;417}418/**419 * 下载文件类型420 */421export interface FileI {422 id?: Nullable<number>;423 objectId?: Nullable<number>;424 objectName?: Nullable<string>;425 fileTypeId?: Nullable<number>;426 name?: Nullable<string>;427 url?: Nullable<string>;428 size?: Nullable<number>;429 addUserId?: Nullable<number>;430 fileExplain?: Nullable<string>;431 addDateTime?: Nullable<number | string | Date>;432 updateDateTime?: Nullable<number | string | Date>;433 ifDelete?: Nullable<number>;434 [key: string]: any;435}436export interface CommonFileI {437 id?: Nullable<number>;438 name: string;439 downloadType?: any;440 attach?: Nullable<string>;441 role?: Nullable<number>;442 addDateTime?: Nullable<number | string | Date>;443 updateDateTime?: Nullable<number | string | Date>;444 ifDelete?: Nullable<number>;445 useMark?: Nullable<number>;446 downloadAmount?: Nullable<number>;447 systemModule?: Nullable<number>;448 [key: string]: any;449}450export interface NoticeI {451 id?: Nullable<number>;452 title?: Nullable<string>;453 content?: Nullable<string>;454 systemModule?: Nullable<number>;455 role?: Nullable<number>;456 viewingTimes?: Nullable<number>;457 ifIndexShow?: Nullable<number>;458 pic?: Nullable<string>;459 addUserId?: any;460 addDateTime?: Nullable<number | string | Date>;461 ifDelete?: Nullable<number>;462 useMark?: Nullable<number>;463 updateDateTime?: Nullable<number | string | Date>;464 [key: string]: any;465}466// 我的业务 interfce467export interface MyBusinessItemI {468 addDateTime: number;469 amount: Nullable<number>;470 currencyTypeName: string;471 id: number;472 name: string;473 objNumber: string;474 statusName: string;475 type: string;476 [key: string]: any;...

Full Screen

Full Screen

702d6ee9b14f_compact_all_migrations.py

Source:702d6ee9b14f_compact_all_migrations.py Github

copy

Full Screen

1"""compact all migrations2Revision ID: 702d6ee9b14f3Revises:4Create Date: 2020-09-21 21:11:08.8547925"""6from alembic import op7import sqlalchemy as sa8# revision identifiers, used by Alembic.9revision = "702d6ee9b14f"10down_revision = None11branch_labels = None12depends_on = None13def upgrade():14 conn = op.get_bind()15 inspector = sa.inspect(conn)16 tables = inspector.get_table_names()17 if "choice_group" not in tables:18 op.create_table(19 "choice_group",20 sa.Column("id", sa.Integer(), nullable=False),21 sa.Column("created_at", sa.DateTime(), nullable=True),22 sa.Column("title", sa.String(), nullable=True),23 sa.PrimaryKeyConstraint("id"),24 )25 if "company" not in tables:26 op.create_table(27 "company",28 sa.Column("id", sa.Integer(), nullable=False),29 sa.Column("created_at", sa.DateTime(), nullable=True),30 sa.Column("name", sa.String(), nullable=True),31 sa.Column("slogan", sa.String(), nullable=True),32 sa.Column("logo_src", sa.String(), nullable=True),33 sa.PrimaryKeyConstraint("id"),34 )35 if "email_template" not in tables:36 op.create_table(37 "email_template",38 sa.Column("id", sa.Integer(), nullable=False),39 sa.Column("custom_welcome_email_template", sa.String(), nullable=True),40 sa.Column("use_custom_welcome_email", sa.Boolean(), nullable=True),41 sa.PrimaryKeyConstraint("id"),42 )43 if "integration" not in tables:44 op.create_table(45 "integration",46 sa.Column("id", sa.Integer(), nullable=False),47 sa.Column("created_at", sa.DateTime(), nullable=True),48 sa.Column("google_tag_manager_active", sa.Boolean(), nullable=True),49 sa.Column("google_tag_manager_container_id", sa.String(), nullable=True),50 sa.Column("tawk_active", sa.Boolean(), nullable=True),51 sa.Column("tawk_property_id", sa.String(), nullable=True),52 sa.PrimaryKeyConstraint("id"),53 )54 if "module" not in tables:55 op.create_table(56 "module",57 sa.Column("id", sa.Integer(), nullable=False),58 sa.Column("created_at", sa.DateTime(), nullable=True),59 sa.Column("name", sa.String(), nullable=True),60 sa.Column("src", sa.String(), nullable=True),61 sa.PrimaryKeyConstraint("id"),62 )63 if "module_seo_page_title" not in tables:64 op.create_table(65 "module_seo_page_title",66 sa.Column("path", sa.String(), nullable=False),67 sa.Column("title", sa.String(), nullable=True),68 sa.PrimaryKeyConstraint("path"),69 )70 if "module_style" not in tables:71 op.create_table(72 "module_style",73 sa.Column("id", sa.Integer(), nullable=False),74 sa.Column("created_at", sa.DateTime(), nullable=True),75 sa.Column("css", sa.String(), nullable=True),76 sa.PrimaryKeyConstraint("id"),77 )78 if "page" not in tables:79 op.create_table(80 "page",81 sa.Column("id", sa.Integer(), nullable=False),82 sa.Column("created_at", sa.DateTime(), nullable=True),83 sa.Column("page_name", sa.String(), nullable=True),84 sa.Column("path", sa.String(), nullable=True),85 sa.Column("template_file", sa.String(), nullable=True),86 sa.PrimaryKeyConstraint("id"),87 )88 if "payment_provider" not in tables:89 op.create_table(90 "payment_provider",91 sa.Column("id", sa.Integer(), nullable=False),92 sa.Column("created_at", sa.DateTime(), nullable=True),93 sa.Column("gocardless_active", sa.Boolean(), nullable=True),94 sa.Column("gocardless_access_token", sa.String(), nullable=True),95 sa.Column("gocardless_environment", sa.String(), nullable=True),96 sa.Column("stripe_active", sa.Boolean(), nullable=True),97 sa.Column("stripe_publishable_key", sa.String(), nullable=True),98 sa.Column("stripe_secret_key", sa.String(), nullable=True),99 sa.Column("stripe_webhook_endpoint_secret", sa.String(), nullable=True),100 sa.Column("stripe_webhook_endpoint_id", sa.String(), nullable=True),101 sa.PrimaryKeyConstraint("id"),102 )103 if "person" not in tables:104 op.create_table(105 "person",106 sa.Column("id", sa.Integer(), nullable=False),107 sa.Column("created_at", sa.DateTime(), nullable=True),108 sa.Column("uuid", sa.String(), nullable=True),109 sa.Column("sid", sa.String(), nullable=True),110 sa.Column("ts", sa.DateTime(), nullable=True),111 sa.Column("given_name", sa.String(), nullable=True),112 sa.Column("family_name", sa.String(), nullable=True),113 sa.Column("address_line1", sa.String(), nullable=True),114 sa.Column("city", sa.String(), nullable=True),115 sa.Column("postal_code", sa.String(), nullable=True),116 sa.Column("email", sa.String(), nullable=True),117 sa.Column("password", sa.String(), nullable=True),118 sa.Column("password_reset_string", sa.String(), nullable=True),119 sa.Column("mobile", sa.String(), nullable=True),120 sa.PrimaryKeyConstraint("id"),121 )122 if "plan" not in tables:123 op.create_table(124 "plan",125 sa.Column("id", sa.Integer(), nullable=False),126 sa.Column("created_at", sa.DateTime(), nullable=True),127 sa.Column("archived", sa.Boolean(), nullable=True),128 sa.Column("uuid", sa.String(), nullable=True),129 sa.Column("title", sa.String(), nullable=True),130 sa.Column("interval_unit", sa.String(), nullable=True),131 sa.Column("interval_amount", sa.Integer(), nullable=True),132 sa.Column("monthly_price", sa.Integer(), nullable=True),133 sa.Column("sell_price", sa.Integer(), nullable=True),134 sa.Column("days_before_first_charge", sa.Integer(), nullable=True),135 sa.Column("primary_icon", sa.String(), nullable=True),136 sa.Column("position", sa.Integer(), nullable=True),137 sa.PrimaryKeyConstraint("id"),138 )139 if "setting" not in tables:140 op.create_table(141 "setting",142 sa.Column("id", sa.Integer(), nullable=False),143 sa.Column("reply_to_email_address", sa.String(), nullable=True),144 sa.PrimaryKeyConstraint("id"),145 )146 if "user" not in tables:147 op.create_table(148 "user",149 sa.Column("id", sa.Integer(), nullable=False),150 sa.Column("email", sa.String(), nullable=True),151 sa.Column("password", sa.String(), nullable=True),152 sa.Column("created_at", sa.DateTime(), nullable=True),153 sa.Column("active", sa.String(), nullable=True),154 sa.Column("login_token", sa.String(), nullable=True),155 sa.Column("password_reset_string", sa.String(), nullable=True),156 sa.PrimaryKeyConstraint("id"),157 )158 if "option" not in tables:159 op.create_table(160 "option",161 sa.Column("id", sa.Integer(), nullable=False),162 sa.Column("choice_group_id", sa.Integer(), nullable=True),163 sa.Column("created_at", sa.DateTime(), nullable=True),164 sa.Column("title", sa.String(), nullable=True),165 sa.Column("description", sa.Text(), nullable=True),166 sa.Column("primary_icon", sa.String(), nullable=True),167 sa.ForeignKeyConstraint(168 ["choice_group_id"],169 ["choice_group.id"],170 ),171 sa.PrimaryKeyConstraint("id"),172 )173 if "plan_choice_group" not in tables:174 op.create_table(175 "plan_choice_group",176 sa.Column("choice_group_id", sa.Integer(), nullable=True),177 sa.Column("plan_id", sa.Integer(), nullable=True),178 sa.ForeignKeyConstraint(179 ["choice_group_id"],180 ["choice_group.id"],181 ),182 sa.ForeignKeyConstraint(183 ["plan_id"],184 ["plan.id"],185 ),186 )187 if "plan_requirements" not in tables:188 op.create_table(189 "plan_requirements",190 sa.Column("id", sa.Integer(), nullable=False),191 sa.Column("created_at", sa.DateTime(), nullable=True),192 sa.Column("plan_id", sa.Integer(), nullable=True),193 sa.Column("instant_payment", sa.Boolean(), nullable=True),194 sa.Column("subscription", sa.Boolean(), nullable=True),195 sa.Column("note_to_seller_required", sa.Boolean(), nullable=True),196 sa.Column("note_to_buyer_message", sa.String(), nullable=True),197 sa.ForeignKeyConstraint(198 ["plan_id"],199 ["plan.id"],200 ),201 sa.PrimaryKeyConstraint("id"),202 )203 if "plan_selling_points" not in tables:204 op.create_table(205 "plan_selling_points",206 sa.Column("id", sa.Integer(), nullable=False),207 sa.Column("created_at", sa.DateTime(), nullable=True),208 sa.Column("point", sa.String(), nullable=True),209 sa.Column("plan_id", sa.Integer(), nullable=True),210 sa.ForeignKeyConstraint(211 ["plan_id"],212 ["plan.id"],213 ),214 sa.PrimaryKeyConstraint("id"),215 )216 if "subscription" not in tables:217 op.create_table(218 "subscription",219 sa.Column("id", sa.Integer(), nullable=False),220 sa.Column("uuid", sa.String(), nullable=True),221 sa.Column("sku_uuid", sa.String(), nullable=True),222 sa.Column("gocardless_subscription_id", sa.String(), nullable=True),223 sa.Column("person_id", sa.Integer(), nullable=True),224 sa.Column("created_at", sa.DateTime(), nullable=True),225 sa.ForeignKeyConstraint(226 ["person_id"],227 ["person.id"],228 ),229 sa.PrimaryKeyConstraint("id"),230 )231 if "chosen_option" not in tables:232 op.create_table(233 "chosen_option",234 sa.Column("id", sa.Integer(), nullable=False),235 sa.Column("created_at", sa.DateTime(), nullable=True),236 sa.Column("choice_group_id", sa.Integer(), nullable=True),237 sa.Column("choice_group_title", sa.String(), nullable=True),238 sa.Column("option_title", sa.String(), nullable=True),239 sa.Column("subscription_id", sa.Integer(), nullable=True),240 sa.ForeignKeyConstraint(241 ["subscription_id"],242 ["subscription.id"],243 ),244 sa.PrimaryKeyConstraint("id"),245 )246 if "subscription_note" not in tables:247 op.create_table(248 "subscription_note",249 sa.Column("id", sa.Integer(), nullable=False),250 sa.Column("created_at", sa.DateTime(), nullable=True),251 sa.Column("note", sa.String(), nullable=True),252 sa.Column("subscription_id", sa.Integer(), nullable=True),253 sa.ForeignKeyConstraint(254 ["subscription_id"],255 ["subscription.id"],256 ),257 sa.PrimaryKeyConstraint("id"),258 )259 if "transactions" not in tables:260 op.create_table(261 "transactions",262 sa.Column("id", sa.Integer(), nullable=False),263 sa.Column("created_at", sa.DateTime(), nullable=True),264 sa.Column("uuid", sa.String(), nullable=True),265 sa.Column("amount", sa.Integer(), nullable=True),266 sa.Column("comment", sa.Text(), nullable=True),267 sa.Column("external_id", sa.String(), nullable=True),268 sa.Column("external_src", sa.String(), nullable=True),269 sa.Column("person_id", sa.Integer(), nullable=True),270 sa.Column("subscription_id", sa.Integer(), nullable=True),271 sa.Column("payment_status", sa.String(), nullable=True),272 sa.Column("fulfillment_state", sa.String(), nullable=True),273 sa.ForeignKeyConstraint(274 ["person_id"],275 ["person.id"],276 ),277 sa.ForeignKeyConstraint(278 ["subscription_id"],279 ["subscription.id"],280 ),281 sa.PrimaryKeyConstraint("id"),282 )283def downgrade():...

Full Screen

Full Screen

schema.js

Source:schema.js Github

copy

Full Screen

1var db = {2 posts: {3 id: {type: 'increments', nullable: false, primary: true},4 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},5 title: {type: 'string', maxlength: 150, nullable: false},6 slug: {type: 'string', maxlength: 150, nullable: false, unique: true},7 markdown: {type: 'text', maxlength: 16777215, fieldtype: 'medium', nullable: true},8 html: {type: 'text', maxlength: 16777215, fieldtype: 'medium', nullable: true},9 image: {type: 'text', maxlength: 2000, nullable: true},10 featured: {type: 'bool', nullable: false, defaultTo: false, validations: {isIn: [[0, 1, false, true]]}},11 page: {type: 'bool', nullable: false, defaultTo: false, validations: {isIn: [[0, 1, false, true]]}},12 status: {type: 'string', maxlength: 150, nullable: false, defaultTo: 'draft'},13 language: {type: 'string', maxlength: 6, nullable: false, defaultTo: 'en_US'},14 meta_title: {type: 'string', maxlength: 150, nullable: true},15 meta_description: {type: 'string', maxlength: 200, nullable: true},16 author_id: {type: 'integer', nullable: false},17 created_at: {type: 'dateTime', nullable: false},18 created_by: {type: 'integer', nullable: false},19 updated_at: {type: 'dateTime', nullable: true},20 updated_by: {type: 'integer', nullable: true},21 published_at: {type: 'dateTime', nullable: true},22 published_by: {type: 'integer', nullable: true}23 },24 users: {25 id: {type: 'increments', nullable: false, primary: true},26 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},27 name: {type: 'string', maxlength: 150, nullable: false},28 slug: {type: 'string', maxlength: 150, nullable: false, unique: true},29 password: {type: 'string', maxlength: 60, nullable: false},30 email: {type: 'string', maxlength: 254, nullable: false, unique: true, validations: {isEmail: true}},31 image: {type: 'text', maxlength: 2000, nullable: true},32 cover: {type: 'text', maxlength: 2000, nullable: true},33 bio: {type: 'string', maxlength: 200, nullable: true},34 website: {type: 'text', maxlength: 2000, nullable: true, validations: {isEmptyOrURL: true}},35 location: {type: 'text', maxlength: 65535, nullable: true},36 accessibility: {type: 'text', maxlength: 65535, nullable: true},37 status: {type: 'string', maxlength: 150, nullable: false, defaultTo: 'active'},38 language: {type: 'string', maxlength: 6, nullable: false, defaultTo: 'en_US'},39 meta_title: {type: 'string', maxlength: 150, nullable: true},40 meta_description: {type: 'string', maxlength: 200, nullable: true},41 last_login: {type: 'dateTime', nullable: true},42 created_at: {type: 'dateTime', nullable: false},43 created_by: {type: 'integer', nullable: false},44 updated_at: {type: 'dateTime', nullable: true},45 updated_by: {type: 'integer', nullable: true}46 },47 roles: {48 id: {type: 'increments', nullable: false, primary: true},49 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},50 name: {type: 'string', maxlength: 150, nullable: false},51 description: {type: 'string', maxlength: 200, nullable: true},52 created_at: {type: 'dateTime', nullable: false},53 created_by: {type: 'integer', nullable: false},54 updated_at: {type: 'dateTime', nullable: true},55 updated_by: {type: 'integer', nullable: true}56 },57 roles_users: {58 id: {type: 'increments', nullable: false, primary: true},59 role_id: {type: 'integer', nullable: false},60 user_id: {type: 'integer', nullable: false}61 },62 permissions: {63 id: {type: 'increments', nullable: false, primary: true},64 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},65 name: {type: 'string', maxlength: 150, nullable: false},66 object_type: {type: 'string', maxlength: 150, nullable: false},67 action_type: {type: 'string', maxlength: 150, nullable: false},68 object_id: {type: 'integer', nullable: true},69 created_at: {type: 'dateTime', nullable: false},70 created_by: {type: 'integer', nullable: false},71 updated_at: {type: 'dateTime', nullable: true},72 updated_by: {type: 'integer', nullable: true}73 },74 permissions_users: {75 id: {type: 'increments', nullable: false, primary: true},76 user_id: {type: 'integer', nullable: false},77 permission_id: {type: 'integer', nullable: false}78 },79 permissions_roles: {80 id: {type: 'increments', nullable: false, primary: true},81 role_id: {type: 'integer', nullable: false},82 permission_id: {type: 'integer', nullable: false}83 },84 permissions_apps: {85 id: {type: 'increments', nullable: false, primary: true},86 app_id: {type: 'integer', nullable: false},87 permission_id: {type: 'integer', nullable: false}88 },89 settings: {90 id: {type: 'increments', nullable: false, primary: true},91 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},92 key: {type: 'string', maxlength: 150, nullable: false, unique: true},93 value: {type: 'text', maxlength: 65535, nullable: true},94 type: {type: 'string', maxlength: 150, nullable: false, defaultTo: 'core', validations: {isIn: [['core', 'blog', 'theme', 'app', 'plugin']]}},95 created_at: {type: 'dateTime', nullable: false},96 created_by: {type: 'integer', nullable: false},97 updated_at: {type: 'dateTime', nullable: true},98 updated_by: {type: 'integer', nullable: true}99 },100 tags: {101 id: {type: 'increments', nullable: false, primary: true},102 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},103 name: {type: 'string', maxlength: 150, nullable: false},104 slug: {type: 'string', maxlength: 150, nullable: false, unique: true},105 description: {type: 'string', maxlength: 200, nullable: true},106 image: {type: 'text', maxlength: 2000, nullable: true},107 hidden: {type: 'bool', nullable: false, defaultTo: false, validations: {isIn: [[0, 1, false, true]]}},108 parent_id: {type: 'integer', nullable: true},109 meta_title: {type: 'string', maxlength: 150, nullable: true},110 meta_description: {type: 'string', maxlength: 200, nullable: true},111 created_at: {type: 'dateTime', nullable: false},112 created_by: {type: 'integer', nullable: false},113 updated_at: {type: 'dateTime', nullable: true},114 updated_by: {type: 'integer', nullable: true}115 },116 posts_tags: {117 id: {type: 'increments', nullable: false, primary: true},118 post_id: {type: 'integer', nullable: false, unsigned: true, references: 'posts.id'},119 tag_id: {type: 'integer', nullable: false, unsigned: true, references: 'tags.id'}120 },121 apps: {122 id: {type: 'increments', nullable: false, primary: true},123 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},124 name: {type: 'string', maxlength: 150, nullable: false, unique: true},125 slug: {type: 'string', maxlength: 150, nullable: false, unique: true},126 version: {type: 'string', maxlength: 150, nullable: false},127 status: {type: 'string', maxlength: 150, nullable: false, defaultTo: 'inactive'},128 created_at: {type: 'dateTime', nullable: false},129 created_by: {type: 'integer', nullable: false},130 updated_at: {type: 'dateTime', nullable: true},131 updated_by: {type: 'integer', nullable: true}132 },133 app_settings: {134 id: {type: 'increments', nullable: false, primary: true},135 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},136 key: {type: 'string', maxlength: 150, nullable: false, unique: true},137 value: {type: 'text', maxlength: 65535, nullable: true},138 app_id: {type: 'integer', nullable: false, unsigned: true, references: 'apps.id'},139 created_at: {type: 'dateTime', nullable: false},140 created_by: {type: 'integer', nullable: false},141 updated_at: {type: 'dateTime', nullable: true},142 updated_by: {type: 'integer', nullable: true}143 },144 app_fields: {145 id: {type: 'increments', nullable: false, primary: true},146 uuid: {type: 'string', maxlength: 36, nullable: false, validations: {isUUID: true}},147 key: {type: 'string', maxlength: 150, nullable: false},148 value: {type: 'text', maxlength: 65535, nullable: true},149 type: {type: 'string', maxlength: 150, nullable: false, defaultTo: 'html'},150 app_id: {type: 'integer', nullable: false, unsigned: true, references: 'apps.id'},151 relatable_id: {type: 'integer', nullable: false, unsigned: true},152 relatable_type: {type: 'string', maxlength: 150, nullable: false, defaultTo: 'posts'},153 active: {type: 'bool', nullable: false, defaultTo: true, validations: {isIn: [[0, 1, false, true]]}},154 created_at: {type: 'dateTime', nullable: false},155 created_by: {type: 'integer', nullable: false},156 updated_at: {type: 'dateTime', nullable: true},157 updated_by: {type: 'integer', nullable: true}158 },159 clients: {160 id: {type: 'increments', nullable: false, primary: true},161 uuid: {type: 'string', maxlength: 36, nullable: false},162 name: {type: 'string', maxlength: 150, nullable: false, unique: true},163 slug: {type: 'string', maxlength: 150, nullable: false, unique: true},164 secret: {type: 'string', maxlength: 150, nullable: false, unique: true},165 created_at: {type: 'dateTime', nullable: false},166 created_by: {type: 'integer', nullable: false},167 updated_at: {type: 'dateTime', nullable: true},168 updated_by: {type: 'integer', nullable: true}169 },170 accesstokens: {171 id: {type: 'increments', nullable: false, primary: true},172 token: {type: 'string', nullable: false, unique: true},173 user_id: {type: 'integer', nullable: false, unsigned: true, references: 'users.id'},174 client_id: {type: 'integer', nullable: false, unsigned: true, references: 'clients.id'},175 expires: {type: 'bigInteger', nullable: false}176 },177 refreshtokens: {178 id: {type: 'increments', nullable: false, primary: true},179 token: {type: 'string', nullable: false, unique: true},180 user_id: {type: 'integer', nullable: false, unsigned: true, references: 'users.id'},181 client_id: {type: 'integer', nullable: false, unsigned: true, references: 'clients.id'},182 expires: {type: 'bigInteger', nullable: false}183 }184 };185function isPost(jsonData) {186 return jsonData.hasOwnProperty('html') && jsonData.hasOwnProperty('markdown') &&187 jsonData.hasOwnProperty('title') && jsonData.hasOwnProperty('slug');188}189function isTag(jsonData) {190 return jsonData.hasOwnProperty('name') && jsonData.hasOwnProperty('slug') &&191 jsonData.hasOwnProperty('description') && jsonData.hasOwnProperty('parent');192}193function isUser(jsonData) {194 return jsonData.hasOwnProperty('bio') && jsonData.hasOwnProperty('website') &&195 jsonData.hasOwnProperty('status') && jsonData.hasOwnProperty('location');196}197function isNav(jsonData) {198 return jsonData.hasOwnProperty('label') && jsonData.hasOwnProperty('url') &&199 jsonData.hasOwnProperty('slug') && jsonData.hasOwnProperty('current');200}201module.exports.tables = db;202module.exports.checks = {203 isPost: isPost,204 isTag: isTag,205 isUser: isUser,206 isNav: isNav...

Full Screen

Full Screen

8369118943a1_initial_revision.py

Source:8369118943a1_initial_revision.py Github

copy

Full Screen

1"""Initial Revision2Revision ID: 8369118943a13Revises: 4Create Date: 2018-11-05 01:06:24.4950105"""6from alembic import op7import sqlalchemy as sa8from sqlalchemy import TypeDecorator, String, func, types, CheckConstraint, and_9from sqlalchemy.sql.expression import union_all10from sqlalchemy.types import JSON, NullType11from sqlalchemy.orm import validates, column_property12from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method13import json14# revision identifiers, used by Alembic.15revision = '8369118943a1'16down_revision = None17branch_labels = None18depends_on = None19class SQLiteJson(TypeDecorator):20 impl = String21 class Comparator(String.Comparator):22 def __getitem__(self, index):23 if isinstance(index, tuple):24 index = "$%s" % (25 "".join([26 "[%s]" % elem if isinstance(elem, int)27 else '."%s"' % elem for elem in index28 ])29 )30 elif isinstance(index, int):31 index = "$[%s]" % index32 else:33 index = '$."%s"' % index34 # json_extract does not appear to return JSON sub-elements35 # which is weird.36 return func.json_extract(self.expr, index, type_=NullType)37 comparator_factory = Comparator38 def process_bind_param(self, value, dialect):39 if value is not None:40 value = json.dumps(value)41 return value42 def process_result_value(self, value, dialect):43 if value is not None:44 value = json.loads(value)45 return value46JSON = types.JSON().with_variant(SQLiteJson, 'sqlite')47def upgrade():48 # ### commands auto generated by Alembic - please adjust! ###49 op.create_table('challenges',50 sa.Column('id', sa.Integer(), nullable=False),51 sa.Column('name', sa.String(length=80), nullable=True),52 sa.Column('description', sa.Text(), nullable=True),53 sa.Column('max_attempts', sa.Integer(), nullable=True),54 sa.Column('value', sa.Integer(), nullable=True),55 sa.Column('category', sa.String(length=80), nullable=True),56 sa.Column('type', sa.String(length=80), nullable=True),57 sa.Column('state', sa.String(length=80), nullable=False),58 sa.Column('requirements', JSON, nullable=True),59 sa.PrimaryKeyConstraint('id')60 )61 op.create_table('config',62 sa.Column('id', sa.Integer(), nullable=False),63 sa.Column('key', sa.Text(), nullable=True),64 sa.Column('value', sa.Text(), nullable=True),65 sa.PrimaryKeyConstraint('id')66 )67 op.create_table('pages',68 sa.Column('id', sa.Integer(), nullable=False),69 sa.Column('title', sa.String(length=80), nullable=True),70 sa.Column('route', sa.String(length=128), nullable=True),71 sa.Column('content', sa.Text(), nullable=True),72 sa.Column('draft', sa.Boolean(), nullable=True),73 sa.Column('hidden', sa.Boolean(), nullable=True),74 sa.Column('auth_required', sa.Boolean(), nullable=True),75 sa.PrimaryKeyConstraint('id'),76 sa.UniqueConstraint('route')77 )78 op.create_table('teams',79 sa.Column('id', sa.Integer(), nullable=False),80 sa.Column('oauth_id', sa.Integer(), nullable=True),81 sa.Column('name', sa.String(length=128), nullable=True),82 sa.Column('email', sa.String(length=128), nullable=True),83 sa.Column('password', sa.String(length=128), nullable=True),84 sa.Column('secret', sa.String(length=128), nullable=True),85 sa.Column('website', sa.String(length=128), nullable=True),86 sa.Column('affiliation', sa.String(length=128), nullable=True),87 sa.Column('country', sa.String(length=32), nullable=True),88 sa.Column('bracket', sa.String(length=32), nullable=True),89 sa.Column('hidden', sa.Boolean(), nullable=True),90 sa.Column('banned', sa.Boolean(), nullable=True),91 sa.Column('created', sa.DateTime(), nullable=True),92 sa.PrimaryKeyConstraint('id'),93 sa.UniqueConstraint('email'),94 sa.UniqueConstraint('id', 'oauth_id'),95 sa.UniqueConstraint('oauth_id')96 )97 op.create_table('dynamic_challenge',98 sa.Column('id', sa.Integer(), nullable=False),99 sa.Column('initial', sa.Integer(), nullable=True),100 sa.Column('minimum', sa.Integer(), nullable=True),101 sa.Column('decay', sa.Integer(), nullable=True),102 sa.ForeignKeyConstraint(['id'], ['challenges.id'], ),103 sa.PrimaryKeyConstraint('id')104 )105 op.create_table('files',106 sa.Column('id', sa.Integer(), nullable=False),107 sa.Column('type', sa.String(length=80), nullable=True),108 sa.Column('location', sa.Text(), nullable=True),109 sa.Column('challenge_id', sa.Integer(), nullable=True),110 sa.Column('page_id', sa.Integer(), nullable=True),111 sa.ForeignKeyConstraint(['challenge_id'], ['challenges.id'], ),112 sa.ForeignKeyConstraint(['page_id'], ['pages.id'], ),113 sa.PrimaryKeyConstraint('id')114 )115 op.create_table('flags',116 sa.Column('id', sa.Integer(), nullable=False),117 sa.Column('challenge_id', sa.Integer(), nullable=True),118 sa.Column('type', sa.String(length=80), nullable=True),119 sa.Column('content', sa.Text(), nullable=True),120 sa.Column('data', sa.Text(), nullable=True),121 sa.ForeignKeyConstraint(['challenge_id'], ['challenges.id'], ),122 sa.PrimaryKeyConstraint('id')123 )124 op.create_table('hints',125 sa.Column('id', sa.Integer(), nullable=False),126 sa.Column('type', sa.String(length=80), nullable=True),127 sa.Column('challenge_id', sa.Integer(), nullable=True),128 sa.Column('content', sa.Text(), nullable=True),129 sa.Column('cost', sa.Integer(), nullable=True),130 sa.Column('requirements', JSON, nullable=True),131 sa.ForeignKeyConstraint(['challenge_id'], ['challenges.id'], ),132 sa.PrimaryKeyConstraint('id')133 )134 op.create_table('tags',135 sa.Column('id', sa.Integer(), nullable=False),136 sa.Column('challenge_id', sa.Integer(), nullable=True),137 sa.Column('value', sa.String(length=80), nullable=True),138 sa.ForeignKeyConstraint(['challenge_id'], ['challenges.id'], ),139 sa.PrimaryKeyConstraint('id')140 )141 op.create_table('users',142 sa.Column('id', sa.Integer(), nullable=False),143 sa.Column('oauth_id', sa.Integer(), nullable=True),144 sa.Column('name', sa.String(length=128), nullable=True),145 sa.Column('password', sa.String(length=128), nullable=True),146 sa.Column('email', sa.String(length=128), nullable=True),147 sa.Column('type', sa.String(length=80), nullable=True),148 sa.Column('secret', sa.String(length=128), nullable=True),149 sa.Column('website', sa.String(length=128), nullable=True),150 sa.Column('affiliation', sa.String(length=128), nullable=True),151 sa.Column('country', sa.String(length=32), nullable=True),152 sa.Column('bracket', sa.String(length=32), nullable=True),153 sa.Column('hidden', sa.Boolean(), nullable=True),154 sa.Column('banned', sa.Boolean(), nullable=True),155 sa.Column('verified', sa.Boolean(), nullable=True),156 sa.Column('team_id', sa.Integer(), nullable=True),157 sa.Column('created', sa.DateTime(), nullable=True),158 sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ),159 sa.PrimaryKeyConstraint('id'),160 sa.UniqueConstraint('email'),161 sa.UniqueConstraint('id', 'oauth_id'),162 sa.UniqueConstraint('oauth_id')163 )164 op.create_table('awards',165 sa.Column('id', sa.Integer(), nullable=False),166 sa.Column('user_id', sa.Integer(), nullable=True),167 sa.Column('team_id', sa.Integer(), nullable=True),168 sa.Column('name', sa.String(length=80), nullable=True),169 sa.Column('description', sa.Text(), nullable=True),170 sa.Column('date', sa.DateTime(), nullable=True),171 sa.Column('value', sa.Integer(), nullable=True),172 sa.Column('category', sa.String(length=80), nullable=True),173 sa.Column('icon', sa.Text(), nullable=True),174 sa.Column('requirements', JSON, nullable=True),175 sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ),176 sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),177 sa.PrimaryKeyConstraint('id')178 )179 op.create_table('notifications',180 sa.Column('id', sa.Integer(), nullable=False),181 sa.Column('title', sa.Text(), nullable=True),182 sa.Column('content', sa.Text(), nullable=True),183 sa.Column('date', sa.DateTime(), nullable=True),184 sa.Column('user_id', sa.Integer(), nullable=True),185 sa.Column('team_id', sa.Integer(), nullable=True),186 sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ),187 sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),188 sa.PrimaryKeyConstraint('id')189 )190 op.create_table('submissions',191 sa.Column('id', sa.Integer(), nullable=False),192 sa.Column('challenge_id', sa.Integer(), nullable=True),193 sa.Column('user_id', sa.Integer(), nullable=True),194 sa.Column('team_id', sa.Integer(), nullable=True),195 sa.Column('ip', sa.String(length=46), nullable=True),196 sa.Column('provided', sa.Text(), nullable=True),197 sa.Column('type', sa.String(length=32), nullable=True),198 sa.Column('date', sa.DateTime(), nullable=True),199 sa.ForeignKeyConstraint(['challenge_id'], ['challenges.id'], ondelete='CASCADE'),200 sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ondelete='CASCADE'),201 sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),202 sa.PrimaryKeyConstraint('id')203 )204 op.create_table('tracking',205 sa.Column('id', sa.Integer(), nullable=False),206 sa.Column('type', sa.String(length=32), nullable=True),207 sa.Column('ip', sa.String(length=46), nullable=True),208 sa.Column('user_id', sa.Integer(), nullable=True),209 sa.Column('date', sa.DateTime(), nullable=True),210 sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),211 sa.PrimaryKeyConstraint('id')212 )213 op.create_table('unlocks',214 sa.Column('id', sa.Integer(), nullable=False),215 sa.Column('user_id', sa.Integer(), nullable=True),216 sa.Column('team_id', sa.Integer(), nullable=True),217 sa.Column('target', sa.Integer(), nullable=True),218 sa.Column('date', sa.DateTime(), nullable=True),219 sa.Column('type', sa.String(length=32), nullable=True),220 sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ),221 sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),222 sa.PrimaryKeyConstraint('id')223 )224 op.create_table('solves',225 sa.Column('id', sa.Integer(), nullable=False),226 sa.Column('challenge_id', sa.Integer(), nullable=True),227 sa.Column('user_id', sa.Integer(), nullable=True),228 sa.Column('team_id', sa.Integer(), nullable=True),229 sa.ForeignKeyConstraint(['challenge_id'], ['challenges.id'], ondelete='CASCADE'),230 sa.ForeignKeyConstraint(['id'], ['submissions.id'], ondelete='CASCADE'),231 sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ondelete='CASCADE'),232 sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),233 sa.PrimaryKeyConstraint('id'),234 sa.UniqueConstraint('challenge_id', 'team_id'),235 sa.UniqueConstraint('challenge_id', 'user_id')236 )237 # ### end Alembic commands ###238def downgrade():239 # ### commands auto generated by Alembic - please adjust! ###240 op.drop_table('solves')241 op.drop_table('unlocks')242 op.drop_table('tracking')243 op.drop_table('submissions')244 op.drop_table('notifications')245 op.drop_table('awards')246 op.drop_table('users')247 op.drop_table('tags')248 op.drop_table('hints')249 op.drop_table('flags')250 op.drop_table('files')251 op.drop_table('dynamic_challenge')252 op.drop_table('teams')253 op.drop_table('pages')254 op.drop_table('config')255 op.drop_table('challenges')...

Full Screen

Full Screen

001_kilo.py

Source:001_kilo.py Github

copy

Full Screen

1# Copyright 2015 OpenStack Foundation.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or12# implied.13# See the License for the specific language governing permissions and14# limitations under the License.15"""Kilo release16Revision ID: 00117Revises: None18Create Date: 2015-03-31 12:02:51.93536819"""20# revision identifiers, used by Alembic.21revision = '001'22down_revision = None23from alembic import op24import sqlalchemy as sa25from mistral.db.sqlalchemy import types as st26def upgrade():27 op.create_table(28 'workbooks_v2',29 sa.Column('created_at', sa.DateTime(), nullable=True),30 sa.Column('updated_at', sa.DateTime(), nullable=True),31 sa.Column('scope', sa.String(length=80), nullable=True),32 sa.Column('project_id', sa.String(length=80), nullable=True),33 sa.Column('id', sa.String(length=36), nullable=False),34 sa.Column('name', sa.String(length=80), nullable=True),35 sa.Column('definition', sa.Text(), nullable=True),36 sa.Column('spec', st.JsonEncoded(), nullable=True),37 sa.Column('tags', st.JsonEncoded(), nullable=True),38 sa.PrimaryKeyConstraint('id'),39 sa.UniqueConstraint('name', 'project_id')40 )41 op.create_table(42 'tasks',43 sa.Column('created_at', sa.DateTime(), nullable=True),44 sa.Column('updated_at', sa.DateTime(), nullable=True),45 sa.Column('id', sa.String(length=36), nullable=False),46 sa.Column('name', sa.String(length=80), nullable=True),47 sa.Column('requires', st.JsonEncoded(), nullable=True),48 sa.Column('workbook_name', sa.String(length=80), nullable=True),49 sa.Column('execution_id', sa.String(length=36), nullable=True),50 sa.Column('description', sa.String(length=200), nullable=True),51 sa.Column('task_spec', st.JsonEncoded(), nullable=True),52 sa.Column('action_spec', st.JsonEncoded(), nullable=True),53 sa.Column('state', sa.String(length=20), nullable=True),54 sa.Column('tags', st.JsonEncoded(), nullable=True),55 sa.Column('in_context', st.JsonEncoded(), nullable=True),56 sa.Column('parameters', st.JsonEncoded(), nullable=True),57 sa.Column('output', st.JsonEncoded(), nullable=True),58 sa.Column('task_runtime_context', st.JsonEncoded(), nullable=True),59 sa.PrimaryKeyConstraint('id')60 )61 op.create_table(62 'action_definitions_v2',63 sa.Column('created_at', sa.DateTime(), nullable=True),64 sa.Column('updated_at', sa.DateTime(), nullable=True),65 sa.Column('scope', sa.String(length=80), nullable=True),66 sa.Column('project_id', sa.String(length=80), nullable=True),67 sa.Column('id', sa.String(length=36), nullable=False),68 sa.Column('name', sa.String(length=80), nullable=True),69 sa.Column('definition', sa.Text(), nullable=True),70 sa.Column('spec', st.JsonEncoded(), nullable=True),71 sa.Column('tags', st.JsonEncoded(), nullable=True),72 sa.Column('description', sa.Text(), nullable=True),73 sa.Column('input', sa.Text(), nullable=True),74 sa.Column('action_class', sa.String(length=200), nullable=True),75 sa.Column('attributes', st.JsonEncoded(), nullable=True),76 sa.Column('is_system', sa.Boolean(), nullable=True),77 sa.PrimaryKeyConstraint('id'),78 sa.UniqueConstraint('name', 'project_id')79 )80 op.create_table(81 'workflow_definitions_v2',82 sa.Column('created_at', sa.DateTime(), nullable=True),83 sa.Column('updated_at', sa.DateTime(), nullable=True),84 sa.Column('scope', sa.String(length=80), nullable=True),85 sa.Column('project_id', sa.String(length=80), nullable=True),86 sa.Column('id', sa.String(length=36), nullable=False),87 sa.Column('name', sa.String(length=80), nullable=True),88 sa.Column('definition', sa.Text(), nullable=True),89 sa.Column('spec', st.JsonEncoded(), nullable=True),90 sa.Column('tags', st.JsonEncoded(), nullable=True),91 sa.PrimaryKeyConstraint('id'),92 sa.UniqueConstraint('name', 'project_id')93 )94 op.create_table(95 'executions_v2',96 sa.Column('created_at', sa.DateTime(), nullable=True),97 sa.Column('updated_at', sa.DateTime(), nullable=True),98 sa.Column('scope', sa.String(length=80), nullable=True),99 sa.Column('project_id', sa.String(length=80), nullable=True),100 sa.Column('type', sa.String(length=50), nullable=True),101 sa.Column('id', sa.String(length=36), nullable=False),102 sa.Column('name', sa.String(length=80), nullable=True),103 sa.Column('workflow_name', sa.String(length=80), nullable=True),104 sa.Column('spec', st.JsonEncoded(), nullable=True),105 sa.Column('state', sa.String(length=20), nullable=True),106 sa.Column('state_info', sa.String(length=1024), nullable=True),107 sa.Column('tags', st.JsonEncoded(), nullable=True),108 sa.Column('accepted', sa.Boolean(), nullable=True),109 sa.Column('input', st.JsonEncoded(), nullable=True),110 sa.Column('output', st.JsonLongDictType(), nullable=True),111 sa.Column('params', st.JsonEncoded(), nullable=True),112 sa.Column('context', st.JsonEncoded(), nullable=True),113 sa.Column('action_spec', st.JsonEncoded(), nullable=True),114 sa.Column('processed', sa.BOOLEAN(), nullable=True),115 sa.Column('in_context', st.JsonLongDictType(), nullable=True),116 sa.Column('published', st.JsonEncoded(), nullable=True),117 sa.Column('runtime_context', st.JsonEncoded(), nullable=True),118 sa.Column('task_execution_id', sa.String(length=36), nullable=True),119 sa.Column(120 'workflow_execution_id', sa.String(length=36), nullable=True121 ),122 sa.ForeignKeyConstraint(123 ['task_execution_id'], [u'executions_v2.id'],124 ),125 sa.ForeignKeyConstraint(126 ['workflow_execution_id'], [u'executions_v2.id'],127 ),128 sa.PrimaryKeyConstraint('id')129 )130 op.create_table(131 'workbooks',132 sa.Column('created_at', sa.DateTime(), nullable=True),133 sa.Column('updated_at', sa.DateTime(), nullable=True),134 sa.Column('id', sa.String(length=36), nullable=False),135 sa.Column('name', sa.String(length=80), nullable=False),136 sa.Column('definition', sa.Text(), nullable=True),137 sa.Column('description', sa.String(length=200), nullable=True),138 sa.Column('tags', st.JsonEncoded(), nullable=True),139 sa.Column('scope', sa.String(length=80), nullable=True),140 sa.Column('project_id', sa.String(length=80), nullable=True),141 sa.Column('trust_id', sa.String(length=80), nullable=True),142 sa.PrimaryKeyConstraint('id', 'name'),143 sa.UniqueConstraint('name')144 )145 op.create_table(146 'environments_v2',147 sa.Column('created_at', sa.DateTime(), nullable=True),148 sa.Column('updated_at', sa.DateTime(), nullable=True),149 sa.Column('scope', sa.String(length=80), nullable=True),150 sa.Column('project_id', sa.String(length=80), nullable=True),151 sa.Column('id', sa.String(length=36), nullable=False),152 sa.Column('name', sa.String(length=200), nullable=True),153 sa.Column('description', sa.Text(), nullable=True),154 sa.Column('variables', st.JsonEncoded(), nullable=True),155 sa.PrimaryKeyConstraint('id'),156 sa.UniqueConstraint('name', 'project_id')157 )158 op.create_table(159 'triggers',160 sa.Column('created_at', sa.DateTime(), nullable=True),161 sa.Column('updated_at', sa.DateTime(), nullable=True),162 sa.Column('id', sa.String(length=36), nullable=False),163 sa.Column('name', sa.String(length=80), nullable=False),164 sa.Column('pattern', sa.String(length=20), nullable=False),165 sa.Column('next_execution_time', sa.DateTime(), nullable=False),166 sa.Column('workbook_name', sa.String(length=80), nullable=False),167 sa.PrimaryKeyConstraint('id'),168 sa.UniqueConstraint('name')169 )170 op.create_table(171 'delayed_calls_v2',172 sa.Column('created_at', sa.DateTime(), nullable=True),173 sa.Column('updated_at', sa.DateTime(), nullable=True),174 sa.Column('id', sa.String(length=36), nullable=False),175 sa.Column(176 'factory_method_path', sa.String(length=200), nullable=True177 ),178 sa.Column('target_method_name', sa.String(length=80), nullable=False),179 sa.Column('method_arguments', st.JsonEncoded(), nullable=True),180 sa.Column('serializers', st.JsonEncoded(), nullable=True),181 sa.Column('auth_context', st.JsonEncoded(), nullable=True),182 sa.Column('execution_time', sa.DateTime(), nullable=False),183 sa.PrimaryKeyConstraint('id')184 )185 op.create_table(186 'workflow_executions',187 sa.Column('created_at', sa.DateTime(), nullable=True),188 sa.Column('updated_at', sa.DateTime(), nullable=True),189 sa.Column('id', sa.String(length=36), nullable=False),190 sa.Column('workbook_name', sa.String(length=80), nullable=True),191 sa.Column('task', sa.String(length=80), nullable=True),192 sa.Column('state', sa.String(length=20), nullable=True),193 sa.Column('context', st.JsonEncoded(), nullable=True),194 sa.PrimaryKeyConstraint('id')195 )196 op.create_table(197 'cron_triggers_v2',198 sa.Column('created_at', sa.DateTime(), nullable=True),199 sa.Column('updated_at', sa.DateTime(), nullable=True),200 sa.Column('scope', sa.String(length=80), nullable=True),201 sa.Column('project_id', sa.String(length=80), nullable=True),202 sa.Column('id', sa.String(length=36), nullable=False),203 sa.Column('name', sa.String(length=200), nullable=True),204 sa.Column('pattern', sa.String(length=100), nullable=True),205 sa.Column('next_execution_time', sa.DateTime(), nullable=False),206 sa.Column('workflow_name', sa.String(length=80), nullable=True),207 sa.Column('remaining_executions', sa.Integer(), nullable=True),208 sa.Column('workflow_id', sa.String(length=36), nullable=True),209 sa.Column('workflow_input', st.JsonEncoded(), nullable=True),210 sa.Column('workflow_input_hash', sa.CHAR(length=64), nullable=True),211 sa.Column('trust_id', sa.String(length=80), nullable=True),212 sa.ForeignKeyConstraint(213 ['workflow_id'], [u'workflow_definitions_v2.id'],214 ),215 sa.PrimaryKeyConstraint('id'),216 sa.UniqueConstraint('name', 'project_id'),217 sa.UniqueConstraint(218 'workflow_input_hash', 'workflow_name', 'pattern', 'project_id'219 )...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2const fs = require('fs');3const path = require('path');4const csv = require('csv-parser');5const csvWriter = require('csv-write-stream');6const writer = csvWriter();7const results = [];8const results2 = [];9const results3 = [];10const results4 = [];11const results5 = [];12const results6 = [];13const results7 = [];14const results8 = [];15const results9 = [];16const results10 = [];17const results11 = [];18const results12 = [];19const results13 = [];20const results14 = [];21const results15 = [];22const results16 = [];23const results17 = [];24const results18 = [];25const results19 = [];26const results20 = [];27const results21 = [];28const results22 = [];29const results23 = [];30const results24 = [];31const results25 = [];32const results26 = [];33const results27 = [];34const results28 = [];35const results29 = [];36const results30 = [];37const results31 = [];38const results32 = [];39const results33 = [];40const results34 = [];41const results35 = [];42const results36 = [];43const results37 = [];44const results38 = [];45const results39 = [];46const results40 = [];47const results41 = [];48const results42 = [];49const results43 = [];50const results44 = [];51const results45 = [];52const results46 = [];53const results47 = [];54const results48 = [];55const results49 = [];56const results50 = [];57const results51 = [];58const results52 = [];59const results53 = [];60const results54 = [];61const results55 = [];62const results56 = [];63const results57 = [];64const results58 = [];65const results59 = [];66const results60 = [];67const results61 = [];68const results62 = [];69const results63 = [];70const results64 = [];71const results65 = [];72const results66 = [];73const results67 = [];74const results68 = [];75const results69 = [];76const results70 = [];77const results71 = [];78const results72 = [];79const results73 = [];80const results74 = [];81const results75 = [];82const results76 = [];83const results77 = [];84const results78 = [];85const results79 = [];86const results80 = [];87const results81 = [];88const results82 = [];89const results83 = [];90const results84 = [];91const results85 = [];92const results86 = [];93const results87 = [];94const results88 = [];95const results89 = [];

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.log(err);4 console.log(data);5});6### WebPageTest(host, port, ssl, apiKey)7### WebPageTest#runTest(url, options, callback)8### WebPageTest#getLocations(callback)9### WebPageTest#getTesters(callback)10### WebPageTest#getTestStatus(testId, callback)11### WebPageTest#getTestResults(testId, callback)12### WebPageTest#getPageSpeedResults(testId, callback)13### WebPageTest#getRequestData(testId, callback)

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2wptoolkit.nullable('test', function (err, result) {3 if (err) {4 console.log('Error: ' + err);5 } else {6 console.log('Result: ' + result);7 }8});9* 2013-11-26   v0.2.0   Added nullable() method10* 2013-12-01   v0.3.0   Added get() method11* 2013-12-01   v0.4.0   Added get() method12* 2013-12-01   v0.5.0   Added get() method13* 2013-12-01   v0.6.0   Added get() method14* 2013-12-01   v0.7.0   Added get() method15* 2013-12-01   v0.8.0   Added get() method16* 2013-12-01   v0.9.0   Added get() method17* 2013-12-01   v0.10.0  Added get() method18* 2013-12-01   v0.11.0  Added get() method19* 2013-12-01   v0.12.0  Added get() method

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2const fs = require('fs');3const test = async () => {4 try {5 const page = await wptools.page('Barack Obama');6 const json = await page.json();7 console.log(json);8 fs.writeFile('./test.json', JSON.stringify(json), function(err) {9 if (err) throw err;10 console.log('complete');11 });12 } catch (err) {13 console.log(err);14 }15};16test();17const wptools = require('wptools');18const fs = require('fs');19const test = async () => {20 try {21 const page = await wptools.page('Barack Obama');22 const json = await page.json();23 console.log(json);24 fs.writeFile('./test2.json', JSON.stringify(json), function(err) {25 if (err) throw err;26 console.log('complete');27 });28 } catch (err) {29 console.log(err);30 }31};32test();

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2const express = require('express');3const app = express();4app.use(express.json());5app.use(express.urlencoded({extended: true}));6app.get('/', (req, res) => {7 res.sendFile('index.html', {root: __dirname});8});9app.post('/submit', (req, res) => {10 const data = req.body;11 const name = data.name;12 const url = data.url;13 let page = wptools.page(name, {apiUrl: url});14 page.get((err, info) => {15 if (err) {16 console.log(err);17 } else {18 console.log(info);19 res.send(info);20 }21 });22});23app.listen(3000, () => {24 console.log('Server started on port 3000');25});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var options = {3};4var webPageTest = new wpt(options);5webPageTest.runTest(testUrl, function (err, data) {6 if (err) {7 console.log(err);8 } else {9 console.log('Test submitted. Polling for results...');10 webPageTest.getTestResults(data.data.testId, function (err, data) {11 if (err) {12 console.log(err);13 } else {14 console.log('Test completed.');15 console.log('Test ID: ' + data.data.testId);16 console.log('Test URL: ' + data.data.summary);17 console.log('First View (ms): ' + data.data.median.firstView.loadTime);18 console.log('Repeat View (ms): ' + data.data.median.repeatView.loadTime);19 }20 });21 }22});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful