@feathersjs/cli 5.0.0-pre.33 → 5.0.0-pre.34

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 (102) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/app/index.d.ts +2 -2
  3. package/lib/app/index.js +1 -1
  4. package/lib/app/index.js.map +1 -1
  5. package/lib/app/index.ts +1 -0
  6. package/lib/app/templates/app.test.tpl.js +2 -1
  7. package/lib/app/templates/app.test.tpl.js.map +1 -1
  8. package/lib/app/templates/app.test.tpl.ts +4 -1
  9. package/lib/app/templates/app.tpl.js +12 -10
  10. package/lib/app/templates/app.tpl.js.map +1 -1
  11. package/lib/app/templates/app.tpl.ts +12 -10
  12. package/lib/app/templates/channels.tpl.js +2 -1
  13. package/lib/app/templates/channels.tpl.js.map +1 -1
  14. package/lib/app/templates/channels.tpl.ts +2 -1
  15. package/lib/app/templates/client.tpl.js +2 -1
  16. package/lib/app/templates/client.tpl.js.map +1 -1
  17. package/lib/app/templates/client.tpl.ts +2 -1
  18. package/lib/app/templates/{config.tpl.d.ts → configuration.tpl.d.ts} +0 -0
  19. package/lib/app/templates/{schemas.tpl.js → configuration.tpl.js} +25 -29
  20. package/lib/app/templates/configuration.tpl.js.map +1 -0
  21. package/lib/app/templates/{schemas.tpl.ts → configuration.tpl.ts} +25 -32
  22. package/lib/app/templates/declarations.tpl.js +3 -2
  23. package/lib/app/templates/declarations.tpl.js.map +1 -1
  24. package/lib/app/templates/declarations.tpl.ts +3 -2
  25. package/lib/app/templates/logger.tpl.d.ts +1 -0
  26. package/lib/app/templates/logger.tpl.js +11 -5
  27. package/lib/app/templates/logger.tpl.js.map +1 -1
  28. package/lib/app/templates/logger.tpl.ts +20 -8
  29. package/lib/app/templates/package.json.tpl.js +5 -2
  30. package/lib/app/templates/package.json.tpl.js.map +1 -1
  31. package/lib/app/templates/package.json.tpl.ts +5 -2
  32. package/lib/app/templates/services.tpl.js +2 -1
  33. package/lib/app/templates/services.tpl.js.map +1 -1
  34. package/lib/app/templates/services.tpl.ts +3 -1
  35. package/lib/app/templates/{schemas.tpl.d.ts → validators.tpl.d.ts} +0 -0
  36. package/lib/app/templates/validators.tpl.js +36 -0
  37. package/lib/app/templates/validators.tpl.js.map +1 -0
  38. package/lib/app/templates/validators.tpl.ts +40 -0
  39. package/lib/authentication/index.d.ts +1 -1
  40. package/lib/authentication/templates/authentication.tpl.js +2 -1
  41. package/lib/authentication/templates/authentication.tpl.js.map +1 -1
  42. package/lib/authentication/templates/authentication.tpl.ts +2 -1
  43. package/lib/authentication/templates/client.test.tpl.js +2 -1
  44. package/lib/authentication/templates/client.test.tpl.js.map +1 -1
  45. package/lib/authentication/templates/client.test.tpl.ts +2 -1
  46. package/lib/authentication/templates/knex.tpl.js +2 -2
  47. package/lib/authentication/templates/knex.tpl.js.map +1 -1
  48. package/lib/authentication/templates/knex.tpl.ts +2 -2
  49. package/lib/authentication/templates/schema.json.tpl.js +30 -20
  50. package/lib/authentication/templates/schema.json.tpl.js.map +1 -1
  51. package/lib/authentication/templates/schema.json.tpl.ts +37 -21
  52. package/lib/authentication/templates/schema.typebox.tpl.d.ts +1 -1
  53. package/lib/authentication/templates/schema.typebox.tpl.js +30 -22
  54. package/lib/authentication/templates/schema.typebox.tpl.js.map +1 -1
  55. package/lib/authentication/templates/schema.typebox.tpl.ts +37 -23
  56. package/lib/commons.d.ts +11 -4
  57. package/lib/commons.js +9 -1
  58. package/lib/commons.js.map +1 -1
  59. package/lib/commons.ts +8 -0
  60. package/lib/connection/index.d.ts +1 -1
  61. package/lib/connection/index.js +1 -1
  62. package/lib/connection/index.ts +1 -1
  63. package/lib/connection/templates/knex.tpl.js +4 -2
  64. package/lib/connection/templates/knex.tpl.js.map +1 -1
  65. package/lib/connection/templates/knex.tpl.ts +6 -2
  66. package/lib/connection/templates/mongodb.tpl.js +2 -1
  67. package/lib/connection/templates/mongodb.tpl.js.map +1 -1
  68. package/lib/connection/templates/mongodb.tpl.ts +3 -1
  69. package/lib/hook/templates/hook.tpl.js +4 -2
  70. package/lib/hook/templates/hook.tpl.js.map +1 -1
  71. package/lib/hook/templates/hook.tpl.ts +4 -2
  72. package/lib/service/index.d.ts +1 -1
  73. package/lib/service/templates/schema.json.tpl.js +23 -15
  74. package/lib/service/templates/schema.json.tpl.js.map +1 -1
  75. package/lib/service/templates/schema.json.tpl.ts +28 -17
  76. package/lib/service/templates/schema.typebox.tpl.js +21 -15
  77. package/lib/service/templates/schema.typebox.tpl.js.map +1 -1
  78. package/lib/service/templates/schema.typebox.tpl.ts +26 -17
  79. package/lib/service/templates/service.tpl.js +33 -19
  80. package/lib/service/templates/service.tpl.js.map +1 -1
  81. package/lib/service/templates/service.tpl.ts +38 -20
  82. package/lib/service/templates/test.tpl.js +2 -1
  83. package/lib/service/templates/test.tpl.js.map +1 -1
  84. package/lib/service/templates/test.tpl.ts +6 -1
  85. package/lib/service/type/custom.tpl.js +8 -4
  86. package/lib/service/type/custom.tpl.js.map +1 -1
  87. package/lib/service/type/custom.tpl.ts +14 -4
  88. package/lib/service/type/knex.tpl.js +7 -3
  89. package/lib/service/type/knex.tpl.js.map +1 -1
  90. package/lib/service/type/knex.tpl.ts +7 -3
  91. package/lib/service/type/mongodb.tpl.js +5 -2
  92. package/lib/service/type/mongodb.tpl.js.map +1 -1
  93. package/lib/service/type/mongodb.tpl.ts +5 -2
  94. package/package.json +26 -24
  95. package/lib/app/templates/config.tpl.js +0 -30
  96. package/lib/app/templates/config.tpl.js.map +0 -1
  97. package/lib/app/templates/config.tpl.ts +0 -31
  98. package/lib/app/templates/schemas.tpl.js.map +0 -1
  99. package/lib/authentication/templates/client.tpl.d.ts +0 -2
  100. package/lib/authentication/templates/client.tpl.js +0 -14
  101. package/lib/authentication/templates/client.tpl.js.map +0 -1
  102. package/lib/authentication/templates/client.tpl.ts +0 -19
