polen 0.11.0-next.23 → 0.11.0-next.25

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 (192) hide show
  1. package/build/api/config/input.d.ts +76 -77
  2. package/build/api/config/input.d.ts.map +1 -1
  3. package/build/api/config/normalized.d.ts +136 -143
  4. package/build/api/config/normalized.d.ts.map +1 -1
  5. package/build/api/config-template/template.d.ts +110 -121
  6. package/build/api/config-template/template.d.ts.map +1 -1
  7. package/build/api/examples/diagnostic/diagnostic.d.ts +0 -23
  8. package/build/api/examples/diagnostic/diagnostic.d.ts.map +1 -1
  9. package/build/api/examples/diagnostic/diagnostic.js +1 -3
  10. package/build/api/examples/diagnostic/diagnostic.js.map +1 -1
  11. package/build/api/examples/scanner.d.ts +27 -1
  12. package/build/api/examples/scanner.d.ts.map +1 -1
  13. package/build/api/examples/scanner.js +19 -17
  14. package/build/api/examples/scanner.js.map +1 -1
  15. package/build/api/examples/schemas/catalog.d.ts +20 -12
  16. package/build/api/examples/schemas/catalog.d.ts.map +1 -1
  17. package/build/api/examples/schemas/example/example.d.ts +17 -11
  18. package/build/api/examples/schemas/example/example.d.ts.map +1 -1
  19. package/build/api/schema/augmentations/$$.d.ts +7 -0
  20. package/build/api/schema/augmentations/$$.d.ts.map +1 -0
  21. package/build/api/schema/augmentations/$$.js +7 -0
  22. package/build/api/schema/augmentations/$$.js.map +1 -0
  23. package/build/api/schema/augmentations/$.d.ts +1 -1
  24. package/build/api/schema/augmentations/$.d.ts.map +1 -1
  25. package/build/api/schema/augmentations/$.js +1 -1
  26. package/build/api/schema/augmentations/$.js.map +1 -1
  27. package/build/api/schema/augmentations/apply.d.ts +29 -0
  28. package/build/api/schema/augmentations/apply.d.ts.map +1 -0
  29. package/build/api/schema/augmentations/apply.js +181 -0
  30. package/build/api/schema/augmentations/apply.js.map +1 -0
  31. package/build/api/schema/augmentations/augmentation.d.ts +31 -0
  32. package/build/api/schema/augmentations/augmentation.d.ts.map +1 -0
  33. package/build/api/schema/augmentations/augmentation.js +22 -0
  34. package/build/api/schema/augmentations/augmentation.js.map +1 -0
  35. package/build/api/schema/augmentations/config.d.ts +24 -0
  36. package/build/api/schema/augmentations/config.d.ts.map +1 -0
  37. package/build/api/schema/augmentations/config.js +9 -0
  38. package/build/api/schema/augmentations/config.js.map +1 -0
  39. package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts +67 -0
  40. package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts.map +1 -0
  41. package/build/api/schema/augmentations/diagnostics/diagnostic.js +13 -0
  42. package/build/api/schema/augmentations/diagnostics/diagnostic.js.map +1 -0
  43. package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts +45 -0
  44. package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts.map +1 -0
  45. package/build/api/schema/augmentations/diagnostics/duplicate-version.js +17 -0
  46. package/build/api/schema/augmentations/diagnostics/duplicate-version.js.map +1 -0
  47. package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts +46 -0
  48. package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts.map +1 -0
  49. package/build/api/schema/augmentations/diagnostics/invalid-path.js +18 -0
  50. package/build/api/schema/augmentations/diagnostics/invalid-path.js.map +1 -0
  51. package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts +46 -0
  52. package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts.map +1 -0
  53. package/build/api/schema/augmentations/diagnostics/version-mismatch.js +18 -0
  54. package/build/api/schema/augmentations/diagnostics/version-mismatch.js.map +1 -0
  55. package/build/api/schema/augmentations/input.d.ts +145 -0
  56. package/build/api/schema/augmentations/input.d.ts.map +1 -0
  57. package/build/api/schema/augmentations/input.js +191 -0
  58. package/build/api/schema/augmentations/input.js.map +1 -0
  59. package/build/api/schema/augmentations/placement.d.ts +8 -0
  60. package/build/api/schema/augmentations/placement.d.ts.map +1 -0
  61. package/build/api/schema/augmentations/placement.js +7 -0
  62. package/build/api/schema/augmentations/placement.js.map +1 -0
  63. package/build/api/schema/config-schema.d.ts +66 -66
  64. package/build/api/schema/config-schema.d.ts.map +1 -1
  65. package/build/api/schema/config-schema.js +2 -2
  66. package/build/api/schema/config-schema.js.map +1 -1
  67. package/build/api/schema/input-source/load.d.ts +2 -0
  68. package/build/api/schema/input-source/load.d.ts.map +1 -1
  69. package/build/api/schema/input-source/load.js.map +1 -1
  70. package/build/api/schema/input-sources/directory.d.ts +39 -39
  71. package/build/api/schema/input-sources/file.d.ts +39 -39
  72. package/build/api/schema/input-sources/introspection-file.d.ts +39 -39
  73. package/build/api/schema/input-sources/introspection.d.ts +39 -39
  74. package/build/api/schema/input-sources/memory.d.ts +39 -39
  75. package/build/api/schema/input-sources/versioned-directory.d.ts +79 -79
  76. package/build/api/schema/load.d.ts.map +1 -1
  77. package/build/api/schema/load.js +9 -2
  78. package/build/api/schema/load.js.map +1 -1
  79. package/build/lib/catalog/catalog.d.ts +1181 -1181
  80. package/build/lib/catalog/unversioned.d.ts +312 -312
  81. package/build/lib/catalog/versioned.d.ts +634 -634
  82. package/build/lib/change/change.d.ts +238 -238
  83. package/build/lib/document/document.d.ts +14 -8
  84. package/build/lib/document/document.d.ts.map +1 -1
  85. package/build/lib/document/versioned.d.ts +17 -10
  86. package/build/lib/document/versioned.d.ts.map +1 -1
  87. package/build/lib/grafaid/schema/KindMap/_.d.ts +1 -1
  88. package/build/lib/graphql-path/$$.d.ts +7 -13
  89. package/build/lib/graphql-path/$$.d.ts.map +1 -1
  90. package/build/lib/graphql-path/$$.js +7 -13
  91. package/build/lib/graphql-path/$$.js.map +1 -1
  92. package/build/lib/graphql-path/definition.d.ts +104 -94
  93. package/build/lib/graphql-path/definition.d.ts.map +1 -1
  94. package/build/lib/graphql-path/definition.js +126 -125
  95. package/build/lib/graphql-path/definition.js.map +1 -1
  96. package/build/lib/graphql-path/query.d.ts +25 -57
  97. package/build/lib/graphql-path/query.d.ts.map +1 -1
  98. package/build/lib/graphql-path/query.js +15 -93
  99. package/build/lib/graphql-path/query.js.map +1 -1
  100. package/build/lib/graphql-path/schema.d.ts +49 -0
  101. package/build/lib/graphql-path/schema.d.ts.map +1 -0
  102. package/build/lib/graphql-path/schema.js +89 -0
  103. package/build/lib/graphql-path/schema.js.map +1 -0
  104. package/build/lib/graphql-path/types.d.ts +76 -28
  105. package/build/lib/graphql-path/types.d.ts.map +1 -1
  106. package/build/lib/graphql-path/types.js +101 -2
  107. package/build/lib/graphql-path/types.js.map +1 -1
  108. package/build/lib/revision/revision.d.ts +1170 -1170
  109. package/build/lib/schema/schema.d.ts +708 -708
  110. package/build/lib/schema/unversioned.d.ts +1092 -1092
  111. package/build/lib/schema/versioned.d.ts +634 -634
  112. package/build/lib/semver/official-release.d.ts +10 -10
  113. package/build/lib/semver/pre-release.d.ts +10 -10
  114. package/build/lib/semver/semver.d.ts +50 -50
  115. package/build/lib/version-coverage/version-coverage.d.ts +43 -11
  116. package/build/lib/version-coverage/version-coverage.d.ts.map +1 -1
  117. package/build/lib/version-coverage/version-coverage.js +40 -6
  118. package/build/lib/version-coverage/version-coverage.js.map +1 -1
  119. package/build/template/hooks/use-examples.d.ts +1 -1
  120. package/build/template/routes/changelog/ChangelogSidebar.d.ts +2 -2
  121. package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -1
  122. package/build/template/routes/changelog/ChangelogSidebar.js +4 -4
  123. package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -1
  124. package/build/template/routes/examples/_.d.ts +3 -3
  125. package/build/template/routes/examples/_index.d.ts +2 -2
  126. package/build/template/routes/examples/name.d.ts +3 -3
  127. package/build/template/routes/pages.d.ts.map +1 -1
  128. package/build/template/routes/pages.js +5 -1
  129. package/build/template/routes/pages.js.map +1 -1
  130. package/build/template/stores/changelog.d.ts +39 -39
  131. package/build/vite/plugins/examples.d.ts.map +1 -1
  132. package/build/vite/plugins/examples.js +0 -2
  133. package/build/vite/plugins/examples.js.map +1 -1
  134. package/build/vite/plugins/schemas.d.ts.map +1 -1
  135. package/build/vite/plugins/schemas.js +38 -2
  136. package/build/vite/plugins/schemas.js.map +1 -1
  137. package/package.json +1 -1
  138. package/src/api/examples/diagnostic/diagnostic.ts +0 -3
  139. package/src/api/examples/scanner.test.ts +83 -0
  140. package/src/api/examples/scanner.ts +17 -21
  141. package/src/api/schema/augmentations/$$.ts +6 -0
  142. package/src/api/schema/augmentations/$.ts +1 -1
  143. package/src/api/schema/augmentations/apply.test.ts +89 -0
  144. package/src/api/schema/augmentations/apply.ts +277 -0
  145. package/src/api/schema/augmentations/augmentation.ts +24 -0
  146. package/src/api/schema/augmentations/config.ts +11 -0
  147. package/src/api/schema/augmentations/diagnostics/diagnostic.ts +20 -0
  148. package/src/api/schema/augmentations/diagnostics/duplicate-version.ts +20 -0
  149. package/src/api/schema/augmentations/diagnostics/invalid-path.ts +21 -0
  150. package/src/api/schema/augmentations/diagnostics/version-mismatch.ts +21 -0
  151. package/src/api/schema/augmentations/input.test.ts +144 -0
  152. package/src/api/schema/augmentations/input.ts +215 -0
  153. package/src/api/schema/augmentations/placement.ts +11 -0
  154. package/src/api/schema/config-schema.ts +2 -2
  155. package/src/api/schema/input-source/load.ts +2 -0
  156. package/src/api/schema/load.ts +19 -2
  157. package/src/lib/graphql-path/$$.ts +7 -13
  158. package/src/lib/graphql-path/$.test.ts +175 -0
  159. package/src/lib/graphql-path/definition.ts +162 -162
  160. package/src/lib/graphql-path/query.ts +15 -98
  161. package/src/lib/graphql-path/schema.ts +136 -0
  162. package/src/lib/graphql-path/types.ts +108 -28
  163. package/src/lib/version-coverage/version-coverage.ts +48 -6
  164. package/src/template/routes/changelog/ChangelogSidebar.tsx +4 -4
  165. package/src/template/routes/pages.tsx +6 -1
  166. package/src/vite/plugins/examples.ts +0 -2
  167. package/src/vite/plugins/schemas.ts +51 -2
  168. package/build/api/examples/diagnostic/unused-default.d.ts +0 -49
  169. package/build/api/examples/diagnostic/unused-default.d.ts.map +0 -1
  170. package/build/api/examples/diagnostic/unused-default.js +0 -19
  171. package/build/api/examples/diagnostic/unused-default.js.map +0 -1
  172. package/build/api/schema/augmentations/augmentations/description.d.ts +0 -26
  173. package/build/api/schema/augmentations/augmentations/description.d.ts.map +0 -1
  174. package/build/api/schema/augmentations/augmentations/description.js +0 -55
  175. package/build/api/schema/augmentations/augmentations/description.js.map +0 -1
  176. package/build/api/schema/augmentations/schema-augmentation.d.ts +0 -20
  177. package/build/api/schema/augmentations/schema-augmentation.d.ts.map +0 -1
  178. package/build/api/schema/augmentations/schema-augmentation.js +0 -22
  179. package/build/api/schema/augmentations/schema-augmentation.js.map +0 -1
  180. package/build/api/schema/augmentations/target.d.ts +0 -25
  181. package/build/api/schema/augmentations/target.d.ts.map +0 -1
  182. package/build/api/schema/augmentations/target.js +0 -39
  183. package/build/api/schema/augmentations/target.js.map +0 -1
  184. package/build/lib/graphql-path/constructors.d.ts +0 -57
  185. package/build/lib/graphql-path/constructors.d.ts.map +0 -1
  186. package/build/lib/graphql-path/constructors.js +0 -73
  187. package/build/lib/graphql-path/constructors.js.map +0 -1
  188. package/src/api/examples/diagnostic/unused-default.ts +0 -22
  189. package/src/api/schema/augmentations/augmentations/description.ts +0 -69
  190. package/src/api/schema/augmentations/schema-augmentation.ts +0 -32
  191. package/src/api/schema/augmentations/target.ts +0 -61
  192. package/src/lib/graphql-path/constructors.ts +0 -81
