tailar 0.4.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.
Files changed (106) hide show
  1. package/README.md +5 -2
  2. package/README.npm.md +5 -2
  3. package/dist/api/client.d.ts +22 -28
  4. package/dist/api/client.d.ts.map +1 -1
  5. package/dist/api/client.js +111 -236
  6. package/dist/api/client.js.map +1 -1
  7. package/dist/api/errors.d.ts +16 -0
  8. package/dist/api/errors.d.ts.map +1 -0
  9. package/dist/api/errors.js +32 -0
  10. package/dist/api/errors.js.map +1 -0
  11. package/dist/auth/flow.js +1 -1
  12. package/dist/auth/flow.js.map +1 -1
  13. package/dist/commands/add.d.ts +9 -0
  14. package/dist/commands/add.d.ts.map +1 -1
  15. package/dist/commands/add.js +63 -113
  16. package/dist/commands/add.js.map +1 -1
  17. package/dist/commands/init.d.ts.map +1 -1
  18. package/dist/commands/init.js +106 -70
  19. package/dist/commands/init.js.map +1 -1
  20. package/dist/commands/list.d.ts.map +1 -1
  21. package/dist/commands/list.js +1 -23
  22. package/dist/commands/list.js.map +1 -1
  23. package/dist/commands/playground.d.ts.map +1 -1
  24. package/dist/commands/playground.js +2 -1
  25. package/dist/commands/playground.js.map +1 -1
  26. package/dist/commands/sync.d.ts.map +1 -1
  27. package/dist/commands/sync.js +9 -4
  28. package/dist/commands/sync.js.map +1 -1
  29. package/dist/installers/agent-files.d.ts +26 -0
  30. package/dist/installers/agent-files.d.ts.map +1 -0
  31. package/dist/installers/agent-files.js +110 -0
  32. package/dist/installers/agent-files.js.map +1 -0
  33. package/dist/installers/dependencies.d.ts +10 -0
  34. package/dist/installers/dependencies.d.ts.map +1 -1
  35. package/dist/installers/dependencies.js +52 -8
  36. package/dist/installers/dependencies.js.map +1 -1
  37. package/dist/installers/files.d.ts +2 -6
  38. package/dist/installers/files.d.ts.map +1 -1
  39. package/dist/installers/files.js +30 -35
  40. package/dist/installers/files.js.map +1 -1
  41. package/dist/installers/install-feature.d.ts +25 -1
  42. package/dist/installers/install-feature.d.ts.map +1 -1
  43. package/dist/installers/install-feature.js +100 -59
  44. package/dist/installers/install-feature.js.map +1 -1
  45. package/dist/installers/managed-blocks.d.ts +26 -0
  46. package/dist/installers/managed-blocks.d.ts.map +1 -0
  47. package/dist/installers/managed-blocks.js +47 -0
  48. package/dist/installers/managed-blocks.js.map +1 -0
  49. package/dist/installers/post-install.d.ts +12 -0
  50. package/dist/installers/post-install.d.ts.map +1 -1
  51. package/dist/installers/post-install.js +19 -0
  52. package/dist/installers/post-install.js.map +1 -1
  53. package/dist/installers/setup-guide.d.ts +38 -0
  54. package/dist/installers/setup-guide.d.ts.map +1 -0
  55. package/dist/installers/setup-guide.js +206 -0
  56. package/dist/installers/setup-guide.js.map +1 -0
  57. package/dist/installers/variant-switch.d.ts +34 -0
  58. package/dist/installers/variant-switch.d.ts.map +1 -0
  59. package/dist/installers/variant-switch.js +139 -0
  60. package/dist/installers/variant-switch.js.map +1 -0
  61. package/dist/installers/when.d.ts +22 -0
  62. package/dist/installers/when.d.ts.map +1 -0
  63. package/dist/installers/when.js +35 -0
  64. package/dist/installers/when.js.map +1 -0
  65. package/dist/registry/query.d.ts +6 -1
  66. package/dist/registry/query.d.ts.map +1 -1
  67. package/dist/registry/query.js +22 -0
  68. package/dist/registry/query.js.map +1 -1
  69. package/dist/types/config.d.ts +2 -0
  70. package/dist/types/config.d.ts.map +1 -1
  71. package/dist/types/registry.d.ts +65 -6
  72. package/dist/types/registry.d.ts.map +1 -1
  73. package/dist/types/wizard.d.ts +34 -8
  74. package/dist/types/wizard.d.ts.map +1 -1
  75. package/dist/types/wizard.js +74 -40
  76. package/dist/types/wizard.js.map +1 -1
  77. package/dist/utils/clack-wizard.d.ts +3 -1
  78. package/dist/utils/clack-wizard.d.ts.map +1 -1
  79. package/dist/utils/clack-wizard.js +205 -107
  80. package/dist/utils/clack-wizard.js.map +1 -1
  81. package/dist/utils/config.d.ts.map +1 -1
  82. package/dist/utils/config.js +12 -5
  83. package/dist/utils/config.js.map +1 -1
  84. package/dist/utils/init-flags.d.ts +43 -8
  85. package/dist/utils/init-flags.d.ts.map +1 -1
  86. package/dist/utils/init-flags.js +119 -32
  87. package/dist/utils/init-flags.js.map +1 -1
  88. package/dist/utils/local-options.js +1 -1
  89. package/dist/utils/local-options.js.map +1 -1
  90. package/dist/utils/next-steps.d.ts +9 -0
  91. package/dist/utils/next-steps.d.ts.map +1 -0
  92. package/dist/utils/next-steps.js +15 -0
  93. package/dist/utils/next-steps.js.map +1 -0
  94. package/dist/utils/presets.d.ts +34 -0
  95. package/dist/utils/presets.d.ts.map +1 -0
  96. package/dist/utils/presets.js +82 -0
  97. package/dist/utils/presets.js.map +1 -0
  98. package/dist/utils/recipe-id.d.ts +19 -0
  99. package/dist/utils/recipe-id.d.ts.map +1 -0
  100. package/dist/utils/recipe-id.js +72 -0
  101. package/dist/utils/recipe-id.js.map +1 -0
  102. package/dist/utils/recipe.d.ts +49 -0
  103. package/dist/utils/recipe.d.ts.map +1 -0
  104. package/dist/utils/recipe.js +227 -0
  105. package/dist/utils/recipe.js.map +1 -0
  106. package/package.json +7 -1
