@okam/directus-node 0.3.0 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.5.0 (2025-01-30)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **redirection:** use new variable for redirection ([0c21683](https://github.com/OKAMca/stack/commit/0c21683))
6
+ - **directus-node:** adding unit test, fix logger and adding read/write functions for redirections ([6d68bb4](https://github.com/OKAMca/stack/commit/6d68bb4))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - Yan Morin
11
+
1
12
  ## 0.3.0 (2024-09-11)
2
13
 
3
14
 
package/README.md CHANGED
@@ -57,13 +57,22 @@ module.exports = {
57
57
  redirects: async () => redirects,
58
58
  rewrites: async () => rewrites,
59
59
  }
60
+ ```
61
+
62
+ 4.1 or redirect/index.mjs
63
+ ```
64
+ import redirectsData from './redirects.json' with { type: 'json' }
65
+ import rewritesData from './rewrites.json' with { type: 'json' }
60
66
 
67
+ export const redirects = async () => redirectsData
68
+ export const rewrites = async () => rewritesData
61
69
  ```
62
70
 
63
71
  5. Define environments variables
64
72
  ```
65
- NEXT_PUBLIC_GRAPHQL_URL=
66
- NEXT_API_TOKEN_ADMIN=
73
+ NEXT_REDIRECT_GRAPHQL_URL=http://server.some.url/graphql
74
+ NEXT_PUBLIC_GRAPHQL_URL=https://server.external/graphql
75
+ NEXT_API_TOKEN_ADMIN=user_token_for_graphql
67
76
  ```
68
77
 
69
78
  6. Generate redirect/redirects.json and redirect/rewrites.json using fetch-redirect (or build project with nx)
@@ -75,13 +84,23 @@ npx env-cmd -f ../../.env.local node fetch-redirect.js
75
84
  ```
76
85
  const { rewrites, redirects } = require('./redirect/index')
77
86
  ```
87
+
88
+ for next.config.mjs
89
+ ```
90
+ import { redirects, rewrites } from './redirect/index.mjs'
91
+ ```
92
+
93
+ and
94
+
78
95
  ```
79
96
  const nextConfig = {
80
97
  ...
81
98
  async redirects() {
82
99
  const rest = await redirects()
83
100
  return [
101
+ // optional i18nrouter should be before
84
102
  ...i18nReRouter({locale: false, permanent: true}, 'redirect'),
103
+ // custom redirect should be here
85
104
  ...rest,
86
105
  ]
87
106
  return rest
@@ -90,9 +109,11 @@ const nextConfig = {
90
109
  const fallback = await rewrites()
91
110
  return {
92
111
  beforeFiles: [
112
+ // optional i18n router
93
113
  ...i18nReRouter({locale: false}, 'rewrite'),
94
114
  ],
95
115
  afterFiles: [
116
+ // optional i18n router
96
117
  ...i18nRewriter({...i18nConfigWithoutLocaleDetector, localeDetector: false}),
97
118
  ],
98
119
  fallback,
@@ -101,3 +122,6 @@ const nextConfig = {
101
122
  ...
102
123
  }
103
124
  ```
125
+
126
+ ## Warning
127
+ In production (build), you can't reload dynamically in next.config.(m?)js in rewrites()/redirects() because it was compiled in `.nx/route-manifest.json`. Updating the files in redirects/ won't work. In dev mode, both rewrites()/redirects() of next.config.(m?)js are runned on each server start.
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@okam/directus-node",
3
3
  "main": "./src/index.js",
4
- "version": "0.3.0",
4
+ "version": "0.5.0",
5
5
  "types": "./src/index.d.ts",
6
6
  "publishConfig": {
7
- "registry": "https://registry.npmjs.org"
7
+ "access": "public"
8
8
  },
9
9
  "repository": {
10
10
  "url": "https://github.com/OKAMca/stack.git"
11
11
  },
12
+ "dependencies": {
13
+ "@graphql-codegen/cli": "^5.0.3",
14
+ "@okam/logger": "1.1.0",
15
+ "tslib": "^2.8.1"
16
+ },
12
17
  "type": "commonjs"
13
18
  }
package/src/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './lib/redirection';
2
2
  export { default as graphqlCodegenConfig } from './lib/codegen';
3
+ export { logger as DirectusNodeLogger } from './logger';
package/src/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.graphqlCodegenConfig = void 0;
3
+ exports.DirectusNodeLogger = exports.graphqlCodegenConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./lib/redirection"), exports);
6
6
  var codegen_1 = require("./lib/codegen");
7
- Object.defineProperty(exports, "graphqlCodegenConfig", { enumerable: true, get: function () { return codegen_1.default; } });
7
+ Object.defineProperty(exports, "graphqlCodegenConfig", { enumerable: true, get: function () { return tslib_1.__importDefault(codegen_1).default; } });
8
+ var logger_1 = require("./logger");
9
+ Object.defineProperty(exports, "DirectusNodeLogger", { enumerable: true, get: function () { return logger_1.logger; } });
8
10
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/directus/directus-node/src/index.ts"],"names":[],"mappings":";;;;AAAA,4DAAiC;AACjC,yCAA+D;AAAtD,+GAAA,OAAO,OAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/directus/directus-node/src/index.ts"],"names":[],"mappings":";;;;AAAA,4DAAiC;AACjC,yCAA+D;AAAtD,wIAAA,OAAO,OAAwB;AACxC,mCAAuD;AAA9C,4GAAA,MAAM,OAAsB"}
@@ -1,15 +1,47 @@
1
1
  interface TFetchRedirectsConfig {
2
2
  graphqlEndpoint: string;
3
3
  graphqlApiKey: string;
4
- redirectsFilename: string;
5
- rewritesFilename: string;
4
+ redirectsFilename?: string;
5
+ rewritesFilename?: string;
6
6
  limit: number | undefined;
7
7
  }
8
+ interface TFetchRedirectsResponse {
9
+ redirects: unknown;
10
+ rewrites: unknown;
11
+ }
12
+ interface TRedirectData {
13
+ source: string;
14
+ destination: string;
15
+ permanent?: boolean;
16
+ locale?: boolean;
17
+ }
18
+ type TRedirectType = 'redirects' | 'rewrites';
8
19
  export declare const redirectDefaultLimit = 2000;
9
20
  /**
10
21
  * Get Fetch Redirects Configuration
11
22
  * @returns {object}
12
23
  */
13
24
  export declare function getDefaultConfig(): TFetchRedirectsConfig;
25
+ export declare function fetchRedirectsData(config: TFetchRedirectsConfig): Promise<TFetchRedirectsResponse>;
26
+ /**
27
+ * Write Redirect Data
28
+ * @param {string} filename filename
29
+ * @param {unknown} data redirects data (rewrites or redirects)
30
+ */
31
+ export declare function writeRedirectFile(filename: string, data: unknown): Promise<boolean>;
32
+ export declare function readRedirectFileData(filename: string): Promise<unknown>;
33
+ /**
34
+ * Read one redirects or rewrites file
35
+ * @param {string} filePath relative file path like './redirect/redirects.json' to the current working dir
36
+ * @param {TRedirectType} type redirects or rewrites
37
+ * @returns {Promise<TRedirectData[]>} an array of redirect information
38
+ */
39
+ export declare function readRedirectFile(filePath: string, type?: TRedirectType): Promise<TRedirectData[]>;
40
+ /**
41
+ * Fetch and write redirects and rewrites files
42
+ * @param {TFetchRedirectsConfig} config fetch redirects configuration
43
+ * @returns {Promise<boolean>} true
44
+ * @throws {Error}
45
+ */
14
46
  export declare function fetchRedirects(config: TFetchRedirectsConfig): Promise<boolean>;
15
47
  export {};
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchRedirects = exports.getDefaultConfig = exports.redirectDefaultLimit = void 0;
3
+ exports.redirectDefaultLimit = void 0;
4
+ exports.getDefaultConfig = getDefaultConfig;
5
+ exports.fetchRedirectsData = fetchRedirectsData;
6
+ exports.writeRedirectFile = writeRedirectFile;
7
+ exports.readRedirectFileData = readRedirectFileData;
8
+ exports.readRedirectFile = readRedirectFile;
9
+ exports.fetchRedirects = fetchRedirects;
4
10
  const tslib_1 = require("tslib");
5
11
  const promises_1 = require("node:fs/promises");
12
+ const path = tslib_1.__importStar(require("node:path"));
13
+ const logger_1 = require("../logger");
6
14
  exports.redirectDefaultLimit = 2000;
7
15
  /**
8
16
  * Get Fetch Redirects Configuration
@@ -10,23 +18,22 @@ exports.redirectDefaultLimit = 2000;
10
18
  */
11
19
  function getDefaultConfig() {
12
20
  return {
13
- graphqlEndpoint: process.env['NEXT_PUBLIC_GRAPHQL_URL'] || '',
21
+ graphqlEndpoint: process.env['NEXT_REDIRECT_GRAPHQL_URL'] || process.env['NEXT_PUBLIC_GRAPHQL_URL'] || '',
14
22
  graphqlApiKey: process.env['NEXT_API_TOKEN_ADMIN'] || '',
15
23
  redirectsFilename: './redirect/redirects.json',
16
24
  rewritesFilename: './redirect/rewrites.json',
17
25
  limit: exports.redirectDefaultLimit,
18
26
  };
19
27
  }
20
- exports.getDefaultConfig = getDefaultConfig;
21
- function fetchRedirects(config) {
28
+ function fetchRedirectsData(config) {
22
29
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
30
  var _a, _b;
24
- const { graphqlEndpoint, graphqlApiKey, redirectsFilename, rewritesFilename, limit } = config;
25
- if (!graphqlEndpoint || !graphqlApiKey) {
26
- throw new Error('Missing graphql configuration: NEXT_PUBLIC_GRAPHQL_URL or NEXT_API_TOKEN_ADMIN');
31
+ const { graphqlEndpoint, graphqlApiKey, limit } = config;
32
+ if (!graphqlEndpoint) {
33
+ throw new Error('Missing fetchRedirects configuration `graphqlEndpoint`. Check environment variables NEXT_REDIRECT_GRAPHQL_URL or NEXT_PUBLIC_GRAPHQL_URL');
27
34
  }
28
- if (!redirectsFilename || !rewritesFilename) {
29
- throw new Error('Missing filename');
35
+ if (!graphqlApiKey) {
36
+ throw new Error('Missing fetchRedirects configuration `graphqlApiKey`. Check environment variable NEXT_API_TOKEN_ADMIN');
30
37
  }
31
38
  const query = `query fetchRedirects($limit: Int = 2000) {
32
39
  redirects(filter: {status:{_eq:"published"},isrewrite:{_eq:false}}, sort: "sort", limit: $limit) {
@@ -61,18 +68,95 @@ function fetchRedirects(config) {
61
68
  body: JSON.stringify(graphqlBody),
62
69
  });
63
70
  const { data } = yield response.json();
64
- const writeDataRedirects = JSON.stringify(data.redirects || []);
65
- yield (0, promises_1.writeFile)(redirectsFilename, writeDataRedirects);
66
- const writeDataRewrites = JSON.stringify(data.rewrites || []);
67
- yield (0, promises_1.writeFile)(rewritesFilename, writeDataRewrites);
68
- console.log(`Redirects count: ${((_a = data.redirects) === null || _a === void 0 ? void 0 : _a.length) || 0}, Rewrites count: ${((_b = data.rewrites) === null || _b === void 0 ? void 0 : _b.length) || 0}`);
71
+ logger_1.logger.log(`Fetch redirects count: ${((_a = data.redirects) === null || _a === void 0 ? void 0 : _a.length) || 0}, rewrites count: ${((_b = data.rewrites) === null || _b === void 0 ? void 0 : _b.length) || 0}`);
72
+ return {
73
+ redirects: data.redirects || [],
74
+ rewrites: data.rewrites || [],
75
+ };
76
+ }
77
+ catch (e) {
78
+ logger_1.logger.log(`Error fetching redirects: ${e.message}`, 'error');
79
+ }
80
+ return {
81
+ redirects: [],
82
+ rewrites: [],
83
+ };
84
+ });
85
+ }
86
+ /**
87
+ * Write Redirect Data
88
+ * @param {string} filename filename
89
+ * @param {unknown} data redirects data (rewrites or redirects)
90
+ */
91
+ function writeRedirectFile(filename, data) {
92
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
93
+ try {
94
+ const writeData = JSON.stringify(data || []);
95
+ yield (0, promises_1.writeFile)(filename, writeData);
96
+ return true;
97
+ }
98
+ catch (e) {
99
+ logger_1.logger.log(`Error writing redirect file ${filename}: ${e.message}`, 'error');
100
+ }
101
+ return false;
102
+ });
103
+ }
104
+ function readRedirectFileData(filename) {
105
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
106
+ try {
107
+ const file = yield (0, promises_1.readFile)(filename, { encoding: 'utf8' });
108
+ const data = JSON.parse(file);
109
+ return data;
69
110
  }
70
111
  catch (e) {
71
- console.warn('Error fetching redirects:', e.message);
72
- return true; // still want build to pass
112
+ logger_1.logger.log(`Failed loading redirects JSON from ${filename}: ${e.message}`, 'error');
113
+ }
114
+ return [];
115
+ });
116
+ }
117
+ /**
118
+ * Read one redirects or rewrites file
119
+ * @param {string} filePath relative file path like './redirect/redirects.json' to the current working dir
120
+ * @param {TRedirectType} type redirects or rewrites
121
+ * @returns {Promise<TRedirectData[]>} an array of redirect information
122
+ */
123
+ function readRedirectFile(filePath_1) {
124
+ return tslib_1.__awaiter(this, arguments, void 0, function* (filePath, type = 'redirects') {
125
+ const absolutePath = path.resolve(process.cwd(), filePath);
126
+ const data = yield readRedirectFileData(absolutePath);
127
+ if (Array.isArray(data)) {
128
+ // check data integrity
129
+ const checkedData = data.filter((x) => {
130
+ return x && typeof (x === null || x === void 0 ? void 0 : x.source) === 'string' && typeof (x === null || x === void 0 ? void 0 : x.destination) === 'string';
131
+ });
132
+ logger_1.logger.log(`Loading ${type} length: ${checkedData.length}`);
133
+ return checkedData;
73
134
  }
135
+ logger_1.logger.log(`Failed loading ${type}, not a valid array`, 'error');
136
+ return [];
137
+ });
138
+ }
139
+ /**
140
+ * Fetch and write redirects and rewrites files
141
+ * @param {TFetchRedirectsConfig} config fetch redirects configuration
142
+ * @returns {Promise<boolean>} true
143
+ * @throws {Error}
144
+ */
145
+ function fetchRedirects(config) {
146
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
147
+ const { redirectsFilename, rewritesFilename } = config;
148
+ if (!redirectsFilename) {
149
+ throw new Error('Missing fetchRedirects configuration `redirectsFilename`');
150
+ }
151
+ if (!rewritesFilename) {
152
+ throw new Error('Missing fetchRedirects configuration `rewritesFilename`');
153
+ }
154
+ // fetch can throw
155
+ const data = yield fetchRedirectsData(config);
156
+ // should not throw
157
+ yield writeRedirectFile(redirectsFilename, data.redirects);
158
+ yield writeRedirectFile(rewritesFilename, data.rewrites);
74
159
  return true;
75
160
  });
