Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Mar 5, 2024
1 parent 71b7184 commit 9bcfb44
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

[production]
node >= 20.9.0
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

# Locals

Expand Down
8 changes: 4 additions & 4 deletions .env.vault
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="3rfi+ClkONvfHPiU9FTBcC1+Um/L8QeM9dRw1jFzEqzZXw=="
DOTENV_VAULT_MAIN_VERSION=1

# dev
DOTENV_VAULT_DEV="a3bVmJ+WUFOs+Dy+D7eelQDQ9VtkM/idZ2GhuKuaSF+hzZf3LBRzr1LepbP95LkIpPrGa4FGcTV+o8ExXk1ksymZVPbY83ceAodas0Stsh5ADg22AMcj/YF+tC0Jlns6ahiLUMf3badW5jwR0nqPcYWI4/FwI67XcwLROHwP1dKviPpSigEYBkN4AiAi6dFai2t1y9bgddfxmwz2tDQ8IdzuBWvZutIqRMIDDtw97H3T9WhAp+Y6zoeRhqc4lDp0oNmQgzXDkfvrx6R8ohDs2InJK+e0PZjtrnPjXLM0csuk09CVBoDhkpYfpJHWkQlM+BOWbl80Zv0N5GXxpl4sM1obQHif/DuwCcwireUt8BcVfw1W39x7jQcxjlMSQJZljplcOcR8iXfxUSGulHnk5KUth7x+QQom/vkLRGBQqK0SylxIcUaMWGmpITha+tXeAk0CLNOZ0E1QWvMW4WDhUh7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

# stage
DOTENV_VAULT_STAGE="bfqZYD8oVLWMZ0JR5LICV+sB/btaXavszxZLxTfwSH8U5fg="
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

# Default

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

# Packages

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review `./settings.mjs`.
*
* Last generated using `./settings.mjs` Mar 5, 2024 6:33 PM UTC.
* Last generated using `./settings.mjs` Mar 5, 2024 7:09 PM UTC.
*/
{
"editor.formatOnType": false,
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Mar 5, 2024 6:33 PM UTC.
# Last generated Mar 5, 2024 7:09 PM UTC.

# Locals

Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.0.271",
"version": "1.0.272",
"license": "GPL-3.0-or-later",
"name": "@clevercanyon/utilities.cfw",
"description": "Utilities for JavaScript apps running in a Cloudflare Worker environment.",
Expand Down
2 changes: 1 addition & 1 deletion src/cfw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type StdExecutionContext = Readonly<
>;
export type StdEnvironment = Readonly<{
RT: $type.cfw.Fetcher;
RT_AI: $type.cfw.Fetcher;
RT_D1: $type.cfw.D1Database;
RT_R2: $type.cfw.R2Bucket;
RT_KV: $type.cfw.KVNamespace;
Expand All @@ -58,7 +59,6 @@ export type StdEnvironment = Readonly<{
D1: $type.cfw.D1Database;
R2: $type.cfw.R2Bucket;
KV: $type.cfw.KVNamespace;
DO: $type.cfw.DurableObjectNamespace;
}>;
export type StdRequestContextData = Readonly<{
ctx: StdExecutionContext;
Expand Down
19 changes: 19 additions & 0 deletions src/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ fetch.isAvailable = (rcData: $cfw.StdRequestContextData): boolean => {
return rcData.env.RT ? true : false;
};

/**
* Gets root AI binding.
*
* @param rcData Request context data; {@see $cfw.StdRequestContextData}.
*
* @returns Root AI binding.
*/
export const ai = (rcData: $cfw.StdRequestContextData): $type.cfw.Fetcher => {
const { env } = rcData,
ai = env.RT_AI || (rootPkgName === $app.pkgName() && env.AI);

if (!ai) throw Error('Root AI binding unavailable.');

return ai;
};
ai.isAvailable = (rcData: $cfw.StdRequestContextData): boolean => {
return rcData.env.RT_AI || (rootPkgName === $app.pkgName() && rcData.env.AI) ? true : false;
};

/**
* Gets root D1 binding.
*
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review `./tsconfig.mjs`.
*
* Last generated using `./tsconfig.mjs` Mar 5, 2024 6:33 PM UTC.
* Last generated using `./tsconfig.mjs` Mar 5, 2024 7:09 PM UTC.
*/
{
"include": ["./src/**/*", "./dev-types.d.ts"],
Expand Down
2 changes: 1 addition & 1 deletion wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @note This entire file will be updated automatically.
# @note Instead of editing here, please review `./wrangler.mjs`.
#
# Last generated using `./wrangler.mjs` Mar 5, 2024 6:33 PM UTC.
# Last generated using `./wrangler.mjs` Mar 5, 2024 7:09 PM UTC.
##

send_metrics = false
Expand Down

0 comments on commit 9bcfb44

Please sign in to comment.