@@ -9,7 +9,8 @@ const jsPackageJson = (lib) => ({
9
9
  dev: `nodemon ${lib}/`,
10
10
  prettier: 'npx prettier "**/*.js" --write',
11
11
  mocha: 'cross-env NODE_ENV=test mocha test/ --recursive --exit',
12
- test: 'npm run mocha'
12
+ test: 'npm run mocha',
13
+ 'bundle:client': 'npm pack --pack-destination ./public'
13
14
  }
14
15
  });
15
16
  const tsPackageJson = (lib) => ({
@@ -19,7 +20,8 @@ const tsPackageJson = (lib) => ({
19
20
  start: 'node lib/',
20
21
  prettier: 'npx prettier "**/*.ts" --write',
21
22
  mocha: 'cross-env NODE_ENV=test mocha test/ --require ts-node/register --recursive --extension .ts --exit',
22
- test: 'npm run mocha'
23
+ test: 'npm run mocha',
24
+ 'bundle:client': 'npm run compile && npm pack --pack-destination ./public'
23
25
  }
24
26
  });
25
27
  const packageJson = ({ name, description, language, packager, database, framework, transports, lib, test, schema }) => ({
@@ -47,6 +49,7 @@ const packageJson = ({ name, description, language, packager, database, framewor
47
49
  lib,
48
50
  test
49
51
  },
52
+ files: ['lib/client.js', 'lib/**/*.d.ts'],
50
53
  main: language === 'ts' ? 'lib/client' : `${lib}/client`,
51
54
  ...(language === 'ts' ? tsPackageJson(lib) : jsPackageJson(lib))
52
55
  });
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/package.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAiE;AAGjE,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC;IACtC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,KAAK,EAAE,QAAQ,GAAG,EAAE;QACpB,GAAG,EAAE,WAAW,GAAG,GAAG;QACtB,QAAQ,EAAE,gCAAgC;QAC1C,KAAK,EAAE,wDAAwD;QAC/D,IAAI,EAAE,eAAe;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE;QACP,GAAG,EAAE,sBAAsB,GAAG,WAAW;QACzC,OAAO,EAAE,wBAA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AAM;KACP;IACD,WAAW,EAAE;QACX,GAAG;QACH,IAAI;KACL;IACD,KAAK,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IACzC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS;IACxD,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;CACjE,CAAC,CAAA;AAEK,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,kBAAS,EAAC,WAAW,EAAE,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC,CAAC,CAAA;AADxD,QAAA,QAAQ,YACgD"}
@@ -8,7 +8,8 @@ const jsPackageJson = (lib: string) => ({
8
8
  dev: `nodemon ${lib}/`,
9
9
  prettier: 'npx prettier "**/*.js" --write',
10
10
  mocha: 'cross-env NODE_ENV=test mocha test/ --recursive --exit',
11
- test: 'npm run mocha'
11
+ test: 'npm run mocha',
12
+ 'bundle:client': 'npm pack --pack-destination ./public'
12
13
  }
13
14
  })
14
15
 
@@ -20,7 +21,8 @@ const tsPackageJson = (lib: string) => ({
20
21
  prettier: 'npx prettier "**/*.ts" --write',
21
22
  mocha:
22
23
  'cross-env NODE_ENV=test mocha test/ --require ts-node/register --recursive --extension .ts --exit',
23
- test: 'npm run mocha'
24
+ test: 'npm run mocha',
25
+ 'bundle:client': 'npm run compile && npm pack --pack-destination ./public'
24
26
  }
25
27
  })
