@aeriajs/core 0.0.276 → 0.0.278

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 (73) hide show
  1. package/dist/__scripts__/postinstall.js +2 -37
  2. package/dist/accessControl.js +14 -18
  3. package/dist/assets.js +25 -31
  4. package/dist/collection/cascadingRemove.js +14 -19
  5. package/dist/collection/define.js +5 -10
  6. package/dist/collection/description.js +2 -7
  7. package/dist/collection/index.js +8 -24
  8. package/dist/collection/makePagination.js +5 -9
  9. package/dist/collection/normalizeProjection.js +1 -5
  10. package/dist/collection/preload.js +13 -18
  11. package/dist/collection/reference.js +19 -26
  12. package/dist/collection/traverseDocument.js +97 -131
  13. package/dist/context.js +16 -53
  14. package/dist/database.js +12 -52
  15. package/dist/endpoints.js +11 -48
  16. package/dist/functions/count.js +11 -15
  17. package/dist/functions/get.js +20 -24
  18. package/dist/functions/getAll.js +8 -12
  19. package/dist/functions/index.js +9 -27
  20. package/dist/functions/insert.js +19 -23
  21. package/dist/functions/remove.js +15 -19
  22. package/dist/functions/removeAll.js +11 -15
  23. package/dist/functions/removeFile.js +7 -11
  24. package/dist/functions/unpaginatedGetAll.js +15 -19
  25. package/dist/functions/upload.js +19 -57
  26. package/dist/index.js +11 -51
  27. package/dist/presets/add.js +1 -4
  28. package/dist/presets/crud.js +1 -4
  29. package/dist/presets/duplicate.js +1 -4
  30. package/dist/presets/index.js +17 -20
  31. package/dist/presets/owned.js +1 -4
  32. package/dist/presets/remove.js +1 -4
  33. package/dist/presets/removeAll.js +1 -4
  34. package/dist/presets/timestamped.js +1 -4
  35. package/dist/presets/view.js +1 -4
  36. package/dist/token.js +7 -15
  37. package/package.json +12 -17
  38. package/dist/__scripts__/postinstall.mjs +0 -50
  39. package/dist/accessControl.mjs +0 -31
  40. package/dist/assets.mjs +0 -67
  41. package/dist/collection/cascadingRemove.mjs +0 -71
  42. package/dist/collection/define.mjs +0 -13
  43. package/dist/collection/description.mjs +0 -8
  44. package/dist/collection/index.mjs +0 -9
  45. package/dist/collection/makePagination.mjs +0 -20
  46. package/dist/collection/normalizeProjection.mjs +0 -17
  47. package/dist/collection/preload.mjs +0 -88
  48. package/dist/collection/reference.mjs +0 -374
  49. package/dist/collection/traverseDocument.mjs +0 -451
  50. package/dist/context.mjs +0 -120
  51. package/dist/database.mjs +0 -49
  52. package/dist/endpoints.mjs +0 -52
  53. package/dist/functions/count.mjs +0 -50
  54. package/dist/functions/get.mjs +0 -89
  55. package/dist/functions/getAll.mjs +0 -14
  56. package/dist/functions/index.mjs +0 -12
  57. package/dist/functions/insert.mjs +0 -102
  58. package/dist/functions/remove.mjs +0 -41
  59. package/dist/functions/removeAll.mjs +0 -40
  60. package/dist/functions/removeFile.mjs +0 -29
  61. package/dist/functions/unpaginatedGetAll.mjs +0 -123
  62. package/dist/functions/upload.mjs +0 -91
  63. package/dist/index.mjs +0 -14
  64. package/dist/presets/add.mjs +0 -12
  65. package/dist/presets/crud.mjs +0 -35
  66. package/dist/presets/duplicate.mjs +0 -11
  67. package/dist/presets/index.mjs +0 -19
  68. package/dist/presets/owned.mjs +0 -9
  69. package/dist/presets/remove.mjs +0 -11
  70. package/dist/presets/removeAll.mjs +0 -11
  71. package/dist/presets/timestamped.mjs +0 -19
  72. package/dist/presets/view.mjs +0 -14
  73. package/dist/token.mjs +0 -31
@@ -1,9 +0,0 @@
1
- "use strict";
2
- export const owned = {
3
- properties: {
4
- owner: {
5
- $ref: "user",
6
- noForm: true
7
- }
8
- }
9
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- export const remove = {
3
- individualActions: {
4
- remove: {
5
- label: "action.remove",
6
- icon: "trash",
7
- ask: true,
8
- translate: true
9
- }
10
- }
11
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- export const removeAll = {
3
- actions: {
4
- removeAll: {
5
- label: "action.removeAll",
6
- ask: true,
7
- selection: true,
8
- translate: true
9
- }
10
- }
11
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- export const timestamped = {
3
- properties: {
4
- created_at: {
5
- type: "string",
6
- format: "date-time",
7
- noForm: true,
8
- readOnly: true,
9
- isTimestamp: true
10
- },
11
- updated_at: {
12
- type: "string",
13
- format: "date-time",
14
- noForm: true,
15
- readOnly: true,
16
- isTimestamp: true
17
- }
18
- }
19
- };
@@ -1,14 +0,0 @@
1
- "use strict";
2
- export const view = {
3
- individualActions: {
4
- viewItem: {
5
- label: "action.view",
6
- icon: "eye",
7
- translate: true,
8
- route: {
9
- name: "/dashboard/:collection/:id",
10
- setItem: true
11
- }
12
- }
13
- }
14
- };
package/dist/token.mjs DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- import { getConfig } from "@aeriajs/entrypoint";
3
- import jwt from "jsonwebtoken";
4
- const getTokenConfig = async () => {
5
- const config = await getConfig();
6
- if (!config.secret) {
7
- throw new Error("application secret is not set");
8
- }
9
- return {
10
- name: config.name,
11
- secret: config.secret,
12
- tokenExpiration: config.security.tokenExpiration
13
- };
14
- };
15
- export const signToken = async ({ iat, exp, ...payload }, secret, options) => {
16
- const tokenConfig = await getTokenConfig();
17
- if (tokenConfig.name) {
18
- payload.aud = tokenConfig.name;
19
- }
20
- const tokenOptions = options || {};
21
- if (!options) {
22
- if (tokenConfig.tokenExpiration) {
23
- tokenOptions.expiresIn = tokenConfig.tokenExpiration;
24
- }
25
- }
26
- return jwt.sign(payload, secret || tokenConfig.secret, tokenOptions);
27
- };
28
- export const decodeToken = async (token, secret) => {
29
- const tokenConfig = await getTokenConfig();
30
- return jwt.verify(token, secret || tokenConfig.secret);
31
- };