@lafken/common 0.10.1

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.
Files changed (61) hide show
  1. package/LICENCE +21 -0
  2. package/README.md +414 -0
  3. package/lib/constants/env.constants.d.ts +2 -0
  4. package/lib/constants/env.constants.js +5 -0
  5. package/lib/constants/index.d.ts +1 -0
  6. package/lib/constants/index.js +17 -0
  7. package/lib/decorators/field/field.d.ts +9 -0
  8. package/lib/decorators/field/field.js +138 -0
  9. package/lib/decorators/field/field.types.d.ts +71 -0
  10. package/lib/decorators/field/field.types.js +8 -0
  11. package/lib/decorators/field/index.d.ts +2 -0
  12. package/lib/decorators/field/index.js +18 -0
  13. package/lib/decorators/index.d.ts +4 -0
  14. package/lib/decorators/index.js +20 -0
  15. package/lib/decorators/lambda/index.d.ts +2 -0
  16. package/lib/decorators/lambda/index.js +18 -0
  17. package/lib/decorators/lambda/lambda.d.ts +7 -0
  18. package/lib/decorators/lambda/lambda.js +58 -0
  19. package/lib/decorators/lambda/lambda.types.d.ts +204 -0
  20. package/lib/decorators/lambda/lambda.types.js +14 -0
  21. package/lib/decorators/payload/index.d.ts +2 -0
  22. package/lib/decorators/payload/index.js +18 -0
  23. package/lib/decorators/payload/payload.d.ts +2 -0
  24. package/lib/decorators/payload/payload.js +32 -0
  25. package/lib/decorators/payload/payload.types.d.ts +18 -0
  26. package/lib/decorators/payload/payload.types.js +2 -0
  27. package/lib/decorators/resource/index.d.ts +2 -0
  28. package/lib/decorators/resource/index.js +18 -0
  29. package/lib/decorators/resource/resource.d.ts +2 -0
  30. package/lib/decorators/resource/resource.js +25 -0
  31. package/lib/decorators/resource/resource.types.d.ts +31 -0
  32. package/lib/decorators/resource/resource.types.js +7 -0
  33. package/lib/index.d.ts +4 -0
  34. package/lib/index.js +20 -0
  35. package/lib/types/env.types.d.ts +4 -0
  36. package/lib/types/env.types.js +2 -0
  37. package/lib/types/index.d.ts +7 -0
  38. package/lib/types/index.js +23 -0
  39. package/lib/types/output.types.d.ts +55 -0
  40. package/lib/types/output.types.js +2 -0
  41. package/lib/types/override-resources.types.d.ts +35 -0
  42. package/lib/types/override-resources.types.js +2 -0
  43. package/lib/types/resource.types.d.ts +52 -0
  44. package/lib/types/resource.types.js +2 -0
  45. package/lib/types/services.types.d.ts +22 -0
  46. package/lib/types/services.types.js +2 -0
  47. package/lib/types/time.types.d.ts +8 -0
  48. package/lib/types/time.types.js +2 -0
  49. package/lib/types/utilities.types.d.ts +37 -0
  50. package/lib/types/utilities.types.js +2 -0
  51. package/lib/utils/build-env.utils.d.ts +2 -0
  52. package/lib/utils/build-env.utils.js +12 -0
  53. package/lib/utils/index.d.ts +4 -0
  54. package/lib/utils/index.js +20 -0
  55. package/lib/utils/path.utils.d.ts +1 -0
  56. package/lib/utils/path.utils.js +16 -0
  57. package/lib/utils/resource.utils.d.ts +6 -0
  58. package/lib/utils/resource.utils.js +20 -0
  59. package/lib/utils/string.utils.d.ts +5 -0
  60. package/lib/utils/string.utils.js +36 -0
  61. package/package.json +55 -0