26
28
 
@@ -60,6 +62,7 @@ const packageJson = ({
60
62
  lib,
61
63
  test
62
64
  },
65
+ files: ['lib/client.js', 'lib/**/*.d.ts'],
63
66
  main: language === 'ts' ? 'lib/client' : `${lib}/client`,
64
67
  ...(language === 'ts' ? tsPackageJson(lib) : jsPackageJson(lib))
65
68
  })
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
- const template = ({}) => /* ts */ `import type { Application } from '../declarations'
6
+ const template = ({}) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/application.html#configure-functions
7
+ import type { Application } from '../declarations'
7
8
 
8
9
  export const services = (app: Application) => {
9
10
  // All services will be registered here
@@ -1 +1 @@
1
- {"version":3,"file":"services.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/services.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GAAG,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;CAKtD,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,CACnE,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
1
+ {"version":3,"file":"services.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/services.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,QAAQ,GACZ,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;;CAMvC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,CACnE,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
@@ -2,7 +2,9 @@ import { generator, toFile } from '@feathershq/pinion'
2
2
  import { renderSource } from '../../commons'
3
3
  import { AppGeneratorContext } from '../index'
4
4
 
5
- const template = ({}: AppGeneratorContext) => /* ts */ `import type { Application } from '../declarations'
5
+ const template =
6
+ ({}: AppGeneratorContext) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/application.html#configure-functions
7
+ import type { Application } from '../declarations'
6
8
 
7
9
  export const services = (app: Application) => {
8
10
  // All services will be registered here
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generate = void 0;
4
+ const pinion_1 = require("@feathershq/pinion");
5
+ const commons_1 = require("../../commons");
6
+ const validatorTemplate = /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/validators.html
7
+ import { Ajv, addFormats } from '@feathersjs/schema'
8
+ import type { FormatsPluginOptions } from '@feathersjs/schema'
9
+
10
+ const formats: FormatsPluginOptions = [
11
+ 'date-time',
12
+ 'time',
13
+ 'date',
14
+ 'email',
15
+ 'hostname',
16
+ 'ipv4',
17
+ 'ipv6',
18
+ 'uri',
19
+ 'uri-reference',
20
+ 'uuid',
21
+ 'uri-template',
22
+ 'json-pointer',
23
+ 'relative-json-pointer',
24
+ 'regex'
25
+ ]
26
+
27
+ export const dataValidator: Ajv = addFormats(new Ajv({}), formats)
28
+
29
+ export const queryValidator: Ajv = addFormats(new Ajv({
30
+ coerceTypes: true,
31
+ removeAdditional: true
32
+ }), formats)
33
+ `;
34
+ const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, commons_1.renderSource)(validatorTemplate, (0, pinion_1.toFile)(({ lib }) => lib, 'validators')));
35
+ exports.generate = generate;
36
+ //# sourceMappingURL=validators.tpl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.tpl.js","sourceRoot":"","sources":["../../../src/app/templates/validators.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAG5C,MAAM,iBAAiB,GAAG,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BlC,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,EAAE,CACnD,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,iBAAiB,EACjB,IAAA,eAAM,EAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,YAAY,CAAC,CAC5D,CACF,CAAA;AANU,QAAA,QAAQ,YAMlB"}
@@ -0,0 +1,40 @@
1
+ import { generator, toFile } from '@feathershq/pinion'
2
+ import { renderSource } from '../../commons'
3
+ import { AppGeneratorContext } from '../index'
4
+
5
+ const validatorTemplate = /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/validators.html
6
+ import { Ajv, addFormats } from '@feathersjs/schema'
7
+ import type { FormatsPluginOptions } from '@feathersjs/schema'
8
+
9
+ const formats: FormatsPluginOptions = [
10
+ 'date-time',
11
+ 'time',
12
+ 'date',
13
+ 'email',
14
+ 'hostname',
15
+ 'ipv4',
16
+ 'ipv6',
17
+ 'uri',
18
+ 'uri-reference',
19
+ 'uuid',
20
+ 'uri-template',
21
+ 'json-pointer',
22
+ 'relative-json-pointer',
23
+ 'regex'
24
+ ]
25
+
26
+ export const dataValidator: Ajv = addFormats(new Ajv({}), formats)
27
+
28
+ export const queryValidator: Ajv = addFormats(new Ajv({
29
+ coerceTypes: true,
30
+ removeAdditional: true
31
+ }), formats)
32
+ `
33
+
34
+ export const generate = (ctx: AppGeneratorContext) =>
35
+ generator(ctx).then(
36
+ renderSource(
37
+ validatorTemplate,
38
+ toFile<AppGeneratorContext>(({ lib }) => lib, 'validators')
39
+ )
40
+ )
@@ -6,7 +6,7 @@ export interface AuthenticationGeneratorContext extends ServiceGeneratorContext
6
6
  authStrategies: string[];
7
7
  dependencies: string[];
8
8
  }
