aws-service-stack 0.18.371 → 0.18.372

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 (64) hide show
  1. package/README.md +0 -149
  2. package/dist/controller/controller-api.d.ts +0 -8
  3. package/dist/controller/controller-api.js +1 -39
  4. package/dist/controller/controller-api.js.map +1 -1
  5. package/dist/controller/index.d.ts +0 -1
  6. package/dist/controller/index.js +0 -1
  7. package/dist/controller/index.js.map +1 -1
  8. package/dist/function/cognito/cognito.function.d.ts +0 -5
  9. package/dist/function/cognito/cognito.function.js +0 -22
  10. package/dist/function/cognito/cognito.function.js.map +1 -1
  11. package/dist/function/cognito/index.d.ts +1 -3
  12. package/dist/function/cognito/index.js +0 -2
  13. package/dist/function/cognito/index.js.map +1 -1
  14. package/dist/function/index.d.ts +0 -2
  15. package/dist/model/base.config.d.ts +1 -12
  16. package/dist/model/base.config.js +0 -20
  17. package/dist/model/base.config.js.map +1 -1
  18. package/dist/model/base.model.d.ts +0 -19
  19. package/dist/model/base.model.js +1 -14
  20. package/dist/model/base.model.js.map +1 -1
  21. package/dist/model/index.d.ts +0 -1
  22. package/dist/model/index.js.map +1 -1
  23. package/dist/model/validation.model.d.ts +1 -1
  24. package/dist/model/validation.model.js.map +1 -1
  25. package/dist/service/index.d.ts +0 -3
  26. package/dist/service/index.js +0 -3
  27. package/dist/service/index.js.map +1 -1
  28. package/dist/utils/data.util.d.ts +20 -0
  29. package/dist/utils/data.util.js +73 -0
  30. package/dist/utils/data.util.js.map +1 -0
  31. package/dist/utils/date.util.d.ts +13 -0
  32. package/dist/utils/date.util.js +35 -0
  33. package/dist/utils/date.util.js.map +1 -1
  34. package/dist/utils/index.d.ts +1 -0
  35. package/dist/utils/index.js +1 -0
  36. package/dist/utils/index.js.map +1 -1
  37. package/package.json +31 -31
  38. package/dist/_examples/controller/property/property-crud.d.ts +0 -4
  39. package/dist/_examples/controller/property/property-crud.js +0 -58
  40. package/dist/_examples/controller/property/property-crud.js.map +0 -1
  41. package/dist/_examples/controller/property/property.config.d.ts +0 -10
  42. package/dist/_examples/controller/property/property.config.js +0 -55
  43. package/dist/_examples/controller/property/property.config.js.map +0 -1
  44. package/dist/_examples/controller/property/property.controller.d.ts +0 -14
  45. package/dist/_examples/controller/property/property.controller.js +0 -72
  46. package/dist/_examples/controller/property/property.controller.js.map +0 -1
  47. package/dist/_examples/controller/property/property.permissions.d.ts +0 -2
  48. package/dist/_examples/controller/property/property.permissions.js +0 -19
  49. package/dist/_examples/controller/property/property.permissions.js.map +0 -1
  50. package/dist/controller/controller-role.d.ts +0 -56
  51. package/dist/controller/controller-role.js +0 -140
  52. package/dist/controller/controller-role.js.map +0 -1
  53. package/dist/model/role.model.d.ts +0 -20
  54. package/dist/model/role.model.js +0 -12
  55. package/dist/model/role.model.js.map +0 -1
  56. package/dist/service/permission.cache.d.ts +0 -24
  57. package/dist/service/permission.cache.js +0 -61
  58. package/dist/service/permission.cache.js.map +0 -1
  59. package/dist/service/permission.repo.d.ts +0 -16
  60. package/dist/service/permission.repo.js +0 -63
  61. package/dist/service/permission.repo.js.map +0 -1
  62. package/dist/service/permission.service.d.ts +0 -39
  63. package/dist/service/permission.service.js +0 -151
  64. package/dist/service/permission.service.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { DynamoIndexMap, EndpointPolicy, ScopeMap, TraceChange } from "../index.js";
1
+ import { DynamoIndexMap, EndpointPolicy, TraceChange } from "../index.js";
2
2
  /** Generic DynamoDB Configuration */
