@every-app/sdk 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -524,8 +524,8 @@ For a person's own account at a provider (Google, Microsoft 365, Slack,
524
524
  GitHub, Notion and the other presets: deploying an app that lists one
525
525
  registers it on the gateway), the gateway holds the client, runs the flow
526
526
  and keeps the tokens. The
527
- app lists the provider's own scopes, sends people to connect inside the app,
528
- and calls the provider's API; it never sees a token.
527
+ app lists the provider's own scopes, sends people to the gateway to connect
528
+ or to allow the app, and calls the provider's API; it never sees a token.
529
529
 
530
530
  ```ts
531
531
  // everyapp.config.ts
@@ -553,8 +553,8 @@ import {
553
553
 
554
554
  const status = await integrationStatus({ env, provider: "google-workspace" });
555
555
  if (!status.connection?.ready) {
556
- // A "Connect Google" button: the gateway asks Google for exactly this
557
- // app's scopes and sends the person back.
556
+ // A "Connect Google" button: the gateway sends the person to Google,
557
+ // or to its own page that allows this app, and then back here.
558
558
  return redirect(
559
559
  connectUrl({ env, provider: "google-workspace", returnTo: request.url }),
560
560
  );
@@ -566,28 +566,32 @@ const sites = await google(
566
566
  ```
567
567
 
568
568
  `connectUrl({ env, provider, returnTo })` is
569
- `<gateway>/connect/<id>?app=<this app>&return=<returnTo>`. The connection
570
- belongs to that person and this app: another app that needs the same
571
- provider connects for its own scopes. The gateway refuses a token that
572
- carries more scopes than the app lists.
569
+ `<gateway>/connect/<id>?app=<this app>&return=<returnTo>`. A person
570
+ connects a provider once, and the connection belongs to them. The gateway
571
+ asks the provider for every scope the organization's apps list, and
572
+ refuses a token that carries more. Another app that needs the same
573
+ provider sends the person to its own `connectUrl()`. There they select
574
+ Allow on a gateway page, with no trip to the provider. An app they haven't
575
+ allowed can't use the connection. Allowing is a yes or no: an allowed app
576
+ can use every scope the connection holds, not only the ones it lists.
573
577
 
574
578
  `integrationFetch` reaches https URLs only, and the gateway forwards a call
575
579
  to the provider's API hosts alone (a token endpoint or any other host is
576
580
  refused, `invalid_integration_route`); it puts the person's token on the
577
- call. Without a connection, or when the
578
- connection lacks a scope the app now lists, the gateway answers 409
581
+ call. Without a connection, before the person allowed this app, or when
582
+ the connection lacks a scope the app now lists, the gateway answers 409
579
583
  `integration_not_connected` with `connectPath` (and `missingScopes`): send
580
584
  the person to `connectUrl()`.
581
585
 
582
586
  `integrationStatus` for an OAuth provider adds `scopes` (as the manifest
583
587
  lists them), `connectPath` (`/connect/<id>?app=<app>`, or null) and
584
588
  `connection` (`{ label, scopes, ready, missingScopes?, reconnect? }`, or
585
- null) for the person.
589
+ null) for the person. `connection` is null until they allowed this app.
586
590
 
587
- An app may use a connection made in it at any time, including from a cron
588
- or a Durable Object alarm. `for: { background: true, userId }` names any
589
- member's connection to this app, even while serving another member's
590
- request: OpenSEO reads a project's Search Console with the connection of the
591
+ An app a person allowed may use their connection at any time, including
592
+ from a cron or a Durable Object alarm. `for: { background: true, userId }`
593
+ names any member's connection, once that member allowed this app, even
594
+ while serving another member's request: OpenSEO reads a project's Search Console with the connection of the
591
595
  member who picked the property, whoever is viewing. The call carries that
592
596
  member (`x-everyapp-user`), not the person being served. Only an
593
597
  organization's own app may, and only for a member who may still open the
@@ -608,9 +612,9 @@ calls to the provider's hosts as the bearer; without it calls answer the same 40
608
612
  - `for: { background: true, organizationId }`, for work no request started
609
613
  (a cron, a Workflow step, a queue): sent as `x-everyapp-org` with no
610
614
  identity.