@@ -0,0 +1,55 @@
1
+ export type OutputType = 'arn' | 'id';
2
+ export type GetResourceValue<T = string, V = OutputType> = (value: T, type: V) => any;
3
+ /**
4
+ * Common fields shared by all resource output definitions.
5
+ *
6
+ * The `value` field does not contain the final resolved AWS value. Instead, it declares
7
+ * which resource property should be exported by the resolver, such as an ARN, ID, URL,
8
+ * or any other attribute exposed by the resource implementation.
9
+ */
10
+ export interface OutputBase<T> {
11
+ /**
12
+ * Export name.
13
+ *
14
+ * For `ssm` outputs this is the SSM parameter name.
15
+ * For `output` outputs this is the Terraform output name.
16
+ */
17
+ name: string;
18
+ /** Resource attribute key that should be exported. */
19
+ value: T;
20
+ /** Optional human-readable description for the generated output. */
21
+ description?: string;
22
+ }
23
+ /**
24
+ * Defines an output that will be persisted in AWS Systems Manager Parameter Store.
25
+ *
26
+ * Use this output type when a resource property must be consumed outside Terraform,
27
+ * for example by Lambda runtime code, other AWS services, external applications,
28
+ * or deployment processes that read values from Parameter Store.
29
+ */
30
+ export interface SSMOutput<T> extends OutputBase<T> {
31
+ /** Output backend type discriminator. */
32
+ type: 'ssm';
33
+ /**
34
+ * Stores the parameter as `SecureString` when true.
35
+ * Defaults to a plain `String` when omitted.
36
+ */
37
+ secure?: boolean;
38
+ }
39
+ /**
40
+ * Defines an output that will be emitted as a Terraform output.
41
+ *
42
+ * Use this output type when the exported value should remain in Terraform state
43
+ * and be consumed through Terraform plans, remote state, or other Terraform workflows.
44
+ */
45
+ export interface TerraformOutput<T> extends OutputBase<T> {
46
+ /** Output backend type discriminator. */
47
+ type: 'output';
48
+ }
49
+ /**
50
+ * Collection of outputs exposed by a resource.
51
+ *
52
+ * A resource can export one or more of its attributes through SSM Parameter Store,
53
+ * Terraform outputs, or both at the same time.
54
+ */
55
+ export type ResourceOutputType<T> = (SSMOutput<T> | TerraformOutput<T>)[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ import type { ResourceIdentifiers, ScopedResourceNames } from './utilities.types';
2
+ export type ModuleGlobalReferenceNames = 'api' | 'auth' | 'bucket' | 'dynamo' | 'event-bus';
3
+ export interface ModulesAvailable {
4
+ }
5
+ export interface AuthAvailable {
6
+ }
7
+ export interface BucketAvailable {
8
+ }
9
+ export interface ApiRestAvailable {
10
+ }
11
+ export interface ApiAuthorizerAvailable {
12
+ }
13
+ export interface EventBusAvailable {
14
+ }
15
+ export interface DynamoTableAvailable {
16
+ }
17
+ type ResourceNames<T> = keyof T | (string & {});
18
+ type StackResourceName<T, S extends ModuleGlobalReferenceNames> = `${S}::${Extract<keyof T, string | number>}` | (string & {});
19
+ export type ModuleNames = ResourceNames<ModulesAvailable>;
20
+ export type AuthNames = ResourceNames<AuthAvailable>;
21
+ export type AuthScopedNames = StackResourceName<AuthAvailable, 'auth'>;
22
+ export type BucketNames = ResourceNames<BucketAvailable>;
23
+ export type BucketScopedNames = StackResourceName<BucketAvailable, 'bucket'>;
24
+ export type ApiRestNames = ResourceNames<ApiRestAvailable>;
25
+ export type ApiRestScopedNames = StackResourceName<ApiRestAvailable, 'api'>;
26
+ export type ApiAuthorizerNames = ResourceNames<ApiAuthorizerAvailable>;
27
+ export type EventBusNames = ResourceNames<EventBusAvailable>;
28
+ export type EventBusScopedNames = StackResourceName<EventBusAvailable, 'event-bus'>;
29
+ export type DynamoTableNames = ResourceNames<DynamoTableAvailable>;
30
+ export type DynamoTableScopedNames = StackResourceName<DynamoTableAvailable, 'dynamo'>;
31
+ export type StateMachineNames = ResourceIdentifiers<ModulesAvailable, 'StateMachine'> | (string & {});
32
+ export type StateMachineScopedNames = ScopedResourceNames<ModulesAvailable, 'StateMachine', 'state-machine'> | (string & {});
33
+ export type QueueNames = ResourceIdentifiers<ModulesAvailable, 'Queue'> | (string & {});
34
+ export type QueueScopedNames = ScopedResourceNames<ModulesAvailable, 'Queue', 'queue'> | (string & {});
35
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,52 @@
1
+ import type { GetResourceValue } from './output.types';
2
+ import type { ApiRestScopedNames, AuthScopedNames, BucketScopedNames, DynamoTableScopedNames, EventBusScopedNames, QueueScopedNames, StateMachineScopedNames } from './override-resources.types';
3
+ export interface ClassResource {
4
+ new (...args: any[]): {};
5
+ }
6
+ export interface GetResourceProps {
7
+ /**
8
+ * Retrieves an attribute value from a resource created by Lafken.
9
+ *
10
+ * Uses the format `'scope::resourceName'` to identify the resource,
11
+ * where `scope` corresponds to the resource type prefix (e.g., `dynamo`, `bucket`,
12
+ * `api`, `auth`, `event-bus`) or the module name (for queues and state machines).
13
+ *
14
+ * The second argument specifies the attribute to retrieve. Available attributes
15
+ * depend on the resource type and correspond to the Terraform registry attribute
16
+ * reference for each AWS resource.
17
+ *
18
+ * @param value - Resource identifier in `'scope::resourceName'` format.
19
+ * @param type - Attribute to retrieve (`'arn'` or `'id'`).
20
+ *
21
+ * @example
22
+ * // Get a DynamoDB table ID
23
+ * getResourceValue('dynamo::users', 'id')
24
+ *
25
+ * @example
26
+ * // Get a queue ARN
27
+ * getResourceValue('orders-module::queue::processOrder', 'id')
28
+ *
29
+ * @example
30
+ * // Get a bucket ARN
31
+ * getResourceValue('bucket::uploads', 'arn')
32
+ */
33
+ getResourceValue: GetResourceValue<DynamoTableScopedNames | AuthScopedNames | BucketScopedNames | ApiRestScopedNames | EventBusScopedNames | StateMachineScopedNames | QueueScopedNames>;
34
+ /**
35
+ * Retrieves a value from AWS Systems Manager Parameter Store.
36
+ *
37
+ * Resolves SSM parameter references at deployment time, allowing
38
+ * access to configuration values stored in Parameter Store.
39
+ *
40
+ * @param value - The SSM parameter path (e.g., `'/my-app/database-url'`).
41
+ * @param secure - When `true`, retrieves the parameter as a `SecureString`.
42
+ *
43
+ * @example
44
+ * // Get a plain text parameter
45
+ * getSSMValue('/my-app/api-key')
46
+ *
47
+ * @example
48
+ * // Get a secure parameter
49
+ * getSSMValue('/my-app/secret', true)
50
+ */
51
+ getSSMValue: (value: string, secure?: boolean) => string;
52
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import type { GetResourceProps } from './resource.types';
2
+ export type ServicesName = 'dynamodb' | 's3' | 'lambda' | 'cloudwatch' | 'sqs' | 'state_machine' | 'kms' | 'ssm' | 'event';
3
+ interface PermissionService<T extends ServicesName | 'custom', P extends string> {
4
+ type: T;
5
+ permissions?: P[];
6
+ resources?: string[];
7
+ }
8
+ export type DynamoPermissions = 'Query' | 'Scan' | 'GetItem' | 'BatchGetItem' | 'PutItem' | 'DeleteItem' | 'UpdateItem' | 'ConditionCheckItem' | 'DescribeStream' | 'GetRecords' | 'GetShardIterator' | 'ListStreams';
9
+ export type S3Permissions = 'AbortMultipartUpload' | 'CreateBucket' | 'DeleteBucket' | 'DeleteObject' | 'DeleteObjectTagging' | 'DeleteObjectVersion' | 'DeleteObjectVersionTagging' | 'GetBucketTagging' | 'GetBucketVersioning' | 'GetObject' | 'GetObjectAttributes' | 'GetObjectTagging' | 'GetObjectVersion' | 'GetObjectVersionAttributes' | 'GetObjectVersionTagging' | 'ListAllMyBuckets' | 'ListBucket' | 'ListBucketMultipartUploads' | 'ListBucketVersions' | 'ListMultipartUploadParts' | 'PutObject' | 'PutObjectTagging' | 'PutObjectVersionTagging' | 'ReplicateDelete' | 'ReplicateObject' | 'ReplicateTags' | 'RestoreObject';
10
+ export type LambdaPermissions = 'InvokeFunction';
11
+ export type LogsPermission = 'CreateLogGroup' | 'CreateLogStream' | 'PutLogEvents';
12
+ export type SQSPermissions = 'DeleteMessage' | 'GetQueueUrl' | 'ReceiveMessage' | 'ReceiveMessage' | 'SendMessage' | 'GetQueueAttributes';
13
+ export type StateMachinePermissions = 'InvokeHTTPEndpoint' | 'DescribeExecution' | 'StartExecution' | 'StopExecution' | 'DescribeExecution' | 'GetExecutionHistory';
14
+ export type KMSPermissions = 'Decrypt' | 'DescribeKey' | 'Encrypt' | 'GenerateDataKey' | 'GenerateRandom' | 'GetPublicKey' | 'Sign' | 'Verify';
15
+ export type SSMPermissions = 'DescribeParameters' | 'GetDocument' | 'GetParameter' | 'GetParameters' | 'GetParametersByPath' | 'ListDocuments' | 'PutParameter';
16
+ export type EventPermissions = 'DescribeEventRule' | 'DescribeEventBus' | 'DescribeRule' | 'PutEvents' | 'PutRule';
17
+ export type Services = ServicesName | PermissionService<'dynamodb', DynamoPermissions> | PermissionService<'s3', S3Permissions> | PermissionService<'lambda', LambdaPermissions> | PermissionService<'cloudwatch', LogsPermission> | PermissionService<'sqs', SQSPermissions> | PermissionService<'state_machine', StateMachinePermissions> | PermissionService<'kms', KMSPermissions> | PermissionService<'ssm', SSMPermissions> | PermissionService<'event', EventPermissions> | (PermissionService<'custom', string> & {
18
+ serviceName: string;
19
+ });
20
+ export type ServiceFunction = (props: GetResourceProps) => Services[];
21
+ export type ServicesValues = Services[] | ServiceFunction;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface Time {
2
+ type: 'days' | 'minutes' | 'seconds';
3
+ duration: number;
4
+ }
5
+ /**
6
+ * Time in seconds or Time object
7
+ */
8
+ export type Duration = number | Time;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,37 @@
1
+ export type KeyOfClass<E extends Function> = keyof E['prototype'];
2
+ export type DeepPartial<T> = T extends object ? {
3
+ [P in keyof T]?: DeepPartial<T[P]>;
4
+ } : T;
5
+ export type OnlyNumberString<T> = {
6
+ [key in keyof T as T[key] extends string | number ? key : never]: T[key];
7
+ };
8
+ export type OnlyNumber<T> = {
9
+ [key in keyof T as T[key] extends number ? key : never]: T[key];
10
+ };
11
+ export type Join<K, P> = K extends string ? P extends string ? `${K}::${P}` : never : never;
12
+ export type FlattenStacksByResource<TStacks, TResource extends string> = {
13
+ [StackName in keyof TStacks]: TResource extends keyof TStacks[StackName] ? Join<TResource, Join<StackName & string, keyof TStacks[StackName][TResource] & string>> : never;
14
+ }[keyof TStacks];
15
+ export type ResourceIdentifiers<TStacks, TResource extends string> = {
16
+ [K in keyof TStacks]: TResource extends keyof TStacks[K] ? keyof TStacks[K][TResource] : never;
17
+ }[keyof TStacks] & string;
18
+ export type ScopedResourceNames<TStacks, TResource extends string, TMiddle extends string = Lowercase<TResource>> = {
19
+ [StackName in keyof TStacks]: TResource extends keyof TStacks[StackName] ? Join<Join<StackName & string, TMiddle>, keyof TStacks[StackName][TResource] & string> : never;
20
+ }[keyof TStacks];
21
+ export type OnlyOne<T> = {
22
+ [K in keyof T]: Required<Pick<T, K>> & Partial<Record<Exclude<keyof T, K>, never>>;
23
+ }[keyof T];
24
+ export type OnlyOneKey<T> = {
25
+ [K in keyof T]: {
26
+ [P in K]: T[P];
27
+ } & {
28
+ [P in Exclude<keyof T, K>]?: never;
29
+ };
30
+ }[keyof T];
31
+ export type StripReadonly<T> = {
32
+ -readonly [P in keyof T]: StripReadonly<T[P]>;
33
+ };
34
+ export type Primitive = string | number | boolean[];
35
+ export type OnlyTypeKeys<T, V> = {
36
+ [K in keyof T]: T[K] extends V ? K : never;
37
+ }[keyof T];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export declare const enableBuildEnvVariable: () => void;
2
+ export declare const isBuildEnvironment: () => boolean;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBuildEnvironment = exports.enableBuildEnvVariable = void 0;
4
+ const env_constants_1 = require("../constants/env.constants");
5
+ const enableBuildEnvVariable = () => {
6
+ process.env[env_constants_1.LAFKEN_CONTEXT] = env_constants_1.LAFKEN_CONTEXT_VALUE;
7
+ };
8
+ exports.enableBuildEnvVariable = enableBuildEnvVariable;
9
+ const isBuildEnvironment = () => {
10
+ return process.env[env_constants_1.LAFKEN_CONTEXT] === env_constants_1.LAFKEN_CONTEXT_VALUE;
11
+ };
12
+ exports.isBuildEnvironment = isBuildEnvironment;
@@ -0,0 +1,4 @@
1
+ export * from './build-env.utils';
2
+ export * from './path.utils';
3
+ export * from './resource.utils';
4
+ export * from './string.utils';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./build-env.utils"), exports);
18
+ __exportStar(require("./path.utils"), exports);
19
+ __exportStar(require("./resource.utils"), exports);
20
+ __exportStar(require("./string.utils"), exports);
@@ -0,0 +1 @@
1
+ export declare const getCallerFileName: (fileIndex?: number) => string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCallerFileName = void 0;
4
+ const getStacks = () => {
5
+ const originalPrepareStackTrace = Error.prepareStackTrace;
6
+ Error.prepareStackTrace = (_, stack) => stack;
7
+ const err = new Error();
8
+ const stacks = err.stack;
9
+ Error.prepareStackTrace = originalPrepareStackTrace;
10
+ return stacks;
11
+ };
12
+ const getCallerFileName = (fileIndex = 5) => {
13
+ const stacks = getStacks();
14
+ return stacks[fileIndex].getFileName();
15
+ };
16
+ exports.getCallerFileName = getCallerFileName;
@@ -0,0 +1,6 @@
1
+ import { type LambdaMetadata, type ResourceMetadata } from '../decorators';
2
+ import type { ClassResource } from '../types';
3
+ export declare const getResourceMetadata: <T = ResourceMetadata>(classResource: ClassResource) => T;
4
+ export declare const getResourceHandlerMetadata: <T = LambdaMetadata>(classResource: ClassResource) => T[];
5
+ export declare const getMetadataByKey: <T>(classResource: ClassResource, key: string) => T;
6
+ export declare const getMetadataPrototypeByKey: <T>(classResource: ClassResource, key: string) => T;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMetadataPrototypeByKey = exports.getMetadataByKey = exports.getResourceHandlerMetadata = exports.getResourceMetadata = void 0;
4
+ const decorators_1 = require("../decorators");
5
+ const getResourceMetadata = (classResource) => {
6
+ return Reflect.getMetadata(decorators_1.ResourceReflectKeys.resource, classResource);
7
+ };
8
+ exports.getResourceMetadata = getResourceMetadata;
9
+ const getResourceHandlerMetadata = (classResource) => {
10
+ return Reflect.getMetadata(decorators_1.LambdaReflectKeys.handlers, classResource.prototype) || [];
11
+ };
12
+ exports.getResourceHandlerMetadata = getResourceHandlerMetadata;
13
+ const getMetadataByKey = (classResource, key) => {
14
+ return Reflect.getMetadata(key, classResource);
15
+ };
16
+ exports.getMetadataByKey = getMetadataByKey;
17
+ const getMetadataPrototypeByKey = (classResource, key) => {
18
+ return Reflect.getMetadata(key, classResource.prototype);
19
+ };
20
+ exports.getMetadataPrototypeByKey = getMetadataPrototypeByKey;
@@ -0,0 +1,5 @@
1
+ export declare const capitalize: (str: string) => string;
2
+ export declare const kebabCase: (str: string) => string;
3
+ export declare const cleanString: (str: string) => string;
4
+ export declare const cleanTemplateString: (str: string) => string;
5
+ export declare const cleanAndCapitalize: (str: string) => string;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cleanAndCapitalize = exports.cleanTemplateString = exports.cleanString = exports.kebabCase = exports.capitalize = void 0;
4
+ const capitalize = (str) => {
5
+ return str.charAt(0).toUpperCase() + str.slice(1);
6
+ };
7
+ exports.capitalize = capitalize;
8
+ const kebabCase = (str) => {
9
+ if (str === str.toUpperCase()) {
10
+ return str.toLocaleLowerCase();
11
+ }
12
+ return str
13
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
14
+ .replace(/[\s_]+/g, '-')
15
+ .toLowerCase();
16
+ };
17
+ exports.kebabCase = kebabCase;
18
+ const cleanString = (str) => {
19
+ return str.replace(/[^a-zA-Z0-9]/g, '');
20
+ };
21
+ exports.cleanString = cleanString;
22
+ const cleanTemplateString = (str) => {
23
+ return str
24
+ .split('\n')
25
+ .map((s) => s.trim())
26
+ .filter(Boolean)
27
+ .join(' ');
28
+ };
29
+ exports.cleanTemplateString = cleanTemplateString;
30
+ const cleanAndCapitalize = (str) => {
31
+ return str
32
+ .split(/[^a-zA-Z0-9]+/)
33
+ .map((word) => (0, exports.capitalize)(word))
34
+ .join('');
35
+ };
36
+ exports.cleanAndCapitalize = cleanAndCapitalize;
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@lafken/common",
3
+ "version": "0.10.1",
4
+ "private": false,
5
+ "description": "Lafken utilities - TypeScript decorator factories and metadata reflection for infrastructure-as-code decorators",
6
+ "keywords": [
7
+ "aws",
8
+ "serverless",
9
+ "lafken",
10
+ "decorators",
11
+ "metadata",
12
+ "reflection",
13
+ "typescript",
14
+ "utility"
15
+ ],
16
+ "homepage": "https://github.com/Hero64/lafken#readme",
17
+ "bugs": "https://github.com/Hero64/lafken/issues",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/Hero64/lafken",
21
+ "directory": "packages/common"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Aníbal Jorquera",
25
+ "main": "lib/index.js",
26
+ "types": "lib/index.d.ts",
27
+ "files": [
28
+ "lib"
29
+ ],
30
+ "dependencies": {
31
+ "reflect-metadata": "0.2.2"
32
+ },
33
+ "devDependencies": {
34
+ "@swc/core": "^1.15.21",
35
+ "@swc/helpers": "^0.5.20",
36
+ "@vitest/runner": "^4.1.2",
37
+ "cdktn-vitest": "^1.0.0",
38
+ "typescript": "6.0.2",
39
+ "unplugin-swc": "^1.5.9",
40
+ "vitest": "^4.1.2"
41
+ },
42
+ "engines": {
43
+ "node": ">=20.19"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "scripts": {
49
+ "build": "pnpm clean && tsc -p ./tsconfig.build.json",
50
+ "check-types": "tsc --noEmit -p ./tsconfig.build.json",
51
+ "clean": "rm -rf ./lib",
52
+ "dev": "tsc -w",
53
+ "test": "vitest"
54
+ }
55
+ }