3
3
  export declare class DynamoDBConfig {
4
4
  NAME: string;
@@ -23,9 +23,6 @@ export interface EntityConfig {
23
23
  OWNER_PARENT_ID_FIELD_NAME?: string;
24
24
  OWNER_ID_FIELD_NAME?: string;
25
25
  TRACE_CHANGE?: TraceChange;
26
- SCOPE_MAP?: ScopeMap;
27
- ROLE_TABLE?: string;
28
- ROLE_PATH?: string;
29
26
  }
30
27
  /** Generic Entity Configuration Class **/
31
28
  export declare class EntityConfigImpl implements EntityConfig {
@@ -35,9 +32,6 @@ export declare class EntityConfigImpl implements EntityConfig {
35
32
  ENDPOINT_POLICY: EndpointPolicy[];
36
33
  ADMIN_GROUP_NAME: string[];
37
34
  TRACE_CHANGE?: TraceChange;
38
- SCOPE_MAP?: ScopeMap;
39
- ROLE_TABLE?: string;
40
- ROLE_PATH?: string;
41
35
  OWNER_PARENT_ID_FIELD_NAME?: string;
42
36
  OWNER_ID_FIELD_NAME: string;
43
37
  constructor(basePath: string, adminGroupName?: string[]);
@@ -46,11 +40,6 @@ export declare class EntityConfigImpl implements EntityConfig {
46
40
  setDynamoDB(tableName: string, ownerFieldName: string, indexMap: DynamoIndexMap, ownerParentFieldName?: string): this;
47
41
  /** Set OpenSearch configuration */
48
42
  setOpenSearch(domain: string, index: string): this;
49
- /** Set scope map for RBAC scope-based filtering */
50
- setScopes(scopeMap: ScopeMap): this;
51
- /** Set the DynamoDB table name for RBAC role permissions */
52
- setRoleTable(tableName: string): this;
53
- setRolePath(path: string): this;
54
43
  /** Set path-based policies */
55
44
  setPolicies(policies: EndpointPolicy[]): this;
56
45
  /** Get configuration as a plain object (for BaseController compatibility) */
@@ -33,9 +33,6 @@ class EntityConfigImpl {
33
33
  ENDPOINT_POLICY; // Path-based permission configuration
34
34
  ADMIN_GROUP_NAME; // Admin group name for Cognito
35
35
  TRACE_CHANGE;
36
- SCOPE_MAP;
37
- ROLE_TABLE;
38
- ROLE_PATH;
39
36
  OWNER_PARENT_ID_FIELD_NAME;
40
37
  OWNER_ID_FIELD_NAME;
41
38
  constructor(basePath, adminGroupName) {
@@ -58,20 +55,6 @@ class EntityConfigImpl {
58
55
  this.OPEN_SEARCH = new OpenSearchConfig(domain, index);
59
56
  return this;
60
57
  }
61
- /** Set scope map for RBAC scope-based filtering */
62
- setScopes(scopeMap) {
63
- this.SCOPE_MAP = scopeMap;
64
- return this;
65
- }
66
- /** Set the DynamoDB table name for RBAC role permissions */
67
- setRoleTable(tableName) {
68
- this.ROLE_TABLE = tableName;
69
- return this;
70
- }
71
- setRolePath(path) {
72
- this.ROLE_PATH = path;
73
- return this;
74
- }
75
58
  /** Set path-based policies */
76
59
  setPolicies(policies) {
77
60
  this.ENDPOINT_POLICY = policies;
@@ -88,9 +71,6 @@ class EntityConfigImpl {
88
71
  ADMIN_GROUP_NAME: this.ADMIN_GROUP_NAME,
89
72
  OWNER_PARENT_ID_FIELD_NAME: this.OWNER_PARENT_ID_FIELD_NAME,
90
73
  OWNER_ID_FIELD_NAME: this.OWNER_ID_FIELD_NAME,
91
- SCOPE_MAP: this.SCOPE_MAP,
92
- ROLE_TABLE: this.ROLE_TABLE,
93
- ROLE_PATH: this.ROLE_PATH,
94
74
  };
95
75
  }
96
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base.config.js","sourceRoot":"","sources":["../../src/model/base.config.ts"],"names":[],"mappings":";;;AAEA,qCAAqC;AACrC,MAAa,cAAc;IACzB,IAAI,CAAS,CAAC,sBAAsB;IACpC,uBAAuB,CAAU;IACjC,gBAAgB,CAAS,CAAC,iCAAiC;IAC3D,GAAG,CAAiB;IAEpB,YAAY,SAAiB,EAAE,cAAsB,EAAE,QAAwB,EAAE,eAAwB;QACvG,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,uBAAuB,GAAG,eAAe,CAAC;QAC/C,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;IACtB,CAAC;CACF;AAZD,wCAYC;AAED,uCAAuC;AACvC,MAAa,gBAAgB;IAC3B,MAAM,CAAS;IACf,KAAK,CAAS;IAEd,YAAY,MAAc,EAAE,SAAiB;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;CACF;AARD,4CAQC;AAiBD,0CAA0C;AAC1C,MAAa,gBAAgB;IAC3B,SAAS,CAAS,CAAC,uCAAuC;IAC1D,SAAS,C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CAAC;IAED,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8BAA8B;IAC9B,WAAW,CAAC,QAA0B;QACpC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6EAA6E;IAC7E,QAAQ;QACN,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,0BAA0B,EAAE,IAAI,CAAC,0BAA0B;YAC3D,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF;AAnFD,4CAmFC","sourcesContent":["import { DynamoIndexMap, EndpointPolicy, ScopeMap, TraceChange } from \"@chinggis/core\";\n\n/** Generic DynamoDB Configuration */\nexport class DynamoDBConfig {\n NAME: string; // DynamoDB table name\n OWNER_PARENT_FIELD_NAME?: string;\n OWNER_FIELD_NAME: string; // DynamoDB index map for queries\n MAP: DynamoIndexMap;\n\n constructor(tableName: string, ownerFieldName: string, indexMap: DynamoIndexMap, parentFieldName?: string) {\n this.NAME = tableName;\n this.OWNER_PARENT_FIELD_NAME = parentFieldName;\n this.OWNER_FIELD_NAME = ownerFieldName;\n this.MAP = indexMap;\n }\n}\n\n/** Generic OpenSearch Configuration */\nexport class OpenSearchConfig {\n DOMAIN: string;\n INDEX: string;\n\n constructor(domain: string, indexName: string) {\n this.DOMAIN = domain;\n this.INDEX = indexName;\n }\n}\n\n/** Configuration interface for type safety */\nexport interface EntityConfig {\n BASE_PATH: string;\n DYNAMO_DB: DynamoDBConfig;\n OPEN_SEARCH: OpenSearchConfig;\n ENDPOINT_POLICY: EndpointPolicy[];\n ADMIN_GROUP_NAME: string[];\n OWNER_PARENT_ID_FIELD_NAME?: string;\n OWNER_ID_FIELD_NAME?: string;\n TRACE_CHANGE?: TraceChange;\n SCOPE_MAP?: ScopeMap;\n ROLE_TABLE?: string;\n ROLE_PATH?: string;\n}\n\n/** Generic Entity Configuration Class **/\nexport class EntityConfigImpl implements EntityConfig {\n BASE_PATH: string; //Entity name for logging and debugging\n DYNAMO_DB: DynamoDBConfig; // DynamoDB configuration\n OPEN_SEARCH: OpenSearchConfig; // OpenSearch configuration\n ENDPOINT_POLICY: EndpointPolicy[]; // Path-based permission configuration\n ADMIN_GROUP_NAME: string[]; // Admin group name for Cognito\n\n TRACE_CHANGE?: TraceChange;\n SCOPE_MAP?: ScopeMap;\n ROLE_TABLE?: string;\n ROLE_PATH?: string;\n\n OWNER_PARENT_ID_FIELD_NAME?: string;\n OWNER_ID_FIELD_NAME: string;\n\n constructor(basePath: string, adminGroupName?: string[]) {\n this.BASE_PATH = basePath;\n this.ADMIN_GROUP_NAME = adminGroupName || [\"admin\"];\n this.ENDPOINT_POLICY = [];\n }\n\n setTraceChange(traceChange: TraceChange): void {\n this.TRACE_CHANGE = traceChange;\n }\n\n /** Set DynamoDB configuration */\n setDynamoDB(\n tableName: string,\n ownerFieldName: string,\n indexMap: DynamoIndexMap,\n ownerParentFieldName?: string,\n ): this {\n this.DYNAMO_DB = new DynamoDBConfig(tableName, ownerFieldName, indexMap, ownerParentFieldName);\n this.OWNER_PARENT_ID_FIELD_NAME = ownerParentFieldName;\n this.OWNER_ID_FIELD_NAME = ownerFieldName;\n return this;\n }\n\n /** Set OpenSearch configuration */\n setOpenSearch(domain: string, index: string): this {\n this.OPEN_SEARCH = new OpenSearchConfig(domain, index);\n return this;\n }\n\n /** Set scope map for RBAC scope-based filtering */\n setScopes(scopeMap: ScopeMap): this {\n this.SCOPE_MAP = scopeMap;\n return this;\n }\n\n /** Set the DynamoDB table name for RBAC role permissions */\n setRoleTable(tableName: string): this {\n this.ROLE_TABLE = tableName;\n return this;\n }\n\n setRolePath(path: string): this {\n this.ROLE_PATH = path;\n return this;\n }\n\n /** Set path-based policies */\n setPolicies(policies: EndpointPolicy[]): this {\n this.ENDPOINT_POLICY = policies;\n return this;\n }\n\n /** Get configuration as a plain object (for BaseController compatibility) */\n toObject(): EntityConfig {\n return {\n BASE_PATH: this.BASE_PATH,\n DYNAMO_DB: this.DYNAMO_DB,\n OPEN_SEARCH: this.OPEN_SEARCH,\n ENDPOINT_POLICY: this.ENDPOINT_POLICY,\n TRACE_CHANGE: this.TRACE_CHANGE,\n ADMIN_GROUP_NAME: this.ADMIN_GROUP_NAME,\n OWNER_PARENT_ID_FIELD_NAME: this.OWNER_PARENT_ID_FIELD_NAME,\n OWNER_ID_FIELD_NAME: this.OWNER_ID_FIELD_NAME,\n SCOPE_MAP: this.SCOPE_MAP,\n ROLE_TABLE: this.ROLE_TABLE,\n ROLE_PATH: this.ROLE_PATH,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"base.config.js","sourceRoot":"","sources":["../../src/model/base.config.ts"],"names":[],"mappings":";;;AAEA,qCAAqC;AACrC,MAAa,cAAc;IACzB,IAAI,CAAS,CAAC,sBAAsB;IACpC,uBAAuB,CAAU;IACjC,gBAAgB,CAAS,CAAC,iCAAiC;IAC3D,GAAG,CAAiB;IAEpB,YAAY,SAAiB,EAAE,cAAsB,EAAE,QAAwB,EAAE,eAAwB;QACvG,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,uBAAuB,GAAG,eAAe,CAAC;QAC/C,IAAI,CAAC,gBAAgB,GAAG,cAAc,CAAC;QACvC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;IACtB,CAAC;CACF;AAZD,wCAYC;AAED,uCAAuC;AACvC,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AA8B;IAC9B,WAAW,CAAC,QAA0B;QACpC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6EAA6E;IAC7E,QAAQ;QACN,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,0BAA0B,EAAE,IAAI,CAAC,0BAA0B;YAC3D,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC;IACJ,CAAC;CACF;AA5DD,4CA4DC","sourcesContent":["import { DynamoIndexMap, EndpointPolicy, TraceChange } from \"@chinggis/core\";\n\n/** Generic DynamoDB Configuration */\nexport class DynamoDBConfig {\n NAME: string; // DynamoDB table name\n OWNER_PARENT_FIELD_NAME?: string;\n OWNER_FIELD_NAME: string; // DynamoDB index map for queries\n MAP: DynamoIndexMap;\n\n constructor(tableName: string, ownerFieldName: string, indexMap: DynamoIndexMap, parentFieldName?: string) {\n this.NAME = tableName;\n this.OWNER_PARENT_FIELD_NAME = parentFieldName;\n this.OWNER_FIELD_NAME = ownerFieldName;\n this.MAP = indexMap;\n }\n}\n\n/** Generic OpenSearch Configuration */\nexport class OpenSearchConfig {\n DOMAIN: string;\n INDEX: string;\n\n constructor(domain: string, indexName: string) {\n this.DOMAIN = domain;\n this.INDEX = indexName;\n }\n}\n\n/** Configuration interface for type safety */\nexport interface EntityConfig {\n BASE_PATH: string;\n DYNAMO_DB: DynamoDBConfig;\n OPEN_SEARCH: OpenSearchConfig;\n ENDPOINT_POLICY: EndpointPolicy[];\n ADMIN_GROUP_NAME: string[];\n OWNER_PARENT_ID_FIELD_NAME?: string;\n OWNER_ID_FIELD_NAME?: string;\n TRACE_CHANGE?: TraceChange;\n}\n\n/** Generic Entity Configuration Class **/\nexport class EntityConfigImpl implements EntityConfig {\n BASE_PATH: string; //Entity name for logging and debugging\n DYNAMO_DB: DynamoDBConfig; // DynamoDB configuration\n OPEN_SEARCH: OpenSearchConfig; // OpenSearch configuration\n ENDPOINT_POLICY: EndpointPolicy[]; // Path-based permission configuration\n ADMIN_GROUP_NAME: string[]; // Admin group name for Cognito\n\n TRACE_CHANGE?: TraceChange;\n\n OWNER_PARENT_ID_FIELD_NAME?: string;\n OWNER_ID_FIELD_NAME: string;\n\n constructor(basePath: string, adminGroupName?: string[]) {\n this.BASE_PATH = basePath;\n this.ADMIN_GROUP_NAME = adminGroupName || [\"admin\"];\n this.ENDPOINT_POLICY = [];\n }\n\n setTraceChange(traceChange: TraceChange): void {\n this.TRACE_CHANGE = traceChange;\n }\n\n /** Set DynamoDB configuration */\n setDynamoDB(\n tableName: string,\n ownerFieldName: string,\n indexMap: DynamoIndexMap,\n ownerParentFieldName?: string,\n ): this {\n this.DYNAMO_DB = new DynamoDBConfig(tableName, ownerFieldName, indexMap, ownerParentFieldName);\n this.OWNER_PARENT_ID_FIELD_NAME = ownerParentFieldName;\n this.OWNER_ID_FIELD_NAME = ownerFieldName;\n return this;\n }\n\n /** Set OpenSearch configuration */\n setOpenSearch(domain: string, index: string): this {\n this.OPEN_SEARCH = new OpenSearchConfig(domain, index);\n return this;\n }\n\n /** Set path-based policies */\n setPolicies(policies: EndpointPolicy[]): this {\n this.ENDPOINT_POLICY = policies;\n return this;\n }\n\n /** Get configuration as a plain object (for BaseController compatibility) */\n toObject(): EntityConfig {\n return {\n BASE_PATH: this.BASE_PATH,\n DYNAMO_DB: this.DYNAMO_DB,\n OPEN_SEARCH: this.OPEN_SEARCH,\n ENDPOINT_POLICY: this.ENDPOINT_POLICY,\n TRACE_CHANGE: this.TRACE_CHANGE,\n ADMIN_GROUP_NAME: this.ADMIN_GROUP_NAME,\n OWNER_PARENT_ID_FIELD_NAME: this.OWNER_PARENT_ID_FIELD_NAME,\n OWNER_ID_FIELD_NAME: this.OWNER_ID_FIELD_NAME,\n };\n }\n}\n"]}
@@ -45,22 +45,3 @@ export declare enum InclusionMode {
45
45
  INCLUDE = "include",
46
46
  EXCLUDE = "exclude"
47
47
  }
48
- export interface RolePermission {
49
- role: string;
50
- permissions: string[];
51
- }
52
- /**
53
- * Map of scope name → { filterField, claimKey }.
54
- * Key is scope name (e.g. "branch", "agent", "org").
55
- *
56
- * Usage:
57
- * new ScopeMap()
58
- * .set("branch", { filterField: "branchId", claimKey: "custom:branch" })
59
- * .set("agent", { filterField: "agentId", claimKey: "custom:agent" })
60
- * .set("org", { filterField: "orgId", claimKey: "custom:org" })
61
- */
62
- export declare class ScopeMap extends Map<string, {
63
- filterField: string;
64
- claimKey?: string;
65
- }> {
66
- }
@@ -1,22 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScopeMap = exports.InclusionMode = void 0;
3
+ exports.InclusionMode = void 0;
4
4
  var InclusionMode;
5
5
  (function (InclusionMode) {
6
6
  InclusionMode["INCLUDE"] = "include";
7
7
  InclusionMode["EXCLUDE"] = "exclude";
8
8
  })(InclusionMode || (exports.InclusionMode = InclusionMode = {}));
9
- /**
10
- * Map of scope name → { filterField, claimKey }.
11
- * Key is scope name (e.g. "branch", "agent", "org").
12
- *
13
- * Usage:
14
- * new ScopeMap()
15
- * .set("branch", { filterField: "branchId", claimKey: "custom:branch" })
16
- * .set("agent", { filterField: "agentId", claimKey: "custom:agent" })
17
- * .set("org", { filterField: "orgId", claimKey: "custom:org" })
18
- */
19
- class ScopeMap extends Map {
20
- }
21
- exports.ScopeMap = ScopeMap;
22
9
  //# sourceMappingURL=base.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.model.js","sourceRoot":"","sources":["../../src/model/base.model.ts"],"names":[],"mappings":";;;AAwDA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAOD;;;;;;;;;GASG;AACH,MAAa,QAAS,SAAQ,GAAuD;CAAG;AAAxF,4BAAwF","sourcesContent":["import { RequestType } from \"./validation.model\";\nimport { Action } from \"./http.model\";\n\nexport interface BaseEntity {\n id?: string;\n createdAt?: string;\n updatedAt?: string;\n\n createdBy?: any;\n updatedBy?: any;\n\n ownerId?: string;\n ownerParentId?: string;\n\n permission?: Map<string, Permission[]>;\n\n history?: ChangeHistory[];\n\n year?: string;\n yearMonth?: string;\n}\n\nexport interface ChangedField {\n fieldName: string;\n oldValue: string;\n newValue: string;\n}\n\nexport interface ChangeHistory {\n action: string;\n user: string;\n date: string;\n changes?: ChangedField[];\n}\n\nexport interface Permission {\n role: RequestType;\n actions: Action[];\n}\n\nexport interface Attachment {\n thumbnail: string;\n original: string;\n}\n\nexport interface List<T> {\n items: Array<T>;\n total?: number;\n lastKey?: string;\n}\n\nexport interface TraceChange {\n fields: string[];\n mode: InclusionMode;\n}\n\nexport enum InclusionMode {\n INCLUDE = \"include\",\n EXCLUDE = \"exclude\",\n}\n\nexport interface RolePermission {\n role: string;\n permissions: string[];\n}\n\n/**\n * Map of scope name → { filterField, claimKey }.\n * Key is scope name (e.g. \"branch\", \"agent\", \"org\").\n *\n * Usage:\n * new ScopeMap()\n * .set(\"branch\", { filterField: \"branchId\", claimKey: \"custom:branch\" })\n * .set(\"agent\", { filterField: \"agentId\", claimKey: \"custom:agent\" })\n * .set(\"org\", { filterField: \"orgId\", claimKey: \"custom:org\" })\n */\nexport class ScopeMap extends Map<string, { filterField: string; claimKey?: string }> {}\n"]}
1
+ {"version":3,"file":"base.model.js","sourceRoot":"","sources":["../../src/model/base.model.ts"],"names":[],"mappings":";;;AAwDA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB","sourcesContent":["import { RequestType } from \"./validation.model\";\nimport { Action } from \"./http.model\";\n\nexport interface BaseEntity {\n id?: string;\n createdAt?: string;\n updatedAt?: string;\n\n createdBy?: any;\n updatedBy?: any;\n\n ownerId?: string;\n ownerParentId?: string;\n\n permission?: Map<string, Permission[]>;\n\n history?: ChangeHistory[];\n\n year?: string;\n yearMonth?: string;\n}\n\nexport interface ChangedField {\n fieldName: string;\n oldValue: string;\n newValue: string;\n}\n\nexport interface ChangeHistory {\n action: string;\n user: string;\n date: string;\n changes?: ChangedField[];\n}\n\nexport interface Permission {\n role: RequestType;\n actions: Action[];\n}\n\nexport interface Attachment {\n thumbnail: string;\n original: string;\n}\n\nexport interface List<T> {\n items: Array<T>;\n total?: number;\n lastKey?: string;\n}\n\nexport interface TraceChange {\n fields: string[];\n mode: InclusionMode;\n}\n\nexport enum InclusionMode {\n INCLUDE = \"include\",\n EXCLUDE = \"exclude\",\n}\n"]}
@@ -5,4 +5,3 @@ export * from "./filter.model";
5
5
  export * from "./validation.model";
6
6
  export * from "./dynamodb.model";
7
7
  export * from "./base.config";
8
- export { Permission as RolePermission } from "./role.model";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,+CAA6B;AAC7B,+CAA6B;AAC7B,iDAA+B;AAC/B,qDAAmC;AACnC,mDAAiC;AACjC,gDAA8B","sourcesContent":["export * from \"./cognito-user.model\";\nexport * from \"./http.model\";\nexport * from \"./base.model\";\nexport * from \"./filter.model\";\nexport * from \"./validation.model\";\nexport * from \"./dynamodb.model\";\nexport * from \"./base.config\";\nexport { Permission as RolePermission } from \"./role.model\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,+CAA6B;AAC7B,+CAA6B;AAC7B,iDAA+B;AAC/B,qDAAmC;AACnC,mDAAiC;AACjC,gDAA8B","sourcesContent":["export * from \"./cognito-user.model\";\nexport * from \"./http.model\";\nexport * from \"./base.model\";\nexport * from \"./filter.model\";\nexport * from \"./validation.model\";\nexport * from \"./dynamodb.model\";\nexport * from \"./base.config\";\n"]}
@@ -7,7 +7,7 @@ export interface ResponseFields {
7
7
  export interface EndpointPolicy {
8
8
  method: HttpMethod;
9
9
  path: string;
10
- access?: Access[];
10
+ access: Access[];
11
11
  validator?: any;
12
12
  response?: ResponseFields;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validation.model.js","sourceRoot":"","sources":["../../src/model/validation.model.ts"],"names":[],"mappings":";;;AAgBA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,MAMX;AAND,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EANW,MAAM,sBAAN,MAAM,QAMjB","sourcesContent":["import { HttpMethod } from \"@chinggis/core\";\n\nexport interface ResponseFields {\n include?: string[];\n exclude?: string[];\n}\n\n/** Path-based permission definition */\nexport interface EndpointPolicy {\n method: HttpMethod;\n path: string;\n access?: Access[];\n validator?: any;\n response?: ResponseFields;\n}\n\nexport enum RequestType {\n GUEST = \"guest\",\n USER = \"user\",\n ADMIN = \"admin\",\n SYSTEM = \"system\",\n}\n\nexport enum Access {\n PUBLIC = \"public\",\n USER = \"user\",\n OWNER = \"owner\",\n ADMIN = \"admin\",\n SYSTEM = \"system\",\n}\n"]}
1
+ {"version":3,"file":"validation.model.js","sourceRoot":"","sources":["../../src/model/validation.model.ts"],"names":[],"mappings":";;;AAgBA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,MAMX;AAND,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,uBAAa,CAAA;IACb,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EANW,MAAM,sBAAN,MAAM,QAMjB","sourcesContent":["import { HttpMethod } from \"@chinggis/core\";\n\nexport interface ResponseFields {\n include?: string[];\n exclude?: string[];\n}\n\n/** Path-based permission definition */\nexport interface EndpointPolicy {\n method: HttpMethod;\n path: string;\n access: Access[];\n validator?: any;\n response?: ResponseFields;\n}\n\nexport enum RequestType {\n GUEST = \"guest\",\n USER = \"user\",\n ADMIN = \"admin\",\n SYSTEM = \"system\",\n}\n\nexport enum Access {\n PUBLIC = \"public\",\n USER = \"user\",\n OWNER = \"owner\",\n ADMIN = \"admin\",\n SYSTEM = \"system\",\n}\n"]}
@@ -7,6 +7,3 @@ export * from "./crud.service";
7
7
  export * from "./crud.service.interface";
8
8
  export * from "./stream.service";
9
9
  export * from "./stream.service.interface";
10
- export * from "./permission.cache";
11
- export * from "./permission.repo";
12
- export * from "./permission.service";
@@ -23,7 +23,4 @@ __exportStar(require("./crud.service"), exports);
23
23
  __exportStar(require("./crud.service.interface"), exports);
24
24
  __exportStar(require("./stream.service"), exports);
25
25
  __exportStar(require("./stream.service.interface"), exports);
26
- __exportStar(require("./permission.cache"), exports);
27
- __exportStar(require("./permission.repo"), exports);
28
- __exportStar(require("./permission.service"), exports);
29
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,iDAA+B;AAC/B,2DAAyC;AACzC,mDAAiC;AACjC,6DAA2C;AAC3C,iDAA+B;AAC/B,2DAAyC;AACzC,mDAAiC;AACjC,6DAA2C;AAC3C,qDAAmC;AACnC,oDAAkC;AAClC,uDAAqC","sourcesContent":["export * from \"./api.services\";\nexport * from \"./base.service\";\nexport * from \"./base.service.interface\";\nexport * from \"./socket.service\";\nexport * from \"./socket.service.interface\";\nexport * from \"./crud.service\";\nexport * from \"./crud.service.interface\";\nexport * from \"./stream.service\";\nexport * from \"./stream.service.interface\";\nexport * from \"./permission.cache\";\nexport * from \"./permission.repo\";\nexport * from \"./permission.service\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,iDAA+B;AAC/B,2DAAyC;AACzC,mDAAiC;AACjC,6DAA2C;AAC3C,iDAA+B;AAC/B,2DAAyC;AACzC,mDAAiC;AACjC,6DAA2C","sourcesContent":["export * from \"./api.services\";\nexport * from \"./base.service\";\nexport * from \"./base.service.interface\";\nexport * from \"./socket.service\";\nexport * from \"./socket.service.interface\";\nexport * from \"./crud.service\";\nexport * from \"./crud.service.interface\";\nexport * from \"./stream.service\";\nexport * from \"./stream.service.interface\";\n"]}
@@ -0,0 +1,20 @@
1
+ import { z, ZodType } from "zod";
2
+ type InvalidConfig = boolean | string[];
3
+ /**
4
+ * EntityBuilder generates mock objects from a Zod schema.
5
+ * - Can produce fully valid objects
6
+ * - Can produce random invalid objects (at least one field invalid)
7
+ * - Can produce targeted invalid objects (specific fields)
8
+ * - Arrays are autofilled with multiple elements if `arrayLength` > 1
9
+ */
10
+ export declare class EntityBuilder<T extends ZodType<any, any, any>> {
11
+ private readonly schema;
12
+ private readonly invalid;
13
+ private readonly arrayLength;
14
+ private seed;
15
+ constructor(schema: T, invalid?: InvalidConfig, arrayLength?: number);
16
+ build(): z.infer<T>;
17
+ private buildFromZod;
18
+ private shouldInvalidate;
19
+ }
20
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntityBuilder = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * EntityBuilder generates mock objects from a Zod schema.
7
+ * - Can produce fully valid objects
8
+ * - Can produce random invalid objects (at least one field invalid)
9
+ * - Can produce targeted invalid objects (specific fields)
10
+ * - Arrays are autofilled with multiple elements if `arrayLength` > 1
11
+ */
12
+ class EntityBuilder {
13
+ schema;
14
+ invalid;
15
+ arrayLength;
16
+ seed = 1;
17
+ constructor(schema, invalid = true, arrayLength = 1) {
18
+ this.schema = schema;
19
+ this.invalid = invalid;
20
+ this.arrayLength = arrayLength;
21
+ }
22
+ build() {
23
+ return this.buildFromZod(this.schema, this.invalid);
24
+ }
25
+ buildFromZod(schema, invalidConfig, path = []) {
26
+ // Optional / Nullable unwrap
27
+ if (schema instanceof zod_1.ZodOptional || schema instanceof zod_1.ZodNullable) {
28
+ const inner = schema._def.innerType;
29
+ return this.buildFromZod(inner, invalidConfig, path);
30
+ }
31
+ if (schema instanceof zod_1.ZodString) {
32
+ return this.shouldInvalidate(path, invalidConfig) ? "INVALID" : `valid_${path.join("_")}`;
33
+ }
34
+ if (schema instanceof zod_1.ZodNumber) {
35
+ return this.shouldInvalidate(path, invalidConfig) ? -1 : 1;
36
+ }
37
+ if (schema instanceof zod_1.ZodBoolean) {
38
+ return !this.shouldInvalidate(path, invalidConfig);
39
+ }
40
+ if (schema instanceof zod_1.ZodArray) {
41
+ const elementSchema = schema.element;
42
+ const arr = [];
43
+ for (let i = 0; i < this.arrayLength; i++) {
44
+ arr.push(this.buildFromZod(elementSchema, invalidConfig, path.concat([String(i)])));
45
+ }
46
+ return arr;
47
+ }
48
+ if (schema instanceof zod_1.ZodObject) {
49
+ const obj = {};
50
+ const shape = schema.shape;
51
+ for (const key in shape) {
52
+ obj[key] = this.buildFromZod(shape[key], invalidConfig, path.concat([key]));
53
+ }
54
+ return obj;
55
+ }
56
+ // fallback for unsupported types
57
+ return null;
58
+ }
59
+ shouldInvalidate(path, invalidConfig) {
60
+ if (invalidConfig === false) {
61
+ // random invalid
62
+ const x = Math.sin(this.seed++) * 10000;
63
+ return x - Math.floor(x) > 0.5;
64
+ }
65
+ if (Array.isArray(invalidConfig)) {
66
+ // targeted invalid
67
+ return invalidConfig.includes(path.join("."));
68
+ }
69
+ return false; // valid by default
70
+ }
71
+ }
72
+ exports.EntityBuilder = EntityBuilder;
73
+ //# sourceMappingURL=data.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.util.js","sourceRoot":"","sources":["../../src/utils/data.util.ts"],"names":[],"mappings":";;;AAAA,6BAAkH;AAIlH;;;;;;GAMG;AACH,MAAa,aAAa;IAIL;IACA;IACA;IALX,IAAI,GAAG,CAAC,CAAC;IAEjB,YACmB,MAAS,EACT,UAAyB,IAAI,EAC7B,cAAsB,CAAC;QAFvB,WAAM,GAAN,MAAM,CAAG;QACT,YAAO,GAAP,OAAO,CAAsB;QAC7B,gBAAW,GAAX,WAAW,CAAY;IACvC,CAAC;IAEJ,KAAK;QACH,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAe,CAAC;IACpE,CAAC;IAEO,YAAY,CAAC,MAA8B,EAAE,aAA4B,EAAE,OAAiB,EAAE;QACpG,6BAA6B;QAC7B,IAAI,MAAM,YAAY,iBAAW,IAAI,MAAM,YAAY,iBAAW,EAAE,CAAC;YACnE,MAAM,KAAK,GAAI,MAAc,CAAC,IAAI,CAAC,SAAmC,CAAC;YACvE,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,MAAM,YAAY,eAAS,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5F,CAAC;QAED,IAAI,MAAM,YAAY,eAAS,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AC;YAC5B,iBAAiB;YACjB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC;YACxC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACjC,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACjC,mBAAmB;YACnB,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC,CAAC,mBAAmB;IACnC,CAAC;CACF;AAlED,sCAkEC","sourcesContent":["import { z, ZodArray, ZodBoolean, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodString, ZodType } from \"zod\";\n\ntype InvalidConfig = boolean | string[];\n\n/**\n * EntityBuilder generates mock objects from a Zod schema.\n * - Can produce fully valid objects\n * - Can produce random invalid objects (at least one field invalid)\n * - Can produce targeted invalid objects (specific fields)\n * - Arrays are autofilled with multiple elements if `arrayLength` > 1\n */\nexport class EntityBuilder<T extends ZodType<any, any, any>> {\n private seed = 1;\n\n constructor(\n private readonly schema: T,\n private readonly invalid: InvalidConfig = true,\n private readonly arrayLength: number = 1, // default number of elements in arrays\n ) {}\n\n build(): z.infer<T> {\n return this.buildFromZod(this.schema, this.invalid) as z.infer<T>;\n }\n\n private buildFromZod(schema: ZodType<any, any, any>, invalidConfig: InvalidConfig, path: string[] = []): any {\n // Optional / Nullable unwrap\n if (schema instanceof ZodOptional || schema instanceof ZodNullable) {\n const inner = (schema as any)._def.innerType as ZodType<any, any, any>;\n return this.buildFromZod(inner, invalidConfig, path);\n }\n\n if (schema instanceof ZodString) {\n return this.shouldInvalidate(path, invalidConfig) ? \"INVALID\" : `valid_${path.join(\"_\")}`;\n }\n\n if (schema instanceof ZodNumber) {\n return this.shouldInvalidate(path, invalidConfig) ? -1 : 1;\n }\n\n if (schema instanceof ZodBoolean) {\n return !this.shouldInvalidate(path, invalidConfig);\n }\n\n if (schema instanceof ZodArray) {\n const elementSchema = (schema as ZodArray<any>).element as ZodType<any, any, any>;\n const arr = [];\n for (let i = 0; i < this.arrayLength; i++) {\n arr.push(this.buildFromZod(elementSchema, invalidConfig, path.concat([String(i)])));\n }\n return arr;\n }\n\n if (schema instanceof ZodObject) {\n const obj: any = {};\n const shape = (schema as ZodObject<any>).shape;\n for (const key in shape) {\n obj[key] = this.buildFromZod(shape[key], invalidConfig, path.concat([key]));\n }\n return obj;\n }\n\n // fallback for unsupported types\n return null;\n }\n\n private shouldInvalidate(path: string[], invalidConfig: InvalidConfig): boolean {\n if (invalidConfig === false) {\n // random invalid\n const x = Math.sin(this.seed++) * 10000;\n return x - Math.floor(x) > 0.5;\n }\n if (Array.isArray(invalidConfig)) {\n // targeted invalid\n return invalidConfig.includes(path.join(\".\"));\n }\n return false; // valid by default\n }\n}\n"]}
@@ -3,3 +3,16 @@ export declare function isValidDate(dateStr: string): boolean;
3
3
  export declare function isSameYearMonth(date1: string | Date | Dayjs, date2: string | Date | Dayjs): boolean;
4
4
  export declare function isCurrentMonth(date: string | Date | Dayjs): boolean;
5
5
  export declare function isFutureMonth(date: string): boolean;
6
+ export declare function addSecondToDate(date: string | Date | Dayjs): Dayjs;
7
+ /**
8
+ * Returns the oldest date string from a list of date strings.
9
+ * @param dateStrList List of date strings (ISO or other formats supported by dayjs).
10
+ * @returns The oldest date string, or an empty string if the list is empty.
11
+ */
12
+ export declare function minDateStr(dateStrList: any[]): string;
13
+ /**
14
+ * Returns the newest date string from a list of date strings.
15
+ * @param dateStrList List of date strings (ISO or other formats supported by dayjs).
16
+ * @returns The newest date string, or an empty string if the list is empty.
17
+ */
18
+ export declare function maxDateStr(dateStrList: any[]): string;
@@ -7,6 +7,9 @@ exports.isValidDate = isValidDate;
7
7
  exports.isSameYearMonth = isSameYearMonth;
8
8
  exports.isCurrentMonth = isCurrentMonth;
9
9
  exports.isFutureMonth = isFutureMonth;
10
+ exports.addSecondToDate = addSecondToDate;
11
+ exports.minDateStr = minDateStr;
12
+ exports.maxDateStr = maxDateStr;
10
13
  const dayjs_1 = __importDefault(require("dayjs"));
11
14
  function isValidDate(dateStr) {
12
15
  const d = new Date(dateStr);
@@ -31,4 +34,36 @@ function isFutureMonth(date) {
31
34
  // Compare year-month
32
35
  return inputYear > currentYear || (inputYear === currentYear && inputMonth > currentMonth);
33
36
  }
37
+ function addSecondToDate(date) {
38
+ return (0, dayjs_1.default)(date).add(1, "second");
39
+ }
40
+ /**
41
+ * Returns the oldest date string from a list of date strings.
42
+ * @param dateStrList List of date strings (ISO or other formats supported by dayjs).
43
+ * @returns The oldest date string, or an empty string if the list is empty.
44
+ */
45
+ function minDateStr(dateStrList) {
46
+ return minMaxDateStr(dateStrList, false);
47
+ }
48
+ /**
49
+ * Returns the newest date string from a list of date strings.
50
+ * @param dateStrList List of date strings (ISO or other formats supported by dayjs).
51
+ * @returns The newest date string, or an empty string if the list is empty.
52
+ */
53
+ function maxDateStr(dateStrList) {
54
+ return minMaxDateStr(dateStrList, true);
55
+ }
56
+ function minMaxDateStr(dateStrList, isMax) {
57
+ if (!dateStrList || dateStrList.length === 0)
58
+ return "";
59
+ const filtered = dateStrList.filter((d) => !!d);
60
+ if (filtered.length === 0)
61
+ return "";
62
+ return filtered.reduce((newestDate, current) => {
63
+ if (isMax)
64
+ return (0, dayjs_1.default)(current).isAfter((0, dayjs_1.default)(newestDate)) ? current : newestDate;
65
+ else
66
+ return (0, dayjs_1.default)(current).isBefore((0, dayjs_1.default)(newestDate)) ? newestDate : current;
67
+ });
68
+ }
34
69
  //# sourceMappingURL=date.util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.util.js","sourceRoot":"","sources":["../../src/utils/date.util.ts"],"names":[],"mappings":";;;;;AACA,kCAGC;AAED,0CAIC;AAED,wCAEC;AAED,sCAYC;AA5BD,kDAAqC;AACrC,SAAgB,WAAW,CAAC,OAAe;IACzC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,eAAe,CAAC,KAA4B,EAAE,KAA4B;IACxF,MAAM,EAAE,GAAG,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;IACxB,MAAM,EAAE,GAAG,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,cAAc,CAAC,IAA2B;IACxD,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY;IACxC,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IAEzB,yBAAyB;IACzB,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,oBAAoB;IAC7D,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACxC,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IAEtC,qBAAqB;IACrB,OAAO,SAAS,GAAG,WAAW,IAAI,CAAC,SAAS,KAAK,WAAW,IAAI,UAAU,GAAG,YAAY,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["import dayjs, { Dayjs } from \"dayjs\";\nexport function isValidDate(dateStr: string): boolean {\n const d = new Date(dateStr);\n return !Number.isNaN(d.getTime());\n}\n\nexport function isSameYearMonth(date1: string | Date | Dayjs, date2: string | Date | Dayjs): boolean {\n const d1 = dayjs(date1);\n const d2 = dayjs(date2);\n return d1.isSame(d2, \"month\") && d1.isSame(d2, \"year\");\n}\n\nexport function isCurrentMonth(date: string | Date | Dayjs): boolean {\n return isSameYearMonth(date, new Date());\n}\n\nexport function isFutureMonth(date: string): boolean {\n const inputDate = new Date(date);\n const today = new Date();\n\n // Extract year and month\n const inputYear = inputDate.getFullYear();\n const inputMonth = inputDate.getMonth(); // 0-based (0 = Jan)\n const currentYear = today.getFullYear();\n const currentMonth = today.getMonth();\n\n // Compare year-month\n return inputYear > currentYear || (inputYear === currentYear && inputMonth > currentMonth);\n}\n"]}
1
+ {"version":3,"file":"date.util.js","sourceRoot":"","sources":["../../src/utils/date.util.ts"],"names":[],"mappings":";;;;;AAEA,kCAGC;AAED,0CAIC;AAED,wCAEC;AAED,sCAYC;AAED,0CAEC;AAMD,gCAEC;AAOD,gCAEC;AAlDD,kDAAqC;AAErC,SAAgB,WAAW,CAAC,OAAe;IACzC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,eAAe,CAAC,KAA4B,EAAE,KAA4B;IACxF,MAAM,EAAE,GAAG,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;IACxB,MAAM,EAAE,GAAG,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,cAAc,CAAC,IAA2B;IACxD,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY;IACxC,MAAM,SAAS,GAAG,IAAI,IAAI,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EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAA,eAAK,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;;YAC9E,OAAO,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAA,eAAK,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import dayjs, { Dayjs } from \"dayjs\";\n\nexport function isValidDate(dateStr: string): boolean {\n const d = new Date(dateStr);\n return !Number.isNaN(d.getTime());\n}\n\nexport function isSameYearMonth(date1: string | Date | Dayjs, date2: string | Date | Dayjs): boolean {\n const d1 = dayjs(date1);\n const d2 = dayjs(date2);\n return d1.isSame(d2, \"month\") && d1.isSame(d2, \"year\");\n}\n\nexport function isCurrentMonth(date: string | Date | Dayjs): boolean {\n return isSameYearMonth(date, new Date());\n}\n\nexport function isFutureMonth(date: string): boolean {\n const inputDate = new Date(date);\n const today = new Date();\n\n // Extract year and month\n const inputYear = inputDate.getFullYear();\n const inputMonth = inputDate.getMonth(); // 0-based (0 = Jan)\n const currentYear = today.getFullYear();\n const currentMonth = today.getMonth();\n\n // Compare year-month\n return inputYear > currentYear || (inputYear === currentYear && inputMonth > currentMonth);\n}\n\nexport function addSecondToDate(date: string | Date | Dayjs): Dayjs {\n return dayjs(date).add(1, \"second\");\n}\n/**\n * Returns the oldest date string from a list of date strings.\n * @param dateStrList List of date strings (ISO or other formats supported by dayjs).\n * @returns The oldest date string, or an empty string if the list is empty.\n */\nexport function minDateStr(dateStrList: any[]): string {\n return minMaxDateStr(dateStrList, false);\n}\n\n/**\n * Returns the newest date string from a list of date strings.\n * @param dateStrList List of date strings (ISO or other formats supported by dayjs).\n * @returns The newest date string, or an empty string if the list is empty.\n */\nexport function maxDateStr(dateStrList: any[]): string {\n return minMaxDateStr(dateStrList, true);\n}\n\nfunction minMaxDateStr(dateStrList: any[], isMax: boolean): string {\n if (!dateStrList || dateStrList.length === 0) return \"\";\n\n const filtered = dateStrList.filter((d) => !!d);\n if (filtered.length === 0) return \"\";\n\n return filtered.reduce((newestDate, current) => {\n if (isMax) return dayjs(current).isAfter(dayjs(newestDate)) ? current : newestDate;\n else return dayjs(current).isBefore(dayjs(newestDate)) ? newestDate : current;\n });\n}\n"]}
@@ -12,4 +12,5 @@ export * from "./reflection.util";
12
12
  export * from "./validation.util";
13
13
  export * from "./opensearch/opensearch.parser";
14
14
  export * from "./opensearch/opensearch.transform";
15
+ export * from "./data.util";
15
16
  export * from "../function/logger";
@@ -28,5 +28,6 @@ __exportStar(require("./reflection.util"), exports);
28
28
  __exportStar(require("./validation.util"), exports);
29
29
  __exportStar(require("./opensearch/opensearch.parser"), exports);
30
30
  __exportStar(require("./opensearch/opensearch.transform"), exports);
31
+ __exportStar(require("./data.util"), exports);
31
32
  __exportStar(require("../function/logger"), exports);
32
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,sDAAoC;AACpC,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAClC,iEAA+C;AAC/C,oEAAkD;AAElD,qDAAmC","sourcesContent":["export * from \"./http/http.util\";\nexport * from \"./http/http-request\";\nexport * from \"./array.util\";\nexport * from \"./auth.util\";\nexport * from \"./date.util\";\nexport * from \"./dynamodb.utils\";\nexport * from \"./env.util\";\nexport * from \"./error.util\";\nexport * from \"./json.util\";\nexport * from \"./opensearch.utils\";\nexport * from \"./reflection.util\";\nexport * from \"./validation.util\";\nexport * from \"./opensearch/opensearch.parser\";\nexport * from \"./opensearch/opensearch.transform\";\n\nexport * from \"../function/logger\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,sDAAoC;AACpC,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,mDAAiC;AACjC,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,oDAAkC;AAClC,oDAAkC;AAClC,iEAA+C;AAC/C,oEAAkD;AAClD,8CAA4B;AAE5B,qDAAmC","sourcesContent":["export * from \"./http/http.util\";\nexport * from \"./http/http-request\";\nexport * from \"./array.util\";\nexport * from \"./auth.util\";\nexport * from \"./date.util\";\nexport * from \"./dynamodb.utils\";\nexport * from \"./env.util\";\nexport * from \"./error.util\";\nexport * from \"./json.util\";\nexport * from \"./opensearch.utils\";\nexport * from \"./reflection.util\";\nexport * from \"./validation.util\";\nexport * from \"./opensearch/opensearch.parser\";\nexport * from \"./opensearch/opensearch.transform\";\nexport * from \"./data.util\";\n\nexport * from \"../function/logger\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-service-stack",
3
- "version": "0.18.371",
3
+ "version": "0.18.372",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "chinggis.systems",
@@ -23,45 +23,45 @@
23
23
  "tslib": "^2.8.1"
24
24
  },
25
25
  "peerDependencies": {
26
- "@aws-sdk/client-api-gateway": "^3.907.0",
27
- "@aws-sdk/client-apigatewaymanagementapi": "^3.907.0",
28
- "@aws-sdk/client-cognito-identity-provider": "^3.907.0",
29
- "@aws-sdk/client-dynamodb": "^3.907.0",
30
- "@aws-sdk/client-lambda": "^3.907.0",
31
- "@aws-sdk/client-pinpoint": "^3.907.0",
32
- "@aws-sdk/client-secrets-manager": "^3.907.0",
33
- "@aws-sdk/client-sqs": "^3.907.0",
34
- "@aws-sdk/credential-provider-node": "^3.907.0",
35
- "@aws-sdk/lib-dynamodb": "^3.907.0",
36
- "@aws-sdk/s3-request-presigner": "^3.907.0",
37
- "@aws-sdk/util-dynamodb": "^3.907.0",
26
+ "@aws-sdk/client-api-gateway": "^3.999.0",
27
+ "@aws-sdk/client-apigatewaymanagementapi": "^3.999.0",
28
+ "@aws-sdk/client-cognito-identity-provider": "^3.999.0",
29
+ "@aws-sdk/client-dynamodb": "^3.999.0",
30
+ "@aws-sdk/client-lambda": "^3.999.0",
31
+ "@aws-sdk/client-pinpoint": "^3.999.0",
32
+ "@aws-sdk/client-secrets-manager": "^3.999.0",
33
+ "@aws-sdk/client-sqs": "^3.999.0",
34
+ "@aws-sdk/credential-provider-node": "^3.972.14",
35
+ "@aws-sdk/lib-dynamodb": "^3.999.0",
36
+ "@aws-sdk/s3-request-presigner": "^3.999.0",
37
+ "@aws-sdk/util-dynamodb": "^3.996.1",
38
38
  "@opensearch-project/opensearch": "^3.5.1",
39
- "axios": "^1.12.2",
40
- "dayjs": "^1.11.10",
41
- "elastic-builder": "^3.4.0",
39
+ "axios": "^1.13.5",
40
+ "dayjs": "^1.11.19",
41
+ "elastic-builder": "^4.1.0",
42
42
  "lodash.truncate": "^4.4.2",
43
- "nodemailer": "^6.9.11",
43
+ "nodemailer": "^8.0.1",
44
44
  "numeral": "^2.0.6",
45
45
  "typedi": "0.10.0",
46
46
  "yup": "^1.7.1",
47
- "zod": "^4.1.12"
47
+ "zod": "^4.3.6"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/aws-lambda": "^8.10.149",
51
- "@types/jest": "^29.5.14",
52
- "eslint": "^8.56.0",
53
- "@typescript-eslint/eslint-plugin": "^6.19.1",
54
- "@typescript-eslint/parser": "^6.19.1",
55
- "jest": "^29.7.0",
50
+ "@types/aws-lambda": "^8.10.161",
51
+ "@types/jest": "^30.0.0",
52
+ "eslint": "^10.0.2",
53
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
54
+ "@typescript-eslint/parser": "^8.56.1",
55
+ "jest": "^30.2.0",
56
56
  "jest-transform-stub": "^2.0.0",
57
- "jsonc-eslint-parser": "^2.4.0",
58
- "serverless-offline": "^14.4.0",
57
+ "jsonc-eslint-parser": "^3.1.0",
58
+ "serverless-offline": "^14.5.0",
59
59
  "serverless-stage-manager": "^1.0.5",
60
- "ts-jest": "^29.3.1",
60
+ "ts-jest": "^29.4.6",
61
61
  "ts-node": "^10.9.2",
62
- "tsc-alias": "^1.8.11",
63
- "typescript": "^5.8.3",
64
- "prettier": "^3.6.2",
65
- "typescript-transform-paths": "^3.5.3"
62
+ "tsc-alias": "^1.8.16",
63
+ "typescript": "^5.9.3",
64
+ "prettier": "^3.8.1",
65
+ "typescript-transform-paths": "^3.5.6"
66
66
  }
67
67
  }
@@ -1,4 +0,0 @@
1
- import "reflect-metadata";
2
- import { APIGatewayProxyEvent } from "aws-lambda";
3
- import "./property.controller";
4
- export declare const handler: (event: APIGatewayProxyEvent) => Promise<import("src/utils").APIResponse>;
@@ -1,58 +0,0 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23
- };
24
- var __importStar = (this && this.__importStar) || (function () {
25
- var ownKeys = function(o) {
26
- ownKeys = Object.getOwnPropertyNames || function (o) {
27
- var ar = [];
28
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
- return ar;
30
- };
31
- return ownKeys(o);
32
- };
33
- return function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- })();
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.handler = void 0;
43
- require("reflect-metadata");
44
- const typedi_1 = __importStar(require("typedi"));
45
- require("./property.controller");
46
- const handler = (event) => typedi_1.default.get(HelperCDI).process(event);
47
- exports.handler = handler;
48
- let HelperCDI = class HelperCDI {
49
- controller = typedi_1.default.get("PropertyController");
50
- async process(event) {
51
- console.log("example Processing...");
52
- return this.controller.resolveCrudRequest(event);
53
- }
54
- };
55
- HelperCDI = __decorate([
56
- (0, typedi_1.Service)()
57
- ], HelperCDI);
58
- //# sourceMappingURL=property-crud.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"property-crud.js","sourceRoot":"","sources":["../../../../src/_examples/controller/property/property-crud.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,iDAA4C;AAG5C,iCAA+B;AAExB,MAAM,OAAO,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,gBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAnF,QAAA,OAAO,WAA4E;AAGhG,IAAM,SAAS,GAAf,MAAM,SAAS;IACL,UAAU,GAAuB,gBAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAE7E,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AAPK,SAAS;IADd,IAAA,gBAAO,GAAE;GACJ,SAAS,CAOd","sourcesContent":["import \"reflect-metadata\";\nimport Container, { Service } from \"typedi\";\nimport { APIGatewayProxyEvent } from \"aws-lambda\";\nimport { PropertyController } from \"./property.controller\";\nimport \"./property.controller\";\n\nexport const handler = (event: APIGatewayProxyEvent) => Container.get(HelperCDI).process(event);\n\n@Service()\nclass HelperCDI {\n private controller: PropertyController = Container.get(\"PropertyController\");\n\n async process(event: APIGatewayProxyEvent) {\n console.log(\"example Processing...\");\n return this.controller.resolveCrudRequest(event);\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { EntityConfigImpl } from "../../../model/base.config";
2
- export declare const openSearch_order: {
3
- domain: string;
4
- index: string;
5
- };
6
- export declare const path = "/property";
7
- export declare class PropertyConfig extends EntityConfigImpl {
8
- constructor();
9
- }
10
- export declare const CONFIG_PROPERTY: PropertyConfig;