@mintlify/common 1.0.1307 → 1.0.1309
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/dist/entitlements/index.d.ts +1 -5
- package/dist/entitlements/index.js +2 -20
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/mdx/builtInComponents.d.ts +2 -0
- package/dist/mdx/builtInComponents.js +3 -0
- package/dist/mdx/builtInComponents.test.d.ts +1 -0
- package/dist/mdx/builtInComponents.test.js +20 -0
- package/dist/mdx/index.d.ts +2 -0
- package/dist/mdx/index.js +2 -0
- package/dist/mdx/snippets/resolveImport/index.d.ts +1 -0
- package/dist/mdx/snippets/resolveImport/index.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/isOrgLessThanTwoWeeksOld.d.ts +0 -7
- package/dist/isOrgLessThanTwoWeeksOld.js +0 -11
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { OrgType, StaticPropsOrgType } from '@mintlify/models';
|
|
2
1
|
import { DeploymentEntitlement, DeploymentEntitlements } from '@mintlify/validation';
|
|
3
|
-
export declare
|
|
4
|
-
export declare function checkAccess({ entitlements, org, entitlementToCheck, allowTrialAccess }: {
|
|
2
|
+
export declare function checkAccess({ entitlements, entitlementToCheck }: {
|
|
5
3
|
entitlements: DeploymentEntitlements | undefined;
|
|
6
|
-
org?: OrgType | StaticPropsOrgType;
|
|
7
4
|
entitlementToCheck: DeploymentEntitlement;
|
|
8
|
-
allowTrialAccess?: boolean;
|
|
9
5
|
}): boolean;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export const TRIAL_ENTITLEMENTS = [
|
|
3
|
-
'AI_CHAT',
|
|
4
|
-
'ANALYTICS',
|
|
5
|
-
'CUSTOM_SUBPATH',
|
|
6
|
-
'PREVIEW_DEPLOYMENTS',
|
|
7
|
-
'SOURCE_CHECK_LINK_ROT',
|
|
8
|
-
'SOURCE_CHECK_VALE_SPELLCHECK',
|
|
9
|
-
'MCP_ENDPOINTS',
|
|
10
|
-
'MCP_AUTH',
|
|
11
|
-
];
|
|
12
|
-
export function checkAccess({ entitlements, org, entitlementToCheck, allowTrialAccess = false, }) {
|
|
1
|
+
export function checkAccess({ entitlements, entitlementToCheck, }) {
|
|
13
2
|
var _a;
|
|
14
|
-
|
|
15
|
-
if (enabledByEntitlement) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (allowTrialAccess && !!org && TRIAL_ENTITLEMENTS.includes(entitlementToCheck)) {
|
|
19
|
-
return isOrgLessThanTwoWeeksOld(org.createdAt);
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
3
|
+
return ((_a = entitlements === null || entitlements === void 0 ? void 0 : entitlements[entitlementToCheck]) === null || _a === void 0 ? void 0 : _a.status) === 'ENABLED';
|
|
22
4
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ export * from './apiStaticExportBasePaths.js';
|
|
|
36
36
|
export * from './basePaths.js';
|
|
37
37
|
export * from './validateCustomDomainBasePath.js';
|
|
38
38
|
export * from './exponentialBackoff.js';
|
|
39
|
-
export * from './isOrgLessThanTwoWeeksOld.js';
|
|
40
39
|
export * from './entitlements/index.js';
|
|
41
40
|
export * from './validateRedirectUrl.js';
|
|
42
41
|
export * from './isAllowedRedirectUri.js';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,6 @@ export * from './apiStaticExportBasePaths.js';
|
|
|
36
36
|
export * from './basePaths.js';
|
|
37
37
|
export * from './validateCustomDomainBasePath.js';
|
|
38
38
|
export * from './exponentialBackoff.js';
|
|
39
|
-
export * from './isOrgLessThanTwoWeeksOld.js';
|
|
40
39
|
export * from './entitlements/index.js';
|
|
41
40
|
export * from './validateRedirectUrl.js';
|
|
42
41
|
export * from './isAllowedRedirectUri.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BUILD_RENAMED_COMPONENTS, isBuiltInComponent } from './builtInComponents.js';
|
|
2
|
+
import { remarkFrames } from './plugins/remark/remarkFrames.js';
|
|
3
|
+
import { coreRemark } from './remark.js';
|
|
4
|
+
import { allowedComponents } from './utils.js';
|
|
5
|
+
describe('isBuiltInComponent', () => {
|
|
6
|
+
it('accepts every component remarkMdxRemoveUnknownJsx keeps', () => {
|
|
7
|
+
expect(allowedComponents.filter((name) => !isBuiltInComponent(name))).toEqual([]);
|
|
8
|
+
expect(isBuiltInComponent('Color.Row')).toBe(true);
|
|
9
|
+
expect(isBuiltInComponent('Color.Nope')).toBe(false);
|
|
10
|
+
expect(isBuiltInComponent('Missing')).toBe(false);
|
|
11
|
+
});
|
|
12
|
+
it('accepts tags the build rewrites before removing unknown JSX', () => {
|
|
13
|
+
const tree = coreRemark().parse('<Example>\n x\n</Example>\n');
|
|
14
|
+
remarkFrames()(tree);
|
|
15
|
+
const [node] = tree.children;
|
|
16
|
+
expect(BUILD_RENAMED_COMPONENTS).toEqual(['Example', 'Snippet']);
|
|
17
|
+
expect((node === null || node === void 0 ? void 0 : node.name) && allowedComponents.includes(node.name)).toBe(true);
|
|
18
|
+
expect(BUILD_RENAMED_COMPONENTS.every(isBuiltInComponent)).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
});
|
package/dist/mdx/index.d.ts
CHANGED
|
@@ -15,4 +15,6 @@ export * from './getCodeStyling.js';
|
|
|
15
15
|
export * from './getCodeRanges.js';
|
|
16
16
|
export * from './replaceVariables.js';
|
|
17
17
|
export * from './componentIds.js';
|
|
18
|
+
export * from './builtInComponents.js';
|
|
19
|
+
export { collectPatternNames, visitReferences } from './estreeReferences.js';
|
|
18
20
|
export * from './islands/index.js';
|
package/dist/mdx/index.js
CHANGED
|
@@ -15,4 +15,6 @@ export * from './getCodeStyling.js';
|
|
|
15
15
|
export * from './getCodeRanges.js';
|
|
16
16
|
export * from './replaceVariables.js';
|
|
17
17
|
export * from './componentIds.js';
|
|
18
|
+
export * from './builtInComponents.js';
|
|
19
|
+
export { collectPatternNames, visitReferences } from './estreeReferences.js';
|
|
18
20
|
export * from './islands/index.js';
|
|
@@ -4,6 +4,7 @@ import { collectContextFromTree } from '../../plugins/remark/staticEvaluator.js'
|
|
|
4
4
|
import { type OnExportCollision } from './exportCollision.js';
|
|
5
5
|
export { type ExportCollisionWarning, type OnExportCollision } from './exportCollision.js';
|
|
6
6
|
export { findExport } from './findExport.js';
|
|
7
|
+
export { collectExportedNames } from './snippetDeclarations.js';
|
|
7
8
|
export { injectToTopOfFileOfTree } from './injectToTopOfFile.js';
|
|
8
9
|
/** What one page's imports have resolved so far. Pass the same state for every import of a page. */
|
|
9
10
|
export interface ImportResolutionState {
|
|
@@ -17,6 +17,7 @@ import { injectToTopOfFileOfTree } from './injectToTopOfFile.js';
|
|
|
17
17
|
import { resolveComponentWithContent } from './resolveComponentWithContent.js';
|
|
18
18
|
import { collectExportedNames, collectTopLevelBindingNames, declarationSource, exportedBindingName, injectBelowEagerDependencies, isolateExportedDeclarator, patternSiblingNames, prepareSnippetSiblings, } from './snippetDeclarations.js';
|
|
19
19
|
export { findExport } from './findExport.js';
|
|
20
|
+
export { collectExportedNames } from './snippetDeclarations.js';
|
|
20
21
|
export { injectToTopOfFileOfTree } from './injectToTopOfFile.js';
|
|
21
22
|
const VALID_SPECIFIERS = [
|
|
22
23
|
MdxImportSpecifier.ImportSpecifier,
|