@@ -1,25 +0,0 @@
1
- import { Grafaid } from '#lib/grafaid';
2
- import { S } from '#lib/kit-temp/effect';
3
- export declare const TargetTypeSchema: S.Struct<{
4
- type: S.Literal<["TargetType"]>;
5
- name: typeof S.String;
6
- }>;
7
- export type TargetType = S.Schema.Type<typeof TargetTypeSchema>;
8
- export declare const TargetFieldSchema: S.Struct<{
9
- type: S.Literal<["TargetField"]>;
10
- name: typeof S.String;
11
- targetType: typeof S.String;
12
- }>;
13
- export type TargetField = S.Schema.Type<typeof TargetFieldSchema>;
14
- export declare const TargetSchema: S.Union<[S.Struct<{
15
- type: S.Literal<["TargetType"]>;
16
- name: typeof S.String;
17
- }>, S.Struct<{
18
- type: S.Literal<["TargetField"]>;
19
- name: typeof S.String;
20
- targetType: typeof S.String;
21
- }>]>;
22
- export type Target = S.Schema.Type<typeof TargetSchema>;
23
- export declare const locateTargetType: (schema: Grafaid.Schema.Schema, target: TargetType) => Grafaid.Schema.TypesLike.Named;
24
- export declare const locateTargetField: (schema: Grafaid.Schema.Schema, target: TargetField) => Grafaid.Schema.NodesLike.Field;
25
- //# sourceMappingURL=target.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAMxC,eAAO,MAAM,gBAAgB;;;EAG3B,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,iBAAiB;;;;EAI5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE,eAAO,MAAM,YAAY;;;;;;;IAA+C,CAAA;AAExE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,EAC7B,QAAQ,UAAU,KACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,KAM3B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,EAC7B,QAAQ,WAAW,KAClB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,KAoB3B,CAAA"}
@@ -1,39 +0,0 @@
1
- import { Grafaid } from '#lib/grafaid';
2
- import { S } from '#lib/kit-temp/effect';
3
- // ============================================================================
4
- // Schema
5
- // ============================================================================
6
- export const TargetTypeSchema = S.Struct({
7
- type: S.Literal('TargetType'),
8
- name: S.String,
9
- });
10
- export const TargetFieldSchema = S.Struct({
11
- type: S.Literal('TargetField'),
12
- name: S.String,
13
- targetType: S.String,
14
- });
15
- export const TargetSchema = S.Union(TargetTypeSchema, TargetFieldSchema);
16
- export const locateTargetType = (schema, target) => {
17
- const type = schema.getType(target.name);
18
- if (!type) {
19
- throw new Error(`Could not find type ${target.name}`);
20
- }
21
- return type;
22
- };
23
- export const locateTargetField = (schema, target) => {
24
- const type = schema.getType(target.targetType);
25
- if (!type) {
26
- throw new Error(`Could not find type ${target.targetType}`);
27
- }
28
- if (!Grafaid.Schema.TypesLike.isFielded(type)) {
29
- throw new Error(`Type ${target.targetType} does not have fields`);
30
- }
31
- const fields = type.getFields();
32
- const field = fields[target.name];
33
- if (!field) {
34
- // dprint-ignore
35
- throw new Error(`Could not find field ${target.name} on type ${target.targetType}`);
36
- }
37
- return field;
38
- };
39
- //# sourceMappingURL=target.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"target.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM;CACf,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,UAAU,EAAE,CAAC,CAAC,MAAM;CACrB,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;AAIxE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAA6B,EAC7B,MAAkB,EACc,EAAE;IAClC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACxC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IACvD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAA6B,EAC7B,MAAmB,EACa,EAAE;IAClC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAE9C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;IAC7D,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,QAAQ,MAAM,CAAC,UAAU,uBAAuB,CAAC,CAAA;IACnE,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAEjC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,gBAAgB;QAChB,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,CAAC,IAAI,YAAY,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;IACrF,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
@@ -1,57 +0,0 @@
1
- /**
2
- * Constructor functions and type guards
3
- */
4
- import type { ArgumentSegment, FieldSegment, QuerySegment, Segment, TypeSegment } from './types.js';
5
- /**
6
- * Type guard to check if a segment is a type segment
7
- *
8
- * @param segment - The segment to check
9
- * @returns True if the segment is a type segment
10
- */
11
- export declare const isTypeSegment: (segment: Segment) => segment is TypeSegment;
12
- /**
13
- * Type guard to check if a segment is a field segment
14
- *
15
- * @param segment - The segment to check
16
- * @returns True if the segment is a field segment
17
- */
18
- export declare const isFieldSegment: (segment: Segment) => segment is FieldSegment;
19
- /**
20
- * Type guard to check if a segment is an argument segment
21
- *
22
- * @param segment - The segment to check
23
- * @returns True if the segment is an argument segment
24
- */
25
- export declare const isArgumentSegment: (segment: Segment) => segment is ArgumentSegment;
26
- /**
27
- * Type guard to check if a segment can be used in a query path
28
- *
29
- * @param segment - The segment to check
30
- * @returns True if the segment can be used in a query path
31
- */
32
- export declare const isQuerySegment: (segment: Segment) => segment is QuerySegment;
33
- /**
34
- * Create a type segment
35
- *
36
- * @param type - The type name
37
- * @returns A type segment
38
- * @example createTypeSegment('User') // { kind: 'type', type: 'User' }
39
- */
40
- export declare const createTypeSegment: (type: string) => TypeSegment;
41
- /**
42
- * Create a field segment
43
- *
44
- * @param field - The field name
45
- * @returns A field segment
46
- * @example createFieldSegment('name') // { kind: 'field', field: 'name' }
47
- */
48
- export declare const createFieldSegment: (field: string) => FieldSegment;
49
- /**
50
- * Create an argument segment
51
- *
52
- * @param argument - The argument name
53
- * @returns An argument segment
54
- * @example createArgumentSegment('limit') // { kind: 'argument', argument: 'limit' }
55
- */
56
- export declare const createArgumentSegment: (argument: string) => ArgumentSegment;
57
- //# sourceMappingURL=constructors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constructors.d.ts","sourceRoot":"","sources":["../../../src/lib/graphql-path/constructors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEnG;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,WAE3D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,YAE5D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,eAE/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,YAE5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,WAG/C,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,YAGjD,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,KAAG,eAGvD,CAAA"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Constructor functions and type guards
3
- */
4
- /**
5
- * Type guard to check if a segment is a type segment
6
- *
7
- * @param segment - The segment to check
8
- * @returns True if the segment is a type segment
9
- */
10
- export const isTypeSegment = (segment) => {
11
- return segment.kind === 'type';
12
- };
13
- /**
14
- * Type guard to check if a segment is a field segment
15
- *
16
- * @param segment - The segment to check
17
- * @returns True if the segment is a field segment
18
- */
19
- export const isFieldSegment = (segment) => {
20
- return segment.kind === 'field';
21
- };
22
- /**
23
- * Type guard to check if a segment is an argument segment
24
- *
25
- * @param segment - The segment to check
26
- * @returns True if the segment is an argument segment
27
- */
28
- export const isArgumentSegment = (segment) => {
29
- return segment.kind === 'argument';
30
- };
31
- /**
32
- * Type guard to check if a segment can be used in a query path
33
- *
34
- * @param segment - The segment to check
35
- * @returns True if the segment can be used in a query path
36
- */
37
- export const isQuerySegment = (segment) => {
38
- return segment.kind === 'type' || segment.kind === 'field';
39
- };
40
- /**
41
- * Create a type segment
42
- *
43
- * @param type - The type name
44
- * @returns A type segment
45
- * @example createTypeSegment('User') // { kind: 'type', type: 'User' }
46
- */
47
- export const createTypeSegment = (type) => ({
48
- kind: 'type',
49
- type,
50
- });
51
- /**
52
- * Create a field segment
53
- *
54
- * @param field - The field name
55
- * @returns A field segment
56
- * @example createFieldSegment('name') // { kind: 'field', field: 'name' }
57
- */
58
- export const createFieldSegment = (field) => ({
59
- kind: 'field',
60
- field,
61
- });
62
- /**
63
- * Create an argument segment
64
- *
65
- * @param argument - The argument name
66
- * @returns An argument segment
67
- * @example createArgumentSegment('limit') // { kind: 'argument', argument: 'limit' }
68
- */
69
- export const createArgumentSegment = (argument) => ({
70
- kind: 'argument',
71
- argument,
72
- });
73
- //# sourceMappingURL=constructors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constructors.js","sourceRoot":"","sources":["../../../src/lib/graphql-path/constructors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAgB,EAA0B,EAAE;IACxE,OAAO,OAAO,CAAC,IAAI,KAAK,MAAM,CAAA;AAChC,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgB,EAA2B,EAAE;IAC1E,OAAO,OAAO,CAAC,IAAI,KAAK,OAAO,CAAA;AACjC,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAgB,EAA8B,EAAE;IAChF,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,CAAA;AACpC,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgB,EAA2B,EAAE;IAC1E,OAAO,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAA;AAC5D,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAe,EAAE,CAAC,CAAC;IAC/D,IAAI,EAAE,MAAM;IACZ,IAAI;CACL,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAgB,EAAE,CAAC,CAAC;IAClE,IAAI,EAAE,OAAO;IACb,KAAK;CACN,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAmB,EAAE,CAAC,CAAC;IAC3E,IAAI,EAAE,UAAU;IAChB,QAAQ;CACT,CAAC,CAAA"}
@@ -1,22 +0,0 @@
1
- import { Diagnostic } from '#lib/diagnostic/$'
2
- import { S } from '#lib/kit-temp/effect'
3
-
4
- export const DiagnosticUnusedDefault = Diagnostic.create({
5
- source: 'examples-scanner',
6
- name: 'unused-default',
7
- severity: 'warning',
8
- context: {
9
- example: S.Struct({
10
- name: S.String,
11
- path: S.String,
12
- }),
13
- versions: S.Array(S.String),
14
- },
15
- }).annotations({
16
- identifier: 'DiagnosticUnusedDefault',
17
- description: 'Default example file that is never used because explicit versions exist for all schema versions',
18
- })
19
-
20
- export const makeDiagnosticUnusedDefault = Diagnostic.createMake(DiagnosticUnusedDefault)
21
-
22
- export type DiagnosticUnusedDefault = S.Schema.Type<typeof DiagnosticUnusedDefault>
@@ -1,69 +0,0 @@
1
- import type { GrafaidOld } from '#lib/grafaid-old'
2
- import { S } from '#lib/kit-temp/effect'
3
- import { neverCase } from '@wollybeard/kit/language'
4
- import { TargetSchema } from '../target.js'
5
- import { locateTargetField, locateTargetType } from '../target.js'
6
-
7
- // ============================================================================
8
- // Schema
9
- // ============================================================================
10
-
11
- export const PlacementSchema = S.Literal('before', 'after', 'over')
12
- export type Placement = S.Schema.Type<typeof PlacementSchema>
13
-
14
- export const DescriptionAugmentationSchema = S.Struct({
15
- type: S.Literal('description'),
16
- on: TargetSchema,
17
- placement: PlacementSchema,
18
- content: S.String,
19
- })
20
-
21
- export type DescriptionAugmentation = S.Schema.Type<typeof DescriptionAugmentationSchema>
22
-
23
- // ============================================================================
24
- // Constants
25
- // ============================================================================
26
-
27
- export const Placement = {
28
- Before: `before` as const,
29
- After: `after` as const,
30
- Over: `over` as const,
31
- }
32
-
33
- export const applyDescriptionContent = (
34
- type: GrafaidOld.Groups.Describable,
35
- augmentation: DescriptionAugmentation,
36
- ) => {
37
- const existingDescription = type.description ?? ``
38
-
39
- switch (augmentation.placement) {
40
- case `before`:
41
- type.description = `${augmentation.content}\n\n${existingDescription}`
42
- break
43
- case `after`:
44
- type.description = `${existingDescription}\n\n${augmentation.content}`
45
- break
46
- case `over`:
47
- type.description = augmentation.content
48
- break
49
- default:
50
- neverCase(augmentation.placement)
51
- }
52
- }
53
-
54
- export const apply = (schema: GrafaidOld.Schema.Schema, augmentation: DescriptionAugmentation) => {
55
- switch (augmentation.on.type) {
56
- case `TargetType`: {
57
- const type = locateTargetType(schema, augmentation.on)
58
- applyDescriptionContent(type, augmentation)
59
- break
60
- }
61
- case `TargetField`: {
62
- const field = locateTargetField(schema, augmentation.on)
63
- applyDescriptionContent(field, augmentation)
64
- break
65
- }
66
- default:
67
- neverCase(augmentation.on)
68
- }
69
- }
@@ -1,32 +0,0 @@
1
- import type { GrafaidOld } from '#lib/grafaid-old'
2
- import { S } from '#lib/kit-temp/effect'
3
- import { neverCase } from '@wollybeard/kit/language'
4
- import * as AugmentationDescription from './augmentations/description.js'
5
-
6
- export { AugmentationDescription }
7
-
8
- // ============================================================================
9
- // Schema
10
- // ============================================================================
11
-
12
- export const AugmentationSchema = AugmentationDescription.DescriptionAugmentationSchema // Union will expand as more augmentation types are added
13
-
14
- export type Augmentation = S.Schema.Type<typeof AugmentationSchema>
15
-
16
- export const apply = (
17
- schema: GrafaidOld.Schema.Schema,
18
- augmentations: readonly Augmentation[],
19
- ): GrafaidOld.Schema.Schema => {
20
- for (const augmentation of augmentations) {
21
- switch (augmentation.type) {
22
- case `description`: {
23
- AugmentationDescription.apply(schema, augmentation)
24
- break
25
- }
26
- default:
27
- neverCase(augmentation.type)
28
- }
29
- }
30
-
31
- return schema
32
- }
@@ -1,61 +0,0 @@
1
- import { Grafaid } from '#lib/grafaid'
2
- import { S } from '#lib/kit-temp/effect'
3
-
4
- // ============================================================================
5
- // Schema
6
- // ============================================================================
7
-
8
- export const TargetTypeSchema = S.Struct({
9
- type: S.Literal('TargetType'),
10
- name: S.String,
11
- })
12
-
13
- export type TargetType = S.Schema.Type<typeof TargetTypeSchema>
14
-
15
- export const TargetFieldSchema = S.Struct({
16
- type: S.Literal('TargetField'),
17
- name: S.String,
18
- targetType: S.String,
19
- })
20
-
21
- export type TargetField = S.Schema.Type<typeof TargetFieldSchema>
22
-
23
- export const TargetSchema = S.Union(TargetTypeSchema, TargetFieldSchema)
24
-
25
- export type Target = S.Schema.Type<typeof TargetSchema>
26
-
27
- export const locateTargetType = (
28
- schema: Grafaid.Schema.Schema,
29
- target: TargetType,
30
- ): Grafaid.Schema.TypesLike.Named => {
31
- const type = schema.getType(target.name)
32
- if (!type) {
33
- throw new Error(`Could not find type ${target.name}`)
34
- }
35
- return type
36
- }
37
-
38
- export const locateTargetField = (
39
- schema: Grafaid.Schema.Schema,
40
- target: TargetField,
41
- ): Grafaid.Schema.NodesLike.Field => {
42
- const type = schema.getType(target.targetType)
43
-
44
- if (!type) {
45
- throw new Error(`Could not find type ${target.targetType}`)
46
- }
47
-
48
- if (!Grafaid.Schema.TypesLike.isFielded(type)) {
49
- throw new Error(`Type ${target.targetType} does not have fields`)
50
- }
51
-
52
- const fields = type.getFields()
53
- const field = fields[target.name]
54
-
55
- if (!field) {
56
- // dprint-ignore
57
- throw new Error(`Could not find field ${target.name} on type ${target.targetType}`)
58
- }
59
-
60
- return field
61
- }
@@ -1,81 +0,0 @@
1
- /**
2
- * Constructor functions and type guards
3
- */
4
-
5
- import type { ArgumentSegment, FieldSegment, QuerySegment, Segment, TypeSegment } from './types.js'
6
-
7
- /**
8
- * Type guard to check if a segment is a type segment
9
- *
10
- * @param segment - The segment to check
11
- * @returns True if the segment is a type segment
12
- */
13
- export const isTypeSegment = (segment: Segment): segment is TypeSegment => {
14
- return segment.kind === 'type'
15
- }
16
-
17
- /**
18
- * Type guard to check if a segment is a field segment
19
- *
20
- * @param segment - The segment to check
21
- * @returns True if the segment is a field segment
22
- */
23
- export const isFieldSegment = (segment: Segment): segment is FieldSegment => {
24
- return segment.kind === 'field'
25
- }
26
-
27
- /**
28
- * Type guard to check if a segment is an argument segment
29
- *
30
- * @param segment - The segment to check
31
- * @returns True if the segment is an argument segment
32
- */
33
- export const isArgumentSegment = (segment: Segment): segment is ArgumentSegment => {
34
- return segment.kind === 'argument'
35
- }
36
-
37
- /**
38
- * Type guard to check if a segment can be used in a query path
39
- *
40
- * @param segment - The segment to check
41
- * @returns True if the segment can be used in a query path
42
- */
43
- export const isQuerySegment = (segment: Segment): segment is QuerySegment => {
44
- return segment.kind === 'type' || segment.kind === 'field'
45
- }
46
-
47
- /**
48
- * Create a type segment
49
- *
50
- * @param type - The type name
51
- * @returns A type segment
52
- * @example createTypeSegment('User') // { kind: 'type', type: 'User' }
53
- */
54
- export const createTypeSegment = (type: string): TypeSegment => ({
55
- kind: 'type',
56
- type,
57
- })
58
-
59
- /**
60
- * Create a field segment
61
- *
62
- * @param field - The field name
63
- * @returns A field segment
64
- * @example createFieldSegment('name') // { kind: 'field', field: 'name' }
65
- */
66
- export const createFieldSegment = (field: string): FieldSegment => ({
67
- kind: 'field',
68
- field,
69
- })
70
-
71
- /**
72
- * Create an argument segment
73
- *
74
- * @param argument - The argument name
75
- * @returns An argument segment
76
- * @example createArgumentSegment('limit') // { kind: 'argument', argument: 'limit' }
77
- */
78
- export const createArgumentSegment = (argument: string): ArgumentSegment => ({
79
- kind: 'argument',
80
- argument,
81
- })