@webiny/project 6.6.0-alpha.12 → 6.6.0-alpha.14
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/components/FeatureFlag.js +9 -9
- package/components/FeatureFlag.js.map +1 -1
- package/defineExtension/createExtensionReactComponent.js.map +1 -1
- package/extensions/FeatureFlags.d.ts +2 -0
- package/extensions/FeatureFlags.js +3 -1
- package/extensions/FeatureFlags.js.map +1 -1
- package/extensions/api/BackgroundTasks.js +1 -1
- package/extensions/api/BackgroundTasks.js.map +1 -1
- package/extensions/api/Cms/ModelFieldCompression.js +1 -1
- package/extensions/api/Cms/ModelFieldCompression.js.map +1 -1
- package/extensions/api/Route/ApiRoute.js +1 -1
- package/extensions/api/Route/ApiRoute.js.map +1 -1
- package/extensions/api/index.d.ts +0 -2
- package/extensions/api/index.js +0 -2
- package/extensions/index.d.ts +11 -16
- package/extensions/index.js +2 -3
- package/extensions/index.js.map +1 -1
- package/features/BuildApp/PackagesBuilder/worker.js +6 -6
- package/features/BuildApp/PackagesBuilder/worker.js.map +1 -1
- package/features/Watch/watchers/worker.js +6 -6
- package/features/Watch/watchers/worker.js.map +1 -1
- package/package.json +18 -19
- package/services/GetProjectConfigService/EnvContext.js.map +1 -1
- package/services/GetProjectConfigService/FeatureFlagsContext.js.map +1 -1
- package/services/GetProjectConfigService/ProductionEnvironmentsContext.js.map +1 -1
- package/services/GetProjectConfigService/WcpProjectLicenseContext.d.ts +1 -0
- package/services/GetProjectConfigService/WcpProjectLicenseContext.js +2 -1
- package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
- package/tenantStorages/index.d.ts +1 -0
- package/tenantStorages/index.js +1 -0
- package/tenantStorages/tenantStorageDeclarations.d.ts +42 -0
- package/tenantStorages/tenantStorageDeclarations.js +33 -0
- package/tenantStorages/tenantStorageDeclarations.js.map +1 -0
- package/extensions/api/Mailer/Smtp.d.ts +0 -8
- package/extensions/api/Mailer/Smtp.js +0 -22
- package/extensions/api/Mailer/Smtp.js.map +0 -1
- package/extensions/api/Mailer/Smtp.test.d.ts +0 -1
- package/extensions/api/Mailer/Smtp.test.js +0 -127
- package/extensions/api/Mailer/Smtp.test.js.map +0 -1
- package/extensions/api/Mailer/SmtpParamsSchema.d.ts +0 -9
- package/extensions/api/Mailer/SmtpParamsSchema.js +0 -17
- package/extensions/api/Mailer/SmtpParamsSchema.js.map +0 -1
|
@@ -44,15 +44,15 @@ function CanUseWebhooks({ children }) {
|
|
|
44
44
|
return flags.isExplicitlyDisabled("webhooks") ? null : /*#__PURE__*/ react.createElement(react.Fragment, null, children);
|
|
45
45
|
}
|
|
46
46
|
const FeatureFlag = {
|
|
47
|
-
CanUse
|
|
48
|
-
CanUseMultiTenancy
|
|
49
|
-
CanUseWorkflows
|
|
50
|
-
CanUseTeams
|
|
51
|
-
CanUsePrivateFiles
|
|
52
|
-
CanUseFileManagerThreatDetection
|
|
53
|
-
CanUseHcmsFieldPermissions
|
|
54
|
-
CanUseAiPowerups
|
|
55
|
-
CanUseWebhooks
|
|
47
|
+
CanUse,
|
|
48
|
+
CanUseMultiTenancy,
|
|
49
|
+
CanUseWorkflows,
|
|
50
|
+
CanUseTeams,
|
|
51
|
+
CanUsePrivateFiles,
|
|
52
|
+
CanUseFileManagerThreatDetection,
|
|
53
|
+
CanUseHcmsFieldPermissions,
|
|
54
|
+
CanUseAiPowerups,
|
|
55
|
+
CanUseWebhooks
|
|
56
56
|
};
|
|
57
57
|
export { FeatureFlag };
|
|
58
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/FeatureFlag.js","sources":["../../src/components/FeatureFlag.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FeatureFlagName } from \"@webiny/feature-flags\";\nimport { useProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\ninterface CanUseProps {\n name: FeatureFlagName;\n children: React.ReactNode;\n}\n\nfunction CanUse({ name, children }: CanUseProps) {\n const flags = useProjectFeatureFlags();\n return flags.isEnabled(name) ? <>{children}</> : null;\n}\n\nfunction CanUseMultiTenancy({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"multiTenancy\">{children}</CanUse>;\n}\n\nfunction CanUseWorkflows({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedPublishingWorkflow\">{children}</CanUse>;\n}\n\nfunction CanUseTeams({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.teams\">{children}</CanUse>;\n}\n\nfunction CanUsePrivateFiles({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.privateFiles\">{children}</CanUse>;\n}\n\nfunction CanUseFileManagerThreatDetection({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"fileManager.threatDetection\">{children}</CanUse>;\n}\n\nfunction CanUseHcmsFieldPermissions({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.hcmsFieldPermissions\">{children}</CanUse>;\n}\n\nfunction CanUseAiPowerups({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"aiPowerups\">{children}</CanUse>;\n}\n\n/**\n * Webhooks are on unless the project sets `webhooks: false`, so this can't go through `CanUse`:\n * `isEnabled` reads an unset flag as off (and, for a flag the license doesn't list, as off without a\n * license).\n */\nfunction CanUseWebhooks({ children }: { children: React.ReactNode }) {\n const flags = useProjectFeatureFlags();\n return flags.isExplicitlyDisabled(\"webhooks\") ? null : <>{children}</>;\n}\n\nexport const FeatureFlag = {\n CanUse,\n CanUseMultiTenancy,\n CanUseWorkflows,\n CanUseTeams,\n CanUsePrivateFiles,\n CanUseFileManagerThreatDetection,\n CanUseHcmsFieldPermissions,\n CanUseAiPowerups,\n CanUseWebhooks\n};\n"],"names":["CanUse","name","children","flags","useProjectFeatureFlags","CanUseMultiTenancy","CanUseWorkflows","CanUseTeams","CanUsePrivateFiles","CanUseFileManagerThreatDetection","CanUseHcmsFieldPermissions","CanUseAiPowerups","CanUseWebhooks","FeatureFlag"],"mappings":";;AASA,SAASA,OAAO,EAAEC,IAAI,EAAEC,QAAQ,EAAe;IAC3C,MAAMC,QAAQC;IACd,OAAOD,MAAM,SAAS,CAACF,QAAQ,WAARA,GAAQ,0CAAGC,YAAe;AACrD;AAEA,SAASG,mBAAmB,EAAEH,QAAQ,EAAiC;IACnE,OAAO,WAAP,GAAO,oBAACF,
|
|
1
|
+
{"version":3,"file":"components/FeatureFlag.js","sources":["../../src/components/FeatureFlag.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FeatureFlagName } from \"@webiny/feature-flags\";\nimport { useProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\ninterface CanUseProps {\n name: FeatureFlagName;\n children: React.ReactNode;\n}\n\nfunction CanUse({ name, children }: CanUseProps) {\n const flags = useProjectFeatureFlags();\n return flags.isEnabled(name) ? <>{children}</> : null;\n}\n\nfunction CanUseMultiTenancy({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"multiTenancy\">{children}</CanUse>;\n}\n\nfunction CanUseWorkflows({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedPublishingWorkflow\">{children}</CanUse>;\n}\n\nfunction CanUseTeams({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.teams\">{children}</CanUse>;\n}\n\nfunction CanUsePrivateFiles({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.privateFiles\">{children}</CanUse>;\n}\n\nfunction CanUseFileManagerThreatDetection({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"fileManager.threatDetection\">{children}</CanUse>;\n}\n\nfunction CanUseHcmsFieldPermissions({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.hcmsFieldPermissions\">{children}</CanUse>;\n}\n\nfunction CanUseAiPowerups({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"aiPowerups\">{children}</CanUse>;\n}\n\n/**\n * Webhooks are on unless the project sets `webhooks: false`, so this can't go through `CanUse`:\n * `isEnabled` reads an unset flag as off (and, for a flag the license doesn't list, as off without a\n * license).\n */\nfunction CanUseWebhooks({ children }: { children: React.ReactNode }) {\n const flags = useProjectFeatureFlags();\n return flags.isExplicitlyDisabled(\"webhooks\") ? null : <>{children}</>;\n}\n\nexport const FeatureFlag = {\n CanUse,\n CanUseMultiTenancy,\n CanUseWorkflows,\n CanUseTeams,\n CanUsePrivateFiles,\n CanUseFileManagerThreatDetection,\n CanUseHcmsFieldPermissions,\n CanUseAiPowerups,\n CanUseWebhooks\n};\n"],"names":["CanUse","name","children","flags","useProjectFeatureFlags","CanUseMultiTenancy","CanUseWorkflows","CanUseTeams","CanUsePrivateFiles","CanUseFileManagerThreatDetection","CanUseHcmsFieldPermissions","CanUseAiPowerups","CanUseWebhooks","FeatureFlag"],"mappings":";;AASA,SAASA,OAAO,EAAEC,IAAI,EAAEC,QAAQ,EAAe;IAC3C,MAAMC,QAAQC;IACd,OAAOD,MAAM,SAAS,CAACF,QAAQ,WAARA,GAAQ,0CAAGC,YAAe;AACrD;AAEA,SAASG,mBAAmB,EAAEH,QAAQ,EAAiC;IACnE,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAAgBE;AACxC;AAEA,SAASI,gBAAgB,EAAEJ,QAAQ,EAAiC;IAChE,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAA8BE;AACtD;AAEA,SAASK,YAAY,EAAEL,QAAQ,EAAiC;IAC5D,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAAoCE;AAC5D;AAEA,SAASM,mBAAmB,EAAEN,QAAQ,EAAiC;IACnE,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAA2CE;AACnE;AAEA,SAASO,iCAAiC,EAAEP,QAAQ,EAAiC;IACjF,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAA+BE;AACvD;AAEA,SAASQ,2BAA2B,EAAER,QAAQ,EAAiC;IAC3E,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAAmDE;AAC3E;AAEA,SAASS,iBAAiB,EAAET,QAAQ,EAAiC;IACjE,OAAO,WAAP,GAAO,oBAACF,QAAAA;QAAO,MAAK;OAAcE;AACtC;AAOA,SAASU,eAAe,EAAEV,QAAQ,EAAiC;IAC/D,MAAMC,QAAQC;IACd,OAAOD,MAAM,oBAAoB,CAAC,cAAc,OAAO,WAAP,GAAO,0CAAGD;AAC9D;AAEO,MAAMW,cAAc;IACvBb;IACAK;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineExtension/createExtensionReactComponent.js","sources":["../../src/defineExtension/createExtensionReactComponent.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { type DefineExtensionParams } from \"./types.js\";\nimport { type z } from \"zod\";\nimport { assertHostingType } from \"~/extensions/hosting/assertHostingType.js\";\nimport { getExtensionImplementation } from \"~/extensions/hosting/getExtensionImplementation.js\";\n\nconst KeyValues = (props: Record<string, any>) => {\n const getId = useIdGenerator(\"\");\n return Object.entries(props).map(([key, value]) => {\n return <Property key={key} name={key} id={getId(key)} value={value} />;\n });\n};\n\ntype ExtensionReactComponentProps<TParamsSchema extends z.ZodTypeAny> = z.infer<TParamsSchema> & {\n remove?: boolean;\n before?: string;\n after?: string;\n name?: string;\n};\n\nexport function createExtensionReactComponent<TParamsSchema extends z.ZodTypeAny>(\n extensionParams: DefineExtensionParams<TParamsSchema>\n) {\n const ExtensionProperty: React.FC<ExtensionReactComponentProps<TParamsSchema>> = props => {\n const { name, remove, before, after, ...keyValues } = props;\n\n const getId = useIdGenerator(extensionParams.type);\n\n // By passing undefined, we're letting RP generate a unique ID for us.\n const propertyId = useMemo(() => {\n if (extensionParams.multiple) {\n return name ? getId(name) : undefined;\n }\n\n return getId(extensionParams.type);\n }, [name, extensionParams.multiple, getId]);\n\n const propertyName = name || extensionParams.type;\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n // @ts-expect-error move KeyValues back inside the Property component to avoid this error\n const KeyValuesComponent = parentProps => <KeyValues {...parentProps} {...keyValues} />;\n\n return (\n <>\n <Property\n id={propertyId}\n name={propertyName}\n array={extensionParams.multiple}\n remove={remove}\n before={placeBefore}\n after={placeAfter}\n >\n <KeyValuesComponent />\n </Property>\n {extensionParams.render && extensionParams.render(props)}\n </>\n );\n };\n\n const ExtensionReactComponent: React.FC<\n ExtensionReactComponentProps<TParamsSchema>\n > = props => {\n assertHostingType(extensionParams.type, extensionParams.tags.hosting);\n\n /*\n * A hosting package may have registered its own component for this extension type. That\n * component is created by `defineExtension` too, so it finds itself here and renders as\n * usual.\n */\n const Implementation = getExtensionImplementation(extensionParams.type);\n if (Implementation && Implementation !== ExtensionReactComponent) {\n return <Implementation {...props} />;\n }\n\n return <ExtensionProperty {...props} />;\n };\n\n ExtensionReactComponent.displayName = `ExtensionReactComponent(${extensionParams.type})`;\n return ExtensionReactComponent;\n}\n"],"names":["KeyValues","props","getId","useIdGenerator","Object","key","value","Property","createExtensionReactComponent","extensionParams","ExtensionProperty","name","remove","before","after","keyValues","propertyId","useMemo","undefined","propertyName","placeAfter","placeBefore","KeyValuesComponent","parentProps","ExtensionReactComponent","assertHostingType","Implementation","getExtensionImplementation"],"mappings":";;;;AAOA,MAAMA,YAAY,CAACC;IACf,MAAMC,QAAQC,eAAe;IAC7B,OAAOC,OAAO,OAAO,CAACH,OAAO,GAAG,CAAC,CAAC,CAACI,KAAKC,MAAM,GACnC,WAAP,GAAO,oBAACC,UAAQA;YAAC,KAAKF;YAAK,MAAMA;YAAK,IAAIH,MAAMG;YAAM,OAAOC;;AAErE;AASO,SAASE,8BACZC,eAAqD;IAErD,MAAMC,oBAA2ET,CAAAA;QAC7E,MAAM,EAAEU,IAAI,EAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGC,WAAW,GAAGd;QAEtD,MAAMC,QAAQC,eAAeM,gBAAgB,IAAI;QAGjD,MAAMO,aAAaC,QAAQ;YACvB,IAAIR,gBAAgB,QAAQ,EACxB,OAAOE,OAAOT,MAAMS,QAAQO;YAGhC,OAAOhB,MAAMO,gBAAgB,IAAI;QACrC,GAAG;YAACE;YAAMF,gBAAgB,QAAQ;YAAEP;SAAM;QAE1C,MAAMiB,eAAeR,QAAQF,gBAAgB,IAAI;QAEjD,MAAMW,aAAaN,AAAUI,WAAVJ,QAAsBZ,MAAMY,SAASI;QACxD,MAAMG,cAAcR,AAAWK,WAAXL,SAAuBX,MAAMW,UAAUK;QAG3D,MAAMI,qBAAqBC,CAAAA,cAAAA,WAAAA,GAAe,oBAACvB,
|
|
1
|
+
{"version":3,"file":"defineExtension/createExtensionReactComponent.js","sources":["../../src/defineExtension/createExtensionReactComponent.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Property, useIdGenerator } from \"@webiny/react-properties\";\nimport { type DefineExtensionParams } from \"./types.js\";\nimport { type z } from \"zod\";\nimport { assertHostingType } from \"~/extensions/hosting/assertHostingType.js\";\nimport { getExtensionImplementation } from \"~/extensions/hosting/getExtensionImplementation.js\";\n\nconst KeyValues = (props: Record<string, any>) => {\n const getId = useIdGenerator(\"\");\n return Object.entries(props).map(([key, value]) => {\n return <Property key={key} name={key} id={getId(key)} value={value} />;\n });\n};\n\ntype ExtensionReactComponentProps<TParamsSchema extends z.ZodTypeAny> = z.infer<TParamsSchema> & {\n remove?: boolean;\n before?: string;\n after?: string;\n name?: string;\n};\n\nexport function createExtensionReactComponent<TParamsSchema extends z.ZodTypeAny>(\n extensionParams: DefineExtensionParams<TParamsSchema>\n) {\n const ExtensionProperty: React.FC<ExtensionReactComponentProps<TParamsSchema>> = props => {\n const { name, remove, before, after, ...keyValues } = props;\n\n const getId = useIdGenerator(extensionParams.type);\n\n // By passing undefined, we're letting RP generate a unique ID for us.\n const propertyId = useMemo(() => {\n if (extensionParams.multiple) {\n return name ? getId(name) : undefined;\n }\n\n return getId(extensionParams.type);\n }, [name, extensionParams.multiple, getId]);\n\n const propertyName = name || extensionParams.type;\n\n const placeAfter = after !== undefined ? getId(after) : undefined;\n const placeBefore = before !== undefined ? getId(before) : undefined;\n\n // @ts-expect-error move KeyValues back inside the Property component to avoid this error\n const KeyValuesComponent = parentProps => <KeyValues {...parentProps} {...keyValues} />;\n\n return (\n <>\n <Property\n id={propertyId}\n name={propertyName}\n array={extensionParams.multiple}\n remove={remove}\n before={placeBefore}\n after={placeAfter}\n >\n <KeyValuesComponent />\n </Property>\n {extensionParams.render && extensionParams.render(props)}\n </>\n );\n };\n\n const ExtensionReactComponent: React.FC<\n ExtensionReactComponentProps<TParamsSchema>\n > = props => {\n assertHostingType(extensionParams.type, extensionParams.tags.hosting);\n\n /*\n * A hosting package may have registered its own component for this extension type. That\n * component is created by `defineExtension` too, so it finds itself here and renders as\n * usual.\n */\n const Implementation = getExtensionImplementation(extensionParams.type);\n if (Implementation && Implementation !== ExtensionReactComponent) {\n return <Implementation {...props} />;\n }\n\n return <ExtensionProperty {...props} />;\n };\n\n ExtensionReactComponent.displayName = `ExtensionReactComponent(${extensionParams.type})`;\n return ExtensionReactComponent;\n}\n"],"names":["KeyValues","props","getId","useIdGenerator","Object","key","value","Property","createExtensionReactComponent","extensionParams","ExtensionProperty","name","remove","before","after","keyValues","propertyId","useMemo","undefined","propertyName","placeAfter","placeBefore","KeyValuesComponent","parentProps","ExtensionReactComponent","assertHostingType","Implementation","getExtensionImplementation"],"mappings":";;;;AAOA,MAAMA,YAAY,CAACC;IACf,MAAMC,QAAQC,eAAe;IAC7B,OAAOC,OAAO,OAAO,CAACH,OAAO,GAAG,CAAC,CAAC,CAACI,KAAKC,MAAM,GACnC,WAAP,GAAO,oBAACC,UAAQA;YAAC,KAAKF;YAAK,MAAMA;YAAK,IAAIH,MAAMG;YAAM,OAAOC;;AAErE;AASO,SAASE,8BACZC,eAAqD;IAErD,MAAMC,oBAA2ET,CAAAA;QAC7E,MAAM,EAAEU,IAAI,EAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGC,WAAW,GAAGd;QAEtD,MAAMC,QAAQC,eAAeM,gBAAgB,IAAI;QAGjD,MAAMO,aAAaC,QAAQ;YACvB,IAAIR,gBAAgB,QAAQ,EACxB,OAAOE,OAAOT,MAAMS,QAAQO;YAGhC,OAAOhB,MAAMO,gBAAgB,IAAI;QACrC,GAAG;YAACE;YAAMF,gBAAgB,QAAQ;YAAEP;SAAM;QAE1C,MAAMiB,eAAeR,QAAQF,gBAAgB,IAAI;QAEjD,MAAMW,aAAaN,AAAUI,WAAVJ,QAAsBZ,MAAMY,SAASI;QACxD,MAAMG,cAAcR,AAAWK,WAAXL,SAAuBX,MAAMW,UAAUK;QAG3D,MAAMI,qBAAqBC,CAAAA,cAAAA,WAAAA,GAAe,oBAACvB,WAAAA;gBAAW,GAAGuB,WAAW;gBAAG,GAAGR,SAAS;;QAEnF,OAAO,WAAP,GACI,wDACI,oBAACR,UAAQA;YACL,IAAIS;YACJ,MAAMG;YACN,OAAOV,gBAAgB,QAAQ;YAC/B,QAAQG;YACR,QAAQS;YACR,OAAOD;yBAEP,oBAACE,oBAAAA,QAEJb,gBAAgB,MAAM,IAAIA,gBAAgB,MAAM,CAACR;IAG9D;IAEA,MAAMuB,0BAEFvB,CAAAA;QACAwB,kBAAkBhB,gBAAgB,IAAI,EAAEA,gBAAgB,IAAI,CAAC,OAAO;QAOpE,MAAMiB,iBAAiBC,2BAA2BlB,gBAAgB,IAAI;QACtE,IAAIiB,kBAAkBA,mBAAmBF,yBACrC,OAAO,WAAP,GAAO,oBAACE,gBAAmBzB;QAG/B,OAAO,WAAP,GAAO,oBAACS,mBAAsBT;IAClC;IAEAuB,wBAAwB,WAAW,GAAG,CAAC,wBAAwB,EAAEf,gBAAgB,IAAI,CAAC,CAAC,CAAC;IACxF,OAAOe;AACX"}
|
|
@@ -25,6 +25,7 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
|
|
|
25
25
|
}, z.core.$strip>>;
|
|
26
26
|
lexicalGeneration: z.ZodOptional<z.ZodBoolean>;
|
|
27
27
|
adminAssistant: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
remoteComponents: z.ZodOptional<z.ZodBoolean>;
|
|
28
29
|
cms: z.ZodOptional<z.ZodObject<{
|
|
29
30
|
entryGeneration: z.ZodOptional<z.ZodBoolean>;
|
|
30
31
|
entryComparison: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -37,5 +38,6 @@ export declare const FeatureFlags: import("~/defineExtension/index.js").Extensio
|
|
|
37
38
|
activityLog: z.ZodOptional<z.ZodBoolean>;
|
|
38
39
|
}, z.core.$strip>]>>;
|
|
39
40
|
webhooks: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
perTenantStorage: z.ZodOptional<z.ZodBoolean>;
|
|
40
42
|
}, z.core.$strip>;
|
|
41
43
|
}, z.core.$strip>>;
|
|
@@ -42,6 +42,7 @@ const FeatureFlags = defineExtension({
|
|
|
42
42
|
}).optional(),
|
|
43
43
|
lexicalGeneration: z.boolean().optional(),
|
|
44
44
|
adminAssistant: z.boolean().optional(),
|
|
45
|
+
remoteComponents: z.boolean().optional(),
|
|
45
46
|
cms: z.object({
|
|
46
47
|
entryGeneration: z.boolean().optional(),
|
|
47
48
|
entryComparison: z.boolean().optional(),
|
|
@@ -57,7 +58,8 @@ const FeatureFlags = defineExtension({
|
|
|
57
58
|
activityLog: z.boolean().optional()
|
|
58
59
|
})
|
|
59
60
|
]).optional(),
|
|
60
|
-
webhooks: z.boolean().optional()
|
|
61
|
+
webhooks: z.boolean().optional(),
|
|
62
|
+
perTenantStorage: z.boolean().optional()
|
|
61
63
|
})
|
|
62
64
|
}),
|
|
63
65
|
render: ({ features = {} })=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/FeatureFlags.js","sources":["../../src/extensions/FeatureFlags.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { setProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\nexport const FeatureFlags = defineExtension({\n type: \"FeatureFlags\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Enable or disable features.\",\n paramsSchema: z.object({\n // Follows `IFeatureFlagsDto` from `packages/feature-flags/src/types.ts`.\n features: z.object({\n multiTenancy: z.boolean().optional(),\n languages: z.boolean().optional(),\n advancedPublishingWorkflow: z.boolean().optional(),\n advancedAccessControlLayer: z\n .union([\n z.boolean(),\n z.object({\n teams: z.boolean().optional(),\n privateFiles: z.boolean().optional(),\n folderLevelPermissions: z.boolean().optional(),\n hcmsFieldPermissions: z.boolean().optional()\n })\n ])\n .optional(),\n auditLogs: z.boolean().optional(),\n recordLocking: z.boolean().optional(),\n fileManager: z\n .object({\n threatDetection: z.boolean().optional()\n })\n .optional(),\n aiPowerups: z\n .union([\n z.boolean(),\n z.object({\n websiteBuilder: z\n .object({\n pageGeneration: z.boolean().optional(),\n pageTranslation: z.boolean().optional()\n })\n .optional(),\n fileManager: z\n .object({\n imageEnrichment: z.boolean().optional()\n })\n .optional(),\n lexicalGeneration: z.boolean().optional(),\n adminAssistant: z.boolean().optional(),\n cms: z\n .object({\n entryGeneration: z.boolean().optional(),\n entryComparison: z.boolean().optional(),\n entryTranslation: z.boolean().optional()\n })\n .optional()\n })\n ])\n .optional(),\n abTesting: z.boolean().optional(),\n collaboration: z\n .union([\n z.boolean(),\n z.object({\n comments: z.boolean().optional(),\n activityLog: z.boolean().optional()\n })\n ])\n .optional(),\n webhooks: z.boolean().optional()\n })\n }),\n render: ({ features = {} }) => {\n setProjectFeatureFlags(features);\n return (\n <>\n <BuildParam paramName=\"FeatureFlags\" value={features} />\n <AdminBuildParam paramName=\"FeatureFlags\" value={features} />\n </>\n );\n }\n});\n"],"names":["FeatureFlags","defineExtension","z","features","setProjectFeatureFlags","BuildParam","AdminBuildParam"],"mappings":";;;;;;AAOO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QAEnB,UAAUA,EAAE,MAAM,CAAC;YACf,cAAcA,EAAE,OAAO,GAAG,QAAQ;YAClC,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,4BAA4BA,EAAE,OAAO,GAAG,QAAQ;YAChD,4BAA4BA,EAAAA,KAClB,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,OAAOA,EAAE,OAAO,GAAG,QAAQ;oBAC3B,cAAcA,EAAE,OAAO,GAAG,QAAQ;oBAClC,wBAAwBA,EAAE,OAAO,GAAG,QAAQ;oBAC5C,sBAAsBA,EAAE,OAAO,GAAG,QAAQ;gBAC9C;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAE,OAAO,GAAG,QAAQ;YACnC,aAAaA,EAAAA,MACF,CAAC;gBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;YACzC,GACC,QAAQ;YACb,YAAYA,EAAAA,KACF,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,gBAAgBA,EAAAA,MACL,CAAC;wBACJ,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;wBACpC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,aAAaA,EAAAA,MACF,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,mBAAmBA,EAAE,OAAO,GAAG,QAAQ;oBACvC,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;oBACpC,KAAKA,EAAAA,MACM,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;oBAC1C,GACC,QAAQ;gBACjB;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAAA,KACL,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,UAAUA,EAAE,OAAO,GAAG,QAAQ;oBAC9B,aAAaA,EAAE,OAAO,GAAG,QAAQ;gBACrC;aACH,EACA,QAAQ;YACb,UAAUA,EAAE,OAAO,GAAG,QAAQ;
|
|
1
|
+
{"version":3,"file":"extensions/FeatureFlags.js","sources":["../../src/extensions/FeatureFlags.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { setProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\nexport const FeatureFlags = defineExtension({\n type: \"FeatureFlags\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description: \"Enable or disable features.\",\n paramsSchema: z.object({\n // Follows `IFeatureFlagsDto` from `packages/feature-flags/src/types.ts`.\n features: z.object({\n multiTenancy: z.boolean().optional(),\n languages: z.boolean().optional(),\n advancedPublishingWorkflow: z.boolean().optional(),\n advancedAccessControlLayer: z\n .union([\n z.boolean(),\n z.object({\n teams: z.boolean().optional(),\n privateFiles: z.boolean().optional(),\n folderLevelPermissions: z.boolean().optional(),\n hcmsFieldPermissions: z.boolean().optional()\n })\n ])\n .optional(),\n auditLogs: z.boolean().optional(),\n recordLocking: z.boolean().optional(),\n fileManager: z\n .object({\n threatDetection: z.boolean().optional()\n })\n .optional(),\n aiPowerups: z\n .union([\n z.boolean(),\n z.object({\n websiteBuilder: z\n .object({\n pageGeneration: z.boolean().optional(),\n pageTranslation: z.boolean().optional()\n })\n .optional(),\n fileManager: z\n .object({\n imageEnrichment: z.boolean().optional()\n })\n .optional(),\n lexicalGeneration: z.boolean().optional(),\n adminAssistant: z.boolean().optional(),\n remoteComponents: z.boolean().optional(),\n cms: z\n .object({\n entryGeneration: z.boolean().optional(),\n entryComparison: z.boolean().optional(),\n entryTranslation: z.boolean().optional()\n })\n .optional()\n })\n ])\n .optional(),\n abTesting: z.boolean().optional(),\n collaboration: z\n .union([\n z.boolean(),\n z.object({\n comments: z.boolean().optional(),\n activityLog: z.boolean().optional()\n })\n ])\n .optional(),\n webhooks: z.boolean().optional(),\n perTenantStorage: z.boolean().optional()\n })\n }),\n render: ({ features = {} }) => {\n setProjectFeatureFlags(features);\n return (\n <>\n <BuildParam paramName=\"FeatureFlags\" value={features} />\n <AdminBuildParam paramName=\"FeatureFlags\" value={features} />\n </>\n );\n }\n});\n"],"names":["FeatureFlags","defineExtension","z","features","setProjectFeatureFlags","BuildParam","AdminBuildParam"],"mappings":";;;;;;AAOO,MAAMA,eAAeC,gBAAgB;IACxC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QAEnB,UAAUA,EAAE,MAAM,CAAC;YACf,cAAcA,EAAE,OAAO,GAAG,QAAQ;YAClC,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,4BAA4BA,EAAE,OAAO,GAAG,QAAQ;YAChD,4BAA4BA,EAAAA,KAClB,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,OAAOA,EAAE,OAAO,GAAG,QAAQ;oBAC3B,cAAcA,EAAE,OAAO,GAAG,QAAQ;oBAClC,wBAAwBA,EAAE,OAAO,GAAG,QAAQ;oBAC5C,sBAAsBA,EAAE,OAAO,GAAG,QAAQ;gBAC9C;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAE,OAAO,GAAG,QAAQ;YACnC,aAAaA,EAAAA,MACF,CAAC;gBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;YACzC,GACC,QAAQ;YACb,YAAYA,EAAAA,KACF,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,gBAAgBA,EAAAA,MACL,CAAC;wBACJ,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;wBACpC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,aAAaA,EAAAA,MACF,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;oBACzC,GACC,QAAQ;oBACb,mBAAmBA,EAAE,OAAO,GAAG,QAAQ;oBACvC,gBAAgBA,EAAE,OAAO,GAAG,QAAQ;oBACpC,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;oBACtC,KAAKA,EAAAA,MACM,CAAC;wBACJ,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,iBAAiBA,EAAE,OAAO,GAAG,QAAQ;wBACrC,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;oBAC1C,GACC,QAAQ;gBACjB;aACH,EACA,QAAQ;YACb,WAAWA,EAAE,OAAO,GAAG,QAAQ;YAC/B,eAAeA,EAAAA,KACL,CAAC;gBACHA,EAAE,OAAO;gBACTA,EAAE,MAAM,CAAC;oBACL,UAAUA,EAAE,OAAO,GAAG,QAAQ;oBAC9B,aAAaA,EAAE,OAAO,GAAG,QAAQ;gBACrC;aACH,EACA,QAAQ;YACb,UAAUA,EAAE,OAAO,GAAG,QAAQ;YAC9B,kBAAkBA,EAAE,OAAO,GAAG,QAAQ;QAC1C;IACJ;IACA,QAAQ,CAAC,EAAEC,WAAW,CAAC,CAAC,EAAE;QACtBC,uBAAuBD;QACvB,OAAO,WAAP,GACI,wDACI,oBAACE,YAAUA;YAAC,WAAU;YAAe,OAAOF;0BAC5C,oBAACG,iBAAeA;YAAC,WAAU;YAAe,OAAOH;;IAG7D;AACJ"}
|
|
@@ -12,7 +12,7 @@ const BackgroundTasks = defineExtension({
|
|
|
12
12
|
hosting: "all"
|
|
13
13
|
},
|
|
14
14
|
description: "Configure default settings for background tasks. The retention value is used as the default when no admin has explicitly set a value via the Settings UI.",
|
|
15
|
-
paramsSchema
|
|
15
|
+
paramsSchema,
|
|
16
16
|
render (params) {
|
|
17
17
|
return /*#__PURE__*/ react.createElement(BuildParam, {
|
|
18
18
|
paramName: "BackgroundTasks.RetentionDays",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/api/BackgroundTasks.js","sources":["../../../src/extensions/api/BackgroundTasks.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nconst paramsSchema = z.object({\n retentionDays: z\n .number()\n .int()\n .min(0)\n .max(3650)\n .describe(\n \"Default retention period (in days) for completed background task runs. 0 = never delete. Max 3650.\"\n )\n});\n\nexport const BackgroundTasks = defineExtension({\n type: \"Api/BackgroundTasks\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Configure default settings for background tasks. The retention value is used as the default when no admin has explicitly set a value via the Settings UI.\",\n paramsSchema,\n render(params) {\n return (\n <BuildParam paramName=\"BackgroundTasks.RetentionDays\" value={params.retentionDays} />\n );\n }\n});\n"],"names":["paramsSchema","z","BackgroundTasks","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,eAAeA,EAAAA,MACJ,GACN,GAAG,GACH,GAAG,CAAC,GACJ,GAAG,CAAC,MACJ,QAAQ,CACL;AAEZ;AAEO,MAAMC,kBAAkBC,gBAAgB;IAC3C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJH
|
|
1
|
+
{"version":3,"file":"extensions/api/BackgroundTasks.js","sources":["../../../src/extensions/api/BackgroundTasks.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nconst paramsSchema = z.object({\n retentionDays: z\n .number()\n .int()\n .min(0)\n .max(3650)\n .describe(\n \"Default retention period (in days) for completed background task runs. 0 = never delete. Max 3650.\"\n )\n});\n\nexport const BackgroundTasks = defineExtension({\n type: \"Api/BackgroundTasks\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Configure default settings for background tasks. The retention value is used as the default when no admin has explicitly set a value via the Settings UI.\",\n paramsSchema,\n render(params) {\n return (\n <BuildParam paramName=\"BackgroundTasks.RetentionDays\" value={params.retentionDays} />\n );\n }\n});\n"],"names":["paramsSchema","z","BackgroundTasks","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,eAAeA,EAAAA,MACJ,GACN,GAAG,GACH,GAAG,CAAC,GACJ,GAAG,CAAC,MACJ,QAAQ,CACL;AAEZ;AAEO,MAAMC,kBAAkBC,gBAAgB;IAC3C,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJH;IACA,QAAOI,MAAM;QACT,OAAO,WAAP,GACI,oBAACC,YAAUA;YAAC,WAAU;YAAgC,OAAOD,OAAO,aAAa;;IAEzF;AACJ"}
|
|
@@ -12,7 +12,7 @@ const ModelFieldCompression = defineExtension({
|
|
|
12
12
|
hosting: "all"
|
|
13
13
|
},
|
|
14
14
|
description: "Enable or disable compression of Headless CMS model fields at the database storage level.",
|
|
15
|
-
paramsSchema
|
|
15
|
+
paramsSchema,
|
|
16
16
|
render (params) {
|
|
17
17
|
return /*#__PURE__*/ react.createElement(BuildParam, {
|
|
18
18
|
paramName: "ContentModelFieldCompression",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/api/Cms/ModelFieldCompression.js","sources":["../../../../src/extensions/api/Cms/ModelFieldCompression.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nconst paramsSchema = z.object({\n enabled: z\n .boolean()\n .describe(\"Enable compression of model fields before storing in the database.\")\n});\n\nexport const ModelFieldCompression = defineExtension({\n type: \"Api/Cms/ModelFieldCompression\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Enable or disable compression of Headless CMS model fields at the database storage level.\",\n paramsSchema,\n render(params) {\n return <BuildParam paramName=\"ContentModelFieldCompression\" value={params.enabled} />;\n }\n});\n"],"names":["paramsSchema","z","ModelFieldCompression","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,SAASA,EAAAA,OACG,GACP,QAAQ,CAAC;AAClB;AAEO,MAAMC,wBAAwBC,gBAAgB;IACjD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJH
|
|
1
|
+
{"version":3,"file":"extensions/api/Cms/ModelFieldCompression.js","sources":["../../../../src/extensions/api/Cms/ModelFieldCompression.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\n\nconst paramsSchema = z.object({\n enabled: z\n .boolean()\n .describe(\"Enable compression of model fields before storing in the database.\")\n});\n\nexport const ModelFieldCompression = defineExtension({\n type: \"Api/Cms/ModelFieldCompression\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Enable or disable compression of Headless CMS model fields at the database storage level.\",\n paramsSchema,\n render(params) {\n return <BuildParam paramName=\"ContentModelFieldCompression\" value={params.enabled} />;\n }\n});\n"],"names":["paramsSchema","z","ModelFieldCompression","defineExtension","params","BuildParam"],"mappings":";;;;AAKA,MAAMA,eAAeC,EAAE,MAAM,CAAC;IAC1B,SAASA,EAAAA,OACG,GACP,QAAQ,CAAC;AAClB;AAEO,MAAMC,wBAAwBC,gBAAgB;IACjD,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJH;IACA,QAAOI,MAAM;QACT,OAAO,WAAP,GAAO,oBAACC,YAAUA;YAAC,WAAU;YAA+B,OAAOD,OAAO,OAAO;;IACrF;AACJ"}
|
|
@@ -15,7 +15,7 @@ const HTTP_METHODS = [
|
|
|
15
15
|
"OPTIONS"
|
|
16
16
|
];
|
|
17
17
|
const REGISTER_EXTENSION_PLUGIN_PATH = "@webiny/handler/plugins/RegisterExtensionPlugin.js";
|
|
18
|
-
const EVENT_HANDLER_CORE_PATH = "@webiny/
|
|
18
|
+
const EVENT_HANDLER_CORE_PATH = "@webiny/api-kernel-core";
|
|
19
19
|
const getImportInsertIndex = (source)=>{
|
|
20
20
|
const importDeclarations = source.getImportDeclarations();
|
|
21
21
|
const lastImport = importDeclarations[importDeclarations.length - 1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/api/Route/ApiRoute.js","sources":["../../../../src/extensions/api/Route/ApiRoute.ts"],"sourcesContent":["import path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node } from \"ts-morph\";\nimport { Project } from \"ts-morph\";\nimport { type ArrayLiteralExpression } from \"ts-morph\";\nimport { type SourceFile } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { deriveRouteName } from \"./routePath.js\";\nimport { toRouterPath } from \"./routePath.js\";\n\n/*\n * The methods the DI router can match. It compares a definition's method to the request's exactly,\n * so a catch-all such as API Gateway's `ANY` would register a route no request can reach.\n */\nexport const HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\"] as const;\n\nconst REGISTER_EXTENSION_PLUGIN_PATH = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\nconst EVENT_HANDLER_CORE_PATH = \"@webiny/event-handler-core\";\n\n// Right after the last import, or at the top of a file that has none.\nconst getImportInsertIndex = (source: SourceFile) => {\n const importDeclarations = source.getImportDeclarations();\n const lastImport = importDeclarations[importDeclarations.length - 1];\n if (!lastImport) {\n return 1;\n }\n return lastImport.getChildIndex() + 1;\n};\n\n/*\n * Adds `name` to the named imports from `moduleSpecifier`, adding the import declaration after the\n * last import when there is none. An existing import from the same module may name other things,\n * e.g. BuildParam imports `createRegisterBuildParamPlugin` from the RegisterExtensionPlugin path.\n */\nconst ensureNamedImport = (source: SourceFile, moduleSpecifier: string, name: string) => {\n const existing = source.getImportDeclaration(moduleSpecifier);\n if (existing) {\n const namedImports = existing.getNamedImports();\n if (!namedImports.some(i => i.getName() === name)) {\n existing.addNamedImport(name);\n }\n return;\n }\n\n const index = getImportInsertIndex(source);\n source.insertImportDeclaration(index, {\n namedImports: [name],\n moduleSpecifier\n });\n};\n\n/**\n * Registers a custom HTTP route with the API's DI router, for every hosting type. The build step\n * adds the route's handler and an `HttpRouteDefinition` to `apps/api/graphql/src/extensions.ts`.\n * That is all a standalone project needs, because its HTTP server hands every request to the\n * router. `@webiny/project-aws` registers its own implementation, which also adds the route to API\n * Gateway.\n */\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\", hosting: \"all\" },\n description: \"Register a custom HTTP route on the API.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n // Path parameters may be written `{orderId}` (API Gateway) or `:orderId` (the DI\n // router). Both are accepted and converted per consumer, see `routePath.ts`.\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // The `src` file must default-export a route HANDLER, the result of\n // `HttpRouteHandler.createImplementation` from `@webiny/event-handler-core`. It does\n // NOT declare its own method/path: the `HttpRouteDefinition` the router matches on is\n // generated below from the props here, so the route the gateway forwards to and the\n // route the router matches cannot drift apart.\n src: zodSrcPath({ project }),\n // Doubles as the route's DI name, so a decorator on HttpRouteDefinition can pick this\n // route out by it. Derived from path + method when omitted, same as the Pulumi name.\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const extensionsTsFolder = path.dirname(extensionsTsFilePath);\n const importPath = path\n .relative(extensionsTsFolder, absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Register an HttpRouteDefinition built from the props above. The router matches on\n // definitions and only then builds the handler, so registering the handler alone would\n // leave the route unreachable: the request reaches the API and dispatch finds nothing. The\n // path is converted to the router's `:param` syntax.\n const routerPath = toRouterPath(params.path);\n const routeName = params.routeName ?? deriveRouteName(params.path, params.method);\n const nameProperty = `name: ${JSON.stringify(routeName)},`;\n const registration = `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tctx.container.register(\\n\\t\\tcreateHttpRouteDefinition({\\n\\t\\t\\t${nameProperty}\\n\\t\\t\\tmethod: ${JSON.stringify(params.method)},\\n\\t\\t\\tpath: ${JSON.stringify(routerPath)},\\n\\t\\t\\thandler: ${alias}\\n\\t\\t})\\n\\t);\\n})`;\n\n /*\n * The workspace is regenerated before every build and watch, so a registration already in\n * the file comes from another `<Api.Route>` in the same config. The same route twice is\n * skipped. Two routes with one name would be two DI definitions a decorator can't tell\n * apart, and on AWS two API Gateway resources with one Pulumi name, so the build stops.\n */\n const sourceText = source.getFullText();\n // Whitespace is ignored: ts-morph re-indents an element when it inserts it.\n const compactSource = sourceText.replace(/\\s+/g, \"\");\n const compactRegistration = registration.replace(/\\s+/g, \"\");\n if (compactSource.includes(compactRegistration)) {\n return;\n }\n if (sourceText.includes(nameProperty)) {\n throw new Error(\n `Two \"Api.Route\" entries resolve to the route name \"${routeName}\". A derived name leaves out path parameters, so \"/orders\" and \"/orders/{id}\" collide; set \"routeName\" on one of them.`\n );\n }\n\n // One handler file may back several routes, so its import is added only once.\n if (!source.getImportDeclaration(importPath)) {\n const index = getImportInsertIndex(source);\n source.insertImportDeclaration(index, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n }\n\n ensureNamedImport(source, REGISTER_EXTENSION_PLUGIN_PATH, \"createRegisterExtensionPlugin\");\n ensureNamedImport(source, EVENT_HANDLER_CORE_PATH, \"createHttpRouteDefinition\");\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(registration);\n\n await source.save();\n }\n});\n"],"names":["HTTP_METHODS","REGISTER_EXTENSION_PLUGIN_PATH","EVENT_HANDLER_CORE_PATH","getImportInsertIndex","source","importDeclarations","lastImport","ensureNamedImport","moduleSpecifier","name","existing","namedImports","i","index","ApiRoute","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","absoluteSrcFilePath","ExtensionSrcResolver","hash","crypto","alias","extensionsTsFolder","path","importPath","tsProject","Project","routerPath","toRouterPath","routeName","deriveRouteName","nameProperty","JSON","registration","sourceText","compactSource","compactRegistration","Error","pluginsArray","node","Node"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"extensions/api/Route/ApiRoute.js","sources":["../../../../src/extensions/api/Route/ApiRoute.ts"],"sourcesContent":["import path from \"path\";\nimport crypto from \"crypto\";\nimport { z } from \"zod\";\nimport { Node } from \"ts-morph\";\nimport { Project } from \"ts-morph\";\nimport { type ArrayLiteralExpression } from \"ts-morph\";\nimport { type SourceFile } from \"ts-morph\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { zodSrcPath } from \"~/defineExtension/index.js\";\nimport { ExtensionSrcResolver } from \"~/index.js\";\nimport { deriveRouteName } from \"./routePath.js\";\nimport { toRouterPath } from \"./routePath.js\";\n\n/*\n * The methods the DI router can match. It compares a definition's method to the request's exactly,\n * so a catch-all such as API Gateway's `ANY` would register a route no request can reach.\n */\nexport const HTTP_METHODS = [\"DELETE\", \"GET\", \"HEAD\", \"PATCH\", \"POST\", \"PUT\", \"OPTIONS\"] as const;\n\nconst REGISTER_EXTENSION_PLUGIN_PATH = \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\nconst EVENT_HANDLER_CORE_PATH = \"@webiny/api-kernel-core\";\n\n// Right after the last import, or at the top of a file that has none.\nconst getImportInsertIndex = (source: SourceFile) => {\n const importDeclarations = source.getImportDeclarations();\n const lastImport = importDeclarations[importDeclarations.length - 1];\n if (!lastImport) {\n return 1;\n }\n return lastImport.getChildIndex() + 1;\n};\n\n/*\n * Adds `name` to the named imports from `moduleSpecifier`, adding the import declaration after the\n * last import when there is none. An existing import from the same module may name other things,\n * e.g. BuildParam imports `createRegisterBuildParamPlugin` from the RegisterExtensionPlugin path.\n */\nconst ensureNamedImport = (source: SourceFile, moduleSpecifier: string, name: string) => {\n const existing = source.getImportDeclaration(moduleSpecifier);\n if (existing) {\n const namedImports = existing.getNamedImports();\n if (!namedImports.some(i => i.getName() === name)) {\n existing.addNamedImport(name);\n }\n return;\n }\n\n const index = getImportInsertIndex(source);\n source.insertImportDeclaration(index, {\n namedImports: [name],\n moduleSpecifier\n });\n};\n\n/**\n * Registers a custom HTTP route with the API's DI router, for every hosting type. The build step\n * adds the route's handler and an `HttpRouteDefinition` to `apps/api/graphql/src/extensions.ts`.\n * That is all a standalone project needs, because its HTTP server hands every request to the\n * router. `@webiny/project-aws` registers its own implementation, which also adds the route to API\n * Gateway.\n */\nexport const ApiRoute = defineExtension({\n type: \"Api/Route\",\n tags: { runtimeContext: \"app-build\", appName: \"api\", hosting: \"all\" },\n description: \"Register a custom HTTP route on the API.\",\n multiple: true,\n paramsSchema: ({ project }) => {\n return z.object({\n // Path parameters may be written `{orderId}` (API Gateway) or `:orderId` (the DI\n // router). Both are accepted and converted per consumer, see `routePath.ts`.\n path: z.string().startsWith(\"/\"),\n method: z.enum(HTTP_METHODS),\n // The `src` file must default-export a route HANDLER, the result of\n // `HttpRouteHandler.createImplementation` from `@webiny/api-kernel-core`. It does\n // NOT declare its own method/path: the `HttpRouteDefinition` the router matches on is\n // generated below from the props here, so the route the gateway forwards to and the\n // route the router matches cannot drift apart.\n src: zodSrcPath({ project }),\n // Doubles as the route's DI name, so a decorator on HttpRouteDefinition can pick this\n // route out by it. Derived from path + method when omitted, same as the Pulumi name.\n routeName: z.string().optional()\n });\n },\n async build(params, ctx) {\n const extensionsTsFilePath = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"extensions.ts\")\n .toString();\n\n const absoluteSrcFilePath = ExtensionSrcResolver.resolvePath(params.src, ctx.project);\n\n // Stable alias to avoid naming conflicts across multiple routes.\n const hash = crypto.createHash(\"sha256\").update(params.src).digest(\"hex\");\n const alias = `ApiRoute_${hash.slice(-10)}`;\n\n const extensionsTsFolder = path.dirname(extensionsTsFilePath);\n const importPath = path\n .relative(extensionsTsFolder, absoluteSrcFilePath)\n .replace(/\\.tsx?$/, \".js\");\n\n const tsProject = new Project();\n tsProject.addSourceFileAtPath(extensionsTsFilePath);\n const source = tsProject.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Register an HttpRouteDefinition built from the props above. The router matches on\n // definitions and only then builds the handler, so registering the handler alone would\n // leave the route unreachable: the request reaches the API and dispatch finds nothing. The\n // path is converted to the router's `:param` syntax.\n const routerPath = toRouterPath(params.path);\n const routeName = params.routeName ?? deriveRouteName(params.path, params.method);\n const nameProperty = `name: ${JSON.stringify(routeName)},`;\n const registration = `\\ncreateRegisterExtensionPlugin(ctx => {\\n\\tctx.container.register(\\n\\t\\tcreateHttpRouteDefinition({\\n\\t\\t\\t${nameProperty}\\n\\t\\t\\tmethod: ${JSON.stringify(params.method)},\\n\\t\\t\\tpath: ${JSON.stringify(routerPath)},\\n\\t\\t\\thandler: ${alias}\\n\\t\\t})\\n\\t);\\n})`;\n\n /*\n * The workspace is regenerated before every build and watch, so a registration already in\n * the file comes from another `<Api.Route>` in the same config. The same route twice is\n * skipped. Two routes with one name would be two DI definitions a decorator can't tell\n * apart, and on AWS two API Gateway resources with one Pulumi name, so the build stops.\n */\n const sourceText = source.getFullText();\n // Whitespace is ignored: ts-morph re-indents an element when it inserts it.\n const compactSource = sourceText.replace(/\\s+/g, \"\");\n const compactRegistration = registration.replace(/\\s+/g, \"\");\n if (compactSource.includes(compactRegistration)) {\n return;\n }\n if (sourceText.includes(nameProperty)) {\n throw new Error(\n `Two \"Api.Route\" entries resolve to the route name \"${routeName}\". A derived name leaves out path parameters, so \"/orders\" and \"/orders/{id}\" collide; set \"routeName\" on one of them.`\n );\n }\n\n // One handler file may back several routes, so its import is added only once.\n if (!source.getImportDeclaration(importPath)) {\n const index = getImportInsertIndex(source);\n source.insertImportDeclaration(index, {\n defaultImport: alias,\n moduleSpecifier: importPath\n });\n }\n\n ensureNamedImport(source, REGISTER_EXTENSION_PLUGIN_PATH, \"createRegisterExtensionPlugin\");\n ensureNamedImport(source, EVENT_HANDLER_CORE_PATH, \"createHttpRouteDefinition\");\n\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(registration);\n\n await source.save();\n }\n});\n"],"names":["HTTP_METHODS","REGISTER_EXTENSION_PLUGIN_PATH","EVENT_HANDLER_CORE_PATH","getImportInsertIndex","source","importDeclarations","lastImport","ensureNamedImport","moduleSpecifier","name","existing","namedImports","i","index","ApiRoute","defineExtension","project","z","zodSrcPath","params","ctx","extensionsTsFilePath","absoluteSrcFilePath","ExtensionSrcResolver","hash","crypto","alias","extensionsTsFolder","path","importPath","tsProject","Project","routerPath","toRouterPath","routeName","deriveRouteName","nameProperty","JSON","registration","sourceText","compactSource","compactRegistration","Error","pluginsArray","node","Node"],"mappings":"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"}
|
package/extensions/api/index.js
CHANGED
package/extensions/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export { CoreBeforeWatch };
|
|
|
44
44
|
export { CoreAfterBuild };
|
|
45
45
|
export { ProductionEnvironments };
|
|
46
46
|
export declare const definitions: (import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
47
|
-
|
|
47
|
+
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
48
48
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
49
49
|
paramName: import("zod").ZodString;
|
|
50
50
|
value: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>, import("zod").ZodArray<import("zod").ZodAny>, import("zod").ZodNumber, import("zod").ZodBoolean]>;
|
|
@@ -74,6 +74,7 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
74
74
|
}, import("zod/v4/core").$strip>>;
|
|
75
75
|
lexicalGeneration: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
76
76
|
adminAssistant: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
77
|
+
remoteComponents: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
77
78
|
cms: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
78
79
|
entryGeneration: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
79
80
|
entryComparison: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
@@ -86,24 +87,23 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
86
87
|
activityLog: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
87
88
|
}, import("zod/v4/core").$strip>]>>;
|
|
88
89
|
webhooks: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
90
|
+
perTenantStorage: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
89
91
|
}, import("zod/v4/core").$strip>;
|
|
90
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
91
|
-
src: import("zod").ZodString;
|
|
92
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
93
|
-
id: import("zod").ZodString;
|
|
94
92
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
95
93
|
src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
96
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
97
|
-
url: import("zod").ZodString;
|
|
98
94
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
99
95
|
varName: import("zod").ZodString;
|
|
100
96
|
value: import("zod").ZodString;
|
|
101
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
102
|
-
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
103
97
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
104
98
|
token: import("zod").ZodOptional<import("zod").ZodString>;
|
|
105
99
|
repository: import("zod").ZodOptional<import("zod").ZodString>;
|
|
106
100
|
labels: import("zod").ZodOptional<import("zod").ZodString>;
|
|
101
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
102
|
+
id: import("zod").ZodString;
|
|
103
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
104
|
+
src: import("zod").ZodString;
|
|
105
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
106
|
+
environments: import("zod").ZodArray<import("zod").ZodString>;
|
|
107
107
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
108
108
|
setupName: import("zod").ZodEnum<{
|
|
109
109
|
ddb: "ddb";
|
|
@@ -111,17 +111,12 @@ export declare const definitions: (import("./index.js").ExtensionDefinitionModel
|
|
|
111
111
|
"ddb+os": "ddb+os";
|
|
112
112
|
pg: "pg";
|
|
113
113
|
}>;
|
|
114
|
+
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
115
|
+
url: import("zod").ZodString;
|
|
114
116
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
115
117
|
retentionDays: import("zod").ZodNumber;
|
|
116
118
|
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
117
119
|
enabled: import("zod").ZodBoolean;
|
|
118
|
-
}, import("zod/v4/core").$strip>> | import("./index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
119
|
-
host: import("zod").ZodString;
|
|
120
|
-
port: import("zod").ZodNumber;
|
|
121
|
-
user: import("zod").ZodString;
|
|
122
|
-
password: import("zod").ZodString;
|
|
123
|
-
from: import("zod").ZodString;
|
|
124
|
-
replyTo: import("zod").ZodOptional<import("zod").ZodString>;
|
|
125
120
|
}, import("zod/v4/core").$strip>>)[];
|
|
126
121
|
export { Project } from "./Project.js";
|
|
127
122
|
export * from "../defineExtension/index.js";
|
package/extensions/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { AdminApiUrl } from "./AdminApiUrl.js";
|
|
|
13
13
|
import { AdminWebsocketsUrl } from "./AdminWebsocketsUrl.js";
|
|
14
14
|
import { AdminExtension } from "./AdminExtension.js";
|
|
15
15
|
import { ApiExtension } from "./ApiExtension.js";
|
|
16
|
-
import { ApiRoute, BackgroundTasks, ModelFieldCompression
|
|
16
|
+
import { ApiRoute, BackgroundTasks, ModelFieldCompression } from "./api/index.js";
|
|
17
17
|
import { AdminAfterBuild, AdminBeforeBuild, AdminBeforeWatch, AfterBuild, ApiAfterBuild, ApiBeforeBuild, ApiBeforeWatch, BeforeBuild, BeforeWatch, CoreAfterBuild, CoreBeforeBuild, CoreBeforeWatch } from "./hooks/index.js";
|
|
18
18
|
import { ProductionEnvironments } from "./ProductionEnvironments.js";
|
|
19
19
|
export * from "../defineExtension/index.js";
|
|
@@ -48,8 +48,7 @@ const definitions = [
|
|
|
48
48
|
ApiExtension.def,
|
|
49
49
|
ApiRoute.def,
|
|
50
50
|
BackgroundTasks.def,
|
|
51
|
-
ModelFieldCompression.def
|
|
52
|
-
Smtp.def
|
|
51
|
+
ModelFieldCompression.def
|
|
53
52
|
];
|
|
54
53
|
export { Project } from "./Project.js";
|
|
55
54
|
export { AdminAfterBuild, AdminApiUrl, AdminBeforeBuild, AdminBeforeWatch, AdminBuildParam, AdminExtension, AdminWebsocketsUrl, AfterBuild, ApiAfterBuild, ApiBeforeBuild, ApiBeforeWatch, ApiExtension, BeforeBuild, BeforeWatch, BugReporter, BuildParam, CoreAfterBuild, CoreBeforeBuild, CoreBeforeWatch, DatabaseSetup, EnvVar, ExtensionDefinitions, FeatureFlags, ProductionEnvironments, ProjectDecorator, ProjectId, ProjectImplementation, Telemetry, definitions };
|
package/extensions/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/index.js","sources":["../../src/extensions/index.ts"],"sourcesContent":["import { ExtensionDefinitions } from \"./ExtensionDefinitions.js\";\nimport { ProjectDecorator } from \"./ProjectDecorator.js\";\nimport { ProjectImplementation } from \"./ProjectImplementation.js\";\nimport { ProjectId } from \"./ProjectId.js\";\nimport { Telemetry } from \"./Telemetry.js\";\nimport { EnvVar } from \"./EnvVar.js\";\nimport { DatabaseSetup } from \"./DatabaseSetup.js\";\nimport { FeatureFlags } from \"./FeatureFlags.js\";\nimport { BugReporter } from \"./BugReporter.js\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { AdminApiUrl } from \"./AdminApiUrl.js\";\nimport { AdminWebsocketsUrl } from \"./AdminWebsocketsUrl.js\";\nimport { AdminExtension } from \"./AdminExtension.js\";\nimport { ApiExtension } from \"./ApiExtension.js\";\nimport { ApiRoute } from \"./api/index.js\";\nimport { BackgroundTasks } from \"./api/index.js\";\nimport { ModelFieldCompression } from \"./api/index.js\";\
|
|
1
|
+
{"version":3,"file":"extensions/index.js","sources":["../../src/extensions/index.ts"],"sourcesContent":["import { ExtensionDefinitions } from \"./ExtensionDefinitions.js\";\nimport { ProjectDecorator } from \"./ProjectDecorator.js\";\nimport { ProjectImplementation } from \"./ProjectImplementation.js\";\nimport { ProjectId } from \"./ProjectId.js\";\nimport { Telemetry } from \"./Telemetry.js\";\nimport { EnvVar } from \"./EnvVar.js\";\nimport { DatabaseSetup } from \"./DatabaseSetup.js\";\nimport { FeatureFlags } from \"./FeatureFlags.js\";\nimport { BugReporter } from \"./BugReporter.js\";\nimport { BuildParam } from \"./ApiBuildParam.js\";\nimport { AdminBuildParam } from \"./AdminBuildParam.js\";\nimport { AdminApiUrl } from \"./AdminApiUrl.js\";\nimport { AdminWebsocketsUrl } from \"./AdminWebsocketsUrl.js\";\nimport { AdminExtension } from \"./AdminExtension.js\";\nimport { ApiExtension } from \"./ApiExtension.js\";\nimport { ApiRoute } from \"./api/index.js\";\nimport { BackgroundTasks } from \"./api/index.js\";\nimport { ModelFieldCompression } from \"./api/index.js\";\n\n// Hooks.\nimport {\n AdminAfterBuild,\n AdminBeforeBuild,\n AdminBeforeWatch,\n AfterBuild,\n BeforeWatch,\n ApiAfterBuild,\n ApiBeforeBuild,\n ApiBeforeWatch,\n BeforeBuild,\n CoreAfterBuild,\n CoreBeforeBuild,\n CoreBeforeWatch\n} from \"./hooks/index.js\";\n\nimport { ProductionEnvironments } from \"./ProductionEnvironments.js\";\n\n// Exports.\nexport { Telemetry };\nexport { ProjectId };\nexport { ProjectDecorator };\nexport { ProjectImplementation };\nexport { ExtensionDefinitions };\nexport { EnvVar };\nexport { FeatureFlags };\nexport { BugReporter };\nexport { DatabaseSetup };\nexport { BuildParam };\nexport { AdminBuildParam };\nexport { AdminApiUrl };\nexport { AdminWebsocketsUrl };\nexport { AdminExtension };\nexport { ApiExtension };\n\n// Hooks.\nexport { BeforeBuild };\nexport { BeforeWatch };\nexport { AfterBuild };\nexport { AdminBeforeBuild };\nexport { AdminBeforeWatch };\nexport { AdminAfterBuild };\nexport { ApiBeforeBuild };\nexport { ApiBeforeWatch };\nexport { ApiAfterBuild };\nexport { CoreBeforeBuild };\nexport { CoreBeforeWatch };\nexport { CoreAfterBuild };\n\nexport { ProductionEnvironments };\n\n// Definitions (used internally). 👇\nexport const definitions = [\n Telemetry.def,\n ProjectId.def,\n ProjectDecorator.def,\n ProjectImplementation.def,\n ExtensionDefinitions.def,\n EnvVar.def,\n FeatureFlags.def,\n BugReporter.def,\n\n // Hooks.\n AdminAfterBuild.def,\n BeforeBuild.def,\n BeforeWatch.def,\n AfterBuild.def,\n AdminBeforeBuild.def,\n AdminBeforeWatch.def,\n ApiAfterBuild.def,\n ApiBeforeBuild.def,\n ApiBeforeWatch.def,\n CoreAfterBuild.def,\n CoreBeforeBuild.def,\n CoreBeforeWatch.def,\n\n ProductionEnvironments.def,\n DatabaseSetup.def,\n BuildParam.def,\n AdminBuildParam.def,\n AdminApiUrl.def,\n AdminWebsocketsUrl.def,\n AdminExtension.def,\n ApiExtension.def,\n ApiRoute.def,\n\n // Api settings that apply to every hosting type.\n BackgroundTasks.def,\n ModelFieldCompression.def\n];\n\nexport { Project } from \"./Project.js\";\n\nexport * from \"../defineExtension/index.js\";\n"],"names":["definitions","Telemetry","ProjectId","ProjectDecorator","ProjectImplementation","ExtensionDefinitions","EnvVar","FeatureFlags","BugReporter","AdminAfterBuild","BeforeBuild","BeforeWatch","AfterBuild","AdminBeforeBuild","AdminBeforeWatch","ApiAfterBuild","ApiBeforeBuild","ApiBeforeWatch","CoreAfterBuild","CoreBeforeBuild","CoreBeforeWatch","ProductionEnvironments","DatabaseSetup","BuildParam","AdminBuildParam","AdminApiUrl","AdminWebsocketsUrl","AdminExtension","ApiExtension","ApiRoute","BackgroundTasks","ModelFieldCompression"],"mappings":";;;;;;;;;;;;;;;;;;;AAuEO,MAAMA,cAAc;IACvBC,UAAU,GAAG;IACbC,UAAU,GAAG;IACbC,iBAAiB,GAAG;IACpBC,sBAAsB,GAAG;IACzBC,qBAAqB,GAAG;IACxBC,OAAO,GAAG;IACVC,aAAa,GAAG;IAChBC,YAAY,GAAG;IAGfC,gBAAgB,GAAG;IACnBC,YAAY,GAAG;IACfC,YAAY,GAAG;IACfC,WAAW,GAAG;IACdC,iBAAiB,GAAG;IACpBC,iBAAiB,GAAG;IACpBC,cAAc,GAAG;IACjBC,eAAe,GAAG;IAClBC,eAAe,GAAG;IAClBC,eAAe,GAAG;IAClBC,gBAAgB,GAAG;IACnBC,gBAAgB,GAAG;IAEnBC,uBAAuB,GAAG;IAC1BC,cAAc,GAAG;IACjBC,WAAW,GAAG;IACdC,gBAAgB,GAAG;IACnBC,YAAY,GAAG;IACfC,mBAAmB,GAAG;IACtBC,eAAe,GAAG;IAClBC,aAAa,GAAG;IAChBC,SAAS,GAAG;IAGZC,gBAAgB,GAAG;IACnBC,sBAAsB,GAAG;CAC5B"}
|
|
@@ -23,16 +23,16 @@ process.on("unhandledRejection", (reason)=>{
|
|
|
23
23
|
sendError(err);
|
|
24
24
|
});
|
|
25
25
|
const workerData = JSON.parse(process.argv[2]);
|
|
26
|
-
const { package: pkg, env
|
|
26
|
+
const { package: pkg, env, variant, region, debug } = workerData;
|
|
27
27
|
const options = {
|
|
28
28
|
cwd: pkg.paths.packageFolder,
|
|
29
|
-
env
|
|
30
|
-
variant
|
|
31
|
-
region
|
|
32
|
-
debug
|
|
29
|
+
env,
|
|
30
|
+
variant,
|
|
31
|
+
region,
|
|
32
|
+
debug
|
|
33
33
|
};
|
|
34
34
|
const config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {
|
|
35
|
-
options
|
|
35
|
+
options
|
|
36
36
|
});
|
|
37
37
|
const hasBuild = config.commands && "function" == typeof config.commands.build;
|
|
38
38
|
if (!hasBuild) throw new Error("Build command not found.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/BuildApp/PackagesBuilder/worker.js","sources":["../../../../src/features/BuildApp/PackagesBuilder/worker.ts"],"sourcesContent":["import \"tsx/esm\";\nimport { requireConfigWithExecute } from \"~/utils/index.js\";\nimport { serializeError } from \"serialize-error\";\n\nconst sendError = (err: Error) => {\n const response = {\n type: \"error\",\n error: serializeError(err)\n };\n\n process.send!(response);\n};\n\nconst sendSuccess = () => {\n const response = {\n type: \"success\",\n error: null\n };\n\n process.send!(response);\n};\n\nprocess.on(\"uncaughtException\", err => {\n sendError(err);\n});\n\nprocess.on(\"unhandledRejection\", reason => {\n const err = reason instanceof Error ? reason : new Error(String(reason));\n sendError(err);\n});\n\nconst workerData = JSON.parse(process.argv[2]);\n\nconst { package: pkg, env, variant, region, debug } = workerData;\nconst options = {\n cwd: pkg.paths.packageFolder,\n env,\n variant,\n region,\n debug\n};\n\nconst config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {\n options\n});\n\nconst hasBuild = config.commands && typeof config.commands.build === \"function\";\nif (!hasBuild) {\n throw new Error(\"Build command not found.\");\n}\n\nawait config.commands.build(options);\n\nsendSuccess();\n"],"names":["sendError","err","response","serializeError","process","sendSuccess","reason","Error","String","workerData","JSON","pkg","env","variant","region","debug","options","config","requireConfigWithExecute","hasBuild"],"mappings":";;;AAIA,MAAMA,YAAY,CAACC;IACf,MAAMC,WAAW;QACb,MAAM;QACN,OAAOC,eAAeF;IAC1B;IAEAG,QAAQ,IAAI,CAAEF;AAClB;AAEA,MAAMG,cAAc;IAChB,MAAMH,WAAW;QACb,MAAM;QACN,OAAO;IACX;IAEAE,QAAQ,IAAI,CAAEF;AAClB;AAEAE,QAAQ,EAAE,CAAC,qBAAqBH,CAAAA;IAC5BD,UAAUC;AACd;AAEAG,QAAQ,EAAE,CAAC,sBAAsBE,CAAAA;IAC7B,MAAML,MAAMK,kBAAkBC,QAAQD,SAAS,IAAIC,MAAMC,OAAOF;IAChEN,UAAUC;AACd;AAEA,MAAMQ,aAAaC,KAAK,KAAK,CAACN,QAAQ,IAAI,CAAC,EAAE;AAE7C,MAAM,EAAE,SAASO,GAAG,EAAEC,
|
|
1
|
+
{"version":3,"file":"features/BuildApp/PackagesBuilder/worker.js","sources":["../../../../src/features/BuildApp/PackagesBuilder/worker.ts"],"sourcesContent":["import \"tsx/esm\";\nimport { requireConfigWithExecute } from \"~/utils/index.js\";\nimport { serializeError } from \"serialize-error\";\n\nconst sendError = (err: Error) => {\n const response = {\n type: \"error\",\n error: serializeError(err)\n };\n\n process.send!(response);\n};\n\nconst sendSuccess = () => {\n const response = {\n type: \"success\",\n error: null\n };\n\n process.send!(response);\n};\n\nprocess.on(\"uncaughtException\", err => {\n sendError(err);\n});\n\nprocess.on(\"unhandledRejection\", reason => {\n const err = reason instanceof Error ? reason : new Error(String(reason));\n sendError(err);\n});\n\nconst workerData = JSON.parse(process.argv[2]);\n\nconst { package: pkg, env, variant, region, debug } = workerData;\nconst options = {\n cwd: pkg.paths.packageFolder,\n env,\n variant,\n region,\n debug\n};\n\nconst config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {\n options\n});\n\nconst hasBuild = config.commands && typeof config.commands.build === \"function\";\nif (!hasBuild) {\n throw new Error(\"Build command not found.\");\n}\n\nawait config.commands.build(options);\n\nsendSuccess();\n"],"names":["sendError","err","response","serializeError","process","sendSuccess","reason","Error","String","workerData","JSON","pkg","env","variant","region","debug","options","config","requireConfigWithExecute","hasBuild"],"mappings":";;;AAIA,MAAMA,YAAY,CAACC;IACf,MAAMC,WAAW;QACb,MAAM;QACN,OAAOC,eAAeF;IAC1B;IAEAG,QAAQ,IAAI,CAAEF;AAClB;AAEA,MAAMG,cAAc;IAChB,MAAMH,WAAW;QACb,MAAM;QACN,OAAO;IACX;IAEAE,QAAQ,IAAI,CAAEF;AAClB;AAEAE,QAAQ,EAAE,CAAC,qBAAqBH,CAAAA;IAC5BD,UAAUC;AACd;AAEAG,QAAQ,EAAE,CAAC,sBAAsBE,CAAAA;IAC7B,MAAML,MAAMK,kBAAkBC,QAAQD,SAAS,IAAIC,MAAMC,OAAOF;IAChEN,UAAUC;AACd;AAEA,MAAMQ,aAAaC,KAAK,KAAK,CAACN,QAAQ,IAAI,CAAC,EAAE;AAE7C,MAAM,EAAE,SAASO,GAAG,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGN;AACtD,MAAMO,UAAU;IACZ,KAAKL,IAAI,KAAK,CAAC,aAAa;IAC5BC;IACAC;IACAC;IACAC;AACJ;AAEA,MAAME,SAAS,MAAMC,yBAAyBP,IAAI,KAAK,CAAC,gBAAgB,EAAE;IACtEK;AACJ;AAEA,MAAMG,WAAWF,OAAO,QAAQ,IAAI,AAAiC,cAAjC,OAAOA,OAAO,QAAQ,CAAC,KAAK;AAChE,IAAI,CAACE,UACD,MAAM,IAAIZ,MAAM;AAGpB,MAAMU,OAAO,QAAQ,CAAC,KAAK,CAACD;AAE5BX"}
|
|
@@ -5,20 +5,20 @@ process.on("disconnect", ()=>{
|
|
|
5
5
|
process.exit(0);
|
|
6
6
|
});
|
|
7
7
|
const workerData = JSON.parse(process.argv[2]);
|
|
8
|
-
const { package: pkg, env
|
|
8
|
+
const { package: pkg, env, variant, region, debug } = workerData;
|
|
9
9
|
const options = {
|
|
10
10
|
cwd: pkg.paths.packageFolder,
|
|
11
|
-
env
|
|
12
|
-
variant
|
|
13
|
-
region
|
|
14
|
-
debug
|
|
11
|
+
env,
|
|
12
|
+
variant,
|
|
13
|
+
region,
|
|
14
|
+
debug
|
|
15
15
|
};
|
|
16
16
|
if (!fs.existsSync(pkg.paths.webinyConfigFile)) {
|
|
17
17
|
console.warn(`Cannot watch "${pkg.name}" package. No "webiny.config.ts" file found.`);
|
|
18
18
|
process.exit(0);
|
|
19
19
|
}
|
|
20
20
|
const config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {
|
|
21
|
-
options
|
|
21
|
+
options
|
|
22
22
|
});
|
|
23
23
|
const hasWatch = config.commands && "function" == typeof config.commands.watch;
|
|
24
24
|
if (hasWatch) await config.commands.watch(options, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/Watch/watchers/worker.js","sources":["../../../../src/features/Watch/watchers/worker.ts"],"sourcesContent":["import \"tsx\";\nimport { requireConfigWithExecute } from \"~/utils/index.js\";\nimport fs from \"fs\";\n\n// The CLI forks this worker with an IPC channel, and the channel closes when the CLI stops, however\n// it stops. Without this, a worker outlives a CLI that was killed and keeps rebuilding into the\n// workspace. The next `webiny watch` then regenerates that workspace while this worker is still\n// bundling it, and its server loads a half-written build.\nprocess.on(\"disconnect\", () => {\n process.exit(0);\n});\n\nconst workerData = JSON.parse(process.argv[2]);\nconst { package: pkg, env, variant, region, debug } = workerData;\n\nconst options = { cwd: pkg.paths.packageFolder, env, variant, region, debug };\n\nif (!fs.existsSync(pkg.paths.webinyConfigFile)) {\n console.warn(`Cannot watch \"${pkg.name}\" package. No \"webiny.config.ts\" file found.`);\n process.exit(0);\n}\n\nconst config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {\n options\n});\n\nconst hasWatch = config.commands && typeof config.commands.watch === \"function\";\nif (hasWatch) {\n await config.commands.watch(options, {});\n} else {\n throw new Error(\"Watch command not found.\");\n}\n"],"names":["process","workerData","JSON","pkg","env","variant","region","debug","options","fs","console","config","requireConfigWithExecute","hasWatch","Error"],"mappings":";;;AAQAA,QAAQ,EAAE,CAAC,cAAc;IACrBA,QAAQ,IAAI,CAAC;AACjB;AAEA,MAAMC,aAAaC,KAAK,KAAK,CAACF,QAAQ,IAAI,CAAC,EAAE;AAC7C,MAAM,EAAE,SAASG,GAAG,EAAEC,
|
|
1
|
+
{"version":3,"file":"features/Watch/watchers/worker.js","sources":["../../../../src/features/Watch/watchers/worker.ts"],"sourcesContent":["import \"tsx\";\nimport { requireConfigWithExecute } from \"~/utils/index.js\";\nimport fs from \"fs\";\n\n// The CLI forks this worker with an IPC channel, and the channel closes when the CLI stops, however\n// it stops. Without this, a worker outlives a CLI that was killed and keeps rebuilding into the\n// workspace. The next `webiny watch` then regenerates that workspace while this worker is still\n// bundling it, and its server loads a half-written build.\nprocess.on(\"disconnect\", () => {\n process.exit(0);\n});\n\nconst workerData = JSON.parse(process.argv[2]);\nconst { package: pkg, env, variant, region, debug } = workerData;\n\nconst options = { cwd: pkg.paths.packageFolder, env, variant, region, debug };\n\nif (!fs.existsSync(pkg.paths.webinyConfigFile)) {\n console.warn(`Cannot watch \"${pkg.name}\" package. No \"webiny.config.ts\" file found.`);\n process.exit(0);\n}\n\nconst config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {\n options\n});\n\nconst hasWatch = config.commands && typeof config.commands.watch === \"function\";\nif (hasWatch) {\n await config.commands.watch(options, {});\n} else {\n throw new Error(\"Watch command not found.\");\n}\n"],"names":["process","workerData","JSON","pkg","env","variant","region","debug","options","fs","console","config","requireConfigWithExecute","hasWatch","Error"],"mappings":";;;AAQAA,QAAQ,EAAE,CAAC,cAAc;IACrBA,QAAQ,IAAI,CAAC;AACjB;AAEA,MAAMC,aAAaC,KAAK,KAAK,CAACF,QAAQ,IAAI,CAAC,EAAE;AAC7C,MAAM,EAAE,SAASG,GAAG,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGN;AAEtD,MAAMO,UAAU;IAAE,KAAKL,IAAI,KAAK,CAAC,aAAa;IAAEC;IAAKC;IAASC;IAAQC;AAAM;AAE5E,IAAI,CAACE,GAAG,UAAU,CAACN,IAAI,KAAK,CAAC,gBAAgB,GAAG;IAC5CO,QAAQ,IAAI,CAAC,CAAC,cAAc,EAAEP,IAAI,IAAI,CAAC,4CAA4C,CAAC;IACpFH,QAAQ,IAAI,CAAC;AACjB;AAEA,MAAMW,SAAS,MAAMC,yBAAyBT,IAAI,KAAK,CAAC,gBAAgB,EAAE;IACtEK;AACJ;AAEA,MAAMK,WAAWF,OAAO,QAAQ,IAAI,AAAiC,cAAjC,OAAOA,OAAO,QAAQ,CAAC,KAAK;AAChE,IAAIE,UACA,MAAMF,OAAO,QAAQ,CAAC,KAAK,CAACH,SAAS,CAAC;KAEtC,MAAM,IAAIM,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/project",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -13,36 +13,35 @@
|
|
|
13
13
|
"description": "An SDK for managing Webiny projects.",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/build-tools": "6.6.0-alpha.
|
|
16
|
+
"@webiny/build-tools": "6.6.0-alpha.14",
|
|
17
17
|
"@webiny/di": "2.0.0",
|
|
18
|
-
"@webiny/feature-flags": "6.6.0-alpha.
|
|
19
|
-
"@webiny/global-config": "6.6.0-alpha.
|
|
20
|
-
"@webiny/react-properties": "6.6.0-alpha.
|
|
21
|
-
"@webiny/system-requirements": "6.6.0-alpha.
|
|
22
|
-
"@webiny/telemetry": "6.6.0-alpha.
|
|
23
|
-
"@webiny/wcp": "6.6.0-alpha.
|
|
18
|
+
"@webiny/feature-flags": "6.6.0-alpha.14",
|
|
19
|
+
"@webiny/global-config": "6.6.0-alpha.14",
|
|
20
|
+
"@webiny/react-properties": "6.6.0-alpha.14",
|
|
21
|
+
"@webiny/system-requirements": "6.6.0-alpha.14",
|
|
22
|
+
"@webiny/telemetry": "6.6.0-alpha.14",
|
|
23
|
+
"@webiny/wcp": "6.6.0-alpha.14",
|
|
24
24
|
"chalk": "6.0.1",
|
|
25
25
|
"chokidar": "6.0.0",
|
|
26
|
-
"ci-info": "4.
|
|
27
|
-
"debounce": "
|
|
26
|
+
"ci-info": "4.5.0",
|
|
27
|
+
"debounce": "4.0.0",
|
|
28
28
|
"deepmerge": "4.3.1",
|
|
29
|
-
"dotenv": "18.0.
|
|
30
|
-
"email-addresses": "5.0.0",
|
|
29
|
+
"dotenv": "18.0.10",
|
|
31
30
|
"exit-hook": "5.1.0",
|
|
32
31
|
"fast-glob": "3.3.3",
|
|
33
32
|
"find-up": "8.0.0",
|
|
34
33
|
"get-tsconfig": "4.14.3",
|
|
35
34
|
"graphql-request": "7.4.0",
|
|
36
|
-
"humanize-duration": "3.35.
|
|
35
|
+
"humanize-duration": "3.35.1",
|
|
37
36
|
"load-json-file": "7.0.1",
|
|
38
|
-
"mobx": "7.1.
|
|
39
|
-
"mobx-react-lite": "5.1.
|
|
37
|
+
"mobx": "7.1.7",
|
|
38
|
+
"mobx-react-lite": "5.1.3",
|
|
40
39
|
"neverthrow": "8.2.0",
|
|
41
40
|
"pino": "10.4.0",
|
|
42
41
|
"pino-pretty": "13.2.0",
|
|
43
42
|
"react": "19.3.1",
|
|
44
43
|
"react-reconciler": "0.34.0",
|
|
45
|
-
"serialize-error": "13.0
|
|
44
|
+
"serialize-error": "13.1.0",
|
|
46
45
|
"ts-morph": "28.0.0",
|
|
47
46
|
"tsx": "4.23.15",
|
|
48
47
|
"wrap-ansi": "10.0.2",
|
|
@@ -54,10 +53,10 @@
|
|
|
54
53
|
"@types/humanize-duration": "3.27.4",
|
|
55
54
|
"@types/lodash": "4.17.27",
|
|
56
55
|
"@types/react-reconciler": "0.34.1",
|
|
57
|
-
"rimraf": "6.1.
|
|
58
|
-
"type-fest": "
|
|
56
|
+
"rimraf": "6.1.4",
|
|
57
|
+
"type-fest": "6.0.3",
|
|
59
58
|
"typescript": "7.0.2",
|
|
60
|
-
"vitest": "5.
|
|
59
|
+
"vitest": "5.1.1"
|
|
61
60
|
},
|
|
62
61
|
"adio": {
|
|
63
62
|
"ignore": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services/GetProjectConfigService/EnvContext.js","sources":["../../../src/services/GetProjectConfigService/EnvContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\n\nexport interface EnvContextValue {\n env: string;\n variant?: string;\n region?: string;\n}\n\nexport interface EnvProviderProps extends Partial<EnvContextValue> {\n children: React.ReactNode;\n}\n\nconst EnvContext = createContext<EnvContextValue | null>(null);\n\n/*\n * Takes the environment explicitly. It used to read it back out of `WBY_PROJECT_SDK_CONTEXT`, which\n * was the only way to get it across to the child process the config was rendered in. The render\n * happens in the caller's process now, so the values are simply passed down.\n */\nexport const EnvProvider = ({ children, env, variant, region }: EnvProviderProps) => {\n const value: EnvContextValue = {\n env: env || \"dev\",\n variant,\n region\n };\n\n return <EnvContext.Provider value={value}>{children}</EnvContext.Provider>;\n};\n\nexport const useEnv = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useEnv must be used within an EnvProvider\");\n }\n return context.env;\n};\n\nexport const useVariant = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useVariant must be used within an EnvProvider\");\n }\n return context.variant;\n};\n\nexport const useRegion = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useRegion must be used within an EnvProvider\");\n }\n return context.region;\n};\n\nexport const useEnvContext = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useEnvContext must be used within an EnvProvider\");\n }\n return context;\n};\n"],"names":["EnvContext","createContext","EnvProvider","children","env","variant","region","value","useEnv","context","useContext","Error","useVariant","useRegion","useEnvContext"],"mappings":";AAYA,MAAMA,aAAa,
|
|
1
|
+
{"version":3,"file":"services/GetProjectConfigService/EnvContext.js","sources":["../../../src/services/GetProjectConfigService/EnvContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\n\nexport interface EnvContextValue {\n env: string;\n variant?: string;\n region?: string;\n}\n\nexport interface EnvProviderProps extends Partial<EnvContextValue> {\n children: React.ReactNode;\n}\n\nconst EnvContext = createContext<EnvContextValue | null>(null);\n\n/*\n * Takes the environment explicitly. It used to read it back out of `WBY_PROJECT_SDK_CONTEXT`, which\n * was the only way to get it across to the child process the config was rendered in. The render\n * happens in the caller's process now, so the values are simply passed down.\n */\nexport const EnvProvider = ({ children, env, variant, region }: EnvProviderProps) => {\n const value: EnvContextValue = {\n env: env || \"dev\",\n variant,\n region\n };\n\n return <EnvContext.Provider value={value}>{children}</EnvContext.Provider>;\n};\n\nexport const useEnv = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useEnv must be used within an EnvProvider\");\n }\n return context.env;\n};\n\nexport const useVariant = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useVariant must be used within an EnvProvider\");\n }\n return context.variant;\n};\n\nexport const useRegion = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useRegion must be used within an EnvProvider\");\n }\n return context.region;\n};\n\nexport const useEnvContext = () => {\n const context = useContext(EnvContext);\n if (!context) {\n throw new Error(\"useEnvContext must be used within an EnvProvider\");\n }\n return context;\n};\n"],"names":["EnvContext","createContext","EnvProvider","children","env","variant","region","value","useEnv","context","useContext","Error","useVariant","useRegion","useEnvContext"],"mappings":";AAYA,MAAMA,aAAa,WAAbA,GAAaC,cAAsC;AAOlD,MAAMC,cAAc,CAAC,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAoB;IAC5E,MAAMC,QAAyB;QAC3B,KAAKH,OAAO;QACZC;QACAC;IACJ;IAEA,OAAO,WAAP,GAAO,oBAACN,WAAW,QAAQ;QAAC,OAAOO;OAAQJ;AAC/C;AAEO,MAAMK,SAAS;IAClB,MAAMC,UAAUC,WAAWV;IAC3B,IAAI,CAACS,SACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF,QAAQ,GAAG;AACtB;AAEO,MAAMG,aAAa;IACtB,MAAMH,UAAUC,WAAWV;IAC3B,IAAI,CAACS,SACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF,QAAQ,OAAO;AAC1B;AAEO,MAAMI,YAAY;IACrB,MAAMJ,UAAUC,WAAWV;IAC3B,IAAI,CAACS,SACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF,QAAQ,MAAM;AACzB;AAEO,MAAMK,gBAAgB;IACzB,MAAML,UAAUC,WAAWV;IAC3B,IAAI,CAACS,SACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services/GetProjectConfigService/FeatureFlagsContext.js","sources":["../../../src/services/GetProjectConfigService/FeatureFlagsContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport { makeAutoObservable } from \"mobx\";\nimport { observer } from \"mobx-react-lite\";\nimport { FeatureFlags } from \"@webiny/feature-flags\";\nimport type { IFeatureFlagsDto } from \"@webiny/feature-flags\";\nimport { useWcpProjectLicense } from \"./WcpProjectLicenseContext.js\";\nimport { LicenseDecoratedFeatureFlags } from \"./LicenseDecoratedFeatureFlags.js\";\n\nclass FeatureFlagsStore {\n dto: IFeatureFlagsDto = {};\n ready = false;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n set(dto: IFeatureFlagsDto) {\n this.dto = dto;\n this.ready = true;\n }\n}\n\nconst store = new FeatureFlagsStore();\n\nexport function setProjectFeatureFlags(dto: IFeatureFlagsDto) {\n store.set(dto);\n}\n\nconst FeatureFlagsContext = createContext<FeatureFlags | null>(null);\n\nexport const FeatureFlagsProvider = observer(({ children }: { children: React.ReactNode }) => {\n const license = useWcpProjectLicense();\n const flags = license.hasLicense\n ? new LicenseDecoratedFeatureFlags(store.dto, license)\n : new FeatureFlags(store.dto);\n\n return <FeatureFlagsContext.Provider value={flags}>{children}</FeatureFlagsContext.Provider>;\n});\n\nexport const FeatureFlagsGate = observer(\n ({ children, skip }: { children: React.ReactNode; skip?: boolean }) => {\n if (!store.ready && !skip) {\n return null;\n }\n\n return <>{children}</>;\n }\n);\n\nexport function useProjectFeatureFlags(): FeatureFlags {\n const context = useContext(FeatureFlagsContext);\n if (!context) {\n throw new Error(\"useProjectFeatureFlags must be used within a FeatureFlagsProvider\");\n }\n return context;\n}\n"],"names":["FeatureFlagsStore","makeAutoObservable","dto","store","setProjectFeatureFlags","FeatureFlagsContext","createContext","FeatureFlagsProvider","observer","children","license","useWcpProjectLicense","flags","LicenseDecoratedFeatureFlags","FeatureFlags","FeatureFlagsGate","skip","useProjectFeatureFlags","context","useContext","Error"],"mappings":";;;;;;AAQA,MAAMA;IAIF,aAAc;aAHd,GAAG,GAAqB,CAAC;aACzB,KAAK,GAAG;QAGJC,mBAAmB,IAAI;IAC3B;IAEA,IAAIC,GAAqB,EAAE;QACvB,IAAI,CAAC,GAAG,GAAGA;QACX,IAAI,CAAC,KAAK,GAAG;IACjB;AACJ;AAEA,MAAMC,QAAQ,IAAIH;AAEX,SAASI,uBAAuBF,GAAqB;IACxDC,MAAM,GAAG,CAACD;AACd;AAEA,MAAMG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"services/GetProjectConfigService/FeatureFlagsContext.js","sources":["../../../src/services/GetProjectConfigService/FeatureFlagsContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport { makeAutoObservable } from \"mobx\";\nimport { observer } from \"mobx-react-lite\";\nimport { FeatureFlags } from \"@webiny/feature-flags\";\nimport type { IFeatureFlagsDto } from \"@webiny/feature-flags\";\nimport { useWcpProjectLicense } from \"./WcpProjectLicenseContext.js\";\nimport { LicenseDecoratedFeatureFlags } from \"./LicenseDecoratedFeatureFlags.js\";\n\nclass FeatureFlagsStore {\n dto: IFeatureFlagsDto = {};\n ready = false;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n set(dto: IFeatureFlagsDto) {\n this.dto = dto;\n this.ready = true;\n }\n}\n\nconst store = new FeatureFlagsStore();\n\nexport function setProjectFeatureFlags(dto: IFeatureFlagsDto) {\n store.set(dto);\n}\n\nconst FeatureFlagsContext = createContext<FeatureFlags | null>(null);\n\nexport const FeatureFlagsProvider = observer(({ children }: { children: React.ReactNode }) => {\n const license = useWcpProjectLicense();\n const flags = license.hasLicense\n ? new LicenseDecoratedFeatureFlags(store.dto, license)\n : new FeatureFlags(store.dto);\n\n return <FeatureFlagsContext.Provider value={flags}>{children}</FeatureFlagsContext.Provider>;\n});\n\nexport const FeatureFlagsGate = observer(\n ({ children, skip }: { children: React.ReactNode; skip?: boolean }) => {\n if (!store.ready && !skip) {\n return null;\n }\n\n return <>{children}</>;\n }\n);\n\nexport function useProjectFeatureFlags(): FeatureFlags {\n const context = useContext(FeatureFlagsContext);\n if (!context) {\n throw new Error(\"useProjectFeatureFlags must be used within a FeatureFlagsProvider\");\n }\n return context;\n}\n"],"names":["FeatureFlagsStore","makeAutoObservable","dto","store","setProjectFeatureFlags","FeatureFlagsContext","createContext","FeatureFlagsProvider","observer","children","license","useWcpProjectLicense","flags","LicenseDecoratedFeatureFlags","FeatureFlags","FeatureFlagsGate","skip","useProjectFeatureFlags","context","useContext","Error"],"mappings":";;;;;;AAQA,MAAMA;IAIF,aAAc;aAHd,GAAG,GAAqB,CAAC;aACzB,KAAK,GAAG;QAGJC,mBAAmB,IAAI;IAC3B;IAEA,IAAIC,GAAqB,EAAE;QACvB,IAAI,CAAC,GAAG,GAAGA;QACX,IAAI,CAAC,KAAK,GAAG;IACjB;AACJ;AAEA,MAAMC,QAAQ,IAAIH;AAEX,SAASI,uBAAuBF,GAAqB;IACxDC,MAAM,GAAG,CAACD;AACd;AAEA,MAAMG,sBAAsB,WAAtBA,GAAsBC,cAAmC;AAExD,MAAMC,uBAAuBC,SAAS,CAAC,EAAEC,QAAQ,EAAiC;IACrF,MAAMC,UAAUC;IAChB,MAAMC,QAAQF,QAAQ,UAAU,GAC1B,IAAIG,6BAA6BV,MAAM,GAAG,EAAEO,WAC5C,IAAII,aAAaX,MAAM,GAAG;IAEhC,OAAO,WAAP,GAAO,oBAACE,oBAAoB,QAAQ;QAAC,OAAOO;OAAQH;AACxD;AAEO,MAAMM,mBAAmBP,SAC5B,CAAC,EAAEC,QAAQ,EAAEO,IAAI,EAAiD;IAC9D,IAAI,CAACb,MAAM,KAAK,IAAI,CAACa,MACjB,OAAO;IAGX,OAAO,WAAP,GAAO,0CAAGP;AACd;AAGG,SAASQ;IACZ,MAAMC,UAAUC,WAAWd;IAC3B,IAAI,CAACa,SACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services/GetProjectConfigService/ProductionEnvironmentsContext.js","sources":["../../../src/services/GetProjectConfigService/ProductionEnvironmentsContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\n\ninterface ProductionEnvironmentsContextValue {\n prodEnvs: string[];\n setProdEnvs: React.Dispatch<React.SetStateAction<string[]>>;\n}\n\nconst ProductionEnvironmentsContext = createContext<ProductionEnvironmentsContextValue | null>(\n null\n);\n\nexport const ProductionEnvironmentsCollector: React.FC<{ children: React.ReactNode }> = ({\n children\n}) => {\n const [prodEnvs, setProdEnvs] = useState<string[]>([]);\n return (\n <ProductionEnvironmentsContext.Provider value={{ prodEnvs, setProdEnvs }}>\n {children}\n </ProductionEnvironmentsContext.Provider>\n );\n};\n\nexport const useProductionEnvironments = (): string[] => {\n return useContext(ProductionEnvironmentsContext)?.prodEnvs ?? [];\n};\n\nexport const useRegisterProductionEnvironments = () => {\n return useContext(ProductionEnvironmentsContext)?.setProdEnvs ?? null;\n};\n"],"names":["ProductionEnvironmentsContext","createContext","ProductionEnvironmentsCollector","children","prodEnvs","setProdEnvs","useState","useProductionEnvironments","useContext","useRegisterProductionEnvironments"],"mappings":";AAOA,MAAMA,gCAAgC,
|
|
1
|
+
{"version":3,"file":"services/GetProjectConfigService/ProductionEnvironmentsContext.js","sources":["../../../src/services/GetProjectConfigService/ProductionEnvironmentsContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\n\ninterface ProductionEnvironmentsContextValue {\n prodEnvs: string[];\n setProdEnvs: React.Dispatch<React.SetStateAction<string[]>>;\n}\n\nconst ProductionEnvironmentsContext = createContext<ProductionEnvironmentsContextValue | null>(\n null\n);\n\nexport const ProductionEnvironmentsCollector: React.FC<{ children: React.ReactNode }> = ({\n children\n}) => {\n const [prodEnvs, setProdEnvs] = useState<string[]>([]);\n return (\n <ProductionEnvironmentsContext.Provider value={{ prodEnvs, setProdEnvs }}>\n {children}\n </ProductionEnvironmentsContext.Provider>\n );\n};\n\nexport const useProductionEnvironments = (): string[] => {\n return useContext(ProductionEnvironmentsContext)?.prodEnvs ?? [];\n};\n\nexport const useRegisterProductionEnvironments = () => {\n return useContext(ProductionEnvironmentsContext)?.setProdEnvs ?? null;\n};\n"],"names":["ProductionEnvironmentsContext","createContext","ProductionEnvironmentsCollector","children","prodEnvs","setProdEnvs","useState","useProductionEnvironments","useContext","useRegisterProductionEnvironments"],"mappings":";AAOA,MAAMA,gCAAgC,WAAhCA,GAAgCC,cAClC;AAGG,MAAMC,kCAA2E,CAAC,EACrFC,QAAQ,EACX;IACG,MAAM,CAACC,UAAUC,YAAY,GAAGC,SAAmB,EAAE;IACrD,OAAO,WAAP,GACI,oBAACN,8BAA8B,QAAQ;QAAC,OAAO;YAAEI;YAAUC;QAAY;OAClEF;AAGb;AAEO,MAAMI,4BAA4B,IAC9BC,WAAWR,gCAAgC,YAAY,EAAE;AAG7D,MAAMS,oCAAoC,IACtCD,WAAWR,gCAAgC,eAAe"}
|
|
@@ -8,6 +8,7 @@ export interface WcpProjectLicenseContextValue {
|
|
|
8
8
|
canUseFileManagerThreatDetection: () => boolean;
|
|
9
9
|
canUseWorkflows: () => boolean;
|
|
10
10
|
canUseHcmsFieldPermissions: () => boolean;
|
|
11
|
+
canUseAiPowerups: () => boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare const WcpProjectLicenseProvider: React.FC<{
|
|
13
14
|
children: React.ReactNode;
|
|
@@ -22,7 +22,8 @@ const WcpProjectLicenseProvider = ({ children })=>{
|
|
|
22
22
|
canUsePrivateFiles: ()=>license?.canUsePrivateFiles() ?? false,
|
|
23
23
|
canUseFileManagerThreatDetection: ()=>license?.canUseFileManagerThreatDetection() ?? false,
|
|
24
24
|
canUseWorkflows: ()=>license?.canUseWorkflows() ?? false,
|
|
25
|
-
canUseHcmsFieldPermissions: ()=>license?.canUseHcmsFieldPermissions() ?? false
|
|
25
|
+
canUseHcmsFieldPermissions: ()=>license?.canUseHcmsFieldPermissions() ?? false,
|
|
26
|
+
canUseAiPowerups: ()=>license?.canUseAiPowerups() ?? false
|
|
26
27
|
};
|
|
27
28
|
return /*#__PURE__*/ react.createElement(WcpProjectLicenseContext.Provider, {
|
|
28
29
|
value: value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services/GetProjectConfigService/WcpProjectLicenseContext.js","sources":["../../../src/services/GetProjectConfigService/WcpProjectLicenseContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo } from \"react\";\nimport { License } from \"@webiny/wcp\";\nimport type { DecryptedWcpProjectLicense } from \"@webiny/wcp/types.js\";\n\nexport interface WcpProjectLicenseContextValue {\n hasLicense: boolean;\n canUseMultiTenancy: () => boolean;\n canUseLanguages: () => boolean;\n canUseTeams: () => boolean;\n canUsePrivateFiles: () => boolean;\n canUseFileManagerThreatDetection: () => boolean;\n canUseWorkflows: () => boolean;\n canUseHcmsFieldPermissions: () => boolean;\n}\n\nconst WcpProjectLicenseContext = createContext<WcpProjectLicenseContextValue | null>(null);\n\nexport const WcpProjectLicenseProvider: React.FC<{ children: React.ReactNode }> = ({\n children\n}) => {\n const license = useMemo(() => {\n const licenseEnv = process.env.WCP_PROJECT_LICENSE;\n if (!licenseEnv) {\n return null;\n }\n\n try {\n const licenseDto = JSON.parse(licenseEnv) as DecryptedWcpProjectLicense;\n return License.fromLicenseDto(licenseDto);\n } catch (e) {\n console.warn(\n \"Failed to parse WCP_PROJECT_LICENSE environment variable. Expected valid JSON with DecryptedWcpProjectLicense format:\",\n e\n );\n return null;\n }\n }, []);\n\n const hasLicense = !!license;\n\n const value: WcpProjectLicenseContextValue = {\n hasLicense,\n canUseMultiTenancy: () => hasLicense,\n canUseLanguages: () => license?.canUseLanguages() ?? false,\n canUseTeams: () => license?.canUseTeams() ?? false,\n canUsePrivateFiles: () => license?.canUsePrivateFiles() ?? false,\n canUseFileManagerThreatDetection: () =>\n license?.canUseFileManagerThreatDetection() ?? false,\n canUseWorkflows: () => license?.canUseWorkflows() ?? false,\n canUseHcmsFieldPermissions: () => license?.canUseHcmsFieldPermissions() ?? false\n };\n\n return (\n <WcpProjectLicenseContext.Provider value={value}>\n {children}\n </WcpProjectLicenseContext.Provider>\n );\n};\n\nexport const useWcpProjectLicense = () => {\n const context = useContext(WcpProjectLicenseContext);\n if (!context) {\n throw new Error(\"useWcpProjectLicense must be used within a WcpProjectLicenseProvider\");\n }\n return context;\n};\n"],"names":["WcpProjectLicenseContext","createContext","WcpProjectLicenseProvider","children","license","useMemo","licenseEnv","process","licenseDto","JSON","License","e","console","hasLicense","value","useWcpProjectLicense","context","useContext","Error"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"services/GetProjectConfigService/WcpProjectLicenseContext.js","sources":["../../../src/services/GetProjectConfigService/WcpProjectLicenseContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo } from \"react\";\nimport { License } from \"@webiny/wcp\";\nimport type { DecryptedWcpProjectLicense } from \"@webiny/wcp/types.js\";\n\nexport interface WcpProjectLicenseContextValue {\n hasLicense: boolean;\n canUseMultiTenancy: () => boolean;\n canUseLanguages: () => boolean;\n canUseTeams: () => boolean;\n canUsePrivateFiles: () => boolean;\n canUseFileManagerThreatDetection: () => boolean;\n canUseWorkflows: () => boolean;\n canUseHcmsFieldPermissions: () => boolean;\n canUseAiPowerups: () => boolean;\n}\n\nconst WcpProjectLicenseContext = createContext<WcpProjectLicenseContextValue | null>(null);\n\nexport const WcpProjectLicenseProvider: React.FC<{ children: React.ReactNode }> = ({\n children\n}) => {\n const license = useMemo(() => {\n const licenseEnv = process.env.WCP_PROJECT_LICENSE;\n if (!licenseEnv) {\n return null;\n }\n\n try {\n const licenseDto = JSON.parse(licenseEnv) as DecryptedWcpProjectLicense;\n return License.fromLicenseDto(licenseDto);\n } catch (e) {\n console.warn(\n \"Failed to parse WCP_PROJECT_LICENSE environment variable. Expected valid JSON with DecryptedWcpProjectLicense format:\",\n e\n );\n return null;\n }\n }, []);\n\n const hasLicense = !!license;\n\n const value: WcpProjectLicenseContextValue = {\n hasLicense,\n canUseMultiTenancy: () => hasLicense,\n canUseLanguages: () => license?.canUseLanguages() ?? false,\n canUseTeams: () => license?.canUseTeams() ?? false,\n canUsePrivateFiles: () => license?.canUsePrivateFiles() ?? false,\n canUseFileManagerThreatDetection: () =>\n license?.canUseFileManagerThreatDetection() ?? false,\n canUseWorkflows: () => license?.canUseWorkflows() ?? false,\n canUseHcmsFieldPermissions: () => license?.canUseHcmsFieldPermissions() ?? false,\n canUseAiPowerups: () => license?.canUseAiPowerups() ?? false\n };\n\n return (\n <WcpProjectLicenseContext.Provider value={value}>\n {children}\n </WcpProjectLicenseContext.Provider>\n );\n};\n\nexport const useWcpProjectLicense = () => {\n const context = useContext(WcpProjectLicenseContext);\n if (!context) {\n throw new Error(\"useWcpProjectLicense must be used within a WcpProjectLicenseProvider\");\n }\n return context;\n};\n"],"names":["WcpProjectLicenseContext","createContext","WcpProjectLicenseProvider","children","license","useMemo","licenseEnv","process","licenseDto","JSON","License","e","console","hasLicense","value","useWcpProjectLicense","context","useContext","Error"],"mappings":";;AAgBA,MAAMA,2BAA2B,WAA3BA,GAA2BC,cAAoD;AAE9E,MAAMC,4BAAqE,CAAC,EAC/EC,QAAQ,EACX;IACG,MAAMC,UAAUC,QAAQ;QACpB,MAAMC,aAAaC,QAAQ,GAAG,CAAC,mBAAmB;QAClD,IAAI,CAACD,YACD,OAAO;QAGX,IAAI;YACA,MAAME,aAAaC,KAAK,KAAK,CAACH;YAC9B,OAAOI,QAAQ,cAAc,CAACF;QAClC,EAAE,OAAOG,GAAG;YACRC,QAAQ,IAAI,CACR,yHACAD;YAEJ,OAAO;QACX;IACJ,GAAG,EAAE;IAEL,MAAME,aAAa,CAAC,CAACT;IAErB,MAAMU,QAAuC;QACzCD;QACA,oBAAoB,IAAMA;QAC1B,iBAAiB,IAAMT,SAAS,qBAAqB;QACrD,aAAa,IAAMA,SAAS,iBAAiB;QAC7C,oBAAoB,IAAMA,SAAS,wBAAwB;QAC3D,kCAAkC,IAC9BA,SAAS,sCAAsC;QACnD,iBAAiB,IAAMA,SAAS,qBAAqB;QACrD,4BAA4B,IAAMA,SAAS,gCAAgC;QAC3E,kBAAkB,IAAMA,SAAS,sBAAsB;IAC3D;IAEA,OAAO,WAAP,GACI,oBAACJ,yBAAyB,QAAQ;QAAC,OAAOc;OACrCX;AAGb;AAEO,MAAMY,uBAAuB;IAChC,MAAMC,UAAUC,WAAWjB;IAC3B,IAAI,CAACgB,SACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF;AACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DEFAULT_TENANT_STORAGE_ID, tenantStorageIdentitySchema, assertTenantStorageIds, formatStoragesLine, type TenantStorageDeclaration, type StoragesLineParams } from "./tenantStorageDeclarations.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DEFAULT_TENANT_STORAGE_ID, assertTenantStorageIds, formatStoragesLine, tenantStorageIdentitySchema } from "./tenantStorageDeclarations.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The id of the deploy's own storage, as the API knows it. The default storage has no component of
|
|
4
|
+
* its own (it's whichever database the config picks), so no `Infra.TenantStorage.*` may take it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_TENANT_STORAGE_ID = "default";
|
|
7
|
+
/**
|
|
8
|
+
* The params every `Infra.TenantStorage.*` component takes, next to its connection. A tenant's
|
|
9
|
+
* `settings.storage` stores the `id`, so it can't change once a tenant runs on it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const tenantStorageIdentitySchema: {
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
label: z.ZodString;
|
|
14
|
+
retired: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
};
|
|
16
|
+
/** One extra storage, as the config declares it. */
|
|
17
|
+
export interface TenantStorageDeclaration {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
retired: boolean;
|
|
21
|
+
/** The storage's family as a person reads it: "Postgres", "PGlite", "Aurora Postgres". */
|
|
22
|
+
family: string;
|
|
23
|
+
/** The component that declares it, for error messages: `<Infra.TenantStorage.Postgres>`. */
|
|
24
|
+
component: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Every declared storage needs an id of its own that a tenant's `settings.storage` can hold: a
|
|
28
|
+
* lowercase slug, not the default storage's id, and not another storage's. Checked across all
|
|
29
|
+
* `Infra.TenantStorage.*` components, so a Postgres and a PGlite storage can't share one either.
|
|
30
|
+
*/
|
|
31
|
+
export declare const assertTenantStorageIds: (declarations: TenantStorageDeclaration[]) => void;
|
|
32
|
+
export interface StoragesLineParams {
|
|
33
|
+
/** The default storage's family: "SQLite", "DynamoDB + OpenSearch", ... */
|
|
34
|
+
defaultFamily: string;
|
|
35
|
+
storages: Pick<TenantStorageDeclaration, "id" | "label" | "retired" | "family">[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The one line the CLI prints at start, so the config's storages can be read at a glance:
|
|
39
|
+
* `Storages: default = SQLite (root); local-pg = PGlite "Local Postgres"`. Retired storages are
|
|
40
|
+
* marked `(retired)`.
|
|
41
|
+
*/
|
|
42
|
+
export declare const formatStoragesLine: (params: StoragesLineParams) => string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { GracefulError } from "../GracefulError.js";
|
|
3
|
+
const DEFAULT_TENANT_STORAGE_ID = "default";
|
|
4
|
+
const TENANT_STORAGE_ID = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
5
|
+
const tenantStorageIdentitySchema = {
|
|
6
|
+
id: z.string().describe('The storage\'s id, stored in each tenant placed on it. A lowercase slug (e.g. "pg-eu"); never "default", which is the default storage\'s. Can\'t change once tenants run on it.'),
|
|
7
|
+
label: z.string().describe("The name the Tenant Manager shows for the storage."),
|
|
8
|
+
retired: z.boolean().optional().describe("A retired storage is no longer offered for new tenants, and tenants already on it keep running. Retire a storage before removing its declaration.")
|
|
9
|
+
};
|
|
10
|
+
const assertTenantStorageIds = (declarations)=>{
|
|
11
|
+
const seen = new Map();
|
|
12
|
+
for (const declaration of declarations){
|
|
13
|
+
const { id, component } = declaration;
|
|
14
|
+
if (id === DEFAULT_TENANT_STORAGE_ID) throw new GracefulError(`${component} can't use the id "${DEFAULT_TENANT_STORAGE_ID}": it is the default storage's, the database the config picks with its own component. Give the storage another id.`);
|
|
15
|
+
if (!TENANT_STORAGE_ID.test(id)) throw new GracefulError(`${component} has the id "${id}", which isn't a lowercase slug. Use lowercase letters, digits and single dashes, e.g. "pg-eu".`);
|
|
16
|
+
const other = seen.get(id);
|
|
17
|
+
if (other) throw new GracefulError(`${other} and ${component} both have the id "${id}". Each storage needs an id of its own.`);
|
|
18
|
+
seen.set(id, component);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const formatStoragesLine = (params)=>{
|
|
22
|
+
const parts = [
|
|
23
|
+
`${DEFAULT_TENANT_STORAGE_ID} = ${params.defaultFamily} (root)`
|
|
24
|
+
];
|
|
25
|
+
for (const storage of params.storages){
|
|
26
|
+
const retired = storage.retired ? " (retired)" : "";
|
|
27
|
+
parts.push(`${storage.id} = ${storage.family} "${storage.label}"${retired}`);
|
|
28
|
+
}
|
|
29
|
+
return `Storages: ${parts.join("; ")}`;
|
|
30
|
+
};
|
|
31
|
+
export { DEFAULT_TENANT_STORAGE_ID, assertTenantStorageIds, formatStoragesLine, tenantStorageIdentitySchema };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=tenantStorageDeclarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantStorages/tenantStorageDeclarations.js","sources":["../../src/tenantStorages/tenantStorageDeclarations.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { GracefulError } from \"~/GracefulError.js\";\n\n/**\n * The id of the deploy's own storage, as the API knows it. The default storage has no component of\n * its own (it's whichever database the config picks), so no `Infra.TenantStorage.*` may take it.\n */\nexport const DEFAULT_TENANT_STORAGE_ID = \"default\";\n\n/** A lowercase slug: letters, digits and single dashes between them. */\nconst TENANT_STORAGE_ID = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/**\n * The params every `Infra.TenantStorage.*` component takes, next to its connection. A tenant's\n * `settings.storage` stores the `id`, so it can't change once a tenant runs on it.\n */\nexport const tenantStorageIdentitySchema = {\n id: z\n .string()\n .describe(\n 'The storage\\'s id, stored in each tenant placed on it. A lowercase slug (e.g. \"pg-eu\"); never \"default\", which is the default storage\\'s. Can\\'t change once tenants run on it.'\n ),\n label: z.string().describe(\"The name the Tenant Manager shows for the storage.\"),\n retired: z\n .boolean()\n .optional()\n .describe(\n \"A retired storage is no longer offered for new tenants, and tenants already on it keep running. Retire a storage before removing its declaration.\"\n )\n};\n\n/** One extra storage, as the config declares it. */\nexport interface TenantStorageDeclaration {\n id: string;\n label: string;\n retired: boolean;\n /** The storage's family as a person reads it: \"Postgres\", \"PGlite\", \"Aurora Postgres\". */\n family: string;\n /** The component that declares it, for error messages: `<Infra.TenantStorage.Postgres>`. */\n component: string;\n}\n\n/**\n * Every declared storage needs an id of its own that a tenant's `settings.storage` can hold: a\n * lowercase slug, not the default storage's id, and not another storage's. Checked across all\n * `Infra.TenantStorage.*` components, so a Postgres and a PGlite storage can't share one either.\n */\nexport const assertTenantStorageIds = (declarations: TenantStorageDeclaration[]): void => {\n const seen = new Map<string, string>();\n for (const declaration of declarations) {\n const { id, component } = declaration;\n if (id === DEFAULT_TENANT_STORAGE_ID) {\n throw new GracefulError(\n `${component} can't use the id \"${DEFAULT_TENANT_STORAGE_ID}\": it is the default storage's, the database the config picks with its own component. Give the storage another id.`\n );\n }\n if (!TENANT_STORAGE_ID.test(id)) {\n throw new GracefulError(\n `${component} has the id \"${id}\", which isn't a lowercase slug. Use lowercase letters, digits and single dashes, e.g. \"pg-eu\".`\n );\n }\n const other = seen.get(id);\n if (other) {\n throw new GracefulError(\n `${other} and ${component} both have the id \"${id}\". Each storage needs an id of its own.`\n );\n }\n seen.set(id, component);\n }\n};\n\nexport interface StoragesLineParams {\n /** The default storage's family: \"SQLite\", \"DynamoDB + OpenSearch\", ... */\n defaultFamily: string;\n storages: Pick<TenantStorageDeclaration, \"id\" | \"label\" | \"retired\" | \"family\">[];\n}\n\n/**\n * The one line the CLI prints at start, so the config's storages can be read at a glance:\n * `Storages: default = SQLite (root); local-pg = PGlite \"Local Postgres\"`. Retired storages are\n * marked `(retired)`.\n */\nexport const formatStoragesLine = (params: StoragesLineParams): string => {\n const parts = [`${DEFAULT_TENANT_STORAGE_ID} = ${params.defaultFamily} (root)`];\n for (const storage of params.storages) {\n const retired = storage.retired ? \" (retired)\" : \"\";\n parts.push(`${storage.id} = ${storage.family} \"${storage.label}\"${retired}`);\n }\n return `Storages: ${parts.join(\"; \")}`;\n};\n"],"names":["DEFAULT_TENANT_STORAGE_ID","TENANT_STORAGE_ID","tenantStorageIdentitySchema","z","assertTenantStorageIds","declarations","seen","Map","declaration","id","component","GracefulError","other","formatStoragesLine","params","parts","storage","retired"],"mappings":";;AAOO,MAAMA,4BAA4B;AAGzC,MAAMC,oBAAoB;AAMnB,MAAMC,8BAA8B;IACvC,IAAIC,EAAAA,MACO,GACN,QAAQ,CACL;IAER,OAAOA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,SAASA,EAAAA,OACG,GACP,QAAQ,GACR,QAAQ,CACL;AAEZ;AAkBO,MAAMC,yBAAyB,CAACC;IACnC,MAAMC,OAAO,IAAIC;IACjB,KAAK,MAAMC,eAAeH,aAAc;QACpC,MAAM,EAAEI,EAAE,EAAEC,SAAS,EAAE,GAAGF;QAC1B,IAAIC,OAAOT,2BACP,MAAM,IAAIW,cACN,GAAGD,UAAU,mBAAmB,EAAEV,0BAA0B,kHAAkH,CAAC;QAGvL,IAAI,CAACC,kBAAkB,IAAI,CAACQ,KACxB,MAAM,IAAIE,cACN,GAAGD,UAAU,aAAa,EAAED,GAAG,+FAA+F,CAAC;QAGvI,MAAMG,QAAQN,KAAK,GAAG,CAACG;QACvB,IAAIG,OACA,MAAM,IAAID,cACN,GAAGC,MAAM,KAAK,EAAEF,UAAU,mBAAmB,EAAED,GAAG,uCAAuC,CAAC;QAGlGH,KAAK,GAAG,CAACG,IAAIC;IACjB;AACJ;AAaO,MAAMG,qBAAqB,CAACC;IAC/B,MAAMC,QAAQ;QAAC,GAAGf,0BAA0B,GAAG,EAAEc,OAAO,aAAa,CAAC,OAAO,CAAC;KAAC;IAC/E,KAAK,MAAME,WAAWF,OAAO,QAAQ,CAAE;QACnC,MAAMG,UAAUD,QAAQ,OAAO,GAAG,eAAe;QACjDD,MAAM,IAAI,CAAC,GAAGC,QAAQ,EAAE,CAAC,GAAG,EAAEA,QAAQ,MAAM,CAAC,EAAE,EAAEA,QAAQ,KAAK,CAAC,CAAC,EAAEC,SAAS;IAC/E;IACA,OAAO,CAAC,UAAU,EAAEF,MAAM,IAAI,CAAC,OAAO;AAC1C"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const Smtp: import("~/defineExtension/index.js").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
host: import("zod").ZodString;
|
|
3
|
-
port: import("zod").ZodNumber;
|
|
4
|
-
user: import("zod").ZodString;
|
|
5
|
-
password: import("zod").ZodString;
|
|
6
|
-
from: import("zod").ZodString;
|
|
7
|
-
replyTo: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
-
}, import("zod/v4/core").$strip>>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import react from "react";
|
|
2
|
-
import { defineExtension } from "../../../defineExtension/index.js";
|
|
3
|
-
import { BuildParam } from "../../ApiBuildParam.js";
|
|
4
|
-
import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
|
|
5
|
-
const Smtp = defineExtension({
|
|
6
|
-
type: "Api/Mailer/Smtp",
|
|
7
|
-
tags: {
|
|
8
|
-
runtimeContext: "project",
|
|
9
|
-
hosting: "all"
|
|
10
|
-
},
|
|
11
|
-
description: "Configure mailer SMTP transport settings via code. Always pass the password through a build-time env var, e.g. `password={process.env.SMTP_PASSWORD!}` — the value is serialized into the build artifact, so hard-coding it would commit the secret to source control.",
|
|
12
|
-
paramsSchema: SmtpParamsSchema,
|
|
13
|
-
render (params) {
|
|
14
|
-
return /*#__PURE__*/ react.createElement(BuildParam, {
|
|
15
|
-
paramName: "Mailer.SmtpSettings",
|
|
16
|
-
value: params
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
export { Smtp };
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=Smtp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/api/Mailer/Smtp.js","sources":["../../../../src/extensions/api/Mailer/Smtp.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { BuildParam } from \"~/extensions/ApiBuildParam.js\";\nimport { SmtpParamsSchema } from \"./SmtpParamsSchema.js\";\n\nexport const Smtp = defineExtension({\n type: \"Api/Mailer/Smtp\",\n tags: { runtimeContext: \"project\", hosting: \"all\" },\n description:\n \"Configure mailer SMTP transport settings via code. Always pass the password through a build-time env var, e.g. `password={process.env.SMTP_PASSWORD!}` — the value is serialized into the build artifact, so hard-coding it would commit the secret to source control.\",\n paramsSchema: SmtpParamsSchema,\n render(params) {\n return <BuildParam paramName=\"Mailer.SmtpSettings\" value={params} />;\n }\n});\n"],"names":["Smtp","defineExtension","SmtpParamsSchema","params","BuildParam"],"mappings":";;;;AAKO,MAAMA,OAAOC,gBAAgB;IAChC,MAAM;IACN,MAAM;QAAE,gBAAgB;QAAW,SAAS;IAAM;IAClD,aACI;IACJ,cAAcC;IACd,QAAOC,MAAM;QACT,OAAO,WAAP,GAAO,oBAACC,YAAUA;YAAC,WAAU;YAAsB,OAAOD;;IAC9D;AACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { SmtpParamsSchema } from "./SmtpParamsSchema.js";
|
|
3
|
-
const validParams = {
|
|
4
|
-
host: "smtp.example.com",
|
|
5
|
-
port: 587,
|
|
6
|
-
user: "smtp-user",
|
|
7
|
-
password: "secret",
|
|
8
|
-
from: "Webiny <test@webiny.com>",
|
|
9
|
-
replyTo: "No-reply <no-reply@webiny.com>"
|
|
10
|
-
};
|
|
11
|
-
describe("Smtp paramsSchema", ()=>{
|
|
12
|
-
describe("valid inputs", ()=>{
|
|
13
|
-
it("accepts a complete valid config", async ()=>{
|
|
14
|
-
const result = await SmtpParamsSchema.safeParseAsync(validParams);
|
|
15
|
-
expect(result.success).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
it("accepts config without replyTo (it is optional)", async ()=>{
|
|
18
|
-
const { replyTo: _, ...params } = validParams;
|
|
19
|
-
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
20
|
-
expect(result.success).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
it("accepts bare addr-spec for from and replyTo", async ()=>{
|
|
23
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
24
|
-
...validParams,
|
|
25
|
-
from: "test@webiny.com",
|
|
26
|
-
replyTo: "no-reply@webiny.com"
|
|
27
|
-
});
|
|
28
|
-
expect(result.success).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
describe("react-properties serialization bug", ()=>{
|
|
32
|
-
it("password={} reproduces the 'expected string, received object' error", async ()=>{
|
|
33
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
34
|
-
...validParams,
|
|
35
|
-
password: {}
|
|
36
|
-
});
|
|
37
|
-
expect(result.success).toBe(false);
|
|
38
|
-
const issue = result.error?.issues[0];
|
|
39
|
-
expect(issue?.code).toBe("invalid_type");
|
|
40
|
-
expect(issue?.path).toEqual([
|
|
41
|
-
"password"
|
|
42
|
-
]);
|
|
43
|
-
expect(issue?.message).toBe("Invalid input: expected string, received object");
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
describe("required string fields", ()=>{
|
|
47
|
-
it("rejects missing host", async ()=>{
|
|
48
|
-
const { host: _, ...params } = validParams;
|
|
49
|
-
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
50
|
-
expect(result.success).toBe(false);
|
|
51
|
-
});
|
|
52
|
-
it("rejects empty host", async ()=>{
|
|
53
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
54
|
-
...validParams,
|
|
55
|
-
host: ""
|
|
56
|
-
});
|
|
57
|
-
expect(result.success).toBe(false);
|
|
58
|
-
});
|
|
59
|
-
it("rejects missing user", async ()=>{
|
|
60
|
-
const { user: _, ...params } = validParams;
|
|
61
|
-
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
62
|
-
expect(result.success).toBe(false);
|
|
63
|
-
});
|
|
64
|
-
it("rejects empty user", async ()=>{
|
|
65
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
66
|
-
...validParams,
|
|
67
|
-
user: ""
|
|
68
|
-
});
|
|
69
|
-
expect(result.success).toBe(false);
|
|
70
|
-
});
|
|
71
|
-
it("rejects missing password", async ()=>{
|
|
72
|
-
const { password: _, ...params } = validParams;
|
|
73
|
-
const result = await SmtpParamsSchema.safeParseAsync(params);
|
|
74
|
-
expect(result.success).toBe(false);
|
|
75
|
-
});
|
|
76
|
-
it("rejects empty password", async ()=>{
|
|
77
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
78
|
-
...validParams,
|
|
79
|
-
password: ""
|
|
80
|
-
});
|
|
81
|
-
expect(result.success).toBe(false);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
describe("port validation", ()=>{
|
|
85
|
-
it("rejects port 0", async ()=>{
|
|
86
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
87
|
-
...validParams,
|
|
88
|
-
port: 0
|
|
89
|
-
});
|
|
90
|
-
expect(result.success).toBe(false);
|
|
91
|
-
});
|
|
92
|
-
it("rejects negative port", async ()=>{
|
|
93
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
94
|
-
...validParams,
|
|
95
|
-
port: -1
|
|
96
|
-
});
|
|
97
|
-
expect(result.success).toBe(false);
|
|
98
|
-
});
|
|
99
|
-
it("rejects fractional port", async ()=>{
|
|
100
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
101
|
-
...validParams,
|
|
102
|
-
port: 587.5
|
|
103
|
-
});
|
|
104
|
-
expect(result.success).toBe(false);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
describe("email address validation", ()=>{
|
|
108
|
-
it("rejects invalid from address", async ()=>{
|
|
109
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
110
|
-
...validParams,
|
|
111
|
-
from: "not-an-email"
|
|
112
|
-
});
|
|
113
|
-
expect(result.success).toBe(false);
|
|
114
|
-
expect(result.error?.issues[0].message).toBe("Invalid email address.");
|
|
115
|
-
});
|
|
116
|
-
it("rejects invalid replyTo address", async ()=>{
|
|
117
|
-
const result = await SmtpParamsSchema.safeParseAsync({
|
|
118
|
-
...validParams,
|
|
119
|
-
replyTo: "not-an-email"
|
|
120
|
-
});
|
|
121
|
-
expect(result.success).toBe(false);
|
|
122
|
-
expect(result.error?.issues[0].message).toBe("Invalid email address.");
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
//# sourceMappingURL=Smtp.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/api/Mailer/Smtp.test.js","sources":["../../../../src/extensions/api/Mailer/Smtp.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { SmtpParamsSchema as schema } from \"./SmtpParamsSchema.js\";\n\nconst validParams = {\n host: \"smtp.example.com\",\n port: 587,\n user: \"smtp-user\",\n password: \"secret\",\n from: \"Webiny <test@webiny.com>\",\n replyTo: \"No-reply <no-reply@webiny.com>\"\n};\n\ndescribe(\"Smtp paramsSchema\", () => {\n describe(\"valid inputs\", () => {\n it(\"accepts a complete valid config\", async () => {\n const result = await schema.safeParseAsync(validParams);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts config without replyTo (it is optional)\", async () => {\n const { replyTo: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(true);\n });\n\n it(\"accepts bare addr-spec for from and replyTo\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n from: \"test@webiny.com\",\n replyTo: \"no-reply@webiny.com\"\n });\n expect(result.success).toBe(true);\n });\n });\n\n describe(\"react-properties serialization bug\", () => {\n // When process.env.SMTP_PASSWORD is undefined at build time,\n // react-properties' buildRoots treats value===undefined as \"no value, build from\n // children\". The password Property has no children, so buildRoots returns {}.\n // Zod then validates {} against z.string() → \"expected string, received object\".\n it(\"password={} reproduces the 'expected string, received object' error\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: {} });\n expect(result.success).toBe(false);\n const issue = result.error?.issues[0];\n expect(issue?.code).toBe(\"invalid_type\");\n expect(issue?.path).toEqual([\"password\"]);\n expect(issue?.message).toBe(\"Invalid input: expected string, received object\");\n });\n });\n\n describe(\"required string fields\", () => {\n it(\"rejects missing host\", async () => {\n const { host: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty host\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, host: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing user\", async () => {\n const { user: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty user\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, user: \"\" });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects missing password\", async () => {\n const { password: _, ...params } = validParams;\n const result = await schema.safeParseAsync(params);\n expect(result.success).toBe(false);\n });\n\n it(\"rejects empty password\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, password: \"\" });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"port validation\", () => {\n it(\"rejects port 0\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 0 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects negative port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: -1 });\n expect(result.success).toBe(false);\n });\n\n it(\"rejects fractional port\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, port: 587.5 });\n expect(result.success).toBe(false);\n });\n });\n\n describe(\"email address validation\", () => {\n it(\"rejects invalid from address\", async () => {\n const result = await schema.safeParseAsync({ ...validParams, from: \"not-an-email\" });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n\n it(\"rejects invalid replyTo address\", async () => {\n const result = await schema.safeParseAsync({\n ...validParams,\n replyTo: \"not-an-email\"\n });\n expect(result.success).toBe(false);\n expect(result.error?.issues[0].message).toBe(\"Invalid email address.\");\n });\n });\n});\n"],"names":["validParams","describe","it","result","schema","expect","_","params","issue"],"mappings":";;AAGA,MAAMA,cAAc;IAChB,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;AACb;AAEAC,SAAS,qBAAqB;IAC1BA,SAAS,gBAAgB;QACrBC,GAAG,mCAAmC;YAClC,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAACJ;YAC3CK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,mDAAmD;YAClD,MAAM,EAAE,SAASI,CAAC,EAAE,GAAGC,QAAQ,GAAGP;YAClC,MAAMG,SAAS,MAAMC,iBAAAA,cAAqB,CAACG;YAC3CF,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,+CAA+C;YAC9C,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBACvC,GAAGJ,WAAW;gBACd,MAAM;gBACN,SAAS;YACb;YACAK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;IACJ;IAEAF,SAAS,sCAAsC;QAK3CC,GAAG,uEAAuE;YACtE,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,UAAU,CAAC;YAAE;YAC1EK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;YAC5B,MAAMK,QAAQL,OAAO,KAAK,EAAE,MAAM,CAAC,EAAE;YACrCE,OAAOG,OAAO,MAAM,IAAI,CAAC;YACzBH,OAAOG,OAAO,MAAM,OAAO,CAAC;gBAAC;aAAW;YACxCH,OAAOG,OAAO,SAAS,IAAI,CAAC;QAChC;IACJ;IAEAP,SAAS,0BAA0B;QAC/BC,GAAG,wBAAwB;YACvB,MAAM,EAAE,MAAMI,CAAC,EAAE,GAAGC,QAAQ,GAAGP;YAC/B,MAAMG,SAAS,MAAMC,iBAAAA,cAAqB,CAACG;YAC3CF,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,sBAAsB;YACrB,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,MAAM;YAAG;YACtEK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,wBAAwB;YACvB,MAAM,EAAE,MAAMI,CAAC,EAAE,GAAGC,QAAQ,GAAGP;YAC/B,MAAMG,SAAS,MAAMC,iBAAAA,cAAqB,CAACG;YAC3CF,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,sBAAsB;YACrB,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,MAAM;YAAG;YACtEK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,4BAA4B;YAC3B,MAAM,EAAE,UAAUI,CAAC,EAAE,GAAGC,QAAQ,GAAGP;YACnC,MAAMG,SAAS,MAAMC,iBAAAA,cAAqB,CAACG;YAC3CF,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,0BAA0B;YACzB,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,UAAU;YAAG;YAC1EK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;IACJ;IAEAF,SAAS,mBAAmB;QACxBC,GAAG,kBAAkB;YACjB,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,MAAM;YAAE;YACrEK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,yBAAyB;YACxB,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,MAAM;YAAG;YACtEK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;QAEAD,GAAG,2BAA2B;YAC1B,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,MAAM;YAAM;YACzEK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;QAChC;IACJ;IAEAF,SAAS,4BAA4B;QACjCC,GAAG,gCAAgC;YAC/B,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBAAE,GAAGJ,WAAW;gBAAE,MAAM;YAAe;YAClFK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;YAC5BE,OAAOF,OAAO,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC;QACjD;QAEAD,GAAG,mCAAmC;YAClC,MAAMC,SAAS,MAAMC,iBAAAA,cAAqB,CAAC;gBACvC,GAAGJ,WAAW;gBACd,SAAS;YACb;YACAK,OAAOF,OAAO,OAAO,EAAE,IAAI,CAAC;YAC5BE,OAAOF,OAAO,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC;QACjD;IACJ;AACJ"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import email_addresses from "email-addresses";
|
|
3
|
-
const isMailboxAddress = (value)=>null !== email_addresses.parseOneAddress(value);
|
|
4
|
-
const mailboxAddress = z.string().refine(isMailboxAddress, {
|
|
5
|
-
message: "Invalid email address."
|
|
6
|
-
});
|
|
7
|
-
const SmtpParamsSchema = z.object({
|
|
8
|
-
host: z.string().min(1).describe("SMTP server hostname."),
|
|
9
|
-
port: z.number().int().positive().describe("SMTP server port."),
|
|
10
|
-
user: z.string().min(1).describe("SMTP authentication username."),
|
|
11
|
-
password: z.string().min(1).describe("SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code."),
|
|
12
|
-
from: mailboxAddress.describe("Default 'from' address."),
|
|
13
|
-
replyTo: mailboxAddress.optional().describe("Default 'reply-to' address.")
|
|
14
|
-
});
|
|
15
|
-
export { SmtpParamsSchema };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=SmtpParamsSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions/api/Mailer/SmtpParamsSchema.js","sources":["../../../../src/extensions/api/Mailer/SmtpParamsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport emailAddresses from \"email-addresses\";\n\n// Accept both addr-spec (\"foo@bar.com\") and name-addr (\"Foo <foo@bar.com>\") forms.\nconst isMailboxAddress = (value: string): boolean => {\n return emailAddresses.parseOneAddress(value) !== null;\n};\n\nconst mailboxAddress = z.string().refine(isMailboxAddress, { message: \"Invalid email address.\" });\n\nexport const SmtpParamsSchema = z.object({\n host: z.string().min(1).describe(\"SMTP server hostname.\"),\n port: z.number().int().positive().describe(\"SMTP server port.\"),\n user: z.string().min(1).describe(\"SMTP authentication username.\"),\n password: z\n .string()\n .min(1)\n .describe(\n \"SMTP authentication password. Pass via env var (e.g. `process.env.SMTP_PASSWORD!`), never hard-code.\"\n ),\n from: mailboxAddress.describe(\"Default 'from' address.\"),\n replyTo: mailboxAddress.optional().describe(\"Default 'reply-to' address.\")\n});\n"],"names":["isMailboxAddress","value","emailAddresses","mailboxAddress","z","SmtpParamsSchema"],"mappings":";;AAIA,MAAMA,mBAAmB,CAACC,QACfC,AAA0C,SAA1CA,gBAAAA,eAA8B,CAACD;AAG1C,MAAME,iBAAiBC,EAAE,MAAM,GAAG,MAAM,CAACJ,kBAAkB;IAAE,SAAS;AAAyB;AAExF,MAAMK,mBAAmBD,EAAE,MAAM,CAAC;IACrC,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjC,MAAMA,EAAE,MAAM,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjC,UAAUA,EAAAA,MACC,GACN,GAAG,CAAC,GACJ,QAAQ,CACL;IAER,MAAMD,eAAe,QAAQ,CAAC;IAC9B,SAASA,eAAe,QAAQ,GAAG,QAAQ,CAAC;AAChD"}
|