convex 1.42.2 → 1.43.0-alpha.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 +8 -1
- package/bin/main-dev +6 -1
- package/dist/browser.bundle.js +49 -10
- package/dist/browser.bundle.js.map +2 -2
- package/dist/cjs/browser/index.js.map +2 -2
- package/dist/cjs/browser/simple_client-node.js +35 -35
- package/dist/cjs/browser/simple_client-node.js.map +2 -2
- package/dist/cjs/browser/sync/client.js.map +1 -1
- package/dist/cjs/browser/sync/paginated_query_client.js +20 -9
- package/dist/cjs/browser/sync/paginated_query_client.js.map +2 -2
- package/dist/cjs/cli/codegen_templates/component_api.js +2 -2
- package/dist/cjs/cli/codegen_templates/component_api.js.map +2 -2
- package/dist/cjs/cli/codegen_templates/validator_helpers.js +2 -0
- package/dist/cjs/cli/codegen_templates/validator_helpers.js.map +2 -2
- package/dist/cjs/cli/deployment.js +2 -1
- package/dist/cjs/cli/deployment.js.map +2 -2
- package/dist/cjs/cli/deploymentCreate.js.map +2 -2
- package/dist/cjs/cli/generatedApi.js.map +1 -1
- package/dist/cjs/cli/lib/deployApi/validator.js +1 -0
- package/dist/cjs/cli/lib/deployApi/validator.js.map +2 -2
- package/dist/cjs/cli/lib/deploymentSelection.js.map +2 -2
- package/dist/cjs/cli/lib/generateDocs.js +1 -1
- package/dist/cjs/cli/lib/generateDocs.js.map +2 -2
- package/dist/cjs/cli/lib/generatedFunctionLogsApi.js.map +1 -1
- package/dist/cjs/cli/lib/localDeployment/projectMismatch.js.map +2 -2
- package/dist/cjs/cli/lib/login.js +23 -23
- package/dist/cjs/cli/lib/login.js.map +2 -2
- package/dist/cjs/cli/lib/typecheck.js +28 -25
- package/dist/cjs/cli/lib/typecheck.js.map +2 -2
- package/dist/cjs/cli/lib/usageLimits.js +164 -0
- package/dist/cjs/cli/lib/usageLimits.js.map +7 -0
- package/dist/cjs/cli/usageLimits.js +326 -0
- package/dist/cjs/cli/usageLimits.js.map +7 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/client.js.map +2 -2
- package/dist/cjs/server/components/index.js.map +2 -2
- package/dist/cjs/server/cron.js +33 -29
- package/dist/cjs/server/cron.js.map +2 -2
- package/dist/cjs/server/database.js.map +1 -1
- package/dist/cjs/server/impl/database_impl.js +3 -0
- package/dist/cjs/server/impl/database_impl.js.map +2 -2
- package/dist/cjs/server/log.js +2 -1
- package/dist/cjs/server/log.js.map +2 -2
- package/dist/cjs/server/logVars.js +12 -1
- package/dist/cjs/server/logVars.js.map +2 -2
- package/dist/cjs/server/meta.js.map +1 -1
- package/dist/cjs/values/compare.js +5 -1
- package/dist/cjs/values/compare.js.map +2 -2
- package/dist/cjs/values/index.js +1 -0
- package/dist/cjs/values/index.js.map +2 -2
- package/dist/cjs/values/size.js +4 -0
- package/dist/cjs/values/size.js.map +2 -2
- package/dist/cjs/values/validator.js +11 -0
- package/dist/cjs/values/validator.js.map +2 -2
- package/dist/cjs/values/validators.js +20 -0
- package/dist/cjs/values/validators.js.map +2 -2
- package/dist/cjs/values/value.js +31 -0
- package/dist/cjs/values/value.js.map +2 -2
- package/dist/cjs-types/browser/index.d.ts.map +1 -1
- package/dist/cjs-types/browser/sync/paginated_query_client.d.ts +1 -38
- package/dist/cjs-types/browser/sync/paginated_query_client.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen_templates/component_api.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen_templates/validator_helpers.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen_templates/validator_helpers.test.d.ts +2 -0
- package/dist/cjs-types/cli/codegen_templates/validator_helpers.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/deployment.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentCreate.d.ts +2 -2
- package/dist/cjs-types/cli/generatedApi.d.ts +43 -43
- package/dist/cjs-types/cli/generatedApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deployApi/validator.d.ts +6 -0
- package/dist/cjs-types/cli/lib/deployApi/validator.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploymentSelection.d.ts +2 -2
- package/dist/cjs-types/cli/lib/deploymentSelection.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts +45 -45
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/projectMismatch.d.ts +2 -2
- package/dist/cjs-types/cli/lib/localDeployment/projectMismatch.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/login.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/mcp/tools/insights.d.ts +24 -24
- package/dist/cjs-types/cli/lib/typecheck.d.ts +2 -0
- package/dist/cjs-types/cli/lib/typecheck.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/typecheck.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/typecheck.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/usageLimits.d.ts +46 -0
- package/dist/cjs-types/cli/lib/usageLimits.d.ts.map +1 -0
- package/dist/cjs-types/cli/usageLimits.d.ts +22 -0
- package/dist/cjs-types/cli/usageLimits.d.ts.map +1 -0
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/index.d.ts.map +1 -1
- package/dist/cjs-types/react/client.d.ts.map +1 -1
- package/dist/cjs-types/server/components/index.d.ts +26 -8
- package/dist/cjs-types/server/components/index.d.ts.map +1 -1
- package/dist/cjs-types/server/cron.d.ts +20 -11
- package/dist/cjs-types/server/cron.d.ts.map +1 -1
- package/dist/cjs-types/server/cron.test.d.ts +2 -0
- package/dist/cjs-types/server/cron.test.d.ts.map +1 -0
- package/dist/cjs-types/server/database.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/database_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/log.d.ts.map +1 -1
- package/dist/cjs-types/server/logVars.d.ts +14 -1
- package/dist/cjs-types/server/logVars.d.ts.map +1 -1
- package/dist/cjs-types/server/meta.d.ts +2 -2
- package/dist/cjs-types/server/meta.d.ts.map +1 -1
- package/dist/cjs-types/values/compare.d.ts.map +1 -1
- package/dist/cjs-types/values/index.d.ts +2 -2
- package/dist/cjs-types/values/index.d.ts.map +1 -1
- package/dist/cjs-types/values/size.d.ts +1 -1
- package/dist/cjs-types/values/size.d.ts.map +1 -1
- package/dist/cjs-types/values/validator.d.ts +10 -1
- package/dist/cjs-types/values/validator.d.ts.map +1 -1
- package/dist/cjs-types/values/validators.d.ts +14 -3
- package/dist/cjs-types/values/validators.d.ts.map +1 -1
- package/dist/cjs-types/values/value.d.ts +18 -1
- package/dist/cjs-types/values/value.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +2327 -1866
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/browser/index.js.map +2 -2
- package/dist/esm/browser/simple_client-node.js +35 -35
- package/dist/esm/browser/simple_client-node.js.map +1 -1
- package/dist/esm/browser/sync/client.js.map +1 -1
- package/dist/esm/browser/sync/paginated_query_client.js +20 -9
- package/dist/esm/browser/sync/paginated_query_client.js.map +2 -2
- package/dist/esm/cli/codegen_templates/component_api.js +8 -3
- package/dist/esm/cli/codegen_templates/component_api.js.map +2 -2
- package/dist/esm/cli/codegen_templates/validator_helpers.js +2 -0
- package/dist/esm/cli/codegen_templates/validator_helpers.js.map +2 -2
- package/dist/esm/cli/deployment.js +2 -1
- package/dist/esm/cli/deployment.js.map +2 -2
- package/dist/esm/cli/deploymentCreate.js.map +2 -2
- package/dist/esm/cli/lib/deployApi/validator.js +1 -0
- package/dist/esm/cli/lib/deployApi/validator.js.map +2 -2
- package/dist/esm/cli/lib/deploymentSelection.js.map +2 -2
- package/dist/esm/cli/lib/generateDocs.js +1 -1
- package/dist/esm/cli/lib/generateDocs.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/projectMismatch.js.map +2 -2
- package/dist/esm/cli/lib/login.js +23 -23
- package/dist/esm/cli/lib/login.js.map +2 -2
- package/dist/esm/cli/lib/typecheck.js +27 -25
- package/dist/esm/cli/lib/typecheck.js.map +2 -2
- package/dist/esm/cli/lib/usageLimits.js +129 -0
- package/dist/esm/cli/lib/usageLimits.js.map +7 -0
- package/dist/esm/cli/usageLimits.js +316 -0
- package/dist/esm/cli/usageLimits.js.map +7 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/client.js.map +2 -2
- package/dist/esm/server/components/index.js.map +2 -2
- package/dist/esm/server/cron.js +33 -29
- package/dist/esm/server/cron.js.map +2 -2
- package/dist/esm/server/impl/database_impl.js +4 -1
- package/dist/esm/server/impl/database_impl.js.map +2 -2
- package/dist/esm/server/log.js +3 -2
- package/dist/esm/server/log.js.map +2 -2
- package/dist/esm/server/logVars.js +11 -1
- package/dist/esm/server/logVars.js.map +2 -2
- package/dist/esm/values/compare.js +5 -1
- package/dist/esm/values/compare.js.map +2 -2
- package/dist/esm/values/index.js +1 -1
- package/dist/esm/values/index.js.map +2 -2
- package/dist/esm/values/size.js +4 -0
- package/dist/esm/values/size.js.map +2 -2
- package/dist/esm/values/validator.js +12 -0
- package/dist/esm/values/validator.js.map +2 -2
- package/dist/esm/values/validators.js +19 -0
- package/dist/esm/values/validators.js.map +2 -2
- package/dist/esm/values/value.js +29 -1
- package/dist/esm/values/value.js.map +2 -2
- package/dist/esm-types/browser/index.d.ts.map +1 -1
- package/dist/esm-types/browser/sync/paginated_query_client.d.ts +1 -38
- package/dist/esm-types/browser/sync/paginated_query_client.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen_templates/component_api.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen_templates/validator_helpers.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen_templates/validator_helpers.test.d.ts +2 -0
- package/dist/esm-types/cli/codegen_templates/validator_helpers.test.d.ts.map +1 -0
- package/dist/esm-types/cli/deployment.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentCreate.d.ts +2 -2
- package/dist/esm-types/cli/generatedApi.d.ts +43 -43
- package/dist/esm-types/cli/generatedApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deployApi/validator.d.ts +6 -0
- package/dist/esm-types/cli/lib/deployApi/validator.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploymentSelection.d.ts +2 -2
- package/dist/esm-types/cli/lib/deploymentSelection.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts +45 -45
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/projectMismatch.d.ts +2 -2
- package/dist/esm-types/cli/lib/localDeployment/projectMismatch.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/login.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/mcp/tools/insights.d.ts +24 -24
- package/dist/esm-types/cli/lib/typecheck.d.ts +2 -0
- package/dist/esm-types/cli/lib/typecheck.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/typecheck.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/typecheck.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/usageLimits.d.ts +46 -0
- package/dist/esm-types/cli/lib/usageLimits.d.ts.map +1 -0
- package/dist/esm-types/cli/usageLimits.d.ts +22 -0
- package/dist/esm-types/cli/usageLimits.d.ts.map +1 -0
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/index.d.ts.map +1 -1
- package/dist/esm-types/react/client.d.ts.map +1 -1
- package/dist/esm-types/server/components/index.d.ts +26 -8
- package/dist/esm-types/server/components/index.d.ts.map +1 -1
- package/dist/esm-types/server/cron.d.ts +20 -11
- package/dist/esm-types/server/cron.d.ts.map +1 -1
- package/dist/esm-types/server/cron.test.d.ts +2 -0
- package/dist/esm-types/server/cron.test.d.ts.map +1 -0
- package/dist/esm-types/server/database.d.ts.map +1 -1
- package/dist/esm-types/server/impl/database_impl.d.ts.map +1 -1
- package/dist/esm-types/server/log.d.ts.map +1 -1
- package/dist/esm-types/server/logVars.d.ts +14 -1
- package/dist/esm-types/server/logVars.d.ts.map +1 -1
- package/dist/esm-types/server/meta.d.ts +2 -2
- package/dist/esm-types/server/meta.d.ts.map +1 -1
- package/dist/esm-types/values/compare.d.ts.map +1 -1
- package/dist/esm-types/values/index.d.ts +2 -2
- package/dist/esm-types/values/index.d.ts.map +1 -1
- package/dist/esm-types/values/size.d.ts +1 -1
- package/dist/esm-types/values/size.d.ts.map +1 -1
- package/dist/esm-types/values/validator.d.ts +10 -1
- package/dist/esm-types/values/validator.d.ts.map +1 -1
- package/dist/esm-types/values/validators.d.ts +14 -3
- package/dist/esm-types/values/validators.d.ts.map +1 -1
- package/dist/esm-types/values/value.d.ts +18 -1
- package/dist/esm-types/values/value.d.ts.map +1 -1
- package/dist/react.bundle.js +53 -11
- package/dist/react.bundle.js.map +2 -2
- package/package.json +8 -8
- package/schemas/convex.schema.json +2 -1
- package/src/browser/index.ts +2 -0
- package/src/browser/sync/client.test.ts +8 -1
- package/src/browser/sync/client.ts +63 -0
- package/src/browser/sync/paginated_query_client.test.ts +209 -1
- package/src/browser/sync/paginated_query_client.ts +29 -11
- package/src/cli/codegen_templates/component_api.ts +8 -3
- package/src/cli/codegen_templates/validator_helpers.test.ts +31 -0
- package/src/cli/codegen_templates/validator_helpers.ts +6 -0
- package/src/cli/deployment.ts +4 -1
- package/src/cli/deploymentCreate.test.ts +2 -2
- package/src/cli/deploymentCreate.ts +2 -2
- package/src/cli/generatedApi.ts +43 -43
- package/src/cli/lib/deployApi/validator.ts +1 -0
- package/src/cli/lib/deploymentSelection.ts +2 -2
- package/src/cli/lib/generateDocs.test.ts +1 -1
- package/src/cli/lib/generateDocs.ts +3 -3
- package/src/cli/lib/generatedFunctionLogsApi.ts +45 -45
- package/src/cli/lib/localDeployment/projectMismatch.ts +2 -2
- package/src/cli/lib/login.ts +33 -30
- package/src/cli/lib/typecheck.test.ts +71 -0
- package/src/cli/lib/typecheck.ts +33 -27
- package/src/cli/lib/usageLimits.ts +242 -0
- package/src/cli/usageLimits.ts +420 -0
- package/src/index.ts +1 -1
- package/src/react/ConvexAuthState.test.tsx +24 -8
- package/src/react/auth_websocket.test.tsx +39 -29
- package/src/react/client.ts +3 -2
- package/src/react/client_provided_base_client.test.tsx +154 -36
- package/src/server/audit_logging.test.ts +2 -0
- package/src/server/components/index.test.ts +33 -1
- package/src/server/components/index.ts +41 -14
- package/src/server/cron.test.ts +58 -0
- package/src/server/cron.ts +82 -21
- package/src/server/database.ts +17 -0
- package/src/server/impl/database_impl.ts +4 -1
- package/src/server/log.ts +4 -1
- package/src/server/logVars.ts +17 -1
- package/src/server/meta.ts +2 -2
- package/src/server/schema.test.ts +6 -1
- package/src/values/compare.ts +5 -2
- package/src/values/index.ts +2 -1
- package/src/values/size.test.ts +5 -0
- package/src/values/size.ts +5 -1
- package/src/values/validator.test.ts +16 -1
- package/src/values/validator.ts +13 -0
- package/src/values/validators.ts +29 -1
- package/src/values/value.test.ts +35 -0
- package/src/values/value.ts +56 -1
package/src/cli/generatedApi.ts
CHANGED
|
@@ -301,22 +301,22 @@ export interface components {
|
|
|
301
301
|
usedEmails: string[];
|
|
302
302
|
};
|
|
303
303
|
CheckProjectEnvironmentHealthRequest: {
|
|
304
|
-
/** @description WorkOS client ID */
|
|
305
|
-
clientId: string;
|
|
306
304
|
/**
|
|
307
305
|
* Format: int64
|
|
308
306
|
* @description Project ID
|
|
309
307
|
*/
|
|
310
308
|
projectId: number;
|
|
309
|
+
/** @description WorkOS client ID */
|
|
310
|
+
clientId: string;
|
|
311
311
|
};
|
|
312
312
|
DeleteProjectEnvironmentRequest: {
|
|
313
|
-
/** @description WorkOS client ID of the environment to delete */
|
|
314
|
-
clientId: string;
|
|
315
313
|
/**
|
|
316
314
|
* Format: int64
|
|
317
315
|
* @description Project ID for the environment to delete
|
|
318
316
|
*/
|
|
319
317
|
projectId: number;
|
|
318
|
+
/** @description WorkOS client ID of the environment to delete */
|
|
319
|
+
clientId: string;
|
|
320
320
|
};
|
|
321
321
|
/** @description Response for deleting a project environment - matches
|
|
322
322
|
* DeleteWorkOSEnvironmentResponse */
|
|
@@ -350,13 +350,13 @@ export interface components {
|
|
|
350
350
|
/** @description Response for getting a project WorkOS environment with credentials - matches
|
|
351
351
|
* ProvisionProjectEnvironmentResponse pattern with workos_ prefix */
|
|
352
352
|
GetProjectEnvironmentResponse: {
|
|
353
|
-
isProduction: boolean;
|
|
354
|
-
/** @description The user-provided environment name (e.g., "staging", "development") */
|
|
355
|
-
userEnvironmentName: string;
|
|
356
|
-
workosApiKey: string;
|
|
357
|
-
workosClientId: string;
|
|
358
353
|
workosEnvironmentId: string;
|
|
359
354
|
workosEnvironmentName: string;
|
|
355
|
+
workosClientId: string;
|
|
356
|
+
workosApiKey: string;
|
|
357
|
+
/** @description The user-provided environment name (e.g., "staging", "development") */
|
|
358
|
+
userEnvironmentName: string;
|
|
359
|
+
isProduction: boolean;
|
|
360
360
|
};
|
|
361
361
|
GetProjectEnvironmentsResponse: {
|
|
362
362
|
environments: components["schemas"]["ProjectEnvironmentSummary"][];
|
|
@@ -365,31 +365,31 @@ export interface components {
|
|
|
365
365
|
deploymentName: string;
|
|
366
366
|
};
|
|
367
367
|
HasAssociatedWorkOSTeamResponse: {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
* true. */
|
|
371
|
-
adminConvexEmail?: string | null;
|
|
368
|
+
hasAssociatedWorkosTeam: boolean;
|
|
369
|
+
teamId: components["schemas"]["TeamId"];
|
|
372
370
|
/** @description Email address used to provision the WorkOS account. This field should
|
|
373
371
|
* always be present if has_associated_workos_team is true. */
|
|
374
372
|
adminEmail?: string | null;
|
|
375
373
|
/** @description Name of Convex team member who created the WorkOS account.
|
|
376
374
|
* This field is optional even when has_associated_workos_team is true. */
|
|
377
375
|
adminName?: string | null;
|
|
378
|
-
|
|
379
|
-
|
|
376
|
+
/** @description Email of Convex team member who created the WorkOS account.
|
|
377
|
+
* This field should always be present when has_associated_workos_team is
|
|
378
|
+
* true. */
|
|
379
|
+
adminConvexEmail?: string | null;
|
|
380
380
|
};
|
|
381
381
|
InvitationEligibleEmailsResponse: {
|
|
382
|
+
eligibleEmails: string[];
|
|
382
383
|
/** @description The admin email used to create this team's WorkOS account (always
|
|
383
384
|
* eligible for re-invitation) */
|
|
384
385
|
adminEmail?: string | null;
|
|
385
|
-
eligibleEmails: string[];
|
|
386
386
|
};
|
|
387
387
|
InviteWorkOSTeamMemberRequest: {
|
|
388
|
+
/** @description Convex team ID that has an associated WorkOS team */
|
|
389
|
+
teamId: components["schemas"]["TeamId"];
|
|
388
390
|
/** @description Email address to invite to the WorkOS team,
|
|
389
391
|
* must be a verified email address associated with the user's account */
|
|
390
392
|
email: string;
|
|
391
|
-
/** @description Convex team ID that has an associated WorkOS team */
|
|
392
|
-
teamId: components["schemas"]["TeamId"];
|
|
393
393
|
};
|
|
394
394
|
InviteWorkOSTeamMemberResponse: {
|
|
395
395
|
email: string;
|
|
@@ -401,35 +401,35 @@ export interface components {
|
|
|
401
401
|
/** Format: int64 */
|
|
402
402
|
MemberId: number;
|
|
403
403
|
ProjectDetails: {
|
|
404
|
-
/** Format: int64 */
|
|
405
|
-
createTime: number;
|
|
406
|
-
devDeploymentName?: string | null;
|
|
407
404
|
id: components["schemas"]["ProjectId"];
|
|
408
405
|
name: components["schemas"]["ProjectName"];
|
|
409
|
-
prodDeploymentName?: string | null;
|
|
410
406
|
slug: components["schemas"]["ProjectSlug"];
|
|
411
407
|
teamId: components["schemas"]["TeamId"];
|
|
408
|
+
/** Format: int64 */
|
|
409
|
+
createTime: number;
|
|
410
|
+
prodDeploymentName?: string | null;
|
|
411
|
+
devDeploymentName?: string | null;
|
|
412
412
|
};
|
|
413
413
|
/** @description Summary of a project WorkOS environment for list responses - slimmer than
|
|
414
414
|
* full environment details, uses workos_ prefix for consistency with
|
|
415
415
|
* deployment */
|
|
416
416
|
ProjectEnvironmentSummary: {
|
|
417
|
-
isProduction: boolean;
|
|
418
|
-
/** @description The user-provided environment name (e.g., "staging", "development") */
|
|
419
|
-
userEnvironmentName: string;
|
|
420
|
-
workosClientId: string;
|
|
421
417
|
workosEnvironmentId: string;
|
|
422
418
|
workosEnvironmentName: string;
|
|
419
|
+
workosClientId: string;
|
|
420
|
+
/** @description The user-provided environment name (e.g., "staging", "development") */
|
|
421
|
+
userEnvironmentName: string;
|
|
422
|
+
isProduction: boolean;
|
|
423
423
|
};
|
|
424
424
|
/** Format: int64 */
|
|
425
425
|
ProjectId: number;
|
|
426
426
|
ProjectName: string;
|
|
427
427
|
ProjectSlug: string;
|
|
428
428
|
ProvisionEnvironmentResponse: {
|
|
429
|
-
apiKey: string;
|
|
430
|
-
clientId: string;
|
|
431
429
|
environmentId: string;
|
|
432
430
|
environmentName: string;
|
|
431
|
+
clientId: string;
|
|
432
|
+
apiKey: string;
|
|
433
433
|
newlyProvisioned: boolean;
|
|
434
434
|
};
|
|
435
435
|
ProvisionProjectEnvironmentRequest: {
|
|
@@ -439,25 +439,25 @@ export interface components {
|
|
|
439
439
|
/** @description Response for provisioning a project WorkOS environment - matches
|
|
440
440
|
* ProvisionEnvironmentResponse pattern with workos_ prefix for consistency */
|
|
441
441
|
ProvisionProjectEnvironmentResponse: {
|
|
442
|
+
workosEnvironmentId: string;
|
|
443
|
+
workosEnvironmentName: string;
|
|
444
|
+
workosClientId: string;
|
|
445
|
+
workosApiKey: string;
|
|
442
446
|
newlyProvisioned: boolean;
|
|
443
447
|
/** @description The user-provided environment name (e.g., "staging", "development") */
|
|
444
448
|
userEnvironmentName: string;
|
|
445
|
-
workosApiKey: string;
|
|
446
|
-
workosClientId: string;
|
|
447
|
-
workosEnvironmentId: string;
|
|
448
|
-
workosEnvironmentName: string;
|
|
449
449
|
};
|
|
450
450
|
ProvisionWorkOSTeamRequest: {
|
|
451
|
+
/** @description Convex team ID, no WorkOS team exists at this point */
|
|
452
|
+
teamId: components["schemas"]["TeamId"];
|
|
451
453
|
/** @description Email address to use for the WorkOS team admin,
|
|
452
454
|
* must be a verified email address associated with the user's account */
|
|
453
455
|
email: string;
|
|
454
|
-
/** @description Convex team ID, no WorkOS team exists at this point */
|
|
455
|
-
teamId: components["schemas"]["TeamId"];
|
|
456
456
|
};
|
|
457
457
|
ProvisionWorkOSTeamResponse: {
|
|
458
|
-
adminEmail: string;
|
|
459
458
|
workosTeamId: string;
|
|
460
459
|
workosTeamName: string;
|
|
460
|
+
adminEmail: string;
|
|
461
461
|
};
|
|
462
462
|
ReferralCode: string;
|
|
463
463
|
/** @enum {string} */
|
|
@@ -466,30 +466,30 @@ export interface components {
|
|
|
466
466
|
TeamId: number;
|
|
467
467
|
TeamName: string;
|
|
468
468
|
TeamResponse: {
|
|
469
|
-
creator?: null | components["schemas"]["MemberId"];
|
|
470
|
-
defaultRegion?: null | components["schemas"]["RegionName"];
|
|
471
469
|
id: components["schemas"]["TeamId"];
|
|
472
|
-
managedBy?: null | components["schemas"]["ManagedBy"];
|
|
473
|
-
managedByUrl?: string | null;
|
|
474
470
|
name: components["schemas"]["TeamName"];
|
|
471
|
+
slug: components["schemas"]["TeamSlug"];
|
|
472
|
+
creator?: null | components["schemas"]["MemberId"];
|
|
473
|
+
suspended: boolean;
|
|
475
474
|
referralCode: components["schemas"]["ReferralCode"];
|
|
476
475
|
referredBy?: null | components["schemas"]["TeamId"];
|
|
477
|
-
|
|
476
|
+
managedBy?: null | components["schemas"]["ManagedBy"];
|
|
477
|
+
defaultRegion?: null | components["schemas"]["RegionName"];
|
|
478
478
|
ssoLoginId?: string | null;
|
|
479
|
-
|
|
479
|
+
managedByUrl?: string | null;
|
|
480
480
|
};
|
|
481
481
|
TeamSlug: string;
|
|
482
482
|
WorkOSEnvironmentHealthResponse: {
|
|
483
|
-
clientId: string;
|
|
484
483
|
id: string;
|
|
485
484
|
name: string;
|
|
485
|
+
clientId: string;
|
|
486
486
|
};
|
|
487
487
|
/** @enum {string} */
|
|
488
488
|
WorkOSProductionState: "active" | "inactive" | "suspended" | "deleting";
|
|
489
489
|
WorkOSTeamHealthResponse: {
|
|
490
|
-
teamInfo?: null | components["schemas"]["WorkOSTeamInfo"];
|
|
491
490
|
/** @description Whether a WorkOS team has been provisioned for this Convex team */
|
|
492
491
|
teamProvisioned: boolean;
|
|
492
|
+
teamInfo?: null | components["schemas"]["WorkOSTeamInfo"];
|
|
493
493
|
};
|
|
494
494
|
WorkOSTeamInfo: {
|
|
495
495
|
id: string;
|
|
@@ -5,6 +5,7 @@ const baseConvexValidator = z.discriminatedUnion("type", [
|
|
|
5
5
|
looseObject({ type: z.literal("null") }),
|
|
6
6
|
looseObject({ type: z.literal("number") }),
|
|
7
7
|
looseObject({ type: z.literal("bigint") }),
|
|
8
|
+
looseObject({ type: z.literal("commitTs") }),
|
|
8
9
|
looseObject({ type: z.literal("boolean") }),
|
|
9
10
|
looseObject({ type: z.literal("string") }),
|
|
10
11
|
looseObject({ type: z.literal("bytes") }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProjectResponse } from "@convex-dev/platform/managementApi";
|
|
2
2
|
import { BigBrainAuth, Context } from "../../bundler/context.js";
|
|
3
3
|
import { logVerbose } from "../../bundler/log.js";
|
|
4
4
|
import {
|
|
@@ -940,7 +940,7 @@ export const shouldAllowAnonymousDevelopment = (): boolean => {
|
|
|
940
940
|
export async function getProjectDetails(
|
|
941
941
|
ctx: Context,
|
|
942
942
|
projectSelection: ProjectSelection,
|
|
943
|
-
): Promise<
|
|
943
|
+
): Promise<ProjectResponse> {
|
|
944
944
|
switch (projectSelection.kind) {
|
|
945
945
|
case "deploymentName": {
|
|
946
946
|
if (projectSelection.deploymentType === "local") {
|
|
@@ -170,7 +170,7 @@ describe("generateDocs", () => {
|
|
|
170
170
|
const md = generateDocs(makeFakeRoot())["item.mdx"];
|
|
171
171
|
expect(md).toContain("## `npx fake item add` \\{#add}");
|
|
172
172
|
expect(md).toContain("## `npx fake item list` \\{#list}");
|
|
173
|
-
expect(md).toContain("###
|
|
173
|
+
expect(md).toContain("### Syntax");
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
it("documents aliases for nested subcommands inside the main command file", () => {
|
|
@@ -102,9 +102,9 @@ function displayName(path: string[]): string {
|
|
|
102
102
|
return `npx ${path.join(" ")}`;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// Build the usage suffix (everything after the command name) for the
|
|
105
|
+
// Build the usage suffix (everything after the command name) for the Syntax
|
|
106
106
|
// code block. We derive the argument portion from the command's registered
|
|
107
|
-
// arguments rather than trusting a manual `.usage()` override, so the
|
|
107
|
+
// arguments rather than trusting a manual `.usage()` override, so the Syntax
|
|
108
108
|
// line always agrees with the Arguments section below. For example `env set`
|
|
109
109
|
// overrides `.usage()` to show `<name> <value>` (pretending the args are
|
|
110
110
|
// required) for nicer `--help` output, even though it registers them as
|
|
@@ -183,7 +183,7 @@ function renderCommand(
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
const usage = commandUsage(command);
|
|
186
|
-
lines.push(`${h2}
|
|
186
|
+
lines.push(`${h2} Syntax`);
|
|
187
187
|
lines.push("");
|
|
188
188
|
lines.push("```sh");
|
|
189
189
|
lines.push(`${display} ${usage}`.trim());
|
|
@@ -8,72 +8,72 @@ export type webhooks = Record<string, never>;
|
|
|
8
8
|
export interface components {
|
|
9
9
|
schemas: {
|
|
10
10
|
FunctionExecutionJson: {
|
|
11
|
+
udfType: components["schemas"]["UdfTypeJson"];
|
|
12
|
+
componentPath?: string | null;
|
|
13
|
+
identifier: string;
|
|
14
|
+
logLines: components["schemas"]["Value"][];
|
|
15
|
+
/** Format: double */
|
|
16
|
+
timestamp: number;
|
|
11
17
|
cachedResult: boolean;
|
|
12
18
|
caller: string;
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
parentExecutionId?: string | null;
|
|
20
|
+
/** Format: double */
|
|
21
|
+
executionTime: number;
|
|
22
|
+
/** Format: double */
|
|
23
|
+
userExecutionTime?: number | null;
|
|
24
|
+
success?: null | components["schemas"]["Value"];
|
|
15
25
|
error?: string | null;
|
|
26
|
+
requestId: string;
|
|
16
27
|
executionId: string;
|
|
28
|
+
usageStats: components["schemas"]["UsageStatsJson"];
|
|
17
29
|
/** Format: double */
|
|
18
|
-
|
|
30
|
+
returnBytes?: number | null;
|
|
31
|
+
occInfo?: null | components["schemas"]["OccInfoJson"];
|
|
32
|
+
willRetry: boolean;
|
|
19
33
|
/** Format: double */
|
|
20
34
|
executionTimestamp: number;
|
|
21
|
-
identifier: string;
|
|
22
35
|
identityType: string;
|
|
36
|
+
environment: string;
|
|
23
37
|
/** @enum {string} */
|
|
24
38
|
kind: "Completion";
|
|
25
|
-
logLines: components["schemas"]["Value"][];
|
|
26
|
-
occInfo?: null | components["schemas"]["OccInfoJson"];
|
|
27
|
-
parentExecutionId?: string | null;
|
|
28
|
-
requestId: string;
|
|
29
|
-
/** Format: double */
|
|
30
|
-
returnBytes?: number | null;
|
|
31
|
-
success?: null | components["schemas"]["Value"];
|
|
32
|
-
/** Format: double */
|
|
33
|
-
timestamp: number;
|
|
34
|
-
udfType: components["schemas"]["UdfTypeJson"];
|
|
35
|
-
usageStats: components["schemas"]["UsageStatsJson"];
|
|
36
|
-
/** Format: double */
|
|
37
|
-
userExecutionTime?: number | null;
|
|
38
|
-
willRetry: boolean;
|
|
39
39
|
} | {
|
|
40
|
+
udfType: components["schemas"]["UdfTypeJson"];
|
|
40
41
|
componentPath?: string | null;
|
|
41
|
-
executionId: string;
|
|
42
42
|
identifier: string;
|
|
43
|
-
/** @enum {string} */
|
|
44
|
-
kind: "Progress";
|
|
45
|
-
logLines: components["schemas"]["Value"][];
|
|
46
|
-
requestId: string;
|
|
47
43
|
/** Format: double */
|
|
48
44
|
timestamp: number;
|
|
49
|
-
|
|
45
|
+
logLines: components["schemas"]["Value"][];
|
|
46
|
+
requestId: string;
|
|
47
|
+
executionId: string;
|
|
48
|
+
/** @enum {string} */
|
|
49
|
+
kind: "Progress";
|
|
50
50
|
};
|
|
51
51
|
/** @enum {string} */
|
|
52
52
|
LogLevelJson: "DEBUG" | "ERROR" | "WARN" | "INFO" | "LOG";
|
|
53
53
|
LogLineJson: {
|
|
54
|
-
componentPath?: string | null;
|
|
55
|
-
isTruncated: boolean;
|
|
56
|
-
level: components["schemas"]["LogLevelJson"];
|
|
57
54
|
messages: string[];
|
|
58
|
-
|
|
55
|
+
isTruncated: boolean;
|
|
59
56
|
/** Format: int64 */
|
|
60
57
|
timestamp: number;
|
|
58
|
+
level: components["schemas"]["LogLevelJson"];
|
|
59
|
+
systemMetadata?: null | components["schemas"]["SystemLogMetadataJson"];
|
|
60
|
+
componentPath?: string | null;
|
|
61
61
|
udfPath?: string | null;
|
|
62
62
|
};
|
|
63
63
|
OccInfoJson: {
|
|
64
|
-
|
|
64
|
+
tableName?: string | null;
|
|
65
65
|
documentId?: string | null;
|
|
66
|
+
writeSource?: string | null;
|
|
67
|
+
componentPath?: string | null;
|
|
66
68
|
/** Format: int64 */
|
|
67
69
|
retryCount?: number | null;
|
|
68
|
-
tableName?: string | null;
|
|
69
|
-
writeSource?: string | null;
|
|
70
70
|
};
|
|
71
71
|
StreamFunctionLogs: {
|
|
72
|
-
/** Format: int32 */
|
|
73
|
-
clientRequestCounter?: number | null;
|
|
74
72
|
/** Format: double */
|
|
75
73
|
cursor: number;
|
|
76
74
|
sessionId?: string | null;
|
|
75
|
+
/** Format: int32 */
|
|
76
|
+
clientRequestCounter?: number | null;
|
|
77
77
|
};
|
|
78
78
|
StreamUdfExecutionQueryArgs: {
|
|
79
79
|
/** Format: double */
|
|
@@ -90,36 +90,36 @@ export interface components {
|
|
|
90
90
|
/** @enum {string} */
|
|
91
91
|
UdfTypeJson: "Query" | "Mutation" | "Action" | "HttpAction";
|
|
92
92
|
UsageStatsJson: {
|
|
93
|
-
/** Format: int64 */
|
|
94
|
-
databaseIoReadBytes: number;
|
|
95
|
-
/** Format: int64 */
|
|
96
|
-
databaseIoWriteBytes: number;
|
|
97
93
|
/** Format: int64 */
|
|
98
94
|
databaseReadBytes: number;
|
|
99
95
|
/** Format: int64 */
|
|
100
|
-
databaseReadDocuments: number;
|
|
101
|
-
/** Format: int64 */
|
|
102
96
|
databaseWriteBytes: number;
|
|
103
97
|
/** Format: int64 */
|
|
104
|
-
|
|
98
|
+
databaseIoReadBytes: number;
|
|
105
99
|
/** Format: int64 */
|
|
106
|
-
|
|
100
|
+
databaseIoWriteBytes: number;
|
|
101
|
+
/** Format: int64 */
|
|
102
|
+
databaseReadDocuments: number;
|
|
107
103
|
/** Format: int64 */
|
|
108
104
|
storageReadBytes: number;
|
|
109
105
|
/** Format: int64 */
|
|
110
106
|
storageWriteBytes: number;
|
|
111
107
|
/** Format: int64 */
|
|
108
|
+
vectorIndexReadBytes: number;
|
|
109
|
+
/** Format: int64 */
|
|
110
|
+
vectorIndexWriteBytes: number;
|
|
111
|
+
/** Format: int64 */
|
|
112
112
|
textIndexQueryBytes: number;
|
|
113
113
|
/** Format: int64 */
|
|
114
114
|
textIndexWriteQueryBytes: number;
|
|
115
115
|
/** Format: int64 */
|
|
116
|
-
vectorIndexReadBytes: number;
|
|
117
|
-
/** Format: int64 */
|
|
118
116
|
vectorIndexReadQueryBytes: number;
|
|
119
117
|
/** Format: int64 */
|
|
120
|
-
vectorIndexWriteBytes: number;
|
|
121
|
-
/** Format: int64 */
|
|
122
118
|
vectorIndexWriteQueryBytes: number;
|
|
119
|
+
/** Format: int64 */
|
|
120
|
+
networkEgressBytes: number;
|
|
121
|
+
/** Format: int64 */
|
|
122
|
+
memoryUsedMb: number;
|
|
123
123
|
};
|
|
124
124
|
Value: unknown;
|
|
125
125
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProjectResponse } from "@convex-dev/platform/managementApi";
|
|
2
2
|
import { Context } from "../../../bundler/context.js";
|
|
3
3
|
import { logVerbose } from "../../../bundler/log.js";
|
|
4
4
|
import {
|
|
@@ -19,7 +19,7 @@ export async function targetProjectForLocalSelector(
|
|
|
19
19
|
ctx: Context,
|
|
20
20
|
parsed: ParsedDeploymentSelector,
|
|
21
21
|
currentSelection: DeploymentSelection,
|
|
22
|
-
): Promise<
|
|
22
|
+
): Promise<ProjectResponse | null> {
|
|
23
23
|
switch (parsed.kind) {
|
|
24
24
|
case "inTeamProject":
|
|
25
25
|
return await getProjectDetails(ctx, {
|
package/src/cli/lib/login.ts
CHANGED
|
@@ -326,46 +326,44 @@ export async function performLogin(
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
const issuer = overrideAuthUrl ?? "https://auth.convex.dev";
|
|
329
|
-
|
|
329
|
+
const clientId = overrideAuthClient ?? "HFtA247jp9iNs08NTLIB7JsNPMmRIyfi";
|
|
330
330
|
let accessToken: string;
|
|
331
331
|
|
|
332
|
-
if (
|
|
332
|
+
if (overrideAccessToken) {
|
|
333
|
+
// Access token was supplied directly.
|
|
334
|
+
accessToken = overrideAccessToken;
|
|
335
|
+
} else if (overrideAuthUsername && overrideAuthPassword) {
|
|
336
|
+
// Username/Password auth
|
|
337
|
+
accessToken = await performPasswordAuthentication(
|
|
338
|
+
ctx,
|
|
339
|
+
clientId,
|
|
340
|
+
overrideAuthUsername,
|
|
341
|
+
overrideAuthPassword,
|
|
342
|
+
);
|
|
343
|
+
} else if (
|
|
344
|
+
loginFlow === "paste" ||
|
|
345
|
+
(loginFlow === "auto" && isWebContainer())
|
|
346
|
+
) {
|
|
333
347
|
accessToken = await promptString(ctx, {
|
|
334
348
|
message:
|
|
335
349
|
"Open https://dashboard.convex.dev/auth, log in and paste the token here:",
|
|
336
350
|
});
|
|
337
351
|
} else {
|
|
352
|
+
// Device authorization flow. Contact OIDC issuer.
|
|
353
|
+
let authIssuer;
|
|
338
354
|
try {
|
|
339
355
|
authIssuer = await Issuer.discover(issuer);
|
|
340
356
|
} catch {
|
|
341
357
|
// Couldn't contact https://auth.convex.dev/.well-known/openid-configuration,
|
|
342
358
|
// proceed with manual auth.
|
|
343
|
-
|
|
344
|
-
message:
|
|
345
|
-
"Open https://dashboard.convex.dev/auth, log in and paste the token here:",
|
|
346
|
-
});
|
|
359
|
+
authIssuer = undefined;
|
|
347
360
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
client_id: clientId,
|
|
355
|
-
token_endpoint_auth_method: "none",
|
|
356
|
-
id_token_signed_response_alg: "RS256",
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
if (overrideAccessToken) {
|
|
360
|
-
accessToken = overrideAccessToken;
|
|
361
|
-
} else if (overrideAuthUsername && overrideAuthPassword) {
|
|
362
|
-
accessToken = await performPasswordAuthentication(
|
|
363
|
-
ctx,
|
|
364
|
-
clientId,
|
|
365
|
-
overrideAuthUsername,
|
|
366
|
-
overrideAuthPassword,
|
|
367
|
-
);
|
|
368
|
-
} else {
|
|
361
|
+
if (authIssuer) {
|
|
362
|
+
const authClient = new authIssuer.Client({
|
|
363
|
+
client_id: clientId,
|
|
364
|
+
token_endpoint_auth_method: "none",
|
|
365
|
+
id_token_signed_response_alg: "RS256",
|
|
366
|
+
});
|
|
369
367
|
accessToken = await performDeviceAuthorization(
|
|
370
368
|
ctx,
|
|
371
369
|
authClient,
|
|
@@ -373,11 +371,16 @@ export async function performLogin(
|
|
|
373
371
|
vercel,
|
|
374
372
|
vercelOverride,
|
|
375
373
|
);
|
|
374
|
+
} else {
|
|
375
|
+
accessToken = await promptString(ctx, {
|
|
376
|
+
message:
|
|
377
|
+
"Open https://dashboard.convex.dev/auth, log in and paste the token here:",
|
|
378
|
+
});
|
|
376
379
|
}
|
|
377
380
|
}
|
|
378
381
|
|
|
379
382
|
if (dumpAccessToken) {
|
|
380
|
-
logOutput(`${accessToken
|
|
383
|
+
logOutput(`${accessToken}`);
|
|
381
384
|
return await ctx.crash({
|
|
382
385
|
exitCode: 0,
|
|
383
386
|
errorType: "fatal",
|
|
@@ -387,9 +390,9 @@ export async function performLogin(
|
|
|
387
390
|
|
|
388
391
|
// Exchange the WorkOS access token for a Convex personal access token.
|
|
389
392
|
ctx._updateBigBrainAuth({
|
|
390
|
-
accessToken: accessToken
|
|
393
|
+
accessToken: accessToken,
|
|
391
394
|
kind: "accessToken",
|
|
392
|
-
header: `Bearer ${accessToken
|
|
395
|
+
header: `Bearer ${accessToken}`,
|
|
393
396
|
});
|
|
394
397
|
const response = await typedPlatformClient(ctx).POST(
|
|
395
398
|
"/create_personal_access_token",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { findTypeScriptCompilerPath } from "./typecheck.js";
|
|
4
|
+
import type { TypescriptCompiler } from "./typecheck.js";
|
|
5
|
+
|
|
6
|
+
const compilerPaths = {
|
|
7
|
+
tsc: path.join("node_modules", "typescript", "bin", "tsc"),
|
|
8
|
+
native: path.join("node_modules", "@typescript", "native", "bin", "tsc"),
|
|
9
|
+
tsgo: path.join(
|
|
10
|
+
"node_modules",
|
|
11
|
+
"@typescript",
|
|
12
|
+
"native-preview",
|
|
13
|
+
"bin",
|
|
14
|
+
"tsgo",
|
|
15
|
+
),
|
|
16
|
+
legacyTsgo: path.join(
|
|
17
|
+
"node_modules",
|
|
18
|
+
"@typescript",
|
|
19
|
+
"native-preview",
|
|
20
|
+
"bin",
|
|
21
|
+
"tsgo.js",
|
|
22
|
+
),
|
|
23
|
+
} as const;
|
|
24
|
+
|
|
25
|
+
describe("findTypeScriptCompilerPath", () => {
|
|
26
|
+
test.each<{
|
|
27
|
+
compiler: TypescriptCompiler;
|
|
28
|
+
existing: string[];
|
|
29
|
+
expected: string | undefined;
|
|
30
|
+
}>([
|
|
31
|
+
{
|
|
32
|
+
compiler: "tsc",
|
|
33
|
+
existing: [compilerPaths.tsc],
|
|
34
|
+
expected: compilerPaths.tsc,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
compiler: "tsc",
|
|
38
|
+
existing: [compilerPaths.native],
|
|
39
|
+
expected: compilerPaths.native,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
compiler: "tsc",
|
|
43
|
+
existing: [compilerPaths.tsc, compilerPaths.native],
|
|
44
|
+
expected: compilerPaths.native,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
compiler: "tsgo",
|
|
48
|
+
existing: [compilerPaths.tsgo],
|
|
49
|
+
expected: compilerPaths.tsgo,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
compiler: "tsgo",
|
|
53
|
+
existing: [compilerPaths.legacyTsgo],
|
|
54
|
+
expected: compilerPaths.legacyTsgo,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
compiler: "tsgo",
|
|
58
|
+
existing: [compilerPaths.tsgo, compilerPaths.legacyTsgo],
|
|
59
|
+
expected: compilerPaths.tsgo,
|
|
60
|
+
},
|
|
61
|
+
{ compiler: "tsc", existing: [], expected: undefined },
|
|
62
|
+
{ compiler: "tsgo", existing: [], expected: undefined },
|
|
63
|
+
])("finds $expected for $compiler", ({ compiler, existing, expected }) => {
|
|
64
|
+
expect(
|
|
65
|
+
findTypeScriptCompilerPath(
|
|
66
|
+
{ exists: (candidate) => existing.includes(candidate) },
|
|
67
|
+
compiler,
|
|
68
|
+
),
|
|
69
|
+
).toBe(expected);
|
|
70
|
+
});
|
|
71
|
+
});
|