9
- export declare type AuthenticationGeneratorArguments = FeathersBaseContext & Partial<Pick<AuthenticationGeneratorContext, 'service' | 'authStrategies' | 'entity' | 'path'>>;
9
+ export type AuthenticationGeneratorArguments = FeathersBaseContext & Partial<Pick<AuthenticationGeneratorContext, 'service' | 'authStrategies' | 'entity' | 'path'>>;
10
10
  export declare const localTemplate: (authStrategies: string[], content: string) => string;
11
11
  export declare const oauthTemplate: (authStrategies: string[], content: string) => string;
12
12
  export declare const prompts: (ctx: AuthenticationGeneratorArguments) => ({
@@ -4,7 +4,8 @@ exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
6
  const index_1 = require("../index");
7
- const template = ({ authStrategies }) => /* ts */ `import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
7
+ const template = ({ authStrategies }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/authentication.html
8
+ import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
8
9
  ${(0, index_1.localTemplate)(authStrategies, `import { LocalStrategy } from '@feathersjs/authentication-local'`)}
9
10
  ${(0, index_1.oauthTemplate)(authStrategies, `import { oauth, OAuthStrategy } from '@feathersjs/authentication-oauth'`)}
10
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/authentication.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAC9D,2CAA0D;AAC1D,oCAAuF;AAEvF,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;EAC7C,IAAA,qBAAa,EAAC,cAAc,EAAE,kEAAkE,CAAC;EACjG,IAAA,qBAAa,EAAC,cAAc,EAAE,yEAAyE,CAAC;;;;;;;;;;;;;;IActG,cAAc;KACb,GAAG,CACF,CAAC,QAAQ,EAAE,EAAE,CACX,8BAA8B,QAAQ,MACpC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBACjD,GAAG,CACN;KACA,IAAI,CAAC,IAAI,CAAC;;;IAGX,IAAA,qBAAa,EAAC,cAAc,EAAE,wBAAwB,CAAC;;CAE1D,CAAA;AAED,MAAM,cAAc,GAAG,mDAAmD,CAAA;AAC1E,MAAM,iBAAiB,GAAG,+BAA+B,CAAA;AACzD,MAAM,SAAS,GAAG,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAE5E,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAC3E,CACF;KACA,IAAI,CAAC,IAAA,sBAAY,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAC;KACjF,IAAI,CAAC,IAAA,sBAAY,EAAC,iBAAiB,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAT3E,QAAA,QAAQ,YASmE"}
1
+ {"version":3,"file":"authentication.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/authentication.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAC9D,2CAA0D;AAC1D,oCAAuF;AAEvF,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;;EAE7C,IAAA,qBAAa,EAAC,cAAc,EAAE,kEAAkE,CAAC;EACjG,IAAA,qBAAa,EAAC,cAAc,EAAE,yEAAyE,CAAC;;;;;;;;;;;;;;IActG,cAAc;KACb,GAAG,CACF,CAAC,QAAQ,EAAE,EAAE,CACX,8BAA8B,QAAQ,MACpC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBACjD,GAAG,CACN;KACA,IAAI,CAAC,IAAI,CAAC;;;IAGX,IAAA,qBAAa,EAAC,cAAc,EAAE,wBAAwB,CAAC;;CAE1D,CAAA;AAED,MAAM,cAAc,GAAG,mDAAmD,CAAA;AAC1E,MAAM,iBAAiB,GAAG,+BAA+B,CAAA;AACzD,MAAM,SAAS,GAAG,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAE5E,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC;KACX,IAAI,CACH,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAC3E,CACF;KACA,IAAI,CAAC,IAAA,sBAAY,EAAC,cAAc,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC,EAAE,SAAS,CAAC,CAAC;KACjF,IAAI,CAAC,IAAA,sBAAY,EAAC,iBAAiB,EAAE,IAAA,eAAM,EAAC,yBAAyB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAT3E,QAAA,QAAQ,YASmE"}
@@ -4,7 +4,8 @@ import { AuthenticationGeneratorContext, localTemplate, oauthTemplate } from '..
4
4
 
5
5
  const template = ({
6
6
  authStrategies
7
- }: AuthenticationGeneratorContext) => /* ts */ `import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
7
+ }: AuthenticationGeneratorContext) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/authentication.html
8
+ import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
8
9
  ${localTemplate(authStrategies, `import { LocalStrategy } from '@feathersjs/authentication-local'`)}
9
10
  ${oauthTemplate(authStrategies, `import { oauth, OAuthStrategy } from '@feathersjs/authentication-oauth'`)}
10
11
 
@@ -4,7 +4,8 @@ exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
6
  const index_1 = require("../index");
