vscode-apollo 2.5.6 → 2.6.0
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/.circleci/config.yml +17 -0
- package/.github/workflows/E2E.yml +3 -2
- package/.github/workflows/build-prs.yml +2 -1
- package/.prettierignore +3 -0
- package/.semgrepignore +2 -0
- package/.vscode/settings.json +7 -2
- package/CHANGELOG.md +6 -0
- package/apollo.connectors.mapping.configuration.json +10 -0
- package/package.json +37 -3
- package/sampleWorkspace/connectors-community/.github/ISSUE_TEMPLATE/connector-bug-report.md +36 -0
- package/sampleWorkspace/connectors-community/.github/ISSUE_TEMPLATE/new-connector.md +10 -0
- package/sampleWorkspace/connectors-community/.github/renovate.json5 +3 -0
- package/sampleWorkspace/connectors-community/.vscode/extensions.json +3 -0
- package/sampleWorkspace/connectors-community/.vscode/settings.json +13 -0
- package/sampleWorkspace/connectors-community/.vscode/tasks.json +10 -0
- package/sampleWorkspace/connectors-community/README.md +108 -0
- package/sampleWorkspace/connectors-community/apollo.config.json +5 -0
- package/sampleWorkspace/connectors-community/connectors/.template/Dockerfile +5 -0
- package/sampleWorkspace/connectors-community/connectors/.template/README +46 -0
- package/sampleWorkspace/connectors-community/connectors/.template/connector.graphql +31 -0
- package/sampleWorkspace/connectors-community/connectors/.template/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/.template/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/README +12 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/albums.graphql +48 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/comments.graphql +54 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/photos.graphql +54 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/posts.graphql +51 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/supergraph.yaml +26 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/todos.graphql +51 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/users.graphql +80 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/README.md +9 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/tmf622-ProductOrdering.graphql +296 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/README.md +7 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/addresses.graphql +30 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/customer.graphql +77 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/products.graphql +70 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/router.yaml +24 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/supergraph.yaml +14 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/swagger.json +69226 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/Dockerfile +5 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/README +61 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/messages.graphql +258 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/README +3 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/connector.graphql +38 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/apple/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/apple/app-store-connect.graphql +100 -0
- package/sampleWorkspace/connectors-community/connectors/apple/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/apple/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/aws/README +125 -0
- package/sampleWorkspace/connectors-community/connectors/aws/dynamodb.graphql +130 -0
- package/sampleWorkspace/connectors-community/connectors/aws/json-responses/product-price.json +10 -0
- package/sampleWorkspace/connectors-community/connectors/aws/json-responses/products.json +53 -0
- package/sampleWorkspace/connectors-community/connectors/aws/lambda.graphql +179 -0
- package/sampleWorkspace/connectors-community/connectors/aws/router.yaml +54 -0
- package/sampleWorkspace/connectors-community/connectors/aws/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/bored/README.md +35 -0
- package/sampleWorkspace/connectors-community/connectors/bored/bored.graphql +87 -0
- package/sampleWorkspace/connectors-community/connectors/bored/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/README.md +23 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/contacts.graphql +141 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/json-responses/members_email_.json +61 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/README.md +58 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/distancematrix.graphql +155 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/places-legacy.graphql +117 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/places.graphql +399 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/supergraph.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/timezone.graphql +64 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/README +105 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/avatars.graphql +79 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/photo-avatars.graphql +454 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/router.yaml +21 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/jira/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/jira/connector.graphql +197 -0
- package/sampleWorkspace/connectors-community/connectors/jira/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/jira/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/museums/README.md +40 -0
- package/sampleWorkspace/connectors-community/connectors/museums/chicagoArt.graphql +150 -0
- package/sampleWorkspace/connectors-community/connectors/museums/met.graphql +119 -0
- package/sampleWorkspace/connectors-community/connectors/museums/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/nws/README.md +45 -0
- package/sampleWorkspace/connectors-community/connectors/nws/alerts.graphql +598 -0
- package/sampleWorkspace/connectors-community/connectors/nws/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/odata/README +18 -0
- package/sampleWorkspace/connectors-community/connectors/odata/connector.graphql +171 -0
- package/sampleWorkspace/connectors-community/connectors/odata/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/odata/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/openai/README.md +61 -0
- package/sampleWorkspace/connectors-community/connectors/openai/assistants.graphql +285 -0
- package/sampleWorkspace/connectors-community/connectors/openai/chat-completions.graphql +169 -0
- package/sampleWorkspace/connectors-community/connectors/openai/models.graphql +47 -0
- package/sampleWorkspace/connectors-community/connectors/openai/router.yaml +24 -0
- package/sampleWorkspace/connectors-community/connectors/openai/supergraph.yaml +14 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/README +45 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/games.graphql +70 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/locations.graphql +127 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/moves.graphql +107 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/pokemon.graphql +539 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/supergraph.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/README.md +75 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/router.yaml +19 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/users.graphql +227 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/README.md +83 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/checkout.graphql +112 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/core-resources.graphql +868 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/payment-methods.graphql +526 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/products.graphql +162 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/router.yaml +26 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/supergraph.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/README.md +80 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/router.yaml +5 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/supabase.graphql +143 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/README +46 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/agencies.graphql +193 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/api-throttle.graphql +33 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/astronauts.graphql +237 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/celestial-bodies.graphql +131 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/docking-events.graphql +3460 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/launches.graphql +1156 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/supergraph.yaml +77 -0
- package/sampleWorkspace/connectors-community/connectors/tint/README +35 -0
- package/sampleWorkspace/connectors-community/connectors/tint/accounts.graphql +69 -0
- package/sampleWorkspace/connectors-community/connectors/tint/router.yaml +21 -0
- package/sampleWorkspace/connectors-community/connectors/tint/social-feeds.graphql +62 -0
- package/sampleWorkspace/connectors-community/connectors/tint/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/todoist/README.md +48 -0
- package/sampleWorkspace/connectors-community/connectors/todoist/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/todoist/todoist.graphql +381 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/README +99 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/connector.graphql +66 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/README.md +44 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/messages.graphql +107 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/router.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/README.md +44 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/earthquakes.graphql +235 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/README.md +44 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/earthquake-simple.graphql +87 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/router.yaml +3 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usps/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/usps/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/usps/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usps/tracking.graphql +118 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/connector.graphql +98 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/file-new/index.js +520 -0
- package/sampleWorkspace/connectors-community/package-lock.json +119 -0
- package/sampleWorkspace/connectors-community/package.json +20 -0
- package/sampleWorkspace/connectors-community/supergraph.yaml +6 -0
- package/sampleWorkspace/sampleWorkspace.code-workspace +29 -8
- package/src/__tests__/fixtures/textmate/test.apollo.connectors.mapping +213 -0
- package/src/__tests__/fixtures/textmate/test.connect.graphql +104 -0
- package/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap +3 -3
- package/syntaxes/build.ts +266 -0
- package/syntaxes/connectors.mapping.json +532 -0
- package/syntaxes/connectors.mapping.yaml +440 -0
- package/syntaxes/graphql.connectors.json +426 -0
- package/syntaxes/graphql.connectors.yaml +254 -0
- package/syntaxes/graphql.json +8 -1
- package/syntaxes/tsconfig.json +6 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Anthropic REST Connector
|
|
2
|
+
|
|
3
|
+
This connector currently covers the [Messages](https://docs.anthropic.com/en/api/messages) in the [Anthropic API](https://docs.anthropic.com/en/api/getting-started).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
To use the connector, you need a [Anthropic API token](https://console.anthropic.com/settings/keys).
|
|
8
|
+
|
|
9
|
+
## Getting started
|
|
10
|
+
|
|
11
|
+
1. If you haven't already, [create a new graph in GraphOS](https://www.apollographql.com/docs/graphos/get-started/guides/rest#step-1-set-up-your-graphql-api). Once you get to the **Set up your local development environment** modal in the [Create a graph](https://www.apollographql.com/docs/graphos/get-started/guides/rest#create-a-graph) section:
|
|
12
|
+
- Copy the `supergraph.yaml` and `router.yaml` files from this folder instead of the `supergraph.yaml` provided by the modal.
|
|
13
|
+
- Instead of downloading the example schema provided by the modal, copy the schema file from this fodler that you want to use.
|
|
14
|
+
1. Grab your Anthropic API key and set it as an environment variable for your terminal:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
export ANTHROPIC_API_KEY=....
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. Run `rover dev` to start the local development session:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
APOLLO_KEY=service:My-Graph-s1ff1u:•••••••••••••••••••••• \
|
|
24
|
+
APOLLO_GRAPH_REF=My-Graph-s1ff1u@main \
|
|
25
|
+
rover dev --supergraph-config supergraph.yaml --router-config router.yaml
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
You’re all set! Open up http://localhost:4000 to query your graph using Apollo Sandbox.
|
|
29
|
+
|
|
30
|
+
### Adding to an existing graph in GraphOS
|
|
31
|
+
|
|
32
|
+
To add these connectors to an existing graph, publish the schema files to your graph ref using `rover subgraph publish`:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
APOLLO_KEY=service:My-Graph-s1ff1u:•••••••••••••••••••••• \
|
|
36
|
+
rover subgraph publish My-Graph-s1ff1u@main --name messages --schema messages.graphql --routing-url http://messages
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Additional Setup for VS Code Task runner
|
|
40
|
+
|
|
41
|
+
Edit your `.vscode/settings.json` to include the following keys:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
{
|
|
45
|
+
"terminal.integrated.profiles.osx": {
|
|
46
|
+
"graphos": {
|
|
47
|
+
"path": "zsh",
|
|
48
|
+
"args": ["-l"],
|
|
49
|
+
"env": {
|
|
50
|
+
"ANTHROPIC_API_KEY": "",
|
|
51
|
+
"APOLLO_KEY": "",
|
|
52
|
+
...
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"terminal.integrated.defaultProfile.osx": "graphos"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Once you've set this up, you can execute the `Tasks: Run Task` command in VS Code to run the `rover dev` task.
|
|
61
|
+
Alternatively, you can open a new terminal window in VS Code with the `graphos` profile, then run `rover dev --supergraph-config supergraph.yaml --router-config router.yaml`.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
extend schema
|
|
2
|
+
@link(
|
|
3
|
+
url: "https://specs.apollo.dev/federation/v2.10"
|
|
4
|
+
import: ["@key", "@requires", "@shareable"]
|
|
5
|
+
)
|
|
6
|
+
@link(
|
|
7
|
+
url: "https://specs.apollo.dev/connect/v0.2"
|
|
8
|
+
import: ["@source", "@connect"]
|
|
9
|
+
)
|
|
10
|
+
@source(
|
|
11
|
+
name: "anthropic"
|
|
12
|
+
http: {
|
|
13
|
+
baseURL: "https://api.anthropic.com/v1/"
|
|
14
|
+
headers: [
|
|
15
|
+
{ name: "x-api-key", value: "{$config.apiKey}" }
|
|
16
|
+
{ name: "anthropic-version", value: "2023-06-01" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
type ContentBlock {
|
|
22
|
+
text: String
|
|
23
|
+
type: String
|
|
24
|
+
id: ID
|
|
25
|
+
name: String
|
|
26
|
+
input: JSON
|
|
27
|
+
}
|
|
28
|
+
enum ContentBlockType {
|
|
29
|
+
TEXT
|
|
30
|
+
TOOL
|
|
31
|
+
}
|
|
32
|
+
type Message {
|
|
33
|
+
id: ID!
|
|
34
|
+
model: String
|
|
35
|
+
content: [ContentBlock]
|
|
36
|
+
role: MessageRole
|
|
37
|
+
stopReason: String
|
|
38
|
+
stopSequence: [String]
|
|
39
|
+
usage: TokenUsage
|
|
40
|
+
metadata: Metadata
|
|
41
|
+
}
|
|
42
|
+
input MessageInput {
|
|
43
|
+
content: String
|
|
44
|
+
role: MessageRole
|
|
45
|
+
}
|
|
46
|
+
enum MessageRole {
|
|
47
|
+
USER
|
|
48
|
+
ASSISTANT
|
|
49
|
+
}
|
|
50
|
+
type Metadata {
|
|
51
|
+
userId: ID
|
|
52
|
+
}
|
|
53
|
+
input MetadataInput {
|
|
54
|
+
userId: ID
|
|
55
|
+
}
|
|
56
|
+
type Model {
|
|
57
|
+
id: ID!
|
|
58
|
+
name: String
|
|
59
|
+
createdAt: String
|
|
60
|
+
}
|
|
61
|
+
type Mutation {
|
|
62
|
+
createMessage(
|
|
63
|
+
messages: [MessageInput]!
|
|
64
|
+
"The model that will complete your prompt."
|
|
65
|
+
model: String = "claude-3-7-sonnet-20250219"
|
|
66
|
+
"The maximum number of tokens to generate before stopping."
|
|
67
|
+
max_tokens: Int = 1024
|
|
68
|
+
options: MessageOptionsInput
|
|
69
|
+
): Message
|
|
70
|
+
@connect(
|
|
71
|
+
#https://docs.anthropic.com/en/api/messages
|
|
72
|
+
source: "anthropic"
|
|
73
|
+
http: {
|
|
74
|
+
POST: "/messages"
|
|
75
|
+
body: """
|
|
76
|
+
model: $args.model
|
|
77
|
+
max_tokens: $args.max_tokens
|
|
78
|
+
messages: $args.messages {
|
|
79
|
+
role: role->match(
|
|
80
|
+
['USER','user'],
|
|
81
|
+
['ASSISTANT','assistant']
|
|
82
|
+
)
|
|
83
|
+
content
|
|
84
|
+
}
|
|
85
|
+
metadata: $args.options.metadata {
|
|
86
|
+
user_id: userId
|
|
87
|
+
}
|
|
88
|
+
stop_sequences: $args.options.stopSequences
|
|
89
|
+
system: $args.options.systemPrompt
|
|
90
|
+
temperature: $args.options.temperature
|
|
91
|
+
thinking: $args.options.thinking {
|
|
92
|
+
type: type->match(
|
|
93
|
+
['DISABLED', 'disabled'],
|
|
94
|
+
['ENABLED', 'enabled']
|
|
95
|
+
)
|
|
96
|
+
budget_tokens: budgetTokens
|
|
97
|
+
}
|
|
98
|
+
tool_choice: $args.options.toolChoice {
|
|
99
|
+
type: type->match(
|
|
100
|
+
['NONE', 'none'],
|
|
101
|
+
['TOOL', 'tool'],
|
|
102
|
+
['ANY', 'any'],
|
|
103
|
+
['AUTO', 'auto']
|
|
104
|
+
)
|
|
105
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
106
|
+
name
|
|
107
|
+
}
|
|
108
|
+
tools: $args.options.tools {
|
|
109
|
+
name
|
|
110
|
+
description
|
|
111
|
+
input_schema: inputSchema
|
|
112
|
+
}
|
|
113
|
+
"""
|
|
114
|
+
}
|
|
115
|
+
selection: """
|
|
116
|
+
id
|
|
117
|
+
model
|
|
118
|
+
role: role->match(
|
|
119
|
+
['user','USER'],
|
|
120
|
+
['assistant','ASSISTANT']
|
|
121
|
+
)
|
|
122
|
+
content {
|
|
123
|
+
type: type->match(
|
|
124
|
+
['text','TEXT'],
|
|
125
|
+
['tool','TOOL']
|
|
126
|
+
)
|
|
127
|
+
text
|
|
128
|
+
id
|
|
129
|
+
name
|
|
130
|
+
input
|
|
131
|
+
}
|
|
132
|
+
stopReason: stop_reason
|
|
133
|
+
stopSequence: stop_sequence
|
|
134
|
+
usage {
|
|
135
|
+
inputTokens: input_tokens
|
|
136
|
+
outputTokens: output_tokens
|
|
137
|
+
cacheReadInputTokens: cache_read_input_tokens
|
|
138
|
+
cacheCreationInputTokens: cache_creation_input_tokens
|
|
139
|
+
}
|
|
140
|
+
metadata {
|
|
141
|
+
userId: user_id
|
|
142
|
+
}
|
|
143
|
+
"""
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
input MessageOptionsInput {
|
|
147
|
+
"An object describing metadata about the request."
|
|
148
|
+
metadata: MetadataInput
|
|
149
|
+
"""
|
|
150
|
+
If you want the model to stop generating when it encounters custom strings of text, you can use the stop_sequences parameter. If the model encounters one of the custom sequences, the response stop_reason value will be "stop_sequence" and the response stop_sequence value will contain the matched stop sequence.
|
|
151
|
+
"""
|
|
152
|
+
stopSequences: [String]
|
|
153
|
+
"A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role."
|
|
154
|
+
systemPrompt: String
|
|
155
|
+
"Amount of randomness injected into the response. Ranges from 0.0 to 1.0."
|
|
156
|
+
temperature: Float = 1.0
|
|
157
|
+
"""
|
|
158
|
+
Configuration for enabling Claude's extended thinking.
|
|
159
|
+
|
|
160
|
+
When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your max_tokens limit.
|
|
161
|
+
"""
|
|
162
|
+
thinking: ThinkingInput
|
|
163
|
+
"How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all."
|
|
164
|
+
toolChoice: ToolChoiceInput
|
|
165
|
+
"Definitions of tools that the model may use."
|
|
166
|
+
tools: [ToolInput]
|
|
167
|
+
"Only sample from the top K options for each subsequent token. Recommended for advanced use cases only. You usually only need to use temperature."
|
|
168
|
+
topK: Float
|
|
169
|
+
"""
|
|
170
|
+
Use nucleus sampling.
|
|
171
|
+
In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by top_p. You should either alter temperature or top_p, but not both.
|
|
172
|
+
|
|
173
|
+
Recommended for advanced use cases only. You usually only need to use temperature. Required range: 0 < x < 1.
|
|
174
|
+
"""
|
|
175
|
+
topP: Float
|
|
176
|
+
}
|
|
177
|
+
type Query {
|
|
178
|
+
countTokens(
|
|
179
|
+
messages: [MessageInput]!
|
|
180
|
+
model: String = "claude-3-7-sonnet-20250219"
|
|
181
|
+
): Int
|
|
182
|
+
@connect(
|
|
183
|
+
#https://docs.anthropic.com/en/api/messages-count-tokens
|
|
184
|
+
source: "anthropic"
|
|
185
|
+
http: {
|
|
186
|
+
POST: "/messages/count_tokens"
|
|
187
|
+
body: """
|
|
188
|
+
model: $args.model
|
|
189
|
+
messages: $args.messages {
|
|
190
|
+
role: role->match(
|
|
191
|
+
['USER','user'],
|
|
192
|
+
['ASSISTANT','assistant']
|
|
193
|
+
)
|
|
194
|
+
content
|
|
195
|
+
}
|
|
196
|
+
"""
|
|
197
|
+
}
|
|
198
|
+
selection: """
|
|
199
|
+
$.input_tokens
|
|
200
|
+
"""
|
|
201
|
+
)
|
|
202
|
+
model(id: String!): Model
|
|
203
|
+
@connect(
|
|
204
|
+
#https://docs.anthropic.com/en/api/models
|
|
205
|
+
source: "anthropic"
|
|
206
|
+
http: { GET: "/models/$args.id" }
|
|
207
|
+
selection: """
|
|
208
|
+
id
|
|
209
|
+
name
|
|
210
|
+
createdAt: created_at
|
|
211
|
+
"""
|
|
212
|
+
)
|
|
213
|
+
models: [Model]
|
|
214
|
+
@connect(
|
|
215
|
+
#https://docs.anthropic.com/en/api/models-list
|
|
216
|
+
source: "anthropic"
|
|
217
|
+
http: { GET: "/models" }
|
|
218
|
+
selection: """
|
|
219
|
+
id
|
|
220
|
+
name
|
|
221
|
+
createdAt: created_at
|
|
222
|
+
"""
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
input ThinkingInput {
|
|
226
|
+
type: ThinkingType = DISABLED
|
|
227
|
+
"Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than max_tokens"
|
|
228
|
+
budgetTokens: Int = 1024
|
|
229
|
+
}
|
|
230
|
+
type TokenUsage @shareable {
|
|
231
|
+
inputTokens: Int
|
|
232
|
+
cacheReadInputTokens: Int
|
|
233
|
+
cacheCreationInputTokens: Int
|
|
234
|
+
outputTokens: Int
|
|
235
|
+
}
|
|
236
|
+
enum ThinkingType {
|
|
237
|
+
DISABLED
|
|
238
|
+
ENABLED
|
|
239
|
+
}
|
|
240
|
+
input ToolChoiceInput {
|
|
241
|
+
type: ToolChoiceType = NONE
|
|
242
|
+
"Whether to disable parallel tool use."
|
|
243
|
+
disableParallelToolUse: Boolean = false
|
|
244
|
+
"The name of the tool to use."
|
|
245
|
+
name: String
|
|
246
|
+
}
|
|
247
|
+
enum ToolChoiceType {
|
|
248
|
+
NONE
|
|
249
|
+
TOOL
|
|
250
|
+
ANY
|
|
251
|
+
AUTO
|
|
252
|
+
}
|
|
253
|
+
input ToolInput {
|
|
254
|
+
name: String
|
|
255
|
+
description: String
|
|
256
|
+
inputSchema: JSON
|
|
257
|
+
}
|
|
258
|
+
scalar JSON
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
supergraph:
|
|
2
|
+
listen: 0.0.0.0:${env.PORT:-4000}
|
|
3
|
+
|
|
4
|
+
headers:
|
|
5
|
+
all:
|
|
6
|
+
request:
|
|
7
|
+
- propagate:
|
|
8
|
+
matching: .*
|
|
9
|
+
telemetry:
|
|
10
|
+
instrumentation:
|
|
11
|
+
spans:
|
|
12
|
+
mode: spec_compliant
|
|
13
|
+
|
|
14
|
+
connectors:
|
|
15
|
+
sources:
|
|
16
|
+
messages.anthropic:
|
|
17
|
+
$config:
|
|
18
|
+
apiKey: ${env.ANTHROPOIC_API_KEY}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# These are the necessary federation and connector directives you will be using
|
|
3
|
+
extend schema
|
|
4
|
+
@link(
|
|
5
|
+
url: "https://specs.apollo.dev/federation/v2.10"
|
|
6
|
+
import: ["@key"]
|
|
7
|
+
)
|
|
8
|
+
@link(
|
|
9
|
+
url: "https://specs.apollo.dev/connect/v0.2"
|
|
10
|
+
import: ["@connect", "@source"]
|
|
11
|
+
)
|
|
12
|
+
# A @source directive defines a shared data source for multiple connectors.
|
|
13
|
+
@source(
|
|
14
|
+
name: "ecomm"
|
|
15
|
+
http: { baseURL: "https://ecommerce.demo-api.apollo.dev/" }
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
type Product {
|
|
19
|
+
id: ID!
|
|
20
|
+
name: String
|
|
21
|
+
description: String
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type Query {
|
|
25
|
+
products: [Product]
|
|
26
|
+
# A @connect directive defines the API data source of a GraphQL schema field.
|
|
27
|
+
@connect(
|
|
28
|
+
source: "ecomm"
|
|
29
|
+
http: { GET: "/products" }
|
|
30
|
+
selection: """
|
|
31
|
+
$.products {
|
|
32
|
+
id
|
|
33
|
+
name
|
|
34
|
+
description
|
|
35
|
+
}
|
|
36
|
+
"""
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
supergraph:
|
|
2
|
+
listen: 0.0.0.0:${env.PORT:-4000}
|
|
3
|
+
|
|
4
|
+
headers:
|
|
5
|
+
all:
|
|
6
|
+
request:
|
|
7
|
+
- propagate:
|
|
8
|
+
matching: .*
|
|
9
|
+
telemetry:
|
|
10
|
+
instrumentation:
|
|
11
|
+
spans:
|
|
12
|
+
mode: spec_compliant
|
|
13
|
+
|
|
14
|
+
# connectors:
|
|
15
|
+
# subgraphs:
|
|
16
|
+
# connector:
|
|
17
|
+
# $config:
|
|
18
|
+
# apiKey: ${env.API_KEY}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Apple App Store Connect API REST Connector
|
|
2
|
+
|
|
3
|
+
This connector currently covers the App object with builds and price points in the App Store Connect API. To use this, you'll need to add a `API_KEY` in your environment variables then running `rover` or the `router` with the config files in this folder.
|
|
4
|
+
|
|
5
|
+
## Additional Setup for VS Code Task runner
|
|
6
|
+
|
|
7
|
+
Edit your `.vscode/settings.json` to include the Strapi specific keys
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
{
|
|
11
|
+
"terminal.integrated.profiles.osx": {
|
|
12
|
+
"graphos": {
|
|
13
|
+
"path": "zsh",
|
|
14
|
+
"args": ["-l"],
|
|
15
|
+
"env": {
|
|
16
|
+
"API_KEY": "",
|
|
17
|
+
"APOLLO_KEY": "",
|
|
18
|
+
...
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"terminal.integrated.defaultProfile.osx": "graphos"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Then you can execute the "Tasks: Run Task" command in VS code to execute the `rover dev` task or simply open a new terminal window in vscode with the `graphos` profile, then you can simply run `rover dev --supergraph-config supergraph.yaml --router-config router.yaml`.
|
|
28
|
+
|
|
29
|
+
## Contributing
|
|
30
|
+
|
|
31
|
+
The following schema modules need to be:
|
|
32
|
+
|
|
33
|
+
1. A schema designed for that portion of the rest API as a new `.graphql` file
|
|
34
|
+
2. Additions to the `router.yaml` and `supergraph.yaml` files
|
|
35
|
+
|
|
36
|
+
There are various modules that can be implemented and can be found in the [documentation navigation](https://developer.apple.com/documentation/) bar
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
extend schema
|
|
2
|
+
@link(
|
|
3
|
+
url: "https://specs.apollo.dev/federation/v2.10"
|
|
4
|
+
import: ["@key", "@requires"]
|
|
5
|
+
)
|
|
6
|
+
@link(
|
|
7
|
+
url: "https://specs.apollo.dev/connect/v0.2"
|
|
8
|
+
import: ["@source", "@connect"]
|
|
9
|
+
)
|
|
10
|
+
@source(
|
|
11
|
+
name: "connect-api"
|
|
12
|
+
http: {
|
|
13
|
+
# https://developer.apple.com/documentation/appstoreconnectapi
|
|
14
|
+
# https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip
|
|
15
|
+
baseURL: "https://api.appstoreconnect.apple.com/v1"
|
|
16
|
+
headers: [{ name: "Authorization", value: "Bearer {$config.apiKey}" }]
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
type App {
|
|
21
|
+
id: ID!
|
|
22
|
+
name: String
|
|
23
|
+
bundleId: String
|
|
24
|
+
sku: String
|
|
25
|
+
builds: [Build]
|
|
26
|
+
@connect(
|
|
27
|
+
source: "connect-api"
|
|
28
|
+
http: { GET: "/apps/{$this.id}/builds" }
|
|
29
|
+
selection: """
|
|
30
|
+
$.data {
|
|
31
|
+
id
|
|
32
|
+
$.attributes {
|
|
33
|
+
version
|
|
34
|
+
expired
|
|
35
|
+
minOsVersion
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
"""
|
|
39
|
+
)
|
|
40
|
+
pricePoints: [AppPricePoint]
|
|
41
|
+
@connect(
|
|
42
|
+
source: "connect-api"
|
|
43
|
+
http: { GET: "/apps/{$this.id}/appPricePoints" }
|
|
44
|
+
selection: """
|
|
45
|
+
$.data {
|
|
46
|
+
id
|
|
47
|
+
$.attributes {
|
|
48
|
+
customerPrice
|
|
49
|
+
proceeds
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
"""
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type AppPricePoint {
|
|
57
|
+
id: ID!
|
|
58
|
+
customerPrice: String
|
|
59
|
+
proceeds: String
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type Build {
|
|
63
|
+
id: ID!
|
|
64
|
+
expired: Boolean
|
|
65
|
+
version: String
|
|
66
|
+
minOsVersion: String
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type Query {
|
|
70
|
+
apps: [App]
|
|
71
|
+
@connect(
|
|
72
|
+
source: "connect-api"
|
|
73
|
+
http: { GET: "/apps" }
|
|
74
|
+
selection: """
|
|
75
|
+
$.data {
|
|
76
|
+
id
|
|
77
|
+
$.attributes {
|
|
78
|
+
name
|
|
79
|
+
bundleId
|
|
80
|
+
sku
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
"""
|
|
84
|
+
)
|
|
85
|
+
app(id: ID!): App
|
|
86
|
+
@connect(
|
|
87
|
+
source: "connect-api"
|
|
88
|
+
http: { GET: "/apps/{$args.id}" }
|
|
89
|
+
selection: """
|
|
90
|
+
$.data {
|
|
91
|
+
id
|
|
92
|
+
$.attributes {
|
|
93
|
+
name
|
|
94
|
+
bundleId
|
|
95
|
+
sku
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
"""
|
|
99
|
+
)
|
|
100
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
supergraph:
|
|
2
|
+
listen: 0.0.0.0:${env.PORT:-4000}
|
|
3
|
+
|
|
4
|
+
headers:
|
|
5
|
+
all:
|
|
6
|
+
request:
|
|
7
|
+
- propagate:
|
|
8
|
+
matching: .*
|
|
9
|
+
telemetry:
|
|
10
|
+
instrumentation:
|
|
11
|
+
spans:
|
|
12
|
+
mode: spec_compliant
|
|
13
|
+
|
|
14
|
+
connectors:
|
|
15
|
+
subgraphs:
|
|
16
|
+
app-store-connect:
|
|
17
|
+
$config:
|
|
18
|
+
apiKey: ${env.API_KEY}
|