611
- - `for: { background: true, userId }`, for a call to an OAuth provider on a
612
- member's connection to this app: sent as `x-everyapp-user`, with no
613
- identity, even while a request is being served.
615
+ - `for: { background: true, userId }`, for a call to an OAuth provider on
616
+ the connection of a member who allowed this app: sent as
617
+ `x-everyapp-user`, with no identity, even while a request is being served.
614
618
  - Omitted: allowed only in an organization's own app, whose background
615
619
  calls are the app's, in its own organization (the same as
616
620
  `{ background: true }`). Naming another organization is refused.
@@ -19,9 +19,10 @@
19
19
  * - `oauth_client`: an OAuth provider whose client the gateway holds and
20
20
  * whose flow it runs. None is in the catalog: each is a registered row,
21
21
  * written from a preset (./oauthPresets.ts: Google, Microsoft, Slack,
22
- * GitHub and the rest) or an operator's spec. A person connects in an app,
23
- * for exactly the provider scopes the app's manifest entry lists
24
- * (`scopes`); the gateway keeps the tokens and puts the person's token
22
+ * GitHub and the rest) or an operator's spec. A person connects once,
23
+ * for the provider scopes the organization's apps list in their
24
+ * manifest entries (`scopes`), and allows each app that asks to use the
25
+ * connection; the gateway keeps the tokens and puts the person's token
25
26
  * on the app's calls to the provider's `api` hosts. Each provider is a
26
27
  * spec (./oauthSpec.ts), its differences data; ./oauthScopes.ts holds
27
28
  * the one set of scope rules.
@@ -381,9 +382,9 @@ export interface OAuthFlow {
381
382
  }
382
383
  /**
383
384
  * An OAuth provider the Gateway holds a client for and runs the flow for
384
- * (docs/design/2026-11-oauth-simplify.md). A person connects in an app;
385
- * the connection is theirs and that app's, for exactly the scopes the
386
- * app's `everyapp.config.ts` lists, and the app calls the provider's
385
+ * (docs/design/2026-11-oauth-one-connection.md). A person connects once;
386
+ * the connection is theirs, for the scopes the organization's apps list
387
+ * in `everyapp.config.ts`, and each app they allow calls the provider's
387
388
  * `api` hosts through the Gateway, which puts the token on.
388
389
  */
389
390
  export interface OAuthClientCapability {
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/internal/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU;AACpB,kGAAkG;AAChG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AACrD,8FAA8F;GAC5F;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE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AAM,MAAM,qBAAqB;AAC/B,6EAA6E;AAC3E;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE;AAC9E,+FAA+F;GAC7F;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,qBAAqB,CAAC;IAClC,QAAQ,EAAE,GAAG,CAAC;CACf;AACH,iEAAiE;GAC/D;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,mBAAmB,CAAC;IACxB,UAAU,EAAE,wBAAwB,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEN,0EAA0E;AAC1E,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,kBAAkB,EAC7B,MAAM,GAAE,gBAA0B,GACjC,qBAAqB,GAAG,IAAI,CAiC9B;AAWD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,qBAAqB,GAChC,MAAM,CAER;AAaD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,MAAM,GACf,OAAO,CAqBT;AA6BD,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C"}
@@ -19,9 +19,10 @@
19
19
  * - `oauth_client`: an OAuth provider whose client the gateway holds and
20
20
  * whose flow it runs. None is in the catalog: each is a registered row,
21
21
  * written from a preset (./oauthPresets.ts: Google, Microsoft, Slack,
22
- * GitHub and the rest) or an operator's spec. A person connects in an app,
23
- * for exactly the provider scopes the app's manifest entry lists
24
- * (`scopes`); the gateway keeps the tokens and puts the person's token
22
+ * GitHub and the rest) or an operator's spec. A person connects once,
23
+ * for the provider scopes the organization's apps list in their
24
+ * manifest entries (`scopes`), and allows each app that asks to use the
25
+ * connection; the gateway keeps the tokens and puts the person's token
25
26
  * on the app's calls to the provider's `api` hosts. Each provider is a
26
27
  * spec (./oauthSpec.ts), its differences data; ./oauthScopes.ts holds
27
28
  * the one set of scope rules.