7
- const template = ({ authStrategies, upperName, type, lib }) => /* ts */ `import assert from 'assert'
7
+ const template = ({ authStrategies, upperName, type, lib }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/client.test.html
8
+ import assert from 'assert'
8
9
  import axios from 'axios'
9
10
 
10
11
  import rest from '@feathersjs/rest-client'
@@ -1 +1 @@
1
- {"version":3,"file":"client.test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/client.test.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAC5C,oCAAwE;AAExE,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACd,SAAS,EACT,IAAI,EACJ,GAAG,EAC4B,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;EAI7C,IAAA,qBAAa,EAAC,cAAc,EAAE,sEAAsE,CAAC;0BAC7E,GAAG;mCACM,GAAG;EACpC,IAAA,qBAAa,EAAC,cAAc,EAAE,iBAAiB,SAAS,mBAAmB,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;IAoBvF,IAAA,qBAAa,EACb,cAAc,EACd;;sBAEkB,SAAS;;;;;;;;;;;;;;;;;;;6CAmBc,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;KACzE,CACF;;CAEF,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,EACzE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAA;AAPU,QAAA,QAAQ,YAOlB"}
1
+ {"version":3,"file":"client.test.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/client.test.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AACtD,2CAA4C;AAC5C,oCAAwE;AAExE,MAAM,QAAQ,GAAG,CAAC,EAChB,cAAc,EACd,SAAS,EACT,IAAI,EACJ,GAAG,EAC4B,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;;EAK7C,IAAA,qBAAa,EAAC,cAAc,EAAE,sEAAsE,CAAC;0BAC7E,GAAG;mCACM,GAAG;EACpC,IAAA,qBAAa,EAAC,cAAc,EAAE,iBAAiB,SAAS,mBAAmB,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;IAoBvF,IAAA,qBAAa,EACb,cAAc,EACd;;sBAEkB,SAAS;;;;;;;;;;;;;;;;;;;6CAmBc,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;KACzE,CACF;;CAEF,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,sBAAY,EACV,QAAQ,EACR,IAAA,eAAM,EAAiC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,EACzE,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CAAA;AAPU,QAAA,QAAQ,YAOlB"}
@@ -7,7 +7,8 @@ const template = ({
7
7
  upperName,
8
8
  type,
9
9
  lib
10
- }: AuthenticationGeneratorContext) => /* ts */ `import assert from 'assert'
10
+ }: AuthenticationGeneratorContext) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/client.test.html
11
+ import assert from 'assert'
11
12
  import axios from 'axios'
12
13
 
13
14
  import rest from '@feathersjs/rest-client'
@@ -34,8 +34,8 @@ export async function down(knex: Knex): Promise<void> {
34
34
  `;
35
35
  const generate = (ctx) => (0, pinion_1.generator)(ctx).then((0, pinion_1.when)((ctx) => { var _a; return (0, commons_1.getDatabaseAdapter)((_a = ctx.feathers) === null || _a === void 0 ? void 0 : _a.database) === 'knex'; }, (0, commons_1.renderSource)(migrationTemplate, (0, pinion_1.toFile)((0, pinion_1.toFile)('migrations', () => {
36
36
  // Probably not great but it works to align with the Knex migration file format
37
- // We add 2 seconds so that the migrations run in the correct order
38
- const migrationDate = new Date(Date.now() + 2000)
37
+ // We add a few seconds so that the migrations run in the correct order
38
+ const migrationDate = new Date(Date.now() + 10000)
39
39
  .toISOString()
40
40
  .replace(/\D/g, '')
41
41
  .substring(0, 14);
@@ -1 +1 @@
1
- {"version":3,"file":"knex.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/knex.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAAgE;AAGhE,MAAM,iBAAiB,GAAG,CAAC,EACzB,SAAS,EACT,cAAc,EACiB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;kCAGb,SAAS;8BACb,cAAc;KACrC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;;6BAEiB;IACnB,CAAC,CAAC;oBACQ,IAAI,MAAM,CACvB;KACA,IAAI,CAAC,IAAI,CAAC;;;;;kCAKiB,SAAS;0BACjB,cAAc;KACjC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;;iCAEqB;IACvB,CAAC,CAAC;wBACY,IAAI;KACvB,CACE;KACA,IAAI,CAAC,IAAI,CAAC;;;CAGhB,CAAA;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,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AA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,GAAG,EAAE,EAAE,WAAC,OAAA,IAAA,4BAAkB,EAAC,MAAA,GAAG,CAAC,QAAQ,0CAAE,QAAQ,CAAC,KAAK,MAAM,CAAA,EAAA,EAC9D,IAAA,sBAAY,EACV,iBAAiB,EACjB,IAAA,eAAM,EACJ,IAAA,eAAM,EAAiC,YAAY,EAAE,GAAG,EAAE;IACxD,+EAA+E;IAC/E,uEAAuE;IACvE,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;SAC/C,WAAW,EAAE;SACb,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAEnB,OAAO,GAAG,aAAa,iBAAiB,CAAA;AAC1C,CAAC,CAAC,CACH,CACF,CACF,CACF,CAAA;AApBU,QAAA,QAAQ,YAoBlB"}
@@ -48,8 +48,8 @@ export const generate = (ctx: AuthenticationGeneratorContext) =>
48
48
  toFile(
49
49
  toFile<AuthenticationGeneratorContext>('migrations', () => {
50
50
  // Probably not great but it works to align with the Knex migration file format
51
- // We add 2 seconds so that the migrations run in the correct order
52
- const migrationDate = new Date(Date.now() + 2000)
51
+ // We add a few seconds so that the migrations run in the correct order
52
+ const migrationDate = new Date(Date.now() + 10000)
53
53
  .toISOString()
54
54
  .replace(/\D/g, '')
55
55
  .substring(0, 14)
@@ -4,12 +4,14 @@ exports.generate = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
6
  const index_1 = require("../index");
7
- const template = ({ camelName, upperName, authStrategies, type, relative }) => /* ts */ `import { resolve, querySyntax, getValidator, getDataValidator } from '@feathersjs/schema'
7
+ const template = ({ cwd, lib, camelName, upperName, authStrategies, type, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html
8
+ import { resolve, querySyntax, getValidator } from '@feathersjs/schema'
8
9
  import type { FromSchema } from '@feathersjs/schema'
9
10
  ${(0, index_1.localTemplate)(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
10
11
 
11
12
  import type { HookContext } from '${relative}/declarations'
12
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
13
+ import { dataValidator, queryValidator } from '${relative}/${(0, commons_1.fileExists)(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
14
+ }validators'
13
15
 
14
16
  // Main data model schema
15
17
  export const ${camelName}Schema = {
@@ -30,11 +32,14 @@ export const ${camelName}Schema = {
30
32
  }
31
33
  } as const
32
34
  export type ${upperName} = FromSchema<typeof ${camelName}Schema>
33
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
34
- properties: {}
35
+ export const ${camelName}Resolver = resolve<${upperName}, HookContext>({})
36
+
37
+ export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
38
+ ${(0, index_1.localTemplate)(authStrategies, `// The password should never be visible externally
39
+ password: async () => undefined`)}
35
40
  })
36
41
 
37
- // Schema for the basic data model (e.g. creating new entries)
42
+ // Schema for creating new users
38
43
  export const ${camelName}DataSchema = {
39
44
  $id: '${upperName}Data',
40
45
  type: 'object',
@@ -45,18 +50,25 @@ export const ${camelName}DataSchema = {
45
50
  }
46
51
  } as const
47
52
  export type ${upperName}Data = FromSchema<typeof ${camelName}DataSchema>
48
- export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
53
+ export const ${camelName}DataValidator = getValidator(${camelName}DataSchema, dataValidator)
49
54
  export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
50
- properties: {
51
- ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
52
- }
55
+ ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
53
56
  })
