polen 0.11.0-next.10 → 0.11.0-next.12
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/build/api/api.d.ts +2 -1
- package/build/api/api.d.ts.map +1 -1
- package/build/api/api.js +5 -1
- package/build/api/api.js.map +1 -1
- package/build/api/iso/$$.d.ts +2 -0
- package/build/api/iso/$$.d.ts.map +1 -0
- package/build/api/iso/$$.js +2 -0
- package/build/api/iso/$$.js.map +1 -0
- package/build/api/iso/$.d.ts +2 -0
- package/build/api/iso/$.d.ts.map +1 -0
- package/build/api/iso/$.js +2 -0
- package/build/api/iso/$.js.map +1 -0
- package/build/api/iso/schema/$$.d.ts +5 -0
- package/build/api/iso/schema/$$.d.ts.map +1 -0
- package/build/api/iso/schema/$$.js +4 -0
- package/build/api/iso/schema/$$.js.map +1 -0
- package/build/api/iso/schema/$.d.ts +2 -0
- package/build/api/iso/schema/$.d.ts.map +1 -0
- package/build/api/iso/schema/$.js +2 -0
- package/build/api/iso/schema/$.js.map +1 -0
- package/build/api/iso/schema/constants.d.ts +25 -0
- package/build/api/iso/schema/constants.d.ts.map +1 -0
- package/build/api/iso/schema/constants.js +42 -0
- package/build/api/iso/schema/constants.js.map +1 -0
- package/build/api/iso/schema/routing.d.ts +56 -0
- package/build/api/iso/schema/routing.d.ts.map +1 -0
- package/build/api/iso/schema/routing.js +97 -0
- package/build/api/iso/schema/routing.js.map +1 -0
- package/build/api/iso/schema/validation.d.ts +32 -0
- package/build/api/iso/schema/validation.d.ts.map +1 -0
- package/build/api/iso/schema/validation.js +101 -0
- package/build/api/iso/schema/validation.js.map +1 -0
- package/build/api/iso.d.ts +2 -0
- package/build/api/iso.d.ts.map +1 -0
- package/build/api/iso.js +2 -0
- package/build/api/iso.js.map +1 -0
- package/build/api/schema/schema.d.ts +3 -25
- package/build/api/schema/schema.d.ts.map +1 -1
- package/build/api/schema/schema.js +5 -42
- package/build/api/schema/schema.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +3 -6
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/template/components/ArgumentList.d.ts +3 -4
- package/build/template/components/ArgumentList.d.ts.map +1 -1
- package/build/template/components/ArgumentList.js.map +1 -1
- package/build/template/components/Changelog.js +2 -2
- package/build/template/components/Changelog.js.map +1 -1
- package/build/template/components/DeprecationReason.d.ts +2 -2
- package/build/template/components/DeprecationReason.d.ts.map +1 -1
- package/build/template/components/DeprecationReason.js.map +1 -1
- package/build/template/components/Description.d.ts +2 -2
- package/build/template/components/Description.d.ts.map +1 -1
- package/build/template/components/Description.js.map +1 -1
- package/build/template/components/Field.d.ts +3 -4
- package/build/template/components/Field.d.ts.map +1 -1
- package/build/template/components/Field.js.map +1 -1
- package/build/template/components/FieldListSection.d.ts +3 -4
- package/build/template/components/FieldListSection.d.ts.map +1 -1
- package/build/template/components/FieldListSection.js.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.js +32 -10
- package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
- package/build/template/components/HamburgerMenu.d.ts +1 -0
- package/build/template/components/HamburgerMenu.d.ts.map +1 -1
- package/build/template/components/HamburgerMenu.js +2 -2
- package/build/template/components/HamburgerMenu.js.map +1 -1
- package/build/template/components/MissingSchema.d.ts +2 -1
- package/build/template/components/MissingSchema.d.ts.map +1 -1
- package/build/template/components/MissingSchema.js.map +1 -1
- package/build/template/components/ReferenceLink.d.ts +9 -11
- package/build/template/components/ReferenceLink.d.ts.map +1 -1
- package/build/template/components/ReferenceLink.js +2 -4
- package/build/template/components/ReferenceLink.js.map +1 -1
- package/build/template/components/ToastContainer.d.ts +3 -0
- package/build/template/components/ToastContainer.d.ts.map +1 -0
- package/build/template/components/ToastContainer.js +44 -0
- package/build/template/components/ToastContainer.js.map +1 -0
- package/build/template/components/ToastItem.d.ts +7 -0
- package/build/template/components/ToastItem.d.ts.map +1 -0
- package/build/template/components/ToastItem.js +48 -0
- package/build/template/components/ToastItem.js.map +1 -0
- package/build/template/components/TypeAnnotation.d.ts +4 -5
- package/build/template/components/TypeAnnotation.d.ts.map +1 -1
- package/build/template/components/TypeAnnotation.js.map +1 -1
- package/build/template/components/VersionPicker.d.ts +8 -0
- package/build/template/components/VersionPicker.d.ts.map +1 -0
- package/build/template/components/VersionPicker.js +66 -0
- package/build/template/components/VersionPicker.js.map +1 -0
- package/build/template/components/sidebar/Sidebar.d.ts +3 -2
- package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
- package/build/template/components/sidebar/Sidebar.js +7 -6
- package/build/template/components/sidebar/Sidebar.js.map +1 -1
- package/build/template/components/sidebar/SidebarContext.d.ts +6 -0
- package/build/template/components/sidebar/SidebarContext.d.ts.map +1 -0
- package/build/template/components/sidebar/SidebarContext.js +3 -0
- package/build/template/components/sidebar/SidebarContext.js.map +1 -0
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.js +11 -4
- package/build/template/components/sidebar/SidebarItem.js.map +1 -1
- package/build/template/hooks/useReferencePath.d.ts +9 -0
- package/build/template/hooks/useReferencePath.d.ts.map +1 -0
- package/build/template/hooks/useReferencePath.js +18 -0
- package/build/template/hooks/useReferencePath.js.map +1 -0
- package/build/template/hooks/useVersionPath.d.ts.map +1 -1
- package/build/template/hooks/useVersionPath.js +3 -1
- package/build/template/hooks/useVersionPath.js.map +1 -1
- package/build/template/layouts/SidebarLayout.d.ts +3 -2
- package/build/template/layouts/SidebarLayout.d.ts.map +1 -1
- package/build/template/layouts/SidebarLayout.js +2 -2
- package/build/template/layouts/SidebarLayout.js.map +1 -1
- package/build/template/routes/reference.d.ts +24 -8
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.js +52 -61
- package/build/template/routes/reference.js.map +1 -1
- package/build/template/routes/root.d.ts +1 -0
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/root.js +16 -5
- package/build/template/routes/root.js.map +1 -1
- package/build/template/server/ssg/get-route-paths.d.ts.map +1 -1
- package/build/template/server/ssg/get-route-paths.js +47 -14
- package/build/template/server/ssg/get-route-paths.js.map +1 -1
- package/build/template/stores/$$.d.ts +13 -0
- package/build/template/stores/$$.d.ts.map +1 -0
- package/build/template/stores/$$.js +5 -0
- package/build/template/stores/$$.js.map +1 -0
- package/build/template/stores/$.d.ts +2 -0
- package/build/template/stores/$.d.ts.map +1 -0
- package/build/template/stores/$.js +2 -0
- package/build/template/stores/$.js.map +1 -0
- package/build/template/stores/schema.d.ts +40 -0
- package/build/template/stores/schema.d.ts.map +1 -0
- package/build/template/stores/schema.js +36 -0
- package/build/template/stores/schema.js.map +1 -0
- package/build/template/stores/toast.d.ts +103 -0
- package/build/template/stores/toast.d.ts.map +1 -0
- package/build/template/stores/toast.js +105 -0
- package/build/template/stores/toast.js.map +1 -0
- package/build/template/utils/try-with-toast.d.ts +9 -0
- package/build/template/utils/try-with-toast.d.ts.map +1 -0
- package/build/template/utils/try-with-toast.js +37 -0
- package/build/template/utils/try-with-toast.js.map +1 -0
- package/package.json +5 -1
- package/src/api/api.ts +7 -1
- package/src/api/iso/$$.ts +1 -0
- package/src/api/iso/$.ts +1 -0
- package/src/api/iso/schema/$$.ts +6 -0
- package/src/api/iso/schema/$.ts +1 -0
- package/src/api/iso/schema/constants.ts +49 -0
- package/src/api/iso/schema/routing.ts +142 -0
- package/src/api/iso/schema/validation.ts +136 -0
- package/src/api/iso.ts +1 -0
- package/src/api/schema/schema.ts +6 -53
- package/src/api/vite/plugins/core.ts +3 -6
- package/src/template/components/ArgumentList.tsx +2 -6
- package/src/template/components/Changelog.tsx +2 -2
- package/src/template/components/DeprecationReason.tsx +2 -2
- package/src/template/components/Description.tsx +2 -2
- package/src/template/components/Field.tsx +2 -6
- package/src/template/components/FieldListSection.tsx +2 -6
- package/src/template/components/GraphQLInteractive/lib/parser.ts +32 -16
- package/src/template/components/HamburgerMenu.tsx +3 -1
- package/src/template/components/MissingSchema.tsx +3 -1
- package/src/template/components/ReferenceLink.tsx +16 -15
- package/src/template/components/ToastContainer.tsx +67 -0
- package/src/template/components/ToastItem.tsx +119 -0
- package/src/template/components/TypeAnnotation.tsx +2 -6
- package/src/template/components/VersionPicker.tsx +94 -0
- package/src/template/components/sidebar/Sidebar.tsx +20 -16
- package/src/template/components/sidebar/SidebarContext.tsx +7 -0
- package/src/template/components/sidebar/SidebarItem.tsx +11 -4
- package/src/template/hooks/useReferencePath.ts +20 -0
- package/src/template/hooks/useVersionPath.ts +3 -1
- package/src/template/layouts/SidebarLayout.tsx +5 -3
- package/src/template/routes/reference.tsx +56 -73
- package/src/template/routes/root.tsx +29 -6
- package/src/template/server/ssg/get-route-paths.test.ts +13 -0
- package/src/template/server/ssg/get-route-paths.ts +47 -14
- package/src/template/stores/$$.ts +15 -0
- package/src/template/stores/$.ts +1 -0
- package/src/template/stores/schema.ts +52 -0
- package/src/template/stores/toast.ts +153 -0
- package/src/template/utils/try-with-toast.ts +41 -0
- package/build/template/components/VersionSelector.d.ts +0 -7
- package/build/template/components/VersionSelector.d.ts.map +0 -1
- package/build/template/components/VersionSelector.js +0 -30
- package/build/template/components/VersionSelector.js.map +0 -1
- package/build/template/lib/schema-utils/constants.d.ts +0 -5
- package/build/template/lib/schema-utils/constants.d.ts.map +0 -1
- package/build/template/lib/schema-utils/constants.js +0 -5
- package/build/template/lib/schema-utils/constants.js.map +0 -1
- package/src/template/components/VersionSelector.tsx +0 -50
- package/src/template/lib/schema-utils/constants.ts +0 -4
package/build/api/api.d.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
export * from './iso/$$.js';
|
1
2
|
export * from './builder/index.js';
|
2
3
|
export * from './config-resolver/index.js';
|
3
4
|
export * from './config/index.js';
|
4
5
|
export * as Project from './project/index.js';
|
5
|
-
export * from './schema/index.js';
|
6
6
|
export * from './static/index.js';
|
7
|
+
export { Schema } from './schema/index.js';
|
7
8
|
//# sourceMappingURL=api.d.ts.map
|
package/build/api/api.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAG3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AAGjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA"}
|
package/build/api/api.js
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
// Re-export everything from isomorphic layer
|
2
|
+
export * from './iso/$$.js';
|
3
|
+
// Server-only exports
|
1
4
|
export * from './builder/index.js';
|
2
5
|
export * from './config-resolver/index.js';
|
3
6
|
export * from './config/index.js';
|
4
7
|
export * as Project from './project/index.js';
|
5
|
-
export * from './schema/index.js';
|
6
8
|
export * from './static/index.js';
|
9
|
+
// Re-export schema with server-only extensions
|
10
|
+
export { Schema } from './schema/index.js';
|
7
11
|
//# sourceMappingURL=api.js.map
|
package/build/api/api.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,cAAc,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,cAAc,aAAa,CAAA;AAE3B,sBAAsB;AACtB,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AAEjC,+CAA+C;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/api/iso/$$.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.js","sourceRoot":"","sources":["../../../src/api/iso/$$.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../src/api/iso/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,SAAS,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$.js","sourceRoot":"","sources":["../../../src/api/iso/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,SAAS,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../../src/api/iso/schema/$$.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.js","sourceRoot":"","sources":["../../../../src/api/iso/schema/$$.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../../src/api/iso/schema/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,SAAS,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$.js","sourceRoot":"","sources":["../../../../src/api/iso/schema/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,SAAS,CAAA"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Constants for schema versioning
|
3
|
+
*/
|
4
|
+
/**
|
5
|
+
* The version identifier for the latest schema
|
6
|
+
*/
|
7
|
+
export declare const VERSION_LATEST = "latest";
|
8
|
+
/**
|
9
|
+
* Fallback version name when date parsing fails
|
10
|
+
*/
|
11
|
+
export declare const VERSION_UNKNOWN_FALLBACK = "unknown";
|
12
|
+
/**
|
13
|
+
* Convert a date to a version string in YYYY-MM-DD format
|
14
|
+
*/
|
15
|
+
export declare const dateToVersionString: (date: Date) => string;
|
16
|
+
/**
|
17
|
+
* Convert a version string back to a Date
|
18
|
+
*/
|
19
|
+
export declare const versionStringToDate: (version: string) => Date;
|
20
|
+
/**
|
21
|
+
* Determine if a version at the given index should have a changelog file.
|
22
|
+
* Only non-oldest versions get changelog files.
|
23
|
+
*/
|
24
|
+
export declare const shouldVersionHaveChangelog: (versionIndex: number, totalVersions: number) => boolean;
|
25
|
+
//# sourceMappingURL=constants.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/api/iso/schema/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,WAAW,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,wBAAwB,YAAY,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,IAAI,KAAG,MAEhD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,IAgBrD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,cAAc,MAAM,EAAE,eAAe,MAAM,KAAG,OAExF,CAAA"}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/**
|
2
|
+
* Constants for schema versioning
|
3
|
+
*/
|
4
|
+
/**
|
5
|
+
* The version identifier for the latest schema
|
6
|
+
*/
|
7
|
+
export const VERSION_LATEST = `latest`;
|
8
|
+
/**
|
9
|
+
* Fallback version name when date parsing fails
|
10
|
+
*/
|
11
|
+
export const VERSION_UNKNOWN_FALLBACK = `unknown`;
|
12
|
+
/**
|
13
|
+
* Convert a date to a version string in YYYY-MM-DD format
|
14
|
+
*/
|
15
|
+
export const dateToVersionString = (date) => {
|
16
|
+
return date.toLocaleDateString('en-CA');
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* Convert a version string back to a Date
|
20
|
+
*/
|
21
|
+
export const versionStringToDate = (version) => {
|
22
|
+
if (version === VERSION_LATEST) {
|
23
|
+
return new Date();
|
24
|
+
}
|
25
|
+
// Use modern date parsing - the version string should be in YYYY-MM-DD format
|
26
|
+
// which is ISO 8601 compatible
|
27
|
+
const parsedDate = new Date(version + 'T00:00:00Z');
|
28
|
+
// Check if the date is valid
|
29
|
+
if (!isNaN(parsedDate.getTime())) {
|
30
|
+
return parsedDate;
|
31
|
+
}
|
32
|
+
// Throw error for invalid dates instead of silently defaulting
|
33
|
+
throw new Error(`Invalid version string: ${version}`);
|
34
|
+
};
|
35
|
+
/**
|
36
|
+
* Determine if a version at the given index should have a changelog file.
|
37
|
+
* Only non-oldest versions get changelog files.
|
38
|
+
*/
|
39
|
+
export const shouldVersionHaveChangelog = (versionIndex, totalVersions) => {
|
40
|
+
return versionIndex < totalVersions - 1;
|
41
|
+
};
|
42
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/api/iso/schema/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAA;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAU,EAAU,EAAE;IACxD,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;AACzC,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAQ,EAAE;IAC3D,IAAI,OAAO,KAAK,cAAc,EAAE,CAAC;QAC/B,OAAO,IAAI,IAAI,EAAE,CAAA;IACnB,CAAC;IAED,8EAA8E;IAC9E,+BAA+B;IAC/B,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,CAAA;IAEnD,6BAA6B;IAC7B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACjC,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,+DAA+D;IAC/D,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,YAAoB,EAAE,aAAqB,EAAW,EAAE;IACjG,OAAO,YAAY,GAAG,aAAa,GAAG,CAAC,CAAA;AACzC,CAAC,CAAA"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
export interface ReferencePathParts {
|
2
|
+
version?: string;
|
3
|
+
type?: string;
|
4
|
+
field?: string;
|
5
|
+
}
|
6
|
+
interface RouteCheck {
|
7
|
+
pathname: string;
|
8
|
+
params: Record<string, string | undefined>;
|
9
|
+
}
|
10
|
+
export declare const createReferencePath: (parts: ReferencePathParts) => string;
|
11
|
+
/**
|
12
|
+
* Create a base path for reference pages based on the current version
|
13
|
+
* Used for sidebar navigation and other UI components that need version-aware paths
|
14
|
+
*/
|
15
|
+
export declare const createReferenceBasePath: (version?: string) => string;
|
16
|
+
export declare const segmentLiterals: {
|
17
|
+
reference: string;
|
18
|
+
version: string;
|
19
|
+
};
|
20
|
+
/**
|
21
|
+
* Create a base path for reference pages based on the current version
|
22
|
+
* Used for sidebar navigation and other UI components that need version-aware paths
|
23
|
+
*/
|
24
|
+
export declare const createReferenceVersionPath: (version?: string) => string;
|
25
|
+
export declare const joinSegmentsAndPaths: (...segmentsOrPaths: (string | undefined | null | (string | null | undefined)[])[]) => string;
|
26
|
+
/**
|
27
|
+
* Check if the current route is a reference route
|
28
|
+
* @param route - Route information containing pathname and params
|
29
|
+
* @returns True if on a reference route
|
30
|
+
*/
|
31
|
+
export declare const isReferenceRoute: (route: RouteCheck) => boolean;
|
32
|
+
/**
|
33
|
+
* Assert that the current route is a reference route
|
34
|
+
* @param route - Route information containing pathname and params
|
35
|
+
* @throws {Error} If not on a reference route
|
36
|
+
*/
|
37
|
+
export declare const assertReferenceRoute: (route: RouteCheck) => void;
|
38
|
+
/**
|
39
|
+
* View type for reference routes
|
40
|
+
*/
|
41
|
+
export type ReferenceViewType = 'index' | 'type' | 'field' | 'type-missing' | 'field-missing';
|
42
|
+
export interface ReferenceViewParams {
|
43
|
+
schema: import('graphql').GraphQLSchema;
|
44
|
+
type?: string;
|
45
|
+
field?: string;
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* Determine the view type for a reference route based on params and schema
|
49
|
+
*/
|
50
|
+
export declare const getReferenceViewType: (params: ReferenceViewParams) => ReferenceViewType;
|
51
|
+
/**
|
52
|
+
* Type guard to check if view type indicates missing content
|
53
|
+
*/
|
54
|
+
export declare const isMissingView: (viewType: ReferenceViewType) => viewType is "type-missing" | "field-missing";
|
55
|
+
export {};
|
56
|
+
//# sourceMappingURL=routing.d.ts.map
|
@@ -0,0 +1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Q,mBAAmB,KAAG,iBAgClE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,iBAAiB,KAAG,QAAQ,IAAI,cAAc,GAAG,eAExF,CAAA"}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import { Grafaid } from '#lib/grafaid/index';
|
2
|
+
import { VERSION_LATEST } from './constants.js';
|
3
|
+
export const createReferencePath = (parts) => {
|
4
|
+
const basePath = createReferenceBasePath(parts.version);
|
5
|
+
return joinSegmentsAndPaths(basePath, parts.type, parts.field);
|
6
|
+
};
|
7
|
+
/**
|
8
|
+
* Create a base path for reference pages based on the current version
|
9
|
+
* Used for sidebar navigation and other UI components that need version-aware paths
|
10
|
+
*/
|
11
|
+
export const createReferenceBasePath = (version) => {
|
12
|
+
return joinSegmentsAndPaths(segmentLiterals.reference, createReferenceVersionPath(version));
|
13
|
+
};
|
14
|
+
export const segmentLiterals = {
|
15
|
+
reference: 'reference',
|
16
|
+
version: 'version',
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* Create a base path for reference pages based on the current version
|
20
|
+
* Used for sidebar navigation and other UI components that need version-aware paths
|
21
|
+
*/
|
22
|
+
export const createReferenceVersionPath = (version) => {
|
23
|
+
if (version === undefined)
|
24
|
+
return '';
|
25
|
+
return version === VERSION_LATEST
|
26
|
+
? ``
|
27
|
+
: `/${segmentLiterals.version}/${version}`;
|
28
|
+
};
|
29
|
+
export const joinSegmentsAndPaths = (...segmentsOrPaths) => {
|
30
|
+
const path = '/' + segmentsOrPaths
|
31
|
+
.flat()
|
32
|
+
.filter((_) => _ !== undefined && _ !== null)
|
33
|
+
.map(chunkUnformatted => chunkUnformatted
|
34
|
+
.replace(/^\//, '')
|
35
|
+
.replace(/\/$/, ''))
|
36
|
+
.filter(Boolean)
|
37
|
+
.join('/');
|
38
|
+
return path;
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* Check if the current route is a reference route
|
42
|
+
* @param route - Route information containing pathname and params
|
43
|
+
* @returns True if on a reference route
|
44
|
+
*/
|
45
|
+
export const isReferenceRoute = (route) => {
|
46
|
+
return route.params[`type`] !== undefined
|
47
|
+
|| route.params[`field`] !== undefined
|
48
|
+
|| route.params[`argument`] !== undefined
|
49
|
+
|| route.pathname.includes(`/${segmentLiterals.reference}`);
|
50
|
+
};
|
51
|
+
/**
|
52
|
+
* Assert that the current route is a reference route
|
53
|
+
* @param route - Route information containing pathname and params
|
54
|
+
* @throws {Error} If not on a reference route
|
55
|
+
*/
|
56
|
+
export const assertReferenceRoute = (route) => {
|
57
|
+
if (!isReferenceRoute(route)) {
|
58
|
+
throw new Error('Not on a reference route. This function can only be used on reference routes.');
|
59
|
+
}
|
60
|
+
};
|
61
|
+
/**
|
62
|
+
* Determine the view type for a reference route based on params and schema
|
63
|
+
*/
|
64
|
+
export const getReferenceViewType = (params) => {
|
65
|
+
const { schema, type: typeName, field: fieldName } = params;
|
66
|
+
// No type selected - show index
|
67
|
+
if (!typeName) {
|
68
|
+
return 'index';
|
69
|
+
}
|
70
|
+
// Check if type exists
|
71
|
+
const type = schema.getType(typeName);
|
72
|
+
if (!type) {
|
73
|
+
return 'type-missing';
|
74
|
+
}
|
75
|
+
// No field selected - show type
|
76
|
+
if (!fieldName) {
|
77
|
+
return 'type';
|
78
|
+
}
|
79
|
+
// Check if type has fields
|
80
|
+
if (!Grafaid.Schema.TypesLike.isFielded(type)) {
|
81
|
+
return 'field-missing';
|
82
|
+
}
|
83
|
+
// Check if field exists
|
84
|
+
const fields = type.getFields();
|
85
|
+
if (!fields[fieldName]) {
|
86
|
+
return 'field-missing';
|
87
|
+
}
|
88
|
+
// Field exists - show field
|
89
|
+
return 'field';
|
90
|
+
};
|
91
|
+
/**
|
92
|
+
* Type guard to check if view type indicates missing content
|
93
|
+
*/
|
94
|
+
export const isMissingView = (viewType) => {
|
95
|
+
return viewType === 'type-missing' || viewType === 'field-missing';
|
96
|
+
};
|
97
|
+
//# sourceMappingURL=routing.js.map
|
@@ -0,0 +1 @@
|
|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AC,SAAS,EAAE,CAAC;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,OAAO,eAAe,CAAA;IACxB,CAAC;IAED,wBAAwB;IACxB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;IAC/B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QACvB,OAAO,eAAe,CAAA;IACxB,CAAC;IAED,4BAA4B;IAC5B,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAA2B,EAAgD,EAAE;IACzG,OAAO,QAAQ,KAAK,cAAc,IAAI,QAAQ,KAAK,eAAe,CAAA;AACpE,CAAC,CAAA"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import type { GraphQLSchema } from 'graphql';
|
2
|
+
export interface PathValidation {
|
3
|
+
version?: string;
|
4
|
+
type?: string;
|
5
|
+
field?: string;
|
6
|
+
argument?: string;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* Check if a reference path exists in the given schema
|
10
|
+
*/
|
11
|
+
export declare const doesPathExist: (schema: GraphQLSchema, path: PathValidation) => boolean;
|
12
|
+
/**
|
13
|
+
* Find the best fallback path when the current path doesn't exist
|
14
|
+
*/
|
15
|
+
export declare const findFallbackPath: (schema: GraphQLSchema, currentPath: PathValidation) => PathValidation;
|
16
|
+
/**
|
17
|
+
* Get all available types in a schema
|
18
|
+
*/
|
19
|
+
export declare const getAvailableTypes: (schema: GraphQLSchema) => string[];
|
20
|
+
/**
|
21
|
+
* Get all available fields for a type
|
22
|
+
*/
|
23
|
+
export declare const getAvailableFields: (schema: GraphQLSchema, typeName: string) => string[];
|
24
|
+
/**
|
25
|
+
* Check if a path would require a redirect when switching to a new schema version
|
26
|
+
*/
|
27
|
+
export declare const wouldRequireRedirect: (currentSchema: GraphQLSchema, targetSchema: GraphQLSchema, currentPath: PathValidation) => boolean;
|
28
|
+
/**
|
29
|
+
* Get a human-readable description of what will happen when switching versions
|
30
|
+
*/
|
31
|
+
export declare const getRedirectDescription: (targetSchema: GraphQLSchema, currentPath: PathValidation, fallbackPath: PathValidation, targetVersion?: string) => string | null;
|
32
|
+
//# sourceMappingURL=validation.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/api/iso/schema/validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7D,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,aAAa,EAAE,MAAM,cAAc,KAAG,OAmB3E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,aAAa,EACrB,aAAa,cAAc,KAC1B,cA6BF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,aAAa,KAAG,MAAM,EAG/D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,aAAa,EAAE,UAAU,MAAM,KAAG,MAAM,EAQlF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,eAAe,aAAa,EAC5B,cAAc,aAAa,EAC3B,aAAa,cAAc,KAC1B,OAKF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,cAAc,aAAa,EAC3B,aAAa,cAAc,EAC3B,cAAc,cAAc,EAC5B,gBAAgB,MAAM,KACrB,MAAM,GAAG,IAqBX,CAAA"}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import { Grafaid } from '#lib/grafaid/index';
|
2
|
+
/**
|
3
|
+
* Check if a reference path exists in the given schema
|
4
|
+
*/
|
5
|
+
export const doesPathExist = (schema, path) => {
|
6
|
+
if (!path.type)
|
7
|
+
return true;
|
8
|
+
const type = schema.getType(path.type);
|
9
|
+
if (!type)
|
10
|
+
return false;
|
11
|
+
if (!path.field)
|
12
|
+
return true;
|
13
|
+
if (!Grafaid.Schema.TypesLike.isFielded(type))
|
14
|
+
return false;
|
15
|
+
const fields = type.getFields();
|
16
|
+
const field = fields[path.field];
|
17
|
+
if (!field)
|
18
|
+
return false;
|
19
|
+
if (!path.argument)
|
20
|
+
return true;
|
21
|
+
// Check if argument exists
|
22
|
+
const arg = field.args.find(a => a.name === path.argument);
|
23
|
+
return !!arg;
|
24
|
+
};
|
25
|
+
/**
|
26
|
+
* Find the best fallback path when the current path doesn't exist
|
27
|
+
*/
|
28
|
+
export const findFallbackPath = (schema, currentPath) => {
|
29
|
+
// If no type specified, return empty path
|
30
|
+
if (!currentPath.type) {
|
31
|
+
return { type: `Query` };
|
32
|
+
}
|
33
|
+
// Check if current path exists
|
34
|
+
if (doesPathExist(schema, currentPath)) {
|
35
|
+
return currentPath;
|
36
|
+
}
|
37
|
+
// If viewing an argument that doesn't exist, fall back to parent field
|
38
|
+
if (currentPath.argument && currentPath.field) {
|
39
|
+
const fieldPath = { type: currentPath.type, field: currentPath.field };
|
40
|
+
if (doesPathExist(schema, fieldPath)) {
|
41
|
+
return fieldPath;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
// If viewing a field that doesn't exist, fall back to parent type
|
45
|
+
if (currentPath.field) {
|
46
|
+
const typePath = { type: currentPath.type };
|
47
|
+
if (doesPathExist(schema, typePath)) {
|
48
|
+
return typePath;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
// If viewing a type that doesn't exist, fall back to Query type
|
52
|
+
return { type: `Query` };
|
53
|
+
};
|
54
|
+
/**
|
55
|
+
* Get all available types in a schema
|
56
|
+
*/
|
57
|
+
export const getAvailableTypes = (schema) => {
|
58
|
+
const typeMap = schema.getTypeMap();
|
59
|
+
return Object.keys(typeMap).filter(name => !name.startsWith(`__`));
|
60
|
+
};
|
61
|
+
/**
|
62
|
+
* Get all available fields for a type
|
63
|
+
*/
|
64
|
+
export const getAvailableFields = (schema, typeName) => {
|
65
|
+
const type = schema.getType(typeName);
|
66
|
+
if (!type || !Grafaid.Schema.TypesLike.isFielded(type)) {
|
67
|
+
return [];
|
68
|
+
}
|
69
|
+
const fields = type.getFields();
|
70
|
+
return Object.keys(fields);
|
71
|
+
};
|
72
|
+
/**
|
73
|
+
* Check if a path would require a redirect when switching to a new schema version
|
74
|
+
*/
|
75
|
+
export const wouldRequireRedirect = (currentSchema, targetSchema, currentPath) => {
|
76
|
+
const existsInCurrent = doesPathExist(currentSchema, currentPath);
|
77
|
+
const existsInTarget = doesPathExist(targetSchema, currentPath);
|
78
|
+
return existsInCurrent && !existsInTarget;
|
79
|
+
};
|
80
|
+
/**
|
81
|
+
* Get a human-readable description of what will happen when switching versions
|
82
|
+
*/
|
83
|
+
export const getRedirectDescription = (targetSchema, currentPath, fallbackPath, targetVersion) => {
|
84
|
+
if (!currentPath.type)
|
85
|
+
return null;
|
86
|
+
const currentExists = doesPathExist(targetSchema, currentPath);
|
87
|
+
if (currentExists)
|
88
|
+
return null;
|
89
|
+
const versionInfo = targetVersion ? ` in version ${targetVersion}` : ` in this version`;
|
90
|
+
if (currentPath.argument && fallbackPath.field) {
|
91
|
+
return `Argument "${currentPath.argument}" doesn't exist${versionInfo}. Redirecting to field "${fallbackPath.field}".`;
|
92
|
+
}
|
93
|
+
if (currentPath.field && fallbackPath.type && !fallbackPath.field) {
|
94
|
+
return `Field "${currentPath.field}" doesn't exist${versionInfo}. Redirecting to type "${fallbackPath.type}".`;
|
95
|
+
}
|
96
|
+
if (currentPath.type !== fallbackPath.type) {
|
97
|
+
return `Type "${currentPath.type}" doesn't exist${versionInfo}. Redirecting to type "${fallbackPath.type}".`;
|
98
|
+
}
|
99
|
+
return `This path doesn't exist${versionInfo}. Redirecting to a valid location.`;
|
100
|
+
};
|
101
|
+
//# sourceMappingURL=validation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/api/iso/schema/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAU5C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAE,IAAoB,EAAW,EAAE;IACpF,IAAI,CAAC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAE3B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IAEvB,IAAI,CAAC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAE5B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAE3D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAuC,CAAA;IACpE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IAExB,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE/B,2BAA2B;IAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1D,OAAO,CAAC,CAAC,GAAG,CAAA;AACd,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9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IAAI,WAAW,CAAC,KAAK,IAAI,YAAY,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAClE,OAAO,UAAU,WAAW,CAAC,KAAK,kBAAkB,WAAW,0BAA0B,YAAY,CAAC,IAAI,IAAI,CAAA;IAChH,CAAC;IAED,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,EAAE,CAAC;QAC3C,OAAO,SAAS,WAAW,CAAC,IAAI,kBAAkB,WAAW,0BAA0B,YAAY,CAAC,IAAI,IAAI,CAAA;IAC9G,CAAC;IAED,OAAO,0BAA0B,WAAW,oCAAoC,CAAA;AAClF,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iso.d.ts","sourceRoot":"","sources":["../../src/api/iso.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
package/build/api/iso.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"iso.js","sourceRoot":"","sources":["../../src/api/iso.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import type { GraphqlChangeset } from '#lib/graphql-changeset/index';
|
2
|
+
export * from '../iso/schema/constants.js';
|
3
|
+
export * as Routing from '../iso/schema/routing.js';
|
2
4
|
export * as DataSources from './data-sources/data-sources.js';
|
3
|
-
export * from './read.js';
|
4
5
|
export * from './metadata.js';
|
6
|
+
export * from './read.js';
|
5
7
|
export type ChangeSets = GraphqlChangeset.ChangeSet[];
|
6
8
|
export type NonEmptyChangeSets = [GraphqlChangeset.ChangeSet, ...GraphqlChangeset.ChangeSet[]];
|
7
9
|
/**
|
@@ -11,28 +13,4 @@ export interface ChangelogData {
|
|
11
13
|
changes: GraphqlChangeset.ChangeSet['changes'];
|
12
14
|
date: string;
|
13
15
|
}
|
14
|
-
/**
|
15
|
-
* Constants for schema versioning
|
16
|
-
*/
|
17
|
-
/**
|
18
|
-
* The version identifier for the latest schema
|
19
|
-
*/
|
20
|
-
export declare const VERSION_LATEST = "latest";
|
21
|
-
/**
|
22
|
-
* Fallback version name when date parsing fails
|
23
|
-
*/
|
24
|
-
export declare const VERSION_UNKNOWN_FALLBACK = "unknown";
|
25
|
-
/**
|
26
|
-
* Convert a date to a version string in YYYY-MM-DD format
|
27
|
-
*/
|
28
|
-
export declare const dateToVersionString: (date: Date) => string;
|
29
|
-
/**
|
30
|
-
* Determine if a version at the given index should have a changelog file.
|
31
|
-
* Only non-oldest versions get changelog files.
|
32
|
-
*/
|
33
|
-
export declare const shouldVersionHaveChangelog: (versionIndex: number, totalVersions: number) => boolean;
|
34
|
-
/**
|
35
|
-
* Convert a version string back to a Date
|
36
|
-
*/
|
37
|
-
export declare const versionStringToDate: (version: string) => Date;
|
38
16
|
//# sourceMappingURL=schema.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/api/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/api/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAGpE,cAAc,4BAA4B,CAAA;AAC1C,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AAGnD,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAA;AAC7D,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AAEzB,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAA;AAErD,MAAM,MAAM,kBAAkB,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAA;AAE9F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IAC9C,IAAI,EAAE,MAAM,CAAA;CACb"}
|
@@ -1,45 +1,8 @@
|
|
1
|
+
// Re-export everything from isomorphic layer
|
2
|
+
export * from '../iso/schema/constants.js';
|
3
|
+
export * as Routing from '../iso/schema/routing.js';
|
4
|
+
// Server-only exports
|
1
5
|
export * as DataSources from './data-sources/data-sources.js';
|
2
|
-
export * from './read.js';
|
3
6
|
export * from './metadata.js';
|
4
|
-
|
5
|
-
* Constants for schema versioning
|
6
|
-
*/
|
7
|
-
/**
|
8
|
-
* The version identifier for the latest schema
|
9
|
-
*/
|
10
|
-
export const VERSION_LATEST = `latest`;
|
11
|
-
/**
|
12
|
-
* Fallback version name when date parsing fails
|
13
|
-
*/
|
14
|
-
export const VERSION_UNKNOWN_FALLBACK = `unknown`;
|
15
|
-
/**
|
16
|
-
* Convert a date to a version string in YYYY-MM-DD format
|
17
|
-
*/
|
18
|
-
export const dateToVersionString = (date) => {
|
19
|
-
return date.toLocaleDateString('en-CA');
|
20
|
-
};
|
21
|
-
/**
|
22
|
-
* Determine if a version at the given index should have a changelog file.
|
23
|
-
* Only non-oldest versions get changelog files.
|
24
|
-
*/
|
25
|
-
export const shouldVersionHaveChangelog = (versionIndex, totalVersions) => {
|
26
|
-
return versionIndex < totalVersions - 1;
|
27
|
-
};
|
28
|
-
/**
|
29
|
-
* Convert a version string back to a Date
|
30
|
-
*/
|
31
|
-
export const versionStringToDate = (version) => {
|
32
|
-
if (version === VERSION_LATEST) {
|
33
|
-
return new Date();
|
34
|
-
}
|
35
|
-
// Use modern date parsing - the version string should be in YYYY-MM-DD format
|
36
|
-
// which is ISO 8601 compatible
|
37
|
-
const parsedDate = new Date(version + 'T00:00:00Z');
|
38
|
-
// Check if the date is valid
|
39
|
-
if (!isNaN(parsedDate.getTime())) {
|
40
|
-
return parsedDate;
|
41
|
-
}
|
42
|
-
// Throw error for invalid dates instead of silently defaulting
|
43
|
-
throw new Error(`Invalid version string: ${version}`);
|
44
|
-
};
|
7
|
+
export * from './read.js';
|
45
8
|
//# sourceMappingURL=schema.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/api/schema/schema.ts"],"names":[],"mappings":"AAEA,
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/api/schema/schema.ts"],"names":[],"mappings":"AAEA,6CAA6C;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AAEnD,sBAAsB;AACtB,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAA;AAC7D,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAK/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAK/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAarD,eAAO,MAAM,aAAa,mCAA+E,CAAA;AACzG,eAAO,MAAM,eAAe,mCAAiF,CAAA;AAE7G,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,WAAW,CAAC,WAAW,EAAE,CAAA;CAClC;AAED,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,CAAC,MAAM,KAAG,IAAI,CAAC,YAAY,EA8M7D,CAAA"}
|