76
161
  }
77
- exports.fetchRedirects = fetchRedirects;
78
162
  //# sourceMappingURL=redirection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redirection.js","sourceRoot":"","sources":["../../../../../../libs/directus/directus-node/src/lib/redirection.ts"],"names":[],"mappings":";;;;AAAA,+CAA4C;AAU/B,QAAA,oBAAoB,GAAG,IAAI,CAAA;AAExC;;;GAGG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL,eAAe,EAAE,OAAO,CAAC,GAA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AE,CAAC,CAAA;YAC/D,MAAM,IAAA,oBAAS,EAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAA;YAEtD,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAA;YAC7D,MAAM,IAAA,oBAAS,EAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;YAEpD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,MAAM,KAAI,CAAC,qBAAqB,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,KAAI,CAAC,EAAE,CAAC,CAAA;QAC/G,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAG,CAAW,CAAC,OAAO,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA,CAAC,2BAA2B;QACzC,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AA5DD,wCA4DC"}
1
+ {"version":3,"file":"redirection.js","sourceRoot":"","sources":["../../../../../../libs/directus/directus-node/src/lib/redirection.ts"],"names":[],"mappings":";;;AAgCA,4CAQC;AAED,gDA8DC;AAOD,8CASC;AAED,oDASC;AAQD,4CAaC;AAQD,wCAkBC;;AAlLD,+CAAsD;AACtD,wDAAiC;AACjC,sCAAkC;AAwBrB,QAAA,oBAAoB,GAAG,IAAI,CAAA;AAExC;;;GAGG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,IAAI,EAAE;QACzG,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,IAAI,EAAE;QACxD,iBAAiB,EAAE,2BAA2B;QAC9C,gBAAgB,EAAE,0BAA0B;QAC5C,KAAK,EAAE,4BAAoB;KAC5B,CAA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"}
@@ -0,0 +1 @@
1
+ export declare const logger: import("@okam/logger").Logger;
package/src/logger.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logger = void 0;
4
+ const logger_1 = require("@okam/logger");
5
+ exports.logger = (0, logger_1.createLogger)('[DirectusNode]');
6
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../../libs/directus/directus-node/src/logger.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAE9B,QAAA,MAAM,GAAG,IAAA,qBAAY,EAAC,gBAAgB,CAAC,CAAA"}