directus-template-cli 0.4.0 → 0.4.1

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/README.md CHANGED
@@ -4,7 +4,7 @@ A CLI tool to make applying or extracting Directus "templates" a little easier..
4
4
 
5
5
  **Notes:**
6
6
 
7
- - This is a pre-release. It is recommended for use on POC or demo projects only.
7
+ - This is a pre-release. It is recommended for use on POC, demo, or greenfield projects only.
8
8
  - ⚠️ Known issues with using MySQL currently, please use ONLY PostgreSQL or SQLite for your database provider.
9
9
  - Templates are applied / extracted on an all or nothing basis – meaning that all the schema, content, and system settings are extracted or applied. We'd love to support more granular operations in the future. (PRs welcome 🙏)
10
10
  - If you are extracting or applying from a remote source, the script can take quite a while depending on the "size" of your instance (how many collections, how many items in each collection, number and size of assets, etc). The script applies a strict rate limit of 10 requests per second using bottleneck.
@@ -44,7 +44,7 @@ async function getTemplate() {
44
44
  throw new Error(`Invalid download directory: ${node_path_1.default.join(__dirname, '..', 'downloads', 'official')}`);
45
45
  }
46
46
  try {
47
- const { dir } = await (0, giget_1.downloadTemplate)('github:directus-community/directus-templates', {
47
+ const { dir } = await (0, giget_1.downloadTemplate)('github:directus-labs/directus-templates', {
48
48
  dir: downloadDir,
49
49
  force: true,
50
50
  preferOffline: true,
@@ -0,0 +1 @@
1
+ export declare const protectedDomains: string[];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.protectedDomains = void 0;
4
+ exports.protectedDomains = [
5
+ 'directus.pizza',
6
+ ];
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const protected_domains_1 = require("./protected-domains");
3
4
  function validateUrl(url) {
4
5
  try {
5
- new URL(url);
6
- return true;
6
+ const parsedUrl = new URL(url);
7
+ return !protected_domains_1.protectedDomains.includes(parsedUrl.hostname);
7
8
  }
8
9
  catch {
9
10
  return false;
@@ -47,5 +47,5 @@
47
47
  ]
48
48
  }
49
49
  },
50
- "version": "0.4.0"
50
+ "version": "0.4.1"
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "directus-template-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "CLI Utility for applying templates to a Directus instance.",
5
5
  "author": "bryantgillespie @bryantgillespie",
6
6
  "bin": {