directus-template-cli 0.3.6 → 0.4.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/README.md +5 -2
- package/dist/commands/apply.d.ts +1 -1
- package/dist/commands/apply.js +80 -50
- package/dist/commands/extract.d.ts +1 -2
- package/dist/commands/extract.js +13 -18
- package/dist/lib/extract/extract-assets.d.ts +182 -2
- package/dist/lib/extract/extract-assets.js +25 -32
- package/dist/lib/extract/extract-collections.d.ts +4 -0
- package/dist/lib/extract/extract-collections.js +24 -0
- package/dist/lib/extract/extract-content.d.ts +1 -1
- package/dist/lib/extract/extract-content.js +18 -18
- package/dist/lib/extract/extract-dashboards.d.ts +8 -0
- package/dist/lib/extract/extract-dashboards.js +42 -0
- package/dist/lib/extract/extract-fields.d.ts +4 -0
- package/dist/lib/extract/extract-fields.js +30 -0
- package/dist/lib/extract/extract-files.js +11 -34
- package/dist/lib/extract/extract-flows.d.ts +8 -0
- package/dist/lib/extract/extract-flows.js +42 -0
- package/dist/lib/extract/extract-folders.d.ts +1 -1
- package/dist/lib/extract/extract-folders.js +12 -13
- package/dist/lib/extract/extract-permissions.d.ts +1 -1
- package/dist/lib/extract/extract-permissions.js +13 -13
- package/dist/lib/extract/extract-presets.js +15 -11
- package/dist/lib/extract/extract-relations.d.ts +4 -0
- package/dist/lib/extract/extract-relations.js +33 -0
- package/dist/lib/extract/extract-roles.js +11 -22
- package/dist/lib/extract/extract-schema.js +14 -14
- package/dist/lib/extract/extract-settings.d.ts +4 -0
- package/dist/lib/extract/extract-settings.js +22 -0
- package/dist/lib/extract/extract-translations.d.ts +4 -0
- package/dist/lib/extract/extract-translations.js +24 -0
- package/dist/lib/extract/extract-users.d.ts +1 -1
- package/dist/lib/extract/extract-users.js +14 -36
- package/dist/lib/extract/index.d.ts +1 -1
- package/dist/lib/extract/index.js +27 -32
- package/dist/lib/interfaces.d.ts +1 -1
- package/dist/lib/load/index.d.ts +1 -1
- package/dist/lib/load/index.js +33 -44
- package/dist/lib/load/load-collections.d.ts +4 -0
- package/dist/lib/load/load-collections.js +66 -0
- package/dist/lib/load/load-dashboards.d.ts +2 -1
- package/dist/lib/load/load-dashboards.js +33 -3
- package/dist/lib/load/load-data.d.ts +1 -1
- package/dist/lib/load/load-data.js +87 -60
- package/dist/lib/load/load-files.d.ts +1 -1
- package/dist/lib/load/load-files.js +23 -20
- package/dist/lib/load/load-flows.d.ts +2 -2
- package/dist/lib/load/load-flows.js +43 -9
- package/dist/lib/load/load-folders.js +15 -11
- package/dist/lib/load/load-permissions.d.ts +1 -1
- package/dist/lib/load/load-permissions.js +22 -21
- package/dist/lib/load/load-presets.d.ts +1 -2
- package/dist/lib/load/load-presets.js +16 -19
- package/dist/lib/load/load-relations.d.ts +4 -0
- package/dist/lib/load/load-relations.js +33 -0
- package/dist/lib/load/load-roles.d.ts +1 -1
- package/dist/lib/load/load-roles.js +20 -10
- package/dist/lib/load/load-schema.d.ts +14 -2
- package/dist/lib/load/load-schema.js +85 -10
- package/dist/lib/load/load-settings.d.ts +1 -1
- package/dist/lib/load/load-settings.js +10 -4
- package/dist/lib/load/load-translations.d.ts +1 -0
- package/dist/lib/load/load-translations.js +21 -0
- package/dist/lib/load/load-users.d.ts +1 -2
- package/dist/lib/load/load-users.js +19 -8
- package/dist/lib/sdk.d.ts +13 -0
- package/dist/lib/sdk.js +26 -0
- package/dist/lib/utils/auth.d.ts +2 -2
- package/dist/lib/utils/auth.js +12 -11
- package/dist/lib/utils/check-template.d.ts +1 -0
- package/dist/lib/utils/check-template.js +32 -0
- package/dist/lib/utils/filter-fields.js +5 -5
- package/dist/lib/utils/get-role-ids.d.ts +55 -0
- package/dist/lib/utils/get-role-ids.js +14 -0
- package/dist/lib/utils/log-error.d.ts +14 -0
- package/dist/lib/utils/log-error.js +25 -0
- package/dist/lib/utils/path.d.ts +7 -0
- package/dist/lib/utils/path.js +20 -0
- package/dist/lib/utils/read-file.d.ts +0 -1
- package/dist/lib/utils/read-file.js +7 -9
- package/dist/lib/utils/read-templates.js +2 -2
- package/dist/lib/utils/system-fields.d.ts +20 -0
- package/dist/lib/utils/system-fields.js +159 -0
- package/dist/lib/utils/template-defaults.js +8 -11
- package/dist/lib/utils/transform-github-url.d.ts +1 -0
- package/dist/lib/utils/transform-github-url.js +15 -0
- package/dist/lib/utils/validate-url.js +1 -1
- package/dist/lib/utils/write-to-file.js +4 -4
- package/oclif.manifest.json +34 -16
- package/package.json +25 -23
- package/dist/lib/api.d.ts +0 -15
- package/dist/lib/api.js +0 -37
- package/dist/lib/extract/extract-from-endpoint.d.ts +0 -4
- package/dist/lib/extract/extract-from-endpoint.js +0 -23
- package/dist/lib/load/load-operations.d.ts +0 -1
- package/dist/lib/load/load-operations.js +0 -29
- package/dist/lib/load/load-panels.d.ts +0 -0
- package/dist/lib/load/load-panels.js +0 -0
- package/dist/lib/utils/delete-items.d.ts +0 -1
- package/dist/lib/utils/delete-items.js +0 -15
- package/dist/lib/utils/load-to-destination.d.ts +0 -1
- package/dist/lib/utils/load-to-destination.js +0 -14
- package/templates/agencyos/README.md +0 -11
- package/templates/agencyos/package.json +0 -11
- package/templates/agencyos/src/assets/08177527-b867-47e9-b5d5-eab146b3cdba.jpg +0 -0
- package/templates/agencyos/src/assets/08242513-ca8f-471f-b69b-82703a19d1e5.svg +0 -14
- package/templates/agencyos/src/assets/0dfe66dd-ceba-4dca-8907-03b2dda49443.svg +0 -1
- package/templates/agencyos/src/assets/12e02b82-b4a4-4aaf-8ca4-e73c20a41c26.jpeg +0 -0
- package/templates/agencyos/src/assets/1f19dd72-a433-481d-9b51-e3cc8e4f33d3.svg +0 -1
- package/templates/agencyos/src/assets/1f69c0b8-19b7-49d7-b420-bedad577a079.png +0 -0
- package/templates/agencyos/src/assets/21e179ab-72c3-4350-b46a-fadd16f5652e.svg +0 -1
- package/templates/agencyos/src/assets/270fa8d1-45a3-4fcb-87d2-27a0248f1daf.jpg +0 -0
- package/templates/agencyos/src/assets/27f55be1-7ef5-47c4-87ba-ab9a060ab270.jpeg +0 -0
- package/templates/agencyos/src/assets/2b4a0ba0-52c7-4e10-b191-c803d8da6a36.png +0 -0
- package/templates/agencyos/src/assets/35a67f1b-d401-4300-a503-b8e583186f2a.svg +0 -11
- package/templates/agencyos/src/assets/3eff7dc2-445a-47c5-9503-3f600ecdb5c6.jpeg +0 -0
- package/templates/agencyos/src/assets/44a4e780-d59b-4fa5-9b26-1c4b447474d2.jpg +0 -0
- package/templates/agencyos/src/assets/4b31c98e-ec03-4b91-bb18-ef55dd199638.jpg +0 -0
- package/templates/agencyos/src/assets/5419bf05-9ab2-484b-a69d-d09b18602cf1.svg +0 -1
- package/templates/agencyos/src/assets/5a6dfe1e-7e5b-4a5f-9f6c-983777a67c05.svg +0 -1
- package/templates/agencyos/src/assets/643faffb-d41d-48ad-9050-881cf495cbb6.jpg +0 -0
- package/templates/agencyos/src/assets/6464e61f-455a-4b47-b623-bb12e5251dfe.jpeg +0 -0
- package/templates/agencyos/src/assets/6789bc72-ab83-40bf-8152-d6f2bafbc2a8.png +0 -0
- package/templates/agencyos/src/assets/68103296-6634-4d66-918a-04b09afe6621.jpeg +0 -0
- package/templates/agencyos/src/assets/690c2042-e3ad-46f4-9cd8-095a7b3a1df7.svg +0 -3
- package/templates/agencyos/src/assets/6a1ca349-d7ab-4f43-9284-c61671e145f2.svg +0 -22
- package/templates/agencyos/src/assets/6dad2008-3af5-407e-827e-da5744223181.svg +0 -1
- package/templates/agencyos/src/assets/6ff389c5-3ecb-4219-8f72-f10326aab421.jpg +0 -0
- package/templates/agencyos/src/assets/7647f4c2-9880-433a-bb8e-69b0c30ae31e.svg +0 -1
- package/templates/agencyos/src/assets/7775c53a-6c2c-453d-8c22-8b5445121d10.jpeg +0 -0
- package/templates/agencyos/src/assets/793e9bf7-c646-4588-8865-fe22556070ff.svg +0 -1
- package/templates/agencyos/src/assets/87fc0e81-45e4-4c05-8e9a-8e5c759d7aae.png +0 -0
- package/templates/agencyos/src/assets/88b95737-7ff4-4a09-8523-362d42caa9f9.jpg +0 -0
- package/templates/agencyos/src/assets/8f748634-d77b-4985-b27e-7e1f3559881a.jpeg +0 -0
- package/templates/agencyos/src/assets/a104c031-6ad2-4148-ace6-052e28cfda0b.svg +0 -1
- package/templates/agencyos/src/assets/ac905071-0643-4337-8f53-48ed45b1ccf2.jpg +0 -0
- package/templates/agencyos/src/assets/b1a3fd77-8e62-4678-9d44-333a30eec13b.jpg +0 -0
- package/templates/agencyos/src/assets/b210ecec-860f-4057-bab9-18c044b6e129.jpg +0 -0
- package/templates/agencyos/src/assets/b9db00d9-535f-4e24-8a46-5f7e5fc65bf2.jpg +0 -0
- package/templates/agencyos/src/assets/c0253924-38cd-4ca0-9989-9c0a57ec076a.png +0 -0
- package/templates/agencyos/src/assets/ce0b845f-f8d8-4856-b0af-1df4e3a838cc.jpg +0 -0
- package/templates/agencyos/src/assets/d0130348-9ead-49d0-b8e7-871cd43921a0.svg +0 -1
- package/templates/agencyos/src/assets/d4fd6edc-4cc5-48c1-8bc7-e646924bbdca.jpeg +0 -0
- package/templates/agencyos/src/assets/d598a4c0-4e9a-44a3-a72e-49564e34a432.jpg +0 -0
- package/templates/agencyos/src/assets/d94c9355-d89e-4229-941a-62b8525fd69a.png +0 -0
- package/templates/agencyos/src/assets/df0745c2-b6e3-4b37-b64d-55a4eb0033ab.avif +0 -0
- package/templates/agencyos/src/assets/df979753-946b-4d93-954e-e24367388d2c.svg +0 -1
- package/templates/agencyos/src/assets/dfa90758-9700-49e4-8fa2-b6cd074811b7.png +0 -0
- package/templates/agencyos/src/assets/e15ca910-1567-4f15-b5a0-b802da67f228.jpg +0 -0
- package/templates/agencyos/src/assets/eef7d7b1-3bf9-4647-90c1-a16c24161335.svg +0 -4
- package/templates/agencyos/src/assets/f1693c44-52e4-4fae-a7d2-b3153a34eb72.jpg +0 -0
- package/templates/agencyos/src/assets/f81e1a85-5a9c-41ef-9ef3-6a9349722daa.jpg +0 -0
- package/templates/agencyos/src/assets/fbae19f3-8739-4048-a20f-89ebbf59b032.jpg +0 -0
- package/templates/agencyos/src/collections.json +0 -3007
- package/templates/agencyos/src/content/block_button.json +0 -50
- package/templates/agencyos/src/content/block_button_group.json +0 -27
- package/templates/agencyos/src/content/block_columns.json +0 -18
- package/templates/agencyos/src/content/block_columns_rows.json +0 -47
- package/templates/agencyos/src/content/block_cta.json +0 -9
- package/templates/agencyos/src/content/block_divider.json +0 -14
- package/templates/agencyos/src/content/block_faqs.json +0 -90
- package/templates/agencyos/src/content/block_form.json +0 -26
- package/templates/agencyos/src/content/block_gallery.json +0 -19
- package/templates/agencyos/src/content/block_gallery_files.json +0 -102
- package/templates/agencyos/src/content/block_hero.json +0 -20
- package/templates/agencyos/src/content/block_html.json +0 -1
- package/templates/agencyos/src/content/block_logocloud.json +0 -24
- package/templates/agencyos/src/content/block_logocloud_logos.json +0 -50
- package/templates/agencyos/src/content/block_quote.json +0 -14
- package/templates/agencyos/src/content/block_richtext.json +0 -58
- package/templates/agencyos/src/content/block_step_items.json +0 -47
- package/templates/agencyos/src/content/block_steps.json +0 -24
- package/templates/agencyos/src/content/block_team.json +0 -14
- package/templates/agencyos/src/content/block_testimonial_slider_items.json +0 -42
- package/templates/agencyos/src/content/block_testimonials.json +0 -13
- package/templates/agencyos/src/content/block_video.json +0 -10
- package/templates/agencyos/src/content/categories.json +0 -38
- package/templates/agencyos/src/content/contacts.json +0 -46
- package/templates/agencyos/src/content/conversations.json +0 -1
- package/templates/agencyos/src/content/forms.json +0 -129
- package/templates/agencyos/src/content/globals.json +0 -52
- package/templates/agencyos/src/content/help_articles.json +0 -1
- package/templates/agencyos/src/content/help_collections.json +0 -20
- package/templates/agencyos/src/content/help_feedback.json +0 -122
- package/templates/agencyos/src/content/inbox.json +0 -15
- package/templates/agencyos/src/content/messages.json +0 -1
- package/templates/agencyos/src/content/navigation.json +0 -34
- package/templates/agencyos/src/content/navigation_items.json +0 -185
- package/templates/agencyos/src/content/organization_addresses.json +0 -18
- package/templates/agencyos/src/content/organizations.json +0 -50
- package/templates/agencyos/src/content/organizations_contacts.json +0 -14
- package/templates/agencyos/src/content/os_activities.json +0 -23
- package/templates/agencyos/src/content/os_activity_contacts.json +0 -7
- package/templates/agencyos/src/content/os_deal_contacts.json +0 -9
- package/templates/agencyos/src/content/os_deal_stages.json +0 -68
- package/templates/agencyos/src/content/os_deals.json +0 -27
- package/templates/agencyos/src/content/os_email_templates.json +0 -13
- package/templates/agencyos/src/content/os_expenses.json +0 -22
- package/templates/agencyos/src/content/os_invoice_items.json +0 -65
- package/templates/agencyos/src/content/os_invoices.json +0 -29
- package/templates/agencyos/src/content/os_items.json +0 -17
- package/templates/agencyos/src/content/os_payment_terms.json +0 -18
- package/templates/agencyos/src/content/os_payments.json +0 -291
- package/templates/agencyos/src/content/os_project_contacts.json +0 -8
- package/templates/agencyos/src/content/os_project_files.json +0 -1
- package/templates/agencyos/src/content/os_project_templates.json +0 -467
- package/templates/agencyos/src/content/os_project_updates.json +0 -1
- package/templates/agencyos/src/content/os_projects.json +0 -50
- package/templates/agencyos/src/content/os_proposal_approvals.json +0 -1
- package/templates/agencyos/src/content/os_proposal_blocks.json +0 -134
- package/templates/agencyos/src/content/os_proposal_contacts.json +0 -8
- package/templates/agencyos/src/content/os_proposals.json +0 -33
- package/templates/agencyos/src/content/os_settings.json +0 -6
- package/templates/agencyos/src/content/os_task_files.json +0 -1
- package/templates/agencyos/src/content/os_tasks.json +0 -464
- package/templates/agencyos/src/content/os_tax_rates.json +0 -24
- package/templates/agencyos/src/content/page_blocks.json +0 -170
- package/templates/agencyos/src/content/pages.json +0 -96
- package/templates/agencyos/src/content/pages_blog.json +0 -7
- package/templates/agencyos/src/content/pages_projects.json +0 -6
- package/templates/agencyos/src/content/post_gallery_items.json +0 -32
- package/templates/agencyos/src/content/posts.json +0 -235
- package/templates/agencyos/src/content/redirects.json +0 -12
- package/templates/agencyos/src/content/seo.json +0 -52
- package/templates/agencyos/src/content/team.json +0 -128
- package/templates/agencyos/src/content/testimonials.json +0 -66
- package/templates/agencyos/src/dashboards.json +0 -64
- package/templates/agencyos/src/files.json +0 -1129
- package/templates/agencyos/src/flows.json +0 -451
- package/templates/agencyos/src/folders.json +0 -104
- package/templates/agencyos/src/operations.json +0 -717
- package/templates/agencyos/src/panels.json +0 -1019
- package/templates/agencyos/src/permissions.json +0 -5533
- package/templates/agencyos/src/presets.json +0 -2421
- package/templates/agencyos/src/public-permissions.json +0 -629
- package/templates/agencyos/src/roles.json +0 -46
- package/templates/agencyos/src/schema/snapshot.json +0 -39415
- package/templates/agencyos/src/settings.json +0 -99
- package/templates/agencyos/src/users.json +0 -147
- package/templates/website/README.md +0 -15
- package/templates/website/package.json +0 -11
- package/templates/website/src/assets/004e37f7-765e-4339-8d44-987729e47898.png +0 -0
- package/templates/website/src/assets/008b1c0e-bdd3-4c5f-a029-b9c07582a42d.jpg +0 -0
- package/templates/website/src/assets/08177527-b867-47e9-b5d5-eab146b3cdba.jpg +0 -0
- package/templates/website/src/assets/0dfe66dd-ceba-4dca-8907-03b2dda49443.svg +0 -1
- package/templates/website/src/assets/12e02b82-b4a4-4aaf-8ca4-e73c20a41c26.jpeg +0 -0
- package/templates/website/src/assets/18bf5269-9986-48c7-b607-01b77283df3b.png +0 -0
- package/templates/website/src/assets/1f19dd72-a433-481d-9b51-e3cc8e4f33d3.svg +0 -1
- package/templates/website/src/assets/270fa8d1-45a3-4fcb-87d2-27a0248f1daf.jpg +0 -0
- package/templates/website/src/assets/27f55be1-7ef5-47c4-87ba-ab9a060ab270.jpeg +0 -0
- package/templates/website/src/assets/284c190b-0ebb-4b3e-847d-c260b793b77c.png +0 -0
- package/templates/website/src/assets/35a67f1b-d401-4300-a503-b8e583186f2a.svg +0 -11
- package/templates/website/src/assets/3ac899c4-4bf9-4733-b2c4-b259c69faf46.png +0 -0
- package/templates/website/src/assets/3eff7dc2-445a-47c5-9503-3f600ecdb5c6.jpeg +0 -0
- package/templates/website/src/assets/40a0a417-231e-4819-86bf-66e96ec64852.svg +0 -3
- package/templates/website/src/assets/45140116-7656-4226-99b6-fd750722a083.svg +0 -3
- package/templates/website/src/assets/4b31c98e-ec03-4b91-bb18-ef55dd199638.jpg +0 -0
- package/templates/website/src/assets/57c6e801-9ba1-46eb-beb7-96cf7c497c92.svg +0 -1
- package/templates/website/src/assets/643faffb-d41d-48ad-9050-881cf495cbb6.jpg +0 -0
- package/templates/website/src/assets/6464e61f-455a-4b47-b623-bb12e5251dfe.jpeg +0 -0
- package/templates/website/src/assets/68103296-6634-4d66-918a-04b09afe6621.jpeg +0 -0
- package/templates/website/src/assets/68ee3ce3-bc8e-4901-b3a6-8a23afda0fa0.jpg +0 -0
- package/templates/website/src/assets/6dad2008-3af5-407e-827e-da5744223181.svg +0 -1
- package/templates/website/src/assets/72eea8c7-72fe-4ef2-9e57-524f7cb886a4.jpg +0 -0
- package/templates/website/src/assets/72f6f5a0-9a07-422f-b82f-b9e295ce5afa.svg +0 -4
- package/templates/website/src/assets/7775c53a-6c2c-453d-8c22-8b5445121d10.jpeg +0 -0
- package/templates/website/src/assets/7834aacc-d78c-4a55-ba92-d7b5d74188c1.png +0 -0
- package/templates/website/src/assets/7a5b47f6-d648-48f9-bf93-4bfafda48940.png +0 -0
- package/templates/website/src/assets/7c04cbdd-4b48-41aa-94d7-fc7c17373b1a.png +0 -0
- package/templates/website/src/assets/82b872b1-ff96-4af6-b7f1-878e60c3c448.png +0 -0
- package/templates/website/src/assets/840ec616-acad-412e-be79-485a702f9a55.svg +0 -1
- package/templates/website/src/assets/87fc0e81-45e4-4c05-8e9a-8e5c759d7aae.png +0 -0
- package/templates/website/src/assets/8bc1e7b3-b795-46af-bac4-34f7d90b902f.JPG +0 -0
- package/templates/website/src/assets/8f748634-d77b-4985-b27e-7e1f3559881a.jpeg +0 -0
- package/templates/website/src/assets/9778a2b4-27de-4035-af5a-f58897578787.png +0 -0
- package/templates/website/src/assets/a104c031-6ad2-4148-ace6-052e28cfda0b.svg +0 -1
- package/templates/website/src/assets/b626a403-5f09-4463-9715-44b2bd34eb26.jpg +0 -0
- package/templates/website/src/assets/c38f6e9e-7bb5-46c7-8266-b27ab96a1282.png +0 -0
- package/templates/website/src/assets/c983bd13-da09-4c90-8e65-ae6a92093df8.png +0 -0
- package/templates/website/src/assets/d0130348-9ead-49d0-b8e7-871cd43921a0.svg +0 -1
- package/templates/website/src/assets/d304528e-9000-4530-92cf-bb04891e8d5d.jpg +0 -0
- package/templates/website/src/assets/d4fd6edc-4cc5-48c1-8bc7-e646924bbdca.jpeg +0 -0
- package/templates/website/src/assets/d598a4c0-4e9a-44a3-a72e-49564e34a432.jpg +0 -0
- package/templates/website/src/assets/dfa90758-9700-49e4-8fa2-b6cd074811b7.png +0 -0
- package/templates/website/src/assets/e15ca910-1567-4f15-b5a0-b802da67f228.jpg +0 -0
- package/templates/website/src/assets/ea18cbf2-3c4f-488b-a68c-2d3a64cc9137.png +0 -0
- package/templates/website/src/assets/eb8e4c86-92ac-4697-9634-2e376f5d6015.png +0 -0
- package/templates/website/src/assets/f1693c44-52e4-4fae-a7d2-b3153a34eb72.jpg +0 -0
- package/templates/website/src/collections.json +0 -1788
- package/templates/website/src/content/block_cardgroup.json +0 -26
- package/templates/website/src/content/block_cardgroup_cards.json +0 -1
- package/templates/website/src/content/block_cardgroup_posts.json +0 -32
- package/templates/website/src/content/block_columns.json +0 -21
- package/templates/website/src/content/block_columns_rows.json +0 -47
- package/templates/website/src/content/block_cta.json +0 -15
- package/templates/website/src/content/block_faqs.json +0 -45
- package/templates/website/src/content/block_form.json +0 -26
- package/templates/website/src/content/block_gallery.json +0 -15
- package/templates/website/src/content/block_gallery_files.json +0 -38
- package/templates/website/src/content/block_hero.json +0 -145
- package/templates/website/src/content/block_html.json +0 -1
- package/templates/website/src/content/block_logocloud.json +0 -16
- package/templates/website/src/content/block_logocloud_files.json +0 -44
- package/templates/website/src/content/block_quote.json +0 -11
- package/templates/website/src/content/block_richtext.json +0 -32
- package/templates/website/src/content/block_steps.json +0 -14
- package/templates/website/src/content/block_steps_items.json +0 -26
- package/templates/website/src/content/block_team.json +0 -8
- package/templates/website/src/content/block_testimonials.json +0 -13
- package/templates/website/src/content/block_testimonials_items.json +0 -26
- package/templates/website/src/content/block_video.json +0 -10
- package/templates/website/src/content/blog_settings.json +0 -8
- package/templates/website/src/content/categories.json +0 -38
- package/templates/website/src/content/events.json +0 -1
- package/templates/website/src/content/forms.json +0 -92
- package/templates/website/src/content/globals.json +0 -57
- package/templates/website/src/content/inbox.json +0 -21
- package/templates/website/src/content/metrics.json +0 -1
- package/templates/website/src/content/navigation.json +0 -30
- package/templates/website/src/content/navigation_items.json +0 -140
- package/templates/website/src/content/pages.json +0 -123
- package/templates/website/src/content/pages_blocks.json +0 -310
- package/templates/website/src/content/posts.json +0 -120
- package/templates/website/src/content/projects.json +0 -48
- package/templates/website/src/content/projects_files.json +0 -44
- package/templates/website/src/content/projects_settings.json +0 -6
- package/templates/website/src/content/redirects.json +0 -12
- package/templates/website/src/content/seo.json +0 -278
- package/templates/website/src/content/team.json +0 -132
- package/templates/website/src/content/testimonials.json +0 -66
- package/templates/website/src/dashboards.json +0 -38
- package/templates/website/src/fields.json +0 -27761
- package/templates/website/src/files.json +0 -1100
- package/templates/website/src/flows.json +0 -131
- package/templates/website/src/folders.json +0 -52
- package/templates/website/src/operations.json +0 -214
- package/templates/website/src/panels.json +0 -433
- package/templates/website/src/permissions.json +0 -1556
- package/templates/website/src/presets.json +0 -1254
- package/templates/website/src/public-permissions.json +0 -511
- package/templates/website/src/roles.json +0 -70
- package/templates/website/src/schema/snapshot.json +0 -17018
- package/templates/website/src/settings.json +0 -66
- package/templates/website/src/users.json +0 -194
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export default function getRoleIds(dir: string): Promise<{
|
|
2
|
+
legacyAdminRoleId: any;
|
|
3
|
+
newAdminRoleId: string | {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
description: string;
|
|
8
|
+
ip_access: string;
|
|
9
|
+
enforce_tfa: boolean;
|
|
10
|
+
admin_access: boolean;
|
|
11
|
+
app_access: boolean;
|
|
12
|
+
} | import("@directus/sdk/dist/types-ZBNrmR-A").ax<import("@directus/sdk/dist/types-ZBNrmR-A").a8<{
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
description: string;
|
|
17
|
+
ip_access: string;
|
|
18
|
+
enforce_tfa: boolean;
|
|
19
|
+
admin_access: boolean;
|
|
20
|
+
app_access: boolean;
|
|
21
|
+
}, "name" | "description" | "id" | "icon" | "ip_access" | "enforce_tfa" | "admin_access" | "app_access", import("@directus/sdk/dist/types-ZBNrmR-A").aI<import("../sdk").Schema, {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
description: string;
|
|
26
|
+
ip_access: string;
|
|
27
|
+
enforce_tfa: boolean;
|
|
28
|
+
admin_access: boolean;
|
|
29
|
+
app_access: boolean;
|
|
30
|
+
}>>, {
|
|
31
|
+
[x: string]: never;
|
|
32
|
+
[x: number]: never;
|
|
33
|
+
}, import("@directus/sdk/dist/types-ZBNrmR-A").a8<{
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
description: string;
|
|
38
|
+
ip_access: string;
|
|
39
|
+
enforce_tfa: boolean;
|
|
40
|
+
admin_access: boolean;
|
|
41
|
+
app_access: boolean;
|
|
42
|
+
}, "name" | "description" | "id" | "icon" | "ip_access" | "enforce_tfa" | "admin_access" | "app_access", import("@directus/sdk/dist/types-ZBNrmR-A").aI<import("../sdk").Schema, {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
description: string;
|
|
47
|
+
ip_access: string;
|
|
48
|
+
enforce_tfa: boolean;
|
|
49
|
+
admin_access: boolean;
|
|
50
|
+
app_access: boolean;
|
|
51
|
+
}>>, {
|
|
52
|
+
[x: string]: never;
|
|
53
|
+
[x: number]: never;
|
|
54
|
+
}>;
|
|
55
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const sdk_1 = require("@directus/sdk");
|
|
5
|
+
const sdk_2 = require("../sdk");
|
|
6
|
+
const read_file_1 = tslib_1.__importDefault(require("./read-file"));
|
|
7
|
+
async function getRoleIds(dir) {
|
|
8
|
+
const roles = (0, read_file_1.default)('roles', dir);
|
|
9
|
+
const legacyAdminRoleId = roles.find(role => role.name === 'Administrator').id;
|
|
10
|
+
const currentUser = await sdk_2.api.client.request((0, sdk_1.readMe)());
|
|
11
|
+
const newAdminRoleId = currentUser.role;
|
|
12
|
+
return { legacyAdminRoleId, newAdminRoleId };
|
|
13
|
+
}
|
|
14
|
+
exports.default = getRoleIds;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Error {
|
|
2
|
+
errors: {
|
|
3
|
+
message: string;
|
|
4
|
+
}[];
|
|
5
|
+
response: {
|
|
6
|
+
status: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface Options {
|
|
10
|
+
fatal?: boolean;
|
|
11
|
+
logToFile?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export default function logError(error: Error, options?: Options): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
6
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
7
|
+
function logError(error, options = {}) {
|
|
8
|
+
const errorMessage = `Status ${error.response.status} • ${error.errors[0].message}\n`;
|
|
9
|
+
if (options.fatal) {
|
|
10
|
+
core_1.ux.error(errorMessage);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
core_1.ux.warn(errorMessage);
|
|
14
|
+
}
|
|
15
|
+
if (options.logToFile) {
|
|
16
|
+
const logFilePath = node_path_1.default.join(__dirname, 'error.log');
|
|
17
|
+
try {
|
|
18
|
+
node_fs_1.default.appendFileSync(logFilePath, `${new Date().toISOString()} - ${errorMessage}`);
|
|
19
|
+
}
|
|
20
|
+
catch (fileError) {
|
|
21
|
+
console.error('Error writing to log file:', fileError);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = logError;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a given path to an absolute path and checks if it exists.
|
|
3
|
+
* @param inputPath The path to resolve.
|
|
4
|
+
* @param checkExistence Whether to check if the resolved path exists.
|
|
5
|
+
* @returns The resolved absolute path if it exists, or null if it doesn't.
|
|
6
|
+
*/
|
|
7
|
+
export default function resolvePathAndCheckExistence(inputPath: string, checkExistence?: boolean): null | string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
5
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
|
+
const node_process_1 = require("node:process");
|
|
7
|
+
/**
|
|
8
|
+
* Resolves a given path to an absolute path and checks if it exists.
|
|
9
|
+
* @param inputPath The path to resolve.
|
|
10
|
+
* @param checkExistence Whether to check if the resolved path exists.
|
|
11
|
+
* @returns The resolved absolute path if it exists, or null if it doesn't.
|
|
12
|
+
*/
|
|
13
|
+
function resolvePathAndCheckExistence(inputPath, checkExistence = true) {
|
|
14
|
+
const resolvedPath = node_path_1.default.isAbsolute(inputPath) ? inputPath : node_path_1.default.resolve((0, node_process_1.cwd)(), inputPath);
|
|
15
|
+
if (!checkExistence || node_fs_1.default.existsSync(resolvedPath)) {
|
|
16
|
+
return resolvedPath;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
exports.default = resolvePathAndCheckExistence;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readJsonFile = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
4
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
5
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
6
|
function readFile(file, dir) {
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const filePath = node_path_1.default.join(dir, `${file}.json`); // Use path.join for proper path resolution
|
|
8
|
+
if (!node_fs_1.default.existsSync(filePath)) {
|
|
9
|
+
throw new Error(`File not found: ${filePath}`); // Improved error handling
|
|
10
|
+
}
|
|
11
|
+
const fileContents = node_fs_1.default.readFileSync(filePath, 'utf8');
|
|
12
|
+
const obj = JSON.parse(fileContents);
|
|
9
13
|
return obj;
|
|
10
14
|
}
|
|
11
15
|
exports.default = readFile;
|
|
12
|
-
function readJsonFile(path) {
|
|
13
|
-
const f = node_fs_1.default.readFileSync(`${path}.json`, 'utf8');
|
|
14
|
-
const obj = JSON.parse(f);
|
|
15
|
-
return obj;
|
|
16
|
-
}
|
|
17
|
-
exports.readJsonFile = readJsonFile;
|
|
@@ -5,9 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
6
6
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
7
7
|
async function readTemplate(directoryPath) {
|
|
8
|
-
const packageFilePath = node_path_1.default.join(directoryPath,
|
|
8
|
+
const packageFilePath = node_path_1.default.join(directoryPath, 'package.json');
|
|
9
9
|
try {
|
|
10
|
-
const packageData = await node_fs_1.default.promises.readFile(packageFilePath,
|
|
10
|
+
const packageData = await node_fs_1.default.promises.readFile(packageFilePath, 'utf8');
|
|
11
11
|
const packageJson = JSON.parse(packageData);
|
|
12
12
|
if (packageJson.templateName) {
|
|
13
13
|
return {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const directusUserFields: string[];
|
|
2
|
+
export declare const directusRoleFields: string[];
|
|
3
|
+
export declare const directusFileFields: string[];
|
|
4
|
+
export declare const directusFolderFields: string[];
|
|
5
|
+
export declare const directusFlowFields: string[];
|
|
6
|
+
export declare const directusOperationFields: string[];
|
|
7
|
+
export declare const directusDashboardFields: string[];
|
|
8
|
+
export declare const directusPanelFields: string[];
|
|
9
|
+
export declare const directusSettingsFields: string[];
|
|
10
|
+
export declare const systemFields: {
|
|
11
|
+
directus_dashboards: string[];
|
|
12
|
+
directus_files: string[];
|
|
13
|
+
directus_flows: string[];
|
|
14
|
+
directus_folders: string[];
|
|
15
|
+
directus_operations: string[];
|
|
16
|
+
directus_panels: string[];
|
|
17
|
+
directus_roles: string[];
|
|
18
|
+
directus_settings: string[];
|
|
19
|
+
directus_users: string[];
|
|
20
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.systemFields = exports.directusSettingsFields = exports.directusPanelFields = exports.directusDashboardFields = exports.directusOperationFields = exports.directusFlowFields = exports.directusFolderFields = exports.directusFileFields = exports.directusRoleFields = exports.directusUserFields = void 0;
|
|
4
|
+
exports.directusUserFields = [
|
|
5
|
+
'id',
|
|
6
|
+
'status',
|
|
7
|
+
'first_name',
|
|
8
|
+
'last_name',
|
|
9
|
+
'email',
|
|
10
|
+
'password',
|
|
11
|
+
'token',
|
|
12
|
+
'last_access',
|
|
13
|
+
'last_page',
|
|
14
|
+
'external_identifier',
|
|
15
|
+
'tfa_secret',
|
|
16
|
+
'auth_data',
|
|
17
|
+
'provider',
|
|
18
|
+
'theme',
|
|
19
|
+
'role',
|
|
20
|
+
'language',
|
|
21
|
+
'avatar',
|
|
22
|
+
'title',
|
|
23
|
+
'description',
|
|
24
|
+
'location',
|
|
25
|
+
'tags',
|
|
26
|
+
'email_notifications',
|
|
27
|
+
];
|
|
28
|
+
exports.directusRoleFields = [
|
|
29
|
+
'id',
|
|
30
|
+
'name',
|
|
31
|
+
'description',
|
|
32
|
+
'icon',
|
|
33
|
+
'enforce_tfa',
|
|
34
|
+
'external_id',
|
|
35
|
+
'ip_whitelist',
|
|
36
|
+
'app_access',
|
|
37
|
+
'admin_access',
|
|
38
|
+
];
|
|
39
|
+
exports.directusFileFields = [
|
|
40
|
+
'id',
|
|
41
|
+
'storage',
|
|
42
|
+
'filename_disk',
|
|
43
|
+
'filename_download',
|
|
44
|
+
'title',
|
|
45
|
+
'type',
|
|
46
|
+
'folder',
|
|
47
|
+
'uploaded_by',
|
|
48
|
+
'uploaded_on',
|
|
49
|
+
'modified_by',
|
|
50
|
+
'modified_on',
|
|
51
|
+
'charset',
|
|
52
|
+
'filesize',
|
|
53
|
+
'width',
|
|
54
|
+
'height',
|
|
55
|
+
'duration',
|
|
56
|
+
'embed',
|
|
57
|
+
'description',
|
|
58
|
+
'location',
|
|
59
|
+
'tags',
|
|
60
|
+
'metadata',
|
|
61
|
+
];
|
|
62
|
+
exports.directusFolderFields = [
|
|
63
|
+
'id',
|
|
64
|
+
'name',
|
|
65
|
+
'parent',
|
|
66
|
+
];
|
|
67
|
+
exports.directusFlowFields = [
|
|
68
|
+
'id',
|
|
69
|
+
'name',
|
|
70
|
+
'icon',
|
|
71
|
+
'color',
|
|
72
|
+
'description',
|
|
73
|
+
'status',
|
|
74
|
+
'trigger',
|
|
75
|
+
'accountability',
|
|
76
|
+
'options',
|
|
77
|
+
'operation',
|
|
78
|
+
'date_created',
|
|
79
|
+
'user_created',
|
|
80
|
+
];
|
|
81
|
+
exports.directusOperationFields = [
|
|
82
|
+
'id',
|
|
83
|
+
'name',
|
|
84
|
+
'key',
|
|
85
|
+
'type',
|
|
86
|
+
'position_x',
|
|
87
|
+
'position_y',
|
|
88
|
+
'options',
|
|
89
|
+
'resolve',
|
|
90
|
+
'reject',
|
|
91
|
+
'flow',
|
|
92
|
+
'date_created',
|
|
93
|
+
'user_created',
|
|
94
|
+
];
|
|
95
|
+
exports.directusDashboardFields = [
|
|
96
|
+
'id',
|
|
97
|
+
'name',
|
|
98
|
+
'icon',
|
|
99
|
+
'note',
|
|
100
|
+
'date_created',
|
|
101
|
+
'user_created',
|
|
102
|
+
'color',
|
|
103
|
+
];
|
|
104
|
+
exports.directusPanelFields = [
|
|
105
|
+
'id',
|
|
106
|
+
'dashboard',
|
|
107
|
+
'name',
|
|
108
|
+
'icon',
|
|
109
|
+
'color',
|
|
110
|
+
'show_header',
|
|
111
|
+
'note',
|
|
112
|
+
'type',
|
|
113
|
+
'position_x',
|
|
114
|
+
'position_y',
|
|
115
|
+
'width',
|
|
116
|
+
'height',
|
|
117
|
+
'options',
|
|
118
|
+
'date_created',
|
|
119
|
+
'user_created',
|
|
120
|
+
];
|
|
121
|
+
exports.directusSettingsFields = [
|
|
122
|
+
'id',
|
|
123
|
+
'project_name',
|
|
124
|
+
'project_url',
|
|
125
|
+
'project_color',
|
|
126
|
+
'project_logo',
|
|
127
|
+
'public_foreground',
|
|
128
|
+
'public_background',
|
|
129
|
+
'public_note',
|
|
130
|
+
'auth_login_attempts',
|
|
131
|
+
'auth_password_policy',
|
|
132
|
+
'storage_asset_transform',
|
|
133
|
+
'storage_asset_presets',
|
|
134
|
+
'custom_css',
|
|
135
|
+
'storage_default_folder',
|
|
136
|
+
'basemaps',
|
|
137
|
+
'mapbox_key',
|
|
138
|
+
'module_bar',
|
|
139
|
+
'project_descriptor',
|
|
140
|
+
'default_language',
|
|
141
|
+
'custom_aspect_ratios',
|
|
142
|
+
'public_favicon',
|
|
143
|
+
'default_appearance',
|
|
144
|
+
'default_theme_light',
|
|
145
|
+
'theme_light_overrides',
|
|
146
|
+
'default_theme_dark',
|
|
147
|
+
'theme_dark_overrides',
|
|
148
|
+
];
|
|
149
|
+
exports.systemFields = {
|
|
150
|
+
directus_dashboards: exports.directusDashboardFields,
|
|
151
|
+
directus_files: exports.directusFileFields,
|
|
152
|
+
directus_flows: exports.directusFlowFields,
|
|
153
|
+
directus_folders: exports.directusFolderFields,
|
|
154
|
+
directus_operations: exports.directusOperationFields,
|
|
155
|
+
directus_panels: exports.directusPanelFields,
|
|
156
|
+
directus_roles: exports.directusRoleFields,
|
|
157
|
+
directus_settings: exports.directusSettingsFields,
|
|
158
|
+
directus_users: exports.directusUserFields,
|
|
159
|
+
};
|
|
@@ -5,23 +5,22 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const slugify_1 = tslib_1.__importDefault(require("slugify"));
|
|
6
6
|
const generatePackageJsonContent = (templateName) => {
|
|
7
7
|
const slugifiedName = (0, slugify_1.default)(templateName, {
|
|
8
|
-
lower: true,
|
|
8
|
+
lower: true, // Convert to lowercase
|
|
9
9
|
strict: true, // Remove special characters
|
|
10
10
|
});
|
|
11
11
|
const packageName = `directus-template-${slugifiedName}`;
|
|
12
12
|
return JSON.stringify({
|
|
13
|
+
author: '',
|
|
14
|
+
description: '',
|
|
15
|
+
directusTemplate: true,
|
|
16
|
+
files: ['src'],
|
|
13
17
|
name: packageName,
|
|
14
|
-
templateName
|
|
15
|
-
version:
|
|
16
|
-
description: "",
|
|
17
|
-
author: "",
|
|
18
|
-
license: "MIT",
|
|
19
|
-
files: ["src"],
|
|
18
|
+
templateName,
|
|
19
|
+
version: '1.0.0',
|
|
20
20
|
}, null, 2);
|
|
21
21
|
};
|
|
22
22
|
exports.generatePackageJsonContent = generatePackageJsonContent;
|
|
23
|
-
const generateReadmeContent = (templateName) => {
|
|
24
|
-
return `# ${templateName} Template
|
|
23
|
+
const generateReadmeContent = (templateName) => `# ${templateName} Template
|
|
25
24
|
|
|
26
25
|
This is a template for [Directus](https://directus.io/) - an open-source headless CMS and API. Use the template-cli to load / apply this template to a blank instance.
|
|
27
26
|
|
|
@@ -31,7 +30,5 @@ This is a template for [Directus](https://directus.io/) - an open-source headles
|
|
|
31
30
|
|
|
32
31
|
## License
|
|
33
32
|
|
|
34
|
-
This template is licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
|
35
33
|
`;
|
|
36
|
-
};
|
|
37
34
|
exports.generateReadmeContent = generateReadmeContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function transformGitHubUrl(url: string): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformGitHubUrl = void 0;
|
|
4
|
+
function transformGitHubUrl(url) {
|
|
5
|
+
// Regular expression to capture the repository name and any subsequent path after the 'tree'
|
|
6
|
+
const regex = /github\.com\/([^/]+\/[^/]+)(?:\/tree\/[^/]+\/(.*))?$/;
|
|
7
|
+
const match = url.match(regex);
|
|
8
|
+
if (match) {
|
|
9
|
+
const repo = match[1];
|
|
10
|
+
const subpath = match[2] ? match[2] : '';
|
|
11
|
+
return `github:${repo}/${subpath}`;
|
|
12
|
+
}
|
|
13
|
+
return 'Invalid URL';
|
|
14
|
+
}
|
|
15
|
+
exports.transformGitHubUrl = transformGitHubUrl;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
5
4
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
5
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
6
|
exports.default = async (fileName, data, dir) => {
|
|
7
|
-
const folders = fileName.split(
|
|
7
|
+
const folders = fileName.split('/');
|
|
8
8
|
const endFileName = folders.pop();
|
|
9
|
-
const folderPath = folders.join(
|
|
9
|
+
const folderPath = folders.join('/');
|
|
10
10
|
// Generate the full path where you want to write the file
|
|
11
11
|
const fullPath = node_path_1.default.join(dir, folderPath);
|
|
12
12
|
// Check if the directory exists. Create if it doesn't.
|
|
@@ -21,6 +21,6 @@ exports.default = async (fileName, data, dir) => {
|
|
|
21
21
|
// console.log(`Wrote ${fullFilePath}`);
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
|
-
console.log(
|
|
24
|
+
console.log('Error writing to file', error.data.errors);
|
|
25
25
|
}
|
|
26
26
|
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1,33 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.3.6",
|
|
3
2
|
"commands": {
|
|
4
3
|
"apply": {
|
|
5
|
-
"id": "apply",
|
|
6
|
-
"description": "Apply a template to a blank Directus instance.",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"pluginName": "directus-template-cli",
|
|
9
|
-
"pluginAlias": "directus-template-cli",
|
|
10
|
-
"pluginType": "core",
|
|
11
4
|
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Apply a template to a blank Directus instance.",
|
|
12
7
|
"examples": [
|
|
13
8
|
"$ directus-template-cli apply"
|
|
14
9
|
],
|
|
15
10
|
"flags": {},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"id": "extract",
|
|
20
|
-
"description": "Extract a template from a Directus instance.",
|
|
21
|
-
"strict": true,
|
|
22
|
-
"pluginName": "directus-template-cli",
|
|
11
|
+
"hasDynamicHelp": false,
|
|
12
|
+
"hiddenAliases": [],
|
|
13
|
+
"id": "apply",
|
|
23
14
|
"pluginAlias": "directus-template-cli",
|
|
15
|
+
"pluginName": "directus-template-cli",
|
|
24
16
|
"pluginType": "core",
|
|
17
|
+
"strict": true,
|
|
18
|
+
"enableJsonFlag": false,
|
|
19
|
+
"isESM": false,
|
|
20
|
+
"relativePath": [
|
|
21
|
+
"dist",
|
|
22
|
+
"commands",
|
|
23
|
+
"apply.js"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"extract": {
|
|
25
27
|
"aliases": [],
|
|
28
|
+
"args": {},
|
|
29
|
+
"description": "Extract a template from a Directus instance.",
|
|
26
30
|
"examples": [
|
|
27
31
|
"$ directus-template-cli extract"
|
|
28
32
|
],
|
|
29
33
|
"flags": {},
|
|
30
|
-
"
|
|
34
|
+
"hasDynamicHelp": false,
|
|
35
|
+
"hiddenAliases": [],
|
|
36
|
+
"id": "extract",
|
|
37
|
+
"pluginAlias": "directus-template-cli",
|
|
38
|
+
"pluginName": "directus-template-cli",
|
|
39
|
+
"pluginType": "core",
|
|
40
|
+
"strict": true,
|
|
41
|
+
"enableJsonFlag": false,
|
|
42
|
+
"isESM": false,
|
|
43
|
+
"relativePath": [
|
|
44
|
+
"dist",
|
|
45
|
+
"commands",
|
|
46
|
+
"extract.js"
|
|
47
|
+
]
|
|
31
48
|
}
|
|
32
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"version": "0.4.0"
|
|
33
51
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "directus-template-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "CLI Utility for applying templates to a Directus instance.",
|
|
5
5
|
"author": "bryantgillespie @bryantgillespie",
|
|
6
6
|
"bin": {
|
|
7
|
-
"directus-template-
|
|
7
|
+
"directus-template-cli": "./bin/run"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://github.com/directus-community/directus-template-cli",
|
|
10
10
|
"license": "MIT",
|
|
@@ -18,32 +18,34 @@
|
|
|
18
18
|
"/oclif.manifest.json"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@oclif/
|
|
24
|
-
"
|
|
21
|
+
"@directus/sdk": "^14.0.0",
|
|
22
|
+
"@directus/types": "^11.0.3",
|
|
23
|
+
"@oclif/core": "^3.18.1",
|
|
24
|
+
"@oclif/plugin-help": "^6.0.12",
|
|
25
|
+
"@oclif/plugin-plugins": "^4.1.22",
|
|
26
|
+
"axios": "^1.6.7",
|
|
25
27
|
"bottleneck": "^2.19.5",
|
|
26
|
-
"dotenv": "^16.
|
|
27
|
-
"formdata-node": "^
|
|
28
|
-
"
|
|
28
|
+
"dotenv": "^16.4.1",
|
|
29
|
+
"formdata-node": "^6.0.3",
|
|
30
|
+
"giget": "^1.2.1",
|
|
29
31
|
"inquirer": "^8.2.5",
|
|
30
32
|
"slugify": "^1.6.6"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
|
-
"@oclif/test": "^
|
|
34
|
-
"@types/chai": "^4",
|
|
35
|
-
"@types/mocha": "^
|
|
36
|
-
"@types/node": "^
|
|
37
|
-
"chai": "^
|
|
38
|
-
"eslint": "^
|
|
39
|
-
"eslint-config-oclif": "^
|
|
40
|
-
"eslint-config-oclif-typescript": "^
|
|
41
|
-
"mocha": "^
|
|
42
|
-
"oclif": "^
|
|
35
|
+
"@oclif/test": "^3.1.13",
|
|
36
|
+
"@types/chai": "^4.3.11",
|
|
37
|
+
"@types/mocha": "^10.0.6",
|
|
38
|
+
"@types/node": "^20.11.10",
|
|
39
|
+
"chai": "^5.0.3",
|
|
40
|
+
"eslint": "^8.56.0",
|
|
41
|
+
"eslint-config-oclif": "^5.0.0",
|
|
42
|
+
"eslint-config-oclif-typescript": "^3.0.41",
|
|
43
|
+
"mocha": "^10.2.0",
|
|
44
|
+
"oclif": "^4.4.2",
|
|
43
45
|
"shx": "^0.3.3",
|
|
44
|
-
"ts-node": "^10.9.
|
|
45
|
-
"tslib": "^2.
|
|
46
|
-
"typescript": "^
|
|
46
|
+
"ts-node": "^10.9.2",
|
|
47
|
+
"tslib": "^2.6.2",
|
|
48
|
+
"typescript": "^5.3.3"
|
|
47
49
|
},
|
|
48
50
|
"oclif": {
|
|
49
51
|
"bin": "directus-template-cli",
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
"version": "oclif readme && git add README.md"
|
|
67
69
|
},
|
|
68
70
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
71
|
+
"node": ">=18.0.0"
|
|
70
72
|
},
|
|
71
73
|
"bugs": "https://github.com/directus-community/directus-template-cli/issues",
|
|
72
74
|
"keywords": [
|
package/dist/lib/api.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
declare class Api {
|
|
3
|
-
private instance;
|
|
4
|
-
private limiter;
|
|
5
|
-
constructor();
|
|
6
|
-
setBaseUrl(url: string): void;
|
|
7
|
-
setAuthToken(token: string): void;
|
|
8
|
-
get<T>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
|
|
9
|
-
post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
|
|
10
|
-
put<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
|
|
11
|
-
patch<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
|
|
12
|
-
delete(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse>;
|
|
13
|
-
}
|
|
14
|
-
export declare const api: Api;
|
|
15
|
-
export {};
|
package/dist/lib/api.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.api = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
|
-
const bottleneck_1 = tslib_1.__importDefault(require("bottleneck"));
|
|
7
|
-
class Api {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.instance = axios_1.default.create();
|
|
10
|
-
this.limiter = new bottleneck_1.default({
|
|
11
|
-
minTime: 100, // Set min time between tasks here (1000 ms = 1 second)
|
|
12
|
-
// You can set other options here as well.
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
setBaseUrl(url) {
|
|
16
|
-
this.instance.defaults.baseURL = url;
|
|
17
|
-
}
|
|
18
|
-
setAuthToken(token) {
|
|
19
|
-
this.instance.defaults.headers.common.Authorization = `Bearer ${token}`;
|
|
20
|
-
}
|
|
21
|
-
get(url, config) {
|
|
22
|
-
return this.limiter.schedule(() => this.instance.get(url, config));
|
|
23
|
-
}
|
|
24
|
-
post(url, data, config) {
|
|
25
|
-
return this.limiter.schedule(() => this.instance.post(url, data, config));
|
|
26
|
-
}
|
|
27
|
-
put(url, data, config) {
|
|
28
|
-
return this.limiter.schedule(() => this.instance.put(url, data, config));
|
|
29
|
-
}
|
|
30
|
-
patch(url, data, config) {
|
|
31
|
-
return this.limiter.schedule(() => this.instance.patch(url, data, config));
|
|
32
|
-
}
|
|
33
|
-
delete(url, config) {
|
|
34
|
-
return this.limiter.schedule(() => this.instance.delete(url, config));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.api = new Api();
|