├── .editorconfig ├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature-request.md ├── .gitignore ├── .npmrc ├── .nvmrc ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── _v1 ├── .dockerignore ├── .editorconfig ├── .gitignore ├── .prettierignore ├── .travis.yml ├── LICENSE ├── PerformancOptimization.md ├── README.md ├── Restrictions.md ├── demoPackage │ ├── .npmignore │ ├── index.js │ ├── lib │ │ └── index.ts │ ├── package.json │ └── tsconfig.json ├── docker │ ├── test.Dockerfile │ ├── test.sh │ ├── tslint.Dockerfile │ └── tslint.sh ├── docs │ ├── AuthApiTest.paw │ ├── ErrorHandling.md │ ├── FullstackOneAuth.key │ ├── Migrations.md │ ├── NestedMutationPreferredSolution.md │ ├── NestedMutationSolutions.md │ ├── NestedMutationUseCases.md │ ├── TransactionalMutationsUsage.md │ ├── fullstack-one-security-concept.key │ └── pgAuthFunctions.md ├── examples │ ├── 1-orm-basic │ │ ├── config │ │ │ ├── default.js │ │ │ └── development.js │ │ ├── index.ts │ │ ├── models │ │ │ └── Task.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── schema │ │ │ └── schema.gql │ │ └── tsconfig.json │ ├── 2-orm-auth-graphql │ │ ├── README.md │ │ ├── config │ │ │ ├── default.js │ │ │ └── development.js │ │ ├── expression.ts │ │ ├── expressions-playground-new.ts │ │ ├── expressions-playground.ts │ │ ├── expressions │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── models │ │ │ ├── Photo.ts │ │ │ ├── Represent.ts │ │ │ ├── Task.ts │ │ │ └── User.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── schema │ │ │ └── schema.gql │ │ └── tsconfig.json │ ├── 3-orm-triggers │ │ ├── README.md │ │ ├── config │ │ │ ├── default.js │ │ │ └── development.js │ │ ├── index.ts │ │ ├── models │ │ │ └── Task.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── schema │ │ │ └── schema.gql │ │ └── tsconfig.json │ ├── 4-orm-computed-and-custom-columns │ │ ├── README.md │ │ ├── config │ │ │ ├── default.js │ │ │ └── development.js │ │ ├── expressions │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── models │ │ │ └── Task.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── schema │ │ │ └── schema.gql │ │ └── tsconfig.json │ ├── 5-file-storage │ │ ├── README.md │ │ ├── config │ │ │ ├── default.js │ │ │ └── development.js │ │ ├── expressions │ │ │ └── basic.ts │ │ ├── index.ts │ │ ├── models │ │ │ └── User.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── schema │ │ │ └── schema.gql │ ├── experimental │ │ ├── subscription_test │ │ │ ├── db.sql │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── package-lock.json │ │ │ └── package.json │ │ └── subscription_test_1 │ │ │ ├── db.sql │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── package-lock.json │ │ │ └── package.json │ └── fullstack-one-example │ │ ├── .editorconfig │ │ ├── .githooks │ │ └── pre-commit │ │ │ └── tslint │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── boot │ │ ├── 1.js │ │ └── 2.ts │ │ ├── config │ │ ├── default.js │ │ └── development.js │ │ ├── expressions │ │ └── basic.ts │ │ ├── index.ts │ │ ├── modules │ │ └── Randomizer │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── permissions │ │ ├── post.js │ │ └── user.js │ │ ├── resolvers │ │ ├── add.ts │ │ ├── getRandomValueOutOfArray.ts │ │ └── stripeAccount.ts │ │ ├── schema │ │ ├── AlleMeineEntchenSchwimmenAufDemSeeLaLaLaaaaaBlubBlub.gql │ │ ├── File.gql │ │ ├── Post.gql │ │ ├── UniqueDemo.gql │ │ ├── User.gql │ │ └── userPayload.json │ │ ├── test.js │ │ └── types.ts ├── index.ts ├── lerna.json ├── package-lock.json ├── package.json ├── packages │ ├── auth-fb-token │ │ ├── config │ │ │ └── default.js │ │ ├── docs │ │ │ ├── index.md │ │ │ ├── usageLocalStategy.md │ │ │ └── usageOauthStrategy.md │ │ ├── index.js │ │ ├── lib │ │ │ ├── fbHelper.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── schema.gql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── auth │ │ ├── Auth2Plan.md │ │ ├── config │ │ │ └── default.js │ │ ├── docs │ │ │ ├── Auth2Usage.md │ │ │ ├── index.md │ │ │ ├── usageLocalStategy.md │ │ │ └── usageOauthStrategy.md │ │ ├── index.js │ │ ├── lib │ │ │ ├── AccessTokenParser.ts │ │ │ ├── AuthConnector.ts │ │ │ ├── AuthProvider.ts │ │ │ ├── AuthProviders │ │ │ │ ├── AuthProviderEmail.ts │ │ │ │ ├── AuthProviderOAuth.ts │ │ │ │ └── AuthProviderPassword.ts │ │ │ ├── AuthQueryHelper.ts │ │ │ ├── CSRFProtection.ts │ │ │ ├── CryptoFactory.ts │ │ │ ├── Encoder.ts │ │ │ ├── SignHelper.ts │ │ │ ├── crypto.ts │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ ├── migrations │ │ │ │ ├── 1560266074875-InitialAuth.ts │ │ │ │ ├── 1560267333653-InitialAuthFunctions.ts │ │ │ │ ├── 1560267369283-InitialMetaAuth.ts │ │ │ │ └── index.ts │ │ │ └── oAuth.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── res │ │ │ ├── 1560266074875-auth-schema-and-tables │ │ │ │ ├── AuthFactor.table.down.sql │ │ │ │ ├── AuthFactor.table.up.sql │ │ │ │ ├── UserAuthentication.table.down.sql │ │ │ │ ├── UserAuthentication.table.up.sql │ │ │ │ ├── auth.schema.down.sql │ │ │ │ └── auth.schema.up.sql │ │ │ └── 1560267333653-auth-functions │ │ │ │ ├── auth.array_sort.function.sql │ │ │ │ ├── auth.authenticate_transaction.function.sql │ │ │ │ ├── auth.create_user_authentication.function.sql │ │ │ │ ├── auth.current_available_providers.function.sql │ │ │ │ ├── auth.current_provider_set.function.sql │ │ │ │ ├── auth.current_user_has_proofed_provider.function.sql │ │ │ │ ├── auth.current_user_id.function.sql │ │ │ │ ├── auth.current_user_id_or_null.function.sql │ │ │ │ ├── auth.find_user.function.sql │ │ │ │ ├── auth.get_auth_factor_for_proof.function.sql │ │ │ │ ├── auth.get_communication_address.function.sql │ │ │ │ ├── auth.get_communication_address_if_proofed.function.sql │ │ │ │ ├── auth.get_tenant_by_userid.function.sql │ │ │ │ ├── auth.get_user_authentication.function.sql │ │ │ │ ├── auth.get_user_authentication_by_id.function.sql │ │ │ │ ├── auth.invalidate_access_token.function.sql │ │ │ │ ├── auth.invalidate_all_access_tokens.function.sql │ │ │ │ ├── auth.is_admin.function.sql │ │ │ │ ├── auth.is_user_authentication_valid.function.sql │ │ │ │ ├── auth.login.function.sql │ │ │ │ ├── auth.modify_user_authentication.function.sql │ │ │ │ ├── auth.proof_auth_factor.function.sql │ │ │ │ ├── auth.refresh_access_token.function.sql │ │ │ │ ├── auth.set_admin.function.sql │ │ │ │ ├── auth.unauthenticate_transaction.function.sql │ │ │ │ └── auth.validate_access_token.function.sql │ │ ├── schema.gql │ │ ├── sql │ │ │ ├── 10000 │ │ │ │ └── meta.current_user_id_or_null.function.sql │ │ │ └── 20000 │ │ │ │ ├── auth.AUserAuthentication.table.sql │ │ │ │ ├── auth.AuthFactor.table.sql │ │ │ │ ├── auth.array_sort.function.sql │ │ │ │ ├── auth.authenticate_transaction.function.sql │ │ │ │ ├── auth.create_user_authentication.function.sql │ │ │ │ ├── auth.current_available_providers.function.sql │ │ │ │ ├── auth.current_provider_set.function.sql │ │ │ │ ├── auth.current_user_has_proofed_provider.function.sql │ │ │ │ ├── auth.current_user_id.function.sql │ │ │ │ ├── auth.current_user_id_or_null.function.sql │ │ │ │ ├── auth.find_user.function.sql │ │ │ │ ├── auth.get_auth_factor_for_proof.function.sql │ │ │ │ ├── auth.get_communication_address.function.sql │ │ │ │ ├── auth.get_communication_address_if_proofed.function.sql │ │ │ │ ├── auth.get_tenant_by_userid.function.sql │ │ │ │ ├── auth.get_user_authentication.function.sql │ │ │ │ ├── auth.get_user_authentication_by_id.function.sql │ │ │ │ ├── auth.invalidate_access_token.function.sql │ │ │ │ ├── auth.invalidate_all_access_tokens.function.sql │ │ │ │ ├── auth.is_admin.function.sql │ │ │ │ ├── auth.is_user_authentication_valid.function.sql │ │ │ │ ├── auth.login.function.sql │ │ │ │ ├── auth.modify_user_authentication.function.sql │ │ │ │ ├── auth.proof_auth_factor.function.sql │ │ │ │ ├── auth.refresh_access_token.function.sql │ │ │ │ ├── auth.schema.sql │ │ │ │ ├── auth.set_admin.function.sql │ │ │ │ ├── auth.validate_access_token.function.sql │ │ │ │ ├── meta.Auth.insert.sql │ │ │ │ └── meta.Auth.table.sql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── boot-scripts │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── db │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── IDbConfig.ts │ │ │ ├── createTriggers.ts │ │ │ ├── decorator │ │ │ │ ├── Column.ts │ │ │ │ ├── CreateDateColumn.ts │ │ │ │ ├── Entity.ts │ │ │ │ ├── Field.ts │ │ │ │ ├── ManyToOne.ts │ │ │ │ ├── OneToMany.ts │ │ │ │ ├── OneToOneJoinColumn.ts │ │ │ │ ├── PrimaryGeneratedColumn.ts │ │ │ │ ├── Type.ts │ │ │ │ ├── UpdateDateColumn.ts │ │ │ │ ├── decoratorFactoryColumn.ts │ │ │ │ └── index.ts │ │ │ ├── getClientManager.ts │ │ │ ├── gracefullyRemoveConnection.ts │ │ │ ├── index.ts │ │ │ ├── migrations │ │ │ │ ├── 1560087843421-Extensions.ts │ │ │ │ ├── 1560153367583-MetaInfoTable.ts │ │ │ │ ├── 1560153367683-MetaMigrationsTable.ts │ │ │ │ ├── 1560160652405-MetaPlv8JsModulesTable.ts │ │ │ │ ├── 1560161087095-MetaFunctions.ts │ │ │ │ ├── 1560162945204-SetPlv8StartProc.ts │ │ │ │ ├── 1560163271393-MetaInserts.ts │ │ │ │ ├── 1560164600721-MetaTypes.ts │ │ │ │ ├── 1560165051719-OperatorClassUuidOps.ts │ │ │ │ ├── 1560165600721-Audit.ts │ │ │ │ ├── index.ts │ │ │ │ └── plv8_modules.md │ │ │ └── model-meta │ │ │ │ ├── addTriggersFromEntityOptions.ts │ │ │ │ ├── check-and-adjust-column-options │ │ │ │ ├── adjustEnum.ts │ │ │ │ └── index.ts │ │ │ │ ├── generateSdl.ts │ │ │ │ ├── index.ts │ │ │ │ ├── logger.ts │ │ │ │ └── types.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── res │ │ │ ├── 1560161087095-meta-functions │ │ │ │ ├── get_last_generated_uuid.down.sql │ │ │ │ ├── get_last_generated_uuid.up.sql │ │ │ │ ├── jsonb_merge.down.sql │ │ │ │ ├── jsonb_merge.up.sql │ │ │ │ ├── make_table_immutable.down.sql │ │ │ │ ├── make_table_immutable.up.sql │ │ │ │ ├── plv8_require.down.sql │ │ │ │ ├── plv8_require.up.sql │ │ │ │ ├── sanitize.down.sql │ │ │ │ ├── sanitize.up.sql │ │ │ │ ├── strip_all_triggers.down.sql │ │ │ │ ├── strip_all_triggers.up.sql │ │ │ │ ├── triggerUpdateOrCreate.down.sql │ │ │ │ ├── triggerUpdateOrCreate.up.sql │ │ │ │ ├── uuid_generate_v4.down.sql │ │ │ │ ├── uuid_generate_v4.up.sql │ │ │ │ ├── validate.down.sql │ │ │ │ ├── validate.up.sql │ │ │ │ └── validator_santitize.md │ │ │ ├── 1560163271393-meta-inserts │ │ │ │ ├── info_version.down.sql │ │ │ │ ├── info_version.up.sql │ │ │ │ ├── plv8_rfc6902.down.sql │ │ │ │ ├── plv8_rfc6902.up.sql │ │ │ │ ├── plv8_validator.down.sql │ │ │ │ └── plv8_validator.up.sql │ │ │ └── 1560164600721-meta-types │ │ │ │ ├── locale.down.sql │ │ │ │ └── locale.up.sql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── events │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── file-storage │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── DefaultVerifier.ts │ │ │ ├── FileName.ts │ │ │ ├── IFileStorageConfig.ts │ │ │ ├── Verifier.ts │ │ │ ├── decorators.ts │ │ │ ├── fileColumnsAndTrigger.ts │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ ├── migrations │ │ │ │ ├── 1561973614862-FileStorage-Tables.ts │ │ │ │ ├── 1561973614863-FileStorage-Functions.ts │ │ │ │ └── index.ts │ │ │ └── parser.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── res │ │ │ └── 1561973614863-file-storage-functions │ │ │ │ ├── meta.file_clearup.function.sql │ │ │ │ ├── meta.file_clearupone.function.sql │ │ │ │ ├── meta.file_create.function.sql │ │ │ │ ├── meta.file_create_system.function.sql │ │ │ │ ├── meta.file_deleteone.function.sql │ │ │ │ ├── meta.file_deleteone_admin.function.sql │ │ │ │ ├── meta.file_get_type_to_verify.function.sql │ │ │ │ ├── meta.file_invalidate.function.sql │ │ │ │ ├── meta.file_todelete_by_entity.function.sql │ │ │ │ ├── meta.file_trigger.function.sql │ │ │ │ ├── meta.file_validate.function.sql │ │ │ │ └── meta.file_verify.function.sql │ │ ├── schema.gql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── graceful-shutdown │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── IGracefulShutdownConfig.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── graphql │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── GraphqlErrors.ts │ │ │ ├── IGraphQlConfig.ts │ │ │ ├── ReturnIdHandler.ts │ │ │ ├── RevertibleResult.ts │ │ │ ├── getDefaultResolvers │ │ │ │ ├── MutationBuilder │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── parseValue.ts │ │ │ │ │ ├── resolveCreateMutation.ts │ │ │ │ │ ├── resolveDeleteMutation.ts │ │ │ │ │ ├── resolveUpdateMutation.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── QueryBuilder │ │ │ │ │ ├── QueryBuild.ts │ │ │ │ │ ├── calculateMaxDepth.ts │ │ │ │ │ ├── generateClauses │ │ │ │ │ │ ├── getGenerateFilterFn.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── checks │ │ │ │ │ ├── checkCosts.ts │ │ │ │ │ └── checkQueryResultForInjection.ts │ │ │ │ ├── getDefaultMutationResolver.ts │ │ │ │ ├── getDefaultQueryResolver.ts │ │ │ │ ├── getTransactionMutationResolvers.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── index.ts │ │ │ ├── koaMiddleware.ts │ │ │ ├── logicalOperators │ │ │ │ ├── boolean.ts │ │ │ │ ├── equal.ts │ │ │ │ ├── helpers │ │ │ │ │ ├── getDuplicates.ts │ │ │ │ │ ├── getOperatorsDefinitionNode.ts │ │ │ │ │ └── getOperatorsSchemaExtension.ts │ │ │ │ ├── in.ts │ │ │ │ ├── index.ts │ │ │ │ ├── lessAndGreaterThan.ts │ │ │ │ ├── pattern.ts │ │ │ │ └── types.ts │ │ │ ├── operations │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ └── resolvers.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ ├── buildMutation.test.ts │ │ │ ├── buildQuery.test.ts │ │ │ ├── mutationBuildTestData │ │ │ │ ├── createTestData.ts │ │ │ │ ├── deleteTestData.ts │ │ │ │ ├── types.ts │ │ │ │ └── updateTestData.ts │ │ │ └── queryBuildTestData │ │ │ │ ├── filterArguments.ts │ │ │ │ ├── relationToManySelect.ts │ │ │ │ ├── relationToSingleSelect.ts │ │ │ │ ├── simple.ts │ │ │ │ ├── simpleWithAuthentication.ts │ │ │ │ └── types.ts │ │ └── tsconfig.json │ ├── helper │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── logger │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── notifications │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── NotificationsEmail.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── queue │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── schema-builder │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── createGraphQLViews.ts │ │ │ ├── db-schema-builder │ │ │ │ ├── IDbMeta.ts │ │ │ │ ├── IMigrationSqlObj.ts │ │ │ │ ├── createViewsFromDbMeta.ts │ │ │ │ ├── extensions │ │ │ │ │ └── versioning.ts │ │ │ │ ├── fromGQl │ │ │ │ │ ├── directiveParser │ │ │ │ │ │ ├── IDirectiveParser.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── gQlAstToDbMeta.ts │ │ │ │ │ ├── gQlAstToDbMetaHelper.ts │ │ │ │ │ └── initialDirectiveParser.ts │ │ │ │ ├── fromPg │ │ │ │ │ ├── pgToDbMeta.ts │ │ │ │ │ ├── queryParser │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── triggerParser │ │ │ │ │ │ └── index.ts │ │ │ │ ├── helper.ts │ │ │ │ ├── migrationObject.ts │ │ │ │ └── toPg │ │ │ │ │ ├── columnMigrationExtension │ │ │ │ │ ├── IColumnMigrationExtensions.ts │ │ │ │ │ └── index.ts │ │ │ │ │ ├── createSqlObjFromMigrationObject.ts │ │ │ │ │ └── tableMigrationExtension │ │ │ │ │ ├── ITableMigrationExtensions.ts │ │ │ │ │ └── index.ts │ │ │ ├── decorators │ │ │ │ ├── computedColumn.ts │ │ │ │ ├── custom.ts │ │ │ │ ├── index.ts │ │ │ │ └── permissions.ts │ │ │ ├── gql-schema-builder │ │ │ │ ├── createMutation.ts │ │ │ │ ├── createMutationArguments.ts │ │ │ │ ├── createSchemaBasics.ts │ │ │ │ ├── createTransactionMutations.ts │ │ │ │ ├── createViewBuilder │ │ │ │ │ ├── helpers.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── interfaces.ts │ │ │ │ ├── deleteViewBuilder │ │ │ │ │ ├── helpers.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── interfaces.ts │ │ │ │ ├── expressions │ │ │ │ │ ├── ExpressionCompiler.ts │ │ │ │ │ └── defineExpression.ts │ │ │ │ ├── extensions │ │ │ │ │ ├── computedParser.ts │ │ │ │ │ ├── customParser.ts │ │ │ │ │ ├── defaultParser.ts │ │ │ │ │ ├── idParser.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interfaces.ts │ │ │ │ │ ├── jsonParser.ts │ │ │ │ │ └── relationParser.ts │ │ │ │ ├── interfaces.ts │ │ │ │ ├── parsePermission.ts │ │ │ │ ├── parsePermissions.ts │ │ │ │ ├── readViewBuilder │ │ │ │ │ ├── createQuery.ts │ │ │ │ │ ├── createView.ts │ │ │ │ │ ├── defaultFieldCreator.ts │ │ │ │ │ ├── getFilterDefinitions.ts │ │ │ │ │ ├── getQueryArguments.ts │ │ │ │ │ ├── helpers.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── interfaces.ts │ │ │ │ ├── updateViewBuilder │ │ │ │ │ ├── helpers.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── interfaces.ts │ │ │ │ └── utils │ │ │ │ │ ├── createArrayField.ts │ │ │ │ │ ├── createIdArrayField.ts │ │ │ │ │ ├── createIdField.ts │ │ │ │ │ ├── createScalar.ts │ │ │ │ │ ├── getEnum.ts │ │ │ │ │ ├── getJsonObjectBuilderExpression.ts │ │ │ │ │ ├── getRelationMetasFromDefinition.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── interfaces.ts │ │ │ │ │ ├── parseDirectiveArguments.ts │ │ │ │ │ └── parseDirectives.ts │ │ │ ├── helper.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── sql │ │ │ └── 10000 │ │ │ │ ├── meta.create_version.function.sql │ │ │ │ ├── meta.get_last_generated_uuid.function.sql │ │ │ │ ├── meta.info.table.sql │ │ │ │ ├── meta.info.version.insert.sql │ │ │ │ ├── meta.jsonb_merge.function.sql │ │ │ │ ├── meta.locals.type.sql │ │ │ │ ├── meta.make_table_immutable.function.sql │ │ │ │ ├── meta.migrations.table.sql │ │ │ │ ├── meta.plv8_require.function.sql │ │ │ │ ├── meta.sanitize.function.sql │ │ │ │ ├── meta.schema.sql │ │ │ │ ├── meta.triggerUpdateOrCreate.function.sql │ │ │ │ ├── meta.uuid_generate_v4.function.sql │ │ │ │ ├── meta.validate.function.sql │ │ │ │ ├── meta.versioning_action.type.sql │ │ │ │ ├── pgcrypto.extension.sql │ │ │ │ ├── plv8.extension.sql │ │ │ │ ├── plv8_init.set.sql │ │ │ │ ├── plv8_js_modules.table.sql │ │ │ │ ├── plv8_modules.md │ │ │ │ ├── rfc6902.insert.sql │ │ │ │ ├── uuid-ossp.extension.sql │ │ │ │ ├── uuid_index.operator_class.sql │ │ │ │ ├── validator.insert.sql │ │ │ │ └── validator_santitize.md │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ └── server │ │ ├── config │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ └── test.ts │ │ └── tsconfig.json ├── tsconfig.json ├── tsconfig_packages.json └── tslint.json ├── _v1_mig3 ├── .gitignore ├── SDK_REQUIREMENTS.md ├── _v1 │ ├── examples │ │ ├── 1-orm-basic │ │ │ ├── config │ │ │ │ └── development.js │ │ │ └── package.json │ │ └── experimental │ │ │ └── subscription_test │ │ │ └── package-lock.json │ ├── package-lock.json │ ├── package.json │ └── packages │ │ ├── auth-fb-token │ │ ├── lib │ │ │ └── index.ts │ │ └── package.json │ │ ├── auth │ │ ├── config │ │ │ └── default.js │ │ ├── lib │ │ │ ├── AuthConnector.ts │ │ │ ├── AuthProvider.ts │ │ │ ├── AuthProviders │ │ │ │ ├── AuthProviderEmail.ts │ │ │ │ ├── AuthProviderOAuth.ts │ │ │ │ └── AuthProviderPassword.ts │ │ │ ├── AuthQueryHelper.ts │ │ │ ├── SignHelper.ts │ │ │ ├── index.ts │ │ │ └── interfaces.ts │ │ ├── package-lock.json │ │ ├── res │ │ │ └── 1560267333653-auth-functions │ │ │ │ ├── auth.array_sort.function.sql │ │ │ │ ├── auth.authenticate_transaction.function.sql │ │ │ │ ├── auth.create_user_authentication.function.sql │ │ │ │ ├── auth.current_user_id.function.sql │ │ │ │ ├── auth.current_user_id_or_null.function.sql │ │ │ │ ├── auth.find_user.function.sql │ │ │ │ ├── auth.get_auth_factor_for_proof.function.sql │ │ │ │ ├── auth.get_communication_address.function.sql │ │ │ │ ├── auth.get_communication_address_if_proofed.function.sql │ │ │ │ ├── auth.get_user_authentication.function.sql │ │ │ │ ├── auth.get_user_authentication_by_id.function.sql │ │ │ │ ├── auth.invalidate_access_token.function.sql │ │ │ │ ├── auth.invalidate_all_access_tokens.function.sql │ │ │ │ ├── auth.is_admin.function.sql │ │ │ │ ├── auth.is_user_authentication_valid.function.sql │ │ │ │ ├── auth.refresh_access_token.function.sql │ │ │ │ ├── auth.set_admin.function.sql │ │ │ │ ├── auth.unauthenticate_transaction.function.sql │ │ │ │ └── auth.validate_access_token.function.sql │ │ ├── schema.gql │ │ └── sql │ │ │ └── 20000 │ │ │ ├── auth.current_available_providers.function.sql │ │ │ ├── auth.current_provider_set.function.sql │ │ │ ├── auth.current_user_has_proofed_provider.function.sql │ │ │ ├── auth.get_tenant_by_userid.function.sql │ │ │ ├── auth.is_admin.function.sql │ │ │ ├── auth.login.function.sql │ │ │ ├── auth.modify_user_authentication.function.sql │ │ │ └── auth.proof_auth_factor.function.sql │ │ ├── boot-scripts │ │ ├── index.js │ │ └── tsconfig.json │ │ ├── db │ │ └── tsconfig.json │ │ ├── events │ │ ├── lib │ │ │ └── index.ts │ │ └── package.json │ │ ├── file-storage │ │ ├── config │ │ │ └── default.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package.json │ │ ├── res │ │ │ └── 1561973614863-file-storage-functions │ │ │ │ ├── meta.file_clearup.function.sql │ │ │ │ ├── meta.file_clearupone.function.sql │ │ │ │ ├── meta.file_create_system.function.sql │ │ │ │ ├── meta.file_deleteone.function.sql │ │ │ │ ├── meta.file_deleteone_admin.function.sql │ │ │ │ ├── meta.file_get_type_to_verify.function.sql │ │ │ │ ├── meta.file_trigger.function.sql │ │ │ │ ├── meta.file_validate.function.sql │ │ │ │ └── meta.file_verify.function.sql │ │ └── schema.gql │ │ ├── graphql │ │ ├── config │ │ │ └── default.js │ │ ├── lib │ │ │ ├── ReturnIdHandler.ts │ │ │ ├── RevertibleResult.ts │ │ │ ├── getDefaultResolvers │ │ │ │ ├── MutationBuilder │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── parseValue.ts │ │ │ │ │ ├── resolveCreateMutation.ts │ │ │ │ │ ├── resolveDeleteMutation.ts │ │ │ │ │ ├── resolveUpdateMutation.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── QueryBuilder │ │ │ │ │ ├── QueryBuild.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── checks │ │ │ │ │ └── checkCosts.ts │ │ │ │ ├── getDefaultMutationResolver.ts │ │ │ │ ├── getDefaultQueryResolver.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── index.ts │ │ │ ├── koaMiddleware.ts │ │ │ └── logicalOperators │ │ │ │ ├── boolean.ts │ │ │ │ ├── equal.ts │ │ │ │ ├── in.ts │ │ │ │ ├── index.ts │ │ │ │ ├── lessAndGreaterThan.ts │ │ │ │ ├── pattern.ts │ │ │ │ └── types.ts │ │ ├── package-lock.json │ │ └── package.json │ │ ├── notifications │ │ ├── lib │ │ │ └── NotificationsEmail.ts │ │ └── package.json │ │ ├── queue │ │ ├── lib │ │ │ └── index.ts │ │ └── package.json │ │ ├── schema-builder │ │ └── sql │ │ │ └── 10000 │ │ │ ├── meta.get_last_generated_uuid.function.sql │ │ │ └── meta.uuid_generate_v4.function.sql │ │ └── server │ │ ├── config │ │ └── default.js │ │ ├── lib │ │ └── index.ts │ │ ├── package-lock.json │ │ └── package.json ├── examples │ └── 1-one-basic │ │ ├── config │ │ ├── default.js │ │ └── development.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── dev.ts │ │ ├── example.ts │ │ ├── index.ts │ │ ├── main.ts │ │ ├── migrate.ts │ │ └── schema │ │ │ ├── expressions │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── tables │ │ │ ├── Comment │ │ │ └── index.ts │ │ │ ├── Post │ │ │ └── index.ts │ │ │ └── User │ │ │ └── index.ts │ │ └── tsconfig.json ├── packages │ ├── auth-fb-token │ │ ├── config │ │ │ └── default.js │ │ ├── docs │ │ │ ├── index.md │ │ │ ├── usageLocalStategy.md │ │ │ └── usageOauthStrategy.md │ │ ├── index.js │ │ ├── lib │ │ │ ├── fbHelper.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── schema.gql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── auth │ │ ├── Auth2Plan.md │ │ ├── config │ │ │ └── default.js │ │ ├── docs │ │ │ ├── Auth2Usage.md │ │ │ ├── index.md │ │ │ ├── usageLocalStategy.md │ │ │ └── usageOauthStrategy.md │ │ ├── index.js │ │ ├── lib │ │ │ ├── AccessTokenParser.ts │ │ │ ├── AuthConnector.ts │ │ │ ├── AuthProvider.ts │ │ │ ├── AuthProviders │ │ │ │ ├── AuthProviderEmail.ts │ │ │ │ ├── AuthProviderOAuth.ts │ │ │ │ └── AuthProviderPassword.ts │ │ │ ├── AuthQueryHelper.ts │ │ │ ├── CSRFProtection.ts │ │ │ ├── CryptoFactory.ts │ │ │ ├── Encoder.ts │ │ │ ├── SignHelper.ts │ │ │ ├── crypto.ts │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ ├── migration │ │ │ │ ├── ConfigMergeHelper.ts │ │ │ │ ├── basic.ts │ │ │ │ ├── defaultConfig.ts │ │ │ │ ├── index.ts │ │ │ │ └── tables.ts │ │ │ └── oAuth.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pgFunctions │ │ │ ├── auth.array_sort.function.sql │ │ │ ├── auth.authenticate_transaction.function.sql │ │ │ ├── auth.create_user_authentication.function.sql │ │ │ ├── auth.current_available_providers.function.sql │ │ │ ├── auth.current_provider_set.function.sql │ │ │ ├── auth.current_user_has_proofed_provider.function.sql │ │ │ ├── auth.current_user_id.function.sql │ │ │ ├── auth.current_user_id_or_null.function.sql │ │ │ ├── auth.find_user.function.sql │ │ │ ├── auth.get_auth_factor_for_proof.function.sql │ │ │ ├── auth.get_communication_address.function.sql │ │ │ ├── auth.get_communication_address_if_proofed.function.sql │ │ │ ├── auth.get_tenant_by_userid.function.sql │ │ │ ├── auth.get_user_authentication.function.sql │ │ │ ├── auth.get_user_authentication_by_id.function.sql │ │ │ ├── auth.invalidate_access_token.function.sql │ │ │ ├── auth.invalidate_all_access_tokens.function.sql │ │ │ ├── auth.is_admin.function.sql │ │ │ ├── auth.is_root.function.sql │ │ │ ├── auth.is_user_authentication_valid.function.sql │ │ │ ├── auth.login.function.sql │ │ │ ├── auth.modify_user_authentication.function.sql │ │ │ ├── auth.proof_auth_factor.function.sql │ │ │ ├── auth.refresh_access_token.function.sql │ │ │ ├── auth.set_admin.function.sql │ │ │ ├── auth.set_root.function.sql │ │ │ ├── auth.unauthenticate_transaction.function.sql │ │ │ └── auth.validate_access_token.function.sql │ │ ├── res │ │ │ └── 1560267333653-auth-functions │ │ │ │ └── auth.is_admin.function.sql │ │ ├── schema.gql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── config │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── IConfigObject.ts │ │ │ ├── IEnvironment.ts │ │ │ ├── errors │ │ │ │ ├── DefaultConfigNotFoundError.ts │ │ │ │ ├── MissingConfigPropertiesError.ts │ │ │ │ └── index.ts │ │ │ ├── helpers │ │ │ │ ├── ConfigMergeHelper.ts │ │ │ │ └── EnvironmentBuilder.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ ├── mock │ │ │ │ ├── application │ │ │ │ │ ├── config │ │ │ │ │ │ ├── default.js │ │ │ │ │ │ └── test.js │ │ │ │ │ └── package.json │ │ │ │ ├── module-config-bar │ │ │ │ │ └── default.js │ │ │ │ └── module-config-bat │ │ │ │ │ ├── default.js │ │ │ │ │ └── test.js │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── core │ │ ├── README.md │ │ ├── index.js │ │ ├── lib │ │ │ ├── demo.ts │ │ │ ├── demoModules.ts.temp │ │ │ ├── helpers.ts │ │ │ ├── index.ts │ │ │ └── interfaces.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json │ ├── di │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ └── tsconfig.json │ ├── events │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── file-storage │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── DefaultVerifier.ts │ │ │ ├── FileName.ts │ │ │ ├── IFileStorageConfig.ts │ │ │ ├── Verifier.ts │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ └── migration │ │ │ │ ├── ConfigMergeHelper.ts │ │ │ │ ├── basic.ts │ │ │ │ ├── defaultConfig.ts │ │ │ │ ├── fileColumnExtension │ │ │ │ └── index.ts │ │ │ │ ├── filePostProcessingExtension │ │ │ │ ├── index.ts │ │ │ │ ├── queries.ts │ │ │ │ └── queryHelper.ts │ │ │ │ ├── index.ts │ │ │ │ └── tables.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pgFunctions │ │ │ ├── file_storage.file_clearup.function.sql │ │ │ ├── file_storage.file_clearupone.function.sql │ │ │ ├── file_storage.file_create.function.sql │ │ │ ├── file_storage.file_create_system.function.sql │ │ │ ├── file_storage.file_deleteone.function.sql │ │ │ ├── file_storage.file_deleteone_admin.function.sql │ │ │ ├── file_storage.file_get_type_to_verify.function.sql │ │ │ ├── file_storage.file_invalidate.function.sql │ │ │ ├── file_storage.file_todelete_by_entity.function.sql │ │ │ ├── file_storage.file_trigger.function.sql │ │ │ ├── file_storage.file_trigger_plpgsql.function.sql │ │ │ ├── file_storage.file_validate.function.sql │ │ │ ├── file_storage.file_verify.function.sql │ │ │ └── file_storage.jsonb_arr2text_arr.function.sql │ │ ├── schema.gql │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── graphql │ │ ├── README.md │ │ ├── config │ │ │ └── default.js │ │ ├── gui-dist │ │ │ ├── arrow.28e30bbc.svg │ │ │ ├── arrow_down.3d6b8982.svg │ │ │ ├── gui-lib.3059ce00.js │ │ │ ├── gui-lib.3059ce00.js.map │ │ │ ├── gui-lib.e31bb0bc.css │ │ │ ├── gui-lib.e31bb0bc.css.map │ │ │ ├── gui-lib.e31bb0bc.js │ │ │ ├── gui-lib.e31bb0bc.js.map │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ └── index.js.map │ │ ├── gui-lib │ │ │ ├── FelaProvider.js │ │ │ ├── app.js │ │ │ ├── components │ │ │ │ ├── AddProperty │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Button │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Demo │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditExpressionParamTag │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditExpressionParams │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditExpressionStaticPlaceholderTag │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditIndexProperties │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditIndexPropertyTag │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditMutationColumnTag │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditProperties │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditProperty │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditPropertyTag │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── EditableText │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Header │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── HeaderButton │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Input │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Label │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── MultiSelect │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── PathList │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── PropertyBox │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── PropertyEdit │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── PropertyPopup │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── RenderProperty │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Section │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ ├── Select │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ └── TextArea │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ ├── constants │ │ │ │ └── colors.js │ │ │ ├── getFelaRenderer.js │ │ │ ├── img │ │ │ │ ├── arrow.svg │ │ │ │ └── arrow_down.svg │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── mock.js │ │ │ ├── styles.js │ │ │ ├── testColumnConfig.js │ │ │ ├── testModuleConfig.js │ │ │ └── views │ │ │ │ ├── ExpressionAppConfig │ │ │ │ ├── index.js │ │ │ │ └── style.js │ │ │ │ ├── GeneralAppConfig │ │ │ │ ├── index.js │ │ │ │ └── style.js │ │ │ │ ├── ModuleAppConfig │ │ │ │ ├── index.js │ │ │ │ └── style.js │ │ │ │ ├── ModuleConfig │ │ │ │ ├── index.js │ │ │ │ └── style.js │ │ │ │ └── TableAppConfig │ │ │ │ ├── index.js │ │ │ │ └── style.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── GraphqlErrors.ts │ │ │ ├── IGraphQlConfig.ts │ │ │ ├── RuntimeInterfaces.ts │ │ │ ├── basicMigration │ │ │ │ ├── basic.ts │ │ │ │ ├── index.ts │ │ │ │ └── tables.ts │ │ │ ├── getDefaultResolvers │ │ │ │ ├── MutationBuilder │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── parseValue.ts │ │ │ │ │ ├── resolveCreateMutation.ts │ │ │ │ │ ├── resolveDeleteMutation.ts │ │ │ │ │ ├── resolveUpdateMutation.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── QueryBuilder │ │ │ │ │ ├── ClausesBuilder │ │ │ │ │ │ ├── FilterBuilder.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── QueryBuild.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── checks │ │ │ │ │ ├── checkCosts.ts │ │ │ │ │ └── checkQueryResultForInjection.ts │ │ │ │ ├── getDefaultMutationResolver.ts │ │ │ │ ├── getDefaultQueryResolver.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── index.ts │ │ │ ├── koaMiddleware.ts │ │ │ ├── logicalOperators │ │ │ │ ├── boolean.ts │ │ │ │ ├── equal.ts │ │ │ │ ├── in.ts │ │ │ │ ├── index.ts │ │ │ │ ├── lessAndGreaterThan.ts │ │ │ │ ├── pattern.ts │ │ │ │ └── types.ts │ │ │ ├── migration │ │ │ │ ├── DbSchemaInterface.ts │ │ │ │ ├── DbSchemaValidator.ts │ │ │ │ ├── ExpressionCompiler.ts │ │ │ │ ├── ExpressionGenerator.ts │ │ │ │ ├── Migration.ts │ │ │ │ ├── columnExtensions │ │ │ │ │ ├── IColumnExtension.ts │ │ │ │ │ ├── computed │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── createdAt │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── enum │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── queries.ts │ │ │ │ │ │ └── queryHelper.ts │ │ │ │ │ ├── generic │ │ │ │ │ │ ├── factory.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── id │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── relation │ │ │ │ │ │ ├── manyToOne.ts │ │ │ │ │ │ ├── oneToMany.ts │ │ │ │ │ │ ├── queries.ts │ │ │ │ │ │ └── queryHelper.ts │ │ │ │ │ └── updatedAt │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── queries.ts │ │ │ │ │ │ └── queryHelper.ts │ │ │ │ ├── helpers.ts │ │ │ │ ├── interfaces.ts │ │ │ │ ├── permissions │ │ │ │ │ ├── MutationPermissionGenerator.ts │ │ │ │ │ ├── PermissionsGenerator.ts │ │ │ │ │ └── QueryPermissionGenerator.ts │ │ │ │ ├── postProcessingExtensions │ │ │ │ │ └── IPostProcessingExtension.ts │ │ │ │ ├── schemaExtensions │ │ │ │ │ ├── ISchemaExtension.ts │ │ │ │ │ ├── functions │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── schemas │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── tables │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── queries.ts │ │ │ │ │ │ └── queryHelper.ts │ │ │ │ └── tableExtensions │ │ │ │ │ ├── ITableExtension.ts │ │ │ │ │ ├── checks │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ │ │ ├── columns │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ │ │ └── indexes │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ ├── resolverTransactions │ │ │ │ ├── ReturnIdHandler.ts │ │ │ │ ├── RevertibleResult.ts │ │ │ │ ├── getTransactionMutationResolvers.ts │ │ │ │ ├── getTransactionMutationTypeDefs.ts │ │ │ │ └── index.ts │ │ │ └── schemaDefinition │ │ │ │ ├── column.ts │ │ │ │ ├── expression.ts │ │ │ │ ├── index.ts │ │ │ │ ├── schema.ts │ │ │ │ └── table.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── pgFunctions │ │ │ ├── graphql_meta.get_last_generated_uuid.function.sql │ │ │ ├── graphql_meta.updated_at_trigger.function.sql │ │ │ └── graphql_meta.uuid_generate_v4.function.sql │ │ ├── test │ │ │ ├── buildMutation.test.ts │ │ │ ├── buildQuery.test.ts │ │ │ ├── mutationBuildTestData │ │ │ │ ├── createTestData.ts │ │ │ │ ├── deleteTestData.ts │ │ │ │ ├── types.ts │ │ │ │ └── updateTestData.ts │ │ │ └── queryBuildTestData │ │ │ │ ├── filterArguments.ts │ │ │ │ ├── relationToManySelect.ts │ │ │ │ ├── relationToSingleSelect.ts │ │ │ │ ├── simple.ts │ │ │ │ ├── simpleWithAuthentication.ts │ │ │ │ └── types.ts │ │ └── tsconfig.json │ ├── logger │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── notifications │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── NotificationsEmail.ts │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ ├── queue │ │ ├── config │ │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ │ └── test.ts │ │ └── tsconfig.json │ └── server │ │ ├── config │ │ └── default.js │ │ ├── index.js │ │ ├── lib │ │ └── index.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── test │ │ └── test.ts │ │ └── tsconfig.json ├── test.ts ├── test2.ts └── testSdk │ └── index.ts ├── api-extractor-base.json ├── common ├── config │ └── rush │ │ ├── .npmrc │ │ ├── command-line.json │ │ ├── common-versions.json │ │ ├── experiments.json │ │ ├── pnpmfile.js │ │ ├── shrinkwrap.yaml │ │ └── version-policies.json ├── git-hooks │ └── pre-commit └── scripts │ ├── install-run-rush.js │ ├── install-run-rushx.js │ └── install-run.js ├── docs ├── .nojekyll ├── CNAME ├── RushCommands.md ├── _coverpage.md ├── assets │ └── soniq_logo.png └── index.html ├── examples ├── 01 │ ├── .npmrc │ ├── .nvmrc │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json └── 02 │ ├── .npmrc │ ├── .nvmrc │ ├── package.json │ ├── src │ ├── app │ │ ├── envs │ │ │ ├── dev.ts │ │ │ └── prod.ts │ │ └── index.ts │ ├── deploy.ts │ ├── index.ts │ ├── main.ts │ └── schema │ │ ├── expressions │ │ └── index.ts │ │ ├── index.ts │ │ ├── schema.ts │ │ └── tables │ │ ├── Comment │ │ └── index.ts │ │ ├── Post │ │ └── index.ts │ │ └── User │ │ └── index.ts │ └── tsconfig.json ├── jest.config.js ├── modules ├── _ExampleModule │ ├── .npmrc │ ├── .nvmrc │ ├── README.md │ ├── index.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── auth │ ├── .npmrc │ ├── .nvmrc │ ├── Auth2Plan.md │ ├── README.md │ ├── docs │ │ ├── Auth2Usage.md │ │ ├── index.md │ │ ├── usageLocalStategy.md │ │ └── usageOauthStrategy.md │ ├── index.js │ ├── jest.config.js │ ├── package.json │ ├── pgFunctions │ │ ├── auth.array_sort.function.sql │ │ ├── auth.authenticate_transaction.function.sql │ │ ├── auth.create_user_authentication.function.sql │ │ ├── auth.current_available_providers.function.sql │ │ ├── auth.current_provider_set.function.sql │ │ ├── auth.current_user_has_proofed_provider.function.sql │ │ ├── auth.current_user_id.function.sql │ │ ├── auth.current_user_id_or_null.function.sql │ │ ├── auth.find_user.function.sql │ │ ├── auth.get_auth_factor_for_proof.function.sql │ │ ├── auth.get_communication_address.function.sql │ │ ├── auth.get_communication_address_if_proofed.function.sql │ │ ├── auth.get_tenant_by_userid.function.sql │ │ ├── auth.get_user_authentication.function.sql │ │ ├── auth.get_user_authentication_by_id.function.sql │ │ ├── auth.invalidate_access_token.function.sql │ │ ├── auth.invalidate_all_access_tokens.function.sql │ │ ├── auth.is_admin.function.sql │ │ ├── auth.is_root.function.sql │ │ ├── auth.is_user_authentication_valid.function.sql │ │ ├── auth.login.function.sql │ │ ├── auth.modify_user_authentication.function.sql │ │ ├── auth.proof_auth_factor.function.sql │ │ ├── auth.refresh_access_token.function.sql │ │ ├── auth.set_admin.function.sql │ │ ├── auth.set_root.function.sql │ │ ├── auth.unauthenticate_transaction.function.sql │ │ └── auth.validate_access_token.function.sql │ ├── schema.gql │ ├── src │ │ ├── AccessTokenParser.ts │ │ ├── AuthConnector.ts │ │ ├── AuthProvider.ts │ │ ├── AuthProviders │ │ │ ├── AuthProviderEmail.ts │ │ │ ├── AuthProviderOAuth.ts │ │ │ └── AuthProviderPassword.ts │ │ ├── AuthQueryHelper.ts │ │ ├── CSRFProtection.ts │ │ ├── CryptoFactory.ts │ │ ├── Encoder.ts │ │ ├── SignHelper.ts │ │ ├── crypto.ts │ │ ├── index.ts │ │ ├── index_old.ts │ │ ├── interfaces.ts │ │ ├── migration │ │ │ ├── ConfigMergeHelper.ts │ │ │ ├── basic.ts │ │ │ ├── defaultConfig.ts │ │ │ ├── index.ts │ │ │ └── tables.ts │ │ ├── moduleDefinition.ts │ │ └── oAuth.js │ ├── test │ │ └── test.ts.out │ └── tsconfig.json ├── core │ ├── .npmrc │ ├── .nvmrc │ ├── README.md │ ├── index.js │ ├── jest.config.js │ ├── package.json │ ├── pnpm-lock.yaml │ ├── src │ │ ├── Application.ts │ │ ├── BootLoader │ │ │ └── index.ts │ │ ├── ConfigManager │ │ │ ├── IConfigObject.ts │ │ │ ├── IEnvironment.ts │ │ │ ├── errors │ │ │ │ ├── DefaultConfigNotFoundError.ts │ │ │ │ ├── MissingConfigPropertiesError.ts │ │ │ │ └── index.ts │ │ │ ├── helpers │ │ │ │ ├── ConfigMergeHelper.ts │ │ │ │ └── EnvironmentBuilder.ts │ │ │ └── index.ts │ │ ├── config │ │ │ └── default.ts │ │ ├── helpers.ts │ │ ├── index.ts │ │ └── interfaces.ts │ └── tsconfig.json ├── eslint-config │ ├── index.js │ ├── package.json │ └── prettier.config.js ├── graphql │ ├── .npmrc │ ├── .nvmrc │ ├── README.md │ ├── index.js │ ├── jest.config.js │ ├── package.json │ ├── pgFunctions │ │ ├── graphql_meta.get_last_generated_uuid.function.sql │ │ ├── graphql_meta.updated_at_trigger.function.sql │ │ └── graphql_meta.uuid_generate_v4.function.sql │ ├── src │ │ ├── GraphqlErrors.ts │ │ ├── RuntimeInterfaces.ts │ │ ├── basicMigration │ │ │ ├── basic.ts │ │ │ ├── index.ts │ │ │ └── tables.ts │ │ ├── getDefaultResolvers │ │ │ ├── MutationBuilder │ │ │ │ ├── index.ts │ │ │ │ ├── parseValue.ts │ │ │ │ ├── resolveCreateMutation.ts │ │ │ │ ├── resolveDeleteMutation.ts │ │ │ │ ├── resolveUpdateMutation.ts │ │ │ │ └── types.ts │ │ │ ├── QueryBuilder │ │ │ │ ├── ClausesBuilder │ │ │ │ │ ├── FilterBuilder.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── QueryBuild.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── checks │ │ │ │ ├── checkCosts.ts │ │ │ │ └── checkQueryResultForInjection.ts │ │ │ ├── getDefaultMutationResolver.ts │ │ │ ├── getDefaultQueryResolver.ts │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── hooks │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── index.ts │ │ ├── koaMiddleware.ts │ │ ├── logicalOperators │ │ │ ├── boolean.ts │ │ │ ├── equal.ts │ │ │ ├── in.ts │ │ │ ├── index.ts │ │ │ ├── lessAndGreaterThan.ts │ │ │ ├── pattern.ts │ │ │ └── types.ts │ │ ├── migration │ │ │ ├── DbSchemaInterface.ts │ │ │ ├── DbSchemaValidator.ts │ │ │ ├── ExpressionCompiler.ts │ │ │ ├── ExpressionGenerator.ts │ │ │ ├── Migration.ts │ │ │ ├── columnExtensions │ │ │ │ ├── IColumnExtension.ts │ │ │ │ ├── computed │ │ │ │ │ └── index.ts │ │ │ │ ├── createdAt │ │ │ │ │ └── index.ts │ │ │ │ ├── enum │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ │ ├── generic │ │ │ │ │ ├── factory.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── id │ │ │ │ │ └── index.ts │ │ │ │ ├── relation │ │ │ │ │ ├── manyToOne.ts │ │ │ │ │ ├── oneToMany.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ │ └── updatedAt │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ ├── helpers.ts │ │ │ ├── interfaces.ts │ │ │ ├── permissions │ │ │ │ ├── MutationPermissionGenerator.ts │ │ │ │ ├── PermissionsGenerator.ts │ │ │ │ ├── QueryPermissionGenerator.ts │ │ │ │ └── interfaces.ts │ │ │ ├── postProcessingExtensions │ │ │ │ └── IPostProcessingExtension.ts │ │ │ ├── schemaExtensions │ │ │ │ ├── ISchemaExtension.ts │ │ │ │ ├── functions │ │ │ │ │ └── index.ts │ │ │ │ ├── schemas │ │ │ │ │ └── index.ts │ │ │ │ └── tables │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── queries.ts │ │ │ │ │ └── queryHelper.ts │ │ │ └── tableExtensions │ │ │ │ ├── ITableExtension.ts │ │ │ │ ├── checks │ │ │ │ ├── index.ts │ │ │ │ ├── queries.ts │ │ │ │ └── queryHelper.ts │ │ │ │ ├── columns │ │ │ │ ├── index.ts │ │ │ │ ├── queries.ts │ │ │ │ └── queryHelper.ts │ │ │ │ └── indexes │ │ │ │ ├── index.ts │ │ │ │ ├── queries.ts │ │ │ │ └── queryHelper.ts │ │ ├── moduleDefinition │ │ │ ├── column.ts │ │ │ ├── expression.ts │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ ├── schema.ts │ │ │ └── table.ts │ │ └── resolverTransactions │ │ │ ├── ReturnIdHandler.ts │ │ │ ├── RevertibleResult.ts │ │ │ ├── getTransactionMutationResolvers.ts │ │ │ ├── getTransactionMutationTypeDefs.ts │ │ │ └── index.ts │ ├── test │ │ ├── buildMutation.test.ts.out │ │ ├── buildQuery.test.ts.out │ │ ├── mutationBuildTestData │ │ │ ├── createTestData.ts.out │ │ │ ├── deleteTestData.ts.out │ │ │ ├── types.ts.out │ │ │ └── updateTestData.ts.out │ │ └── queryBuildTestData │ │ │ ├── filterArguments.ts.out │ │ │ ├── relationToManySelect.ts.out │ │ │ ├── relationToSingleSelect.ts.out │ │ │ ├── simple.ts.out │ │ │ ├── simpleWithAuthentication.ts.out │ │ │ └── types.ts.out │ └── tsconfig.json └── server │ ├── .npmrc │ ├── .nvmrc │ ├── README.md │ ├── config │ └── default.js │ ├── index.js │ ├── jest.config.js │ ├── package.json │ ├── src │ ├── index.ts │ ├── interfaces.ts │ └── moduleDefinition │ │ └── index.ts │ └── tsconfig.json ├── rush.json └── tsconfig.json /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Describe feature or change proposals for the framework 4 | title: 'Feature Request: [Feature]' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Package** 11 | 12 | - auth 13 | - boot-loader / graceful-shutdown 14 | - config 15 | - db 16 | - events 17 | - file-storage 18 | - graphql 19 | - notifications 20 | - queue 21 | - schema-builder 22 | - server 23 | 24 | **Description / Use Case for a Feature** 25 | 26 | lorem ipsum 27 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "8.9.4" 4 | script: 5 | - set -e 6 | 7 | - echo 'Checking for missing change logs...' && echo -en 'travis_fold:start:change\\r' 8 | - git fetch origin master:refs/remotes/origin/master -a 9 | - node common/scripts/install-run-rush.js change -v 10 | - echo -en 'travis_fold:end:change\\r' 11 | 12 | - echo 'Installing...' && echo -en 'travis_fold:start:install\\r' 13 | - node common/scripts/install-run-rush.js install 14 | - echo -en 'travis_fold:end:install\\r' 15 | 16 | - echo 'Building...' && echo -en 'travis_fold:start:build\\r' 17 | - node common/scripts/install-run-rush.js rebuild --verbose 18 | - echo -en 'travis_fold:end:build\\r' 19 | -------------------------------------------------------------------------------- /_v1/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/node_modules 3 | **/dist -------------------------------------------------------------------------------- /_v1/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | **/dist/** -------------------------------------------------------------------------------- /_v1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | 5 | install: 6 | - npm install 7 | - npm run lerna-bootstrap 8 | - npm run build 9 | 10 | script: 11 | - npm run tslint 12 | - npm run coverage -------------------------------------------------------------------------------- /_v1/PerformancOptimization.md: -------------------------------------------------------------------------------- 1 | 2 | - Use a `TRUE` expression with `excludeFromPermissionExpressions = true` for PK's and FK's in all views. 3 | - Move often used queries into a computed column boolean expression, and query against that in gql. 4 | - Remove security_barrier from performance-critical views. (especially if you do have complex gql where conditions against huge tables) 5 | - If you only need a list of id's of a foreign 1:n entity, create a computed column which aggregates a list. (That saves one subquery (join)) 6 | - Try to avoid permissions, which depend on a column in the table. -------------------------------------------------------------------------------- /_v1/Restrictions.md: -------------------------------------------------------------------------------- 1 | - Update Permission is required to have column `id` 2 | - Delete Permission can only have column `id` 3 | - Application pg-user is not allowed to call `txid_current()` !VERY IMPORTANT! 4 | -------------------------------------------------------------------------------- /_v1/demoPackage/.npmignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | -------------------------------------------------------------------------------- /_v1/demoPackage/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/demoPackage/lib/index.ts: -------------------------------------------------------------------------------- 1 | export default function() { 2 | return true; 3 | } 4 | -------------------------------------------------------------------------------- /_v1/demoPackage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fullstack-one/demoPackage", 3 | "version": "0.0.1", 4 | "description": "fullstack.one demo package", 5 | "main": "dist/index.js", 6 | "types": "dist/index.d.ts", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "start": "echo \"Error: no start specified\" && exit 1", 10 | "build": "tsc" 11 | }, 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "keywords": [], 16 | "license": "MIT", 17 | "dependencies": {}, 18 | "devDependencies": {} 19 | } 20 | -------------------------------------------------------------------------------- /_v1/demoPackage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["ES2017"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false 15 | }, 16 | "exclude": [ 17 | "node_modules", 18 | "dist" 19 | ] 20 | } -------------------------------------------------------------------------------- /_v1/docker/test.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10.15 2 | 3 | RUN mkdir /fullstack-one 4 | 5 | WORKDIR /fullstack-one 6 | 7 | COPY package.json package.json 8 | COPY package-lock.json package-lock.json 9 | 10 | RUN npm install 11 | 12 | COPY lerna.json lerna.json 13 | 14 | COPY tsconfig.json tsconfig.json 15 | COPY tslint.json tslint.json 16 | COPY .prettierignore .prettierignore 17 | 18 | COPY index.ts index.ts 19 | COPY packages/ packages/ 20 | COPY examples/ examples/ 21 | 22 | RUN npm run lerna-bootstrap 23 | RUN npm run build 24 | 25 | CMD npm run test 26 | -------------------------------------------------------------------------------- /_v1/docker/test.sh: -------------------------------------------------------------------------------- 1 | TAG=one-test:latest 2 | NAME=one-test 3 | 4 | docker build -f docker/test.Dockerfile -t $TAG . 5 | 6 | docker run --rm -i -t --name "$NAME" $TAG 7 | -------------------------------------------------------------------------------- /_v1/docker/tslint.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10.15 2 | 3 | RUN mkdir /fullstack-one 4 | 5 | WORKDIR /fullstack-one 6 | 7 | COPY package.json package.json 8 | COPY package-lock.json package-lock.json 9 | 10 | RUN npm install 11 | 12 | COPY tsconfig.json tsconfig.json 13 | COPY tslint.json tslint.json 14 | COPY .prettierignore .prettierignore 15 | 16 | COPY index.ts index.ts 17 | COPY packages packages 18 | COPY examples examples 19 | 20 | CMD npm run tslint 21 | -------------------------------------------------------------------------------- /_v1/docker/tslint.sh: -------------------------------------------------------------------------------- 1 | TAG=one-tslint:latest 2 | NAME=one-tslint 3 | 4 | docker build -f docker/tslint.Dockerfile -t $TAG . 5 | 6 | docker run --rm -i -t --name "$NAME" $TAG 7 | -------------------------------------------------------------------------------- /_v1/docs/AuthApiTest.paw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fullstack-build/soniq/c18a280ba2601e4c020d9461bf500adaeb6058d0/_v1/docs/AuthApiTest.paw -------------------------------------------------------------------------------- /_v1/docs/FullstackOneAuth.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fullstack-build/soniq/c18a280ba2601e4c020d9461bf500adaeb6058d0/_v1/docs/FullstackOneAuth.key -------------------------------------------------------------------------------- /_v1/docs/fullstack-one-security-concept.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fullstack-build/soniq/c18a280ba2601e4c020d9461bf500adaeb6058d0/_v1/docs/fullstack-one-security-concept.key -------------------------------------------------------------------------------- /_v1/examples/1-orm-basic/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1/examples/1-orm-basic/models/Task.ts: -------------------------------------------------------------------------------- 1 | import { BaseEntity, Entity, Column, Check, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from "@fullstack-one/db"; 2 | 3 | @Entity() 4 | export default class Task extends BaseEntity { 5 | @PrimaryGeneratedColumn() 6 | public id: string; 7 | 8 | @CreateDateColumn() 9 | public readonly createdAt!: string; 10 | 11 | @UpdateDateColumn() 12 | public readonly updatedAt!: string; 13 | 14 | @Column({ gqlType: "String", type: "character varying", nullable: false }) 15 | public title!: string; 16 | 17 | @Column({ gqlType: "String", type: "character varying", nullable: true }) 18 | public solved?: string; 19 | } 20 | -------------------------------------------------------------------------------- /_v1/examples/1-orm-basic/schema/schema.gql: -------------------------------------------------------------------------------- 1 | extend type Mutation { 2 | 3 | """ 4 | Some Mutation 5 | """ 6 | someMutation: String! @custom(resolver: "someMutation") 7 | } 8 | 9 | extend type Query { 10 | 11 | """ 12 | Some Query 13 | """ 14 | someQuery: String! @custom(resolver: "someQuery") 15 | 16 | } -------------------------------------------------------------------------------- /_v1/examples/1-orm-basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es5", 5 | "es6" 6 | ], 7 | "target": "ES5", 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "outDir": "./build", 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "sourceMap": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_v1/examples/2-orm-auth-graphql/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1/examples/2-orm-auth-graphql/schema/schema.gql: -------------------------------------------------------------------------------- 1 | extend type Mutation { 2 | 3 | """ 4 | Some Mutation 5 | """ 6 | someMutation: String! @custom(resolver: "someMutation") 7 | } 8 | 9 | extend type Query { 10 | 11 | """ 12 | Some Query 13 | """ 14 | someQuery: String! @custom(resolver: "someQuery") 15 | 16 | } -------------------------------------------------------------------------------- /_v1/examples/2-orm-auth-graphql/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es5", 5 | "es6" 6 | ], 7 | "target": "ES5", 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "outDir": "./build", 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "sourceMap": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_v1/examples/3-orm-triggers/README.md: -------------------------------------------------------------------------------- 1 | # 3 Orm Triggers 2 | 3 | This example shows you how to add postgres trigger functions to a table. 4 | 5 | We have three pre-defined triggers for you, but you can add your own as well. 6 | 7 | You can add triggers via entity options. The pre-defined triggers `@Entity({ deletable: true, updatable: true, auditing: true })` are shown in the example model. 8 | -------------------------------------------------------------------------------- /_v1/examples/3-orm-triggers/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1/examples/3-orm-triggers/schema/schema.gql: -------------------------------------------------------------------------------- 1 | extend type Mutation { 2 | 3 | """ 4 | Some Mutation 5 | """ 6 | someMutation: String! @custom(resolver: "someMutation") 7 | } 8 | 9 | extend type Query { 10 | 11 | """ 12 | Some Query 13 | """ 14 | someQuery: String! @custom(resolver: "someQuery") 15 | 16 | } -------------------------------------------------------------------------------- /_v1/examples/3-orm-triggers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es5", 5 | "es6" 6 | ], 7 | "target": "ES5", 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "outDir": "./build", 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "sourceMap": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_v1/examples/4-orm-computed-and-custom-columns/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1/examples/4-orm-computed-and-custom-columns/schema/schema.gql: -------------------------------------------------------------------------------- 1 | extend type Mutation { 2 | 3 | """ 4 | Some Mutation 5 | """ 6 | someMutation: String! @custom(resolver: "someMutation") 7 | } 8 | 9 | extend type Query { 10 | 11 | """ 12 | Some Query 13 | """ 14 | someQuery: String! @custom(resolver: "someQuery") 15 | 16 | } -------------------------------------------------------------------------------- /_v1/examples/4-orm-computed-and-custom-columns/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es5", 5 | "es6" 6 | ], 7 | "target": "ES5", 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "outDir": "./build", 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "sourceMap": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_v1/examples/5-file-storage/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1/examples/experimental/subscription_test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "subscription_test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "Eugene (http://fullstack.build)", 10 | "dependencies": { 11 | "koa": "^2.5.3", 12 | "koa-compress": "^3.0.0", 13 | "koa-router": "^7.4.0", 14 | "koa-send": "^5.0.0", 15 | "pg": "^7.4.3", 16 | "sse": "0.0.8", 17 | "sse-node": "^1.0.2", 18 | "through": "^2.3.8" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /_v1/examples/experimental/subscription_test_1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "subscription_test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "Eugene (http://fullstack.build)", 10 | "dependencies": { 11 | "koa": "^2.5.3", 12 | "koa-compress": "^3.0.0", 13 | "koa-router": "^7.4.0", 14 | "koa-send": "^5.0.0", 15 | "pg": "^7.4.3", 16 | "sse": "0.0.8", 17 | "sse-node": "^1.0.2", 18 | "through": "^2.3.8" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/.githooks/pre-commit/tslint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pass=true 4 | RED='\033[1;31m' 5 | GREEN='\033[0;32m' 6 | NC='\033[0m' 7 | 8 | echo "Running TSLint:" 9 | 10 | # Run tslint and get the output and return code 11 | tslint=$(npm run tslint) 12 | ret_code=$? 13 | 14 | # If it didn't pass, announce it failed and print the output 15 | if [ $ret_code != 0 ]; then 16 | printf "\n${RED}tslint failed:${NC}" 17 | echo "$tslint\n" 18 | pass=false 19 | else 20 | printf "${GREEN}tslint passed.${NC}\n" 21 | fi 22 | 23 | # If there were no failures, it is good to commit 24 | if $pass; then 25 | exit 0 26 | fi 27 | 28 | exit 1 29 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/README.md: -------------------------------------------------------------------------------- 1 | # fullstack.one-example 2 | Example project using fullstack.one Framework 3 | 4 | ## Docker 5 | 6 | - *Build docker container* 7 | 8 | `docker build -t fullstack.one/example .` 9 | 10 | - *start docker container mounting local folder* 11 | 12 | `docker run -v $(pwd):/usr/src/app fullstack.one/example` 13 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/boot/1.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | default: (pFullstackOneCore) => { 3 | console.log("* boot script 1.ts", typeof pFullstackOneCore); 4 | } 5 | }; -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/boot/2.ts: -------------------------------------------------------------------------------- 1 | export default (pFullstackOneCore) => { 2 | console.log("** boot script 2.ts", typeof pFullstackOneCore); 3 | }; 4 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/modules/Randomizer/index.ts: -------------------------------------------------------------------------------- 1 | // DI 2 | import { Service, Inject } from "@fullstack-one/di"; 3 | 4 | interface IPossibleNumbers { 5 | values: string[]; 6 | } 7 | 8 | interface IRandomResult { 9 | randomResult: string; 10 | } 11 | 12 | @Service() 13 | export class Randomizer { 14 | public getRandomValueOutOfArray(possibleValues: IPossibleNumbers): IRandomResult { 15 | const maxIndex = possibleValues.values.length; 16 | const randomIndex = Math.floor(Math.random() * maxIndex); 17 | return { randomResult: possibleValues.values[randomIndex] }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/resolvers/add.ts: -------------------------------------------------------------------------------- 1 | import { ApolloError } from "apollo-server"; 2 | 3 | export default async (obj, args, context, info, params, f1) => { 4 | throw new ApolloError("MyMSG", "USERINPUTERROR", { bla: 7, huhu: ["a", "b", "c"] }); 5 | return { 6 | sum: args.a + args.b 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/resolvers/getRandomValueOutOfArray.ts: -------------------------------------------------------------------------------- 1 | import { Container } from "@fullstack-one/di"; 2 | 3 | // Impl DI 4 | import { Randomizer } from "../modules/Randomizer"; 5 | 6 | export default async (obj, args, context, info, params, f1) => { 7 | const randomizer = Container.get(Randomizer); 8 | return randomizer.getRandomValueOutOfArray(args.possibleValues); 9 | }; 10 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/resolvers/stripeAccount.ts: -------------------------------------------------------------------------------- 1 | export default (obj, args, context, info, $one) => { 2 | return new Promise((resolve, reject) => { 3 | setTimeout(() => { 4 | resolve("This is Stripe " + Math.random()); 5 | }, 100); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/schema/AlleMeineEntchenSchwimmenAufDemSeeLaLaLaaaaaBlubBlub.gql: -------------------------------------------------------------------------------- 1 | #type AlleMeineEntchenSchwimmenAufDemSeeLaLaLaaaaaBlubBlub @table @versioning{ 2 | # id: ID! @unique 3 | # createdAt: String @createdAt 4 | # updatedAt: String @updatedAt 5 | #} 6 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/schema/File.gql: -------------------------------------------------------------------------------- 1 | #type File @nonUpdatable @table { 2 | #type PrivateFile @nonUpdatable @table(schemaName: "private", tableName: "File") @migrate(from:"FileOld" fromSchema: "privateOld") { 3 | # id: ID! @unique 4 | # url: String 5 | # container: String @unique(name: "FileSource") 6 | # fileName: String! @unique(name: "FileSource") 7 | # owner: User! @relation(name: "FileOwner", onDelete: "restrict", onUpdate: "cascade") 8 | #} 9 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/schema/UniqueDemo.gql: -------------------------------------------------------------------------------- 1 | type UniqueDemo @table @versioning { 2 | id: ID! @unique 3 | updatedAt: String @updatedAt 4 | createdAt: String @createdAt 5 | 6 | simpleUnique: String @unique 7 | namedUnique: String @unique(name: "namedUnique") 8 | 9 | multipleUnique2: String @unique(name: "multipleUnique") 10 | multipleUnique1: String @unique(name: "multipleUnique") 11 | 12 | 13 | multipleUniqueExpression1: Boolean @unique(name: "multipleUniqueExpression") 14 | multipleUniqueExpression2: Boolean @unique(name: "multipleUniqueExpression" condition: "(\"multipleUniqueExpression1\" = true) AND (\"multipleUniqueExpression2\" = true)") 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /_v1/examples/fullstack-one-example/schema/userPayload.json: -------------------------------------------------------------------------------- 1 | JSON SCHEMA 2 | ... -------------------------------------------------------------------------------- /_v1/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./packages/fullstack-one"; 2 | -------------------------------------------------------------------------------- /_v1/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "lerna": "2.9.0", 3 | "packages": [ 4 | "examples/*", 5 | "packages/*" 6 | ], 7 | "version": "0.6.23", 8 | "command": { 9 | "init": { 10 | "exact": true 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /_v1/packages/auth-fb-token/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | fields: ["id", "email", "name", "last_name", "first_name", "middle_name"], 3 | baseURL: "https://graph.facebook.com/", 4 | userPath: "/me", 5 | debugTokenPath: "/debug_token", 6 | clientID: null, 7 | clientSecret: null 8 | }; 9 | -------------------------------------------------------------------------------- /_v1/packages/auth-fb-token/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/auth-fb-token/schema.gql: -------------------------------------------------------------------------------- 1 | 2 | extend type Mutation { 3 | 4 | """ 5 | Validates a Facebook-Token and generates AuthFactorCreationTokens or AuthFactorProofTokens. 6 | """ 7 | authenticateFacebookToken(token: String!, tenant: String): FacebookTokenAuthentication @custom(resolver: "@fullstack-one/auth-fb-token/authenticateFacebookToken") 8 | } 9 | 10 | type FacebookTokenAuthentication { 11 | email: String! 12 | profile: JSON 13 | authFactorProofTokens: FacebookAuthFactorTokens 14 | authFactorCreationTokens: FacebookAuthFactorTokens 15 | } 16 | 17 | type FacebookAuthFactorTokens { 18 | email: String! 19 | facebook: String! 20 | } 21 | -------------------------------------------------------------------------------- /_v1/packages/auth-fb-token/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/auth-fb-token/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/auth/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/auth/lib/migrations/index.ts: -------------------------------------------------------------------------------- 1 | import { InitialAuth1560266074875 } from "./1560266074875-InitialAuth"; 2 | import { InitialAuthFunctions1560267333653 } from "./1560267333653-InitialAuthFunctions"; 3 | import { InitialMetaAuth1560267369283 } from "./1560267369283-InitialMetaAuth"; 4 | 5 | export default [InitialAuth1560266074875, InitialAuthFunctions1560267333653, InitialMetaAuth1560267369283]; 6 | -------------------------------------------------------------------------------- /_v1/packages/auth/res/1560266074875-auth-schema-and-tables/AuthFactor.table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS _auth."AuthFactor"; 2 | -------------------------------------------------------------------------------- /_v1/packages/auth/res/1560266074875-auth-schema-and-tables/UserAuthentication.table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS _auth."UserAuthentication"; 2 | -------------------------------------------------------------------------------- /_v1/packages/auth/res/1560266074875-auth-schema-and-tables/auth.schema.down.sql: -------------------------------------------------------------------------------- 1 | DROP SCHEMA IF EXISTS _auth; 2 | -------------------------------------------------------------------------------- /_v1/packages/auth/res/1560266074875-auth-schema-and-tables/auth.schema.up.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA IF NOT EXISTS _auth; 2 | -------------------------------------------------------------------------------- /_v1/packages/auth/res/1560267333653-auth-functions/auth.array_sort.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _auth.array_sort (ANYARRAY) 2 | RETURNS ANYARRAY LANGUAGE SQL 3 | AS $$ 4 | SELECT ARRAY(SELECT unnest($1) ORDER BY 1) 5 | $$ STABLE; -------------------------------------------------------------------------------- /_v1/packages/auth/res/1560267333653-auth-functions/auth.set_admin.function.sql: -------------------------------------------------------------------------------- 1 | -- set_admin function sets a local for admin functions 2 | CREATE OR REPLACE FUNCTION _auth.set_admin(i_admin_token_secret TEXT) RETURNS void AS $$ 3 | DECLARE 4 | v_timestamp BIGINT; 5 | v_payload TEXT; 6 | v_admin_token TEXT; 7 | BEGIN 8 | v_timestamp := (round(extract(epoch from now())*1000))::bigint; 9 | 10 | v_payload := v_timestamp || ':' || i_admin_token_secret; 11 | 12 | v_admin_token := v_timestamp || ':' || encode(digest(v_payload, 'sha256'), 'hex'); 13 | 14 | EXECUTE format('set local auth.admin_token to %L', v_admin_token); 15 | END; 16 | $$ LANGUAGE plpgsql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1/packages/auth/sql/20000/auth.array_sort.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _auth.array_sort (ANYARRAY) 2 | RETURNS ANYARRAY LANGUAGE SQL 3 | AS $$ 4 | SELECT ARRAY(SELECT unnest($1) ORDER BY 1) 5 | $$ STABLE; -------------------------------------------------------------------------------- /_v1/packages/auth/sql/20000/auth.schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA IF NOT EXISTS _auth; 2 | -------------------------------------------------------------------------------- /_v1/packages/auth/sql/20000/auth.set_admin.function.sql: -------------------------------------------------------------------------------- 1 | -- set_admin function sets a local for admin functions 2 | CREATE OR REPLACE FUNCTION _auth.set_admin(i_admin_token_secret TEXT) RETURNS void AS $$ 3 | DECLARE 4 | v_timestamp BIGINT; 5 | v_payload TEXT; 6 | v_admin_token TEXT; 7 | BEGIN 8 | v_timestamp := (round(extract(epoch from now())*1000))::bigint; 9 | 10 | v_payload := v_timestamp || ':' || i_admin_token_secret; 11 | 12 | v_admin_token := v_timestamp || ':' || encode(digest(v_payload, 'sha256'), 'hex'); 13 | 14 | EXECUTE format('set local auth.admin_token to %L', v_admin_token); 15 | END; 16 | $$ LANGUAGE plpgsql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1/packages/auth/sql/20000/meta.Auth.table.sql: -------------------------------------------------------------------------------- 1 | -- DDL generated by Postico 1.5.6 2 | -- Not all database features are supported. Do not use for backup. 3 | 4 | -- Table Definition ---------------------------------------------- 5 | 6 | CREATE TABLE IF NOT EXISTS _meta."Auth" ( 7 | key character varying PRIMARY KEY, 8 | value character varying 9 | ); 10 | 11 | -- Indices ------------------------------------------------------- 12 | 13 | CREATE UNIQUE INDEX IF NOT EXISTS "Auth_pkey" ON _meta."Auth"(key text_ops); 14 | -------------------------------------------------------------------------------- /_v1/packages/auth/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/auth/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/boot-scripts/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/boot-scripts/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/boot-scripts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/db/README.md: -------------------------------------------------------------------------------- 1 | # @fullstack-one/db 2 | Packages for managing connections to Postgres 3 | 4 | This package includes a service for a postgres pool, called [DbGeneralPool](lib/DbGeneralPool/index.ts). The pool is used for GraphQl requests. Morover this package includes an ORM subpackage based on [typeorm](https://www.typeorm.io), which has its own pool. Other packages and the application can use the query runners of ORM using `const queryRunner = orm.createQueryRunner(); await queryRunner.connect(); queryRunner.query("SELECT ...")`. 5 | 6 | The pool size is gracefully adjusted depending on the number of connected nodes using `@fullstack-one/events`. -------------------------------------------------------------------------------- /_v1/packages/db/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | host: null, 3 | port: null, 4 | username: null, 5 | password: null, 6 | database: null, 7 | entities: [], 8 | synchronize: false, 9 | logging: false, 10 | min: 3, 11 | max: 5, 12 | globalMax: 100, 13 | updateClientListInterval: 10 * 1000 14 | }; -------------------------------------------------------------------------------- /_v1/packages/db/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/IDbConfig.ts: -------------------------------------------------------------------------------- 1 | import * as typeorm from "typeorm"; 2 | 3 | export interface IDbConfig { 4 | host: string; 5 | port: number; 6 | username: string; 7 | password: string; 8 | database: string; 9 | entities: Array any) | typeorm.EntitySchema>; 10 | synchronize: boolean; 11 | synchronizeGraphQl: boolean; 12 | logging: boolean; 13 | min: number; 14 | max: number; 15 | globalMax: number; 16 | updateClientListInterval: number; 17 | } 18 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/decorator/Column.ts: -------------------------------------------------------------------------------- 1 | import * as typeorm from "typeorm"; 2 | import * as ModelMeta from "../model-meta"; 3 | 4 | // tslint:disable-next-line:function-name 5 | export default function Column(options?: ModelMeta.TColumnOptions) { 6 | return (target: object, columnName: string): void => { 7 | const entityName = target.constructor.name; 8 | if (options != null) ModelMeta.addColumnOptions(entityName, columnName, options); 9 | 10 | const typeormDecorator = typeorm.Column(ModelMeta.getFinalColumnOptions(entityName, columnName)); 11 | typeormDecorator(target, columnName); 12 | ModelMeta.setColumnSynchronizedTrue(entityName, columnName); 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/decorator/Field.ts: -------------------------------------------------------------------------------- 1 | import * as ModelMeta from "../model-meta"; 2 | import { GqlScalarFieldType } from "../model-meta/types"; 3 | 4 | // tslint:disable-next-line:function-name 5 | export default function Field(gqlType: GqlScalarFieldType | string) { 6 | return (target: object, fieldName: string): void => { 7 | const typeName = target.constructor.name; 8 | ModelMeta.addField(typeName, fieldName, gqlType); 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/decorator/Type.ts: -------------------------------------------------------------------------------- 1 | import * as ModelMeta from "../model-meta"; 2 | 3 | // tslint:disable-next-line:function-name 4 | export default function Type() { 5 | return (target: any) => { 6 | const typeName = target.name; 7 | ModelMeta.addType(typeName); 8 | 9 | return target; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/migrations/1560153367583-MetaInfoTable.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface, QueryRunner } from "typeorm"; 2 | 3 | export class MetaInfoTable1560153367583 implements MigrationInterface { 4 | public async up(queryRunner: QueryRunner): Promise { 5 | await queryRunner.query(`CREATE TABLE IF NOT EXISTS "_meta"."info" ( 6 | key varchar NOT NULL, 7 | value varchar NOT NULL, 8 | CONSTRAINT info_pkey PRIMARY KEY (key) 9 | );`); 10 | } 11 | 12 | public async down(queryRunner: QueryRunner): Promise { 13 | await queryRunner.query(`DROP TABLE IF EXISTS "_meta"."info";`); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/migrations/1560153367683-MetaMigrationsTable.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface, QueryRunner } from "typeorm"; 2 | 3 | export class MetaMigrationsTable1560153367683 implements MigrationInterface { 4 | public async up(queryRunner: QueryRunner): Promise { 5 | await queryRunner.query(`CREATE TABLE IF NOT EXISTS "_meta"."migrations" ( 6 | "id" serial, 7 | "created_at" timestamp DEFAULT now(), 8 | "version" varchar, 9 | "state" jsonb, 10 | PRIMARY KEY ("id") 11 | );`); 12 | } 13 | 14 | public async down(queryRunner: QueryRunner): Promise { 15 | await queryRunner.query(`DROP TABLE IF EXISTS "_meta"."migrations";`); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/migrations/1560160652405-MetaPlv8JsModulesTable.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface, QueryRunner } from "typeorm"; 2 | 3 | export class MetaPlv8JsModulesTable1560160652405 implements MigrationInterface { 4 | public async up(queryRunner: QueryRunner): Promise { 5 | await queryRunner.query(`CREATE TABLE IF NOT EXISTS "_meta"."plv8_js_modules" ( 6 | module text unique primary key, 7 | autoload bool default true, 8 | source text 9 | );`); 10 | } 11 | 12 | public async down(queryRunner: QueryRunner): Promise { 13 | await queryRunner.query(`DROP TABLE IF EXISTS "_meta"."plv8_js_modules";`); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/migrations/1560162945204-SetPlv8StartProc.ts: -------------------------------------------------------------------------------- 1 | import { MigrationInterface, QueryRunner } from "typeorm"; 2 | 3 | export class SetPlv8StartProc1560162945204 implements MigrationInterface { 4 | public async up(queryRunner: QueryRunner): Promise { 5 | await queryRunner.query("SET plv8.start_proc = '_meta.plv8_require';"); 6 | } 7 | 8 | public async down(queryRunner: QueryRunner): Promise { 9 | await queryRunner.query("RESET plv8.start_proc;"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/migrations/plv8_modules.md: -------------------------------------------------------------------------------- 1 | ## PL/V8 modules 2 | * https://rymc.io/2016/03/22/a-deep-dive-into-plv8/ 3 | * https://github.com/JerrySievert/plv8-modules -------------------------------------------------------------------------------- /_v1/packages/db/lib/model-meta/check-and-adjust-column-options/index.ts: -------------------------------------------------------------------------------- 1 | import { TColumnOptions } from "../types"; 2 | import adjustEnum from "./adjustEnum"; 3 | 4 | export default function checkAndAdjustColumnOptions(columnOptions: TColumnOptions): TColumnOptions { 5 | adjustEnum(columnOptions); 6 | 7 | return columnOptions; 8 | } 9 | -------------------------------------------------------------------------------- /_v1/packages/db/lib/model-meta/logger.ts: -------------------------------------------------------------------------------- 1 | import { Container } from "@fullstack-one/di"; 2 | import { ILogger, LoggerFactory } from "@fullstack-one/logger"; 3 | 4 | const loggerFactory = Container.get(LoggerFactory); 5 | const logger: ILogger = loggerFactory.create("OrmModelMeta"); 6 | export default logger; 7 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/get_last_generated_uuid.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.get_last_generated_uuid(); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/get_last_generated_uuid.up.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _meta.get_last_generated_uuid() RETURNS uuid AS $$ 2 | DECLARE 3 | v_new_uuid TEXT; 4 | BEGIN 5 | 6 | v_new_uuid := current_setting('temp.new_uuid', true); 7 | 8 | -- Checks that the local variable is not null 9 | IF v_new_uuid IS NULL OR length(v_new_uuid) < 36 THEN 10 | RAISE EXCEPTION 'No uuid has been generated in this transaction.'; 11 | END IF; 12 | 13 | return v_new_uuid::uuid; 14 | END; 15 | $$ LANGUAGE plpgsql; 16 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/jsonb_merge.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.jsonb_merge(left JSONB, right JSONB); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/make_table_immutable.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.make_table_immutable(); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/make_table_immutable.up.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _meta.make_table_immutable() RETURNS trigger AS $$ 2 | BEGIN 3 | -- Raise exeption: immutable 4 | RAISE EXCEPTION 'immutable: Table is immutable.'; 5 | END; 6 | $$ LANGUAGE plpgsql STABLE; -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/plv8_require.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.plv8_require(); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/sanitize.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.sanitize(type text, value text, parameter text); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/sanitize.up.sql: -------------------------------------------------------------------------------- 1 | -- FUNCTION: _meta.sanitize(text, text, text) 2 | -- DROP FUNCTION _meta.sanitize(text, text, text); 3 | CREATE OR REPLACE FUNCTION _meta.sanitize( 4 | type text, 5 | value text, 6 | parameter text) 7 | RETURNS text 8 | LANGUAGE 'plv8' 9 | 10 | COST 100 11 | VOLATILE 12 | AS $BODY$ 13 | // init plv8 require 14 | plv8.execute( 'SELECT _meta.plv8_require();' ); 15 | 16 | var validator = require('validator'); 17 | // parse if parameter is json 18 | try { 19 | parameter = JSON.parse(parameter); 20 | } catch (e) {} 21 | 22 | return validator[type](value, parameter); 23 | 24 | $BODY$; 25 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/strip_all_triggers.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS "_meta".strip_all_triggers(); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/triggerUpdateOrCreate.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.triggerUpdateOrCreate(); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/triggerUpdateOrCreate.up.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _meta.triggerUpdateOrCreate() RETURNS trigger AS $$ 2 | NEW['updatedAt'] = plv8.execute( 'SELECT NOW() AT TIME ZONE \'UTC\' now;')[0].now; 3 | return NEW; 4 | $$ LANGUAGE plv8 STABLE; -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/uuid_generate_v4.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.uuid_generate_v4(); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/uuid_generate_v4.up.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE OR REPLACE FUNCTION _meta.uuid_generate_v4() RETURNS uuid AS $$ 3 | DECLARE 4 | v_new_uuid uuid; 5 | BEGIN 6 | v_new_uuid := uuid_generate_v4(); 7 | 8 | EXECUTE format('set local temp.new_uuid to %L', v_new_uuid); 9 | 10 | return v_new_uuid; 11 | END; 12 | $$ LANGUAGE plpgsql; -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/validate.down.sql: -------------------------------------------------------------------------------- 1 | DROP FUNCTION IF EXISTS _meta.validate(type text, value text, parameter text); 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560161087095-meta-functions/validator_santitize.md: -------------------------------------------------------------------------------- 1 | ## examples 2 | * SELECT _meta.validate('isEmail', 'test123@gmail.com', ''); 3 | * SELECT _meta.validate('contains', 'test123_gmail.com', 'test'); 4 | * SELECT _meta.validate('isAfter', '2017-12-11', '2017-12-10'); 5 | * SELECT _meta.validate('isFloat', '19.5', '{ "min": 7.22, "max": 9.55 }'); 6 | * SELECT _meta.sanitize('normalizeEmail', 'test@Gmail.com ', ''); 7 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560163271393-meta-inserts/info_version.down.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM "_meta"."info" WHERE "key" = 'version' AND "value" = '10000'; 2 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560163271393-meta-inserts/info_version.up.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO "_meta"."info"("key", "value") VALUES('version', '10000') 2 | ON CONFLICT ("key") DO UPDATE SET "value" = '10000'; 3 | -------------------------------------------------------------------------------- /_v1/packages/db/res/1560163271393-meta-inserts/plv8_rfc6902.down.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM "_meta"."plv8_js_modules" WHERE "module" = 'rfc6902'; -------------------------------------------------------------------------------- /_v1/packages/db/res/1560163271393-meta-inserts/plv8_validator.down.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM "_meta"."plv8_js_modules" WHERE "module" = 'validator'; -------------------------------------------------------------------------------- /_v1/packages/db/res/1560164600721-meta-types/locale.down.sql: -------------------------------------------------------------------------------- 1 | DROP TYPE IF EXISTS _meta.locale; -------------------------------------------------------------------------------- /_v1/packages/db/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/db/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/events/README.md: -------------------------------------------------------------------------------- 1 | # @fullstack-one/events 2 | Events system for fullstack-one packages and applications. 3 | 4 | You can emit events and add and remove event listeners for local and global events. 5 | 6 | - Local: All events emitted of the own node 7 | - Global: All events emitted with the same configured namespace and events database 8 | 9 | Please, find usage information in the [code](lib/index.ts). 10 | 11 | -------------------------------------------------------------------------------- /_v1/packages/events/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | eventEmitter: { 3 | delimiter: ".", 4 | newListener: false, 5 | maxListeners: 1000, 6 | verboseMemoryLeak: true 7 | }, 8 | pgClient: { 9 | database: null, 10 | host: null, 11 | user: null, 12 | password: null, 13 | port: 5432, 14 | ssl: false 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /_v1/packages/events/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/events/lib/types.ts: -------------------------------------------------------------------------------- 1 | export interface IEventEmitterConfig { 2 | eventEmitter: { 3 | delimiter: string; 4 | newListener: boolean; 5 | maxListeners: number; 6 | verboseMemoryLeak: boolean; 7 | }; 8 | pgClient: { 9 | database: string; 10 | host: string; 11 | user: string; 12 | password: string; 13 | port: number; 14 | ssl: boolean; 15 | }; 16 | } 17 | 18 | export interface IEvent { 19 | name: string; 20 | nodeId: string; 21 | payload?: TPayload; 22 | } 23 | 24 | export type TEventListener = (nodeId: string, payload?: TPayload) => void; 25 | -------------------------------------------------------------------------------- /_v1/packages/events/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/README.md: -------------------------------------------------------------------------------- 1 | # TODO: 2 | 3 | - [] After cleaning up migrations: Pass params from directive into the `FileFields` table, to be able to create Features like min, max. -------------------------------------------------------------------------------- /_v1/packages/file-storage/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | minio: { 3 | endPoint: null, 4 | region: "eu-central-1", 5 | port: 9000, 6 | useSSL: true, 7 | accessKey: null, 8 | secretKey: null 9 | }, 10 | bucket: null 11 | }; 12 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/lib/IFileStorageConfig.ts: -------------------------------------------------------------------------------- 1 | export default interface IFileStorageConfig { 2 | minio: { 3 | endPoint: string; 4 | region?: string; 5 | port: number; 6 | useSSL: boolean; 7 | accessKey: string; 8 | secretKey: string; 9 | }; 10 | bucket: string; 11 | } 12 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/lib/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface IUploadFile { 2 | extension: string; 3 | type: string; 4 | fileName: string; 5 | uploadFileName: string; 6 | presignedPutUrl: string; 7 | } 8 | 9 | export interface IBucketFile { 10 | fileName: string; 11 | objects: IBucketObject[]; 12 | } 13 | 14 | export interface IBucketObject { 15 | objectName: string; 16 | presignedGetUrl: string; 17 | info: string; 18 | } 19 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/lib/migrations/index.ts: -------------------------------------------------------------------------------- 1 | import { FileStorageTables1561973614862 } from "./1561973614862-FileStorage-Tables"; 2 | import { FileStorageFunctions1561973614863 } from "./1561973614863-FileStorage-Functions"; 3 | 4 | export default [FileStorageTables1561973614862, FileStorageFunctions1561973614863]; 5 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_clearup.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes all temporary files of a user which have not been added to an entity 3 | CREATE OR REPLACE FUNCTION _meta.file_clearup() RETURNS SETOF _meta."Files" AS $$ 4 | UPDATE _meta."Files" SET "deletedAt"=now() 5 | WHERE "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_clearupone.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes one temporary file which has not been added to an entity 3 | CREATE OR REPLACE FUNCTION _meta.file_clearupone(i_file_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | UPDATE _meta."Files" SET "deletedAt"=now() 5 | WHERE "id" = i_file_id AND "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_deleteone.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_deleteone function deletes one file finally => for usage after deleted from bucket 3 | CREATE OR REPLACE FUNCTION _meta.file_deleteone(i_file_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | DELETE FROM _meta."Files" 5 | WHERE "id" = i_file_id AND "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NOT NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_deleteone_admin.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_deleteone function deletes one file finally => for usage after deleted from bucket 3 | CREATE OR REPLACE FUNCTION _meta.file_deleteone_admin(i_file_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | DELETE FROM _meta."Files" 5 | WHERE "id" = i_file_id AND "entityId" IS NOT NULL AND "deletedAt" IS NOT NULL AND _auth.is_admin() = true 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_todelete_by_entity.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes all temporary files of a user which have not been added to an entity 3 | CREATE OR REPLACE FUNCTION _meta.file_todelete_by_entity(i_entity_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | SELECT * FROM _meta."Files" 5 | WHERE "entityId" = i_entity_id AND "deletedAt" IS NOT NULL AND _auth.is_admin() = true; 6 | $$ LANGUAGE sql SECURITY DEFINER STABLE; -------------------------------------------------------------------------------- /_v1/packages/file-storage/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/file-storage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/graceful-shutdown/README.md: -------------------------------------------------------------------------------- 1 | # @fullstack-one/graceful-shutdown 2 | Graceful shutdown for fullstack-one packages and applications. 3 | 4 | You can add graceful shutdown functions, that will be waited for when exiting the node. Please, find usage information in the [code](lib/index.ts). 5 | 6 | -------------------------------------------------------------------------------- /_v1/packages/graceful-shutdown/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | active: true, 3 | healthCheckLivenessPath: "/_health/liveness", 4 | healthCheckReadinessPath: "/_health/readiness" 5 | }; -------------------------------------------------------------------------------- /_v1/packages/graceful-shutdown/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/graceful-shutdown/lib/IGracefulShutdownConfig.ts: -------------------------------------------------------------------------------- 1 | export interface IGracefulShutdownConfig { 2 | active: boolean; 3 | healthCheckLivenessPath?: string; 4 | healthCheckReadinessPath?: string; 5 | } 6 | -------------------------------------------------------------------------------- /_v1/packages/graceful-shutdown/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/graceful-shutdown/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/graphql/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | endpoint: "/graphql", 3 | graphiQlEndpointActive: true, 4 | graphiQlEndpoint: "/graphiql", 5 | queryCostLimit: 2000000, 6 | minQueryDepthToCheckCostLimit: 3, 7 | resolversPattern: "/resolvers/*.ts" 8 | }; 9 | -------------------------------------------------------------------------------- /_v1/packages/graphql/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/GraphqlErrors.ts: -------------------------------------------------------------------------------- 1 | import { ApolloServer, AuthenticationError, ForbiddenError, UserInputError, ApolloError } from "apollo-server-koa"; 2 | 3 | export { ApolloServer, AuthenticationError, ForbiddenError, UserInputError, ApolloError }; 4 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/IGraphQlConfig.ts: -------------------------------------------------------------------------------- 1 | export default interface IGraphQlConfig { 2 | endpoint: string; 3 | graphiQlEndpointActive: boolean; 4 | graphiQlEndpoint: string; 5 | queryCostLimit: number; 6 | minQueryDepthToCheckCostLimit: number; 7 | resolversPattern: string; 8 | } 9 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/RevertibleResult.ts: -------------------------------------------------------------------------------- 1 | export class RevertibleResult { 2 | private result: any; 3 | private rollbackFunction: () => Promise; 4 | private onCommited: () => Promise | null; 5 | 6 | constructor(result: any, rollbackFunction: () => Promise, onCommited: () => Promise = null) { 7 | this.result = result; 8 | this.rollbackFunction = rollbackFunction; 9 | this.onCommited = onCommited; 10 | } 11 | 12 | public getResult() { 13 | return this.result; 14 | } 15 | 16 | public getRollbackFunction() { 17 | return this.rollbackFunction; 18 | } 19 | 20 | public getOnCommitedHandler() { 21 | return this.onCommited; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/getDefaultResolvers/MutationBuilder/parseValue.ts: -------------------------------------------------------------------------------- 1 | import { ReturnIdHandler } from "../../ReturnIdHandler"; 2 | 3 | export default function parseValue(value: any, returnIdHandler: ReturnIdHandler): string | null { 4 | if (value != null && typeof value === "object") { 5 | return JSON.stringify(value); 6 | } 7 | if (value == null) { 8 | return null; 9 | } 10 | return returnIdHandler.getReturnId(`${value}`); 11 | } 12 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/getDefaultResolvers/MutationBuilder/types.ts: -------------------------------------------------------------------------------- 1 | import { IMutationViewMeta } from "@fullstack-one/schema-builder"; 2 | 3 | export interface IMutationBuildObject { 4 | sql: string; 5 | values: string[]; 6 | mutation: IMutationViewMeta; 7 | id: any; 8 | } 9 | 10 | export interface IMutationInputObject { 11 | input: { 12 | [key: string]: any; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/getDefaultResolvers/QueryBuilder/calculateMaxDepth.ts: -------------------------------------------------------------------------------- 1 | import { ICostTree } from "./types"; 2 | 3 | export default function calculateMaxDepth({ type, subtrees }: ICostTree): number { 4 | const subDepth = subtrees.map(calculateMaxDepth).reduce((depth1, depth2) => depth1 + depth2, 0); 5 | const depthAddition = type === "aggregation" ? 1 : 0; 6 | return subDepth + depthAddition; 7 | } 8 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/hooks/types.ts: -------------------------------------------------------------------------------- 1 | import { PostgresQueryRunner } from "@fullstack-one/db"; 2 | 3 | import { IQueryBuildOject, IMutationBuildObject } from "../getDefaultResolvers"; 4 | 5 | export type TPreQueryHookFunction = ( 6 | queryRunner: PostgresQueryRunner, 7 | context: any, 8 | authRequired: boolean, 9 | buildObject: IMutationBuildObject | IQueryBuildOject 10 | ) => any; 11 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/logicalOperators/helpers/getDuplicates.ts: -------------------------------------------------------------------------------- 1 | export default function getDuplicates(values: string[]): string[] { 2 | const duplicates = []; 3 | const uniqueValues = []; 4 | values.forEach((value) => { 5 | if (uniqueValues.includes(value)) duplicates.push(value); 6 | else uniqueValues.push(value); 7 | }); 8 | return duplicates; 9 | } 10 | -------------------------------------------------------------------------------- /_v1/packages/graphql/lib/logicalOperators/helpers/getOperatorsSchemaExtension.ts: -------------------------------------------------------------------------------- 1 | import { IOperatorObject } from "../types"; 2 | 3 | export default function getOperatorsSchemaExtension(operatorsObject: IOperatorObject): string { 4 | return Object.values(operatorsObject) 5 | .map(({ schemaExtension }) => schemaExtension) 6 | .filter((schemaExtension) => schemaExtension != null) 7 | .join("\n"); 8 | } 9 | -------------------------------------------------------------------------------- /_v1/packages/graphql/test/mutationBuildTestData/types.ts: -------------------------------------------------------------------------------- 1 | import { IParsedResolveInfo, IMutationInputObject, IMutationBuildObject } from "../../lib/getDefaultResolvers/types"; 2 | import { IMutationViewMeta } from "@fullstack-one/schema-builder"; 3 | 4 | export interface IMutationBuildTestData { 5 | query: IParsedResolveInfo; 6 | mutation: IMutationViewMeta; 7 | expected: IMutationBuildObject; 8 | } 9 | -------------------------------------------------------------------------------- /_v1/packages/graphql/test/queryBuildTestData/types.ts: -------------------------------------------------------------------------------- 1 | import { IQueryBuildOject, IParsedResolveInfo, IQueryClauseObject } from "../../lib/getDefaultResolvers/types"; 2 | import { IResolverMeta, IDbMeta } from "@fullstack-one/schema-builder"; 3 | 4 | export interface IQueryBuildTestData { 5 | expected: IQueryBuildOject; 6 | query: IParsedResolveInfo; 7 | resolverMeta: IResolverMeta; 8 | dbMeta: IDbMeta; 9 | } 10 | -------------------------------------------------------------------------------- /_v1/packages/graphql/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/helper/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/helper/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fullstack-one/helper", 3 | "version": "0.6.23", 4 | "description": "fullstack.one helper package", 5 | "main": "index.js", 6 | "types": "lib/index.ts", 7 | "scripts": { 8 | "build": "tsc", 9 | "prepublishOnly": "npm run build" 10 | }, 11 | "publishConfig": { 12 | "access": "public" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/fullstack-build/fullstack.one.git" 17 | }, 18 | "keywords": [], 19 | "license": "MIT", 20 | "dependencies": { 21 | "@fullstack-one/di": "^0.6.23", 22 | "fast-glob": "^2.2.2" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /_v1/packages/helper/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/helper/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/logger/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | minLevel: "trace" 3 | }; 4 | -------------------------------------------------------------------------------- /_v1/packages/logger/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/logger/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/logger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/notifications/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/notifications/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { NotificationsEmail } from "./NotificationsEmail"; 2 | -------------------------------------------------------------------------------- /_v1/packages/notifications/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/notifications/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/queue/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // leaving this settings out will use a connection from the general pool 3 | //database: "", 4 | //host: "", 5 | //user: "", 6 | //password: "", 7 | //poolSize: 1, 8 | archiveCompletedJobsEvery: "2 days", 9 | //schema: "_queue" 10 | }; 11 | -------------------------------------------------------------------------------- /_v1/packages/queue/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/queue/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/queue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | schemaPattern: "/schema/*.{gql,graphql}", 3 | permissionsPattern: "/permissions/*.{js,ts}", 4 | expressionsPattern: "/expressions/*.{js,ts}", 5 | setUserPrivileges: false, 6 | createGraphQlViews: false 7 | }; 8 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/db-schema-builder/fromGQl/directiveParser/IDirectiveParser.ts: -------------------------------------------------------------------------------- 1 | // Directive Parser 2 | export interface IDirectiveParser { 3 | [name: string]: (gQlDirectiveNode, dbMetaNode, refDbMeta, refDbMetaCurrentTable, refDbMetaCurrentTableColumn) => void; 4 | } 5 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/db-schema-builder/fromPg/queryParser/index.ts: -------------------------------------------------------------------------------- 1 | import { IDbMeta } from "../../IDbMeta"; 2 | import { PostgresQueryRunner } from "@fullstack-one/db"; 3 | 4 | export type TQueryParser = (queryRunner: PostgresQueryRunner, dbMeta: IDbMeta) => void; 5 | 6 | const queryParsers: TQueryParser[] = []; 7 | 8 | export function registerQueryParser(queryParser: TQueryParser): void { 9 | queryParsers.push(queryParser); 10 | } 11 | 12 | export function getQueryParser(): TQueryParser[] { 13 | return queryParsers; 14 | } 15 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/db-schema-builder/fromPg/triggerParser/index.ts: -------------------------------------------------------------------------------- 1 | import { IDbMeta } from "../../IDbMeta"; 2 | 3 | const triggerParser = []; 4 | 5 | export function registerTriggerParser(callback: (trigger: any, dbMeta: IDbMeta, schemaName: string, tableName: string) => void): void { 6 | triggerParser.push(callback); 7 | } 8 | 9 | // return currently registered parser 10 | export function getTriggerParser(): any { 11 | return triggerParser; 12 | } 13 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/db-schema-builder/toPg/columnMigrationExtension/IColumnMigrationExtensions.ts: -------------------------------------------------------------------------------- 1 | export interface IColumnMigrationExtensions { 2 | [name: string]: (extensionDefinition, sqlMigrationObj, nodeSqlObj, schemaName, tableNameDown, tableNameUp) => void; 3 | } 4 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/db-schema-builder/toPg/tableMigrationExtension/ITableMigrationExtensions.ts: -------------------------------------------------------------------------------- 1 | export interface ITableMigrationExtensions { 2 | [name: string]: (extensionDefinition, sqlMigrationObj, nodeSqlObj, schemaName, tableNameDown, tableNameUp) => void; 3 | } 4 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/decorators/custom.ts: -------------------------------------------------------------------------------- 1 | import { createColumnDecoratorFactory } from "@fullstack-one/db"; 2 | 3 | interface IOptions { 4 | resolver: string; 5 | gqlType: string; 6 | } 7 | 8 | // tslint:disable-next-line:variable-name 9 | export const Custom = createColumnDecoratorFactory({ 10 | getDirective: ({ resolver }) => { 11 | return `@custom(resolver: "${resolver}")`; 12 | }, 13 | getColumnOptions: ({ gqlType }) => ({ gqlType }) 14 | }); 15 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/decorators/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./computedColumn"; 2 | export * from "./custom"; 3 | export * from "./permissions"; 4 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/createViewBuilder/interfaces.ts: -------------------------------------------------------------------------------- 1 | import { ObjectTypeDefinitionNode } from "graphql"; 2 | 3 | export interface ICreateView { 4 | gqlDefinitions: ObjectTypeDefinitionNode[]; 5 | meta: ICreateViewMeta; 6 | sql: any[]; 7 | } 8 | 9 | export interface ICreateViewMeta { 10 | name: string; 11 | viewSchemaName: string; 12 | viewName: string; 13 | type: "CREATE"; 14 | requiresAuth: boolean; 15 | gqlTypeName: string; 16 | gqlReturnTypeName: string; 17 | extensions: any; 18 | gqlInputTypeName: string; 19 | } 20 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/deleteViewBuilder/interfaces.ts: -------------------------------------------------------------------------------- 1 | import { ObjectTypeDefinitionNode } from "graphql"; 2 | 3 | export interface IDeleteView { 4 | gqlDefinitions: ObjectTypeDefinitionNode[]; 5 | meta: IDeleteViewMeta; 6 | sql: any[]; 7 | } 8 | 9 | export interface IDeleteViewMeta { 10 | name: string; 11 | viewSchemaName: string; 12 | viewName: string; 13 | type: "DELETE"; 14 | requiresAuth: boolean; 15 | gqlTypeName: string; 16 | gqlReturnTypeName: "ID"; 17 | extensions: any; 18 | gqlInputTypeName: string; 19 | } 20 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/expressions/defineExpression.ts: -------------------------------------------------------------------------------- 1 | import { IExpression } from "./ExpressionCompiler"; 2 | 3 | export const expressions: IExpression[] = []; 4 | 5 | export function defineExpression(expression: IExpression) { 6 | if (expressions.find(({ name }) => expression.name === name) != null) { 7 | throw new Error(`Expression with name '${expression.name}' aleady exists.`); 8 | } 9 | 10 | expressions.push(expression); 11 | 12 | return (params?: TParams) => ({ name: expression.name, params }); 13 | } 14 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/extensions/index.ts: -------------------------------------------------------------------------------- 1 | import { IParser } from "./interfaces"; 2 | import computedParser from "./computedParser"; 3 | import customParser from "./customParser"; 4 | import defaultParser from "./defaultParser"; 5 | import idParser from "./idParser"; 6 | import jsonParser from "./jsonParser"; 7 | import relationParser from "./relationParser"; 8 | 9 | export const extensions: IParser[] = [idParser, jsonParser, computedParser, customParser, relationParser, defaultParser]; 10 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/updateViewBuilder/interfaces.ts: -------------------------------------------------------------------------------- 1 | import { ObjectTypeDefinitionNode } from "graphql"; 2 | 3 | export interface IUpdateView { 4 | gqlDefinitions: ObjectTypeDefinitionNode[]; 5 | meta: IUpdateViewMeta; 6 | sql: any[]; 7 | } 8 | 9 | export interface IUpdateViewMeta { 10 | name: string; 11 | viewSchemaName: string; 12 | viewName: string; 13 | type: "UPDATE"; 14 | requiresAuth: boolean; 15 | gqlTypeName: string; 16 | gqlReturnTypeName: string; 17 | extensions: any; 18 | gqlInputTypeName: string; 19 | } 20 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/utils/createArrayField.ts: -------------------------------------------------------------------------------- 1 | import { FieldDefinitionNode } from "graphql"; 2 | 3 | export function createArrayField(fieldName: string, type: string): FieldDefinitionNode { 4 | return { 5 | kind: "FieldDefinition", 6 | name: { 7 | kind: "Name", 8 | value: fieldName 9 | }, 10 | arguments: [], 11 | type: { 12 | kind: "ListType", 13 | type: { 14 | kind: "NonNullType", 15 | type: { 16 | kind: "NamedType", 17 | name: { 18 | kind: "Name", 19 | value: type 20 | } 21 | } 22 | } 23 | }, 24 | directives: [] 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/utils/createScalar.ts: -------------------------------------------------------------------------------- 1 | import { ScalarTypeDefinitionNode } from "graphql"; 2 | 3 | export function createScalar(name: string): ScalarTypeDefinitionNode { 4 | return { 5 | kind: "ScalarTypeDefinition", 6 | name: { 7 | kind: "Name", 8 | value: name 9 | }, 10 | directives: [] 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/utils/index.ts: -------------------------------------------------------------------------------- 1 | export { createIdArrayField } from "./createIdArrayField"; 2 | export { createIdField } from "./createIdField"; 3 | export { createScalar } from "./createScalar"; 4 | export { getJsonObjectBuilderExpression } from "./getJsonObjectBuilderExpression"; 5 | export { getEnum } from "./getEnum"; 6 | export { parseDirectiveArguments } from "./parseDirectiveArguments"; 7 | export { parseDirectives } from "./parseDirectives"; 8 | export { createArrayField } from "./createArrayField"; 9 | export { getRelationMetasFromDefinition } from "./getRelationMetasFromDefinition"; 10 | 11 | export { IDirectivesObject } from "./interfaces"; 12 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/utils/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface IDirectivesObject { 2 | [directiveName: string]: any; 3 | } 4 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/lib/gql-schema-builder/utils/parseDirectives.ts: -------------------------------------------------------------------------------- 1 | import { DirectiveNode } from "graphql"; 2 | import { IDirectivesObject } from "./interfaces"; 3 | import { parseDirectiveArguments } from "./parseDirectiveArguments"; 4 | 5 | export function parseDirectives(directiveNodes: ReadonlyArray): IDirectivesObject { 6 | const directivesObject: IDirectivesObject = {}; 7 | 8 | directiveNodes.forEach((directive) => { 9 | directivesObject[directive.name.value] = parseDirectiveArguments(directive); 10 | }); 11 | 12 | return directivesObject; 13 | } 14 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.get_last_generated_uuid.function.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE OR REPLACE FUNCTION _meta.get_last_generated_uuid() RETURNS uuid AS $$ 3 | DECLARE 4 | v_new_uuid TEXT; 5 | BEGIN 6 | 7 | v_new_uuid := current_setting('temp.new_uuid', true); 8 | 9 | -- Checks that the local variable is not null 10 | IF v_new_uuid IS NULL OR length(v_new_uuid) < 36 THEN 11 | RAISE EXCEPTION 'No uuid has been generated in this transaction.'; 12 | END IF; 13 | 14 | return v_new_uuid::uuid; 15 | END; 16 | $$ LANGUAGE plpgsql; -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.info.table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS _meta.info 2 | ( 3 | key varchar NOT NULL, 4 | value varchar NOT NULL, 5 | CONSTRAINT info_pkey PRIMARY KEY (key) 6 | ); 7 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.info.version.insert.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO "_meta"."info"("key", "value") VALUES('version', '10000') 2 | ON CONFLICT ("key") DO UPDATE SET "value" = '10000'; 3 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.make_table_immutable.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _meta.make_table_immutable() RETURNS trigger AS $$ 2 | BEGIN 3 | -- Raise exeption: immutable 4 | RAISE EXCEPTION 'immutable: Table is immutable.'; 5 | END; 6 | $$ LANGUAGE plpgsql STABLE; -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.migrations.table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS "_meta"."migrations" ( 2 | "id" serial, 3 | "created_at" timestamp DEFAULT now(), 4 | "version" varchar, 5 | "state" jsonb, 6 | PRIMARY KEY ("id") 7 | ); 8 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.sanitize.function.sql: -------------------------------------------------------------------------------- 1 | -- FUNCTION: _meta.sanitize(text, text, text) 2 | -- DROP FUNCTION _meta.sanitize(text, text, text); 3 | CREATE OR REPLACE FUNCTION _meta.sanitize( 4 | type text, 5 | value text, 6 | parameter text) 7 | RETURNS text 8 | LANGUAGE 'plv8' 9 | 10 | COST 100 11 | VOLATILE 12 | AS $BODY$ 13 | // init plv8 require 14 | plv8.execute( 'SELECT _meta.plv8_require();' ); 15 | 16 | var validator = require('validator'); 17 | // parse if parameter is json 18 | try { 19 | parameter = JSON.parse(parameter); 20 | } catch (e) {} 21 | 22 | return validator[type](value, parameter); 23 | 24 | $BODY$; 25 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.schema.sql: -------------------------------------------------------------------------------- 1 | CREATE SCHEMA IF NOT EXISTS _meta; 2 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.triggerUpdateOrCreate.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _meta.triggerUpdateOrCreate() RETURNS trigger AS $$ 2 | NEW['updatedAt'] = plv8.execute( 'SELECT NOW() AT TIME ZONE \'UTC\' now;')[0].now; 3 | return NEW; 4 | $$ LANGUAGE plv8 STABLE; -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.uuid_generate_v4.function.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE OR REPLACE FUNCTION _meta.uuid_generate_v4() RETURNS uuid AS $$ 3 | DECLARE 4 | v_new_uuid uuid; 5 | BEGIN 6 | v_new_uuid := uuid_generate_v4(); 7 | 8 | EXECUTE format('set local temp.new_uuid to %L', v_new_uuid); 9 | 10 | return v_new_uuid; 11 | END; 12 | $$ LANGUAGE plpgsql; -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/meta.versioning_action.type.sql: -------------------------------------------------------------------------------- 1 | CREATE TYPE _meta.versioning_action AS ENUM ('INSERT', 'UPDATE', 'DELETE'); 2 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/pgcrypto.extension.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTENSION IF NOT EXISTS "pgcrypto"; 2 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/plv8.extension.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTENSION IF NOT EXISTS "plv8"; 2 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/plv8_init.set.sql: -------------------------------------------------------------------------------- 1 | -- PL/v8 supports a "start proc" variable that can act as a bootstrap function. 2 | SET plv8.start_proc = '_meta.plv8_require'; -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/plv8_js_modules.table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS _meta.plv8_js_modules ( 2 | module text unique primary key, 3 | autoload bool default true, 4 | source text 5 | ); -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/plv8_modules.md: -------------------------------------------------------------------------------- 1 | ## PL/V8 modules 2 | * https://rymc.io/2016/03/22/a-deep-dive-into-plv8/ 3 | * https://github.com/JerrySievert/plv8-modules -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/uuid-ossp.extension.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; -------------------------------------------------------------------------------- /_v1/packages/schema-builder/sql/10000/validator_santitize.md: -------------------------------------------------------------------------------- 1 | ## examples 2 | * SELECT _meta.validate('isEmail', 'test123@gmail.com', ''); 3 | * SELECT _meta.validate('contains', 'test123_gmail.com', 'test'); 4 | * SELECT _meta.validate('isAfter', '2017-12-11', '2017-12-10'); 5 | * SELECT _meta.validate('isFloat', '19.5', '{ "min": 7.22, "max": 9.55 }'); 6 | * SELECT _meta.sanitize('normalizeEmail', 'test@Gmail.com ', ''); 7 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/schema-builder/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/packages/server/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | server: { 3 | port: 3000, 4 | compression: { 5 | threshold: 2048 6 | } 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /_v1/packages/server/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1/packages/server/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1/packages/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "lib": [ 6 | "es2017" 7 | ], 8 | "target": "es6", 9 | "module": "commonjs", 10 | "types": [ 11 | "node" 12 | ], 13 | "moduleResolution": "node", 14 | "emitDecoratorMetadata": true, 15 | "experimentalDecorators": true, 16 | "sourceMap": false 17 | }, 18 | "exclude": [ 19 | "node_modules" 20 | ] 21 | } -------------------------------------------------------------------------------- /_v1/tsconfig_packages.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true 16 | }, 17 | "exclude": [ 18 | "node_modules", 19 | "dist", 20 | "test" 21 | ] 22 | } -------------------------------------------------------------------------------- /_v1_mig3/_v1/examples/1-orm-basic/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/auth/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | oAuth: { 3 | cookie: { 4 | maxAge: 86400000, 5 | overwrite: true, 6 | httpOnly: true, 7 | signed: true 8 | }, 9 | providers: {}, 10 | frontendOrigins: ["*"], 11 | serverApiAddress: "http://localhost:3000" 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/auth/res/1560267333653-auth-functions/auth.array_sort.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _auth.array_sort (ANYARRAY) 2 | RETURNS ANYARRAY LANGUAGE SQL 3 | AS $$ 4 | SELECT ARRAY(SELECT unnest($1) ORDER BY 1) 5 | $$ STABLE; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/auth/res/1560267333653-auth-functions/auth.set_admin.function.sql: -------------------------------------------------------------------------------- 1 | -- set_admin function sets a local for admin functions 2 | CREATE OR REPLACE FUNCTION _auth.set_admin(i_admin_token_secret TEXT) RETURNS void AS $$ 3 | DECLARE 4 | v_timestamp BIGINT; 5 | v_payload TEXT; 6 | v_admin_token TEXT; 7 | BEGIN 8 | v_timestamp := (round(extract(epoch from now())*1000))::bigint; 9 | 10 | v_payload := v_timestamp || ':' || i_admin_token_secret; 11 | 12 | v_admin_token := v_timestamp || ':' || encode(digest(v_payload, 'sha256'), 'hex'); 13 | 14 | EXECUTE format('set local auth.admin_token to %L', v_admin_token); 15 | END; 16 | $$ LANGUAGE plpgsql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/boot-scripts/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/boot-scripts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/db/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/file-storage/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | }; 3 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_clearup.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes all temporary files of a user which have not been added to an entity 3 | CREATE OR REPLACE FUNCTION _meta.file_clearup() RETURNS SETOF _meta."Files" AS $$ 4 | UPDATE _meta."Files" SET "deletedAt"=now() 5 | WHERE "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_clearupone.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes one temporary file which has not been added to an entity 3 | CREATE OR REPLACE FUNCTION _meta.file_clearupone(i_file_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | UPDATE _meta."Files" SET "deletedAt"=now() 5 | WHERE "id" = i_file_id AND "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_deleteone.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_deleteone function deletes one file finally => for usage after deleted from bucket 3 | CREATE OR REPLACE FUNCTION _meta.file_deleteone(i_file_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | DELETE FROM _meta."Files" 5 | WHERE "id" = i_file_id AND "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NOT NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/file-storage/res/1561973614863-file-storage-functions/meta.file_deleteone_admin.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_deleteone function deletes one file finally => for usage after deleted from bucket 3 | CREATE OR REPLACE FUNCTION _meta.file_deleteone_admin(i_file_id uuid) RETURNS SETOF _meta."Files" AS $$ 4 | DELETE FROM _meta."Files" 5 | WHERE "id" = i_file_id AND "entityId" IS NOT NULL AND "deletedAt" IS NOT NULL AND _auth.is_admin() = true 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/graphql/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | endpoint: "/graphql", 3 | playgroundActive: true, 4 | queryCostLimit: 2000000, 5 | minQueryDepthToCheckCostLimit: 3 6 | }; 7 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/graphql/lib/RevertibleResult.ts: -------------------------------------------------------------------------------- 1 | export class RevertibleResult { 2 | private result: any; 3 | private rollbackFunction: () => Promise; 4 | private onCommited: () => Promise | null; 5 | 6 | constructor(result: any, rollbackFunction: () => Promise, onCommited: () => Promise = null) { 7 | this.result = result; 8 | this.rollbackFunction = rollbackFunction; 9 | this.onCommited = onCommited; 10 | } 11 | 12 | public getResult() { 13 | return this.result; 14 | } 15 | 16 | public getRollbackFunction() { 17 | return this.rollbackFunction; 18 | } 19 | 20 | public getOnCommitedHandler() { 21 | return this.onCommited; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/graphql/lib/getDefaultResolvers/MutationBuilder/parseValue.ts: -------------------------------------------------------------------------------- 1 | import { ReturnIdHandler } from "../../resolverTransactions/ReturnIdHandler"; 2 | 3 | export default function parseValue(value: any, returnIdHandler: ReturnIdHandler): string | null { 4 | if (value != null && typeof value === "object") { 5 | return JSON.stringify(value); 6 | } 7 | if (value == null) { 8 | return null; 9 | } 10 | return returnIdHandler.getReturnId(`${value}`); 11 | } 12 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/graphql/lib/getDefaultResolvers/MutationBuilder/types.ts: -------------------------------------------------------------------------------- 1 | import { IMutationViewMeta } from "../../RuntimeInterfaces"; 2 | 3 | export interface IMutationBuildObject { 4 | sql: string; 5 | values: string[]; 6 | mutation: IMutationViewMeta; 7 | id: any; 8 | } 9 | 10 | export interface IMutationInputObject { 11 | input: { 12 | [key: string]: any; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/graphql/lib/hooks/types.ts: -------------------------------------------------------------------------------- 1 | import { PoolClient } from "@fullstack-one/core"; 2 | 3 | import { IQueryBuildOject, IMutationBuildObject } from "../getDefaultResolvers"; 4 | 5 | export type TPreQueryHookFunction = ( 6 | pgClient: PoolClient, 7 | context: any, 8 | authRequired: boolean, 9 | buildObject: IMutationBuildObject | IQueryBuildOject 10 | ) => any; 11 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/graphql/lib/logicalOperators/types.ts: -------------------------------------------------------------------------------- 1 | export interface IOperatorContext { 2 | fieldPgSelector: string; 3 | value: any; 4 | getParam: (value: any) => string; 5 | } 6 | 7 | export interface IOperator { 8 | name: string; 9 | gqlInputType: string; 10 | typeDefs?: string; 11 | getSql(context: IOperatorContext): string; 12 | } 13 | 14 | export interface IOperatorsByName { 15 | [key: string]: IOperator; 16 | } 17 | -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/schema-builder/sql/10000/meta.get_last_generated_uuid.function.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE OR REPLACE FUNCTION _meta.get_last_generated_uuid() RETURNS uuid AS $$ 3 | DECLARE 4 | v_new_uuid TEXT; 5 | BEGIN 6 | 7 | v_new_uuid := current_setting('temp.new_uuid', true); 8 | 9 | -- Checks that the local variable is not null 10 | IF v_new_uuid IS NULL OR length(v_new_uuid) < 36 THEN 11 | RAISE EXCEPTION 'No uuid has been generated in this transaction.'; 12 | END IF; 13 | 14 | return v_new_uuid::uuid; 15 | END; 16 | $$ LANGUAGE plpgsql; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/schema-builder/sql/10000/meta.uuid_generate_v4.function.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE OR REPLACE FUNCTION _meta.uuid_generate_v4() RETURNS uuid AS $$ 3 | DECLARE 4 | v_new_uuid uuid; 5 | BEGIN 6 | v_new_uuid := uuid_generate_v4(); 7 | 8 | EXECUTE format('set local temp.new_uuid to %L', v_new_uuid); 9 | 10 | return v_new_uuid; 11 | END; 12 | $$ LANGUAGE plpgsql; -------------------------------------------------------------------------------- /_v1_mig3/_v1/packages/server/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | port: 3030, 3 | compression: { 4 | threshold: 2048 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Auth: { 3 | }, 4 | Server: { 5 | }, 6 | Events: { 7 | pgClient: { 8 | database: process.env.TYPEORM_DATABASE, 9 | host: process.env.TYPEORM_HOST, 10 | user: process.env.TYPEORM_USERNAME, 11 | password: process.env.TYPEORM_PASSWORD, 12 | port: process.env.TYPEORM_PORT, 13 | ssl : process.env.DB_SSL === "true" ? { rejectUnauthorized: false } : undefined 14 | } 15 | } 16 | }; -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/config/development.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Logger: { 3 | minLevel: "trace", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/src/dev.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fullstack-build/soniq/c18a280ba2601e4c020d9461bf500adaeb6058d0/_v1_mig3/examples/1-one-basic/src/dev.ts -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/src/example.ts: -------------------------------------------------------------------------------- 1 | import { IDbSchema } from "@fullstack-one/graphql"; 2 | 3 | import schema from "./schema"; 4 | 5 | export const exampleSchema: IDbSchema = schema; -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/src/index.ts: -------------------------------------------------------------------------------- 1 | 2 | import { $core, pgConfig } from "./main"; 3 | 4 | (async () => { 5 | console.log("Booting Application"); 6 | 7 | await $core.boot(pgConfig); 8 | 9 | console.log("Booted Application"); 10 | })(); -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/src/migrate.ts: -------------------------------------------------------------------------------- 1 | 2 | import { $core, pgConfig, appConfig, $gql } from "./main"; 3 | 4 | (async () => { 5 | console.log("Generate Migration"); 6 | const res = await $core.generateMigration("v" + Math.random(), appConfig, "development", pgConfig); 7 | 8 | console.log("Print Migration"); 9 | $core.printMigrationResult(res); 10 | 11 | console.log("Apply Migration"); 12 | await $core.applyMigrationResult(res, pgConfig); 13 | 14 | console.log("Finished Migration"); 15 | 16 | // console.log("DEF", JSON.stringify($gql.getColumnExtensionPropertySchemas(), null, 2)); 17 | })(); -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/src/schema/index.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Schema } from "@fullstack-one/graphql"; 3 | 4 | const schema = new Schema(["soniq"]); 5 | 6 | import { user } from "./tables/User"; 7 | import { post } from "./tables/Post"; 8 | 9 | schema.addTable(0, user); 10 | schema.addTable(1, post); 11 | 12 | const res = schema._build("a3af9ea0-11a7-4eb0-96a0-7be79f827779"); 13 | 14 | export default res; -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/src/schema/tables/Comment/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fullstack-build/soniq/c18a280ba2601e4c020d9461bf500adaeb6058d0/_v1_mig3/examples/1-one-basic/src/schema/tables/Comment/index.ts -------------------------------------------------------------------------------- /_v1_mig3/examples/1-one-basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./build", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "build", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth-fb-token/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | fields: ["id", "email", "name", "last_name", "first_name", "middle_name"], 3 | baseURL: "https://graph.facebook.com/", 4 | userPath: "/me", 5 | debugTokenPath: "/debug_token", 6 | clientID: null, 7 | clientSecret: null 8 | }; 9 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth-fb-token/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth-fb-token/schema.gql: -------------------------------------------------------------------------------- 1 | 2 | extend type Mutation { 3 | 4 | """ 5 | Validates a Facebook-Token and generates AuthFactorCreationTokens or AuthFactorProofTokens. 6 | """ 7 | authenticateFacebookToken(token: String!, tenant: String): FacebookTokenAuthentication @custom(resolver: "@fullstack-one/auth-fb-token/authenticateFacebookToken") 8 | } 9 | 10 | type FacebookTokenAuthentication { 11 | email: String! 12 | profile: JSON 13 | authFactorProofTokens: FacebookAuthFactorTokens 14 | authFactorCreationTokens: FacebookAuthFactorTokens 15 | } 16 | 17 | type FacebookAuthFactorTokens { 18 | email: String! 19 | facebook: String! 20 | } 21 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth-fb-token/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth-fb-token/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | oAuth: { 3 | cookie: { 4 | maxAge: 86400000, 5 | overwrite: true, 6 | httpOnly: true, 7 | signed: true 8 | }, 9 | providers: {}, 10 | frontendOrigins: ["*"], 11 | serverApiAddress: "http://localhost:3000" 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/pgFunctions/auth.array_sort.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _auth.array_sort (ANYARRAY) 2 | RETURNS ANYARRAY LANGUAGE SQL 3 | AS $$ 4 | SELECT ARRAY(SELECT unnest($1) ORDER BY 1) 5 | $$ STABLE; -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/pgFunctions/auth.set_admin.function.sql: -------------------------------------------------------------------------------- 1 | -- set_admin function sets a local for admin functions 2 | CREATE OR REPLACE FUNCTION _auth.set_admin(i_admin_token_secret TEXT) RETURNS void AS $$ 3 | DECLARE 4 | v_timestamp BIGINT; 5 | v_payload TEXT; 6 | v_admin_token TEXT; 7 | BEGIN 8 | v_timestamp := (round(extract(epoch from now())*1000))::bigint; 9 | 10 | v_payload := v_timestamp || ':' || i_admin_token_secret; 11 | 12 | v_admin_token := v_timestamp || ':' || encode(digest(v_payload, 'sha256'), 'hex'); 13 | 14 | EXECUTE format('set local auth.admin_token to %L', v_admin_token); 15 | END; 16 | $$ LANGUAGE plpgsql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/pgFunctions/auth.set_root.function.sql: -------------------------------------------------------------------------------- 1 | -- set_root function sets a local for root functions 2 | CREATE OR REPLACE FUNCTION _auth.set_root(i_root_token_secret TEXT) RETURNS void AS $$ 3 | DECLARE 4 | v_timestamp BIGINT; 5 | v_payload TEXT; 6 | v_root_token TEXT; 7 | BEGIN 8 | v_timestamp := (round(extract(epoch from now())*1000))::bigint; 9 | 10 | v_payload := v_timestamp || ':' || i_root_token_secret; 11 | 12 | v_root_token := v_timestamp || ':' || encode(digest(v_payload, 'sha256'), 'hex'); 13 | 14 | EXECUTE format('set local auth.root_token to %L', v_root_token); 15 | END; 16 | $$ LANGUAGE plpgsql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1_mig3/packages/auth/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | namespace: "one" 3 | }; 4 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/lib/IConfigObject.ts: -------------------------------------------------------------------------------- 1 | export interface IConfig { 2 | core: any; 3 | eventEmitter: any; 4 | graphql: any; 5 | logger: any; 6 | } 7 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/lib/IEnvironment.ts: -------------------------------------------------------------------------------- 1 | export interface IEnvironment { 2 | readonly frameworkVersion: string; 3 | readonly NODE_ENV: string; 4 | readonly name: string; 5 | readonly path: string; 6 | readonly version: string; 7 | readonly namespace: string; 8 | readonly nodeId: string; // unique instance ID (6 char) 9 | } 10 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/lib/errors/DefaultConfigNotFoundError.ts: -------------------------------------------------------------------------------- 1 | export class DefaultConfigNotFoundError extends Error {} 2 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/lib/errors/MissingConfigPropertiesError.ts: -------------------------------------------------------------------------------- 1 | export class MissingConfigPropertiesError extends Error { 2 | public readonly missingProperties: string[]; 3 | 4 | constructor(moduleName: string, missingProperties: string[]) { 5 | super(); 6 | this.message += `config.not.set ${missingProperties.map((prop) => `${moduleName}.${prop}`).join(", ")}`; 7 | this.missingProperties = missingProperties; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/lib/errors/index.ts: -------------------------------------------------------------------------------- 1 | export { DefaultConfigNotFoundError } from "./DefaultConfigNotFoundError"; 2 | export { MissingConfigPropertiesError } from "./MissingConfigPropertiesError"; 3 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "@types/lodash": { 6 | "version": "4.14.120", 7 | "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.120.tgz", 8 | "integrity": "sha512-jQ21kQ120mo+IrDs1nFNVm/AsdFxIx2+vZ347DbogHJPd/JzKNMOqU6HCYin1W6v8l5R9XSO2/e9cxmn7HAnVw==" 9 | }, 10 | "lodash": { 11 | "version": "4.17.11", 12 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 13 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/test/mock/application/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Config: { 3 | namespace: "application-default" 4 | }, 5 | Foo: { 6 | bat: "application-default", 7 | bar: "application-default", 8 | baz: "application-default" 9 | }, 10 | Bat: { 11 | baa: "application-default" 12 | } 13 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/config/test/mock/application/config/test.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | Foo: { 3 | bat: "application-test", 4 | bar: "application-test" 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/test/mock/application/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mockapplication", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "mockerino", 10 | "license": "MIT" 11 | } 12 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/test/mock/module-config-bar/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bar: 2, 3 | blub: "foo" 4 | }; 5 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/test/mock/module-config-bat/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | baa: "module-default", 3 | boo: "module-default", 4 | buu: "module-default" 5 | }; 6 | -------------------------------------------------------------------------------- /_v1_mig3/packages/config/test/mock/module-config-bat/test.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | baa: "module-test", 3 | boo: "module-test" 4 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/core/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/di/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/di/lib/index.ts: -------------------------------------------------------------------------------- 1 | import "reflect-metadata"; 2 | export * from "typedi"; 3 | -------------------------------------------------------------------------------- /_v1_mig3/packages/di/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "reflect-metadata": { 6 | "version": "0.1.13", 7 | "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", 8 | "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" 9 | }, 10 | "typedi": { 11 | "version": "0.8.0", 12 | "resolved": "https://registry.npmjs.org/typedi/-/typedi-0.8.0.tgz", 13 | "integrity": "sha512-/c7Bxnm6eh5kXx2I+mTuO+2OvoWni5+rXA3PhXwVWCtJRYmz3hMok5s1AKLzoDvNAZqj/Q/acGstN0ri5aQoOA==" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /_v1_mig3/packages/di/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fullstack-one/di", 3 | "version": "0.5.20", 4 | "description": "fullstack.one helper package", 5 | "main": "index.js", 6 | "types": "lib/index.ts", 7 | "scripts": { 8 | "build": "tsc", 9 | "prepublishOnly": "npm run build" 10 | }, 11 | "publishConfig": { 12 | "access": "public" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/fullstack-build/fullstack.one.git" 17 | }, 18 | "keywords": [], 19 | "license": "MIT", 20 | "dependencies": { 21 | "reflect-metadata": "^0.1.13", 22 | "typedi": "^0.8.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /_v1_mig3/packages/di/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/events/README.md: -------------------------------------------------------------------------------- 1 | # @fullstack-one/events 2 | Events system for fullstack-one packages and applications. 3 | 4 | You can emit events and add and remove event listeners for local and global events. 5 | 6 | - Local: All events emitted of the own node 7 | - Global: All events emitted with the same configured namespace and events database 8 | 9 | Please, find usage information in the [code](lib/index.ts). 10 | 11 | -------------------------------------------------------------------------------- /_v1_mig3/packages/events/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | eventEmitter: { 3 | delimiter: ".", 4 | newListener: false, 5 | maxListeners: 1000, 6 | verboseMemoryLeak: true 7 | }, 8 | pgClient: { 9 | database: null, 10 | host: null, 11 | user: null, 12 | password: null, 13 | port: 5432, 14 | ssl: false 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /_v1_mig3/packages/events/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/events/lib/types.ts: -------------------------------------------------------------------------------- 1 | export interface IEventEmitterConfig { 2 | eventEmitter: { 3 | delimiter: string; 4 | newListener: boolean; 5 | maxListeners: number; 6 | verboseMemoryLeak: boolean; 7 | }; 8 | pgClient: { 9 | database: string; 10 | host: string; 11 | user: string; 12 | password: string; 13 | port: number; 14 | ssl: boolean; 15 | }; 16 | } 17 | 18 | export interface IEvent { 19 | name: string; 20 | nodeId: string; 21 | payload?: TPayload; 22 | } 23 | 24 | export type TEventListener = (nodeId: string, payload?: TPayload) => void; 25 | -------------------------------------------------------------------------------- /_v1_mig3/packages/events/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1_mig3/packages/events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/README.md: -------------------------------------------------------------------------------- 1 | # TODO: 2 | 3 | - [] After cleaning up migrations: Pass params from directive into the `FileFields` table, to be able to create Features like min, max. -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | }; 3 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | 7 | if (process.env.FULLSTACK_ONE_DEV === "true") { 8 | __export(require("./lib/index.ts")); 9 | } else { 10 | __export(require("./dist/index.js")); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/lib/IFileStorageConfig.ts: -------------------------------------------------------------------------------- 1 | export default interface IFileStorageConfig { 2 | minio: { 3 | endPoint: string; 4 | region?: string; 5 | port: number; 6 | useSSL: boolean; 7 | accessKey: string; 8 | secretKey: string; 9 | }; 10 | bucket: string; 11 | } 12 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/lib/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface IUploadFile { 2 | extension: string; 3 | type: string; 4 | fileName: string; 5 | uploadFileName: string; 6 | presignedPutUrl: string; 7 | } 8 | 9 | export interface IBucketFile { 10 | fileName: string; 11 | objects: IBucketObject[]; 12 | } 13 | 14 | export interface IBucketObject { 15 | objectName: string; 16 | presignedGetUrl: string; 17 | info: string; 18 | } 19 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/lib/migration/defaultConfig.ts: -------------------------------------------------------------------------------- 1 | export const defaultConfig = { 2 | minio: { 3 | endPoint: null, 4 | region: "eu-central-1", 5 | port: 9000, 6 | useSSL: true, 7 | accessKey: null, 8 | secretKey: null 9 | }, 10 | bucket: null, 11 | pgConfig: { 12 | max_temp_files_per_user: 20 13 | } 14 | } -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/lib/migration/filePostProcessingExtension/queries.ts: -------------------------------------------------------------------------------- 1 | export const GET_COLUMNS = `SELECT * FROM _file_storage."Columns" fc WHERE $1 @> ARRAY[fc."schemaName"::text];`; 2 | export const GET_TRIGGERS = `SELECT * FROM information_schema.triggers WHERE $1 @> ARRAY[event_object_schema::text] AND trigger_name LIKE 'fileStorage_trigger_%';;`; 3 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/pgFunctions/file_storage.file_clearup.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes all temporary files of a user which have not been added to an entity 3 | CREATE OR REPLACE FUNCTION _file_storage.file_clearup() RETURNS SETOF _file_storage."Files" AS $$ 4 | UPDATE _file_storage."Files" SET "deletedAt"=now() 5 | WHERE "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/pgFunctions/file_storage.file_clearupone.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes one temporary file which has not been added to an entity 3 | CREATE OR REPLACE FUNCTION _file_storage.file_clearupone(i_file_id uuid) RETURNS SETOF _file_storage."Files" AS $$ 4 | UPDATE _file_storage."Files" SET "deletedAt"=now() 5 | WHERE "id" = i_file_id AND "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/pgFunctions/file_storage.file_deleteone.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_deleteone function deletes one file finally => for usage after deleted from bucket 3 | CREATE OR REPLACE FUNCTION _file_storage.file_deleteone(i_file_id uuid) RETURNS SETOF _file_storage."Files" AS $$ 4 | DELETE FROM _file_storage."Files" 5 | WHERE "id" = i_file_id AND "ownerUserId" = _auth.current_user_id() AND "entityId" IS NULL AND "deletedAt" IS NOT NULL 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/pgFunctions/file_storage.file_deleteone_admin.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_deleteone function deletes one file finally => for usage after deleted from bucket 3 | CREATE OR REPLACE FUNCTION _file_storage.file_deleteone_admin(i_file_id uuid) RETURNS SETOF _file_storage."Files" AS $$ 4 | DELETE FROM _file_storage."Files" 5 | WHERE "id" = i_file_id AND "entityId" IS NOT NULL AND "deletedAt" IS NOT NULL AND _auth.is_admin() = true 6 | RETURNING *; 7 | $$ LANGUAGE sql SECURITY DEFINER; -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/pgFunctions/file_storage.file_todelete_by_entity.function.sql: -------------------------------------------------------------------------------- 1 | 2 | -- file_clearupone function deletes all temporary files of a user which have not been added to an entity 3 | CREATE OR REPLACE FUNCTION _file_storage.file_todelete_by_entity(i_entity_id uuid) RETURNS SETOF _file_storage."Files" AS $$ 4 | SELECT * FROM _file_storage."Files" 5 | WHERE "entityId" = i_entity_id AND "deletedAt" IS NOT NULL AND _auth.is_admin() = true; 6 | $$ LANGUAGE sql SECURITY DEFINER STABLE; -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/pgFunctions/file_storage.jsonb_arr2text_arr.function.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION _file_storage.jsonb_arr2text_arr(_js jsonb) 2 | RETURNS text[] LANGUAGE sql IMMUTABLE AS 3 | 'SELECT ARRAY(SELECT jsonb_array_elements_text(_js))'; -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/test/test.ts: -------------------------------------------------------------------------------- 1 | import ava from "ava"; 2 | 3 | ava.todo("Tests for the package."); 4 | -------------------------------------------------------------------------------- /_v1_mig3/packages/file-storage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "lib": ["es2017", "esnext.asynciterable"], 5 | "target": "es6", 6 | "module": "commonjs", 7 | "types": ["node"], 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "sourceMap": false, 12 | "declaration": true, 13 | "outDir": "./dist", 14 | "strict": false, 15 | "suppressImplicitAnyIndexErrors": true, 16 | "allowSyntheticDefaultImports": true 17 | }, 18 | "exclude": [ 19 | "node_modules", 20 | "dist", 21 | "test" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/config/default.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | endpoint: "/graphql", 3 | playgroundActive: true, 4 | queryCostLimit: 2000000, 5 | minQueryDepthToCheckCostLimit: 3 6 | }; 7 | -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-dist/arrow.28e30bbc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-dist/arrow_down.3d6b8982.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-dist/gui-lib.3059ce00.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["index.js"],"names":["console","log"],"mappings":";AAAAA,QAAQC,IAAI","file":"gui-lib.3059ce00.js","sourceRoot":"../gui-lib","sourcesContent":["console.log(\"Foobar!\");"]} -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fullstack.ONE Graphql-Schema 5 | 6 | 14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import ModuleConfig from "./views/ModuleConfig"; 4 | 5 | const style = { 6 | foobar: { 7 | color: "#ff0000" 8 | }, 9 | main: { 10 | padding: 30 11 | } 12 | }; 13 | 14 | class App extends Component { 15 | render() { 16 | const { styles } = this.props; 17 | return ( 18 | 19 | ); 20 | } 21 | } 22 | 23 | export default connect(style)(App); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Button/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class Button extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
{this.props.label}
10 | ); 11 | } 12 | } 13 | 14 | export default connect(style)(Button); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Demo/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class Demo extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
Demo
10 | ); 11 | } 12 | } 13 | 14 | export default connect(style)(Demo); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Demo/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | demo: { 4 | color: "#ff0000" 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/EditExpressionParams/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | demo: { 4 | // color: "#ff0000" 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/EditIndexProperties/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | demo: { 4 | // color: "#ff0000" 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/EditProperties/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | demo: { 4 | // color: "#ff0000" 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/EditProperty/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | demo: { 4 | // color: "#ff0000" 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Header/style.js: -------------------------------------------------------------------------------- 1 | import { ONE_TEXT_GRAY } from "../../constants/colors"; 2 | 3 | export const style = { 4 | wrapper: { 5 | backgroundColor: "#ffffff", 6 | borderBottom: "1px solid #D8D8D8", 7 | height: 40, 8 | lineHeight: "34px", 9 | fontSize: 14, 10 | paddingLeft: 20 11 | }, 12 | envConfig: { 13 | fontSize: 12, 14 | fontWeight: 300, 15 | color: ONE_TEXT_GRAY, 16 | marginLeft: 20, 17 | marginRight: 14 18 | } 19 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/HeaderButton/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class HeaderButton extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
{this.props.label}
10 | ); 11 | } 12 | } 13 | 14 | export default connect(style)(HeaderButton); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Input/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class Input extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
10 | { 11 | this.props.onChange(evt.target.value); 12 | } } /> 13 |
14 | ); 15 | } 16 | } 17 | 18 | export default connect(style)(Input); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Input/style.js: -------------------------------------------------------------------------------- 1 | import { ONE_WHITE, ONE_TEXT_GRAY, ONE_GRAY, ONE_FOCUS } from "../../constants/colors"; 2 | 3 | export const style = { 4 | wrapper: { 5 | color: "#ff0000", 6 | display: "inline-block" 7 | }, 8 | input: (props) => { 9 | return { 10 | outline: "none", 11 | border: `1px solid ${ONE_GRAY}`, 12 | padding: 11, 13 | fontSize: 12, 14 | backgroundColor: ONE_WHITE, 15 | color: ONE_TEXT_GRAY, 16 | width: props.width || 300, 17 | height: 13, 18 | onFocus: { 19 | border: `1px solid ${ONE_FOCUS}`, 20 | } 21 | } 22 | } 23 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Label/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class Label extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
{this.props.label}
10 | ); 11 | } 12 | } 13 | 14 | export default connect(style)(Label); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Label/style.js: -------------------------------------------------------------------------------- 1 | import { ONE_TEXT_GRAY } from "../../constants/colors"; 2 | 3 | export const style = { 4 | wrapper: { 5 | color: ONE_TEXT_GRAY, 6 | fontSize: 12, 7 | fontWeight: 300, 8 | marginTop: 16, 9 | marginBottom: 6 10 | } 11 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/MultiSelect/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | wrapper: { 4 | width: 324 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/PathList/style.js: -------------------------------------------------------------------------------- 1 | import { ONE_TEXT_GRAY } from "../../constants/colors"; 2 | 3 | export const style = { 4 | wrapper: { 5 | color: ONE_TEXT_GRAY, 6 | fontSize: 14, 7 | fontWeight: 300, 8 | height: 80, 9 | lineHeight: "80px", 10 | paddingLeft: 20, 11 | borderBottom: "1px solid #D8D8D8" 12 | }, 13 | element: { 14 | marginLeft: 10, 15 | marginRight: 10, 16 | cursor: "pointer" 17 | }, 18 | arrow: { 19 | height: 22, 20 | top: 5, 21 | position: "relative" 22 | } 23 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/PropertyBox/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class PropertyBox extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
10 |
11 |
{this.props.label}
12 |
{this.props.value}
13 |
14 |
15 | ); 16 | } 17 | } 18 | 19 | export default connect(style)(PropertyBox); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/RenderProperty/style.js: -------------------------------------------------------------------------------- 1 | 2 | export const style = { 3 | demo: { 4 | // color: "#ff0000" 5 | } 6 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Section/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class Section extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
10 |
{this.props.title}
11 |
{this.props.children}
12 |
13 | ); 14 | } 15 | } 16 | 17 | export default connect(style)(Section); -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/Section/style.js: -------------------------------------------------------------------------------- 1 | import { ONE_TEXT_GRAY, ONE_PRIMARY } from "../../constants/colors"; 2 | 3 | export const style = { 4 | wrapper: (props) => { 5 | return { 6 | color: ONE_TEXT_GRAY, 7 | fontSize: 12, 8 | fontWeight: 300, 9 | marginTop: 16, 10 | marginBottom: 50, 11 | borderLeft: `5px solid ${props.color != null ? props.color : ONE_PRIMARY}`, 12 | paddingLeft: 10 13 | } 14 | }, 15 | title: { 16 | color: ONE_TEXT_GRAY, 17 | fontSize: 16, 18 | fontWeight: 300 19 | } 20 | }; -------------------------------------------------------------------------------- /_v1_mig3/packages/graphql/gui-lib/components/TextArea/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { connect } from "react-fela"; 3 | import { style } from "./style"; 4 | 5 | class TextArea extends Component { 6 | render() { 7 | const { styles } = this.props; 8 | return ( 9 |
10 |