@things-factory/shell 7.0.1-beta.7 → 7.0.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/client/themes/app-theme.css +25 -34
  2. package/client/themes/dark.css +0 -100
  3. package/client/themes/grist-theme.css +12 -10
  4. package/client/themes/layout-theme.css +0 -5
  5. package/client/themes/light.css +0 -100
  6. package/client/themes/oops-theme.css +2 -2
  7. package/client/themes/report-theme.css +47 -0
  8. package/client/themes/state-color.css +1 -1
  9. package/dist-server/initializers/database.js +6 -6
  10. package/dist-server/initializers/database.js.map +1 -1
  11. package/dist-server/middlewares/domain-middleware.js +1 -2
  12. package/dist-server/middlewares/domain-middleware.js.map +1 -1
  13. package/dist-server/middlewares/index.js +1 -2
  14. package/dist-server/middlewares/index.js.map +1 -1
  15. package/dist-server/pubsub.js +0 -1
  16. package/dist-server/pubsub.js.map +1 -1
  17. package/dist-server/routers/global-router.js.map +1 -1
  18. package/dist-server/schema.js +1 -2
  19. package/dist-server/schema.js.map +1 -1
  20. package/dist-server/server-dev.js.map +1 -1
  21. package/dist-server/server.js.map +1 -1
  22. package/dist-server/service/attribute-set/attribute-set-item-type.js +5 -5
  23. package/dist-server/service/attribute-set/attribute-set-item-type.js.map +1 -1
  24. package/dist-server/service/attribute-set/attribute-set-mutation.js +2 -2
  25. package/dist-server/service/attribute-set/attribute-set-mutation.js.map +1 -1
  26. package/dist-server/service/attribute-set/attribute-set-query.js +3 -3
  27. package/dist-server/service/attribute-set/attribute-set-query.js.map +1 -1
  28. package/dist-server/service/attribute-set/attribute-set-type.js +6 -6
  29. package/dist-server/service/attribute-set/attribute-set-type.js.map +1 -1
  30. package/dist-server/service/attribute-set/attribute-set.js +2 -2
  31. package/dist-server/service/attribute-set/attribute-set.js.map +1 -1
  32. package/dist-server/service/common-types/list-param.js +9 -9
  33. package/dist-server/service/common-types/list-param.js.map +1 -1
  34. package/dist-server/service/common-types/log.js +2 -2
  35. package/dist-server/service/common-types/log.js.map +1 -1
  36. package/dist-server/service/common-types/object-ref.js +2 -2
  37. package/dist-server/service/common-types/object-ref.js.map +1 -1
  38. package/dist-server/service/common-types/scalar-any.js.map +1 -1
  39. package/dist-server/service/common-types/scalar-date.js.map +1 -1
  40. package/dist-server/service/directive-transaction/transaction.js.map +1 -1
  41. package/dist-server/service/domain/{domain-Mutation.js → domain-mutation.js} +3 -3
  42. package/dist-server/service/domain/domain-mutation.js.map +1 -0
  43. package/dist-server/service/domain/domain-query.js +3 -3
  44. package/dist-server/service/domain/domain-query.js.map +1 -1
  45. package/dist-server/service/domain/domain-types.js +6 -6
  46. package/dist-server/service/domain/domain-types.js.map +1 -1
  47. package/dist-server/service/domain/domain.js +6 -7
  48. package/dist-server/service/domain/domain.js.map +1 -1
  49. package/dist-server/service/domain/index.d.ts +1 -1
  50. package/dist-server/service/domain/index.js +2 -2
  51. package/dist-server/service/domain/index.js.map +1 -1
  52. package/dist-server/service/index.d.ts +1 -1
  53. package/dist-server/service/subscription-data/data-resolver.js +2 -2
  54. package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
  55. package/dist-server/service/subscription-data/data-types.js +2 -2
  56. package/dist-server/service/subscription-data/data-types.js.map +1 -1
  57. package/dist-server/tsconfig.tsbuildinfo +1 -1
  58. package/dist-server/typeorm/encrypt-transform.js +1 -1
  59. package/dist-server/typeorm/encrypt-transform.js.map +1 -1
  60. package/dist-server/typeorm/get-data-encryption-key.js.map +1 -1
  61. package/dist-server/typeorm/json5-transform.js.map +1 -1
  62. package/dist-server/utils/condition-builder.js.map +1 -1
  63. package/dist-server/utils/get-domain.d.ts +0 -1
  64. package/dist-server/utils/get-domain.js +7 -8
  65. package/dist-server/utils/get-domain.js.map +1 -1
  66. package/dist-server/utils/get-query-builder-from-list-params.js +1 -2
  67. package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
  68. package/dist-server/utils/get-times-for-period.js +2 -3
  69. package/dist-server/utils/get-times-for-period.js.map +1 -1
  70. package/dist-server/utils/list-param-adjuster.js +1 -2
  71. package/dist-server/utils/list-param-adjuster.js.map +1 -1
  72. package/dist-server/utils/list-params-converter.js +1 -2
  73. package/dist-server/utils/list-params-converter.js.map +1 -1
  74. package/dist-server/utils/list-query-builder.js.map +1 -1
  75. package/dist-server/utils/publish-progress.js +1 -2
  76. package/dist-server/utils/publish-progress.js.map +1 -1
  77. package/package.json +14 -14
  78. package/server/service/attribute-set/attribute-set-query.ts +1 -1
  79. package/server/service/domain/domain-query.ts +1 -1
  80. package/server/service/domain/index.ts +1 -1
  81. package/dist-server/service/domain/domain-Mutation.js.map +0 -1
  82. /package/dist-server/service/domain/{domain-Mutation.d.ts → domain-mutation.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../server/pubsub.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,2EAAuD;AACvD,6EAAyD;AACzD,+CAA2C;AAC3C,8DAA2B;AAC3B,+BAA8B;AAE9B,6CAAoD;AAGpD,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,YAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AAElF,IAAI,MAAc,CAAA;AAwFT,wBAAM;AAtFf,QAAQ,UAAU,EAAE;IAClB,KAAK,MAAM;QACT,YAAY;QACZ,iBAAA,MAAM,GAAG,IAAI,uCAAU,CAAC;YACtB,MAAM,EAAE,IAAA,cAAO,EAAC,SAAS,GAAG,IAAI,kBAC9B,eAAe,EAAE,IAAI,IAClB,OAAO,EACH;SACV,CAAC,CAAA;QACF,MAAK;IACP,KAAK,OAAO;QACV,MAAM,WAAW,mBACf,IAAI;YACJ,IAAI,EACJ,aAAa,EAAE,KAAK,CAAC,EAAE;gBACrB,kBAAkB;gBAClB,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE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W,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAExE,sBAAsB;AACtB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAE5E,oDAAoD;AACpD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC9E,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA","sourcesContent":["/**\n * @module pubsub\n * @description\n * This module provides a Pub/Sub (Publish/Subscribe) mechanism for handling messages and events.\n * Developers can use various middleware options such as MQTT, Redis, Redis Cluster, or Kafka\n * to implement Pub/Sub functionality.\n */\n\nimport { MQTTPubSub } from 'graphql-mqtt-subscriptions'\nimport { RedisPubSub } from 'graphql-redis-subscriptions'\nimport { createPubSub } from 'graphql-yoga'\nimport Redis from 'ioredis'\nimport { connect } from 'mqtt'\n\nimport { config, logger } from '@things-factory/env'\nimport { PubSub } from 'type-graphql'\n\nconst { middleware, host, port, nodes, topic, options } = config.get('pubsub', {})\n\nlet pubsub: PubSub\n\nswitch (middleware) {\n case 'mqtt':\n //@ts-ignore\n pubsub = new MQTTPubSub({\n client: connect('mqtt://' + host, {\n reconnectPeriod: 1000,\n ...options\n }) as any\n })\n break\n case 'redis':\n const redisOption = {\n host,\n port,\n retryStrategy: times => {\n // reconnect after\n return Math.min(times * 50, 2000)\n },\n ...options\n }\n //@ts-ignore\n pubsub = new RedisPubSub({\n publisher: new Redis(redisOption),\n subscriber: new Redis(redisOption)\n })\n break\n case 'redisCluster':\n const cluster = new Redis.Cluster(nodes, options)\n //@ts-ignore\n pubsub = new RedisPubSub({\n publisher: cluster,\n subscriber: cluster\n })\n break\n case 'kafka':\n try {\n /*\n * https://github.com/hatiolab/things-factory/issues/1239\n */\n const { KafkaPubSub } = require('graphql-kafka-subscriptions')\n pubsub = new KafkaPubSub({\n topic,\n host,\n port,\n ...options\n })\n } catch (e) {\n logger.error('graphql-kafka-subscriptions module is not installed, so application can not go further.')\n throw e\n }\n break\n default:\n pubsub = createPubSub()\n break\n}\n\n// kafka pubsub keeps connection and app port with 'ctrl+c' termination.\nconst exitHandler = async evt => {\n //@ts-ignore\n if (pubsub.close) {\n try {\n //@ts-ignore\n await pubsub.close()\n } catch (err) {\n logger.error(err)\n }\n }\n}\n\n/*\n * exit events hint from https://stackoverflow.com/a/14032965/14539284\n */\n\n//do something when app is closing\nprocess.on('exit', exitHandler.bind(null, { name: 'exit', exit: true }))\n\n//catches ctrl+c event\nprocess.on('SIGINT', exitHandler.bind(null, { name: 'SIGINT', exit: true }))\n\n// catches \"kill pid\" (for example: nodemon restart)\nprocess.on('SIGUSR1', exitHandler.bind(null, { name: 'SIGUSR1', exit: true }))\nprocess.on('SIGUSR2', exitHandler.bind(null, { name: 'SIGUSR2', exit: true }))\n\n//catches uncaught exceptions\n// process.on('uncaughtException', exitHandler.bind(null, { name: 'uncaughtException', exit: true }))\n\nexport { pubsub }\n"]}
1
+ {"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../server/pubsub.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,2EAAuD;AACvD,6EAAyD;AACzD,+CAA2C;AAC3C,8DAA2B;AAC3B,+BAA8B;AAE9B,6CAAoD;AAGpD,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,YAAM,CAAC,GAAG,CAAC,QAAQ,EAAE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AC,CAAA;QACT,CAAC;QACD,MAAK;IACP;QACE,iBAAA,MAAM,GAAG,IAAA,2BAAY,GAAE,CAAA;QACvB,MAAK;AACT,CAAC;AAED,wEAAwE;AACxE,MAAM,WAAW,GAAG,KAAK,EAAC,GAAG,EAAC,EAAE;IAC9B,YAAY;IACZ,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,IAAI,CAAC;YACH,YAAY;YACZ,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,YAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;AACH,CAAC,CAAA;AAED;;GAEG;AAEH,kCAAkC;AAClC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAExE,sBAAsB;AACtB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAE5E,oDAAoD;AACpD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC9E,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA","sourcesContent":["/**\n * @module pubsub\n * @description\n * This module provides a Pub/Sub (Publish/Subscribe) mechanism for handling messages and events.\n * Developers can use various middleware options such as MQTT, Redis, Redis Cluster, or Kafka\n * to implement Pub/Sub functionality.\n */\n\nimport { MQTTPubSub } from 'graphql-mqtt-subscriptions'\nimport { RedisPubSub } from 'graphql-redis-subscriptions'\nimport { createPubSub } from 'graphql-yoga'\nimport Redis from 'ioredis'\nimport { connect } from 'mqtt'\n\nimport { config, logger } from '@things-factory/env'\nimport { PubSub } from 'type-graphql'\n\nconst { middleware, host, port, nodes, topic, options } = config.get('pubsub', {})\n\nlet pubsub: PubSub\n\nswitch (middleware) {\n case 'mqtt':\n //@ts-ignore\n pubsub = new MQTTPubSub({\n client: connect('mqtt://' + host, {\n reconnectPeriod: 1000,\n ...options\n }) as any\n })\n break\n case 'redis':\n const redisOption = {\n host,\n port,\n retryStrategy: times => {\n // reconnect after\n return Math.min(times * 50, 2000)\n },\n ...options\n }\n //@ts-ignore\n pubsub = new RedisPubSub({\n publisher: new Redis(redisOption),\n subscriber: new Redis(redisOption)\n })\n break\n case 'redisCluster':\n const cluster = new Redis.Cluster(nodes, options)\n //@ts-ignore\n pubsub = new RedisPubSub({\n publisher: cluster,\n subscriber: cluster\n })\n break\n case 'kafka':\n try {\n /*\n * https://github.com/hatiolab/things-factory/issues/1239\n */\n const { KafkaPubSub } = require('graphql-kafka-subscriptions')\n pubsub = new KafkaPubSub({\n topic,\n host,\n port,\n ...options\n })\n } catch (e) {\n logger.error('graphql-kafka-subscriptions module is not installed, so application can not go further.')\n throw e\n }\n break\n default:\n pubsub = createPubSub()\n break\n}\n\n// kafka pubsub keeps connection and app port with 'ctrl+c' termination.\nconst exitHandler = async evt => {\n //@ts-ignore\n if (pubsub.close) {\n try {\n //@ts-ignore\n await pubsub.close()\n } catch (err) {\n logger.error(err)\n }\n }\n}\n\n/*\n * exit events hint from https://stackoverflow.com/a/14032965/14539284\n */\n\n//do something when app is closing\nprocess.on('exit', exitHandler.bind(null, { name: 'exit', exit: true }))\n\n//catches ctrl+c event\nprocess.on('SIGINT', exitHandler.bind(null, { name: 'SIGINT', exit: true }))\n\n// catches \"kill pid\" (for example: nodemon restart)\nprocess.on('SIGUSR1', exitHandler.bind(null, { name: 'SIGUSR1', exit: true }))\nprocess.on('SIGUSR2', exitHandler.bind(null, { name: 'SIGUSR2', exit: true }))\n\n//catches uncaught exceptions\n// process.on('uncaughtException', exitHandler.bind(null, { name: 'uncaughtException', exit: true }))\n\nexport { pubsub }\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"global-router.js","sourceRoot":"","sources":["../../server/routers/global-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAC/B,oEAAkC;AAElC,qFAAwE;AACxE,wEAAmE;AAEnE,IAAI,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE/B,QAAA,kBAAkB,GAAG,IAAI,oBAAM,EAAE,CAAA;AACjC,QAAA,mBAAmB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE/C,qEAAqE;AACrE,2BAAmB,CAAC,GAAG,CAAC,oCAAgB,CAAC,CAAA;AAEzC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,EAAE;IACxC,0BAAkB,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzD,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;QAE5C,MAAM,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;CACH;AAED,0BAAkB,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC9D,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAE1D,MAAM,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAA;AAChF,CAAC,CAAC,CAAA;AAEF,0BAAkB,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,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,kBAAkB,CAAC;GAC5E,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,2EAA2E;AAC3E,0BAAkB,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACjE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\nimport requestIp from 'request-ip'\n\nimport { getLicenseInfo } from '@things-factory/operato-license-checker'\nimport { domainMiddleware } from '../middlewares/domain-middleware'\n\nvar crawler = require('npm-license-crawler')\n\nexport const globalPublicRouter = new Router()\nexport const globalPrivateRouter = new Router()\n\n/* even though global private router, catch domain for information */\nglobalPrivateRouter.use(domainMiddleware)\n\nif (process.env.NODE_ENV != 'production') {\n globalPublicRouter.get('/graphql', async (context, next) => {\n const initialEndpoint = context.request.href\n\n await context.render('graphql', { initialEndpoint })\n })\n}\n\nglobalPublicRouter.get('/dependencies', async (context, next) => {\n const { dependencyGraph } = require('@things-factory/env')\n\n await context.render('dependencies-view-graphviz', { model: dependencyGraph })\n})\n\nglobalPublicRouter.get('/license-info', (context, next) => {\n context.type = 'application/json'\n context.body = getLicenseInfo()\n})\n\nglobalPublicRouter.get('/opensource-licenses', (context, next) => {\n return new Promise(function (resolve, reject) {\n var options = {\n start: ['.'],\n exclude: [],\n noColor: true,\n production: true,\n unknown: false\n }\n\n crawler.dumpLicenses(options, function (error, res) {\n if (error) {\n console.error('get:/opensource-licenses', error)\n reject(error)\n } else {\n context.type = 'application/json'\n context.body = res\n resolve(res)\n }\n })\n })\n})\n\nglobalPublicRouter.get('/request-info', context => {\n context.body = `\n Client info. from \"requestIp\": ${requestIp.getClientIp(context.req)}\n\n Client info. from \"context.ip\": ${context.ip}\n Client info. from \"context.protocol\": ${context.protocol}\n Client info. from \"context.host\": ${context.host}\n\n Client info. from \"x-forwarded-for\": ${context.headers['x-forwarded-for']}\n Client info. from \"x-forwarded-proto\": ${context.headers['x-forwarded-proto']}\n Client info. from \"x-forwarded-host\": ${context.headers['x-forwarded-host']}\n Client info. from \"x-forwarded-port\": ${context.headers['x-forwarded-port']}\n `\n})\n\n/* Paths starting with /public are assumed to use the koa-view renderer. */\nglobalPublicRouter.get('/public/(.[^.]*)', async (context, next) => {\n const { path } = context\n await context.render(path.substr(1))\n})\n"]}
1
+ {"version":3,"file":"global-router.js","sourceRoot":"","sources":["../../server/routers/global-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAC/B,oEAAkC;AAElC,qFAAwE;AACxE,wEAAmE;AAEnE,IAAI,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE/B,QAAA,kBAAkB,GAAG,IAAI,oBAAM,EAAE,CAAA;AACjC,QAAA,mBAAmB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE/C,qEAAqE;AACrE,2BAAmB,CAAC,GAAG,CAAC,oCAAgB,CAAC,CAAA;AAEzC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,EAAE,CAAC;IACzC,0BAAkB,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzD,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;QAE5C,MAAM,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IACtD,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,0BAAkB,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC9D,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAE1D,MAAM,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,eAAe,EA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C,iBAAiB,CAAC;6CAChC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;4CACrC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC;4CACnC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC;GAC5E,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,2EAA2E;AAC3E,0BAAkB,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACjE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\nimport requestIp from 'request-ip'\n\nimport { getLicenseInfo } from '@things-factory/operato-license-checker'\nimport { domainMiddleware } from '../middlewares/domain-middleware'\n\nvar crawler = require('npm-license-crawler')\n\nexport const globalPublicRouter = new Router()\nexport const globalPrivateRouter = new Router()\n\n/* even though global private router, catch domain for information */\nglobalPrivateRouter.use(domainMiddleware)\n\nif (process.env.NODE_ENV != 'production') {\n globalPublicRouter.get('/graphql', async (context, next) => {\n const initialEndpoint = context.request.href\n\n await context.render('graphql', { initialEndpoint })\n })\n}\n\nglobalPublicRouter.get('/dependencies', async (context, next) => {\n const { dependencyGraph } = require('@things-factory/env')\n\n await context.render('dependencies-view-graphviz', { model: dependencyGraph })\n})\n\nglobalPublicRouter.get('/license-info', (context, next) => {\n context.type = 'application/json'\n context.body = getLicenseInfo()\n})\n\nglobalPublicRouter.get('/opensource-licenses', (context, next) => {\n return new Promise(function (resolve, reject) {\n var options = {\n start: ['.'],\n exclude: [],\n noColor: true,\n production: true,\n unknown: false\n }\n\n crawler.dumpLicenses(options, function (error, res) {\n if (error) {\n console.error('get:/opensource-licenses', error)\n reject(error)\n } else {\n context.type = 'application/json'\n context.body = res\n resolve(res)\n }\n })\n })\n})\n\nglobalPublicRouter.get('/request-info', context => {\n context.body = `\n Client info. from \"requestIp\": ${requestIp.getClientIp(context.req)}\n\n Client info. from \"context.ip\": ${context.ip}\n Client info. from \"context.protocol\": ${context.protocol}\n Client info. from \"context.host\": ${context.host}\n\n Client info. from \"x-forwarded-for\": ${context.headers['x-forwarded-for']}\n Client info. from \"x-forwarded-proto\": ${context.headers['x-forwarded-proto']}\n Client info. from \"x-forwarded-host\": ${context.headers['x-forwarded-host']}\n Client info. from \"x-forwarded-port\": ${context.headers['x-forwarded-port']}\n `\n})\n\n/* Paths starting with /public are assumed to use the koa-view renderer. */\nglobalPublicRouter.get('/public/(.[^.]*)', async (context, next) => {\n const { path } = context\n await context.render(path.substr(1))\n})\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = void 0;
3
+ exports.schema = schema;
4
4
  const GraphQLUpload_js_1 = require("graphql-upload/GraphQLUpload.js");
5
5
  const type_graphql_1 = require("type-graphql");
6
6
  const graphql_scalars_1 = require("graphql-scalars");
@@ -116,5 +116,4 @@ async function schema() {
116
116
  });
117
117
  return merged;
118
118
  }
119
- exports.schema = schema;
120
119
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../server/schema.ts"],"names":[],"mappings":";;;AACA,sEAA+D;AAC/D,+CAA0C;AAC1C,qDAA0F;AAE1F,kDAAoD;AACpD,6CAAgE;AAChE,iDAAiD;AACjD,qCAAiC;AAEjC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAE5B;;;GAGG;AACI,KAAK,UAAU,MAAM;IAC1B,MAAM,OAAO,GAAG,wBAAkB;SAC/B,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,YAAM,EAAC,GAAG,CAAC,CAAC,MAAM,CAAC;SAC9B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC;SACxB,MAAM,CACL,CAA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,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAA;IACvC,IAAI,YAAY,GAAG,SAAS,CAAC,YAAY,IAAI,EAAE,CAAA;IAC/C,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,IAAI,EAAE,CAAA;IAEzC,OAAO,SAAS,CAAC,KAAK,CAAA;IACtB,OAAO,SAAS,CAAC,QAAQ,CAAA;IACzB,OAAO,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,SAAS,CAAC,SAAS,CAAA;IAE1B,SAAS,iCACP,MAAM,EAAE,gCAAoB,EAC5B,KAAK,EAAE,IAAA,iBAAS,EAAC,KAAK,EAAE,cAAc,CAAC,EACvC,QAAQ,EAAE,IAAA,iBAAS,EAAC,QAAQ,EAAE,iBAAiB,CAAC,EAChD,YAAY,EAAE,IAAA,iBAAS,EAAC,YAAY,EAAE,qBAAqB,CAAC,IACzD,2BAAe,GACf,SAAS,CACb,CAAA;IAED,IAAI,MAAM,GAAG,IAAA,qBAAY,EAAC;QACxB,OAAO,EAAE;YACP,MAAM,IAAA,0BAAW,EAAC;gBAChB,MAAM,EAAE,eAAM;gBACd,SAAS,EAAE,OAAO,CAAC,eAAe;gBAClC,gEAAgE;gBAChE,iCAAiC;gBACjC,kDAAkD;gBAClD,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa;gBACrD,4EAA4E;aAC7E,CAAC;SACH;QACD,QAAQ;QACR,SAAS;KACV,CAAC,CAAA;IAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,SAAwC,EAAE,EAAE;QACjF,MAAM,GAAG,SAAS,CAAC,MAAM,CAAQ,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAlJD,wBAkJC","sourcesContent":["import { GraphQLSchema } from 'graphql'\nimport { GraphQLUpload } from 'graphql-upload/GraphQLUpload.js'\nimport { buildSchema } from 'type-graphql'\nimport { typeDefs as scalarTypeDefs, resolvers as scalarResolvers } from 'graphql-scalars'\n\nimport { mergeSchemas } from '@graphql-tools/schema'\nimport { loader, orderedModuleNames } from '@things-factory/env'\nimport { deepMerge } from '@things-factory/utils'\nimport { pubsub } from './pubsub'\n\nconst path = require('path')\n\n/**\n * Generates and returns a GraphQL schema by merging schemas and resolvers from various modules.\n * @returns {GraphQLSchema} The merged GraphQL schema.\n */\nexport async function schema() {\n const schemas = orderedModuleNames\n .map(dep => loader(dep).schema)\n .filter(schema => schema)\n .reduce(\n (sum, schema) => {\n const { typeDefs, resolvers, resolverClasses, directives } = sum\n let { typeDefs: sTypeDefs = {}, resolvers: sResolvers = {}, resolverClasses: sResolverClasses = [], directives: sDirectives = {} } = schema\n\n return {\n typeDefs: deepMerge(typeDefs, sTypeDefs),\n resolvers: deepMerge(resolvers, sResolvers),\n resolverClasses: [...resolverClasses, ...(sResolverClasses || [])],\n directives: deepMerge(directives, sDirectives)\n }\n },\n {\n typeDefs: {},\n resolvers: {},\n resolverClasses: [],\n directives: {}\n }\n )\n\n /* for typeDefs */\n var typeDefs = schemas.typeDefs\n var { queries = [], mutations = [], subscriptions = [], directives = [], types = [] } = typeDefs\n\n queries = [...queries, ...(typeDefs.Query || [])]\n mutations = [...mutations, ...(typeDefs.Mutation || [])]\n subscriptions = [...subscriptions, ...(typeDefs.Subscription || [])]\n directives = [...directives, ...(typeDefs.Directive || [])]\n\n delete typeDefs.Query\n delete typeDefs.Mutation\n delete typeDefs.Subscription\n delete typeDefs.Directive\n\n delete typeDefs.queries\n delete typeDefs.mutations\n delete typeDefs.subscriptions\n delete typeDefs.directives\n delete typeDefs.types\n\n const defs = {\n query: queries.length > 0 ? ['type Query {', ...queries, '}'].join('\\n') : 'type Query { _ : Boolean }',\n mutation: mutations.length > 0 ? ['type Mutation {', ...mutations, '}'].join('\\n') : 'type Mutation { _ : Boolean }',\n subscription: subscriptions.length > 0 ? ['type Subscription {', ...subscriptions, '}'].join('\\n') : 'type Subscription { _ : Boolean }'\n }\n\n typeDefs = [\n ...scalarTypeDefs,\n `\n scalar Upload\n `,\n defs.query,\n defs.mutation,\n defs.subscription,\n ...directives,\n ...types,\n ...Object.values(typeDefs)\n ].filter(type => !!type)\n\n /* for resolvers */\n var { resolvers } = schemas\n var { queries = [], mutations = [], subscriptions = [], directives = [] } = resolvers\n\n var queryResolvers =\n queries.length > 0 &&\n queries.reduce((sum, query) => {\n return {\n ...sum,\n ...query\n }\n }, {})\n\n var mutationResolvers =\n mutations.length > 0 &&\n mutations.reduce((sum, mutation) => {\n return {\n ...sum,\n ...mutation\n }\n }, {})\n\n var subscriptionResolvers =\n subscriptions.length > 0 &&\n subscriptions.reduce((sum, subscription) => {\n return {\n ...sum,\n ...subscription\n }\n }, {})\n\n var directiveResolvers = directives.reduce((sum, directive) => {\n return {\n ...sum,\n ...directive\n }\n }, {})\n\n delete resolvers.queries\n delete resolvers.mutations\n delete resolvers.subscriptions\n delete resolvers.directives\n\n var Query = resolvers.Query || {}\n var Mutation = resolvers.Mutation || {}\n var Subscription = resolvers.Subscription || {}\n var Directive = resolvers.Directive || {}\n\n delete resolvers.Query\n delete resolvers.Mutation\n delete resolvers.Subscription\n delete resolvers.Directive\n\n resolvers = {\n Upload: GraphQLUpload as any,\n Query: deepMerge(Query, queryResolvers),\n Mutation: deepMerge(Mutation, mutationResolvers),\n Subscription: deepMerge(Subscription, subscriptionResolvers),\n ...scalarResolvers,\n ...resolvers\n }\n\n var merged = mergeSchemas({\n schemas: [\n await buildSchema({\n pubSub: pubsub,\n resolvers: schemas.resolverClasses,\n // automatically create `schema.gql` file with schema definition\n // in project's working directory\n // or create the file with schema in selected path\n emitSchemaFile: process.env.NODE_ENV == 'development'\n // emitSchemaFile: path.resolve(__dirname, 'snapshots/schema', 'schema.gql')\n })\n ],\n typeDefs,\n resolvers\n })\n\n Object.values(schemas.directives).map((directive: (schema: GraphQLSchema) => {}) => {\n merged = directive(merged) as any\n })\n\n return merged\n}\n"]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;gBAChE,iCAAiC;gBACjC,kDAAkD;gBAClD,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa;gBACrD,4EAA4E;aAC7E,CAAC;SACH;QACD,QAAQ;QACR,SAAS;KACV,CAAC,CAAA;IAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,SAAwC,EAAE,EAAE;QACjF,MAAM,GAAG,SAAS,CAAC,MAAM,CAAQ,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { GraphQLSchema } from 'graphql'\nimport { GraphQLUpload } from 'graphql-upload/GraphQLUpload.js'\nimport { buildSchema } from 'type-graphql'\nimport { typeDefs as scalarTypeDefs, resolvers as scalarResolvers } from 'graphql-scalars'\n\nimport { mergeSchemas } from '@graphql-tools/schema'\nimport { loader, orderedModuleNames } from '@things-factory/env'\nimport { deepMerge } from '@things-factory/utils'\nimport { pubsub } from './pubsub'\n\nconst path = require('path')\n\n/**\n * Generates and returns a GraphQL schema by merging schemas and resolvers from various modules.\n * @returns {GraphQLSchema} The merged GraphQL schema.\n */\nexport async function schema() {\n const schemas = orderedModuleNames\n .map(dep => loader(dep).schema)\n .filter(schema => schema)\n .reduce(\n (sum, schema) => {\n const { typeDefs, resolvers, resolverClasses, directives } = sum\n let { typeDefs: sTypeDefs = {}, resolvers: sResolvers = {}, resolverClasses: sResolverClasses = [], directives: sDirectives = {} } = schema\n\n return {\n typeDefs: deepMerge(typeDefs, sTypeDefs),\n resolvers: deepMerge(resolvers, sResolvers),\n resolverClasses: [...resolverClasses, ...(sResolverClasses || [])],\n directives: deepMerge(directives, sDirectives)\n }\n },\n {\n typeDefs: {},\n resolvers: {},\n resolverClasses: [],\n directives: {}\n }\n )\n\n /* for typeDefs */\n var typeDefs = schemas.typeDefs\n var { queries = [], mutations = [], subscriptions = [], directives = [], types = [] } = typeDefs\n\n queries = [...queries, ...(typeDefs.Query || [])]\n mutations = [...mutations, ...(typeDefs.Mutation || [])]\n subscriptions = [...subscriptions, ...(typeDefs.Subscription || [])]\n directives = [...directives, ...(typeDefs.Directive || [])]\n\n delete typeDefs.Query\n delete typeDefs.Mutation\n delete typeDefs.Subscription\n delete typeDefs.Directive\n\n delete typeDefs.queries\n delete typeDefs.mutations\n delete typeDefs.subscriptions\n delete typeDefs.directives\n delete typeDefs.types\n\n const defs = {\n query: queries.length > 0 ? ['type Query {', ...queries, '}'].join('\\n') : 'type Query { _ : Boolean }',\n mutation: mutations.length > 0 ? ['type Mutation {', ...mutations, '}'].join('\\n') : 'type Mutation { _ : Boolean }',\n subscription: subscriptions.length > 0 ? ['type Subscription {', ...subscriptions, '}'].join('\\n') : 'type Subscription { _ : Boolean }'\n }\n\n typeDefs = [\n ...scalarTypeDefs,\n `\n scalar Upload\n `,\n defs.query,\n defs.mutation,\n defs.subscription,\n ...directives,\n ...types,\n ...Object.values(typeDefs)\n ].filter(type => !!type)\n\n /* for resolvers */\n var { resolvers } = schemas\n var { queries = [], mutations = [], subscriptions = [], directives = [] } = resolvers\n\n var queryResolvers =\n queries.length > 0 &&\n queries.reduce((sum, query) => {\n return {\n ...sum,\n ...query\n }\n }, {})\n\n var mutationResolvers =\n mutations.length > 0 &&\n mutations.reduce((sum, mutation) => {\n return {\n ...sum,\n ...mutation\n }\n }, {})\n\n var subscriptionResolvers =\n subscriptions.length > 0 &&\n subscriptions.reduce((sum, subscription) => {\n return {\n ...sum,\n ...subscription\n }\n }, {})\n\n var directiveResolvers = directives.reduce((sum, directive) => {\n return {\n ...sum,\n ...directive\n }\n }, {})\n\n delete resolvers.queries\n delete resolvers.mutations\n delete resolvers.subscriptions\n delete resolvers.directives\n\n var Query = resolvers.Query || {}\n var Mutation = resolvers.Mutation || {}\n var Subscription = resolvers.Subscription || {}\n var Directive = resolvers.Directive || {}\n\n delete resolvers.Query\n delete resolvers.Mutation\n delete resolvers.Subscription\n delete resolvers.Directive\n\n resolvers = {\n Upload: GraphQLUpload as any,\n Query: deepMerge(Query, queryResolvers),\n Mutation: deepMerge(Mutation, mutationResolvers),\n Subscription: deepMerge(Subscription, subscriptionResolvers),\n ...scalarResolvers,\n ...resolvers\n }\n\n var merged = mergeSchemas({\n schemas: [\n await buildSchema({\n pubSub: pubsub,\n resolvers: schemas.resolverClasses,\n // automatically create `schema.gql` file with schema definition\n // in project's working directory\n // or create the file with schema in selected path\n emitSchemaFile: process.env.NODE_ENV == 'development'\n // emitSchemaFile: path.resolve(__dirname, 'snapshots/schema', 'schema.gql')\n })\n ],\n typeDefs,\n resolvers\n })\n\n Object.values(schemas.directives).map((directive: (schema: GraphQLSchema) => {}) => {\n merged = directive(merged) as any\n })\n\n return merged\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"server-dev.js","sourceRoot":"","sources":["../server/server-dev.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,4DAA4D;AAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAA;AAEjD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAEjE,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAA;AACpC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;AAE1B,2CAA6C;AAC7C,2EAAyF;AACzF,uEAAqG;AAErG,8CAAoD;AACpD,0DAA+B;AAC/B,qGAAiE;AACjE,8CAAiD;AACjD,+BAAmC;AACnC,sDAAqB;AACrB,4EAA0C;AAC1C,sEAAiC;AACjC,yFAAsE;AACtE,2BAAoC;AACpC,oDAAmB;AACnB,wDAAuB;AAEvB,gFAA8C;AAC9C,6DAA4B;AAC5B,6CAAgF;AAChF,qFAAoF;AAEpF,iEAA2D;AAC3D,sDAA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UAAU,CAAC,CAAA;IAEnB,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE;QACrC,YAAM,CAAC,IAAI,CAAC,qCAAqC,IAAI,UAAU,CAAC,CAAA;QAChE,YAAM,CAAC,IAAI,CAAC,0CAA0C,IAAI,UAAU,CAAC,CAAA;QAErE,OAAO,CAAC,IAAI,CAAC,wBAA+B,EAAE,EAAE,GAAG,EAAE,MAAM,EAAN,YAAM,EAAE,WAAW,EAAE,UAAU,EAAS,CAAC,CAAA;IAChG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,EAAE,CAAA","sourcesContent":["// ts-import-sorter: disable\n\n/* following 7 lines should be located in top of the file */\nconst OS = require('os')\nprocess.env.UV_THREADPOOL_SIZE = OS.cpus().length\n\nconsole.log('UV_THREADPOOL_SIZE', process.env.UV_THREADPOOL_SIZE)\n\nprocess.env.NODE_ENV = 'development'\nprocess.setMaxListeners(0)\n\nimport { ApolloServer } from '@apollo/server'\nimport { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'\nimport { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default'\n\nimport { koaMiddleware } from '@as-integrations/koa'\nimport bytesFormat from 'bytes'\nimport graphqlUploadKoa from 'graphql-upload/graphqlUploadKoa.js'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport { createServer } from 'http'\nimport Koa from 'koa'\nimport koaBodyParser from 'koa-bodyparser'\nimport compose from 'koa-compose'\nimport { historyApiFallback } from 'koa2-connect-history-api-fallback'\nimport { WebSocketServer } from 'ws'\nimport co from 'co'\nimport http from 'http'\n\nimport koaWebpack from '@hatiolab/koa-webpack'\nimport cors from '@koa/cors'\nimport { config, loader, logger, orderedModuleNames } from '@things-factory/env'\nimport { initLicense, checkValidity } from '@things-factory/operato-license-checker'\n\nimport { GraphqlLocalClient } from './graphql-local-client'\nimport { databaseInitializer } from './initializers/database'\nimport {\n domainPrivateRouter,\n domainPublicRouter,\n globalPrivateRouter,\n globalPublicRouter,\n graphqlRouter\n} from './routers'\nimport { schema } from './schema'\nimport { Domain } from './service'\nimport { EntityManager } from 'typeorm'\nimport { domainMiddleware } from './middlewares'\n\nprocess.on('uncaughtException', error => {\n logger.error('uncaughtException: ', error, error.stack)\n\n //process.exit(1)\n})\n\nconst args = require('args')\n\nargs.option('port', 'The port on which the app will be running', config.get('port', 3000))\nargs.option(\n 'inspect',\n `The address on which the inspection will be running. Used in development mode only.\n This option is just to prevent termination for reasons of not recognizing the 'inspect' option.`,\n config.get('inspect', ':9229')\n)\nargs.option('webpack', 'webpack configuration file', config.get('webpack'))\n\nconst flags = args.parse(process.argv)\n\nconst webpack = require('webpack')\nconst webpackConfig = require(flags.webpack || '@things-factory/builder/webpack.config.dev.js')\n\nconst compiler = webpack(webpackConfig)\n\nconst PORT = (process.env.PORT = flags.port)\n\nconst requestBody = config.get('requestBody') || {}\n\nconst bodyParserOption = {\n formLimit: requestBody.formLimit || '10mb',\n jsonLimit: requestBody.jsonLimit || '10mb',\n textLimit: requestBody.textLimit || '10mb'\n}\n\nconst fileUpload = config.get('fileUpload') || {}\nconst fileUploadOption = {\n maxFileSize: bytesFormat.parse(fileUpload.maxFileSize) || bytesFormat.parse('10mb'),\n maxFiles: fileUpload.maxFiles || 10\n}\n\ninterface ICustomAppState {\n domain: Domain\n user: any\n tx: EntityManager\n}\n\ninterface ICustomAppContext {\n t: any\n ssoMiddlewares: any[]\n}\n\ninitLicense(config.get('licenseKey'))\n\n/* bootstrap */\nconst bootstrap = async () => {\n await databaseInitializer()\n\n const app = new Koa<ICustomAppState, ICustomAppContext>() as any\n app.proxy = true\n\n app.use(\n cors({\n origin: function (ctx) {\n return ctx.request.headers.origin || '*'\n },\n exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],\n maxAge: 5,\n credentials: true,\n /* allowMethods: ['GET', 'POST', 'DELETE'], -- use default */\n allowHeaders: ['Content-Type', 'Authorization', 'Accept']\n })\n )\n\n var subscriptionMiddleware = []\n process.emit('bootstrap-module-subscription' as any, app, subscriptionMiddleware)\n\n const builtSchema = await schema()\n\n const httpServer = createServer(app.callback())\n const websocketServer = new WebSocketServer({\n server: httpServer,\n path: '/graphql'\n })\n\n // Save the returned server's info so we can shut down this server later\n const serverCleanup = useServer(\n {\n schema: builtSchema,\n context: async (ctx, msg, args) => {\n return ctx['context']\n },\n onConnect: async ctx => {\n var { extra, connectionParams } = ctx\n var { request } = extra\n\n if (((connectionParams['headers'] as any) || connectionParams)?.referer) {\n var url = new URL(((connectionParams['headers'] as any) || connectionParams).referer)\n var accessToken = url.searchParams.get('access_token')\n if (accessToken) {\n connectionParams['headers']['authorization'] = accessToken\n }\n }\n\n request.headers = {\n ...request.headers,\n ...(connectionParams['headers'] || (connectionParams as any))\n }\n\n var koacontext = await app.createContext(request, new http.ServerResponse(request))\n koacontext['state'] = {}\n\n /* in case connect error(like a authentication error) just throw exception */\n var middlewares = [domainMiddleware, ...subscriptionMiddleware]\n const fn = co.wrap(compose(middlewares))\n\n await fn(koacontext)\n\n return (ctx['context'] = koacontext)\n },\n onDisconnect(ctx, code, reason) {\n console.log('Disconnected!')\n },\n onError(ctx, msg, errors) {\n console.error(msg, errors)\n }\n },\n websocketServer\n )\n\n const server = new ApolloServer({\n schema: builtSchema,\n formatError: error => {\n logger.error(error)\n return error\n },\n introspection: true,\n csrfPrevention: true,\n plugins: [\n // Proper shutdown for the HTTP server.\n ApolloServerPluginDrainHttpServer({ httpServer }),\n // Proper shutdown for the WebSocket server.\n {\n async serverWillStart() {\n return {\n async drainServer() {\n await serverCleanup.dispose()\n }\n }\n }\n },\n // TODO make this landing page work\n ApolloServerPluginLandingPageLocalDefault({\n footer: false,\n embed: true,\n includeCookies: true\n })\n ],\n cache: 'bounded'\n })\n\n await server.start()\n\n GraphqlLocalClient.init(builtSchema, app)\n\n orderedModuleNames.forEach(name => {\n const { initMiddlewares } = loader(name)\n initMiddlewares && initMiddlewares(app)\n })\n\n const render = require('@things-factory/ejs-remote')\n render(app, {\n root: '/views',\n host: `http://127.0.0.1:${PORT}`,\n layout: false,\n viewExt: 'html',\n cache: false,\n debug: false\n })\n\n const middleware = await koaWebpack({\n compiler,\n hotClient: {},\n devMiddleware: {\n publicPath: webpackConfig.output.publicPath,\n stats: { colors: true }\n }\n })\n\n // only for development mode. triggered after webpack compilation is done.\n compiler.hooks.done.tap({ name: 'server-dev' }, stats => {\n process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)\n })\n\n app.use(koaBodyParser(bodyParserOption))\n\n /* routers */\n const ssoMiddlewares = []\n process.emit('bootstrap-collect-sso-middleware' as any, null, ssoMiddlewares)\n app.ssoMiddlewares = ssoMiddlewares\n\n process.emit('bootstrap-module-global-public-route' as any, app, globalPublicRouter)\n process.emit('bootstrap-module-global-private-route' as any, app, globalPrivateRouter)\n process.emit('bootstrap-module-domain-public-route' as any, app, domainPublicRouter)\n process.emit('bootstrap-module-domain-private-route' as any, app, domainPrivateRouter)\n\n app.use(checkValidity) /* Check the license after most of the context has been built */\n\n app\n .use(globalPublicRouter.routes())\n .use(globalPublicRouter.allowedMethods())\n .use(globalPrivateRouter.routes())\n .use(globalPrivateRouter.allowedMethods())\n .use(domainPublicRouter.routes())\n .use(domainPublicRouter.allowedMethods())\n .use(domainPrivateRouter.routes())\n .use(domainPrivateRouter.allowedMethods())\n\n /* Graphql Upload's multipart/form-data handling affects the restful file upload feature, so it should be placed after the routers configuration. */\n app.use(graphqlUploadKoa(fileUploadOption))\n\n graphqlRouter.post(\n '/graphql',\n koaMiddleware(server, {\n context: async ({ ctx }) => ctx\n })\n )\n app.use(graphqlRouter.routes())\n app.use(graphqlRouter.allowedMethods())\n\n /* should follow this order : history-fallback => webpack-middleware */\n app.use(historyApiFallback({ whiteList: [] }))\n\n app.use(middleware)\n\n httpServer.listen({ port: PORT }, () => {\n logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)\n logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}/graphql`)\n\n process.emit('bootstrap-module-start' as any, { app, config, builtSchema, httpServer } as any)\n })\n}\n\nbootstrap()\n"]}
1
+ {"version":3,"file":"server-dev.js","sourceRoot":"","sources":["../server/server-dev.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,4DAA4D;AAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAA;AAEjD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAEjE,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAA;AACpC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;AAE1B,2CAA6C;AAC7C,2EAAyF;AACzF,uEAAqG;AAErG,8CAAoD;AACpD,0DAA+B;AAC/B,qGAAiE;AACjE,8CAAiD;AACjD,+BAAmC;AACnC,sDAAqB;AACrB,4EAA0C;AAC1C,sEAAiC;AACjC,yFAAsE;AACtE,2BAAoC;AACpC,oDAAmB;AACnB,wDAAuB;AAEvB,gFAA8C;AAC9C,6DAA4B;AAC5B,6CAAgF;AAChF,qFAAoF;AAEpF,iEAA2D;AAC3D,sDAA6D;AAC7D,uCAMkB;AAClB,qCAAiC;AAGjC,+CAAgD;AAEhD,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE;IACtC,YAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IAEvD,iBAAiB;AACnB,CAAC,CAAC,CAAA;AAEF,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAE5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,2CAA2C,EAAE,YAAM,CAAC,GAAG,CAA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ChG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,EAAE,CAAA","sourcesContent":["// ts-import-sorter: disable\n\n/* following 7 lines should be located in top of the file */\nconst OS = require('os')\nprocess.env.UV_THREADPOOL_SIZE = OS.cpus().length\n\nconsole.log('UV_THREADPOOL_SIZE', process.env.UV_THREADPOOL_SIZE)\n\nprocess.env.NODE_ENV = 'development'\nprocess.setMaxListeners(0)\n\nimport { ApolloServer } from '@apollo/server'\nimport { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'\nimport { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default'\n\nimport { koaMiddleware } from '@as-integrations/koa'\nimport bytesFormat from 'bytes'\nimport graphqlUploadKoa from 'graphql-upload/graphqlUploadKoa.js'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport { createServer } from 'http'\nimport Koa from 'koa'\nimport koaBodyParser from 'koa-bodyparser'\nimport compose from 'koa-compose'\nimport { historyApiFallback } from 'koa2-connect-history-api-fallback'\nimport { WebSocketServer } from 'ws'\nimport co from 'co'\nimport http from 'http'\n\nimport koaWebpack from '@hatiolab/koa-webpack'\nimport cors from '@koa/cors'\nimport { config, loader, logger, orderedModuleNames } from '@things-factory/env'\nimport { initLicense, checkValidity } from '@things-factory/operato-license-checker'\n\nimport { GraphqlLocalClient } from './graphql-local-client'\nimport { databaseInitializer } from './initializers/database'\nimport {\n domainPrivateRouter,\n domainPublicRouter,\n globalPrivateRouter,\n globalPublicRouter,\n graphqlRouter\n} from './routers'\nimport { schema } from './schema'\nimport { Domain } from './service'\nimport { EntityManager } from 'typeorm'\nimport { domainMiddleware } from './middlewares'\n\nprocess.on('uncaughtException', error => {\n logger.error('uncaughtException: ', error, error.stack)\n\n //process.exit(1)\n})\n\nconst args = require('args')\n\nargs.option('port', 'The port on which the app will be running', config.get('port', 3000))\nargs.option(\n 'inspect',\n `The address on which the inspection will be running. Used in development mode only.\n This option is just to prevent termination for reasons of not recognizing the 'inspect' option.`,\n config.get('inspect', ':9229')\n)\nargs.option('webpack', 'webpack configuration file', config.get('webpack'))\n\nconst flags = args.parse(process.argv)\n\nconst webpack = require('webpack')\nconst webpackConfig = require(flags.webpack || '@things-factory/builder/webpack.config.dev.js')\n\nconst compiler = webpack(webpackConfig)\n\nconst PORT = (process.env.PORT = flags.port)\n\nconst requestBody = config.get('requestBody') || {}\n\nconst bodyParserOption = {\n formLimit: requestBody.formLimit || '10mb',\n jsonLimit: requestBody.jsonLimit || '10mb',\n textLimit: requestBody.textLimit || '10mb'\n}\n\nconst fileUpload = config.get('fileUpload') || {}\nconst fileUploadOption = {\n maxFileSize: bytesFormat.parse(fileUpload.maxFileSize) || bytesFormat.parse('10mb'),\n maxFiles: fileUpload.maxFiles || 10\n}\n\ninterface ICustomAppState {\n domain: Domain\n user: any\n tx: EntityManager\n}\n\ninterface ICustomAppContext {\n t: any\n ssoMiddlewares: any[]\n}\n\ninitLicense(config.get('licenseKey'))\n\n/* bootstrap */\nconst bootstrap = async () => {\n await databaseInitializer()\n\n const app = new Koa<ICustomAppState, ICustomAppContext>() as any\n app.proxy = true\n\n app.use(\n cors({\n origin: function (ctx) {\n return ctx.request.headers.origin || '*'\n },\n exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],\n maxAge: 5,\n credentials: true,\n /* allowMethods: ['GET', 'POST', 'DELETE'], -- use default */\n allowHeaders: ['Content-Type', 'Authorization', 'Accept']\n })\n )\n\n var subscriptionMiddleware = []\n process.emit('bootstrap-module-subscription' as any, app, subscriptionMiddleware)\n\n const builtSchema = await schema()\n\n const httpServer = createServer(app.callback())\n const websocketServer = new WebSocketServer({\n server: httpServer,\n path: '/graphql'\n })\n\n // Save the returned server's info so we can shut down this server later\n const serverCleanup = useServer(\n {\n schema: builtSchema,\n context: async (ctx, msg, args) => {\n return ctx['context']\n },\n onConnect: async ctx => {\n var { extra, connectionParams } = ctx\n var { request } = extra\n\n if (((connectionParams['headers'] as any) || connectionParams)?.referer) {\n var url = new URL(((connectionParams['headers'] as any) || connectionParams).referer)\n var accessToken = url.searchParams.get('access_token')\n if (accessToken) {\n connectionParams['headers']['authorization'] = accessToken\n }\n }\n\n request.headers = {\n ...request.headers,\n ...(connectionParams['headers'] || (connectionParams as any))\n }\n\n var koacontext = await app.createContext(request, new http.ServerResponse(request))\n koacontext['state'] = {}\n\n /* in case connect error(like a authentication error) just throw exception */\n var middlewares = [domainMiddleware, ...subscriptionMiddleware]\n const fn = co.wrap(compose(middlewares))\n\n await fn(koacontext)\n\n return (ctx['context'] = koacontext)\n },\n onDisconnect(ctx, code, reason) {\n console.log('Disconnected!')\n },\n onError(ctx, msg, errors) {\n console.error(msg, errors)\n }\n },\n websocketServer\n )\n\n const server = new ApolloServer({\n schema: builtSchema,\n formatError: error => {\n logger.error(error)\n return error\n },\n introspection: true,\n csrfPrevention: true,\n plugins: [\n // Proper shutdown for the HTTP server.\n ApolloServerPluginDrainHttpServer({ httpServer }),\n // Proper shutdown for the WebSocket server.\n {\n async serverWillStart() {\n return {\n async drainServer() {\n await serverCleanup.dispose()\n }\n }\n }\n },\n // TODO make this landing page work\n ApolloServerPluginLandingPageLocalDefault({\n footer: false,\n embed: true,\n includeCookies: true\n })\n ],\n cache: 'bounded'\n })\n\n await server.start()\n\n GraphqlLocalClient.init(builtSchema, app)\n\n orderedModuleNames.forEach(name => {\n const { initMiddlewares } = loader(name)\n initMiddlewares && initMiddlewares(app)\n })\n\n const render = require('@things-factory/ejs-remote')\n render(app, {\n root: '/views',\n host: `http://127.0.0.1:${PORT}`,\n layout: false,\n viewExt: 'html',\n cache: false,\n debug: false\n })\n\n const middleware = await koaWebpack({\n compiler,\n hotClient: {},\n devMiddleware: {\n publicPath: webpackConfig.output.publicPath,\n stats: { colors: true }\n }\n })\n\n // only for development mode. triggered after webpack compilation is done.\n compiler.hooks.done.tap({ name: 'server-dev' }, stats => {\n process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)\n })\n\n app.use(koaBodyParser(bodyParserOption))\n\n /* routers */\n const ssoMiddlewares = []\n process.emit('bootstrap-collect-sso-middleware' as any, null, ssoMiddlewares)\n app.ssoMiddlewares = ssoMiddlewares\n\n process.emit('bootstrap-module-global-public-route' as any, app, globalPublicRouter)\n process.emit('bootstrap-module-global-private-route' as any, app, globalPrivateRouter)\n process.emit('bootstrap-module-domain-public-route' as any, app, domainPublicRouter)\n process.emit('bootstrap-module-domain-private-route' as any, app, domainPrivateRouter)\n\n app.use(checkValidity) /* Check the license after most of the context has been built */\n\n app\n .use(globalPublicRouter.routes())\n .use(globalPublicRouter.allowedMethods())\n .use(globalPrivateRouter.routes())\n .use(globalPrivateRouter.allowedMethods())\n .use(domainPublicRouter.routes())\n .use(domainPublicRouter.allowedMethods())\n .use(domainPrivateRouter.routes())\n .use(domainPrivateRouter.allowedMethods())\n\n /* Graphql Upload's multipart/form-data handling affects the restful file upload feature, so it should be placed after the routers configuration. */\n app.use(graphqlUploadKoa(fileUploadOption))\n\n graphqlRouter.post(\n '/graphql',\n koaMiddleware(server, {\n context: async ({ ctx }) => ctx\n })\n )\n app.use(graphqlRouter.routes())\n app.use(graphqlRouter.allowedMethods())\n\n /* should follow this order : history-fallback => webpack-middleware */\n app.use(historyApiFallback({ whiteList: [] }))\n\n app.use(middleware)\n\n httpServer.listen({ port: PORT }, () => {\n logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)\n logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}/graphql`)\n\n process.emit('bootstrap-module-start' as any, { app, config, builtSchema, httpServer } as any)\n })\n}\n\nbootstrap()\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../server/server.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,4DAA4D;AAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,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I,UAAU,CAAC,CAAA;QAErE,OAAO,CAAC,IAAI,CAAC,wBAA+B,EAAE,EAAE,GAAG,EAAE,MAAM,EAAN,YAAM,EAAE,WAAW,EAAE,UAAU,EAAS,CAAC,CAAA;IAChG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,EAAE,CAAA","sourcesContent":["// ts-import-sorter: disable\n\n/* following 5 lines should be located in top of the file */\nconst OS = require('os')\nprocess.env.UV_THREADPOOL_SIZE = OS.cpus().length\n\nconsole.log('UV_THREADPOOL_SIZE', process.env.UV_THREADPOOL_SIZE)\n\nprocess.env.NODE_ENV = 'production'\nprocess.setMaxListeners(0)\n\nimport { ApolloServer } from '@apollo/server'\nimport { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'\nimport { ApolloServerPluginLandingPageProductionDefault } from '@apollo/server/plugin/landingPage/default'\nimport { koaMiddleware } from '@as-integrations/koa'\n\nimport bytesFormat from 'bytes'\nimport graphqlUploadKoa from 'graphql-upload/graphqlUploadKoa.js'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport { createServer } from 'http'\nimport Koa from 'koa'\nimport koaBodyParser from 'koa-bodyparser'\nimport koaStatic from 'koa-static'\nimport compose from 'koa-compose'\nimport { historyApiFallback } from 'koa2-connect-history-api-fallback'\nimport { WebSocketServer } from 'ws'\nimport co from 'co'\nimport http from 'http'\n\nimport cors from '@koa/cors'\nimport { config, loader, logger, orderedModuleNames } from '@things-factory/env'\nimport { initLicense, checkValidity } from '@things-factory/operato-license-checker'\n\nimport { GraphqlLocalClient } from './graphql-local-client'\nimport { databaseInitializer } from './initializers/database'\nimport {\n domainPrivateRouter,\n domainPublicRouter,\n globalPrivateRouter,\n globalPublicRouter,\n graphqlRouter\n} from './routers'\nimport { schema } from './schema'\nimport { domainMiddleware } from './middlewares'\n\nprocess.on('uncaughtException', error => {\n logger.error('uncaughtException: ', error, error.stack)\n\n //process.exit(1)\n})\n\nconst args = require('args')\n\nargs.option('port', 'The port on which the app will be running', config.get('port', 3000))\n\nconst flags = args.parse(process.argv)\n\nconst path = require('path')\n\nconst PORT = (process.env.PORT = flags.port)\n\nconst requestBody = config.get('requestBody') || {}\n\nconst bodyParserOption = {\n formLimit: requestBody.formLimit || '10mb',\n jsonLimit: requestBody.jsonLimit || '10mb',\n textLimit: requestBody.textLimit || '10mb'\n}\n\nconst fileUpload = config.get('fileUpload') || {}\nconst fileUploadOption = {\n maxFileSize: bytesFormat.parse(fileUpload.maxFileSize) || bytesFormat.parse('10mb'),\n maxFiles: fileUpload.maxFiles || 10\n}\n\ninitLicense(config.get('licenseKey'))\n\n/* bootstrap */\nconst bootstrap = async () => {\n await databaseInitializer()\n\n const app = new Koa() as any\n app.proxy = true\n\n app.use(\n cors({\n origin: function (ctx) {\n return ctx.request.headers.origin || '*'\n },\n exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],\n maxAge: 5,\n credentials: true,\n /* allowMethods: ['GET', 'POST', 'DELETE'], -- use default */\n allowHeaders: ['Content-Type', 'Authorization', 'Accept']\n })\n )\n\n var subscriptionMiddleware = []\n process.emit('bootstrap-module-subscription' as any, app, subscriptionMiddleware)\n\n const builtSchema = await schema()\n\n const httpServer = createServer(app.callback())\n const websocketServer = new WebSocketServer({\n server: httpServer,\n path: '/graphql'\n })\n\n // Save the returned server's info so we can shut down this server later\n const serverCleanup = useServer(\n {\n schema: builtSchema,\n context: async (ctx, msg, args) => {\n return ctx['context']\n },\n onConnect: async ctx => {\n var { extra, connectionParams } = ctx\n var { request } = extra\n\n if (((connectionParams['headers'] as any) || connectionParams)?.referer) {\n var url = new URL(((connectionParams['headers'] as any) || connectionParams).referer)\n var accessToken = url.searchParams.get('access_token')\n if (accessToken) {\n connectionParams['headers']['authorization'] = accessToken\n }\n }\n\n request.headers = {\n ...request.headers,\n ...(connectionParams['headers'] || (connectionParams as any))\n }\n\n var koacontext = await app.createContext(request, new http.ServerResponse(request))\n koacontext['state'] = {}\n\n /* in case connect error(like a authentication error) just throw exception */\n var middlewares = [domainMiddleware, ...subscriptionMiddleware]\n const fn = co.wrap(compose(middlewares))\n\n await fn(koacontext)\n\n return (ctx['context'] = koacontext)\n },\n onDisconnect(ctx, code, reason) {\n console.log('Disconnected!')\n },\n onError(ctx, msg, errors) {\n console.error(msg, errors)\n }\n },\n websocketServer\n )\n\n const server = new ApolloServer({\n schema: builtSchema,\n formatError: error => {\n logger.error(error)\n return error\n },\n introspection: true,\n csrfPrevention: true,\n plugins: [\n // Proper shutdown for the HTTP server.\n ApolloServerPluginDrainHttpServer({ httpServer }),\n // Proper shutdown for the WebSocket server.\n {\n async serverWillStart() {\n return {\n async drainServer() {\n await serverCleanup.dispose()\n }\n }\n }\n },\n // TODO make this landing page work\n ApolloServerPluginLandingPageProductionDefault({\n graphRef: 'my-graph-id@my-graph-variant',\n footer: false\n })\n ],\n cache: 'bounded'\n })\n\n await server.start()\n\n GraphqlLocalClient.init(builtSchema, app)\n\n orderedModuleNames.forEach(name => {\n const { initMiddlewares } = loader(name)\n initMiddlewares && initMiddlewares(app)\n })\n\n const render = require('@things-factory/ejs-remote')\n render(app, {\n root: '/views',\n host: `http://127.0.0.1:${PORT}`,\n layout: false,\n viewExt: 'html',\n cache: true,\n debug: false\n })\n\n app.use(koaBodyParser(bodyParserOption))\n\n /* routers */\n const ssoMiddlewares = []\n process.emit('bootstrap-collect-sso-middleware' as any, null, ssoMiddlewares)\n app.ssoMiddlewares = ssoMiddlewares\n\n process.emit('bootstrap-module-global-public-route' as any, app, globalPublicRouter)\n process.emit('bootstrap-module-global-private-route' as any, app, globalPrivateRouter)\n process.emit('bootstrap-module-domain-public-route' as any, app, domainPublicRouter)\n process.emit('bootstrap-module-domain-private-route' as any, app, domainPrivateRouter)\n\n app.use(checkValidity) /* Check the license after most of the context has been built */\n\n app\n .use(globalPublicRouter.routes())\n .use(globalPublicRouter.allowedMethods())\n .use(globalPrivateRouter.routes())\n .use(globalPrivateRouter.allowedMethods())\n .use(domainPublicRouter.routes())\n .use(domainPublicRouter.allowedMethods())\n .use(domainPrivateRouter.routes())\n .use(domainPrivateRouter.allowedMethods())\n\n /* Graphql Upload's multipart/form-data handling affects the restful file upload feature, so it should be placed after the routers configuration. */\n app.use(graphqlUploadKoa(fileUploadOption))\n\n graphqlRouter.post(\n '/graphql',\n koaMiddleware(server, {\n context: async ({ ctx }) => ctx\n })\n )\n app.use(graphqlRouter.routes())\n app.use(graphqlRouter.allowedMethods())\n\n /* should follow this order : history-fallback => koaStatic */\n app.use(historyApiFallback({ whiteList: [] }))\n\n app.use(\n koaStatic(path.join(process.cwd(), 'dist-app'), {\n index: 'index.html'\n })\n )\n\n httpServer.listen({ port: PORT }, () => {\n logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)\n logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}/graphql`)\n\n process.emit('bootstrap-module-start' as any, { app, config, builtSchema, httpServer } as any)\n })\n}\n\nbootstrap()\n"]}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../server/server.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;AAE5B,4DAA4D;AAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAA;AAEjD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAEjE,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAA;AACnC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;AAE1B,2CAA6C;AAC7C,2EAAyF;AACzF,uEAA0G;AAC1G,8CAAoD;AAEpD,0DAA+B;AAC/B,qGAAiE;AACjE,8CAAiD;AACjD,+BAAmC;AACnC,sDAAqB;AACrB,4EAA0C;AAC1C,oEAAkC;AAClC,sEAAiC;AACjC,yFAAsE;AACtE,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IACpJ,GAAG,CAAC,GAAG,CAAC,IAAA,6BAAgB,EAAC,gBAAgB,CAAC,CAAC,CAAA;IAE3C,uBAAa,CAAC,IAAI,CAChB,UAAU,EACV,IAAA,mBAAa,EAAC,MAAM,EAAE;QACpB,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG;KAChC,CAAC,CACH,CAAA;IACD,GAAG,CAAC,GAAG,CAAC,uBAAa,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/B,GAAG,CAAC,GAAG,CAAC,uBAAa,CAAC,cAAc,EAAE,CAAC,CAAA;IAEvC,8DAA8D;IAC9D,GAAG,CAAC,GAAG,CAAC,IAAA,sDAAkB,EAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAE9C,GAAG,CAAC,GAAG,CACL,IAAA,oBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,EAAE;QAC9C,KAAK,EAAE,YAAY;KACpB,CAAC,CACH,CAAA;IAED,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE;QACrC,YAAM,CAAC,IAAI,CAAC,qCAAqC,IAAI,UAAU,CAAC,CAAA;QAChE,YAAM,CAAC,IAAI,CAAC,0CAA0C,IAAI,UAAU,CAAC,CAAA;QAErE,OAAO,CAAC,IAAI,CAAC,wBAA+B,EAAE,EAAE,GAAG,EAAE,MAAM,EAAN,YAAM,EAAE,WAAW,EAAE,UAAU,EAAS,CAAC,CAAA;IAChG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,EAAE,CAAA","sourcesContent":["// ts-import-sorter: disable\n\n/* following 5 lines should be located in top of the file */\nconst OS = require('os')\nprocess.env.UV_THREADPOOL_SIZE = OS.cpus().length\n\nconsole.log('UV_THREADPOOL_SIZE', process.env.UV_THREADPOOL_SIZE)\n\nprocess.env.NODE_ENV = 'production'\nprocess.setMaxListeners(0)\n\nimport { ApolloServer } from '@apollo/server'\nimport { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'\nimport { ApolloServerPluginLandingPageProductionDefault } from '@apollo/server/plugin/landingPage/default'\nimport { koaMiddleware } from '@as-integrations/koa'\n\nimport bytesFormat from 'bytes'\nimport graphqlUploadKoa from 'graphql-upload/graphqlUploadKoa.js'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport { createServer } from 'http'\nimport Koa from 'koa'\nimport koaBodyParser from 'koa-bodyparser'\nimport koaStatic from 'koa-static'\nimport compose from 'koa-compose'\nimport { historyApiFallback } from 'koa2-connect-history-api-fallback'\nimport { WebSocketServer } from 'ws'\nimport co from 'co'\nimport http from 'http'\n\nimport cors from '@koa/cors'\nimport { config, loader, logger, orderedModuleNames } from '@things-factory/env'\nimport { initLicense, checkValidity } from '@things-factory/operato-license-checker'\n\nimport { GraphqlLocalClient } from './graphql-local-client'\nimport { databaseInitializer } from './initializers/database'\nimport {\n domainPrivateRouter,\n domainPublicRouter,\n globalPrivateRouter,\n globalPublicRouter,\n graphqlRouter\n} from './routers'\nimport { schema } from './schema'\nimport { domainMiddleware } from './middlewares'\n\nprocess.on('uncaughtException', error => {\n logger.error('uncaughtException: ', error, error.stack)\n\n //process.exit(1)\n})\n\nconst args = require('args')\n\nargs.option('port', 'The port on which the app will be running', config.get('port', 3000))\n\nconst flags = args.parse(process.argv)\n\nconst path = require('path')\n\nconst PORT = (process.env.PORT = flags.port)\n\nconst requestBody = config.get('requestBody') || {}\n\nconst bodyParserOption = {\n formLimit: requestBody.formLimit || '10mb',\n jsonLimit: requestBody.jsonLimit || '10mb',\n textLimit: requestBody.textLimit || '10mb'\n}\n\nconst fileUpload = config.get('fileUpload') || {}\nconst fileUploadOption = {\n maxFileSize: bytesFormat.parse(fileUpload.maxFileSize) || bytesFormat.parse('10mb'),\n maxFiles: fileUpload.maxFiles || 10\n}\n\ninitLicense(config.get('licenseKey'))\n\n/* bootstrap */\nconst bootstrap = async () => {\n await databaseInitializer()\n\n const app = new Koa() as any\n app.proxy = true\n\n app.use(\n cors({\n origin: function (ctx) {\n return ctx.request.headers.origin || '*'\n },\n exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],\n maxAge: 5,\n credentials: true,\n /* allowMethods: ['GET', 'POST', 'DELETE'], -- use default */\n allowHeaders: ['Content-Type', 'Authorization', 'Accept']\n })\n )\n\n var subscriptionMiddleware = []\n process.emit('bootstrap-module-subscription' as any, app, subscriptionMiddleware)\n\n const builtSchema = await schema()\n\n const httpServer = createServer(app.callback())\n const websocketServer = new WebSocketServer({\n server: httpServer,\n path: '/graphql'\n })\n\n // Save the returned server's info so we can shut down this server later\n const serverCleanup = useServer(\n {\n schema: builtSchema,\n context: async (ctx, msg, args) => {\n return ctx['context']\n },\n onConnect: async ctx => {\n var { extra, connectionParams } = ctx\n var { request } = extra\n\n if (((connectionParams['headers'] as any) || connectionParams)?.referer) {\n var url = new URL(((connectionParams['headers'] as any) || connectionParams).referer)\n var accessToken = url.searchParams.get('access_token')\n if (accessToken) {\n connectionParams['headers']['authorization'] = accessToken\n }\n }\n\n request.headers = {\n ...request.headers,\n ...(connectionParams['headers'] || (connectionParams as any))\n }\n\n var koacontext = await app.createContext(request, new http.ServerResponse(request))\n koacontext['state'] = {}\n\n /* in case connect error(like a authentication error) just throw exception */\n var middlewares = [domainMiddleware, ...subscriptionMiddleware]\n const fn = co.wrap(compose(middlewares))\n\n await fn(koacontext)\n\n return (ctx['context'] = koacontext)\n },\n onDisconnect(ctx, code, reason) {\n console.log('Disconnected!')\n },\n onError(ctx, msg, errors) {\n console.error(msg, errors)\n }\n },\n websocketServer\n )\n\n const server = new ApolloServer({\n schema: builtSchema,\n formatError: error => {\n logger.error(error)\n return error\n },\n introspection: true,\n csrfPrevention: true,\n plugins: [\n // Proper shutdown for the HTTP server.\n ApolloServerPluginDrainHttpServer({ httpServer }),\n // Proper shutdown for the WebSocket server.\n {\n async serverWillStart() {\n return {\n async drainServer() {\n await serverCleanup.dispose()\n }\n }\n }\n },\n // TODO make this landing page work\n ApolloServerPluginLandingPageProductionDefault({\n graphRef: 'my-graph-id@my-graph-variant',\n footer: false\n })\n ],\n cache: 'bounded'\n })\n\n await server.start()\n\n GraphqlLocalClient.init(builtSchema, app)\n\n orderedModuleNames.forEach(name => {\n const { initMiddlewares } = loader(name)\n initMiddlewares && initMiddlewares(app)\n })\n\n const render = require('@things-factory/ejs-remote')\n render(app, {\n root: '/views',\n host: `http://127.0.0.1:${PORT}`,\n layout: false,\n viewExt: 'html',\n cache: true,\n debug: false\n })\n\n app.use(koaBodyParser(bodyParserOption))\n\n /* routers */\n const ssoMiddlewares = []\n process.emit('bootstrap-collect-sso-middleware' as any, null, ssoMiddlewares)\n app.ssoMiddlewares = ssoMiddlewares\n\n process.emit('bootstrap-module-global-public-route' as any, app, globalPublicRouter)\n process.emit('bootstrap-module-global-private-route' as any, app, globalPrivateRouter)\n process.emit('bootstrap-module-domain-public-route' as any, app, domainPublicRouter)\n process.emit('bootstrap-module-domain-private-route' as any, app, domainPrivateRouter)\n\n app.use(checkValidity) /* Check the license after most of the context has been built */\n\n app\n .use(globalPublicRouter.routes())\n .use(globalPublicRouter.allowedMethods())\n .use(globalPrivateRouter.routes())\n .use(globalPrivateRouter.allowedMethods())\n .use(domainPublicRouter.routes())\n .use(domainPublicRouter.allowedMethods())\n .use(domainPrivateRouter.routes())\n .use(domainPrivateRouter.allowedMethods())\n\n /* Graphql Upload's multipart/form-data handling affects the restful file upload feature, so it should be placed after the routers configuration. */\n app.use(graphqlUploadKoa(fileUploadOption))\n\n graphqlRouter.post(\n '/graphql',\n koaMiddleware(server, {\n context: async ({ ctx }) => ctx\n })\n )\n app.use(graphqlRouter.routes())\n app.use(graphqlRouter.allowedMethods())\n\n /* should follow this order : history-fallback => koaStatic */\n app.use(historyApiFallback({ whiteList: [] }))\n\n app.use(\n koaStatic(path.join(process.cwd(), 'dist-app'), {\n index: 'index.html'\n })\n )\n\n httpServer.listen({ port: PORT }, () => {\n logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}/graphql`)\n logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}/graphql`)\n\n process.emit('bootstrap-module-start' as any, { app, config, builtSchema, httpServer } as any)\n })\n}\n\nbootstrap()\n"]}
@@ -13,13 +13,14 @@ var AttributeSetItemType;
13
13
  AttributeSetItemType["date"] = "date";
14
14
  AttributeSetItemType["datetime"] = "datetime";
15
15
  AttributeSetItemType["file"] = "file";
16
- })(AttributeSetItemType = exports.AttributeSetItemType || (exports.AttributeSetItemType = {}));
16
+ })(AttributeSetItemType || (exports.AttributeSetItemType = AttributeSetItemType = {}));
17
17
  (0, type_graphql_1.registerEnumType)(AttributeSetItemType, {
18
18
  name: 'AttributeSetItemType',
19
19
  description: 'type enumeration of a attribute-set-item'
20
20
  });
21
21
  let AttributeSetItem = class AttributeSetItem {
22
22
  };
23
+ exports.AttributeSetItem = AttributeSetItem;
23
24
  tslib_1.__decorate([
24
25
  (0, type_graphql_1.Field)(),
25
26
  tslib_1.__metadata("design:type", String)
@@ -48,12 +49,12 @@ tslib_1.__decorate([
48
49
  (0, type_graphql_1.Field)(type => common_types_1.ScalarObject, { nullable: true }),
49
50
  tslib_1.__metadata("design:type", Object)
50
51
  ], AttributeSetItem.prototype, "options", void 0);
51
- AttributeSetItem = tslib_1.__decorate([
52
+ exports.AttributeSetItem = AttributeSetItem = tslib_1.__decorate([
52
53
  (0, type_graphql_1.ObjectType)({ description: 'Entity for AttributeSetItem' })
53
54
  ], AttributeSetItem);
54
- exports.AttributeSetItem = AttributeSetItem;
55
55
  let AttributeSetItemPatch = class AttributeSetItemPatch {
56
56
  };
57
+ exports.AttributeSetItemPatch = AttributeSetItemPatch;
57
58
  tslib_1.__decorate([
58
59
  (0, type_graphql_1.Field)({ nullable: true }),
59
60
  tslib_1.__metadata("design:type", String)
@@ -82,8 +83,7 @@ tslib_1.__decorate([
82
83
  (0, type_graphql_1.Field)({ nullable: true }),
83
84
  tslib_1.__metadata("design:type", Boolean)
84
85
  ], AttributeSetItemPatch.prototype, "hidden", void 0);
85
- AttributeSetItemPatch = tslib_1.__decorate([
86
+ exports.AttributeSetItemPatch = AttributeSetItemPatch = tslib_1.__decorate([
86
87
  (0, type_graphql_1.InputType)()
87
88
  ], AttributeSetItemPatch);
88
- exports.AttributeSetItemPatch = AttributeSetItemPatch;
89
89
  //# sourceMappingURL=attribute-set-item-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribute-set-item-type.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAClF,kDAA8C;AAE9C,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,6CAAqB,CAAA;IACrB,qCAAa,CAAA;AACf,CAAC,EARW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAQ/B;AAED,IAAA,+BAAgB,EAAC,oBAAoB,EAAE;IACrC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,0CAA0C;CACxD,CAAC,CAAA;AAGK,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAqB5B,CAAA;AApBC;IAAC,IAAA,oBAAK,GAAE;;8CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACd;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACC;AAE3B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACb;AApBxB,gBAAgB;IAD5B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;GAC9C,gBAAgB,CAqB5B;AArBY,4CAAgB;AAwBtB,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAqBjC,CAAA;AApBC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACd;AAEZ;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAC7B;AAE3B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACb;AAEnC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;AApBL,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAqBjC;AArBY,sDAAqB","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport { ScalarObject } from '../common-types'\n\nexport enum AttributeSetItemType {\n number = 'number',\n text = 'text',\n boolean = 'boolean',\n select = 'select',\n date = 'date',\n datetime = 'datetime',\n file = 'file'\n}\n\nregisterEnumType(AttributeSetItemType, {\n name: 'AttributeSetItemType',\n description: 'type enumeration of a attribute-set-item'\n})\n\n@ObjectType({ description: 'Entity for AttributeSetItem' })\nexport class AttributeSetItem {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n tag?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hidden?: boolean\n\n @Field({ nullable: true })\n type?: AttributeSetItemType\n\n @Field(type => ScalarObject, { nullable: true })\n options?: { [option: string]: any }\n}\n\n@InputType()\nexport class AttributeSetItemPatch {\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n tag?: string\n\n @Field(type => AttributeSetItemType, { nullable: true })\n type?: AttributeSetItemType\n\n @Field(type => ScalarObject, { nullable: true })\n options?: { [option: string]: any }\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hidden?: boolean\n}\n"]}
1
+ {"version":3,"file":"attribute-set-item-type.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAClF,kDAA8C;AAE9C,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,2CAAmB,CAAA;IACnB,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,6CAAqB,CAAA;IACrB,qCAAa,CAAA;AACf,CAAC,EARW,oBAAoB,oCAApB,oBAAoB,QAQ/B;AAED,IAAA,+BAAgB,EAAC,oBAAoB,EAAE;IACrC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,0CAA0C;CACxD,CAAC,CAAA;AAGK,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAqB5B,CAAA;AArBY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,GAAE;;8CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACN;AAGpB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AE;GACC,qBAAqB,CAqBjC","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport { ScalarObject } from '../common-types'\n\nexport enum AttributeSetItemType {\n number = 'number',\n text = 'text',\n boolean = 'boolean',\n select = 'select',\n date = 'date',\n datetime = 'datetime',\n file = 'file'\n}\n\nregisterEnumType(AttributeSetItemType, {\n name: 'AttributeSetItemType',\n description: 'type enumeration of a attribute-set-item'\n})\n\n@ObjectType({ description: 'Entity for AttributeSetItem' })\nexport class AttributeSetItem {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n tag?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hidden?: boolean\n\n @Field({ nullable: true })\n type?: AttributeSetItemType\n\n @Field(type => ScalarObject, { nullable: true })\n options?: { [option: string]: any }\n}\n\n@InputType()\nexport class AttributeSetItemPatch {\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n tag?: string\n\n @Field(type => AttributeSetItemType, { nullable: true })\n type?: AttributeSetItemType\n\n @Field(type => ScalarObject, { nullable: true })\n options?: { [option: string]: any }\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n hidden?: boolean\n}\n"]}
@@ -62,6 +62,7 @@ let AttributeSetMutation = class AttributeSetMutation {
62
62
  return true;
63
63
  }
64
64
  };
65
+ exports.AttributeSetMutation = AttributeSetMutation;
65
66
  tslib_1.__decorate([
66
67
  (0, type_graphql_1.Directive)('@transaction'),
67
68
  (0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
@@ -123,8 +124,7 @@ tslib_1.__decorate([
123
124
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
124
125
  tslib_1.__metadata("design:returntype", Promise)
125
126
  ], AttributeSetMutation.prototype, "importAttributeSets", null);
126
- AttributeSetMutation = tslib_1.__decorate([
127
+ exports.AttributeSetMutation = AttributeSetMutation = tslib_1.__decorate([
127
128
  (0, type_graphql_1.Resolver)(attribute_set_1.AttributeSet)
128
129
  ], AttributeSetMutation);
129
- exports.AttributeSetMutation = AttributeSetMutation;
130
130
  //# sourceMappingURL=attribute-set-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribute-set-mutation.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAIzB,AAAN,KAAK,CAAC,kBAAkB,CAAmB,SAA0B,EAAS,OAAY;QACxF,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE5B,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAC,IAAI,mBAC3C,SAAS,EACZ,CAAA;IACJ,CAAC;IAKK,AAAN,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAY;QAEnB,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE5B,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAA;QACjD,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACzC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,iCACvB,SAAS,GACT,KAAK,EACR,CAAA;IACJ,CAAC;IAKK,AAAN,KAAK,CAAC,0BAA0B,CACe,OAA4B,EAClE,OAAY;QAEnB,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE5B,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW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CAAC;IACzB,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAE/E,mBAAA,IAAA,kBAAG,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,sCAAiB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAWP;AApHU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAqHhC;AArHY,oDAAoB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { AttributeSet } from './attribute-set'\nimport { NewAttributeSet, AttributeSetPatch } from './attribute-set-type'\n\n@Resolver(AttributeSet)\nexport class AttributeSetMutation {\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => AttributeSet, { description: 'To create new AttributeSet' })\n async createAttributeSet(@Arg('attribute') attribute: NewAttributeSet, @Ctx() context: any): Promise<AttributeSet> {\n const { tx } = context.state\n\n return await tx.getRepository(AttributeSet).save({\n ...attribute\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => AttributeSet, { description: 'To modify AttributeSet information' })\n async updateAttributeSet(\n @Arg('id') id: string,\n @Arg('patch') patch: AttributeSetPatch,\n @Ctx() context: any\n ): Promise<AttributeSet> {\n const { tx } = context.state\n\n const repository = tx.getRepository(AttributeSet)\n const attribute = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...attribute,\n ...patch\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => [AttributeSet], { description: \"To modify multiple AttributeSets' information\" })\n async updateMultipleAttributeSet(\n @Arg('patches', type => [AttributeSetPatch]) patches: AttributeSetPatch[],\n @Ctx() context: any\n ): Promise<AttributeSet[]> {\n const { tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const attributeRepo = tx.getRepository(AttributeSet)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await attributeRepo.save({\n ...newRecord\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const attribute = await attributeRepo.findOneBy({ id: updateRecord.id })\n\n const result = await attributeRepo.save({\n ...attribute,\n ...updateRecord\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete AttributeSet' })\n async deleteAttributeSet(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(AttributeSet).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple AttributeSets' })\n async deleteAttributeSets(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(AttributeSet).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple AttributeSets' })\n async importAttributeSets(\n @Arg('attributes', type => [AttributeSetPatch]) attributes: AttributeSetPatch[],\n @Ctx() context: any\n ): Promise<boolean> {\n const { tx } = context.state\n\n await Promise.all(\n attributes.map(async (attribute: AttributeSetPatch) => {\n await tx.getRepository(AttributeSet).save(attribute)\n })\n )\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"attribute-set-mutation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AAW,EAAE,kCAAkC,EAAE,CAAC;IAE/E,mBAAA,IAAA,kBAAG,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,sCAAiB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAWP;+BApHU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAqHhC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { AttributeSet } from './attribute-set'\nimport { NewAttributeSet, AttributeSetPatch } from './attribute-set-type'\n\n@Resolver(AttributeSet)\nexport class AttributeSetMutation {\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => AttributeSet, { description: 'To create new AttributeSet' })\n async createAttributeSet(@Arg('attribute') attribute: NewAttributeSet, @Ctx() context: any): Promise<AttributeSet> {\n const { tx } = context.state\n\n return await tx.getRepository(AttributeSet).save({\n ...attribute\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => AttributeSet, { description: 'To modify AttributeSet information' })\n async updateAttributeSet(\n @Arg('id') id: string,\n @Arg('patch') patch: AttributeSetPatch,\n @Ctx() context: any\n ): Promise<AttributeSet> {\n const { tx } = context.state\n\n const repository = tx.getRepository(AttributeSet)\n const attribute = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...attribute,\n ...patch\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => [AttributeSet], { description: \"To modify multiple AttributeSets' information\" })\n async updateMultipleAttributeSet(\n @Arg('patches', type => [AttributeSetPatch]) patches: AttributeSetPatch[],\n @Ctx() context: any\n ): Promise<AttributeSet[]> {\n const { tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const attributeRepo = tx.getRepository(AttributeSet)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await attributeRepo.save({\n ...newRecord\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const attribute = await attributeRepo.findOneBy({ id: updateRecord.id })\n\n const result = await attributeRepo.save({\n ...attribute,\n ...updateRecord\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete AttributeSet' })\n async deleteAttributeSet(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(AttributeSet).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple AttributeSets' })\n async deleteAttributeSets(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(AttributeSet).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple AttributeSets' })\n async importAttributeSets(\n @Arg('attributes', type => [AttributeSetPatch]) attributes: AttributeSetPatch[],\n @Ctx() context: any\n ): Promise<boolean> {\n const { tx } = context.state\n\n await Promise.all(\n attributes.map(async (attribute: AttributeSetPatch) => {\n await tx.getRepository(AttributeSet).save(attribute)\n })\n )\n\n return true\n }\n}\n"]}
@@ -29,6 +29,7 @@ let AttributeSetQuery = class AttributeSetQuery {
29
29
  return { items, total };
30
30
  }
31
31
  };
32
+ exports.AttributeSetQuery = AttributeSetQuery;
32
33
  tslib_1.__decorate([
33
34
  (0, type_graphql_1.Query)(returns => attribute_set_1.AttributeSet, { nullable: true, description: 'To fetch a AttributeSet' }),
34
35
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
@@ -47,14 +48,13 @@ tslib_1.__decorate([
47
48
  ], AttributeSetQuery.prototype, "attributeSetByEntity", null);
48
49
  tslib_1.__decorate([
49
50
  (0, type_graphql_1.Query)(returns => attribute_set_type_1.AttributeSetList, { description: 'To fetch multiple AttributeSets' }),
50
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
51
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => common_types_1.ListParam)),
51
52
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
52
53
  tslib_1.__metadata("design:type", Function),
53
54
  tslib_1.__metadata("design:paramtypes", [common_types_1.ListParam, Object]),
54
55
  tslib_1.__metadata("design:returntype", Promise)
55
56
  ], AttributeSetQuery.prototype, "attributeSets", null);
56
- AttributeSetQuery = tslib_1.__decorate([
57
+ exports.AttributeSetQuery = AttributeSetQuery = tslib_1.__decorate([
57
58
  (0, type_graphql_1.Resolver)(attribute_set_1.AttributeSet)
58
59
  ], AttributeSetQuery);
59
- exports.AttributeSetQuery = AttributeSetQuery;
60
60
  //# sourceMappingURL=attribute-set-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribute-set-query.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,mDAA8C;AAC9C,6DAAuD;AACvD,kDAA2C;AAC3C,0DAA2D;AAC3D,uCAA2D;AAGpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;QAC3D,OAAO,MAAM,IAAA,wBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,oBAAoB,CAAgB,MA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,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CA2B7B;AA3BY,8CAAiB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { AttributeSet } from './attribute-set'\nimport { AttributeSetList } from './attribute-set-type'\nimport { ListParam } from '../common-types'\nimport { getRepository } from '../../initializers/database'\nimport { getQueryBuilderFromListParams } from '../../utils'\n\n@Resolver(AttributeSet)\nexport class AttributeSetQuery {\n @Query(returns => AttributeSet!, { nullable: true, description: 'To fetch a AttributeSet' })\n async attributeSet(@Arg('id') id: string, @Ctx() context: any): Promise<AttributeSet> {\n return await getRepository(AttributeSet).findOne({\n where: { id }\n })\n }\n\n @Query(returns => AttributeSet!, { nullable: true, description: 'To fetch a AttributeSet by Entity name' })\n async attributeSetByEntity(@Arg('entity') entity: string, @Ctx() context: any): Promise<AttributeSet> {\n return await getRepository(AttributeSet).findOne({\n where: { entity }\n })\n }\n\n @Query(returns => AttributeSetList, { description: 'To fetch multiple AttributeSets' })\n async attributeSets(@Args() params: ListParam, @Ctx() context: any): Promise<AttributeSetList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(AttributeSet),\n searchables: ['entity', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n}\n"]}
1
+ {"version":3,"file":"attribute-set-query.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,mDAA8C;AAC9C,6DAAuD;AACvD,kDAA2C;AAC3C,0DAA2D;AAC3D,uCAA2D;AAGpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;QAC3D,OAAO,MAAM,IAAA,wBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,E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,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,wBAAS;;sDAU7D;4BA1BU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CA2B7B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { AttributeSet } from './attribute-set'\nimport { AttributeSetList } from './attribute-set-type'\nimport { ListParam } from '../common-types'\nimport { getRepository } from '../../initializers/database'\nimport { getQueryBuilderFromListParams } from '../../utils'\n\n@Resolver(AttributeSet)\nexport class AttributeSetQuery {\n @Query(returns => AttributeSet!, { nullable: true, description: 'To fetch a AttributeSet' })\n async attributeSet(@Arg('id') id: string, @Ctx() context: any): Promise<AttributeSet> {\n return await getRepository(AttributeSet).findOne({\n where: { id }\n })\n }\n\n @Query(returns => AttributeSet!, { nullable: true, description: 'To fetch a AttributeSet by Entity name' })\n async attributeSetByEntity(@Arg('entity') entity: string, @Ctx() context: any): Promise<AttributeSet> {\n return await getRepository(AttributeSet).findOne({\n where: { entity }\n })\n }\n\n @Query(returns => AttributeSetList, { description: 'To fetch multiple AttributeSets' })\n async attributeSets(@Args(type => ListParam) params: ListParam, @Ctx() context: any): Promise<AttributeSetList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(AttributeSet),\n searchables: ['entity', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n}\n"]}
@@ -7,6 +7,7 @@ const attribute_set_1 = require("./attribute-set");
7
7
  const attribute_set_item_type_1 = require("./attribute-set-item-type");
8
8
  let NewAttributeSet = class NewAttributeSet {
9
9
  };
10
+ exports.NewAttributeSet = NewAttributeSet;
10
11
  tslib_1.__decorate([
11
12
  (0, type_graphql_1.Field)(),
12
13
  tslib_1.__metadata("design:type", String)
@@ -23,12 +24,12 @@ tslib_1.__decorate([
23
24
  (0, type_graphql_1.Field)({ nullable: true }),
24
25
  tslib_1.__metadata("design:type", Boolean)
25
26
  ], NewAttributeSet.prototype, "active", void 0);
26
- NewAttributeSet = tslib_1.__decorate([
27
+ exports.NewAttributeSet = NewAttributeSet = tslib_1.__decorate([
27
28
  (0, type_graphql_1.InputType)()
28
29
  ], NewAttributeSet);
29
- exports.NewAttributeSet = NewAttributeSet;
30
30
  let AttributeSetPatch = class AttributeSetPatch {
31
31
  };
32
+ exports.AttributeSetPatch = AttributeSetPatch;
32
33
  tslib_1.__decorate([
33
34
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
34
35
  tslib_1.__metadata("design:type", String)
@@ -49,12 +50,12 @@ tslib_1.__decorate([
49
50
  (0, type_graphql_1.Field)({ nullable: true }),
50
51
  tslib_1.__metadata("design:type", String)
51
52
  ], AttributeSetPatch.prototype, "cuFlag", void 0);
52
- AttributeSetPatch = tslib_1.__decorate([
53
+ exports.AttributeSetPatch = AttributeSetPatch = tslib_1.__decorate([
53
54
  (0, type_graphql_1.InputType)()
54
55
  ], AttributeSetPatch);
55
- exports.AttributeSetPatch = AttributeSetPatch;
56
56
  let AttributeSetList = class AttributeSetList {
57
57
  };
58
+ exports.AttributeSetList = AttributeSetList;
58
59
  tslib_1.__decorate([
59
60
  (0, type_graphql_1.Field)(type => [attribute_set_1.AttributeSet]),
60
61
  tslib_1.__metadata("design:type", Array)
@@ -63,8 +64,7 @@ tslib_1.__decorate([
63
64
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
64
65
  tslib_1.__metadata("design:type", Number)
65
66
  ], AttributeSetList.prototype, "total", void 0);
66
- AttributeSetList = tslib_1.__decorate([
67
+ exports.AttributeSetList = AttributeSetList = tslib_1.__decorate([
67
68
  (0, type_graphql_1.ObjectType)()
68
69
  ], AttributeSetList);
69
- exports.AttributeSetList = AttributeSetList;
70
70
  //# sourceMappingURL=attribute-set-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attrib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C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAErB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;AALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B;AANY,4CAAgB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { AttributeSet } from './attribute-set'\nimport { AttributeSetItemPatch } from './attribute-set-item-type'\n\n@InputType()\nexport class NewAttributeSet {\n @Field()\n entity: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [AttributeSetItemPatch], { nullable: true })\n items?: AttributeSetItemPatch[]\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AttributeSetPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n entity?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [AttributeSetItemPatch], { nullable: true })\n items?: AttributeSetItemPatch[]\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AttributeSetList {\n @Field(type => [AttributeSet])\n items: AttributeSet[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"attribute-set-type.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,mDAA8C;AAC9C,uEAAiE;AAG1D,IAAM,eAAe,GAArB,MAAM,eAAe;CAY3B,CAAA;AAZY,0CAAe;AAE1B;IADC,IAAA,oBAAK,GAAE;;+CACM;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,+CAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAG/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;0BAXL,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAY3B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAe7B,CAAA;AAfY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,+CAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC5B;AAG/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;4BAdJ,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAe7B;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AANY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;2BALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { AttributeSet } from './attribute-set'\nimport { AttributeSetItemPatch } from './attribute-set-item-type'\n\n@InputType()\nexport class NewAttributeSet {\n @Field()\n entity: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [AttributeSetItemPatch], { nullable: true })\n items?: AttributeSetItemPatch[]\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AttributeSetPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n entity?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [AttributeSetItemPatch], { nullable: true })\n items?: AttributeSetItemPatch[]\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AttributeSetList {\n @Field(type => [AttributeSet])\n items: AttributeSet[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -11,6 +11,7 @@ let AttributeSet = class AttributeSet {
11
11
  this.description = '';
12
12
  }
13
13
  };
14
+ exports.AttributeSet = AttributeSet;
14
15
  tslib_1.__decorate([
15
16
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
16
17
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -41,12 +42,11 @@ tslib_1.__decorate([
41
42
  (0, type_graphql_1.Field)({ nullable: true }),
42
43
  tslib_1.__metadata("design:type", Date)
43
44
  ], AttributeSet.prototype, "updatedAt", void 0);
44
- AttributeSet = tslib_1.__decorate([
45
+ exports.AttributeSet = AttributeSet = tslib_1.__decorate([
45
46
  (0, typeorm_1.Entity)(),
46
47
  (0, typeorm_1.Index)('ix_attribute_set_0', (attributeSet) => [attributeSet.entity], {
47
48
  unique: true
48
49
  }),
49
50
  (0, type_graphql_1.ObjectType)({ description: 'Entity for AttributeSet' })
50
51
  ], AttributeSet);
51
- exports.AttributeSet = AttributeSet;
52
52
  //# sourceMappingURL=attribute-set.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribute-set.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set.ts"],"names":[],"mappings":";;;;AAAA,qCAA2G;AAC3G,+CAAoD;AAEpD,uEAA4D;AAOrD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QAOL,WAAM,GAAW,EAAE,CAAA;QAInB,gBAAW,GAAW,EA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, Column, PrimaryGeneratedColumn } from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { AttributeSetItem } from './attribute-set-item-type'\n\n@Entity()\n@Index('ix_attribute_set_0', (attributeSet: AttributeSet) => [attributeSet.entity], {\n unique: true\n})\n@ObjectType({ description: 'Entity for AttributeSet' })\nexport class AttributeSet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n entity: string = ''\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n description: string = ''\n\n @Column('simple-json', { nullable: true })\n @Field(type => [AttributeSetItem], { nullable: true })\n items: AttributeSetItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n}\n"]}
1
+ {"version":3,"file":"attribute-set.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set.ts"],"names":[],"mappings":";;;;AAAA,qCAA2G;AAC3G,+CAAoD;AAEpD,uEAA4D;AAOrD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QAOL,WAAM,GAAW,EAAE,CAAA;QAInB,gBAAW,GAAW,EAAE,CAAA;IAa1B,CAAC;CAAA,CAAA;AAxBY,oCAAY;AAGd;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wCACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACP;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACF;AAIxB;IAFC,IAAA,gBAAM,EAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0CAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAIzB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;uBAvBL,YAAY;IALxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;QAClF,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CAwBxB","sourcesContent":["import { CreateDateColumn, UpdateDateColumn, Entity, Index, Column, PrimaryGeneratedColumn } from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { AttributeSetItem } from './attribute-set-item-type'\n\n@Entity()\n@Index('ix_attribute_set_0', (attributeSet: AttributeSet) => [attributeSet.entity], {\n unique: true\n})\n@ObjectType({ description: 'Entity for AttributeSet' })\nexport class AttributeSet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n entity: string = ''\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n description: string = ''\n\n @Column('simple-json', { nullable: true })\n @Field(type => [AttributeSetItem], { nullable: true })\n items: AttributeSetItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n}\n"]}