@fern-api/php-dynamic-snippets 0.0.12 → 0.0.14

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.
@@ -1,4 +1,4 @@
1
- import { AbstractAstNode } from '@fern-api/browser-compatible-base-generator';
1
+ import { Options, AbstractAstNode } from '@fern-api/browser-compatible-base-generator';
2
2
  import { FernIr } from '@fern-api/dynamic-ir-sdk';
3
3
  import { php } from '@fern-api/php-codegen';
4
4
  import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-CwkDTYOI.cjs';
@@ -16,16 +16,29 @@ declare class EndpointSnippetGenerator {
16
16
  endpoint: FernIr.dynamic.Endpoint;
17
17
  request: FernIr.dynamic.EndpointSnippetRequest;
18
18
  }): string;
19
- generateSnippetAst({ endpoint, request }: {
19
+ generateSnippetAst({ endpoint, request, options }: {
20
20
  endpoint: FernIr.dynamic.Endpoint;
21
21
  request: FernIr.dynamic.EndpointSnippetRequest;
22
+ options?: Options;
22
23
  }): Promise<AbstractAstNode>;
23
24
  buildCodeBlock({ endpoint, snippet }: {
24
25
  endpoint: FernIr.dynamic.Endpoint;
25
26
  snippet: FernIr.dynamic.EndpointSnippetRequest;
26
27
  }): php.AstNode;
28
+ buildCodeBlockWithoutClient({ endpoint, snippet }: {
29
+ endpoint: FernIr.dynamic.Endpoint;
30
+ snippet: FernIr.dynamic.EndpointSnippetRequest;
31
+ }): php.AstNode;
27
32
  private constructClient;
28
33
  private callMethod;
34
+ private callMethodOnExistingClient;
35
+ /**
36
+ * Builds request options from snippet headers for per-request options.
37
+ * This is used when generating snippets for existing clients (e.g., wire tests)
38
+ * where headers should be passed as method call options rather than client constructor options.
39
+ * Only includes headers that are NOT already mapped to the request directly (i.e., not defined in the IR).
40
+ */
41
+ private getRequestOptions;
29
42
  private getConstructorArgs;
30
43
  private getConstructorAuthArgs;
31
44
  private addError;