Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .claude/skills/backend-developer/di-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,9 @@ export type MapDependencies<T extends [...any]> = {
? // Support shorthand and long form.
[Abstraction<T[K]>, OptionalTrue & Partial<MultipleFalse>]
: // Support shorthand and long form.
| [Abstraction<T[K]>, MultipleFalse & Partial<OptionalFalse>]
| [Abstraction<T[K]>]
| Abstraction<T[K]>;
| [Abstraction<T[K]>, MultipleFalse & Partial<OptionalFalse>]
| [Abstraction<T[K]>]
| Abstraction<T[K]>;
};

export type Dependencies<T> = T extends Constructor
Expand Down
4 changes: 3 additions & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
".github/workflows/**/*.yml",
"./nextjs/",
"packages/admin-ui/storybook-static/**",
"**/*.hbs"
"**/*.hbs",
"*.yml",
"*.yaml"
],
"overrides": [
{
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
approvedGitRepositories:
- "https://github.com/webiny/webiny-upgrades-v6"

enableGlobalCache: true

compressionLevel: mixed

enableScripts: false
Expand Down
4 changes: 1 addition & 3 deletions ai-context/prds/admin-list-module/list-module-prd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2026,9 +2026,7 @@ export const PagesListModule = createListModule<Page, PageDTO, PageQueryParams>(
name: "pages",
gateway: PagesGateway,
mapper: PageMapper,
config: {
/* ... */
}
config: {/* ... */}
});

// Usage
Expand Down
4 changes: 1 addition & 3 deletions ai-context/prds/ai-powerups-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ declare module "@core/settings-types" {
```ts
class ProvidersHandler implements IAiPowerUpsSettingsGroupHandler<"providers", ProvidersApiWrite> {
readonly name = "providers" as const;
readonly inputSchema = z.object({
/* ... */
});
readonly inputSchema = z.object({/* ... */});

constructor(
private readonly encryption: Encryption.Interface,
Expand Down
6 changes: 3 additions & 3 deletions cypress-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"@webiny/build-tools": "0.0.0",
"@webiny/project-utils": "0.0.0",
"@webiny/utils": "0.0.0",
"amazon-cognito-identity-js": "^6.3.16",
"cypress": "^15.15.0",
"amazon-cognito-identity-js": "^6.3.20",
"cypress": "^15.18.1",
"cypress-image-snapshot": "^4.0.1",
"cypress-mailosaur": "^5.0.0",
"cypress-wait-until": "^3.0.2",
"del": "^8.0.1",
"graphql-request": "^7.4.0",
"lodash": "^4.18.1",
"nanoid": "^5.1.11",
"nanoid": "^5.1.16",
"typescript": "6.0.3",
"uniqid": "^5.4.0"
},
Expand Down
15 changes: 15 additions & 0 deletions extensions/idp/entraid/EntraIdApiConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { CognitoIdpConfig } from "@webiny/cognito/api";

class EntraIdConfig implements CognitoIdpConfig.Interface {
getIdentity(_token: CognitoIdpConfig.JwtPayload) {
return {
roles: ["full-access"],
teams: []
};
}
}

export default CognitoIdpConfig.createImplementation({
implementation: EntraIdConfig,
dependencies: []
});
49 changes: 49 additions & 0 deletions extensions/idp/entraid/Extension.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from "react";
import { Cognito } from "@webiny/cognito";

async function getCredentials() {
return {
client_id: process.env.ENTRA_CLIENT_ID,
client_secret: process.env.ENTRA_CLIENT_SECRET,
oidc_issuer: process.env.ENTRA_OIDC_ISSUER
};
}

export const CognitoFederation = () => {
return (
<Cognito
mfa={true}
apiConfig={"@/extensions/idp/entraid/EntraIdApiConfig.ts"}
federation={async () => {
const credentials = await getCredentials();

return {
domain: "myproj-webiny-with-entraid",
callbackUrls: ["https://webiny-6.4.x.localhost"],
responseType: "code",
allowCredentialsLogin: true,
identityProviders: [
{
name: "EntraID",
type: "oidc",
label: "Sign in with Microsoft",
providerDetails: {
attributes_request_method: "POST",
authorize_scopes: "email profile openid",
...credentials
},
attributeMapping: {
"custom:id": "sub",
username: "sub",
email: "email",
given_name: "given_name",
family_name: "family_name",
preferred_username: "email"
}
}
]
};
}}
/>
);
};
150 changes: 150 additions & 0 deletions extensions/models/BannerModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import { ModelFactory } from "webiny/api/cms/model";

class BannerModelImpl implements ModelFactory.Interface {
async execute(builder: ModelFactory.Builder) {
return [
builder
.public({
modelId: "siteBanner",
name: "Banner",
group: "ungrouped"
})
.description("Site and special offer banners.")
.fields(fields => ({
name: fields
.text()
.renderer("textInput")
.label("Name")
.required("Name is required.")
.minLength(2)
.maxLength(100),
bannerTypes: fields
.dynamicZone()
.renderer("dynamicZone")
.label("Banner Type")
.template("siteBanner", {
name: "Site Banner",
gqlTypeName: "SiteBannerBlock",
fields: templateFields => ({
enabled: templateFields
.boolean()
.renderer("switch")
.label("Enabled"),
text: templateFields
.richText()
.renderer("lexicalEditor")
.label("Text"),
backgroundColor: templateFields
.text()
.renderer("dropdown")
.label("Background Color")
.predefinedValues([
{ label: "Teal: #009CA6", value: "#009CA6" },
{ label: "Navy: #00205B", value: "#00205B" },
{ label: "Yellow: #EDE04B", value: "#EDE04B" }
]),
additionalInformation: templateFields
.boolean()
.renderer("switch")
.label("Additional Information")
.description(
"Enable this option to add additional information for the banner."
),
additionalInfoTab: templateFields
.uiTabs()
.label("Tab")
.tab("Additional Information", {
label: "Additional Information",
description: "Additional information for the banner.",
fields: tabFields => ({
additionalInformationText: tabFields
.richText()
.renderer("lexicalEditor")
.label("Additional Information Text")
}),
layout: [["additionalInformationText"]]
})
.rules([
{
type: "condition",
target: "$.additionalInformation",
operator: "!=",
value: true,
action: "hide"
}
]),
global: templateFields
.boolean()
.renderer("switch")
.label("Global")
.description(
"Global banners will be displayed on all pages of the website."
),
locationTab: templateFields
.uiTabs()
.label("Location")
.tab("Location", {
label: "Location",
description: "Location for the banner.",
fields: tabFields => ({
location: tabFields
.text()
.label("Location")
.renderer("textInput")
.required("Location is required.")
}),
layout: [["location"]]
})
.rules([
{
type: "condition",
target: "$.global",
operator: "==",
value: true,
action: "hide"
}
])
}),
layout: [
["enabled"],
["text"],
["backgroundColor"],
["additionalInformation"],
["additionalInfoTab"],
["global"],
["locationTab"]
]
})
.template("specialOfferBanner", {
name: "Special Offer Banner",
gqlTypeName: "SpecialOfferBannerBlock",
fields: templateFields => ({
enabled: templateFields
.boolean()
.renderer("switch")
.label("Enabled"),
text: templateFields
.richText()
.renderer("lexicalEditor")
.label("Text"),
ctaLabel: templateFields
.text()
.renderer("textInput")
.label("CTA Label"),
ctaUrl: templateFields.text().renderer("textInput").label("CTA URL")
}),
layout: [["enabled"], ["text"], ["ctaLabel", "ctaUrl"]]
})
}))
.layout([["name"], ["bannerTypes"]])
.titleFieldId("name")
.singularApiName("Banner")
.pluralApiName("Banners")
];
}
}

export default ModelFactory.createImplementation({
implementation: BannerModelImpl,
dependencies: []
});
Loading