54
57
 
55
- export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
58
+ // Schema for updating existing users
59
+ export const ${camelName}DataSchema = {
60
+ $id: '${upperName}Patch',
61
+ type: 'object',
62
+ additionalProperties: false,
63
+ required: [],
56
64
  properties: {
57
- // The password should never be visible externally
58
- password: async () => undefined
65
+ ...${camelName}Schema.properties
59
66
  }
67
+ } as const
68
+ export type ${upperName}Patch = FromSchema<typeof ${camelName}PatchSchema>
69
+ export const ${camelName}PatchValidator = getValidator(${camelName}PatchSchema, dataValidator)
70
+ export const ${camelName}PatchResolver = resolve<${upperName}Patch, HookContext>({
71
+ ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
60
72
  })
61
73
 
62
74
  // Schema for allowed query properties
@@ -71,15 +83,13 @@ export const ${camelName}QuerySchema = {
71
83
  export type ${upperName}Query = FromSchema<typeof ${camelName}QuerySchema>
72
84
  export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
73
85
  export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
74
- properties: {
75
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
76
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
77
- if (context.params.user) {
78
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
79
- }
80
-
81
- return value
86
+ // If there is a user (e.g. with authentication), they are only allowed to see their own data
87
+ ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
88
+ if (context.params.user) {
89
+ return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
82
90
  }
91
+
92
+ return value
83
93
  }
84
94
  })
85
95
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.json.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/schema.json.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAA4C;AAC5C,oCAAwE;AAExE,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,QAAQ,EACuB,EAAE,EAAE,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ACpE,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,SAAS;CACrB,CAAC,EACF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CACF,CAAA;AAfU,QAAA,QAAQ,YAelB"}
@@ -1,19 +1,24 @@
1
1
  import { generator, toFile, when } from '@feathershq/pinion'
2
- import { renderSource } from '../../commons'
2
+ import { fileExists, renderSource } from '../../commons'
3
3
  import { AuthenticationGeneratorContext, localTemplate } from '../index'
4
4
 
