@conduit-client/generator-ts 5.67.0-dev1

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 (131) hide show
  1. package/dist/main/index.js +6 -0
  2. package/dist/main/index.js.map +1 -0
  3. package/dist/types/index.d.ts +0 -0
  4. package/dist/types/v1/__tests__/api-module-generator-service.spec.d.ts +1 -0
  5. package/dist/types/v1/__tests__/test-utils/additional-properties-api.d.ts +8 -0
  6. package/dist/types/v1/__tests__/test-utils/all-of-api.d.ts +8 -0
  7. package/dist/types/v1/__tests__/test-utils/any-api.d.ts +8 -0
  8. package/dist/types/v1/__tests__/test-utils/array-api.d.ts +8 -0
  9. package/dist/types/v1/__tests__/test-utils/base-api.d.ts +9 -0
  10. package/dist/types/v1/__tests__/test-utils/datetime-api.d.ts +8 -0
  11. package/dist/types/v1/__tests__/test-utils/discriminator-api.d.ts +9 -0
  12. package/dist/types/v1/__tests__/test-utils/enum-api.d.ts +8 -0
  13. package/dist/types/v1/__tests__/test-utils/index.d.ts +31 -0
  14. package/dist/types/v1/__tests__/test-utils/object-api.d.ts +8 -0
  15. package/dist/types/v1/__tests__/test-utils/oneof-api.d.ts +8 -0
  16. package/dist/types/v1/__tests__/test-utils/scalar-api.d.ts +9 -0
  17. package/dist/types/v1/__tests__/utils.spec.d.ts +1 -0
  18. package/dist/types/v1/api-module-generator-service.d.ts +18 -0
  19. package/dist/types/v1/files/__tests__/code.spec.d.ts +1 -0
  20. package/dist/types/v1/files/__tests__/file.spec.d.ts +1 -0
  21. package/dist/types/v1/files/__tests__/write-files.spec.d.ts +1 -0
  22. package/dist/types/v1/files/code.d.ts +86 -0
  23. package/dist/types/v1/files/file.d.ts +79 -0
  24. package/dist/types/v1/files/index.d.ts +3 -0
  25. package/dist/types/v1/files/write-files.d.ts +12 -0
  26. package/dist/types/v1/generators/__tests__/api-family-module-generator.spec.d.ts +1 -0
  27. package/dist/types/v1/generators/__tests__/aura-command-generator.spec.d.ts +1 -0
  28. package/dist/types/v1/generators/__tests__/aura-graphql-normalized-cache-control-command-generator.spec.d.ts +1 -0
  29. package/dist/types/v1/generators/__tests__/aura-normalized-cache-control-command-generator.spec.d.ts +1 -0
  30. package/dist/types/v1/generators/__tests__/aura-resource-cache-control-command-generator.spec.d.ts +1 -0
  31. package/dist/types/v1/generators/__tests__/base-command-generator.spec.d.ts +1 -0
  32. package/dist/types/v1/generators/__tests__/bindings-generator.spec.d.ts +1 -0
  33. package/dist/types/v1/generators/__tests__/built-test-model.d.ts +10 -0
  34. package/dist/types/v1/generators/__tests__/cache-control-generator.spec.d.ts +1 -0
  35. package/dist/types/v1/generators/__tests__/command-config-builder.spec.d.ts +1 -0
  36. package/dist/types/v1/generators/__tests__/http-command-generator.spec.d.ts +1 -0
  37. package/dist/types/v1/generators/__tests__/http-normalized-cache-control-command-generator.spec.d.ts +1 -0
  38. package/dist/types/v1/generators/__tests__/imperative-binding-generator.spec.d.ts +1 -0
  39. package/dist/types/v1/generators/__tests__/imperative-legacy-binding-generator.spec.d.ts +1 -0
  40. package/dist/types/v1/generators/__tests__/normalized-cache-control-generator-mixin.spec.d.ts +1 -0
  41. package/dist/types/v1/generators/__tests__/utils.spec.d.ts +1 -0
  42. package/dist/types/v1/generators/__tests__/wire-binding-generator.spec.d.ts +1 -0
  43. package/dist/types/v1/generators/api-family-module-generator.d.ts +54 -0
  44. package/dist/types/v1/generators/aura-command-generator.d.ts +46 -0
  45. package/dist/types/v1/generators/aura-graphql-normalized-cache-control-command-generator.d.ts +1 -0
  46. package/dist/types/v1/generators/aura-normalized-cache-control-command-generator.d.ts +1 -0
  47. package/dist/types/v1/generators/aura-resource-cache-control-command-generator.d.ts +39 -0
  48. package/dist/types/v1/generators/base-command-generator.d.ts +88 -0
  49. package/dist/types/v1/generators/bindings-generator.d.ts +69 -0
  50. package/dist/types/v1/generators/cache-control-generator.d.ts +2 -0
  51. package/dist/types/v1/generators/command-config-builder.d.ts +28 -0
  52. package/dist/types/v1/generators/graphql-imperative-binding-generator.d.ts +23 -0
  53. package/dist/types/v1/generators/graphql-imperative-legacy-binding-generator.d.ts +18 -0
  54. package/dist/types/v1/generators/graphql-mutation-binding-generator.d.ts +21 -0
  55. package/dist/types/v1/generators/graphql-normalized-cache-control-generator-mixin.d.ts +13 -0
  56. package/dist/types/v1/generators/graphql-root-variable-names.d.ts +2 -0
  57. package/dist/types/v1/generators/graphql-wire-binding-generator.d.ts +18 -0
  58. package/dist/types/v1/generators/http-command-generator.d.ts +67 -0
  59. package/dist/types/v1/generators/http-graphql-normalized-cache-control-command-generator.d.ts +1 -0
  60. package/dist/types/v1/generators/http-normalized-cache-control-command-generator.d.ts +1 -0
  61. package/dist/types/v1/generators/imperative-binding-generator.d.ts +24 -0
  62. package/dist/types/v1/generators/imperative-legacy-binding-generator.d.ts +18 -0
  63. package/dist/types/v1/generators/index.d.ts +9 -0
  64. package/dist/types/v1/generators/normalized-cache-control-generator-mixin.d.ts +15 -0
  65. package/dist/types/v1/generators/utils.d.ts +17 -0
  66. package/dist/types/v1/generators/wire-binding-generator.d.ts +19 -0
  67. package/dist/types/v1/index.d.ts +4 -0
  68. package/dist/types/v1/model/__tests__/aura-command-model.spec.d.ts +1 -0
  69. package/dist/types/v1/model/__tests__/aura-graphql-command-model.spec.d.ts +1 -0
  70. package/dist/types/v1/model/__tests__/aura-normalized-caching-command-model.spec.d.ts +1 -0
  71. package/dist/types/v1/model/__tests__/aura-resource-caching-command-model.spec.d.ts +1 -0
  72. package/dist/types/v1/model/__tests__/base-command-model.spec.d.ts +1 -0
  73. package/dist/types/v1/model/__tests__/graphql-schema-model.spec.d.ts +1 -0
  74. package/dist/types/v1/model/__tests__/graphql-utils.d.ts +17 -0
  75. package/dist/types/v1/model/__tests__/http-command-model.spec.d.ts +1 -0
  76. package/dist/types/v1/model/__tests__/http-normalized-caching-command-model.spec.d.ts +1 -0
  77. package/dist/types/v1/model/aura-command-model.d.ts +34 -0
  78. package/dist/types/v1/model/aura-graphql-command-model.d.ts +10 -0
  79. package/dist/types/v1/model/aura-normalized-caching-command-model.d.ts +8 -0
  80. package/dist/types/v1/model/aura-resource-caching-command-model.d.ts +13 -0
  81. package/dist/types/v1/model/base-command-model.d.ts +186 -0
  82. package/dist/types/v1/model/graphql-command-model-interface.d.ts +12 -0
  83. package/dist/types/v1/model/graphql-schema-model.d.ts +104 -0
  84. package/dist/types/v1/model/http-command-model.d.ts +32 -0
  85. package/dist/types/v1/model/http-graphql-command-model.d.ts +16 -0
  86. package/dist/types/v1/model/http-normalized-caching-command-model.d.ts +14 -0
  87. package/dist/types/v1/normalization/__tests__/graphql-type-generator.spec.d.ts +1 -0
  88. package/dist/types/v1/normalization/__tests__/graphql-type-registry-generator.spec.d.ts +1 -0
  89. package/dist/types/v1/normalization/__tests__/identifiable-type-generator.spec.d.ts +1 -0
  90. package/dist/types/v1/normalization/__tests__/integration.spec.d.ts +1 -0
  91. package/dist/types/v1/normalization/__tests__/normalized-type-generator.spec.d.ts +1 -0
  92. package/dist/types/v1/normalization/__tests__/type-registry-generator.spec.d.ts +1 -0
  93. package/dist/types/v1/normalization/__tests__/unidentifiable-type-generator.spec.d.ts +1 -0
  94. package/dist/types/v1/normalization/__tests__/utils.d.ts +3 -0
  95. package/dist/types/v1/normalization/graphql/__tests__/cursor-connection-type-generator.spec.d.ts +1 -0
  96. package/dist/types/v1/normalization/graphql/__tests__/identifiable-type-generator.spec.d.ts +1 -0
  97. package/dist/types/v1/normalization/graphql/__tests__/interface-type-generator.spec.d.ts +1 -0
  98. package/dist/types/v1/normalization/graphql/__tests__/unidentifiable-type-generator.spec.d.ts +1 -0
  99. package/dist/types/v1/normalization/graphql/base-type-generator.d.ts +76 -0
  100. package/dist/types/v1/normalization/graphql/cursor-connection-type-generator.d.ts +17 -0
  101. package/dist/types/v1/normalization/graphql/document-root-type-generator.d.ts +13 -0
  102. package/dist/types/v1/normalization/graphql/identifiable-type-generator.d.ts +13 -0
  103. package/dist/types/v1/normalization/graphql/interface-type-generator.d.ts +10 -0
  104. package/dist/types/v1/normalization/graphql/unidentifiable-type-generator.d.ts +13 -0
  105. package/dist/types/v1/normalization/graphql/union-type-generator.d.ts +10 -0
  106. package/dist/types/v1/normalization/graphql-type-generator.d.ts +47 -0
  107. package/dist/types/v1/normalization/graphql-type-registry-generator.d.ts +59 -0
  108. package/dist/types/v1/normalization/identifiable-type-generator.d.ts +19 -0
  109. package/dist/types/v1/normalization/index.d.ts +28 -0
  110. package/dist/types/v1/normalization/normalize-code-gen/__tests__/normalize-generator-service.spec.d.ts +1 -0
  111. package/dist/types/v1/normalization/normalize-code-gen/__tests__/utils.d.ts +15 -0
  112. package/dist/types/v1/normalization/normalize-code-gen/normalize-generator-service.d.ts +65 -0
  113. package/dist/types/v1/normalization/normalized-type-generator.d.ts +52 -0
  114. package/dist/types/v1/normalization/type-registry-generator.d.ts +68 -0
  115. package/dist/types/v1/normalization/unidentifiable-type-generator.d.ts +17 -0
  116. package/dist/types/v1/normalization/utils.d.ts +23 -0
  117. package/dist/types/v1/types/__tests__/json-schema-declarations.spec.d.ts +1 -0
  118. package/dist/types/v1/types/__tests__/json-schema.spec.d.ts +3 -0
  119. package/dist/types/v1/types/__tests__/normalized-type-definition.spec.d.ts +1 -0
  120. package/dist/types/v1/types/__tests__/resolve-all-of-type.spec.d.ts +1 -0
  121. package/dist/types/v1/types/__tests__/type-definition.spec.d.ts +1 -0
  122. package/dist/types/v1/types/index.d.ts +4 -0
  123. package/dist/types/v1/types/json-schema-declarations.d.ts +29 -0
  124. package/dist/types/v1/types/json-schema.d.ts +15 -0
  125. package/dist/types/v1/types/normalized-type-definition.d.ts +25 -0
  126. package/dist/types/v1/types/resolve-all-of-type.d.ts +16 -0
  127. package/dist/types/v1/types/type-definition.d.ts +35 -0
  128. package/dist/types/v1/utils.d.ts +30 -0
  129. package/dist/v1/index.js +11074 -0
  130. package/dist/v1/index.js.map +1 -0
  131. package/package.json +46 -0