@@ -67,8 +67,8 @@ export const EVENT_TYPES = [
67
67
  entry("provider", "provider.added", "A provider was registered"),
68
68
  entry("provider", "provider.removed", "A provider was removed"),
69
69
  entry("provider", "provider.updated", "A provider's spec or OAuth client was replaced"),
70
- entry("provider", "provider.connected", "Someone connected an account at an OAuth provider in an app"),
71
- entry("provider", "provider.disconnected", "An OAuth provider account was disconnected"),
70
+ entry("provider", "provider.connected", "Someone connected an account at an OAuth provider, from inside an app"),
71
+ entry("provider", "provider.disconnected", "An OAuth provider account was disconnected: every app stops using it"),
72
72
  entry("provider", "provider.connection_expired", "An OAuth provider refused to refresh a connection; it needs reconnecting"),
73
73
  entry("subscription", "subscription.created", "An event subscription was added"),
74
74
  entry("subscription", "subscription.updated", "An event subscription was changed, paused or resumed"),
@@ -18,4 +18,36 @@ export interface OAuthClientCredentials {
18
18
  * it needs is set: the id, and the secret unless it is a public client.
19
19
  */
20
20
  export declare function oauthClientCredentials(capability: OAuthClientCapability, settings: CapabilitySettings): OAuthClientCredentials | null;
21
+ /** Where the client the gateway uses for an OAuth provider comes from. */
22
+ export declare enum OAuthClientSource {
23
+ /** The Worker's settings, set from the terminal (`everyapp secret set`, `provider add`). */
24
+ Env = "env",
25
+ /** Pasted under Manage workspace → Providers: the gateway's sealed D1 row. */
26
+ Pasted = "d1"
27
+ }
28
+ /** What the gateway or the CLI knows of a pasted client, never its value. */
29
+ export interface PastedOAuthClient {
30
+ /** The provider binding it was pasted for (`providerBindingKey`), or null for none recorded. */
31
+ boundTo: string | null;
32
+ hasSecret: boolean;
33
+ /** Whether its sealed copy opens with the gateway's secret; the CLI, which can't open it, says true. */
34
+ opens: boolean;
35
+ }
36
+ /**
37
+ * Which client the gateway uses for an OAuth provider, or null when it has
38
+ * none it may use (docs/design/2026-10-oauth-providers.md section 6): the
39
+ * Worker settings' while the registry may read them (`envBound`: a
40
+ * registered row bound to its hosts), else the pasted one while it was
41
+ * pasted for the provider as it is now, opens, and has its secret. One rule
42
+ * for every surface that asks: the gateway's client lookup, whether an app
43
+ * needs setup (the gate that opens it, the app lists) and the CLI's
44
+ * `status` and `deploy`.
45
+ */
46
+ export declare function oauthClientSource(input: {
47
+ capability: OAuthClientCapability;
48
+ /** Every setting the Worker's client needs is set (`oauthClientCredentials`). */
49
+ envSet: boolean;
50
+ envBound: boolean;
51
+ pasted: PastedOAuthClient | null;
52
+ }): OAuthClientSource | null;
21
53
  //# sourceMappingURL=oauthClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauthClient.d.ts","sourceRoot":"","sources":["../../src/internal/oauthClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,QAAY,CAAC;AAEhD,+CAA+C;AAC/C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,qBAAqB,EACjC,QAAQ,EAAE,kBAAkB,GAC3B,sBAAsB,GAAG,IAAI,CAQ/B"}
1
+ {"version":3,"file":"oauthClient.d.ts","sourceRoot":"","sources":["../../src/internal/oauthClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAG3B,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,QAAY,CAAC;AAEhD,+CAA+C;AAC/C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,qBAAqB,EACjC,QAAQ,EAAE,kBAAkB,GAC3B,sBAAsB,GAAG,IAAI,CAQ/B;AAED,0EAA0E;AAC1E,oBAAY,iBAAiB;IAC3B,4FAA4F;IAC5F,GAAG,QAAQ;IACX,8EAA8E;IAC9E,MAAM,OAAO;CACd;AAED,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,gGAAgG;IAChG,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,wGAAwG;IACxG,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,UAAU,EAAE,qBAAqB,CAAC;IAClC,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAClC,GAAG,iBAAiB,GAAG,IAAI,CAO3B"}
@@ -1,3 +1,4 @@
1
+ import { providerBindingKey } from "./providerRegistry.js";
1
2
  /** The largest token answer the gateway reads: real ones are a few kilobytes. */
2
3
  export const OAUTH_TOKEN_BODY_LIMIT = 64 * 1024;
3
4
  /**
@@ -14,6 +15,36 @@ export function oauthClientCredentials(capability, settings) {
14
15
  return null;
15
16
  return { clientId, ...(clientSecret ? { clientSecret } : {}) };
16
17
  }
18
+ /** Where the client the gateway uses for an OAuth provider comes from. */
19
+ export var OAuthClientSource;
20
+ (function (OAuthClientSource) {
21
+ /** The Worker's settings, set from the terminal (`everyapp secret set`, `provider add`). */
22
+ OAuthClientSource["Env"] = "env";
23
+ /** Pasted under Manage workspace → Providers: the gateway's sealed D1 row. */
24
+ OAuthClientSource["Pasted"] = "d1";
25
+ })(OAuthClientSource || (OAuthClientSource = {}));
26
+ /**
27
+ * Which client the gateway uses for an OAuth provider, or null when it has
28
+ * none it may use (docs/design/2026-10-oauth-providers.md section 6): the
29
+ * Worker settings' while the registry may read them (`envBound`: a
30
+ * registered row bound to its hosts), else the pasted one while it was
31
+ * pasted for the provider as it is now, opens, and has its secret. One rule
32
+ * for every surface that asks: the gateway's client lookup, whether an app
33
+ * needs setup (the gate that opens it, the app lists) and the CLI's
34
+ * `status` and `deploy`.
35
+ */
36
+ export function oauthClientSource(input) {
37
+ if (input.envSet)
38
+ return input.envBound ? OAuthClientSource.Env : null;
39
+ const pasted = input.pasted;
40
+ if (!pasted || !pasted.opens)
41
+ return null;
42
+ if (pasted.boundTo !== providerBindingKey(input.capability))
43
+ return null;
44
+ if (input.capability.secrets.clientSecret && !pasted.hasSecret)
45
+ return null;
46
+ return OAuthClientSource.Pasted;
47
+ }
17
48
  function settingValue(value) {
18
49
  return typeof value === "string" && value.trim() ? value.trim() : undefined;
19
50
  }
@@ -13,9 +13,10 @@
13
13
  * leave it out (the gateway knows its organization) and may only name
14
14
  * its own.
15
15
  * - `{ background: true, organizationId, userId }`: a call to an OAuth
16
- * provider's API (`integrationFetch`) on the connection member `userId`
17
- * made in this app, at any time, even while serving another person's
18
- * request: the call carries that member (`x-everyapp-user`) and never
16
+ * provider's API (`integrationFetch`) on member `userId`'s connection,
17
+ * which they allowed this app to use, at any time, even while serving
18
+ * another person's request: the call carries that member
19
+ * (`x-everyapp-user`) and never
19
20
  * the identity of the person being served. Only an organization's own
20
21
  * app may name a member, and only one who may still open the app. No
21
22
  * identity for the member reaches the app. Other gateway calls ignore
@@ -1 +1 @@
1
- {"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../src/server/attribution.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;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,OAAO,EAChB,MAAM,EAAE,cAAc,GAAG,SAAS,GACjC,IAAI,CAYN;AASD,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAO1D"}
@@ -5,12 +5,12 @@ export interface ConnectUrlOptions {
5
5
  provider: string;
6
6
  /**
7
7
  * Where to send the person afterwards: the app's own URL (absolute) or
8
- * a path on the Gateway. Absent: Settings → Connected accounts.
8
+ * a path on the Gateway. Absent: Your connections → Accounts.
9
9
  */
10
10
  returnTo?: string;
11
11
  }
12
12
  /** The path of the connect page for `provider` on the Gateway, without the app. */
13
13
  export declare function connectPath(provider: string): string;
14
- /** The absolute URL that connects the person to `provider` in this app. */
14
+ /** The absolute URL where the person connects `provider`, or allows this app to use their connection to it. */
15
15
  export declare function connectUrl({ env, provider, returnTo, }: ConnectUrlOptions): string;
16
16
  //# sourceMappingURL=connectUrl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectUrl.d.ts","sourceRoot":"","sources":["../../src/server/connectUrl.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,iBAAiB;IAChC,0GAA0G;IAC1G,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,EACzB,GAAG,EACH,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,GAAG,MAAM,CAwB5B"}
1
+ {"version":3,"file":"connectUrl.d.ts","sourceRoot":"","sources":["../../src/server/connectUrl.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,iBAAiB;IAChC,0GAA0G;IAC1G,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,+GAA+G;AAC/G,wBAAgB,UAAU,CAAC,EACzB,GAAG,EACH,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,GAAG,MAAM,CAwB5B"}
@@ -1,20 +1,25 @@
1
1
  /**
2
2
  * Where an app sends a person to connect an OAuth provider the Gateway
3
- * runs the flow for (docs/design/2026-11-oauth-simplify.md):
3
+ * runs the flow for, or to allow this app to use the connection they
4
+ * already have (docs/design/2026-11-oauth-one-connection.md):
4
5
  * `<gateway>/connect/<id>?app=<this app>&return=<back here>`. A
5
- * connection belongs to one person and one app: the Gateway checks the
6
- * session and that the person may open the app, asks the provider for
7
- * exactly the scopes the app's `everyapp.config.ts` lists (plus the ones
8
- * that name the account), finishes on its own callback and sends the
9
- * browser back to `returnTo`, which must be a path on the Gateway or an
10
- * https URL on one of its app hosts (in local dev also localhost).
6
+ * connection belongs to one person, and each app they allow uses it. The
7
+ * Gateway checks the session and that the person may open the app. With
8
+ * no connection, or one that lacks a scope the app's
9
+ * `everyapp.config.ts` lists, it asks the provider for every scope the
10
+ * organization's apps list (plus the ones that name the account),
11
+ * finishes on its own callback and allows this app. With a connection
12
+ * that holds what the app lists, it shows its own Allow page and asks no
13
+ * provider. Either way it sends the browser back to `returnTo`, which
14
+ * must be a path on the Gateway or an https URL on one of its app hosts
15
+ * (in local dev also localhost).
11
16
  */
12
17
  import { APP_ID_ENV, ConfigurationError } from "../internal/index.js";
13
18
  /** The path of the connect page for `provider` on the Gateway, without the app. */
14
19
  export function connectPath(provider) {
15
20
  return `/connect/${encodeURIComponent(provider)}`;
16
21
  }
17
- /** The absolute URL that connects the person to `provider` in this app. */
22
+ /** The absolute URL where the person connects `provider`, or allows this app to use their connection to it. */
18
23
  export function connectUrl({ env, provider, returnTo, }) {
19
24
  const values = env;
20
25
  const gateway = values["GATEWAY_URL"];
@@ -30,7 +35,7 @@ export function connectUrl({ env, provider, returnTo, }) {
30
35
  }
31
36
  const app = values[APP_ID_ENV];
32
37
  if (typeof app !== "string" || !app.trim()) {
33
- throw new ConfigurationError(`connectUrl() needs ${APP_ID_ENV} in the Worker env: a connection belongs to one app, and the deploy and everyapp dev set it.`);
38
+ throw new ConfigurationError(`connectUrl() needs ${APP_ID_ENV} in the Worker env: the link names the app that asks, and the deploy and everyapp dev set it.`);
34
39
  }
35
40
  const url = new URL(connectPath(provider), base.origin);
36
41
  url.searchParams.set("app", app.trim());
@@ -27,11 +27,12 @@ export interface IntegrationFetchOptions {
27
27
  * queues). A shared app's Worker must end up with one or the other
28
28
  * ({@link AttributionError}).
29
29
  *
30
- * For an OAuth provider the call uses the connection the person behind
31
- * it made in this app. `{ background: true, userId }` names another
32
- * member's connection to this app instead, at any time, even while
33
- * serving a different person: the call then carries that member and
34
- * not the person being served. Only an organization's own app may.
30
+ * For an OAuth provider the call uses the connection of the person
31
+ * behind it, which they allowed this app to use. `{ background: true,
32
+ * userId }` names another member's connection instead (one who allowed
33
+ * this app), at any time, even while serving a different person: the
34
+ * call then carries that member and not the person being served. Only
35
+ * an organization's own app may.
35
36
  */
36
37
  for?: GatewayCallFor;
37
38
  /**
@@ -54,10 +55,11 @@ export interface IntegrationFetchOptions {
54
55
  * {@link gatewayRefusal} recognizes; anything else is the provider's answer.
55
56
  *
56
57
  * For an OAuth provider (`google-workspace`, `github`, ...) the gateway
57
- * puts the token of the person's connection in this app on the call, to
58
- * the provider's API hosts only. Without one the answer is a 409
59
- * `integration_not_connected` refusal with the `connectPath` to send the
60
- * person to ({@link connectUrl}).
58
+ * puts the token of the person's connection on the call, to the
59
+ * provider's API hosts only, once the person allowed this app to use it.
60
+ * Without a connection, or before they allowed this app, the answer is a
61
+ * 409 `integration_not_connected` refusal with the `connectPath` to send
62
+ * the person to ({@link connectUrl}).
61
63
  *
62
64
  * In local dev only, with no binding, the developer's own key from
63
65
  * `.dev.vars` reaches the provider directly, under the gateway's names:
@@ -95,26 +97,30 @@ export interface IntegrationStatus extends SetupInfo {
95
97
  export type EmailIntegrationStatus = IntegrationStatus & Pick<EmailCapabilityStatus, "sender" | "senders" | "provider">;
96
98
  /**
97
99
  * An OAuth provider's status: as {@link IntegrationStatus}, plus the
98
- * scopes the app's manifest lists, where the person connects in this app,
99
- * and their connection to this app. `configured` means the gateway holds
100
- * the client; `ready` that a call for this person would go through.
100
+ * scopes the app's manifest lists, where the person connects or allows
101
+ * this app, and their connection once they allowed this app to use it.
102
+ * `configured` means the gateway holds the client; `ready` that a call
103
+ * for this person would go through.
101
104
  */
102
105
  export type OAuthClientIntegrationStatus = IntegrationStatus & {
103
106
  /** The provider's scopes as the app's `everyapp.config.ts` lists them. */
104
107
  scopes: readonly string[];
105
108
  /**
106
- * Where the person connects the provider in this app:
107
- * `/connect/<id>?app=<app>` on the Gateway ({@link connectUrl} builds
108
- * the absolute URL); null when the app can't connect (the manifest
109
- * doesn't list it, or the gateway holds no client).
109
+ * Where the person connects the provider, or allows this app to use
110
+ * their connection to it: `/connect/<id>?app=<app>` on the Gateway
111
+ * ({@link connectUrl} builds the absolute URL); null when the app can't
112
+ * connect (the manifest doesn't list it, or the gateway holds no
113
+ * client).
110
114
  */
111
115
  connectPath: string | null;
112
116
  /**
113
- * The connection the call would use (the person's in this app, or the
114
- * member's `for: { background: true, userId }` names), or null when there
115
- * is none. `ready` false with `missingScopes` when it lacks a scope the
116
- * app now lists, and `reconnect` when the person has to connect again
117
- * (missing scopes, or it expired).
117
+ * The connection the call would use (the person's, or the member's
118
+ * `for: { background: true, userId }` names), or null when there is
119
+ * none or they haven't allowed this app to use it. `ready` false with
120
+ * `missingScopes` when it lacks a scope the app now lists, or the app
121
+ * lists one the person hasn't allowed it, and `reconnect` when the
122
+ * person has to go through `connectPath` again (missing scopes, or it
123
+ * expired).
118
124
  */
119
125
  connection: {
120
126
  /** The account's name at the provider (an email address, a login). */
@@ -132,18 +138,18 @@ export type IntegrationStatusOf<P extends string> = P extends "email" ? EmailInt
132
138
  * Whether the app can use an integration right now, without calling the
133
139
  * provider: show "an admin needs to set up DataForSEO" (or "sending isn't
134
140
  * set up", or "connect Google") up front instead of failing mid-task. An
135
- * OAuth provider's status carries the person's connection in this app and
136
- * where to connect.
141
+ * OAuth provider's status carries the person's connection, once they
142
+ * allowed this app to use it, and where to connect or allow.
137
143
  */
138
144
  export declare function integrationStatus<P extends CapabilityId | (string & {})>({ env, provider, for: explicitTarget, }: {
139
145
  env: object;
140
146
  provider: P;
141
147
  /**
142
148
  * Whom the status is for: the request being served (its person), so an
143
- * OAuth provider's `connection` is that person's in this app; `{
144
- * background: true, userId }` that member's. Explicitly the inbound
145
- * request or `{ background: true, organizationId, userId? }`, as on
146
- * every call.
149
+ * OAuth provider's `connection` is that person's, once they allowed
150
+ * this app; `{ background: true, userId }` that member's. Explicitly
151
+ * the inbound request or `{ background: true, organizationId, userId?
152
+ * }`, as on every call.
147
153
  */
148
154
  for?: GatewayCallFor;
149
155
  }): Promise<IntegrationStatusOf<P>>;
@@ -1 +1 @@
1
- {"version":3,"file":"integrationFetch.d.ts","sourceRoot":"","sources":["../../src/server/integrationFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAE1B,KAAK,aAAa,EAKnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAO9C,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;OAOG;IACH,QAAQ,EAAE,kBAAkB,GAAG,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC7D;;;;;;;;;;;;;;OAcG;IACH,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,MAAM,GAAG,EAAE,CAAC,EACtC,EACA,GAAG,EACH,QAAQ,EACR,GAAG,EAAE,cAAc,GACpB,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,CAAC,CAAC;IACZ;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,cAAc,CAAC;CACtB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAWlC"}
@@ -90,9 +90,10 @@ export function devAccessTokenName(provider) {
90
90
  return `${providerSettingPrefix(provider)}ACCESS_TOKEN`;
91
91
  }
92
92
  /**
93
- * Where a person connects `provider` in this app:
94
- * `/connect/<id>?app=<EVERYAPP_APP_ID>`, as the gateway's refusal and
95
- * status name it (without the app id when the env has none).
93
+ * Where a person connects `provider`, or allows this app to use their
94
+ * connection to it: `/connect/<id>?app=<EVERYAPP_APP_ID>`, as the
95
+ * gateway's refusal and status name it (without the app id when the env
96
+ * has none).
96
97
  */
97
98
  function appConnectPath(provider, values) {
98
99
  const app = stringValue(values[APP_ID_ENV]);
@@ -217,8 +218,8 @@ function stringValue(value) {
217
218
  * Whether the app can use an integration right now, without calling the
218
219
  * provider: show "an admin needs to set up DataForSEO" (or "sending isn't
219
220
  * set up", or "connect Google") up front instead of failing mid-task. An
220
- * OAuth provider's status carries the person's connection in this app and
221
- * where to connect.
221
+ * OAuth provider's status carries the person's connection, once they
222
+ * allowed this app to use it, and where to connect or allow.
222
223
  */
223
224
  export async function integrationStatus({ env, provider, for: explicitTarget, }) {
224
225
  const status = await readIntegrationStatus({
@@ -316,9 +317,9 @@ async function readIntegrationStatus({ env, provider, for: explicitTarget, }) {
316
317
  response = await binding.fetch(statusUrl);
317
318
  }
318
319
  else {
319
- // Whose status: the person's identity (their connection in this
320
- // app), the member background work names, or the organization's,
321
- // as a call would carry it.
320
+ // Whose status: the person's identity (their connection, which
321
+ // they allowed this app), the member background work names, or the
322
+ // organization's, as a call would carry it.
322
323
  const headers = new Headers();
323
324
  applyAttribution(headers, target);
324
325
  response = await binding.fetch(statusUrl, { headers });
@@ -30,7 +30,7 @@ import type { ExecutionContextLike } from "./everyApp.js";
30
30
  * Reported with every catalog; must match package.json (a test checks).
31
31
  * `pnpm release <version>` (scripts/release.mjs) sets both in one commit.
32
32
  */
33
- export declare const SDK_VERSION = "0.3.0";
33
+ export declare const SDK_VERSION = "0.3.1";
34
34
  /**
35
35
  * Throw from a tool handler to return an error the model can read and act on
36
36
  * ("No todo with that id"). Any other error is logged here and reaches the
@@ -29,7 +29,7 @@ import { TOOL_NAME_PATTERN, catalogHash, isToolRisk, } from "../internal/index.j
29
29
  * Reported with every catalog; must match package.json (a test checks).
30
30
  * `pnpm release <version>` (scripts/release.mjs) sets both in one commit.
31
31
  */
32
- export const SDK_VERSION = "0.3.0";
32
+ export const SDK_VERSION = "0.3.1";
33
33
  const JSON_SCHEMA_TARGET = "draft-2020-12";
34
34
  const DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
35
35
  // The 2026-07-28 MCP revision lets a schema property ask clients to mirror an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@every-app/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",