package/README.md CHANGED
@@ -62,10 +62,13 @@ tailar init my-app -y --modules auth --db postgres --email resend --auth organiz
62
62
  | --- | --- | --- |
63
63
  | `-y, --yes` | Skip prompts. In an empty directory this scaffolds without the wizard | `false` |
64
64
  | `[project]` / `--name` | Directory name for a new app | `my-app` when non-interactive |
65
- | `--modules <list>` | `database,email,auth,payments` | none |
65
+ | `--preset <id>` | `saas`, `saas-ai`, `marketing`, or `custom` | none (flags only) |
66
+ | `--modules <list>` | `database,email,auth,payments,storage,ai` (replaces the preset's modules) | the preset's modules, else none |
66
67
  | `--db <provider>` | `postgres`, `mysql`, or `mongodb` | `postgres` when database is included |
67
68
  | `--email <provider>` | `resend`, `postmark`, or `sendgrid` | `resend` when email is included |
68
69
  | `--auth <structure>` | `user-based` or `organization-based` | `user-based` when auth is included |
70
+ | `--storage-provider <p>` | Storage provider (adds `storage`), e.g. `r2` | `r2` when storage is included |
71
+ | `--billing-provider <p>` | Billing provider (adds `payments`), from the registry: `stripe`, `lemonsqueezy`, `paddle` | `stripe` when payments is included |
69
72
  | `--skip-install` | Skip npm install and post-install commands | `false` |
70
73
 
71
74
  **What it does:**
@@ -203,7 +206,7 @@ npm run build
203
206
  ## 📚 Learn More
204
207
 
205
208
  - **Docs**: [https://www.tailar.dev/docs](https://www.tailar.dev/docs)
206
- - **Report Issues**: [GitHub Issues](https://github.com/tailar-dev/tailar/issues)
209
+ - **Report Issues**: [GitHub Issues](https://github.com/tailar-dev/tailar-all/issues)
207
210
 
208
211
  ## 📄 License
209
212
 
package/README.npm.md CHANGED
@@ -62,10 +62,13 @@ tailar init my-app -y --modules auth --db postgres --email resend --auth organiz
62
62
  | --- | --- | --- |
63
63
  | `-y, --yes` | Skip prompts. In an empty directory this scaffolds without the wizard | `false` |
64
64
  | `[project]` / `--name` | Directory name for a new app | `my-app` when non-interactive |
65
- | `--modules <list>` | `database,email,auth,payments` | none |
65
+ | `--preset <id>` | `saas`, `saas-ai`, `marketing`, or `custom` | none (flags only) |
66
+ | `--modules <list>` | `database,email,auth,payments,storage,ai` (replaces the preset's modules) | the preset's modules, else none |
66
67
  | `--db <provider>` | `postgres`, `mysql`, or `mongodb` | `postgres` when database is included |
67
68
  | `--email <provider>` | `resend`, `postmark`, or `sendgrid` | `resend` when email is included |
68
69
  | `--auth <structure>` | `user-based` or `organization-based` | `user-based` when auth is included |
70
+ | `--storage-provider <p>` | Storage provider (adds `storage`), e.g. `r2` | `r2` when storage is included |
71
+ | `--billing-provider <p>` | Billing provider (adds `payments`), from the registry: `stripe`, `lemonsqueezy`, `paddle` | `stripe` when payments is included |
69
72
  | `--skip-install` | Skip npm install and post-install commands | `false` |
70
73
 
71
74
  **What it does:**
@@ -203,7 +206,7 @@ npm run build
203
206
  ## 📚 Learn More
204
207
 
205
208
  - **Docs**: [https://www.tailar.dev/docs](https://www.tailar.dev/docs)
206
- - **Report Issues**: [GitHub Issues](https://github.com/tailar-dev/tailar/issues)
209
+ - **Report Issues**: [GitHub Issues](https://github.com/tailar-dev/tailar-all/issues)
207
210
 
208
211
  ## 📄 License
209
212
 
@@ -3,45 +3,39 @@
3
3
  *
4
4
  * Handles all API interactions with the Tailar web API
5
5
  */
6
+ import fetch from "node-fetch";
6
7
  import type { Registry } from "../types/index.js";
7
- interface ComponentMetadata {
8
- name: string;
9
- type: string;
10
- requiresSubscription: boolean;
11
- subscriptionTier: number;
12
- isAccessible?: boolean;
13
- reason?: string;
14
- files: any[];
15
- }
16
8
  /**
17
- * Fetch registry.json from API
9
+ * Fetch registry.json from API (public: the files behind it need the licence)
18
10
  */
19
11
  export declare function fetchRegistry(options?: {
20
12
  forceRefresh?: boolean;
21
13
  version?: string;
22
14
  }): Promise<Registry>;
23
15
  /**
24
- * Fetch a single component file from API
16
+ * GET an endpoint that needs a logged-in licence holder.
17
+ *
18
+ * Logs in first when there is no valid token (the device flow prints the
19
+ * verification URL and waits, so it also works in CI). A 401 logs in again
20
+ * once; a 403 `licence_required` throws LicenceRequiredError. Any other
21
+ * status is returned for the caller to handle.
25
22
  */
26
- export declare function fetchComponentFile(type: "feature" | "block" | "component" | "template", name: string, filePath: string, options?: {
27
- variant?: string;
28
- requireAuth?: boolean;
29
- }): Promise<string>;
23
+ export declare function licensedGet(endpoint: string): Promise<Awaited<ReturnType<typeof fetch>>>;
24
+ /** Forget a successful licence check (tests). */
25
+ export declare function resetLicenceCheck(): void;
26
+ /** Record that a licence-gated call succeeded, so later calls skip the check. */
27
+ export declare function markLicenceVerified(): void;
30
28
  /**
31
- * Fetch component metadata from API
32
- * @param requireAuth - If true, requires authentication (default: true for proper access checking)
29
+ * The one licence check. Registry files need a logged-in licence holder:
30
+ * logs in when needed and throws LicenceRequiredError when the account has no
31
+ * licence. Local registry mode (development and CI) skips it. Checked once per
32
+ * process.
33
33
  */
34
- export declare function fetchComponentMetadata(type: "feature" | "block" | "component" | "template", name: string, requireAuth?: boolean): Promise<ComponentMetadata>;
34
+ export declare function requireLicence(): Promise<void>;
35
35
  /**
36
- * Check if user has access to a component (via metadata endpoint)
37
- * @param registryEntry - Optional registry entry to check subscription requirements before API call
36
+ * Fetch a single component file from API (licence required)
38
37
  */
39
- export declare function checkSubscription(type: "feature" | "block" | "component" | "template", name: string, registryEntry?: {
40
- requiresSubscription?: boolean;
41
- subscriptionTier?: number;
42
- }): Promise<{
43
- accessible: boolean;
44
- reason?: string;
45
- }>;
46
- export {};
38
+ export declare function fetchComponentFile(type: "feature" | "block" | "component" | "template", name: string, filePath: string, options?: {
39
+ variant?: string;
40
+ }): Promise<string>;
47
41
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAoBlD,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,GAAG,EAAE,CAAC;CACd;AAkKD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACzD,OAAO,CAAC,QAAQ,CAAC,CA0BnB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,EACpD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WA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AAI,OAAO,CAAC,IAAI,CAAC,CAYpD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,EACpD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjC,OAAO,CAAC,MAAM,CAAC,CA6BjB"}
@@ -6,7 +6,9 @@
6
6
  import fetch from "node-fetch";
7
7
  import { logger } from "../utils/logger.js";
8
8
  import { getAuthHeaders, authenticate, isAuthenticated } from "../auth/flow.js";
9
- import { getStoredToken, clearToken } from "../auth/storage.js";
9
+ import { clearToken } from "../auth/storage.js";
10
+ import { getLocalRegistry } from "../registry/local-mode.js";
11
+ import { LicenceRequiredError } from "./errors.js";
10
12
  // Lazy-load API_BASE_URL to ensure .env file is loaded first
11
13
  // This is a function because .env file is loaded after module imports
12
14
  function getApiBaseUrl() {
@@ -16,94 +18,48 @@ const MAX_RETRIES = 3;
16
18
  const RETRY_DELAY = 1000; // 1 second
17
19
  /** Avoid infinite spinner when API is unreachable (default tailar.dev or wrong host). */
18
20
  const DEFAULT_REQUEST_TIMEOUT_MS = 45_000;
21
+ /** fetch with a timeout, so an unreachable API does not leave a spinner running forever. */
22
+ async function timedFetch(url, init = {}) {
23
+ const timeoutMs = Number(process.env.TAILAR_CLI_REQUEST_TIMEOUT_MS) ||
24
+ DEFAULT_REQUEST_TIMEOUT_MS;
25
+ const abortController = new AbortController();
26
+ const timeoutId = setTimeout(() => abortController.abort(), timeoutMs);
27
+ try {
28
+ return await fetch(url, { ...init, signal: abortController.signal });
29
+ }
30
+ catch (e) {
31
+ const aborted = e instanceof Error &&
32
+ (e.name === "AbortError" || e.message.includes("aborted"));
33
+ if (aborted) {
34
+ throw new Error(`Request timed out after ${timeoutMs}ms (${url}). ` +
35
+ `If you run the Tailar web app locally, set API_BASE_URL in this project's .env, e.g. API_BASE_URL=http://localhost:3000/api/cli`);
36
+ }
37
+ throw e;
38
+ }
39
+ finally {
40
+ clearTimeout(timeoutId);
41
+ }
42
+ }
19
43
  /**
20
- * Make an authenticated API request with retry logic
44
+ * Public GET with retry logic (the registry listing needs no login).
21
45
  */
22
46
  async function apiRequest(endpoint, options = {}) {
23
- const { requireAuth = false, retries = MAX_RETRIES, method, body, headers: customHeaders, } = options;
47
+ const { retries = MAX_RETRIES } = options;
24
48
  let attempt = 0;
25
49
  let lastError = null;
26
50
  while (attempt <= retries) {
27
51
  try {
28
- const headers = {
29
- "Content-Type": "application/json",
30
- "User-Agent": "tailar-cli",
31
- ...(customHeaders || {}),
32
- };
33
- // Add auth headers if required
34
- if (requireAuth) {
35
- try {
36
- const authHeaders = await getAuthHeaders();
37
- Object.assign(headers, authHeaders);
38
- }
39
- catch (error) {
40
- // Not authenticated, try to authenticate
41
- if (error instanceof Error &&
42
- error.message.includes("Not authenticated")) {
43
- logger.info("Authentication required. Starting authentication flow...");
44
- await authenticate();
45
- // Retry with new auth headers
46
- const authHeaders = await getAuthHeaders();
47
- Object.assign(headers, authHeaders);
48
- }
49
- else {
50
- throw error;
51
- }
52
- }
53
- }
54
- const fetchInit = {
55
- method: method || "GET",
56
- headers,
57
- };
58
- if (body) {
59
- fetchInit.body = body;
60
- }
61
- const fullUrl = `${getApiBaseUrl()}${endpoint}`;
62
- const timeoutMs = Number(process.env.TAILAR_CLI_REQUEST_TIMEOUT_MS) ||
63
- DEFAULT_REQUEST_TIMEOUT_MS;
64
- const abortController = new AbortController();
65
- const timeoutId = setTimeout(() => abortController.abort(), timeoutMs);
66
- fetchInit.signal = abortController.signal;
67
- let response;
68
- try {
69
- response = await fetch(fullUrl, fetchInit);
70
- }
71
- catch (e) {
72
- const aborted = e instanceof Error &&
73
- (e.name === "AbortError" || e.message.includes("aborted"));
74
- if (aborted) {
75
- throw new Error(`Request timed out after ${timeoutMs}ms (${fullUrl}). ` +
76
- `If you run the Tailar web app locally, set API_BASE_URL in this project's .env, e.g. API_BASE_URL=http://localhost:3000/api/cli`);
77
- }
78
- throw e;
79
- }
80
- finally {
81
- clearTimeout(timeoutId);
82
- }
83
- // Handle authentication errors
84
- if (response.status === 401) {
85
- if (requireAuth && attempt === 0) {
86
- // Try to re-authenticate once
87
- logger.warn("Authentication expired. Re-authenticating...");
88
- await authenticate();
89
- attempt++;
90
- continue;
91
- }
92
- throw new Error("Authentication failed. Please run authentication again.");
93
- }
94
- // Handle subscription errors
95
- if (response.status === 403) {
96
- const errorData = (await response.json().catch(() => ({})));
97
- const reason = errorData.reason || errorData.error || "Subscription required";
98
- throw new Error(`Access denied: ${reason}\n` +
99
- `Visit https://tailar.dev/choose-plan to upgrade your subscription.`);
100
- }
101
- // Handle not found errors
52
+ const response = await timedFetch(`${getApiBaseUrl()}${endpoint}`, {
53
+ method: "GET",
54
+ headers: {
55
+ "Content-Type": "application/json",
56
+ "User-Agent": "tailar-cli",
57
+ },
58
+ });
102
59
  if (response.status === 404) {
103
60
  const errorData = (await response.json().catch(() => ({})));
104
61
  throw new Error(errorData.error || "Resource not found");
105
62
  }
106
- // Handle other errors
107
63
  if (!response.ok) {
108
64
  const errorData = (await response.json().catch(() => ({})));
109
65
  throw new Error(errorData.error || `API request failed: ${response.statusText}`);
@@ -112,10 +68,7 @@ async function apiRequest(endpoint, options = {}) {
112
68
  }
113
69
  catch (error) {
114
70
  lastError = error instanceof Error ? error : new Error(String(error));
115
- // Don't retry on authentication/subscription errors
116
- if (lastError.message.includes("Authentication") ||
117
- lastError.message.includes("Access denied") ||
118
- lastError.message.includes("not found")) {
71
+ if (lastError.message.includes("not found")) {
119
72
  throw lastError;
120
73
  }
121
74
  // Retry on network errors
@@ -130,7 +83,7 @@ async function apiRequest(endpoint, options = {}) {
130
83
  throw lastError || new Error("API request failed");
131
84
  }
132
85
  /**
133
- * Fetch registry.json from API
86
+ * Fetch registry.json from API (public: the files behind it need the licence)
134
87
  */
135
88
  export async function fetchRegistry(options = {}) {
136
89
  try {
@@ -139,12 +92,7 @@ export async function fetchRegistry(options = {}) {
139
92
  params.append("version", options.version);
140
93
  }
141
94
  const endpoint = `/registry${params.toString() ? `?${params.toString()}` : ""}`;
142
- // Registry is public endpoint (no auth required)
143
- const registry = await apiRequest(endpoint, {
144
- requireAuth: false,
145
- method: "GET",
146
- });
147
- return registry;
95
+ return await apiRequest(endpoint);
148
96
  }
149
97
  catch (error) {
150
98
  logger.error(`Failed to fetch registry: ${error instanceof Error ? error.message : String(error)}`);
@@ -152,178 +100,105 @@ export async function fetchRegistry(options = {}) {
152
100
  }
153
101
  }
154
102
  /**
155
- * Fetch a single component file from API
103
+ * GET an endpoint that needs a logged-in licence holder.
104
+ *
105
+ * Logs in first when there is no valid token (the device flow prints the
106
+ * verification URL and waits, so it also works in CI). A 401 logs in again
107
+ * once; a 403 `licence_required` throws LicenceRequiredError. Any other
108
+ * status is returned for the caller to handle.
156
109
  */
157
- export async function fetchComponentFile(type, name, filePath, options = {}) {
158
- try {
159
- const params = new URLSearchParams();
160
- params.append("path", filePath);
161
- if (options.variant) {
162
- params.append("variant", options.variant);
110
+ export async function licensedGet(endpoint) {
111
+ if (!(await isAuthenticated())) {
112
+ logger.info("Logging in to Tailar...");
113
+ await authenticate();
114
+ }
115
+ for (let attempt = 0;; attempt++) {
116
+ let authHeaders;
117
+ try {
118
+ authHeaders = await getAuthHeaders();
163
119
  }
164
- const endpoint = `/components/${type}/${name}/file?${params.toString()}`;
165
- // If requireAuth is true, check authentication upfront and use auth headers from the start
166
- // This prevents repeated authentication prompts for paid components
167
- if (options.requireAuth === true) {
168
- // Check if already authenticated
169
- if (!(await isAuthenticated())) {
170
- logger.info("Authentication required. Starting authentication flow...");
120
+ catch (error) {
121
+ if (attempt === 0) {
122
+ logger.warn("Login expired. Logging in again...");
171
123
  await authenticate();
124
+ continue;
172
125
  }
173
- // Use auth headers from the start
174
- const response = await fetch(`${getApiBaseUrl()}${endpoint}`, {
175
- method: "GET",
176
- headers: {
177
- "User-Agent": "tailar-cli",
178
- ...(await getAuthHeaders()),
179
- },
180
- });
181
- if (!response.ok) {
182
- if (response.status === 403) {
183
- const errorData = (await response.json().catch(() => ({})));
184
- const reason = errorData.reason || errorData.error || "Subscription required";
185
- throw new Error(`Access denied: ${reason}\n` +
186
- `Visit https://tailar.dev/choose-plan to upgrade your subscription.`);
187
- }
188
- throw new Error(`Failed to fetch file: ${response.statusText}`);
189
- }
190
- return await response.text();
126
+ throw error;
191
127
  }
192
- // For free components (requireAuth === false or undefined), try without auth first
193
- // This allows free components to work without authentication
194
- let response = await fetch(`${getApiBaseUrl()}${endpoint}`, {
128
+ const response = await timedFetch(`${getApiBaseUrl()}${endpoint}`, {
195
129
  method: "GET",
196
- headers: {
197
- "User-Agent": "tailar-cli",
198
- },
130
+ headers: { "User-Agent": "tailar-cli", ...authHeaders },
199
131
  });
200
- // Handle 401 responses - component requires authentication
201
132
  if (response.status === 401) {
202
- // Try to authenticate and retry
203
- logger.info("Authentication required. Starting authentication flow...");
204
- await authenticate();
205
- // Retry with auth headers
206
- const retryResponse = await fetch(`${getApiBaseUrl()}${endpoint}`, {
207
- method: "GET",
208
- headers: {
209
- "User-Agent": "tailar-cli",
210
- ...(await getAuthHeaders()),
211
- },
212
- });
213
- if (!retryResponse.ok) {
214
- throw new Error(`Failed to fetch file: ${retryResponse.statusText}`);
133
+ if (attempt === 0) {
134
+ logger.warn("Login expired. Logging in again...");
135
+ await clearToken();
136
+ await authenticate();
137
+ continue;
215
138
  }
216
- return await retryResponse.text();
139
+ throw new Error("Login failed. Run the command again to log in with your Tailar account.");
217
140
  }
218
141
  if (response.status === 403) {
219
- const errorData = (await response.json().catch(() => ({})));
220
- const reason = errorData.reason || errorData.error || "Subscription required";
221
- throw new Error(`Access denied: ${reason}\n` +
222
- `Visit https://tailar.dev/choose-plan to upgrade your subscription.`);
223
- }
224
- if (!response.ok) {
225
- throw new Error(`Failed to fetch file: ${response.statusText}`);
226
- }
227
- return await response.text();
228
- }
229
- catch (error) {
230
- if (error instanceof Error && error.message.includes("Access denied")) {
231
- throw error;
142
+ const body = (await response.json().catch(() => ({})));
143
+ if (!body.error || body.error === "licence_required") {
144
+ throw new LicenceRequiredError(body.buyUrl);
145
+ }
146
+ throw new Error(`Access denied: ${body.error}`);
232
147
  }
233
- logger.error(`Failed to fetch component file: ${error instanceof Error ? error.message : String(error)}`);
234
- throw error;
148
+ return response;
235
149
  }
236
150
  }
151
+ let licenceVerified = false;
152
+ /** Forget a successful licence check (tests). */
153
+ export function resetLicenceCheck() {
154
+ licenceVerified = false;
155
+ }
156
+ /** Record that a licence-gated call succeeded, so later calls skip the check. */
157
+ export function markLicenceVerified() {
158
+ licenceVerified = true;
159
+ }
160
+ /** Entry used to check the licence: any licence-gated route answers 401/403 before it looks the entry up. */
161
+ const LICENCE_PROBE = "/components/feature/shared";
237
162
  /**
238
- * Fetch component metadata from API
239
- * @param requireAuth - If true, requires authentication (default: true for proper access checking)
163
+ * The one licence check. Registry files need a logged-in licence holder:
164
+ * logs in when needed and throws LicenceRequiredError when the account has no
165
+ * licence. Local registry mode (development and CI) skips it. Checked once per
166
+ * process.
240
167
  */
241
- export async function fetchComponentMetadata(type, name, requireAuth = true) {
242
- try {
243
- const endpoint = `/components/${type}/${name}`;
244
- // Metadata endpoint requires auth for proper subscription checking
245
- const metadata = await apiRequest(endpoint, {
246
- requireAuth,
247
- method: "GET",
248
- });
249
- return metadata;
250
- }
251
- catch (error) {
252
- logger.error(`Failed to fetch component metadata: ${error instanceof Error ? error.message : String(error)}`);
253
- throw error;
168
+ export async function requireLicence() {
169
+ if (getLocalRegistry()?.enabled)
170
+ return;
171
+ if (licenceVerified)
172
+ return;
173
+ const response = await licensedGet(LICENCE_PROBE);
174
+ // 404 means the guard passed and only the probe entry is missing.
175
+ if (!response.ok && response.status !== 404) {
176
+ throw new Error(`Could not verify your licence: ${response.status} ${response.statusText}`);
254
177
  }
178
+ licenceVerified = true;
255
179
  }
256
180
  /**
257
- * Check if user has access to a component (via metadata endpoint)
258
- * @param registryEntry - Optional registry entry to check subscription requirements before API call
181
+ * Fetch a single component file from API (licence required)
259
182
  */
260
- export async function checkSubscription(type, name, registryEntry) {
261
- // If registry entry is provided and component doesn't require subscription, allow access immediately
262
- if (registryEntry &&
263
- (!registryEntry.requiresSubscription ||
264
- (registryEntry.subscriptionTier || 0) === 0)) {
265
- return { accessible: true };
266
- }
183
+ export async function fetchComponentFile(type, name, filePath, options = {}) {
267
184
  try {
268
- // For paid components or when registry entry is not provided, check via API
269
- // Require auth for proper subscription checking
270
- const metadata = await fetchComponentMetadata(type, name, true);
271
- if (!metadata.requiresSubscription) {
272
- return { accessible: true };
185
+ const params = new URLSearchParams();
186
+ params.append("path", filePath);
187
+ if (options.variant) {
188
+ params.append("variant", options.variant);
273
189
  }
274
- // For paid components, isAccessible must be explicitly true
275
- // If it's false, undefined, or missing, deny access
276
- // This handles the case where unauthenticated users get isAccessible: false
277
- if (metadata.isAccessible !== true) {
278
- // If isAccessible is explicitly false, use the reason from API
279
- if (metadata.isAccessible === false && metadata.reason) {
280
- return {
281
- accessible: false,
282
- reason: metadata.reason,
283
- };
284
- }
285
- // isAccessible is false with no reason: server treated the request as anonymous.
286
- // This happens when a locally-valid token was revoked server-side.
287
- // If we have stored credentials, clear them and trigger a fresh auth flow.
288
- const storedToken = await getStoredToken();
289
- if (storedToken) {
290
- logger.warn("Session revoked or expired. Re-authenticating...");
291
- await clearToken();
292
- await authenticate();
293
- // Retry once with the new token
294
- const retryMetadata = await fetchComponentMetadata(type, name, true);
295
- if (!retryMetadata.requiresSubscription ||
296
- retryMetadata.isAccessible === true) {
297
- return { accessible: true };
298
- }
299
- return {
300
- accessible: false,
301
- reason: retryMetadata.reason ?? "Subscription required.",
302
- };
303
- }
304
- return {
305
- accessible: false,
306
- reason: "Authentication and subscription required. Please authenticate first.",
307
- };
190
+ const response = await licensedGet(`/components/${type}/${name}/file?${params.toString()}`);
191
+ if (!response.ok) {
192
+ throw new Error(`Failed to fetch file ${type}s/${name}/${filePath}: ${response.status} ${response.statusText}`);
308
193
  }
309
- return { accessible: true };
194
+ licenceVerified = true;
195
+ return await response.text();
310
196
  }
311
197
  catch (error) {
312
- // If authentication fails or API error, deny access
313
- if (error instanceof Error &&
314
- (error.message.includes("Authentication") ||
315
- error.message.includes("Not authenticated") ||
316
- error.message.includes("Authentication required"))) {
317
- return {
318
- accessible: false,
319
- reason: "Authentication required. Please authenticate first.",
320
- };
321
- }
322
- // For other errors, deny access
323
- return {
324
- accessible: false,
325
- reason: error instanceof Error ? error.message : "Failed to verify access",
326
- };
198
+ if (error instanceof LicenceRequiredError)
199
+ throw error;
200
+ logger.error(`Failed to fetch component file: ${error instanceof Error ? error.message : String(error)}`);
201
+ throw error;
327
202
  }
328
203
  }
329
204
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhE,6DAA6D;AAC7D,sEAAsE;AACtE,SAAS,aAAa;IACpB,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,4BAA4B,CAAC;AAClE,CAAC;AACD,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,WAAW;AACrC,yFAAyF;AACzF,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAoB1C;;GAEG;AACH,KAAK,UAAU,UAAU,CACvB,QAAgB,EAChB,UAAwB,EAAE;IAE1B,MAAM,EACJ,WAAW,GAAG,KAAK,EACnB,OAAO,GAAG,WAAW,EACrB,MAAM,EACN,IAAI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gB,EAChB,UAAgC,EAAE;IAElC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,WAAW,CAChC,eAAe,IAAI,IAAI,IAAI,SAAS,MAAM,CAAC,QAAQ,EAAE,EAAE,CACxD,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,wBAAwB,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAC/F,CAAC;QACJ,CAAC;QAED,eAAe,GAAG,IAAI,CAAC;QACvB,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,oBAAoB;YAAE,MAAM,KAAK,CAAC;QACvD,MAAM,CAAC,KAAK,CACV,mCACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Licence errors
3
+ *
4
+ * Tailar has one lifetime licence. Anything that fetches registry files needs
5
+ * a logged-in licence holder; this is the single message for "no licence".
6
+ */
7
+ export declare const BUY_URL = "https://tailar.dev/checkout";
8
+ export declare const LICENCE_REQUIRED_MESSAGE = "Tailar needs the lifetime licence ($99). Get it at https://tailar.dev/checkout, then run this command again.";
9
+ export declare class LicenceRequiredError extends Error {
10
+ readonly buyUrl: string;
11
+ constructor(buyUrl?: string);
12
+ }
13
+ export declare function isLicenceRequiredError(error: unknown): error is LicenceRequiredError;
14
+ /** Print a command failure and exit. A missing licence gets its own plain message. */
15
+ export declare function exitWithError(prefix: string, error: unknown): never;
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,OAAO,gCAAgC,CAAC;AAErD,eAAO,MAAM,wBAAwB,iHAAgG,CAAC;AAEtI,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,GAAE,MAAgB;CAKrC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAKpF;AAED,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,CAOnE"}