@@ -0,0 +1,88 @@
1
+ import { type Code, type ImportableTypeReference, type NamedFileService } from '../files';
2
+ import type { NamedAPIService } from '@conduit-client/model/v1';
3
+ import type { NamedTypeRegistryGeneratorService } from '../normalization/type-registry-generator';
4
+ import type { NamedJSONSchemaDeclarationService, NamedTypeDefinitionService } from '../types';
5
+ import type { ICommandModel } from '../model/base-command-model';
6
+ export type ICommandGenerator = {
7
+ build(): void;
8
+ };
9
+ /**
10
+ * Abstract base class for generating command files based on a command model and associated services.
11
+ *
12
+ * This class provides a framework for generating files associated with commands, including type definitions,
13
+ * JSON schemas, and class templates. It leverages protected symbols to encapsulate template pieces,
14
+ * facilitating the extension and customization in subclasses.
15
+ *
16
+ * The commandBaseClass abstract property must reference a type only, importable reference that references the base class that the generated command
17
+ * will reference. For example, the HTTP concretion of this class would reference:
18
+ * ```
19
+ * {
20
+ * module: '@conduit-client/command-fetch-network/v1',
21
+ * exportedSymbol: 'FetchNetworkCommand',
22
+ * isType: true,
23
+ * }
24
+ * ```
25
+ * which corresponds to the import: `import {type FetchNetworkCommand} from '@conduit-client/command-fetch-network/v1'`.
26
+ *
27
+ * The class body abstract command provides a hook for concretions to implement whatever contract is required
28
+ * by their base class. By convention, the concrete implementations of `classBody` should delegate to a method for
29
+ * each property & class method that is implemented.
30
+ *
31
+ * None of the other properties are expected to be overridden in subclasses.
32
+ *
33
+ * @abstract
34
+ * @property {ICommandModel} commandModel - The command model that provides metadata and configuration for generating command files.
35
+ * @property {NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService} services - Services required for file generation, type definition, and JSON schema generation.
36
+ */
37
+ export declare abstract class CommandGenerator {
38
+ protected commandModel: ICommandModel;
39
+ protected services: NamedAPIService & NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService & NamedTypeRegistryGeneratorService;
40
+ constructor(commandModel: ICommandModel, services: NamedAPIService & NamedFileService & NamedJSONSchemaDeclarationService & NamedTypeDefinitionService & NamedTypeRegistryGeneratorService);
41
+ protected commandTypeGenericsSymbol: symbol;
42
+ protected commandConfigSchemaSymbol: symbol;
43
+ protected commandConfigTypeSymbol: symbol;
44
+ protected commandClassBodySymbol: symbol;
45
+ protected commandOptionsTypeSymbol: symbol;
46
+ abstract get commandBaseClass(): ImportableTypeReference;
47
+ get classBody(): Code[];
48
+ get commandTypeConstructorArgs(): Code;
49
+ get commandConstructorArgs(): Code;
50
+ get exposeSubscribeAndRefresh(): Code;
51
+ /**
52
+ * Generates the Command type definition.
53
+ * Can be overridden by subclasses to customize the Command type signature.
54
+ */
55
+ protected generateCommandType(): Code;
56
+ /**
57
+ * Generates the constructor for the command class.
58
+ * Can be overridden by subclasses to customize constructor behavior.
59
+ */
60
+ protected generateConstructor(): Code;
61
+ /**
62
+ * Generates the operationType getter for the concrete command class.
63
+ * Subclasses (e.g., GraphQL mixins) can override to emit nothing.
64
+ */
65
+ protected generateOperationType(): Code;
66
+ /**
67
+ * Template for generating the command file content.
68
+ * This getter constructs the full template array incorporating various symbols for later replacement in the build process.
69
+ * @returns {Code[]} An array of code blocks forming the complete command file template.
70
+ */
71
+ get template(): (symbol | Code)[];
72
+ /**
73
+ * Builds the command file by assembling various components into a file structure and saving it.
74
+ * This method orchestrates the generation of necessary types, configurations, and class bodies.
75
+ */
76
+ build(): void;
77
+ protected buildCommandConfigType(): Code;
78
+ protected buildCommandConfigSchema(): Code;
79
+ protected buildCommandOptionsType(): Code;
80
+ protected buildCommandTypeGenerics(): Code;
81
+ protected buildExtraServices(): Code | undefined;
82
+ protected generateAfterRequestHooks(): Code;
83
+ private getInvalidationStatements;
84
+ private generateInvalidationSwitch;
85
+ private generateInvalidationCasesByStatusCode;
86
+ protected buildMappedKeyConfig(operationKey: Record<string, string>): Code;
87
+ private pathToAccessor;
88
+ }
@@ -0,0 +1,69 @@
1
+ import { Code, type NamedFileService } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import { ImperativeAdapterBindingGenerator } from './imperative-binding-generator';
4
+ import { ImperativeAdapterLegacyBindingGenerator } from './imperative-legacy-binding-generator';
5
+ import { GraphQLImperativeAdapterLegacyBindingGenerator } from './graphql-imperative-legacy-binding-generator';
6
+ import { WireAdapterBindingGenerator } from './wire-binding-generator';
7
+ import type { ICommandModel, ServiceDependency } from '../model/base-command-model';
8
+ import type { NamedTypeRegistryGeneratorService, TypeRegistryGenerator } from '../normalization/type-registry-generator';
9
+ import type { NamedGraphQLTypeRegistryGeneratorService } from '../normalization/graphql-type-registry-generator';
10
+ import { Binding, NamedAPIService } from '@conduit-client/model/v1';
11
+ import { GraphQLImperativeAdapterBindingGenerator } from './graphql-imperative-binding-generator';
12
+ import { GraphQLWireAdapterBindingGenerator } from './graphql-wire-binding-generator';
13
+ import { GraphQLMutationAdapterBindingGenerator } from './graphql-mutation-binding-generator';
14
+ export type IBindingsGenerator = {
15
+ build(): void;
16
+ };
17
+ export declare function defaultAdapterBindingsGeneratorFactory(services: NamedTypeDefinitionService, model: ICommandModel, binding: Binding): ImperativeAdapterBindingGenerator | ImperativeAdapterLegacyBindingGenerator | WireAdapterBindingGenerator | GraphQLImperativeAdapterBindingGenerator | GraphQLImperativeAdapterLegacyBindingGenerator | GraphQLWireAdapterBindingGenerator | GraphQLMutationAdapterBindingGenerator;
18
+ /**
19
+ * Class responsible for generating binding files based on command models and service dependencies.
20
+ *
21
+ * The `BindingsGenerator` class orchestrates the creation of files that manage service dependencies,
22
+ * adapters, and invocation logic for a given set of command models. It provides a template for the binding
23
+ * structure and manages the generation and integration of individual adapter bindings.
24
+ *
25
+ * The expectation for new bindings is that new *BindingGenerator classes are used inside of the build method.
26
+ *
27
+ * @property {NamedFileService & NamedTypeDefinitionService} services - Services required for file handling and type definitions.
28
+ * @property {ICommandModel[]} commandModels - Array of command models to generate bindings for.
29
+ */
30
+ export declare class BindingsGenerator {
31
+ protected services: NamedAPIService & NamedFileService & NamedTypeDefinitionService & NamedTypeRegistryGeneratorService & NamedGraphQLTypeRegistryGeneratorService;
32
+ protected commandModels: ICommandModel[];
33
+ protected adapterBindingsGeneratorFactory: typeof defaultAdapterBindingsGeneratorFactory;
34
+ constructor(services: NamedAPIService & NamedFileService & NamedTypeDefinitionService & NamedTypeRegistryGeneratorService & NamedGraphQLTypeRegistryGeneratorService, commandModels: ICommandModel[], adapterBindingsGeneratorFactory?: typeof defaultAdapterBindingsGeneratorFactory);
35
+ protected adapterDeclarationSymbol: symbol;
36
+ protected serviceRequirementsSymbol: symbol;
37
+ protected adapterInvocationSymbol: symbol;
38
+ protected typeRegistryInstantiationSymbol: symbol;
39
+ protected typeInvalidationDeclarationSymbol: symbol;
40
+ protected typeInvalidationDefinitionSymbol: symbol;
41
+ protected rootTypesInstantiationSymbol: symbol;
42
+ /**
43
+ * Template for generating the binding structure in the output file.
44
+ * Includes placeholders for adapter declarations, service requirements, and adapter invocations.
45
+ *
46
+ * Bindings files are structured as:
47
+ * 1. Adapter declarations -> an export of the wire or imperative adapter that is initially undefined, but has proper typescript typing
48
+ * 2. Service requirements -> a declaration of what services this module depends on from the service provisioner
49
+ * 3. Adapter instantiation/invocation -> Creation and population of the declaration with a real adapter implementation, after
50
+ * all the required services have been received.
51
+ *
52
+ * @returns {Code[]} An array of code blocks forming the template for the binding output file.
53
+ */
54
+ get template(): (symbol | Code)[];
55
+ protected get serviceDependencies(): ServiceDependency[];
56
+ /**
57
+ * Builds the binding file, generating declarations, requirements, and invocations for each command model.
58
+ * This method coordinates with individual binding generators to compile the necessary elements into a single file.
59
+ */
60
+ build(): void;
61
+ buildTypeInvalidation(typesWithNormalization: TypeRegistryGenerator['invalidatableTypes']): {
62
+ definitions: Code[];
63
+ declarations: Code[];
64
+ };
65
+ protected buildRequirements(): Code;
66
+ protected get hasRESTNormalization(): boolean;
67
+ protected get hasGraphQL(): boolean;
68
+ protected get hasImperativeBindings(): boolean;
69
+ }
@@ -0,0 +1,2 @@
1
+ import { TypeCacheControlExtension } from '@conduit-client/model/v1';
2
+ export declare function generateCacheControl(cacheControl: TypeCacheControlExtension): import("..").Code;
@@ -0,0 +1,28 @@
1
+ import { type Operation, type Type } from '@conduit-client/model/v1';
2
+ import type { ContentModel } from '../model/base-command-model';
3
+ /**
4
+ * Class for building command configurations based on an operation and its associated parameters.
5
+ * This builder handles the construction of an object type structure that encapsulates various parameters
6
+ * from an operation, including query parameters, headers, URI parameters, and potentially a payload.
7
+ *
8
+ * @property {Operation} operation - The operation object that provides context for the command configuration.
9
+ * @property {{ type: Type; name: string } | undefined} payload - Optional payload definition that specifies the type and name of the main data structure if needed.
10
+ */
11
+ export declare class CommandConfigBuilder {
12
+ protected operation: Operation;
13
+ protected payload?: {
14
+ content: ContentModel;
15
+ parameterName: string;
16
+ } | undefined;
17
+ constructor(operation: Operation, payload?: {
18
+ content: ContentModel;
19
+ parameterName: string;
20
+ } | undefined);
21
+ /**
22
+ * Builds and returns an object type configuration based on the initial operation and the optional payload.
23
+ * This method organizes various request parameters into a structured type definition, suitable for generating type-safe command configurations.
24
+ *
25
+ * @returns {ObjectType} The complete configuration type for the command, encapsulating all necessary parameters and payload definitions.
26
+ */
27
+ build(): Type;
28
+ }
@@ -0,0 +1,23 @@
1
+ import { type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class GraphQLImperativeAdapterBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ protected commandOptionsTypeImport: ImportableReference;
13
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
14
+ buildDeclaration(): import("..").Code;
15
+ get bindingTypeCode(): import("..").Code;
16
+ get localCommandConstructorName(): string;
17
+ get localCommandModel(): ICommandModel;
18
+ get returnShape(): import("..").Code;
19
+ get invoker(): import("..").Code;
20
+ get exposeRefresh(): import("..").Code;
21
+ isSubscribable(): boolean;
22
+ buildInvocation(servicesName?: string): import("..").Code;
23
+ }
@@ -0,0 +1,18 @@
1
+ import { type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class GraphQLImperativeAdapterLegacyBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
13
+ get responseTypeCode(): import("..").Code;
14
+ buildDeclaration(): import("..").Code;
15
+ get localCommandConstructorName(): string;
16
+ get localCommandModel(): ICommandModel;
17
+ buildInvocation(servicesName?: string): import("..").Code;
18
+ }
@@ -0,0 +1,21 @@
1
+ import { type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class GraphQLMutationAdapterBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ protected commandOptionsTypeImport: ImportableReference;
13
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
14
+ buildDeclaration(): import("..").Code;
15
+ get bindingTypeCode(): import("..").Code;
16
+ get localCommandConstructorName(): string;
17
+ get localCommandModel(): ICommandModel;
18
+ get returnShape(): import("..").Code;
19
+ get invoker(): import("..").Code;
20
+ buildInvocation(servicesName?: string): import("..").Code;
21
+ }
@@ -0,0 +1,13 @@
1
+ import { type ImportableTypeReference } from '../files';
2
+ import type { CommandGenerator } from './base-command-generator';
3
+ import type { NormalizedCacheControlGenerator } from './normalized-cache-control-generator-mixin';
4
+ type Constructor = new (...args: any[]) => CommandGenerator & NormalizedCacheControlGenerator;
5
+ /**
6
+ * Mixin that adds GraphQL-specific functionality to command generators.
7
+ * This mixin modifies command generators to work with GraphQL operations by:
8
+ * 1. Using DocumentNode for the query config type instead of string
9
+ * 2. Adding documentRootType parameter to constructor
10
+ * 3. Generating GraphQL-specific methods like buildRequestQuery
11
+ */
12
+ export declare function GraphQLNormalizedCacheControlGeneratorMixin(Base: Constructor, commandBaseClass: ImportableTypeReference): Constructor;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const QUERY_TYPE_VARIABLE_NAME: "queryType";
2
+ export declare const MUTATION_TYPE_VARIABLE_NAME: "mutationType";
@@ -0,0 +1,18 @@
1
+ import { type Code, type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class GraphQLWireAdapterBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
13
+ get responseTypeCode(): Code;
14
+ buildDeclaration(): Code;
15
+ get localCommandConstructorName(): string;
16
+ get localCommandModel(): ICommandModel;
17
+ buildInvocation(servicesName?: string): Code;
18
+ }
@@ -0,0 +1,67 @@
1
+ import { Code } from '../files';
2
+ import { CommandGenerator } from './base-command-generator';
3
+ import type { ImportableTypeReference } from '../files';
4
+ import { type Type } from '@conduit-client/model/v1';
5
+ export declare const MEDIATYPE_APP_JSON = "application/json";
6
+ /**
7
+ * Extends CommandGenerator to provide functionality for generating command files specifically designed for HTTP operations.
8
+ *
9
+ * This class specializes in creating files that include detailed HTTP-specific configurations such as fetch parameters,
10
+ * header construction, query parameters, and error handling, tailored to interact with web APIs using the fetch API.
11
+ *
12
+ * @extends CommandGenerator
13
+ */
14
+ export declare class HttpCommandGenerator extends CommandGenerator {
15
+ commandBaseClass: ImportableTypeReference;
16
+ /**
17
+ * Constructs and returns an array of code blocks that form the body of the HTTP command class.
18
+ * Includes methods for generating fetch parameters and error coercion logic.
19
+ * @returns {Code[]} An array of code snippets that define the command class body for HTTP operations.
20
+ */
21
+ get classBody(): Code[];
22
+ /**
23
+ * Generates a code block for fetch parameters based on the command model's configuration.
24
+ * Constructs a detailed setup for fetch operations including method, headers, body, and cache settings.
25
+ * @returns {Code} A comprehensive code snippet that defines all necessary fetch parameters.
26
+ */
27
+ generateFetchParams(): Code;
28
+ /**
29
+ * Constructs the base URL for the fetch command.
30
+ * @returns {Code} A code snippet that defines the URL to be used in fetch operations.
31
+ */
32
+ generateUrl(): Code;
33
+ /**
34
+ * Generates headers necessary for the HTTP fetch based on the command model's requirements.
35
+ * Handles conditional inclusion of headers based on their defined necessity and request body presence.
36
+ * @returns {object} An object containing the header names and the corresponding code to create them.
37
+ */
38
+ generateHeaders(): Code | undefined;
39
+ /**
40
+ * Constructs a setup for handling query parameters within the URL for the fetch operation.
41
+ * @returns {object} An object containing the parameter names and the corresponding code to handle them.
42
+ */
43
+ generateQueryParameters(): Code | undefined;
44
+ /**
45
+ * Generates a consolidated list of all parameters involved in the fetch operation.
46
+ * @returns {Code} A code block that consolidates all necessary parameters from headers, query, and URI.
47
+ */
48
+ generateAllParams(): Code;
49
+ /**
50
+ * Determines the code snippet for destructuring the input payload based on the configuration schema type.
51
+ * @returns {Code | undefined} A code snippet for the input payload parameter, if applicable.
52
+ */
53
+ generateInputPayloadParameter(): Code | undefined;
54
+ /**
55
+ * Encodes a parameter based on its type.
56
+ * @param {string} name The name of the parameter to encode.
57
+ * @param {Type} type The type descriptor of the parameter.
58
+ * @returns {string | undefined} The encoded parameter value as a string, or undefined if the type is unsupported.
59
+ */
60
+ encodeParam(name: string, type: Type, required: boolean): string | undefined;
61
+ /**
62
+ * Processes the URL with replacements for URI parameters based on their values specified in the command model.
63
+ * @returns {string} The fully constructed URL with all necessary URI parameter substitutions.
64
+ */
65
+ processUrl(): string;
66
+ generateCoerceError(): Code;
67
+ }
@@ -0,0 +1 @@
1
+ export declare const HttpGraphQLNormalizedCacheControlCommandGenerator: new (...args: any[]) => import("./base-command-generator").CommandGenerator & import("./normalized-cache-control-generator-mixin").NormalizedCacheControlGenerator;
@@ -0,0 +1 @@
1
+ export declare const HttpNormalizedCacheControlCommandGenerator: new (...args: any[]) => import("./base-command-generator").CommandGenerator & import("./normalized-cache-control-generator-mixin").NormalizedCacheControlGenerator;
@@ -0,0 +1,24 @@
1
+ import { type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class ImperativeAdapterBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ protected commandOptionsTypeImport: ImportableReference;
13
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
14
+ buildDeclaration(): import("..").Code;
15
+ get bindingTypeCode(): import("..").Code;
16
+ get localCommandConstructorName(): string;
17
+ get localCommandModel(): ICommandModel;
18
+ get returnShape(): import("..").Code;
19
+ get responseTypeCode(): import("..").Code;
20
+ get invoker(): import("..").Code;
21
+ get exposeRefresh(): import("..").Code;
22
+ isSubscribable(): boolean;
23
+ buildInvocation(servicesName?: string): import("..").Code;
24
+ }
@@ -0,0 +1,18 @@
1
+ import { type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class ImperativeAdapterLegacyBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
13
+ get responseTypeCode(): import("..").Code;
14
+ buildDeclaration(): import("..").Code;
15
+ get localCommandConstructorName(): string;
16
+ get localCommandModel(): ICommandModel;
17
+ buildInvocation(servicesName?: string): import("..").Code;
18
+ }
@@ -0,0 +1,9 @@
1
+ export * from './aura-command-generator';
2
+ export * from './aura-resource-cache-control-command-generator';
3
+ export * from './base-command-generator';
4
+ export * from './bindings-generator';
5
+ export * from './command-config-builder';
6
+ export * from './http-command-generator';
7
+ export * from './http-graphql-normalized-cache-control-command-generator';
8
+ export * from './api-family-module-generator';
9
+ export * from './graphql-normalized-cache-control-generator-mixin';
@@ -0,0 +1,15 @@
1
+ import { Code, ImportableTypeReference } from '../files';
2
+ import type { CommandGenerator } from './base-command-generator';
3
+ export interface NormalizedCacheControlGenerator {
4
+ generateCacheControlStrategyConfig(): Code;
5
+ }
6
+ type Constructor = new (...args: any[]) => CommandGenerator;
7
+ type NormalizedCacheControlConstructor = new (...args: any[]) => CommandGenerator & NormalizedCacheControlGenerator;
8
+ /**
9
+ *
10
+ * @param Base The base class to mix in the normalized code generation logic to
11
+ * @param commandBaseClass An importable refernce to the command base class to use in the generated code
12
+ * @returns A new class with the normalized generation behavior mixed in
13
+ */
14
+ export declare function NormalizedCacheControlGeneratorMixin(Base: Constructor, commandBaseClass: ImportableTypeReference): NormalizedCacheControlConstructor;
15
+ export {};
@@ -0,0 +1,17 @@
1
+ import { type Code } from '../files';
2
+ import { ICommandModel } from '../model/base-command-model';
3
+ /**
4
+ * Generates a destructuring assignment code block for a given property name, ensuring that the variable names are valid TypeScript identifiers.
5
+ * This function is particularly useful when dealing with property names that may not directly translate into valid TypeScript variable names,
6
+ * such as names containing special characters.
7
+ *
8
+ * @param propertyName - The original property name to be destructured from an object.
9
+ * @returns An object containing:
10
+ * - `code`: a `Code` type representing the TypeScript code for destructuring the property.
11
+ * - `variableName`: a string that represents the valid TypeScript identifier to which the property value is assigned.
12
+ */
13
+ export declare function buildPropertyDestructureDeclaration(propertyName: string): {
14
+ code: Code;
15
+ variableName: string;
16
+ };
17
+ export declare function buildServiceProjection(model: ICommandModel): string[];
@@ -0,0 +1,19 @@
1
+ import { type Code, type ImportableReference } from '../files';
2
+ import { type NamedTypeDefinitionService } from '../types';
3
+ import type { ICommandModel } from '../model/base-command-model';
4
+ import { Binding } from '@conduit-client/model/v1';
5
+ export declare class WireAdapterBindingGenerator {
6
+ protected services: NamedTypeDefinitionService;
7
+ protected commandModel: ICommandModel;
8
+ protected binding: Binding;
9
+ protected commandConfigTypeImport: ImportableReference;
10
+ protected commandConfigSchemaImport: ImportableReference;
11
+ protected classBuilderImport: ImportableReference;
12
+ constructor(services: NamedTypeDefinitionService, commandModel: ICommandModel, binding: Binding);
13
+ get responseTypeCode(): Code;
14
+ buildDeclaration(): Code;
15
+ get localCommandConstructorName(): string;
16
+ get localCommandModel(): ICommandModel;
17
+ buildInvocation(servicesName?: string): Code;
18
+ getTypeRegistryArgument(): Code;
19
+ }
@@ -0,0 +1,4 @@
1
+ export * from './files';
2
+ export * from './types';
3
+ export * from './normalization';
4
+ export * from './api-module-generator-service';
@@ -0,0 +1,17 @@
1
+ import { GraphQLObjectType, GraphQLInterfaceType, GraphQLEnumType, GraphQLUnionType, GraphQLInputObjectType, GraphQLSchema } from 'graphql';
2
+ export declare const UserType: GraphQLObjectType<any, any>;
3
+ export declare const NestedUserType: GraphQLObjectType<any, any>;
4
+ export declare const EpisodeEnum: GraphQLEnumType;
5
+ export declare const NodeInterface: GraphQLInterfaceType;
6
+ export declare const CharacterInterface: GraphQLInterfaceType;
7
+ export declare const HumanObject: GraphQLObjectType<any, any>;
8
+ export declare const DroidObject: GraphQLObjectType<any, any>;
9
+ export declare const StarshipObject: GraphQLObjectType<any, any>;
10
+ export declare const SearchResultUnion: GraphQLUnionType;
11
+ export declare const SearchResultObject: GraphQLObjectType<any, any>;
12
+ export declare const ReviewInput: GraphQLInputObjectType;
13
+ export declare const ReviewObject: GraphQLObjectType<any, any>;
14
+ export declare const MutationObject: GraphQLObjectType<any, any>;
15
+ export declare const MultipleIdObject: GraphQLObjectType<any, any>;
16
+ export declare const UserConnectionObject: GraphQLObjectType<any, any>;
17
+ export declare const exampleSchema: GraphQLSchema;
@@ -0,0 +1,34 @@
1
+ import { BaseCommandModel, type CommandServiceDependencies } from './base-command-model';
2
+ /**
3
+ * Represents a command model for Aura-specific operations, extending the functionalities of the BaseCommandModel.
4
+ * This class is used to model Aura specific code metadata from the API model.
5
+ */
6
+ export declare class AuraCommandModel extends BaseCommandModel {
7
+ getAllParams(): {
8
+ name: string;
9
+ type: import("@conduit-client/model/v1").ScalarType | ({
10
+ type: "array";
11
+ items: import("@conduit-client/model/v1").Type;
12
+ } & import("@conduit-client/model/v1").BaseType & {
13
+ items?: import("@conduit-client/model/v1").ScalarType;
14
+ });
15
+ required: boolean;
16
+ explode?: boolean;
17
+ }[];
18
+ get networkPreference(): import("@conduit-client/model/v1").NetworkPreference;
19
+ /**
20
+ * Gets the Aura controller and method associated with the operation.
21
+ * @returns {object} An object containing the `controller` and `method` names.
22
+ */
23
+ get aura(): {
24
+ controller: string;
25
+ method: string;
26
+ bodyParam: string | undefined;
27
+ };
28
+ /**
29
+ * Provides the service dependencies required by this AuraCommandModel.
30
+ * Includes information about the base class and inherited services, as well as any extra dependencies.
31
+ * @returns {object} An object detailing the service dependencies for the Aura command.
32
+ */
33
+ get serviceDependencies(): CommandServiceDependencies;
34
+ }
@@ -0,0 +1,10 @@
1
+ import { GraphQLSchemaModel } from './graphql-schema-model';
2
+ import { AuraNormalizedCachingCommandModel } from './aura-normalized-caching-command-model';
3
+ import { AuraGraphQLOperation } from '@conduit-client/model/v1';
4
+ import type { IGraphQLCommandModel } from './graphql-command-model-interface';
5
+ export declare class AuraGraphQLCommandModel extends AuraNormalizedCachingCommandModel implements IGraphQLCommandModel {
6
+ private schemaModel?;
7
+ constructor(operation: AuraGraphQLOperation);
8
+ get serviceDependencies(): import("./base-command-model").CommandServiceDependencies;
9
+ get schema(): GraphQLSchemaModel;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { AuraCommandModel } from './aura-command-model';
2
+ /**
3
+ * Represents a command model specifically designed for handling normalized caching in Aura applications.
4
+ * This model extends `AuraCommandModel` and overrides the service dependencies to include cache control services.
5
+ */
6
+ export declare class AuraNormalizedCachingCommandModel extends AuraCommandModel {
7
+ get serviceDependencies(): import("./base-command-model").CommandServiceDependencies;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { AuraCommandModel } from './aura-command-model';
2
+ /**
3
+ * Represents a command model specifically designed for handling resource caching in Aura applications.
4
+ * This model extends `AuraCommandModel` and overrides the service dependencies to include cache control services.
5
+ */
6
+ export declare class AuraResourceCachingCommandModel extends AuraCommandModel {
7
+ /**
8
+ * Overrides the serviceDependencies getter to customize dependencies for caching.
9
+ * Adds specific dependencies related to cache control, while preserving the base dependencies from `AuraCommandModel`.
10
+ * @returns {CommandServiceDependencies} An object detailing the service dependencies for caching.
11
+ */
12
+ get serviceDependencies(): import("./base-command-model").CommandServiceDependencies;
13
+ }