5
5
  const template = ({
6
+ cwd,
7
+ lib,
6
8
  camelName,
7
9
  upperName,
8
10
  authStrategies,
9
11
  type,
10
12
  relative
11
- }: AuthenticationGeneratorContext) => /* ts */ `import { resolve, querySyntax, getValidator, getDataValidator } from '@feathersjs/schema'
13
+ }: AuthenticationGeneratorContext) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html
14
+ import { resolve, querySyntax, getValidator } from '@feathersjs/schema'
12
15
  import type { FromSchema } from '@feathersjs/schema'
13
16
  ${localTemplate(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
14
17
 
15
18
  import type { HookContext } from '${relative}/declarations'
16
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
19
+ import { dataValidator, queryValidator } from '${relative}/${
20
+ fileExists(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
21
+ }validators'
17
22
 
18
23
  // Main data model schema
19
24
  export const ${camelName}Schema = {
@@ -36,11 +41,17 @@ export const ${camelName}Schema = {
36
41
  }
37
42
  } as const
38
43
  export type ${upperName} = FromSchema<typeof ${camelName}Schema>
39
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
40
- properties: {}
44
+ export const ${camelName}Resolver = resolve<${upperName}, HookContext>({})
45
+
46
+ export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
47
+ ${localTemplate(
48
+ authStrategies,
49
+ `// The password should never be visible externally
50
+ password: async () => undefined`
51
+ )}
41
52
  })
42
53
 
43
- // Schema for the basic data model (e.g. creating new entries)
54
+ // Schema for creating new users
44
55
  export const ${camelName}DataSchema = {
45
56
  $id: '${upperName}Data',
46
57
  type: 'object',
@@ -51,18 +62,25 @@ export const ${camelName}DataSchema = {
51
62
  }
52
63
  } as const
53
64
  export type ${upperName}Data = FromSchema<typeof ${camelName}DataSchema>
54
- export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
65
+ export const ${camelName}DataValidator = getValidator(${camelName}DataSchema, dataValidator)
55
66
  export const ${camelName}DataResolver = resolve<${upperName}Data, HookContext>({
56
- properties: {
57
- ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
58
- }
67
+ ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
59
68
  })
60
69
 
61
- export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
70
+ // Schema for updating existing users
71
+ export const ${camelName}DataSchema = {
72
+ $id: '${upperName}Patch',
73
+ type: 'object',
74
+ additionalProperties: false,
75
+ required: [],
62
76
  properties: {
63
- // The password should never be visible externally
64
- password: async () => undefined
77
+ ...${camelName}Schema.properties
65
78
  }
79
+ } as const
80
+ export type ${upperName}Patch = FromSchema<typeof ${camelName}PatchSchema>
81
+ export const ${camelName}PatchValidator = getValidator(${camelName}PatchSchema, dataValidator)
82
+ export const ${camelName}PatchResolver = resolve<${upperName}Patch, HookContext>({
83
+ ${localTemplate(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
66
84
  })
67
85
 
68
86
  // Schema for allowed query properties
@@ -77,15 +95,13 @@ export const ${camelName}QuerySchema = {
77
95
  export type ${upperName}Query = FromSchema<typeof ${camelName}QuerySchema>
78
96
  export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
79
97
  export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
80
- properties: {
81
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
82
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
83
- if (context.params.user) {
84
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
85
- }
86
-
87
- return value
98
+ // If there is a user (e.g. with authentication), they are only allowed to see their own data
99
+ ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
100
+ if (context.params.user) {
101
+ return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
88
102
  }
103
+
104
+ return value
89
105
  }
90
106
  })
91
107
  `
@@ -1,3 +1,3 @@
1
1
  import { AuthenticationGeneratorContext } from '../index';
2
- export declare const template: ({ camelName, upperName, authStrategies, type, relative }: AuthenticationGeneratorContext) => string;
2
+ export declare const template: ({ cwd, lib, camelName, upperName, authStrategies, type, relative }: AuthenticationGeneratorContext) => string;
3
3
  export declare const generate: (ctx: AuthenticationGeneratorContext) => Promise<AuthenticationGeneratorContext>;
@@ -4,13 +4,15 @@ exports.generate = exports.template = void 0;
4
4
  const pinion_1 = require("@feathershq/pinion");
5
5
  const commons_1 = require("../../commons");
6
6
  const index_1 = require("../index");
7
- const template = ({ camelName, upperName, authStrategies, type, relative }) => /* ts */ `import { resolve } from '@feathersjs/schema'
7
+ const template = ({ cwd, lib, camelName, upperName, authStrategies, type, relative }) => /* ts */ `// For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html
8
+ import { resolve } from '@feathersjs/schema'
8
9
  import { Type, getDataValidator, getValidator, querySyntax } from '@feathersjs/typebox'
9
10
  import type { Static } from '@feathersjs/typebox'
10
11
  ${(0, index_1.localTemplate)(authStrategies, `import { passwordHash } from '@feathersjs/authentication-local'`)}
11
12
 
12
13
  import type { HookContext } from '${relative}/declarations'
13
- import { dataValidator, queryValidator } from '${relative}/schemas/validators'
14
+ import { dataValidator, queryValidator } from '${relative}/${(0, commons_1.fileExists)(cwd, lib, 'schemas') ? 'schemas/' : '' // This is for legacy backwards compatibility
15
+ }validators'
14
16
 
15
17
  // Main data model schema
