@every-app/sdk 0.3.0-rc.1 → 0.3.0-rc.10
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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/cloudflare/catalogSettings.generated.d.ts +81 -0
- package/dist/cloudflare/catalogSettings.generated.d.ts.map +1 -0
- package/dist/cloudflare/catalogSettings.generated.js +174 -0
- package/dist/cloudflare/index.d.ts +3 -2
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +4 -1
- package/dist/cloudflare/sentinel.d.ts +60 -2
- package/dist/cloudflare/sentinel.d.ts.map +1 -1
- package/dist/cloudflare/sentinel.js +37 -2
- package/dist/cloudflare/worker.d.ts +357 -63
- package/dist/cloudflare/worker.d.ts.map +1 -1
- package/dist/cloudflare/worker.js +363 -104
- package/dist/dev/index.d.ts +1 -1
- package/dist/dev/index.d.ts.map +1 -1
- package/dist/dev/index.js +1 -1
- package/dist/dev/keypair.d.ts +2 -0
- package/dist/dev/keypair.d.ts.map +1 -1
- package/dist/dev/keypair.js +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/internal/aiDefault.d.ts +204 -0
- package/dist/internal/aiDefault.d.ts.map +1 -0
- package/dist/internal/aiDefault.js +334 -0
- package/dist/internal/aiProviders.d.ts +7 -2
- package/dist/internal/aiProviders.d.ts.map +1 -1
- package/dist/internal/aiProviders.js +17 -4
- package/dist/internal/appSettings.d.ts +82 -4
- package/dist/internal/appSettings.d.ts.map +1 -1
- package/dist/internal/appSettings.js +204 -29
- package/dist/internal/audit.d.ts +108 -0
- package/dist/internal/audit.d.ts.map +1 -0
- package/dist/internal/audit.js +235 -0
- package/dist/internal/capabilities.d.ts +2268 -438
- package/dist/internal/capabilities.d.ts.map +1 -1
- package/dist/internal/capabilities.js +128 -539
- package/dist/internal/catalog/commerce.d.ts +394 -0
- package/dist/internal/catalog/commerce.d.ts.map +1 -0
- package/dist/internal/catalog/commerce.js +477 -0
- package/dist/internal/catalog/comms.d.ts +375 -0
- package/dist/internal/catalog/comms.d.ts.map +1 -0
- package/dist/internal/catalog/comms.js +520 -0
- package/dist/internal/catalog/index.d.ts +1973 -0
- package/dist/internal/catalog/index.d.ts.map +1 -0
- package/dist/internal/catalog/index.js +19 -0
- package/dist/internal/catalog/inference.d.ts +393 -0
- package/dist/internal/catalog/inference.d.ts.map +1 -0
- package/dist/internal/catalog/inference.js +460 -0
- package/dist/internal/catalog/infra.d.ts +423 -0
- package/dist/internal/catalog/infra.d.ts.map +1 -0
- package/dist/internal/catalog/infra.js +543 -0
- package/dist/internal/catalog/search.d.ts +400 -0
- package/dist/internal/catalog/search.d.ts.map +1 -0
- package/dist/internal/catalog/search.js +463 -0
- package/dist/internal/devProviders.d.ts +2 -2
- package/dist/internal/devProviders.d.ts.map +1 -1
- package/dist/internal/devProviders.js +19 -1
- package/dist/internal/events.d.ts +13 -2
- package/dist/internal/events.d.ts.map +1 -1
- package/dist/internal/events.js +47 -4
- package/dist/internal/gatewaySettings.d.ts +3 -2
- package/dist/internal/gatewaySettings.d.ts.map +1 -1
- package/dist/internal/gatewaySettings.js +12 -6
- package/dist/internal/identity.d.ts +41 -4
- package/dist/internal/identity.d.ts.map +1 -1
- package/dist/internal/identity.js +48 -10
- package/dist/internal/index.d.ts +6 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +6 -1
- package/dist/internal/members.d.ts +3 -2
- package/dist/internal/members.d.ts.map +1 -1
- package/dist/internal/oauthClient.d.ts +10 -12
- package/dist/internal/oauthClient.d.ts.map +1 -1
- package/dist/internal/oauthClient.js +20 -81
- package/dist/internal/oauthPresets.d.ts +33 -0
- package/dist/internal/oauthPresets.d.ts.map +1 -0
- package/dist/internal/oauthPresets.js +1064 -0
- package/dist/internal/oauthScopes.d.ts +56 -1
- package/dist/internal/oauthScopes.d.ts.map +1 -1
- package/dist/internal/oauthScopes.js +98 -4
- package/dist/internal/oauthSpec.d.ts +102 -0
- package/dist/internal/oauthSpec.d.ts.map +1 -0
- package/dist/internal/oauthSpec.js +789 -0
- package/dist/internal/protocol.d.ts +64 -1
- package/dist/internal/protocol.d.ts.map +1 -1
- package/dist/internal/protocol.js +51 -1
- package/dist/internal/providerRegistry.d.ts +77 -6
- package/dist/internal/providerRegistry.d.ts.map +1 -1
- package/dist/internal/providerRegistry.js +178 -8
- package/dist/internal/providerSpec.d.ts +18 -7
- package/dist/internal/providerSpec.d.ts.map +1 -1
- package/dist/internal/providerSpec.js +442 -34
- package/dist/internal/signInProviders.d.ts +104 -0
- package/dist/internal/signInProviders.d.ts.map +1 -0
- package/dist/internal/signInProviders.js +245 -0
- package/dist/manifest.d.ts +238 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +30 -0
- package/dist/server/ai.d.ts +111 -0
- package/dist/server/ai.d.ts.map +1 -0
- package/dist/server/ai.js +145 -0
- package/dist/server/aiBinding.d.ts +68 -0
- package/dist/server/aiBinding.d.ts.map +1 -0
- package/dist/server/aiBinding.js +294 -0
- package/dist/server/attribution.d.ts +9 -5
- package/dist/server/attribution.d.ts.map +1 -1
- package/dist/server/attribution.js +12 -4
- package/dist/server/authorizeUrl.d.ts +1 -1
- package/dist/server/authorizeUrl.d.ts.map +1 -1
- package/dist/server/authorizeUrl.js +2 -6
- package/dist/server/connectUrl.d.ts +21 -0
- package/dist/server/connectUrl.d.ts.map +1 -0
- package/dist/server/connectUrl.js +37 -0
- package/dist/server/context.d.ts +68 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +117 -0
- package/dist/server/emailBinding.d.ts +72 -0
- package/dist/server/emailBinding.d.ts.map +1 -0
- package/dist/server/emailBinding.js +124 -0
- package/dist/server/emit.d.ts +1 -1
- package/dist/server/emit.d.ts.map +1 -1
- package/dist/server/emit.js +7 -7
- package/dist/server/env.d.ts +44 -0
- package/dist/server/env.d.ts.map +1 -0
- package/dist/server/env.js +1 -0
- package/dist/server/everyApp.d.ts +27 -7
- package/dist/server/everyApp.d.ts.map +1 -1
- package/dist/server/everyApp.js +106 -5
- package/dist/server/fromMcpTools.d.ts +89 -0
- package/dist/server/fromMcpTools.d.ts.map +1 -0
- package/dist/server/fromMcpTools.js +192 -0
- package/dist/server/gatewayFetch.d.ts +42 -18
- package/dist/server/gatewayFetch.d.ts.map +1 -1
- package/dist/server/gatewayFetch.js +138 -19
- package/dist/server/gatewayUrl.d.ts +13 -0
- package/dist/server/gatewayUrl.d.ts.map +1 -0
- package/dist/server/gatewayUrl.js +34 -0
- package/dist/server/index.d.ts +15 -4
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +12 -2
- package/dist/server/integrationFetch.d.ts +70 -39
- package/dist/server/integrationFetch.d.ts.map +1 -1
- package/dist/server/integrationFetch.js +244 -82
- package/dist/server/listMembers.d.ts +1 -1
- package/dist/server/listMembers.d.ts.map +1 -1
- package/dist/server/listMembers.js +8 -11
- package/dist/server/refusal.d.ts +55 -0
- package/dist/server/refusal.d.ts.map +1 -0
- package/dist/server/refusal.js +193 -0
- package/dist/server/sendEmail.d.ts +1 -1
- package/dist/server/sendEmail.d.ts.map +1 -1
- package/dist/server/sendEmail.js +7 -7
- package/dist/server/toolsEndpoint.d.ts.map +1 -1
- package/dist/server/toolsEndpoint.js +11 -5
- package/dist/tanstack-start/index.d.ts +9 -0
- package/dist/tanstack-start/index.d.ts.map +1 -0
- package/dist/tanstack-start/index.js +29 -0
- package/dist/testing/index.d.ts +93 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +156 -0
- package/package.json +35 -14
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Every App, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @every-app/sdk
|
|
2
2
|
|
|
3
|
-
The embedded SDK for building apps on the
|
|
3
|
+
The embedded SDK for building apps on the EveryApp platform.
|
|
4
4
|
|
|
5
5
|
It verifies the identity the Gateway injects, defines the app's Worker and its agent tools, and reaches the Gateway's AI, email and integrations. There is no client-side export.
|
|
6
6
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Gateway settings holding the keys of the AI providers and
|
|
3
|
+
* capabilities an app may ask for, with the settings a provider needs
|
|
4
|
+
* besides its key (Workers AI's account, a Basic username held as a
|
|
5
|
+
* setting, a host setting), by manifest id. With no Gateway in
|
|
6
|
+
* development, the SDK reaches them with the developer's own values under
|
|
7
|
+
* the same names, and `everyAppWorker()` declares the ones set locally.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEV_GATEWAY_KEYS: {
|
|
10
|
+
readonly providers: {
|
|
11
|
+
readonly openai: readonly ["OPENAI_API_KEY"];
|
|
12
|
+
readonly openrouter: readonly ["OPENROUTER_API_KEY"];
|
|
13
|
+
readonly "workers-ai": readonly ["WORKERS_AI_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"];
|
|
14
|
+
readonly anthropic: readonly ["ANTHROPIC_API_KEY"];
|
|
15
|
+
readonly gemini: readonly ["GEMINI_API_KEY"];
|
|
16
|
+
readonly mistral: readonly ["MISTRAL_API_KEY"];
|
|
17
|
+
readonly groq: readonly ["GROQ_API_KEY"];
|
|
18
|
+
readonly cohere: readonly ["COHERE_API_KEY"];
|
|
19
|
+
};
|
|
20
|
+
readonly capabilities: {
|
|
21
|
+
readonly dataforseo: readonly ["DATAFORSEO_API_KEY"];
|
|
22
|
+
readonly context: readonly ["CONTEXT_API_KEY"];
|
|
23
|
+
readonly email: readonly ["EMAIL_FROM", "EMAIL_FROM_NAME", "EMAIL_REST_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID", "RESEND_API_KEY", "EMAIL_PROVIDER"];
|
|
24
|
+
readonly members: readonly [];
|
|
25
|
+
readonly slack: readonly ["SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET"];
|
|
26
|
+
readonly "google-workspace": readonly ["GOOGLE_WORKSPACE_CLIENT_ID", "GOOGLE_WORKSPACE_CLIENT_SECRET"];
|
|
27
|
+
readonly "microsoft-365": readonly ["MICROSOFT_365_CLIENT_ID", "MICROSOFT_365_CLIENT_SECRET"];
|
|
28
|
+
readonly stripe: readonly ["STRIPE_API_KEY"];
|
|
29
|
+
readonly lemonsqueezy: readonly ["LEMONSQUEEZY_API_KEY"];
|
|
30
|
+
readonly paddle: readonly ["PADDLE_API_KEY"];
|
|
31
|
+
readonly shopify: readonly ["SHOPIFY_API_TOKEN", "SHOPIFY_HOST"];
|
|
32
|
+
readonly plaid: readonly ["PLAID_SECRET"];
|
|
33
|
+
readonly attio: readonly ["ATTIO_API_KEY"];
|
|
34
|
+
readonly hubspot: readonly ["HUBSPOT_API_TOKEN"];
|
|
35
|
+
readonly pipedrive: readonly ["PIPEDRIVE_API_TOKEN"];
|
|
36
|
+
readonly airtable: readonly ["AIRTABLE_API_TOKEN"];
|
|
37
|
+
readonly notion: readonly ["NOTION_API_TOKEN"];
|
|
38
|
+
readonly postmark: readonly ["POSTMARK_API_TOKEN"];
|
|
39
|
+
readonly sendgrid: readonly ["SENDGRID_API_KEY"];
|
|
40
|
+
readonly twilio: readonly ["TWILIO_API_SECRET", "TWILIO_API_KEY"];
|
|
41
|
+
readonly intercom: readonly ["INTERCOM_API_TOKEN"];
|
|
42
|
+
readonly crisp: readonly ["CRISP_API_KEY", "CRISP_API_IDENTIFIER"];
|
|
43
|
+
readonly granola: readonly ["GRANOLA_API_KEY"];
|
|
44
|
+
readonly linear: readonly ["LINEAR_API_KEY"];
|
|
45
|
+
readonly github: readonly ["GITHUB_API_TOKEN"];
|
|
46
|
+
readonly gitlab: readonly ["GITLAB_API_TOKEN"];
|
|
47
|
+
readonly vercel: readonly ["VERCEL_API_TOKEN"];
|
|
48
|
+
readonly cloudflare: readonly ["CLOUDFLARE_PROVIDER_API_TOKEN"];
|
|
49
|
+
readonly posthog: readonly ["POSTHOG_PERSONAL_API_KEY"];
|
|
50
|
+
readonly mixpanel: readonly ["MIXPANEL_SERVICE_ACCOUNT_SECRET", "MIXPANEL_SERVICE_ACCOUNT_USERNAME"];
|
|
51
|
+
readonly segment: readonly ["SEGMENT_WRITE_KEY"];
|
|
52
|
+
readonly supabase: readonly ["SUPABASE_SECRET_KEY", "SUPABASE_HOST"];
|
|
53
|
+
readonly turso: readonly ["TURSO_API_TOKEN"];
|
|
54
|
+
readonly "turso-db": readonly ["TURSO_DB_AUTH_TOKEN", "TURSO_DB_HOST"];
|
|
55
|
+
readonly neon: readonly ["NEON_API_KEY"];
|
|
56
|
+
readonly pinecone: readonly ["PINECONE_API_KEY", "PINECONE_HOST"];
|
|
57
|
+
readonly mapbox: readonly ["MAPBOX_ACCESS_TOKEN"];
|
|
58
|
+
readonly openweather: readonly ["OPENWEATHER_API_KEY"];
|
|
59
|
+
readonly voyage: readonly ["VOYAGE_API_KEY"];
|
|
60
|
+
readonly perplexity: readonly ["PERPLEXITY_API_KEY"];
|
|
61
|
+
readonly jina: readonly ["JINA_API_KEY"];
|
|
62
|
+
readonly replicate: readonly ["REPLICATE_API_TOKEN"];
|
|
63
|
+
readonly huggingface: readonly ["HUGGINGFACE_API_TOKEN"];
|
|
64
|
+
readonly firecrawl: readonly ["FIRECRAWL_API_KEY"];
|
|
65
|
+
readonly exa: readonly ["EXA_API_KEY"];
|
|
66
|
+
readonly tavily: readonly ["TAVILY_API_KEY"];
|
|
67
|
+
readonly serper: readonly ["SERPER_API_KEY"];
|
|
68
|
+
readonly "brave-search": readonly ["BRAVE_SEARCH_API_KEY"];
|
|
69
|
+
readonly apify: readonly ["APIFY_API_TOKEN"];
|
|
70
|
+
readonly deepgram: readonly ["DEEPGRAM_API_KEY"];
|
|
71
|
+
readonly elevenlabs: readonly ["ELEVENLABS_API_KEY"];
|
|
72
|
+
readonly assemblyai: readonly ["ASSEMBLYAI_API_KEY"];
|
|
73
|
+
readonly newsapi: readonly ["NEWSAPI_API_KEY"];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Every setting a catalog entry reads, in catalog order, each once: what
|
|
78
|
+
* the Gateway's cloudflare.config.ts declares for local dev.
|
|
79
|
+
*/
|
|
80
|
+
export declare const CATALOG_GATEWAY_SETTINGS: readonly ["OPENAI_API_KEY", "OPENROUTER_API_KEY", "WORKERS_AI_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID", "AI_GATEWAY_API_KEY", "AI_GATEWAY_ID", "DATAFORSEO_API_KEY", "CONTEXT_API_KEY", "EMAIL_FROM", "EMAIL_FROM_NAME", "EMAIL_REST_API_TOKEN", "RESEND_API_KEY", "EMAIL_PROVIDER", "SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET", "GOOGLE_WORKSPACE_CLIENT_ID", "GOOGLE_WORKSPACE_CLIENT_SECRET", "MICROSOFT_365_CLIENT_ID", "MICROSOFT_365_CLIENT_SECRET", "STRIPE_API_KEY", "LEMONSQUEEZY_API_KEY", "PADDLE_API_KEY", "SHOPIFY_API_TOKEN", "SHOPIFY_HOST", "PLAID_SECRET", "ATTIO_API_KEY", "HUBSPOT_API_TOKEN", "PIPEDRIVE_API_TOKEN", "AIRTABLE_API_TOKEN", "NOTION_API_TOKEN", "POSTMARK_API_TOKEN", "SENDGRID_API_KEY", "TWILIO_API_SECRET", "TWILIO_API_KEY", "INTERCOM_API_TOKEN", "CRISP_API_KEY", "CRISP_API_IDENTIFIER", "GRANOLA_API_KEY", "LINEAR_API_KEY", "GITHUB_API_TOKEN", "GITLAB_API_TOKEN", "VERCEL_API_TOKEN", "CLOUDFLARE_PROVIDER_API_TOKEN", "POSTHOG_PERSONAL_API_KEY", "MIXPANEL_SERVICE_ACCOUNT_SECRET", "MIXPANEL_SERVICE_ACCOUNT_USERNAME", "SEGMENT_WRITE_KEY", "SUPABASE_SECRET_KEY", "SUPABASE_HOST", "TURSO_API_TOKEN", "TURSO_DB_AUTH_TOKEN", "TURSO_DB_HOST", "NEON_API_KEY", "PINECONE_API_KEY", "PINECONE_HOST", "MAPBOX_ACCESS_TOKEN", "OPENWEATHER_API_KEY", "ANTHROPIC_API_KEY", "GEMINI_API_KEY", "MISTRAL_API_KEY", "GROQ_API_KEY", "COHERE_API_KEY", "VOYAGE_API_KEY", "PERPLEXITY_API_KEY", "JINA_API_KEY", "REPLICATE_API_TOKEN", "HUGGINGFACE_API_TOKEN", "FIRECRAWL_API_KEY", "EXA_API_KEY", "TAVILY_API_KEY", "SERPER_API_KEY", "BRAVE_SEARCH_API_KEY", "APIFY_API_TOKEN", "DEEPGRAM_API_KEY", "ELEVENLABS_API_KEY", "ASSEMBLYAI_API_KEY", "NEWSAPI_API_KEY"];
|
|
81
|
+
//# sourceMappingURL=catalogSettings.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogSettings.generated.d.ts","sourceRoot":"","sources":["../../src/cloudflare/catalogSettings.generated.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EnB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,wBAAwB,wmDA8E3B,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Generated from packages/sdk/src/internal/capabilities.ts by
|
|
2
|
+
// src/cloudflare/catalogSettings.test.ts. Do not edit: change the catalog
|
|
3
|
+
// and run `pnpm -C packages/sdk catalog:update`.
|
|
4
|
+
/**
|
|
5
|
+
* The Gateway settings holding the keys of the AI providers and
|
|
6
|
+
* capabilities an app may ask for, with the settings a provider needs
|
|
7
|
+
* besides its key (Workers AI's account, a Basic username held as a
|
|
8
|
+
* setting, a host setting), by manifest id. With no Gateway in
|
|
9
|
+
* development, the SDK reaches them with the developer's own values under
|
|
10
|
+
* the same names, and `everyAppWorker()` declares the ones set locally.
|
|
11
|
+
*/
|
|
12
|
+
export const DEV_GATEWAY_KEYS = {
|
|
13
|
+
providers: {
|
|
14
|
+
openai: ["OPENAI_API_KEY"],
|
|
15
|
+
openrouter: ["OPENROUTER_API_KEY"],
|
|
16
|
+
"workers-ai": ["WORKERS_AI_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"],
|
|
17
|
+
anthropic: ["ANTHROPIC_API_KEY"],
|
|
18
|
+
gemini: ["GEMINI_API_KEY"],
|
|
19
|
+
mistral: ["MISTRAL_API_KEY"],
|
|
20
|
+
groq: ["GROQ_API_KEY"],
|
|
21
|
+
cohere: ["COHERE_API_KEY"],
|
|
22
|
+
},
|
|
23
|
+
capabilities: {
|
|
24
|
+
dataforseo: ["DATAFORSEO_API_KEY"],
|
|
25
|
+
context: ["CONTEXT_API_KEY"],
|
|
26
|
+
email: [
|
|
27
|
+
"EMAIL_FROM",
|
|
28
|
+
"EMAIL_FROM_NAME",
|
|
29
|
+
"EMAIL_REST_API_TOKEN",
|
|
30
|
+
"CLOUDFLARE_ACCOUNT_ID",
|
|
31
|
+
"RESEND_API_KEY",
|
|
32
|
+
"EMAIL_PROVIDER",
|
|
33
|
+
],
|
|
34
|
+
members: [],
|
|
35
|
+
slack: ["SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET"],
|
|
36
|
+
"google-workspace": [
|
|
37
|
+
"GOOGLE_WORKSPACE_CLIENT_ID",
|
|
38
|
+
"GOOGLE_WORKSPACE_CLIENT_SECRET",
|
|
39
|
+
],
|
|
40
|
+
"microsoft-365": ["MICROSOFT_365_CLIENT_ID", "MICROSOFT_365_CLIENT_SECRET"],
|
|
41
|
+
stripe: ["STRIPE_API_KEY"],
|
|
42
|
+
lemonsqueezy: ["LEMONSQUEEZY_API_KEY"],
|
|
43
|
+
paddle: ["PADDLE_API_KEY"],
|
|
44
|
+
shopify: ["SHOPIFY_API_TOKEN", "SHOPIFY_HOST"],
|
|
45
|
+
plaid: ["PLAID_SECRET"],
|
|
46
|
+
attio: ["ATTIO_API_KEY"],
|
|
47
|
+
hubspot: ["HUBSPOT_API_TOKEN"],
|
|
48
|
+
pipedrive: ["PIPEDRIVE_API_TOKEN"],
|
|
49
|
+
airtable: ["AIRTABLE_API_TOKEN"],
|
|
50
|
+
notion: ["NOTION_API_TOKEN"],
|
|
51
|
+
postmark: ["POSTMARK_API_TOKEN"],
|
|
52
|
+
sendgrid: ["SENDGRID_API_KEY"],
|
|
53
|
+
twilio: ["TWILIO_API_SECRET", "TWILIO_API_KEY"],
|
|
54
|
+
intercom: ["INTERCOM_API_TOKEN"],
|
|
55
|
+
crisp: ["CRISP_API_KEY", "CRISP_API_IDENTIFIER"],
|
|
56
|
+
granola: ["GRANOLA_API_KEY"],
|
|
57
|
+
linear: ["LINEAR_API_KEY"],
|
|
58
|
+
github: ["GITHUB_API_TOKEN"],
|
|
59
|
+
gitlab: ["GITLAB_API_TOKEN"],
|
|
60
|
+
vercel: ["VERCEL_API_TOKEN"],
|
|
61
|
+
cloudflare: ["CLOUDFLARE_PROVIDER_API_TOKEN"],
|
|
62
|
+
posthog: ["POSTHOG_PERSONAL_API_KEY"],
|
|
63
|
+
mixpanel: [
|
|
64
|
+
"MIXPANEL_SERVICE_ACCOUNT_SECRET",
|
|
65
|
+
"MIXPANEL_SERVICE_ACCOUNT_USERNAME",
|
|
66
|
+
],
|
|
67
|
+
segment: ["SEGMENT_WRITE_KEY"],
|
|
68
|
+
supabase: ["SUPABASE_SECRET_KEY", "SUPABASE_HOST"],
|
|
69
|
+
turso: ["TURSO_API_TOKEN"],
|
|
70
|
+
"turso-db": ["TURSO_DB_AUTH_TOKEN", "TURSO_DB_HOST"],
|
|
71
|
+
neon: ["NEON_API_KEY"],
|
|
72
|
+
pinecone: ["PINECONE_API_KEY", "PINECONE_HOST"],
|
|
73
|
+
mapbox: ["MAPBOX_ACCESS_TOKEN"],
|
|
74
|
+
openweather: ["OPENWEATHER_API_KEY"],
|
|
75
|
+
voyage: ["VOYAGE_API_KEY"],
|
|
76
|
+
perplexity: ["PERPLEXITY_API_KEY"],
|
|
77
|
+
jina: ["JINA_API_KEY"],
|
|
78
|
+
replicate: ["REPLICATE_API_TOKEN"],
|
|
79
|
+
huggingface: ["HUGGINGFACE_API_TOKEN"],
|
|
80
|
+
firecrawl: ["FIRECRAWL_API_KEY"],
|
|
81
|
+
exa: ["EXA_API_KEY"],
|
|
82
|
+
tavily: ["TAVILY_API_KEY"],
|
|
83
|
+
serper: ["SERPER_API_KEY"],
|
|
84
|
+
"brave-search": ["BRAVE_SEARCH_API_KEY"],
|
|
85
|
+
apify: ["APIFY_API_TOKEN"],
|
|
86
|
+
deepgram: ["DEEPGRAM_API_KEY"],
|
|
87
|
+
elevenlabs: ["ELEVENLABS_API_KEY"],
|
|
88
|
+
assemblyai: ["ASSEMBLYAI_API_KEY"],
|
|
89
|
+
newsapi: ["NEWSAPI_API_KEY"],
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Every setting a catalog entry reads, in catalog order, each once: what
|
|
94
|
+
* the Gateway's cloudflare.config.ts declares for local dev.
|
|
95
|
+
*/
|
|
96
|
+
export const CATALOG_GATEWAY_SETTINGS = [
|
|
97
|
+
"OPENAI_API_KEY",
|
|
98
|
+
"OPENROUTER_API_KEY",
|
|
99
|
+
"WORKERS_AI_API_TOKEN",
|
|
100
|
+
"CLOUDFLARE_ACCOUNT_ID",
|
|
101
|
+
"AI_GATEWAY_API_KEY",
|
|
102
|
+
"AI_GATEWAY_ID",
|
|
103
|
+
"DATAFORSEO_API_KEY",
|
|
104
|
+
"CONTEXT_API_KEY",
|
|
105
|
+
"EMAIL_FROM",
|
|
106
|
+
"EMAIL_FROM_NAME",
|
|
107
|
+
"EMAIL_REST_API_TOKEN",
|
|
108
|
+
"RESEND_API_KEY",
|
|
109
|
+
"EMAIL_PROVIDER",
|
|
110
|
+
"SLACK_CLIENT_ID",
|
|
111
|
+
"SLACK_CLIENT_SECRET",
|
|
112
|
+
"GOOGLE_WORKSPACE_CLIENT_ID",
|
|
113
|
+
"GOOGLE_WORKSPACE_CLIENT_SECRET",
|
|
114
|
+
"MICROSOFT_365_CLIENT_ID",
|
|
115
|
+
"MICROSOFT_365_CLIENT_SECRET",
|
|
116
|
+
"STRIPE_API_KEY",
|
|
117
|
+
"LEMONSQUEEZY_API_KEY",
|
|
118
|
+
"PADDLE_API_KEY",
|
|
119
|
+
"SHOPIFY_API_TOKEN",
|
|
120
|
+
"SHOPIFY_HOST",
|
|
121
|
+
"PLAID_SECRET",
|
|
122
|
+
"ATTIO_API_KEY",
|
|
123
|
+
"HUBSPOT_API_TOKEN",
|
|
124
|
+
"PIPEDRIVE_API_TOKEN",
|
|
125
|
+
"AIRTABLE_API_TOKEN",
|
|
126
|
+
"NOTION_API_TOKEN",
|
|
127
|
+
"POSTMARK_API_TOKEN",
|
|
128
|
+
"SENDGRID_API_KEY",
|
|
129
|
+
"TWILIO_API_SECRET",
|
|
130
|
+
"TWILIO_API_KEY",
|
|
131
|
+
"INTERCOM_API_TOKEN",
|
|
132
|
+
"CRISP_API_KEY",
|
|
133
|
+
"CRISP_API_IDENTIFIER",
|
|
134
|
+
"GRANOLA_API_KEY",
|
|
135
|
+
"LINEAR_API_KEY",
|
|
136
|
+
"GITHUB_API_TOKEN",
|
|
137
|
+
"GITLAB_API_TOKEN",
|
|
138
|
+
"VERCEL_API_TOKEN",
|
|
139
|
+
"CLOUDFLARE_PROVIDER_API_TOKEN",
|
|
140
|
+
"POSTHOG_PERSONAL_API_KEY",
|
|
141
|
+
"MIXPANEL_SERVICE_ACCOUNT_SECRET",
|
|
142
|
+
"MIXPANEL_SERVICE_ACCOUNT_USERNAME",
|
|
143
|
+
"SEGMENT_WRITE_KEY",
|
|
144
|
+
"SUPABASE_SECRET_KEY",
|
|
145
|
+
"SUPABASE_HOST",
|
|
146
|
+
"TURSO_API_TOKEN",
|
|
147
|
+
"TURSO_DB_AUTH_TOKEN",
|
|
148
|
+
"TURSO_DB_HOST",
|
|
149
|
+
"NEON_API_KEY",
|
|
150
|
+
"PINECONE_API_KEY",
|
|
151
|
+
"PINECONE_HOST",
|
|
152
|
+
"MAPBOX_ACCESS_TOKEN",
|
|
153
|
+
"OPENWEATHER_API_KEY",
|
|
154
|
+
"ANTHROPIC_API_KEY",
|
|
155
|
+
"GEMINI_API_KEY",
|
|
156
|
+
"MISTRAL_API_KEY",
|
|
157
|
+
"GROQ_API_KEY",
|
|
158
|
+
"COHERE_API_KEY",
|
|
159
|
+
"VOYAGE_API_KEY",
|
|
160
|
+
"PERPLEXITY_API_KEY",
|
|
161
|
+
"JINA_API_KEY",
|
|
162
|
+
"REPLICATE_API_TOKEN",
|
|
163
|
+
"HUGGINGFACE_API_TOKEN",
|
|
164
|
+
"FIRECRAWL_API_KEY",
|
|
165
|
+
"EXA_API_KEY",
|
|
166
|
+
"TAVILY_API_KEY",
|
|
167
|
+
"SERPER_API_KEY",
|
|
168
|
+
"BRAVE_SEARCH_API_KEY",
|
|
169
|
+
"APIFY_API_TOKEN",
|
|
170
|
+
"DEEPGRAM_API_KEY",
|
|
171
|
+
"ELEVENLABS_API_KEY",
|
|
172
|
+
"ASSEMBLYAI_API_KEY",
|
|
173
|
+
"NEWSAPI_API_KEY",
|
|
174
|
+
];
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* `/internal` would break `cf dev` wherever the SDK is linked from source.
|
|
18
18
|
* (The dev keypair it hands the dev Worker is a leaf the Worker never loads.)
|
|
19
19
|
*/
|
|
20
|
-
export { EVERYAPP_OBSERVABILITY, everyAppAuxiliaryWorker, everyAppWorker, helperWorkerName, localD1Id, localD1Path, workflowNameFor, type D1Binding, type DurableObjectBinding, type DurableObjectExport, type EveryAppAuxiliaryWorkerConfig, type EveryAppAuxiliaryWorkerOptions, type EveryAppBinding, type EveryAppConfigContext, type EveryAppDeployEnv, type EveryAppDevEnv, type EveryAppExports, type EveryAppObservability, type EveryAppPlacement, type EveryAppWorkerConfig, type EveryAppWorkerManifest, type EveryAppWorkerOptions, type EveryAppWorkerReference, type GatewayBinding, type HyperdriveBinding, type KvBinding, type SecretBinding, type ServiceBinding, type TextBinding, type VersionMetadataBinding, type WorkflowBinding, type WorkflowExport, } from "./worker.js";
|
|
21
|
-
export { BUILD_SENTINEL, resourceSentinel, sentinelDeployTarget, type EveryAppDeployTarget, } from "./sentinel.js";
|
|
20
|
+
export { EVERYAPP_OBSERVABILITY, everyAppAuxiliaryWorker, everyAppWorker, helperWorkerName, localD1Id, localD1Path, workflowNameFor, type AiBinding, type AnalyticsEngineDatasetBinding, type BrowserBinding, type AiGatewayBinding, type D1Binding, type DurableObjectBinding, type DurableObjectExport, type EveryAppAuxiliaryWorkerConfig, type EveryAppAuxiliaryWorkerOptions, type EveryAppBinding, type EveryAppConfigContext, type EveryAppDeployEnv, type EveryAppDevEnv, type EveryAppExports, type EveryAppObservability, type EveryAppPlacement, type EveryAppTrigger, type EveryAppWorkerConfig, type EveryAppWorkerManifest, type EveryAppWorkerOptions, type EveryAppWorkerReference, type GatewayBinding, type HyperdriveBinding, type ImagesBinding, type JsonBinding, type KvBinding, type QueueBinding, type QueueConsumerTrigger, type SecretBinding, type SecretsStoreSecretBinding, type SendEmailBinding, type ServiceBinding, type TextBinding, type VectorizeBinding, type VersionMetadataBinding, type WorkflowBinding, type WorkflowExport, } from "./worker.js";
|
|
21
|
+
export { aiGatewayUrl, BUILD_SENTINEL, resourceSentinel, sentinelDeployTarget, type AiGatewayValue, type EveryAppDeployTarget, } from "./sentinel.js";
|
|
22
|
+
export { CATALOG_GATEWAY_SETTINGS } from "./catalogSettings.generated.js";
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,eAAe,EACf,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,eAAe,EACf,KAAK,SAAS,EACd,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/cloudflare/index.js
CHANGED
|
@@ -18,4 +18,7 @@
|
|
|
18
18
|
* (The dev keypair it hands the dev Worker is a leaf the Worker never loads.)
|
|
19
19
|
*/
|
|
20
20
|
export { EVERYAPP_OBSERVABILITY, everyAppAuxiliaryWorker, everyAppWorker, helperWorkerName, localD1Id, localD1Path, workflowNameFor, } from "./worker.js";
|
|
21
|
-
export { BUILD_SENTINEL, resourceSentinel, sentinelDeployTarget, } from "./sentinel.js";
|
|
21
|
+
export { aiGatewayUrl, BUILD_SENTINEL, resourceSentinel, sentinelDeployTarget, } from "./sentinel.js";
|
|
22
|
+
// Every setting a provider of the built-in catalog reads, generated from
|
|
23
|
+
// it: the Gateway's cloudflare.config.ts declares them for local dev.
|
|
24
|
+
export { CATALOG_GATEWAY_SETTINGS } from "./catalogSettings.generated.js";
|
|
@@ -14,14 +14,25 @@
|
|
|
14
14
|
export declare const BUILD_SENTINEL: Readonly<{
|
|
15
15
|
workerName: "every-hosted--sentinel";
|
|
16
16
|
organizationId: "everyapp-hosted-deploy-sentinel";
|
|
17
|
+
/**
|
|
18
|
+
* The Cloudflare account the app is installed in (an AI Gateway's URL
|
|
19
|
+
* holds it). Starts with the Worker name's placeholder, so an install
|
|
20
|
+
* rewrites it before that one.
|
|
21
|
+
*/
|
|
22
|
+
accountId: "every-hosted--sentinel-account";
|
|
17
23
|
/** The gateway's URL, and so the identity issuer. */
|
|
18
24
|
gatewayUrl: "https://every-hosted--sentinel.invalid";
|
|
19
25
|
publicKey: "-----BEGIN PUBLIC KEY-----\nEVERYAPPHOSTEDDEPLOYSENTINEL\n-----END PUBLIC KEY-----\n";
|
|
20
26
|
}>;
|
|
27
|
+
/** Runtime-independent resource names used by both release installers. */
|
|
28
|
+
export declare function helperWorkerName(appWorker: string, helper: string): string;
|
|
29
|
+
export declare function workflowNameFor(workerName: string, binding: string): string;
|
|
21
30
|
/**
|
|
22
31
|
* A manifest binding's placeholder: a D1 database's name and id, an R2
|
|
23
|
-
* bucket's name, a KV namespace's
|
|
24
|
-
*
|
|
32
|
+
* bucket's, queue's or Vectorize index's name, a KV namespace's, Hyperdrive
|
|
33
|
+
* config's or AI Gateway's id, a Secrets Store secret's store id and name.
|
|
34
|
+
* The installer rewrites each by its binding name; the value only has to
|
|
35
|
+
* be recognizable.
|
|
25
36
|
*/
|
|
26
37
|
export declare function resourceSentinel(binding: string): string;
|
|
27
38
|
/** The fields of the manifest a build's placeholders are made for. */
|
|
@@ -33,14 +44,42 @@ interface SentinelManifest {
|
|
|
33
44
|
hyperdrive?: readonly {
|
|
34
45
|
readonly name: string;
|
|
35
46
|
}[];
|
|
47
|
+
queues?: readonly {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
}[];
|
|
50
|
+
vectorize?: readonly {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
}[];
|
|
53
|
+
aiGateway?: readonly {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
}[];
|
|
56
|
+
secretsStore?: readonly {
|
|
57
|
+
readonly name: string;
|
|
58
|
+
}[];
|
|
36
59
|
};
|
|
37
60
|
}
|
|
61
|
+
/** Where an AI Gateway takes requests: `https://gateway.ai.cloudflare.com/v1/<account>/<id>`. */
|
|
62
|
+
export declare function aiGatewayUrl(accountId: string, id: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* What an AI Gateway binding holds (a `json` binding): the gateway's id,
|
|
65
|
+
* its account, and its URL, under which each provider has a path
|
|
66
|
+
* (`<url>/openai`, `<url>/anthropic`, `<url>/workers-ai`, `<url>/compat`).
|
|
67
|
+
* In development `accountId` and `url` are empty: there is no gateway, so
|
|
68
|
+
* an app calls the provider directly.
|
|
69
|
+
*/
|
|
70
|
+
export type AiGatewayValue = {
|
|
71
|
+
id: string;
|
|
72
|
+
accountId: string;
|
|
73
|
+
url: string;
|
|
74
|
+
};
|
|
38
75
|
/** Everything install-specific a Worker is built from, by binding. */
|
|
39
76
|
export interface EveryAppDeployTarget {
|
|
40
77
|
/** The Worker name the gateway registry assigned to this app. */
|
|
41
78
|
workerName: string;
|
|
42
79
|
/** The organization that owns the app; scopes the AppGateway binding. */
|
|
43
80
|
organizationId: string;
|
|
81
|
+
/** The Cloudflare account the app is installed in. */
|
|
82
|
+
accountId: string;
|
|
44
83
|
/** The gateway's URL, which is also the identity tokens' issuer. */
|
|
45
84
|
gatewayUrl: string;
|
|
46
85
|
/** SPKI PEM public keys (current + next) that verify identity tokens. */
|
|
@@ -61,6 +100,25 @@ export interface EveryAppDeployTarget {
|
|
|
61
100
|
r2?: Record<string, {
|
|
62
101
|
name: string;
|
|
63
102
|
}>;
|
|
103
|
+
/** Queues by binding: each one's name (which its bindings and triggers use) and id. */
|
|
104
|
+
queues?: Record<string, {
|
|
105
|
+
name: string;
|
|
106
|
+
id: string;
|
|
107
|
+
}>;
|
|
108
|
+
/** Vectorize indexes by binding, under the names the deploy provisioned. */
|
|
109
|
+
vectorize?: Record<string, {
|
|
110
|
+
name: string;
|
|
111
|
+
}>;
|
|
112
|
+
/** AI Gateways by binding: each binding's whole value. */
|
|
113
|
+
aiGateway?: Record<string, AiGatewayValue>;
|
|
114
|
+
/**
|
|
115
|
+
* Secrets Store secrets by binding: the account's store and the
|
|
116
|
+
* secret the deploy made in it.
|
|
117
|
+
*/
|
|
118
|
+
secretsStore?: Record<string, {
|
|
119
|
+
storeId: string;
|
|
120
|
+
secretName: string;
|
|
121
|
+
}>;
|
|
64
122
|
};
|
|
65
123
|
}
|
|
66
124
|
/** The target every production build is made for: placeholders throughout. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../src/cloudflare/sentinel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,cAAc;;;IAKzB,qDAAqD;;;EAIrD,CAAC;AAEH
|
|
1
|
+
{"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../src/cloudflare/sentinel.ts"],"names":[],"mappings":"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"}
|
|
@@ -16,18 +16,40 @@ export const BUILD_SENTINEL = Object.freeze({
|
|
|
16
16
|
// and a string rewrite of it can't hit anything else.
|
|
17
17
|
workerName: "every-hosted--sentinel",
|
|
18
18
|
organizationId: "everyapp-hosted-deploy-sentinel",
|
|
19
|
+
/**
|
|
20
|
+
* The Cloudflare account the app is installed in (an AI Gateway's URL
|
|
21
|
+
* holds it). Starts with the Worker name's placeholder, so an install
|
|
22
|
+
* rewrites it before that one.
|
|
23
|
+
*/
|
|
24
|
+
accountId: "every-hosted--sentinel-account",
|
|
19
25
|
/** The gateway's URL, and so the identity issuer. */
|
|
20
26
|
gatewayUrl: "https://every-hosted--sentinel.invalid",
|
|
21
27
|
publicKey: "-----BEGIN PUBLIC KEY-----\nEVERYAPPHOSTEDDEPLOYSENTINEL\n-----END PUBLIC KEY-----\n",
|
|
22
28
|
});
|
|
29
|
+
/** Runtime-independent resource names used by both release installers. */
|
|
30
|
+
export function helperWorkerName(appWorker, helper) {
|
|
31
|
+
const name = `${appWorker}--${helper}`;
|
|
32
|
+
if (name.length > 63)
|
|
33
|
+
throw new Error(`Helper Worker ${name} is longer than Cloudflare's 63 characters; shorten its name in everyapp.config.ts.`);
|
|
34
|
+
return name;
|
|
35
|
+
}
|
|
36
|
+
export function workflowNameFor(workerName, binding) {
|
|
37
|
+
return `${workerName}--${binding.toLowerCase().replaceAll("_", "-")}`;
|
|
38
|
+
}
|
|
23
39
|
/**
|
|
24
40
|
* A manifest binding's placeholder: a D1 database's name and id, an R2
|
|
25
|
-
* bucket's name, a KV namespace's
|
|
26
|
-
*
|
|
41
|
+
* bucket's, queue's or Vectorize index's name, a KV namespace's, Hyperdrive
|
|
42
|
+
* config's or AI Gateway's id, a Secrets Store secret's store id and name.
|
|
43
|
+
* The installer rewrites each by its binding name; the value only has to
|
|
44
|
+
* be recognizable.
|
|
27
45
|
*/
|
|
28
46
|
export function resourceSentinel(binding) {
|
|
29
47
|
return `${BUILD_SENTINEL.workerName}--${binding}`;
|
|
30
48
|
}
|
|
49
|
+
/** Where an AI Gateway takes requests: `https://gateway.ai.cloudflare.com/v1/<account>/<id>`. */
|
|
50
|
+
export function aiGatewayUrl(accountId, id) {
|
|
51
|
+
return `https://gateway.ai.cloudflare.com/v1/${accountId}/${id}`;
|
|
52
|
+
}
|
|
31
53
|
/** The target every production build is made for: placeholders throughout. */
|
|
32
54
|
export function sentinelDeployTarget(manifest) {
|
|
33
55
|
const byBinding = (bindings, value) => Object.fromEntries((bindings ?? []).map((binding) => [
|
|
@@ -38,6 +60,7 @@ export function sentinelDeployTarget(manifest) {
|
|
|
38
60
|
return {
|
|
39
61
|
workerName: BUILD_SENTINEL.workerName,
|
|
40
62
|
organizationId: BUILD_SENTINEL.organizationId,
|
|
63
|
+
accountId: BUILD_SENTINEL.accountId,
|
|
41
64
|
gatewayUrl: BUILD_SENTINEL.gatewayUrl,
|
|
42
65
|
identityPublicKeys: [BUILD_SENTINEL.publicKey],
|
|
43
66
|
resources: {
|
|
@@ -45,6 +68,18 @@ export function sentinelDeployTarget(manifest) {
|
|
|
45
68
|
kv: byBinding(resources?.kv, (id) => ({ id })),
|
|
46
69
|
hyperdrive: byBinding(resources?.hyperdrive?.map((config) => config.name), (id) => ({ id })),
|
|
47
70
|
r2: byBinding(resources?.r2, (name) => ({ name })),
|
|
71
|
+
...(resources?.queues?.length
|
|
72
|
+
? {
|
|
73
|
+
queues: byBinding(resources.queues.map((queue) => queue.name), (name) => ({ name, id: name })),
|
|
74
|
+
}
|
|
75
|
+
: {}),
|
|
76
|
+
vectorize: byBinding(resources?.vectorize?.map((index) => index.name), (name) => ({ name })),
|
|
77
|
+
aiGateway: byBinding(resources?.aiGateway?.map((gateway) => gateway.name), (id) => ({
|
|
78
|
+
id,
|
|
79
|
+
accountId: BUILD_SENTINEL.accountId,
|
|
80
|
+
url: aiGatewayUrl(BUILD_SENTINEL.accountId, id),
|
|
81
|
+
})),
|
|
82
|
+
secretsStore: byBinding(resources?.secretsStore?.map((secret) => secret.name), (placeholder) => ({ storeId: placeholder, secretName: placeholder })),
|
|
48
83
|
},
|
|
49
84
|
};
|
|
50
85
|
}
|