@webiny/api-core 0.0.0-unstable.e622468070 → 0.0.0-unstable.f6dc066313
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/ApiCoreFeature.js +2 -0
- package/ApiCoreFeature.js.map +1 -1
- package/exports/api/{buildParams.js → build-params.js} +1 -1
- package/exports/api/build-params.js.map +1 -0
- package/exports/api/{eventPublisher.js → event-publisher.js} +1 -1
- package/exports/api/event-publisher.js.map +1 -0
- package/exports/api/{keyValueStore.js → key-value-store.js} +1 -1
- package/exports/api/key-value-store.js.map +1 -0
- package/exports/api/security/{apiKey.js → api-key.js} +1 -1
- package/exports/api/security/api-key.js.map +1 -0
- package/features/featureFlags/FeatureFlags.d.ts +12 -0
- package/features/featureFlags/FeatureFlags.js +18 -0
- package/features/featureFlags/FeatureFlags.js.map +1 -0
- package/features/featureFlags/abstractions.d.ts +8 -0
- package/features/featureFlags/abstractions.js +4 -0
- package/features/featureFlags/abstractions.js.map +1 -0
- package/features/featureFlags/feature.d.ts +1 -0
- package/features/featureFlags/feature.js +10 -0
- package/features/featureFlags/feature.js.map +1 -0
- package/features/security/IdentityContext/IdentityContext.js +1 -1
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/permissions/createPermissions.d.ts +8 -0
- package/features/security/permissions/createPermissions.js +240 -0
- package/features/security/permissions/createPermissions.js.map +1 -0
- package/features/security/permissions/index.d.ts +2 -0
- package/features/security/permissions/index.js +3 -0
- package/features/security/permissions/index.js.map +1 -0
- package/features/security/permissions/types.d.ts +137 -0
- package/features/security/permissions/types.js +3 -0
- package/features/security/permissions/types.js.map +1 -0
- package/features/wcp/WcpContext/WcpContext.d.ts +2 -0
- package/features/wcp/WcpContext/WcpContext.js +6 -0
- package/features/wcp/WcpContext/WcpContext.js.map +1 -1
- package/features/wcp/WcpContext/abstractions.d.ts +1 -0
- package/features/wcp/WcpContext/abstractions.js.map +1 -1
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +79 -0
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +121 -0
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -0
- package/features/wcp/WcpFeature.js +2 -0
- package/features/wcp/WcpFeature.js.map +1 -1
- package/graphql/wcp/graphql.js +1 -1
- package/graphql/wcp/graphql.js.map +1 -1
- package/legacy/wcp/LegacyWcpContext.d.ts +2 -0
- package/legacy/wcp/LegacyWcpContext.js +6 -0
- package/legacy/wcp/LegacyWcpContext.js.map +1 -1
- package/models/cms/FieldBuilder.d.ts +1 -1
- package/models/cms/FieldBuilder.js +5 -5
- package/models/cms/FieldBuilder.js.map +1 -1
- package/models/cms/fieldsBuilder.md +2 -2
- package/models/cms/types.d.ts +2 -2
- package/models/cms/types.js.map +1 -1
- package/package.json +19 -20
- package/exports/api/buildParams.js.map +0 -1
- package/exports/api/eventPublisher.js.map +0 -1
- package/exports/api/keyValueStore.js.map +0 -1
- package/exports/api/security/apiKey.js.map +0 -1
- package/extensions/BuildParam.d.ts +0 -11
- package/extensions/BuildParam.js +0 -119
- package/extensions/BuildParam.js.map +0 -1
- package/extensions/GenericExtension.d.ts +0 -10
- package/extensions/GenericExtension.js +0 -7
- package/extensions/GenericExtension.js.map +0 -1
- package/extensions/eventHandlers/AfterAuthentication.d.ts +0 -10
- package/extensions/eventHandlers/AfterAuthentication.js +0 -9
- package/extensions/eventHandlers/AfterAuthentication.js.map +0 -1
- package/extensions/eventHandlers/ApiKeyAfterCreate.d.ts +0 -10
- package/extensions/eventHandlers/ApiKeyAfterCreate.js +0 -9
- package/extensions/eventHandlers/ApiKeyAfterCreate.js.map +0 -1
- package/extensions/eventHandlers/ApiKeyAfterDelete.d.ts +0 -10
- package/extensions/eventHandlers/ApiKeyAfterDelete.js +0 -9
- package/extensions/eventHandlers/ApiKeyAfterDelete.js.map +0 -1
- package/extensions/eventHandlers/ApiKeyAfterUpdate.d.ts +0 -10
- package/extensions/eventHandlers/ApiKeyAfterUpdate.js +0 -9
- package/extensions/eventHandlers/ApiKeyAfterUpdate.js.map +0 -1
- package/extensions/eventHandlers/ApiKeyBeforeCreate.d.ts +0 -10
- package/extensions/eventHandlers/ApiKeyBeforeCreate.js +0 -9
- package/extensions/eventHandlers/ApiKeyBeforeCreate.js.map +0 -1
- package/extensions/eventHandlers/ApiKeyBeforeDelete.d.ts +0 -10
- package/extensions/eventHandlers/ApiKeyBeforeDelete.js +0 -9
- package/extensions/eventHandlers/ApiKeyBeforeDelete.js.map +0 -1
- package/extensions/eventHandlers/ApiKeyBeforeUpdate.d.ts +0 -10
- package/extensions/eventHandlers/ApiKeyBeforeUpdate.js +0 -9
- package/extensions/eventHandlers/ApiKeyBeforeUpdate.js.map +0 -1
- package/extensions/eventHandlers/BeforeAuthentication.d.ts +0 -10
- package/extensions/eventHandlers/BeforeAuthentication.js +0 -9
- package/extensions/eventHandlers/BeforeAuthentication.js.map +0 -1
- package/extensions/eventHandlers/RoleAfterCreate.d.ts +0 -10
- package/extensions/eventHandlers/RoleAfterCreate.js +0 -9
- package/extensions/eventHandlers/RoleAfterCreate.js.map +0 -1
- package/extensions/eventHandlers/RoleAfterDelete.d.ts +0 -10
- package/extensions/eventHandlers/RoleAfterDelete.js +0 -9
- package/extensions/eventHandlers/RoleAfterDelete.js.map +0 -1
- package/extensions/eventHandlers/RoleAfterUpdate.d.ts +0 -10
- package/extensions/eventHandlers/RoleAfterUpdate.js +0 -9
- package/extensions/eventHandlers/RoleAfterUpdate.js.map +0 -1
- package/extensions/eventHandlers/RoleBeforeCreate.d.ts +0 -10
- package/extensions/eventHandlers/RoleBeforeCreate.js +0 -9
- package/extensions/eventHandlers/RoleBeforeCreate.js.map +0 -1
- package/extensions/eventHandlers/RoleBeforeDelete.d.ts +0 -10
- package/extensions/eventHandlers/RoleBeforeDelete.js +0 -9
- package/extensions/eventHandlers/RoleBeforeDelete.js.map +0 -1
- package/extensions/eventHandlers/RoleBeforeUpdate.d.ts +0 -10
- package/extensions/eventHandlers/RoleBeforeUpdate.js +0 -9
- package/extensions/eventHandlers/RoleBeforeUpdate.js.map +0 -1
- package/extensions/eventHandlers/SystemInstalled.d.ts +0 -10
- package/extensions/eventHandlers/SystemInstalled.js +0 -9
- package/extensions/eventHandlers/SystemInstalled.js.map +0 -1
- package/extensions/eventHandlers/TeamAfterCreate.d.ts +0 -10
- package/extensions/eventHandlers/TeamAfterCreate.js +0 -9
- package/extensions/eventHandlers/TeamAfterCreate.js.map +0 -1
- package/extensions/eventHandlers/TeamAfterDelete.d.ts +0 -10
- package/extensions/eventHandlers/TeamAfterDelete.js +0 -9
- package/extensions/eventHandlers/TeamAfterDelete.js.map +0 -1
- package/extensions/eventHandlers/TeamAfterUpdate.d.ts +0 -10
- package/extensions/eventHandlers/TeamAfterUpdate.js +0 -9
- package/extensions/eventHandlers/TeamAfterUpdate.js.map +0 -1
- package/extensions/eventHandlers/TeamBeforeCreate.d.ts +0 -10
- package/extensions/eventHandlers/TeamBeforeCreate.js +0 -9
- package/extensions/eventHandlers/TeamBeforeCreate.js.map +0 -1
- package/extensions/eventHandlers/TeamBeforeDelete.d.ts +0 -10
- package/extensions/eventHandlers/TeamBeforeDelete.js +0 -9
- package/extensions/eventHandlers/TeamBeforeDelete.js.map +0 -1
- package/extensions/eventHandlers/TeamBeforeUpdate.d.ts +0 -10
- package/extensions/eventHandlers/TeamBeforeUpdate.js +0 -9
- package/extensions/eventHandlers/TeamBeforeUpdate.js.map +0 -1
- package/extensions/eventHandlers/TenantAfterCreate.d.ts +0 -10
- package/extensions/eventHandlers/TenantAfterCreate.js +0 -9
- package/extensions/eventHandlers/TenantAfterCreate.js.map +0 -1
- package/extensions/eventHandlers/TenantAfterDelete.d.ts +0 -10
- package/extensions/eventHandlers/TenantAfterDelete.js +0 -9
- package/extensions/eventHandlers/TenantAfterDelete.js.map +0 -1
- package/extensions/eventHandlers/TenantAfterUpdate.d.ts +0 -10
- package/extensions/eventHandlers/TenantAfterUpdate.js +0 -9
- package/extensions/eventHandlers/TenantAfterUpdate.js.map +0 -1
- package/extensions/eventHandlers/TenantBeforeCreate.d.ts +0 -10
- package/extensions/eventHandlers/TenantBeforeCreate.js +0 -9
- package/extensions/eventHandlers/TenantBeforeCreate.js.map +0 -1
- package/extensions/eventHandlers/TenantBeforeDelete.d.ts +0 -10
- package/extensions/eventHandlers/TenantBeforeDelete.js +0 -9
- package/extensions/eventHandlers/TenantBeforeDelete.js.map +0 -1
- package/extensions/eventHandlers/TenantBeforeUpdate.d.ts +0 -10
- package/extensions/eventHandlers/TenantBeforeUpdate.js +0 -9
- package/extensions/eventHandlers/TenantBeforeUpdate.js.map +0 -1
- package/extensions/eventHandlers/TenantInstalled.d.ts +0 -10
- package/extensions/eventHandlers/TenantInstalled.js +0 -9
- package/extensions/eventHandlers/TenantInstalled.js.map +0 -1
- package/extensions/eventHandlers/UserAfterCreate.d.ts +0 -10
- package/extensions/eventHandlers/UserAfterCreate.js +0 -9
- package/extensions/eventHandlers/UserAfterCreate.js.map +0 -1
- package/extensions/eventHandlers/UserAfterDelete.d.ts +0 -10
- package/extensions/eventHandlers/UserAfterDelete.js +0 -9
- package/extensions/eventHandlers/UserAfterDelete.js.map +0 -1
- package/extensions/eventHandlers/UserAfterUpdate.d.ts +0 -10
- package/extensions/eventHandlers/UserAfterUpdate.js +0 -9
- package/extensions/eventHandlers/UserAfterUpdate.js.map +0 -1
- package/extensions/eventHandlers/UserBeforeCreate.d.ts +0 -10
- package/extensions/eventHandlers/UserBeforeCreate.js +0 -9
- package/extensions/eventHandlers/UserBeforeCreate.js.map +0 -1
- package/extensions/eventHandlers/UserBeforeDelete.d.ts +0 -10
- package/extensions/eventHandlers/UserBeforeDelete.js +0 -9
- package/extensions/eventHandlers/UserBeforeDelete.js.map +0 -1
- package/extensions/eventHandlers/UserBeforeUpdate.d.ts +0 -10
- package/extensions/eventHandlers/UserBeforeUpdate.js +0 -9
- package/extensions/eventHandlers/UserBeforeUpdate.js.map +0 -1
- package/extensions/eventHandlers/index.d.ts +0 -34
- package/extensions/eventHandlers/index.js +0 -49
- package/extensions/eventHandlers/index.js.map +0 -1
- package/extensions/index.d.ts +0 -58
- package/extensions/index.js +0 -49
- package/extensions/index.js.map +0 -1
- /package/exports/api/{buildParams.d.ts → build-params.d.ts} +0 -0
- /package/exports/api/{eventPublisher.d.ts → event-publisher.d.ts} +0 -0
- /package/exports/api/{keyValueStore.d.ts → key-value-store.d.ts} +0 -0
- /package/exports/api/security/{apiKey.d.ts → api-key.d.ts} +0 -0
|
@@ -12,12 +12,12 @@ export class FieldBuilder {
|
|
|
12
12
|
this.config.label = text;
|
|
13
13
|
return this;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
this.config.
|
|
15
|
+
help(text) {
|
|
16
|
+
this.config.help = text;
|
|
17
17
|
return this;
|
|
18
18
|
}
|
|
19
19
|
placeholder(text) {
|
|
20
|
-
this.config.
|
|
20
|
+
this.config.placeholder = text;
|
|
21
21
|
return this;
|
|
22
22
|
}
|
|
23
23
|
toConfig() {
|
|
@@ -25,8 +25,8 @@ export class FieldBuilder {
|
|
|
25
25
|
fieldId: "",
|
|
26
26
|
type: this.config.type,
|
|
27
27
|
label: this.config.label,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
help: this.config.help,
|
|
29
|
+
placeholder: this.config.placeholder,
|
|
30
30
|
validation: this.config.validation || [],
|
|
31
31
|
settings: this.config.settings || {},
|
|
32
32
|
zodSchema: this.zodSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["z","FieldBuilder","config","validation","constructor","type","initialSchema","zodSchema","label","text","
|
|
1
|
+
{"version":3,"names":["z","FieldBuilder","config","validation","constructor","type","initialSchema","zodSchema","label","text","help","placeholder","toConfig","fieldId","settings","getZodSchema","TextFieldBuilder","schema","string","required","message","newSchema","min","push","name","minLength","length","maxLength","max","slug","regex","email","url","unique","ObjectFieldBuilder","nestedFields","fields","registry","fieldBuilders","shape","nestedConfigs","builder","Object","entries","object","optional","nullable"],"sources":["FieldBuilder.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { FieldConfig } from \"./types.js\";\nimport type { IFieldBuilderRegistry } from \"./abstractions.js\";\n\n// Make FieldBuilder return the Zod type it produces\nexport abstract class FieldBuilder<TZod extends z.ZodTypeAny> {\n protected config: Partial<FieldConfig> = {\n validation: []\n };\n protected zodSchema: TZod;\n\n constructor(type: string, initialSchema: TZod) {\n this.config.type = type;\n this.zodSchema = initialSchema;\n }\n\n label(text: string): this {\n this.config.label = text;\n return this;\n }\n\n help(text: string): this {\n this.config.help = text;\n return this;\n }\n\n placeholder(text: string): this {\n this.config.placeholder = text;\n return this;\n }\n\n toConfig(): FieldConfig {\n return {\n fieldId: \"\",\n type: this.config.type!,\n label: this.config.label,\n help: this.config.help,\n placeholder: this.config.placeholder,\n validation: this.config.validation || [],\n settings: this.config.settings || {},\n zodSchema: this.zodSchema\n };\n }\n\n getZodSchema(): TZod {\n return this.zodSchema;\n }\n}\n\n// Text Field Builder - properly track type transformations\nexport class TextFieldBuilder<TZod extends z.ZodString = z.ZodString> extends FieldBuilder<TZod> {\n constructor(schema?: TZod) {\n super(\"text\", (schema || z.string()) as TZod);\n }\n\n required(message?: string): TextFieldBuilder<z.ZodString> {\n const newSchema = (this.zodSchema as z.ZodString).min(1, message || \"Field is required\");\n this.zodSchema = newSchema as any;\n this.config.validation?.push({\n name: \"required\",\n message: message || \"Field is required\",\n settings: {}\n });\n return this as any;\n }\n\n minLength(length: number, message?: string): this {\n this.zodSchema = (this.zodSchema as z.ZodString).min(length, message) as TZod;\n return this;\n }\n\n maxLength(length: number, message?: string): this {\n this.zodSchema = (this.zodSchema as z.ZodString).max(length, message) as TZod;\n return this;\n }\n\n slug(): this {\n this.zodSchema = (this.zodSchema as z.ZodString).regex(\n /^[a-z0-9-]+$/,\n \"Must be a valid slug (lowercase letters, numbers, and hyphens only)\"\n ) as TZod;\n this.config.validation?.push({\n name: \"slug\",\n message: \"Must be a valid slug\",\n settings: {}\n });\n return this;\n }\n\n email(): this {\n this.zodSchema = (this.zodSchema as z.ZodString).email(\"Must be a valid email\") as TZod;\n this.config.validation?.push({\n name: \"email\",\n message: \"Must be a valid email\",\n settings: {}\n });\n return this;\n }\n\n url(): this {\n this.zodSchema = (this.zodSchema as z.ZodString).url(\"Must be a valid URL\") as TZod;\n this.config.validation?.push({\n name: \"url\",\n message: \"Must be a valid URL\",\n settings: {}\n });\n return this;\n }\n\n unique(): this {\n this.config.validation?.push({\n name: \"unique\",\n message: \"Value must be unique\",\n settings: {}\n });\n return this;\n }\n}\n\n// Object Field Builder - track the shape type\nexport class ObjectFieldBuilder<TShape extends z.ZodRawShape> extends FieldBuilder<\n z.ZodObject<TShape>\n> {\n private nestedFields: FieldConfig[] = [];\n\n constructor(\n fields: (registry: IFieldBuilderRegistry) => {\n [K in keyof TShape]: FieldBuilder<TShape[K]>;\n },\n registry: IFieldBuilderRegistry\n ) {\n const fieldBuilders = fields(registry);\n const shape = {} as TShape;\n const nestedConfigs: FieldConfig[] = [];\n\n for (const [fieldId, builder] of Object.entries(fieldBuilders) as Array<\n [keyof TShape, FieldBuilder<any>]\n >) {\n const config = builder.toConfig();\n config.fieldId = fieldId as string;\n nestedConfigs.push(config);\n shape[fieldId] = builder.getZodSchema() as TShape[keyof TShape];\n }\n\n super(\"object\", z.object(shape));\n this.nestedFields = nestedConfigs;\n this.config.fields = nestedConfigs;\n }\n\n optional(): ObjectFieldBuilder<TShape> & {\n getZodSchema(): z.ZodOptional<z.ZodObject<TShape>>;\n } {\n this.zodSchema = this.zodSchema.optional() as any;\n return this as any;\n }\n\n nullable(): ObjectFieldBuilder<TShape> & {\n getZodSchema(): z.ZodNullable<z.ZodObject<TShape>>;\n } {\n this.zodSchema = this.zodSchema.nullable() as any;\n return this as any;\n }\n\n override toConfig(): FieldConfig {\n const config = super.toConfig();\n config.fields = this.nestedFields;\n return config;\n }\n}\n"],"mappings":"AAAA,SAASA,CAA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K,CAAC,CAAC;IAChC,IAAI,CAACJ,YAAY,GAAGK,aAAa;IACjC,IAAI,CAACtC,MAAM,CAACkC,MAAM,GAAGI,aAAa;EACtC;EAEAK,QAAQA,CAAA,EAEN;IACE,IAAI,CAACtC,SAAS,GAAG,IAAI,CAACA,SAAS,CAACsC,QAAQ,CAAC,CAAQ;IACjD,OAAO,IAAI;EACf;EAEAC,QAAQA,CAAA,EAEN;IACE,IAAI,CAACvC,SAAS,GAAG,IAAI,CAACA,SAAS,CAACuC,QAAQ,CAAC,CAAQ;IACjD,OAAO,IAAI;EACf;EAESlC,QAAQA,CAAA,EAAgB;IAC7B,MAAMV,MAAM,GAAG,KAAK,CAACU,QAAQ,CAAC,CAAC;IAC/BV,MAAM,CAACkC,MAAM,GAAG,IAAI,CAACD,YAAY;IACjC,OAAOjC,MAAM;EACjB;AACJ","ignoreList":[]}
|
|
@@ -41,7 +41,7 @@ export interface ITextFieldBuilder extends FieldBuilder<z.ZodString> {
|
|
|
41
41
|
email(): this;
|
|
42
42
|
url(): this;
|
|
43
43
|
unique(): this;
|
|
44
|
-
|
|
44
|
+
help(text: string): this;
|
|
45
45
|
placeholder(text: string): this;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -219,7 +219,7 @@ export interface IColorFieldBuilder extends FieldBuilder<z.ZodString> {
|
|
|
219
219
|
default(hex: string): this;
|
|
220
220
|
allowAlpha(): this;
|
|
221
221
|
palette(colors: string[]): this;
|
|
222
|
-
|
|
222
|
+
help(text: string): this;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
class ColorFieldBuilder extends FieldBuilder<z.ZodString> implements IColorFieldBuilder {
|
package/models/cms/types.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface FieldConfig {
|
|
|
6
6
|
fieldId: string;
|
|
7
7
|
type: string;
|
|
8
8
|
label?: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
help?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
11
|
validation?: ValidationRule[];
|
|
12
12
|
settings?: Record<string, any>;
|
|
13
13
|
zodSchema: z.ZodTypeAny;
|
package/models/cms/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { ModelClass } from \"~/models/base/ModelBuilder.js\";\nimport type { BaseModel } from \"~/models/base/BaseModel.js\";\nimport type { IModelData } from \"~/models/base/abstractions.js\";\n\nexport interface FieldConfig {\n fieldId: string;\n type: string;\n label?: string;\n
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { ModelClass } from \"~/models/base/ModelBuilder.js\";\nimport type { BaseModel } from \"~/models/base/BaseModel.js\";\nimport type { IModelData } from \"~/models/base/abstractions.js\";\n\nexport interface FieldConfig {\n fieldId: string;\n type: string;\n label?: string;\n help?: string;\n placeholder?: string;\n validation?: ValidationRule[];\n settings?: Record<string, any>;\n zodSchema: z.ZodTypeAny;\n fields?: FieldConfig[]; // For nested object fields\n}\n\nexport interface ValidationRule {\n name: string;\n message: string;\n settings: Record<string, any>;\n}\n\nexport interface CmsModelMetadata {\n icon?: string;\n description?: string;\n titleFieldId?: string;\n descriptionFieldId?: string;\n imageFieldId?: string;\n tags?: string[];\n}\n\n// Make PrivateCmsModel generic!\nexport interface PrivateCmsModel<TModel extends BaseModel<any>> {\n type: \"private\";\n modelType: \"private\";\n Model: ModelClass<TModel>;\n modelId: string;\n name: string;\n icon?: string;\n description?: string;\n fields: FieldConfig[];\n schema: TModel[\"__schema\"];\n create: (data: IModelData<TModel>) => TModel;\n}\n\nexport interface FieldBuilderConfig {\n fieldId: string;\n config: FieldConfig;\n zodSchema: z.ZodTypeAny;\n}\n"],"mappings":"","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-core",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.f6dc066313",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -57,42 +57,41 @@
|
|
|
57
57
|
},
|
|
58
58
|
"license": "MIT",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@webiny/api": "0.0.0-unstable.
|
|
60
|
+
"@webiny/api": "0.0.0-unstable.f6dc066313",
|
|
61
61
|
"@webiny/di": "0.2.3",
|
|
62
|
-
"@webiny/error": "0.0.0-unstable.
|
|
63
|
-
"@webiny/feature": "0.0.0-unstable.
|
|
64
|
-
"@webiny/
|
|
65
|
-
"@webiny/handler
|
|
66
|
-
"@webiny/handler-
|
|
67
|
-
"@webiny/
|
|
68
|
-
"@webiny/
|
|
69
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
70
|
-
"@webiny/wcp": "0.0.0-unstable.
|
|
62
|
+
"@webiny/error": "0.0.0-unstable.f6dc066313",
|
|
63
|
+
"@webiny/feature": "0.0.0-unstable.f6dc066313",
|
|
64
|
+
"@webiny/feature-flags": "0.0.0-unstable.f6dc066313",
|
|
65
|
+
"@webiny/handler": "0.0.0-unstable.f6dc066313",
|
|
66
|
+
"@webiny/handler-db": "0.0.0-unstable.f6dc066313",
|
|
67
|
+
"@webiny/handler-graphql": "0.0.0-unstable.f6dc066313",
|
|
68
|
+
"@webiny/plugins": "0.0.0-unstable.f6dc066313",
|
|
69
|
+
"@webiny/utils": "0.0.0-unstable.f6dc066313",
|
|
70
|
+
"@webiny/wcp": "0.0.0-unstable.f6dc066313",
|
|
71
71
|
"dataloader": "2.2.3",
|
|
72
72
|
"jose": "5.10.0",
|
|
73
73
|
"jsonwebtoken": "9.0.3",
|
|
74
74
|
"lodash": "4.17.23",
|
|
75
|
-
"minimatch": "
|
|
75
|
+
"minimatch": "10.2.4",
|
|
76
76
|
"pino": "9.14.0",
|
|
77
77
|
"pino-lambda": "4.4.1",
|
|
78
|
-
"ts-morph": "27.0.2",
|
|
79
78
|
"zod": "3.25.76"
|
|
80
79
|
},
|
|
81
80
|
"devDependencies": {
|
|
82
81
|
"@types/jsonwebtoken": "9.0.10",
|
|
83
82
|
"@types/md5": "2.3.6",
|
|
84
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
85
|
-
"@webiny/db-dynamodb": "0.0.0-unstable.
|
|
86
|
-
"@webiny/handler-aws": "0.0.0-unstable.
|
|
87
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
83
|
+
"@webiny/build-tools": "0.0.0-unstable.f6dc066313",
|
|
84
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.f6dc066313",
|
|
85
|
+
"@webiny/handler-aws": "0.0.0-unstable.f6dc066313",
|
|
86
|
+
"@webiny/project-utils": "0.0.0-unstable.f6dc066313",
|
|
88
87
|
"jest-dynalite": "3.6.1",
|
|
89
|
-
"rimraf": "6.1.
|
|
88
|
+
"rimraf": "6.1.3",
|
|
90
89
|
"typescript": "5.9.3",
|
|
91
|
-
"vitest": "
|
|
90
|
+
"vitest": "4.0.18"
|
|
92
91
|
},
|
|
93
92
|
"publishConfig": {
|
|
94
93
|
"access": "public",
|
|
95
94
|
"directory": "dist"
|
|
96
95
|
},
|
|
97
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "f6dc066313ddce5339d2aacec3aa84e61232689b"
|
|
98
97
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BuildParam","BuildParams"],"sources":["buildParams.ts"],"sourcesContent":["export { BuildParam, BuildParams } from \"~/features/buildParams/index.js\";\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,WAAW","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DomainEvent","EventPublisher"],"sources":["eventPublisher.ts"],"sourcesContent":["export { DomainEvent, EventPublisher } from \"~/features/eventPublisher/index.js\";\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,cAAc","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["GlobalKeyValueStore","KeyValueStore"],"sources":["keyValueStore.ts"],"sourcesContent":["export { GlobalKeyValueStore, KeyValueStore } from \"~/features/keyValueStore/index.js\";\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,aAAa","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ApiKeyAfterCreateHandler","ApiKeyBeforeCreateHandler","CreateApiKeyUseCase","ApiKeyAfterDeleteHandler","ApiKeyBeforeDeleteHandler","DeleteApiKeyUseCase","GetApiKeyUseCase","GetApiKeyByTokenUseCase","ListApiKeysUseCase","ApiKeyAfterUpdateHandler","ApiKeyBeforeUpdateHandler","UpdateApiKeyUseCase","ApiKeyFactory"],"sources":["apiKey.ts"],"sourcesContent":["export {\n ApiKeyAfterCreateHandler,\n ApiKeyBeforeCreateHandler,\n CreateApiKeyUseCase\n} from \"~/features/security/apiKeys/CreateApiKey/index.js\";\n\nexport {\n ApiKeyAfterDeleteHandler,\n ApiKeyBeforeDeleteHandler,\n DeleteApiKeyUseCase\n} from \"~/features/security/apiKeys/DeleteApiKey/index.js\";\n\nexport { GetApiKeyUseCase } from \"~/features/security/apiKeys/GetApiKey/index.js\";\nexport { GetApiKeyByTokenUseCase } from \"~/features/security/apiKeys/GetApiKeyByToken/index.js\";\nexport { ListApiKeysUseCase } from \"~/features/security/apiKeys/ListApiKeys/index.js\";\nexport {\n ApiKeyAfterUpdateHandler,\n ApiKeyBeforeUpdateHandler,\n UpdateApiKeyUseCase\n} from \"~/features/security/apiKeys/UpdateApiKey/index.js\";\nexport { ApiKeyFactory } from \"~/features/security/apiKeys/shared/abstractions.js\";\n"],"mappings":"AAAA,SACIA,wBAAwB,EACxBC,yBAAyB,EACzBC,mBAAmB;AAGvB,SACIC,wBAAwB,EACxBC,yBAAyB,EACzBC,mBAAmB;AAGvB,SAASC,gBAAgB;AACzB,SAASC,uBAAuB;AAChC,SAASC,kBAAkB;AAC3B,SACIC,wBAAwB,EACxBC,yBAAyB,EACzBC,mBAAmB;AAEvB,SAASC,aAAa","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const BuildParam: import("@webiny/project/defineExtension").ExtensionComponent<z.ZodObject<{
|
|
3
|
-
paramName: z.ZodString;
|
|
4
|
-
value: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny, "many">, z.ZodNumber, z.ZodBoolean]>;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
value: string | number | boolean | any[] | Record<string, any>;
|
|
7
|
-
paramName: string;
|
|
8
|
-
}, {
|
|
9
|
-
value: string | number | boolean | any[] | Record<string, any>;
|
|
10
|
-
paramName: string;
|
|
11
|
-
}>>;
|
package/extensions/BuildParam.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { Node, Project } from "ts-morph";
|
|
3
|
-
import { defineExtension } from "@webiny/project/defineExtension";
|
|
4
|
-
import crypto from "crypto";
|
|
5
|
-
import path from "path";
|
|
6
|
-
import fs from "fs";
|
|
7
|
-
export const BuildParam = defineExtension({
|
|
8
|
-
type: "Api/BuildParam",
|
|
9
|
-
tags: {
|
|
10
|
-
runtimeContext: "app-build",
|
|
11
|
-
appName: "api"
|
|
12
|
-
},
|
|
13
|
-
description: "Add build-time parameter to API app.",
|
|
14
|
-
multiple: true,
|
|
15
|
-
paramsSchema: () => {
|
|
16
|
-
return z.object({
|
|
17
|
-
paramName: z.string(),
|
|
18
|
-
value: z.union([z.string(), z.record(z.any()), z.array(z.any()), z.number(), z.boolean()])
|
|
19
|
-
});
|
|
20
|
-
},
|
|
21
|
-
async build(params, ctx) {
|
|
22
|
-
const extensionsTsFilePath = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "extensions.ts").toString();
|
|
23
|
-
const buildParamsDir = ctx.project.paths.workspaceFolder.join("apps", "api", "graphql", "src", "buildParams").toString();
|
|
24
|
-
const {
|
|
25
|
-
paramName,
|
|
26
|
-
value
|
|
27
|
-
} = params;
|
|
28
|
-
|
|
29
|
-
// Serialize value to a TypeScript literal.
|
|
30
|
-
const valueStr = JSON.stringify(value, null, 4);
|
|
31
|
-
|
|
32
|
-
// Generate a unique class name based on the paramName.
|
|
33
|
-
const hash = crypto.createHash("sha256").update(paramName).digest("hex");
|
|
34
|
-
const className = `BuildParam_${hash.slice(-10)}`;
|
|
35
|
-
const fileName = `${className}.ts`;
|
|
36
|
-
const filePath = path.join(buildParamsDir, fileName);
|
|
37
|
-
|
|
38
|
-
// Ensure buildParams directory exists.
|
|
39
|
-
if (!fs.existsSync(buildParamsDir)) {
|
|
40
|
-
fs.mkdirSync(buildParamsDir, {
|
|
41
|
-
recursive: true
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Check if file already exists.
|
|
46
|
-
if (fs.existsSync(filePath)) {
|
|
47
|
-
// File exists, just ensure it's imported in extensions.ts
|
|
48
|
-
} else {
|
|
49
|
-
// Create the BuildParam implementation file.
|
|
50
|
-
const fileContent = `import { BuildParam } from "webiny/api/buildParams";
|
|
51
|
-
|
|
52
|
-
class ${className} implements BuildParam.Interface {
|
|
53
|
-
key = "${paramName}";
|
|
54
|
-
value = ${valueStr};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default BuildParam.createImplementation({
|
|
58
|
-
implementation: ${className},
|
|
59
|
-
dependencies: []
|
|
60
|
-
});
|
|
61
|
-
`;
|
|
62
|
-
fs.writeFileSync(filePath, fileContent, "utf8");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Now update extensions.ts to import and register this BuildParam.
|
|
66
|
-
const project = new Project();
|
|
67
|
-
project.addSourceFileAtPath(extensionsTsFilePath);
|
|
68
|
-
const source = project.getSourceFileOrThrow(extensionsTsFilePath);
|
|
69
|
-
|
|
70
|
-
// Calculate import path relative to extensions.ts.
|
|
71
|
-
let importPath = path.relative(path.dirname(extensionsTsFilePath), filePath).replace(/\.tsx?$/, ".js");
|
|
72
|
-
|
|
73
|
-
// Ensure the path starts with ./
|
|
74
|
-
if (!importPath.startsWith(".")) {
|
|
75
|
-
importPath = "./" + importPath;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Check if import already exists.
|
|
79
|
-
const existingImportDeclaration = source.getImportDeclaration(importPath);
|
|
80
|
-
if (existingImportDeclaration) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
let index = 1;
|
|
84
|
-
const importDeclarations = source.getImportDeclarations();
|
|
85
|
-
if (importDeclarations.length) {
|
|
86
|
-
const last = importDeclarations[importDeclarations.length - 1];
|
|
87
|
-
index = last.getChildIndex() + 1;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Add import for the BuildParam implementation.
|
|
91
|
-
source.insertImportDeclaration(index, {
|
|
92
|
-
defaultImport: className,
|
|
93
|
-
moduleSpecifier: importPath
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// Add the registration to the plugins array.
|
|
97
|
-
const pluginsArray = source.getFirstDescendant(node => Node.isArrayLiteralExpression(node));
|
|
98
|
-
pluginsArray.addElement(`\ncreateContextPlugin(ctx => {\n\tregisterExtension(ctx.container, ${className});\n})`);
|
|
99
|
-
{
|
|
100
|
-
let index = 1;
|
|
101
|
-
const importDeclarations = source.getImportDeclarations();
|
|
102
|
-
if (importDeclarations.length) {
|
|
103
|
-
const last = importDeclarations[importDeclarations.length - 1];
|
|
104
|
-
index = last.getChildIndex() + 1;
|
|
105
|
-
}
|
|
106
|
-
const contextPluginImportPath = "@webiny/api/plugins/ContextPlugin";
|
|
107
|
-
const existingContextPluginImport = source.getImportDeclaration(contextPluginImportPath);
|
|
108
|
-
if (!existingContextPluginImport) {
|
|
109
|
-
source.insertImportDeclaration(index, {
|
|
110
|
-
namedImports: ["createContextPlugin"],
|
|
111
|
-
moduleSpecifier: contextPluginImportPath
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
await source.save();
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
//# sourceMappingURL=BuildParam.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["z","Node","Project","defineExtension","crypto","path","fs","BuildParam","type","tags","runtimeContext","appName","description","multiple","paramsSchema","object","paramName","string","value","union","record","any","array","number","boolean","build","params","ctx","extensionsTsFilePath","project","paths","workspaceFolder","join","toString","buildParamsDir","valueStr","JSON","stringify","hash","createHash","update","digest","className","slice","fileName","filePath","existsSync","mkdirSync","recursive","fileContent","writeFileSync","addSourceFileAtPath","source","getSourceFileOrThrow","importPath","relative","dirname","replace","startsWith","existingImportDeclaration","getImportDeclaration","index","importDeclarations","getImportDeclarations","length","last","getChildIndex","insertImportDeclaration","defaultImport","moduleSpecifier","pluginsArray","getFirstDescendant","node","isArrayLiteralExpression","addElement","contextPluginImportPath","existingContextPluginImport","namedImports","save"],"sources":["BuildParam.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Node, Project, ArrayLiteralExpression } from \"ts-morph\";\nimport { defineExtension } from \"@webiny/project/defineExtension\";\nimport crypto from \"crypto\";\nimport path from \"path\";\nimport fs from \"fs\";\n\nexport const BuildParam = defineExtension({\n type: \"Api/BuildParam\",\n tags: { runtimeContext: \"app-build\", appName: \"api\" },\n description: \"Add build-time parameter to API app.\",\n multiple: true,\n paramsSchema: () => {\n return z.object({\n paramName: z.string(),\n value: z.union([\n z.string(),\n z.record(z.any()),\n z.array(z.any()),\n z.number(),\n z.boolean()\n ])\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 buildParamsDir = ctx.project.paths.workspaceFolder\n .join(\"apps\", \"api\", \"graphql\", \"src\", \"buildParams\")\n .toString();\n\n const { paramName, value } = params;\n\n // Serialize value to a TypeScript literal.\n const valueStr = JSON.stringify(value, null, 4);\n\n // Generate a unique class name based on the paramName.\n const hash = crypto.createHash(\"sha256\").update(paramName).digest(\"hex\");\n const className = `BuildParam_${hash.slice(-10)}`;\n const fileName = `${className}.ts`;\n const filePath = path.join(buildParamsDir, fileName);\n\n // Ensure buildParams directory exists.\n if (!fs.existsSync(buildParamsDir)) {\n fs.mkdirSync(buildParamsDir, { recursive: true });\n }\n\n // Check if file already exists.\n if (fs.existsSync(filePath)) {\n // File exists, just ensure it's imported in extensions.ts\n } else {\n // Create the BuildParam implementation file.\n const fileContent = `import { BuildParam } from \"webiny/api/buildParams\";\n\nclass ${className} implements BuildParam.Interface {\n key = \"${paramName}\";\n value = ${valueStr};\n}\n\nexport default BuildParam.createImplementation({\n implementation: ${className},\n dependencies: []\n});\n`;\n fs.writeFileSync(filePath, fileContent, \"utf8\");\n }\n\n // Now update extensions.ts to import and register this BuildParam.\n const project = new Project();\n project.addSourceFileAtPath(extensionsTsFilePath);\n\n const source = project.getSourceFileOrThrow(extensionsTsFilePath);\n\n // Calculate import path relative to extensions.ts.\n let importPath = path\n .relative(path.dirname(extensionsTsFilePath), filePath)\n .replace(/\\.tsx?$/, \".js\");\n\n // Ensure the path starts with ./\n if (!importPath.startsWith(\".\")) {\n importPath = \"./\" + importPath;\n }\n\n // Check if import already exists.\n const existingImportDeclaration = source.getImportDeclaration(importPath);\n if (existingImportDeclaration) {\n return;\n }\n\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n // Add import for the BuildParam implementation.\n source.insertImportDeclaration(index, {\n defaultImport: className,\n moduleSpecifier: importPath\n });\n\n // Add the registration to the plugins array.\n const pluginsArray = source.getFirstDescendant(node =>\n Node.isArrayLiteralExpression(node)\n ) as ArrayLiteralExpression;\n\n pluginsArray.addElement(\n `\\ncreateContextPlugin(ctx => {\\n\\tregisterExtension(ctx.container, ${className});\\n})`\n );\n\n {\n let index = 1;\n\n const importDeclarations = source.getImportDeclarations();\n if (importDeclarations.length) {\n const last = importDeclarations[importDeclarations.length - 1];\n index = last.getChildIndex() + 1;\n }\n\n const contextPluginImportPath = \"@webiny/api/plugins/ContextPlugin\";\n const existingContextPluginImport =\n source.getImportDeclaration(contextPluginImportPath);\n if (!existingContextPluginImport) {\n source.insertImportDeclaration(index, {\n namedImports: [\"createContextPlugin\"],\n moduleSpecifier: contextPluginImportPath\n });\n }\n }\n\n await source.save();\n }\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,IAAI,EAAEC,OAAO,QAAgC,UAAU;AAChE,SAASC,eAAe,QAAQ,iCAAiC;AACjE,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,IAAI;AAEnB,OAAO,MAAMC,UAAU,GAAGJ,eAAe,CAAC;EACtCK,IAAI,EAAE,gBAAgB;EACtBC,IAAI,EAAE;IAAEC,cAAc,EAAE,WAAW;IAAEC,OAAO,EAAE;EAAM,CAAC;EACrDC,WAAW,EAAE,sCAAsC;EACnDC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAOd,CAAC,CAACe,MAAM,CAAC;MACZC,SAAS,EAAEhB,CAAC,CAACiB,MAAM,CAAC,CAAC;MACrBC,KAAK,EAAElB,CAAC,CAACmB,KAAK,CAAC,CACXnB,CAAC,CAACiB,MAAM,CAAC,CAAC,EACVjB,CAAC,CAACoB,MAAM,CAACpB,CAAC,CAACqB,GAAG,CAAC,CAAC,CAAC,EACjBrB,CAAC,CAACsB,KAAK,CAACtB,CAAC,CAACqB,GAAG,CAAC,CAAC,CAAC,EAChBrB,CAAC,CAACuB,MAAM,CAAC,CAAC,EACVvB,CAAC,CAACwB,OAAO,CAAC,CAAC,CACd;IACL,CAAC,CAAC;EACN,CAAC;EACD,M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B,CAACD,IAAI,CACtC,CAA2B;IAE3BF,YAAY,CAACI,UAAU,CACnB,sEAAsEhC,SAAS,QACnF,CAAC;IAED;MACI,IAAImB,KAAK,GAAG,CAAC;MAEb,MAAMC,kBAAkB,GAAGV,MAAM,CAACW,qBAAqB,CAAC,CAAC;MACzD,IAAID,kBAAkB,CAACE,MAAM,EAAE;QAC3B,MAAMC,IAAI,GAAGH,kBAAkB,CAACA,kBAAkB,CAACE,MAAM,GAAG,CAAC,CAAC;QAC9DH,KAAK,GAAGI,IAAI,CAACC,aAAa,CAAC,CAAC,GAAG,CAAC;MACpC;MAEA,MAAMS,uBAAuB,GAAG,mCAAmC;MACnE,MAAMC,2BAA2B,GAC7BxB,MAAM,CAACQ,oBAAoB,CAACe,uBAAuB,CAAC;MACxD,IAAI,CAACC,2BAA2B,EAAE;QAC9BxB,MAAM,CAACe,uBAAuB,CAACN,KAAK,EAAE;UAClCgB,YAAY,EAAE,CAAC,qBAAqB,CAAC;UACrCR,eAAe,EAAEM;QACrB,CAAC,CAAC;MACN;IACJ;IAEA,MAAMvB,MAAM,CAAC0B,IAAI,CAAC,CAAC;EACvB;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const GenericExtension: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","GenericExtension","type","description"],"sources":["GenericExtension.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\n\nexport const GenericExtension = defineApiExtension({\n type: \"Api/Extension\",\n description: \"Add any API extension.\"\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AAEpE,OAAO,MAAMC,gBAAgB,GAAGD,kBAAkB,CAAC;EAC/CE,IAAI,EAAE,eAAe;EACrBC,WAAW,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const AfterAuthentication: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { AfterAuthenticationHandler } from "../../features/security/authentication/AuthenticationContext/index.js";
|
|
3
|
-
export const AfterAuthentication = defineApiExtension({
|
|
4
|
-
type: "Security/AfterAuthentication",
|
|
5
|
-
description: "Add custom logic to be executed after authentication.",
|
|
6
|
-
abstraction: AfterAuthenticationHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=AfterAuthentication.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","AfterAuthenticationHandler","AfterAuthentication","type","description","abstraction"],"sources":["AfterAuthentication.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { AfterAuthenticationHandler } from \"~/features/security/authentication/AuthenticationContext/index.js\";\n\nexport const AfterAuthentication = defineApiExtension({\n type: \"Security/AfterAuthentication\",\n description: \"Add custom logic to be executed after authentication.\",\n abstraction: AfterAuthenticationHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,0BAA0B;AAEnC,OAAO,MAAMC,mBAAmB,GAAGF,kBAAkB,CAAC;EAClDG,IAAI,EAAE,8BAA8B;EACpCC,WAAW,EAAE,uDAAuD;EACpEC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ApiKeyAfterCreate: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { ApiKeyAfterCreateHandler } from "../../features/security/apiKeys/CreateApiKey/index.js";
|
|
3
|
-
export const ApiKeyAfterCreate = defineApiExtension({
|
|
4
|
-
type: "Security/ApiKeyAfterCreate",
|
|
5
|
-
description: "Add custom logic to be executed after an API key is created.",
|
|
6
|
-
abstraction: ApiKeyAfterCreateHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ApiKeyAfterCreate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","ApiKeyAfterCreateHandler","ApiKeyAfterCreate","type","description","abstraction"],"sources":["ApiKeyAfterCreate.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { ApiKeyAfterCreateHandler } from \"~/features/security/apiKeys/CreateApiKey/index.js\";\n\nexport const ApiKeyAfterCreate = defineApiExtension({\n type: \"Security/ApiKeyAfterCreate\",\n description: \"Add custom logic to be executed after an API key is created.\",\n abstraction: ApiKeyAfterCreateHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,wBAAwB;AAEjC,OAAO,MAAMC,iBAAiB,GAAGF,kBAAkB,CAAC;EAChDG,IAAI,EAAE,4BAA4B;EAClCC,WAAW,EAAE,8DAA8D;EAC3EC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ApiKeyAfterDelete: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { ApiKeyAfterDeleteHandler } from "../../features/security/apiKeys/DeleteApiKey/index.js";
|
|
3
|
-
export const ApiKeyAfterDelete = defineApiExtension({
|
|
4
|
-
type: "Security/ApiKeyAfterDelete",
|
|
5
|
-
description: "Add custom logic to be executed after an API key is deleted.",
|
|
6
|
-
abstraction: ApiKeyAfterDeleteHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ApiKeyAfterDelete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","ApiKeyAfterDeleteHandler","ApiKeyAfterDelete","type","description","abstraction"],"sources":["ApiKeyAfterDelete.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { ApiKeyAfterDeleteHandler } from \"~/features/security/apiKeys/DeleteApiKey/index.js\";\n\nexport const ApiKeyAfterDelete = defineApiExtension({\n type: \"Security/ApiKeyAfterDelete\",\n description: \"Add custom logic to be executed after an API key is deleted.\",\n abstraction: ApiKeyAfterDeleteHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,wBAAwB;AAEjC,OAAO,MAAMC,iBAAiB,GAAGF,kBAAkB,CAAC;EAChDG,IAAI,EAAE,4BAA4B;EAClCC,WAAW,EAAE,8DAA8D;EAC3EC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ApiKeyAfterUpdate: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { ApiKeyAfterUpdateHandler } from "../../features/security/apiKeys/UpdateApiKey/index.js";
|
|
3
|
-
export const ApiKeyAfterUpdate = defineApiExtension({
|
|
4
|
-
type: "Security/ApiKeyAfterUpdate",
|
|
5
|
-
description: "Add custom logic to be executed after an API key is updated.",
|
|
6
|
-
abstraction: ApiKeyAfterUpdateHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ApiKeyAfterUpdate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","ApiKeyAfterUpdateHandler","ApiKeyAfterUpdate","type","description","abstraction"],"sources":["ApiKeyAfterUpdate.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { ApiKeyAfterUpdateHandler } from \"~/features/security/apiKeys/UpdateApiKey/index.js\";\n\nexport const ApiKeyAfterUpdate = defineApiExtension({\n type: \"Security/ApiKeyAfterUpdate\",\n description: \"Add custom logic to be executed after an API key is updated.\",\n abstraction: ApiKeyAfterUpdateHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,wBAAwB;AAEjC,OAAO,MAAMC,iBAAiB,GAAGF,kBAAkB,CAAC;EAChDG,IAAI,EAAE,4BAA4B;EAClCC,WAAW,EAAE,8DAA8D;EAC3EC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ApiKeyBeforeCreate: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { ApiKeyBeforeCreateHandler } from "../../features/security/apiKeys/CreateApiKey/index.js";
|
|
3
|
-
export const ApiKeyBeforeCreate = defineApiExtension({
|
|
4
|
-
type: "Security/ApiKeyBeforeCreate",
|
|
5
|
-
description: "Add custom logic to be executed before an API key is created.",
|
|
6
|
-
abstraction: ApiKeyBeforeCreateHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ApiKeyBeforeCreate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","ApiKeyBeforeCreateHandler","ApiKeyBeforeCreate","type","description","abstraction"],"sources":["ApiKeyBeforeCreate.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { ApiKeyBeforeCreateHandler } from \"~/features/security/apiKeys/CreateApiKey/index.js\";\n\nexport const ApiKeyBeforeCreate = defineApiExtension({\n type: \"Security/ApiKeyBeforeCreate\",\n description: \"Add custom logic to be executed before an API key is created.\",\n abstraction: ApiKeyBeforeCreateHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,yBAAyB;AAElC,OAAO,MAAMC,kBAAkB,GAAGF,kBAAkB,CAAC;EACjDG,IAAI,EAAE,6BAA6B;EACnCC,WAAW,EAAE,+DAA+D;EAC5EC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ApiKeyBeforeDelete: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { ApiKeyBeforeDeleteHandler } from "../../features/security/apiKeys/DeleteApiKey/index.js";
|
|
3
|
-
export const ApiKeyBeforeDelete = defineApiExtension({
|
|
4
|
-
type: "Security/ApiKeyBeforeDelete",
|
|
5
|
-
description: "Add custom logic to be executed before an API key is deleted.",
|
|
6
|
-
abstraction: ApiKeyBeforeDeleteHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ApiKeyBeforeDelete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","ApiKeyBeforeDeleteHandler","ApiKeyBeforeDelete","type","description","abstraction"],"sources":["ApiKeyBeforeDelete.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { ApiKeyBeforeDeleteHandler } from \"~/features/security/apiKeys/DeleteApiKey/index.js\";\n\nexport const ApiKeyBeforeDelete = defineApiExtension({\n type: \"Security/ApiKeyBeforeDelete\",\n description: \"Add custom logic to be executed before an API key is deleted.\",\n abstraction: ApiKeyBeforeDeleteHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,yBAAyB;AAElC,OAAO,MAAMC,kBAAkB,GAAGF,kBAAkB,CAAC;EACjDG,IAAI,EAAE,6BAA6B;EACnCC,WAAW,EAAE,+DAA+D;EAC5EC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const ApiKeyBeforeUpdate: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { ApiKeyBeforeUpdateHandler } from "../../features/security/apiKeys/UpdateApiKey/index.js";
|
|
3
|
-
export const ApiKeyBeforeUpdate = defineApiExtension({
|
|
4
|
-
type: "Security/ApiKeyBeforeUpdate",
|
|
5
|
-
description: "Add custom logic to be executed before an API key is updated.",
|
|
6
|
-
abstraction: ApiKeyBeforeUpdateHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ApiKeyBeforeUpdate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","ApiKeyBeforeUpdateHandler","ApiKeyBeforeUpdate","type","description","abstraction"],"sources":["ApiKeyBeforeUpdate.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { ApiKeyBeforeUpdateHandler } from \"~/features/security/apiKeys/UpdateApiKey/index.js\";\n\nexport const ApiKeyBeforeUpdate = defineApiExtension({\n type: \"Security/ApiKeyBeforeUpdate\",\n description: \"Add custom logic to be executed before an API key is updated.\",\n abstraction: ApiKeyBeforeUpdateHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,yBAAyB;AAElC,OAAO,MAAMC,kBAAkB,GAAGF,kBAAkB,CAAC;EACjDG,IAAI,EAAE,6BAA6B;EACnCC,WAAW,EAAE,+DAA+D;EAC5EC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const BeforeAuthentication: import("@webiny/project/defineExtension").ExtensionComponent<import("zod").ZodObject<{
|
|
2
|
-
src: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
|
|
3
|
-
exportName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
-
src: string;
|
|
6
|
-
exportName?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
src: string;
|
|
9
|
-
exportName?: string | undefined;
|
|
10
|
-
}>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineApiExtension } from "@webiny/project/defineExtension";
|
|
2
|
-
import { BeforeAuthenticationHandler } from "../../features/security/authentication/AuthenticationContext/index.js";
|
|
3
|
-
export const BeforeAuthentication = defineApiExtension({
|
|
4
|
-
type: "Security/BeforeAuthentication",
|
|
5
|
-
description: "Add custom logic to be executed before authentication.",
|
|
6
|
-
abstraction: BeforeAuthenticationHandler
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=BeforeAuthentication.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["defineApiExtension","BeforeAuthenticationHandler","BeforeAuthentication","type","description","abstraction"],"sources":["BeforeAuthentication.ts"],"sourcesContent":["import { defineApiExtension } from \"@webiny/project/defineExtension\";\nimport { BeforeAuthenticationHandler } from \"~/features/security/authentication/AuthenticationContext/index.js\";\n\nexport const BeforeAuthentication = defineApiExtension({\n type: \"Security/BeforeAuthentication\",\n description: \"Add custom logic to be executed before authentication.\",\n abstraction: BeforeAuthenticationHandler\n});\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,2BAA2B;AAEpC,OAAO,MAAMC,oBAAoB,GAAGF,kBAAkB,CAAC;EACnDG,IAAI,EAAE,+BAA+B;EACrCC,WAAW,EAAE,wDAAwD;EACrEC,WAAW,EAAEJ;AACjB,CAAC,CAAC","ignoreList":[]}
|