16
18
  export const ${camelName}Schema = Type.Object({
@@ -23,18 +25,14 @@ export const ${camelName}Schema = Type.Object({
23
25
  .join(',\n')}
24
26
  },{ $id: '${upperName}', additionalProperties: false })
25
27
  export type ${upperName} = Static<typeof ${camelName}Schema>
26
- export const ${camelName}Resolver = resolve<${upperName}, HookContext>({
27
- properties: {}
28
- })
28
+ export const ${camelName}Resolver = resolve<${upperName}, HookContext>({})
29
29
 
30
30
  export const ${camelName}ExternalResolver = resolve<${upperName}, HookContext>({
31
- properties: {
32
- // The password should never be visible externally
33
- password: async () => undefined
34
- }
31
+ ${(0, index_1.localTemplate)(authStrategies, `// The password should never be visible externally
32
+ password: async () => undefined`)}
35
33
  })
36
34
 
37
- // Schema for the basic data model (e.g. creating new entries)
35
+ // Schema for creating new users
38
36
  export const ${camelName}DataSchema = Type.Pick(${camelName}Schema, [
39
37
  ${authStrategies.map((name) => (name === 'local' ? `'email', 'password'` : `'${name}Id'`)).join(', ')}
40
38
  ],
@@ -43,27 +41,37 @@ export const ${camelName}DataSchema = Type.Pick(${camelName}Schema, [
43
41
  export type ${upperName}Data = Static<typeof ${camelName}DataSchema>
44
42
  export const ${camelName}DataValidator = getDataValidator(${camelName}DataSchema, dataValidator)
45
43
  export const ${camelName}DataResolver = resolve<${upperName}, HookContext>({
46
- properties: {
47
- ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
48
- }
44
+ ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
45
+ })
46
+
47
+ // Schema for updating existing users
48
+ export const ${camelName}PatchSchema = Type.Partial(${camelName}Schema, {
49
+ $id: '${upperName}Patch'
50
+ })
51
+ export type ${upperName}Patch = Static<typeof ${camelName}PatchSchema>
52
+ export const ${camelName}PatchValidator = getDataValidator(${camelName}PatchSchema, dataValidator)
53
+ export const ${camelName}PatchResolver = resolve<${upperName}, HookContext>({
54
+ ${(0, index_1.localTemplate)(authStrategies, `password: passwordHash({ strategy: 'local' })`)}
49
55
  })
50
56
 
51
57
  // Schema for allowed query properties
52
58
  export const ${camelName}QueryProperties = Type.Pick(${camelName}Schema, ['${type === 'mongodb' ? '_id' : 'id'}', ${authStrategies.map((name) => (name === 'local' ? `'email'` : `'${name}Id'`)).join(', ')}
53
59
  ])
54
- export const ${camelName}QuerySchema = querySyntax(${camelName}QueryProperties)
60
+ export const ${camelName}QuerySchema = Type.Intersect([
61
+ querySyntax(${camelName}QueryProperties),
62
+ // Add additional query properties here
63
+ Type.Object({}, { additionalProperties: false })
64
+ ], { additionalProperties: false })
55
65
  export type ${upperName}Query = Static<typeof ${camelName}QuerySchema>
56
66
  export const ${camelName}QueryValidator = getValidator(${camelName}QuerySchema, queryValidator)
57
67
  export const ${camelName}QueryResolver = resolve<${upperName}Query, HookContext>({
58
- properties: {
59
- // If there is a user (e.g. with authentication), they are only allowed to see their own data
60
- ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
61
- if (context.params.user) {
62
- return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
63
- }
64
-
65
- return value
68
+ // If there is a user (e.g. with authentication), they are only allowed to see their own data
69
+ ${type === 'mongodb' ? '_id' : 'id'}: async (value, user, context) => {
70
+ if (context.params.user) {
71
+ return context.params.user.${type === 'mongodb' ? '_id' : 'id'}
66
72
  }
73
+
74
+ return value
67
75
  }
68
76
  })
69
77
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.typebox.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/schema.typebox.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAA4C;AAC5C,oCAAwE;AAEjE,MAAM,QAAQ,GAAG,CAAC,EACvB,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,QAAQ,EACuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;EAG7C,IAAA,qBAAa,EAAC,cAAc,EAAE,iEAAiE,CAAC;;oCAE9D,QAAQ;iDACK,QAAQ;;;eAG1C,SAAS;IACpB,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CA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AxEY,QAAA,QAAQ,YAwEpB;AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmC,EAAE,EAAE,CAC9D,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC,IAAI,CACjB,IAAA,aAAI,EACF,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,EACpC,IAAA,sBAAY,EACV,gBAAQ,EACR,IAAA,eAAM,EAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAkC,EAAE,EAAE,CAAC;IACpE,GAAG;IACH,UAAU;IACV,GAAG,MAAM;IACT,GAAG,QAAQ,SAAS;CACrB,CAAC,EACF,EAAE,KAAK,EAAE,IAAI,EAAE,CAChB,CACF,CACF,CAAA;AAfU,QAAA,QAAQ,YAelB"}
1
+ {"version":3,"file":"schema.typebox.tpl.js","sourceRoot":"","sources":["../../../src/authentication/templates/schema.typebox.tpl.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAC5D,2CAAwD;AACxD,oCAAwE;AAEjE,MAAM,QAAQ,GAAG,CAAC,EACvB,GAAG,EACH,GAAG,EACH,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,QAAQ,EACuB,EAAE,EAAE,CAAC,QAAQ,CAAC;;;;EAI7C,IAAA,qBAAa,EAAC,cAAc,EAAE,iEAAiE,CAAC;;oCAE9D,QAAQ;iDACK,QAAQ,IACvD,IAAA,oBAAU,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,6CAA6C;AACjG;;;eAGe,SAAS;IACpB,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,mBAAmB;IAC/D,cAAc;KACb,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,IAAI,KAAK,OAAO;IACd,CAAC,CAAC;yCAC+B;IACjC,CAAC,CAAC,OAAO,IAAI,kCAA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