@maxceem/agw 0.8.2 → 0.9.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/dist/agw.mjs +102 -8
- package/package.json +3 -1
package/dist/agw.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// <define:__AGW_MANIFEST__>
|
|
9
|
-
var define_AGW_MANIFEST_default = { version: "0.
|
|
9
|
+
var define_AGW_MANIFEST_default = { version: "0.9.0", wrangler: "4.96.0", upgradeFrom: ["0.9.0", "0.8.3", "0.8.2", "0.8.1", "0.8.0", "0.7.2", "0.7.1", "0.7.0", "0.6.4", "0.6.3", "0.6.2", "0.6.1", "0.6.0", "0.5.2", "0.5.1", "0.5.0", "0.4.0"], release: { url: "https://github.com/maxceem/app-ai-gateway/releases/download/v0.9.0/gateway-0.9.0.tar.gz", sha256: "9080326d72cb3541bd3995058a9ce4c10753eb9fd8cf9e9404c5905bc57288ce", manifest: "b2684dd1c5528f707723d2383b641bb917baa84e2a2164b020fd99dc6c20a63b" } };
|
|
10
10
|
|
|
11
11
|
// src/main.ts
|
|
12
12
|
import { Writable as Writable2 } from "node:stream";
|
|
@@ -15678,6 +15678,15 @@ var OAuthConsentAllowRequestSchema = external_exports.object({
|
|
|
15678
15678
|
description: "How much of the person's role the connection may use, whatever the client asked for."
|
|
15679
15679
|
})
|
|
15680
15680
|
}).strict();
|
|
15681
|
+
var ConsoleReturnPathSchema = external_exports.string().max(512).regex(/^\/(?![/\\])[^\\\s]*$/, "Must be a path on the console, beginning with a single /").meta({ description: "A path on the console to return to once the address is verified, such as an approval page." });
|
|
15682
|
+
var SendVerificationEmailRequestSchema = external_exports.object({
|
|
15683
|
+
returnTo: ConsoleReturnPathSchema.optional()
|
|
15684
|
+
}).strict();
|
|
15685
|
+
var ConfirmEmailVerificationRequestSchema = external_exports.object({
|
|
15686
|
+
token: external_exports.string().min(1).max(2048).meta({
|
|
15687
|
+
description: "The `token` query parameter of the link in the verification email."
|
|
15688
|
+
})
|
|
15689
|
+
}).strict();
|
|
15681
15690
|
|
|
15682
15691
|
// src/common.ts
|
|
15683
15692
|
import { randomBytes } from "node:crypto";
|
|
@@ -17122,7 +17131,7 @@ ${snippet}`;
|
|
|
17122
17131
|
...snippet ? { snippet } : {},
|
|
17123
17132
|
app: app2,
|
|
17124
17133
|
...key ? { applicationKey: key } : {},
|
|
17125
|
-
guidance: doc.config.authentication.type === "apple_app_attest" ? `Add https://github.com/maxceem/app-ai-gateway-swift from 1.
|
|
17134
|
+
guidance: doc.config.authentication.type === "apple_app_attest" ? `Add https://github.com/maxceem/app-ai-gateway-swift from 1.5.0, enable App Attest, and test on a supported physical device. Run agw app snippet ${app2.id} --provider <slug> for integration code. Production releases should use production-only App Attest.` : `Store the generated key on your server; never embed it in a mobile application. Run agw app snippet ${app2.id} for this request again.`
|
|
17126
17135
|
};
|
|
17127
17136
|
}
|
|
17128
17137
|
}
|
|
@@ -17395,7 +17404,14 @@ var ErrorResponseSchema = external_exports.object({
|
|
|
17395
17404
|
var HealthResponseSchema = external_exports.object({
|
|
17396
17405
|
ok: external_exports.literal(true),
|
|
17397
17406
|
service: external_exports.literal("app-ai-gateway"),
|
|
17398
|
-
vault: external_exports.enum(["ok", "misconfigured"])
|
|
17407
|
+
vault: external_exports.enum(["ok", "misconfigured"]),
|
|
17408
|
+
/**
|
|
17409
|
+
* Whether this deployment verifies email addresses: `off` with no way to
|
|
17410
|
+
* send email configured, `ok` with Cloudflare Email Service or SMTP ready to
|
|
17411
|
+
* send, `misconfigured` with one that cannot send yet (a setting missing or
|
|
17412
|
+
* contradictory), where verification is required and no link can be sent.
|
|
17413
|
+
*/
|
|
17414
|
+
email: external_exports.enum(["off", "ok", "misconfigured"])
|
|
17399
17415
|
});
|
|
17400
17416
|
var ConsoleCapabilitiesResponseSchema = external_exports.object({
|
|
17401
17417
|
billing: external_exports.boolean(),
|
|
@@ -17403,7 +17419,13 @@ var ConsoleCapabilitiesResponseSchema = external_exports.object({
|
|
|
17403
17419
|
googleAuth: external_exports.boolean(),
|
|
17404
17420
|
termsOfServiceUrl: external_exports.string().url().optional(),
|
|
17405
17421
|
privacyPolicyUrl: external_exports.string().url().optional(),
|
|
17406
|
-
apiBaseUrl: external_exports.string().url().optional()
|
|
17422
|
+
apiBaseUrl: external_exports.string().url().optional(),
|
|
17423
|
+
/**
|
|
17424
|
+
* Whether this deployment verifies email addresses. Where it does, an
|
|
17425
|
+
* account's apps serve requests only once its owner has verified theirs, and
|
|
17426
|
+
* the console offers the link to do it.
|
|
17427
|
+
*/
|
|
17428
|
+
emailVerification: external_exports.boolean()
|
|
17407
17429
|
});
|
|
17408
17430
|
var GoogleSignInResponseSchema = external_exports.object({
|
|
17409
17431
|
url: external_exports.url().meta({ description: "Provider authorization URL for the browser to navigate to." }),
|
|
@@ -17823,7 +17845,14 @@ var IdentitySessionSchema = external_exports.object({
|
|
|
17823
17845
|
kind: external_exports.enum(["human", "service"]),
|
|
17824
17846
|
credentialId: external_exports.string().nullable(),
|
|
17825
17847
|
actionSource: external_exports.string()
|
|
17826
|
-
}).nullable()
|
|
17848
|
+
}).nullable(),
|
|
17849
|
+
/**
|
|
17850
|
+
* Whether this account's apps refuse requests with `email_unverified`
|
|
17851
|
+
* right now: the deployment verifies addresses, the account is not
|
|
17852
|
+
* activated, and no owner of it has verified theirs. False wherever
|
|
17853
|
+
* traffic is served, an unverified owner of an activated account included.
|
|
17854
|
+
*/
|
|
17855
|
+
verificationPending: external_exports.boolean()
|
|
17827
17856
|
})
|
|
17828
17857
|
});
|
|
17829
17858
|
var OAuthConsentDetailsResponseSchema = external_exports.object({
|
|
@@ -17878,6 +17907,18 @@ var OAuthConsentRedirectResponseSchema = external_exports.object({
|
|
|
17878
17907
|
description: "The client's redirect URI with `code`, `state` and `iss`, or with `error=access_denied` after a denial. Navigate the browser there."
|
|
17879
17908
|
})
|
|
17880
17909
|
});
|
|
17910
|
+
var SendVerificationEmailResponseSchema = external_exports.object({
|
|
17911
|
+
status: external_exports.enum(["sent", "already_verified"]).meta({
|
|
17912
|
+
description: "`sent` when a link went out now; `already_verified` when the address needs none."
|
|
17913
|
+
}),
|
|
17914
|
+
email: external_exports.string().meta({ description: "The address the link was sent to, or that is already verified." })
|
|
17915
|
+
});
|
|
17916
|
+
var ConfirmEmailVerificationResponseSchema = external_exports.object({
|
|
17917
|
+
email: external_exports.string().meta({ description: "The address now verified." }),
|
|
17918
|
+
returnTo: external_exports.string().nullable().meta({
|
|
17919
|
+
description: "The console path the link was asked for from, to continue there; null for none."
|
|
17920
|
+
})
|
|
17921
|
+
});
|
|
17881
17922
|
var OrganizationListResponseSchema = external_exports.object({
|
|
17882
17923
|
organizations: external_exports.array(OrganizationMembershipSchema)
|
|
17883
17924
|
});
|
|
@@ -17938,7 +17979,10 @@ var AppCheckResponseSchema = external_exports.object({
|
|
|
17938
17979
|
description: "Every provider instance the application's routing names, a disabled one included so that it shows as disabled rather than missing."
|
|
17939
17980
|
}),
|
|
17940
17981
|
ready: external_exports.boolean().meta({
|
|
17941
|
-
description: "Whether the application is active
|
|
17982
|
+
description: "Whether the application is active, at least one provider it names is active, and the account may serve requests (`accountRefusal` is null)."
|
|
17983
|
+
}),
|
|
17984
|
+
accountRefusal: external_exports.enum(["email_unverified", "unclaimed_access_expired", "account_expired"]).nullable().meta({
|
|
17985
|
+
description: "Why the account would refuse this application's requests, as the error code its clients would get, or null when it would serve them. `email_unverified`: the account's owner has not verified their email address yet, on a deployment that verifies them; it clears once they open the link in the verification email."
|
|
17942
17986
|
}),
|
|
17943
17987
|
limitations: external_exports.array(external_exports.string()).meta({
|
|
17944
17988
|
description: "What this check did not exercise, one sentence each."
|
|
@@ -18198,7 +18242,13 @@ var CliApprovalRefusalSchema = external_exports.enum([
|
|
|
18198
18242
|
* this deployment does not give a person one of their own. Nothing on the
|
|
18199
18243
|
* page can fix that; an owner has to add them to an account first.
|
|
18200
18244
|
*/
|
|
18201
|
-
"no_eligible_organization"
|
|
18245
|
+
"no_eligible_organization",
|
|
18246
|
+
/**
|
|
18247
|
+
* A claim's approver has not verified their email address, on a deployment
|
|
18248
|
+
* that verifies them. The page offers to send the link; the claim can be
|
|
18249
|
+
* approved once it is opened.
|
|
18250
|
+
*/
|
|
18251
|
+
"verification_required"
|
|
18202
18252
|
]);
|
|
18203
18253
|
var CliViewerSchema = external_exports.object({
|
|
18204
18254
|
name: external_exports.string().nullable(),
|
|
@@ -19525,6 +19575,43 @@ var CATALOG = {
|
|
|
19525
19575
|
responseDescription: "The client's redirect URI with `error=access_denied`.",
|
|
19526
19576
|
errors: CONSENT_ERRORS
|
|
19527
19577
|
},
|
|
19578
|
+
/*
|
|
19579
|
+
* Email verification, on a deployment that sends email. Both are the
|
|
19580
|
+
* console's own and run on its origin alone. Neither needs an account: the
|
|
19581
|
+
* person approving a claim has none yet, and has to verify before the claim
|
|
19582
|
+
* can complete.
|
|
19583
|
+
*/
|
|
19584
|
+
sendVerificationEmail: {
|
|
19585
|
+
method: "POST",
|
|
19586
|
+
path: "/v1/console/email-verification/send",
|
|
19587
|
+
tags: ["Console email verification"],
|
|
19588
|
+
summary: "Email verification: send a link",
|
|
19589
|
+
description: "Sends a verification link to the address of the person signed in to this browser, for their console session only. Where the deployment verifies email addresses, an account's apps serve requests only once its owner has verified theirs, and a claim completes only for a person who has; nothing else waits for it. A link lasts 24 hours, and a sign-up with a password sends the first one itself. Counted per person.",
|
|
19590
|
+
security: "public",
|
|
19591
|
+
request: SendVerificationEmailRequestSchema,
|
|
19592
|
+
response: SendVerificationEmailResponseSchema,
|
|
19593
|
+
responseDescription: "Whether a link went out, and to which address.",
|
|
19594
|
+
errors: {
|
|
19595
|
+
401: "No person is signed in to this browser (`session_required`).",
|
|
19596
|
+
409: "This deployment does not verify email addresses, or the sign-in has no address of its own (`conflict`).",
|
|
19597
|
+
429: "Too many links were sent for this sign-in. Carries Retry-After.",
|
|
19598
|
+
503: "The deployment could not send the email (`email_unavailable`)."
|
|
19599
|
+
}
|
|
19600
|
+
},
|
|
19601
|
+
confirmEmailVerification: {
|
|
19602
|
+
method: "POST",
|
|
19603
|
+
path: "/v1/console/email-verification/confirm",
|
|
19604
|
+
tags: ["Console email verification"],
|
|
19605
|
+
summary: "Email verification: confirm a link",
|
|
19606
|
+
description: "Verifies the address a verification link was sent to. The link alone is the proof, so no sign-in is needed; it is bound to the sign-in and the address it was sent for, and stops working once it expires or the address changes. Confirming a link again answers the same.",
|
|
19607
|
+
security: "public",
|
|
19608
|
+
request: ConfirmEmailVerificationRequestSchema,
|
|
19609
|
+
response: ConfirmEmailVerificationResponseSchema,
|
|
19610
|
+
responseDescription: "The address verified, and where to continue.",
|
|
19611
|
+
errors: {
|
|
19612
|
+
400: "The link is malformed, has expired, or no longer matches the sign-in's address (`invalid_request`)."
|
|
19613
|
+
}
|
|
19614
|
+
},
|
|
19528
19615
|
cliBrowserGoogle: {
|
|
19529
19616
|
method: "POST",
|
|
19530
19617
|
path: "/v1/cli/browser/{id}/google",
|
|
@@ -21958,6 +22045,11 @@ function operation(result, style2) {
|
|
|
21958
22045
|
style2
|
|
21959
22046
|
);
|
|
21960
22047
|
}
|
|
22048
|
+
var ACCOUNT_REFUSALS = {
|
|
22049
|
+
email_unverified: "refuses requests until its owner verifies their email (email_unverified)",
|
|
22050
|
+
unclaimed_access_expired: "refuses requests until a person claims it (unclaimed_access_expired)",
|
|
22051
|
+
account_expired: "refuses requests: its recovery deadline has passed (account_expired)"
|
|
22052
|
+
};
|
|
21961
22053
|
function app(command, result, context, style2) {
|
|
21962
22054
|
if ("output" in result) return [style2.headline(`Saved: ${result.output}`)];
|
|
21963
22055
|
if ("ready" in result)
|
|
@@ -21969,7 +22061,9 @@ function app(command, result, context, style2) {
|
|
|
21969
22061
|
[
|
|
21970
22062
|
["Status", result.status],
|
|
21971
22063
|
["Providers", result.providers.length],
|
|
21972
|
-
["Active providers", result.providers.filter((p) => p.status === "active").length]
|
|
22064
|
+
["Active providers", result.providers.filter((p) => p.status === "active").length],
|
|
22065
|
+
// Absent from a gateway older than the field, which reports none.
|
|
22066
|
+
...result.accountRefusal ? [["Account", ACCOUNT_REFUSALS[result.accountRefusal]]] : []
|
|
21973
22067
|
],
|
|
21974
22068
|
style2
|
|
21975
22069
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxceem/agw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Manage App AI Gateway from a terminal or coding agent: providers, iOS and server apps, usage, and self-hosted deployment on Cloudflare",
|
|
6
6
|
"keywords": [
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"bugs": "https://github.com/maxceem/app-ai-gateway/issues",
|
|
28
28
|
"upgradeFrom": [
|
|
29
|
+
"0.8.3",
|
|
30
|
+
"0.8.2",
|
|
29
31
|
"0.8.1",
|
|
30
32
|
"0.8.0",
|
|
31
33
|
"0.7.2",
|