@webiny/api-core-ddb 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e

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 (45) hide show
  1. package/ApiCoreDdbFeature.d.ts +12 -0
  2. package/ApiCoreDdbFeature.js +16 -0
  3. package/ApiCoreDdbFeature.js.map +1 -0
  4. package/adminUsers/definitions/entities.js +5 -6
  5. package/adminUsers/definitions/entities.js.map +1 -1
  6. package/adminUsers/definitions/types.js +0 -3
  7. package/adminUsers/index.js +135 -156
  8. package/adminUsers/index.js.map +1 -1
  9. package/adminUsers/types.js +5 -4
  10. package/adminUsers/types.js.map +1 -1
  11. package/createApiCoreDdb.js +23 -21
  12. package/createApiCoreDdb.js.map +1 -1
  13. package/index.d.ts +3 -0
  14. package/index.js +2 -2
  15. package/keyValueStore/KeyValueStoreDynamoTable.js +24 -25
  16. package/keyValueStore/KeyValueStoreDynamoTable.js.map +1 -1
  17. package/keyValueStore/KeyValueStoreStorageOperations.d.ts +2 -2
  18. package/keyValueStore/KeyValueStoreStorageOperations.js +74 -75
  19. package/keyValueStore/KeyValueStoreStorageOperations.js.map +1 -1
  20. package/keyValueStore/index.js +2 -3
  21. package/keyValueStore/index.js.map +1 -1
  22. package/package.json +15 -13
  23. package/security/definitions/entities.js +19 -24
  24. package/security/definitions/entities.js.map +1 -1
  25. package/security/definitions/types.js +0 -3
  26. package/security/index.js +389 -464
  27. package/security/index.js.map +1 -1
  28. package/security/types.js +6 -5
  29. package/security/types.js.map +1 -1
  30. package/serviceDiscovery/DdbServiceManifestLoader.d.ts +7 -0
  31. package/serviceDiscovery/DdbServiceManifestLoader.js +27 -0
  32. package/serviceDiscovery/DdbServiceManifestLoader.js.map +1 -0
  33. package/serviceDiscovery/index.d.ts +1 -0
  34. package/serviceDiscovery/index.js +1 -0
  35. package/tenancy/definitions/tenantEntity.js +5 -9
  36. package/tenancy/definitions/tenantEntity.js.map +1 -1
  37. package/tenancy/definitions/types.js +0 -3
  38. package/tenancy/index.js +107 -127
  39. package/tenancy/index.js.map +1 -1
  40. package/tenancy/types.js +4 -3
  41. package/tenancy/types.js.map +1 -1
  42. package/adminUsers/definitions/types.js.map +0 -1
  43. package/index.js.map +0 -1
  44. package/security/definitions/types.js.map +0 -1
  45. package/tenancy/definitions/types.js.map +0 -1
@@ -1,86 +1,85 @@
1
1
  import { WebinyError } from "@webiny/error";
2
2
  import { KeyValueStoreDynamoTable } from "./KeyValueStoreDynamoTable.js";
3
- export class KeyValueStoreStorageOperations {
4
- constructor(dynamoDbClient) {
5
- this.table = new KeyValueStoreDynamoTable(dynamoDbClient);
6
- this.entity = this.table.getEntity();
7
- }
8
- createScopedKey(key, scope) {
9
- return `${scope}:${key}`;
10
- }
11
- async get(key, scope) {
12
- try {
13
- const scopedKey = this.createScopedKey(key, scope);
14
- const entry = await this.entity.get(this.table.createKeys({
15
- scopedKey
16
- }));
17
- if (!entry) {
18
- return null;
19
- }
20
- const ttl = Number(entry.expiresAt);
21
- if (ttl && ttl <= Math.floor(Date.now() / 1000)) {
22
- return null;
23
- }
24
- return {
25
- key,
26
- value: entry.data.value,
27
- scope: entry.data.scope
28
- };
29
- } catch (err) {
30
- throw WebinyError.from(err, {
31
- message: "Could not get key-value record.",
32
- code: "GET_KEY_VALUE_ERROR",
33
- data: {
34
- key,
35
- scope
36
- }
37
- });
3
+ class KeyValueStoreStorageOperations {
4
+ constructor(dynamoDbClient){
5
+ this.table = new KeyValueStoreDynamoTable(dynamoDbClient);
6
+ this.entity = this.table.getEntity();
7
+ }
8
+ createScopedKey(key, scope) {
9
+ return `${scope}:${key}`;
38
10
  }
39
- }
40
- async set(key, value, scope, options) {
41
- try {
42
- const scopedKey = this.createScopedKey(key, scope);
43
- const keys = this.table.createKeys({
44
- scopedKey
45
- });
46
- await this.entity.put({
47
- ...keys,
48
- TYPE: "KeyValueStore",
49
- expiresAt: options?.expiresAt ? Math.floor(options.expiresAt.getTime() / 1000) : undefined,
50
- data: {
51
- key,
52
- value,
53
- scope
11
+ async get(key, scope, options) {
12
+ try {
13
+ const scopedKey = this.createScopedKey(key, scope);
14
+ const entry = await this.entity.get(this.table.createKeys({
15
+ scopedKey
16
+ }), {
17
+ consistent: options?.consistent
18
+ });
19
+ if (!entry) return null;
20
+ const ttl = Number(entry.expiresAt);
21
+ if (ttl && ttl <= Math.floor(Date.now() / 1000)) return null;
22
+ return {
23
+ key,
24
+ value: entry.data.value,
25
+ scope: entry.data.scope
26
+ };
27
+ } catch (err) {
28
+ throw WebinyError.from(err, {
29
+ message: "Could not get key-value record.",
30
+ code: "GET_KEY_VALUE_ERROR",
31
+ data: {
32
+ key,
33
+ scope
34
+ }
35
+ });
54
36
  }
55
- });
56
- } catch (err) {
57
- throw WebinyError.from(err, {
58
- message: "Could not set key-value record.",
59
- code: "SET_KEY_VALUE_ERROR",
60
- data: {
61
- key,
62
- scope
37
+ }
38
+ async set(key, value, scope, options) {
39
+ try {
40
+ const scopedKey = this.createScopedKey(key, scope);
41
+ const keys = this.table.createKeys({
42
+ scopedKey
43
+ });
44
+ await this.entity.put({
45
+ ...keys,
46
+ TYPE: "KeyValueStore",
47
+ expiresAt: options?.expiresAt ? Math.floor(options.expiresAt.getTime() / 1000) : void 0,
48
+ data: {
49
+ key,
50
+ value,
51
+ scope
52
+ }
53
+ });
54
+ } catch (err) {
55
+ throw WebinyError.from(err, {
56
+ message: "Could not set key-value record.",
57
+ code: "SET_KEY_VALUE_ERROR",
58
+ data: {
59
+ key,
60
+ scope
61
+ }
62
+ });
63
63
  }
64
- });
65
64
  }
66
- }
67
- async delete(key, scope) {
68
- try {
69
- const scopedKey = this.createScopedKey(key, scope);
70
- await this.entity.delete(this.table.createKeys({
71
- scopedKey
72
- }));
73
- } catch (err) {
74
- throw WebinyError.from(err, {
75
- message: "Could not delete key-value record.",
76
- code: "DELETE_KEY_VALUE_ERROR",
77
- data: {
78
- key,
79
- scope
65
+ async delete(key, scope) {
66
+ try {
67
+ const scopedKey = this.createScopedKey(key, scope);
68
+ await this.entity.delete(this.table.createKeys({
69
+ scopedKey
70
+ }));
71
+ } catch (err) {
72
+ throw WebinyError.from(err, {
73
+ message: "Could not delete key-value record.",
74
+ code: "DELETE_KEY_VALUE_ERROR",
75
+ data: {
76
+ key,
77
+ scope
78
+ }
79
+ });
80
80
  }
81
- });
82
81
  }
83
- }
84
82
  }
83
+ export { KeyValueStoreStorageOperations };
85
84
 
86
85
  //# sourceMappingURL=KeyValueStoreStorageOperations.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","KeyValueStoreDynamoTable","KeyValueStoreStorageOperations","constructor","dynamoDbClient","table","entity","getEntity","createScopedKey","key","scope","get","scopedKey","entry","createKeys","ttl","Number","expiresAt","Math","floor","Date","now","value","data","err","from","message","code","set","options","keys","put","TYPE","getTime","undefined","delete"],"sources":["KeyValueStoreStorageOperations.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { WebinyError } from \"@webiny/error\";\nimport type { IKeyValueStoreSetOptions } from \"@webiny/api-core/features/keyValueStore/abstractions.js\";\nimport { KeyValueStoreDynamoTable } from \"./KeyValueStoreDynamoTable.js\";\n\ninterface KeyValueRecord {\n key: string;\n value: any;\n scope: string;\n}\n\nexport class KeyValueStoreStorageOperations {\n private readonly table;\n private readonly entity;\n\n constructor(dynamoDbClient: DynamoDBDocument) {\n this.table = new KeyValueStoreDynamoTable<KeyValueRecord>(dynamoDbClient);\n this.entity = this.table.getEntity();\n }\n\n private createScopedKey(key: string, scope: string): string {\n return `${scope}:${key}`;\n }\n\n async get(key: string, scope: string): Promise<KeyValueRecord | null> {\n try {\n const scopedKey = this.createScopedKey(key, scope);\n const entry = await this.entity.get(this.table.createKeys({ scopedKey }));\n\n if (!entry) {\n return null;\n }\n\n const ttl = Number(entry.expiresAt);\n if (ttl && ttl <= Math.floor(Date.now() / 1000)) {\n return null;\n }\n\n return {\n key,\n value: entry.data.value,\n scope: entry.data.scope\n };\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not get key-value record.\",\n code: \"GET_KEY_VALUE_ERROR\",\n data: { key, scope }\n });\n }\n }\n\n async set(\n key: string,\n value: any,\n scope: string,\n options?: IKeyValueStoreSetOptions\n ): Promise<void> {\n try {\n const scopedKey = this.createScopedKey(key, scope);\n const keys = this.table.createKeys({ scopedKey });\n\n await this.entity.put({\n ...keys,\n TYPE: \"KeyValueStore\",\n expiresAt: options?.expiresAt\n ? Math.floor(options.expiresAt.getTime() / 1000)\n : undefined,\n data: {\n key,\n value,\n scope\n }\n });\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not set key-value record.\",\n code: \"SET_KEY_VALUE_ERROR\",\n data: { key, scope }\n });\n }\n }\n\n async delete(key: string, scope: string): Promise<void> {\n try {\n const scopedKey = this.createScopedKey(key, scope);\n await this.entity.delete(this.table.createKeys({ scopedKey }));\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not delete key-value record.\",\n code: \"DELETE_KEY_VALUE_ERROR\",\n data: { key, scope }\n });\n }\n }\n}\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,eAAe;AAE3C,SAASC,wBAAwB;AAQjC,OAAO,MAAMC,8BAA8B,CAAC;EAIxCC,WAAWA,CAACC,cAAgC,EAAE;IAC1C,IAAI,CAACC,KAAK,GAAG,IAAIJ,wBAAwB,CAAiBG,cAAc,CAAC;IACzE,IAAI,CAACE,MAAM,GAAG,IAAI,CAACD,KAAK,CAACE,SAAS,CAAC,CAAC;EACxC;EAEQC,eAAeA,CAACC,GAAW,EAAEC,KAAa,EAAU;IACxD,OAAO,GAAGA,KAAK,IAAID,GAAG,EAAE;EAC5B;EAEA,MAAME,GAAGA,CAACF,GAAW,EAAEC,KAAa,EAAkC;IAClE,IAAI;MACA,MAAME,SAAS,GAAG,IAAI,CAACJ,eAAe,CAACC,GAAG,EAAEC,KAAK,CAAC;MAClD,MAAMG,KAAK,GA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EAAE;UACFd,GAAG;UACHa,KAAK;UACLZ;QACJ;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOc,GAAG,EAAE;MACV,MAAMxB,WAAW,CAACyB,IAAI,CAACD,GAAG,EAAE;QACxBE,OAAO,EAAE,iCAAiC;QAC1CC,IAAI,EAAE,qBAAqB;QAC3BJ,IAAI,EAAE;UAAEd,GAAG;UAAEC;QAAM;MACvB,CAAC,CAAC;IACN;EACJ;EAEA,MAAMyB,MAAMA,CAAC1B,GAAW,EAAEC,KAAa,EAAiB;IACpD,IAAI;MACA,MAAME,SAAS,GAAG,IAAI,CAACJ,eAAe,CAACC,GAAG,EAAEC,KAAK,CAAC;MAClD,MAAM,IAAI,CAACJ,MAAM,CAAC6B,MAAM,CAAC,IAAI,CAAC9B,KAAK,CAACS,UAAU,CAAC;QAAEF;MAAU,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,OAAOY,GAAG,EAAE;MACV,MAAMxB,WAAW,CAACyB,IAAI,CAACD,GAAG,EAAE;QACxBE,OAAO,EAAE,oCAAoC;QAC7CC,IAAI,EAAE,wBAAwB;QAC9BJ,IAAI,EAAE;UAAEd,GAAG;UAAEC;QAAM;MACvB,CAAC,CAAC;IACN;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"keyValueStore/KeyValueStoreStorageOperations.js","sources":["../../src/keyValueStore/KeyValueStoreStorageOperations.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { WebinyError } from \"@webiny/error\";\nimport type {\n IKeyValueStoreGetOptions,\n IKeyValueStoreSetOptions\n} from \"@webiny/api-core/features/keyValueStore/abstractions.js\";\nimport { KeyValueStoreDynamoTable } from \"./KeyValueStoreDynamoTable.js\";\n\ninterface KeyValueRecord {\n key: string;\n value: any;\n scope: string;\n}\n\nexport class KeyValueStoreStorageOperations {\n private readonly table;\n private readonly entity;\n\n constructor(dynamoDbClient: DynamoDBDocument) {\n this.table = new KeyValueStoreDynamoTable<KeyValueRecord>(dynamoDbClient);\n this.entity = this.table.getEntity();\n }\n\n private createScopedKey(key: string, scope: string): string {\n return `${scope}:${key}`;\n }\n\n async get(\n key: string,\n scope: string,\n options?: IKeyValueStoreGetOptions\n ): Promise<KeyValueRecord | null> {\n try {\n const scopedKey = this.createScopedKey(key, scope);\n const entry = await this.entity.get(this.table.createKeys({ scopedKey }), {\n consistent: options?.consistent\n });\n\n if (!entry) {\n return null;\n }\n\n const ttl = Number(entry.expiresAt);\n if (ttl && ttl <= Math.floor(Date.now() / 1000)) {\n return null;\n }\n\n return {\n key,\n value: entry.data.value,\n scope: entry.data.scope\n };\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not get key-value record.\",\n code: \"GET_KEY_VALUE_ERROR\",\n data: { key, scope }\n });\n }\n }\n\n async set(\n key: string,\n value: any,\n scope: string,\n options?: IKeyValueStoreSetOptions\n ): Promise<void> {\n try {\n const scopedKey = this.createScopedKey(key, scope);\n const keys = this.table.createKeys({ scopedKey });\n\n await this.entity.put({\n ...keys,\n TYPE: \"KeyValueStore\",\n expiresAt: options?.expiresAt\n ? Math.floor(options.expiresAt.getTime() / 1000)\n : undefined,\n data: {\n key,\n value,\n scope\n }\n });\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not set key-value record.\",\n code: \"SET_KEY_VALUE_ERROR\",\n data: { key, scope }\n });\n }\n }\n\n async delete(key: string, scope: string): Promise<void> {\n try {\n const scopedKey = this.createScopedKey(key, scope);\n await this.entity.delete(this.table.createKeys({ scopedKey }));\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not delete key-value record.\",\n code: \"DELETE_KEY_VALUE_ERROR\",\n data: { key, scope }\n });\n }\n }\n}\n"],"names":["KeyValueStoreStorageOperations","dynamoDbClient","KeyValueStoreDynamoTable","key","scope","options","scopedKey","entry","ttl","Number","Math","Date","err","WebinyError","value","keys","undefined"],"mappings":";;AAcO,MAAMA;IAIT,YAAYC,cAAgC,CAAE;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BACFb;oBACAW;oBACAV;gBACJ;YACJ;QACJ,EAAE,OAAOQ,KAAK;YACV,MAAMC,YAAY,IAAI,CAACD,KAAK;gBACxB,SAAS;gBACT,MAAM;gBACN,MAAM;oBAAET;oBAAKC;gBAAM;YACvB;QACJ;IACJ;IAEA,MAAM,OAAOD,GAAW,EAAEC,KAAa,EAAiB;QACpD,IAAI;YACA,MAAME,YAAY,IAAI,CAAC,eAAe,CAACH,KAAKC;YAC5C,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;gBAAEE;YAAU;QAC/D,EAAE,OAAOM,KAAK;YACV,MAAMC,YAAY,IAAI,CAACD,KAAK;gBACxB,SAAS;gBACT,MAAM;gBACN,MAAM;oBAAET;oBAAKC;gBAAM;YACvB;QACJ;IACJ;AACJ"}
@@ -1,6 +1,5 @@
1
1
  import { KeyValueStoreStorageOperations } from "./KeyValueStoreStorageOperations.js";
2
- export const createStorageOperations = params => {
3
- return new KeyValueStoreStorageOperations(params.documentClient);
4
- };
2
+ const createStorageOperations = (params)=>new KeyValueStoreStorageOperations(params.documentClient);
3
+ export { createStorageOperations };
5
4
 
6
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["KeyValueStoreStorageOperations","createStorageOperations","params","documentClient"],"sources":["index.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { KeyValueStoreStorageOperations } from \"./KeyValueStoreStorageOperations.js\";\n\nexport interface CreateKeyValueStoreStorageOperations {\n (params: { documentClient: DynamoDBDocument }): KeyValueStoreStorageOperations;\n}\n\nexport const createStorageOperations: CreateKeyValueStoreStorageOperations = params => {\n return new KeyValueStoreStorageOperations(params.documentClient);\n};\n"],"mappings":"AACA,SAASA,8BAA8B;AAMvC,OAAO,MAAMC,uBAA6D,GAAGC,MAAM,IAAI;EACnF,OAAO,IAAIF,8BAA8B,CAACE,MAAM,CAACC,cAAc,CAAC;AACpE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"keyValueStore/index.js","sources":["../../src/keyValueStore/index.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { KeyValueStoreStorageOperations } from \"./KeyValueStoreStorageOperations.js\";\n\nexport interface CreateKeyValueStoreStorageOperations {\n (params: { documentClient: DynamoDBDocument }): KeyValueStoreStorageOperations;\n}\n\nexport const createStorageOperations: CreateKeyValueStoreStorageOperations = params => {\n return new KeyValueStoreStorageOperations(params.documentClient);\n};\n"],"names":["createStorageOperations","params","KeyValueStoreStorageOperations"],"mappings":";AAOO,MAAMA,0BAAgEC,CAAAA,SAClE,IAAIC,+BAA+BD,OAAO,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-core-ddb",
3
- "version": "0.0.0-unstable.e6f0dc8ca7",
3
+ "version": "0.0.0-unstable.eb81deee7e",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -21,23 +21,25 @@
21
21
  "author": "Webiny Ltd.",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@webiny/api": "0.0.0-unstable.e6f0dc8ca7",
25
- "@webiny/api-core": "0.0.0-unstable.e6f0dc8ca7",
26
- "@webiny/aws-sdk": "0.0.0-unstable.e6f0dc8ca7",
27
- "@webiny/db-dynamodb": "0.0.0-unstable.e6f0dc8ca7",
28
- "@webiny/error": "0.0.0-unstable.e6f0dc8ca7"
24
+ "@webiny/api": "0.0.0-unstable.eb81deee7e",
25
+ "@webiny/api-core": "0.0.0-unstable.eb81deee7e",
26
+ "@webiny/aws-sdk": "0.0.0-unstable.eb81deee7e",
27
+ "@webiny/db-dynamodb": "0.0.0-unstable.eb81deee7e",
28
+ "@webiny/error": "0.0.0-unstable.eb81deee7e",
29
+ "@webiny/feature": "0.0.0-unstable.eb81deee7e"
29
30
  },
30
31
  "devDependencies": {
31
- "@webiny/api": "0.0.0",
32
- "@webiny/build-tools": "0.0.0-unstable.e6f0dc8ca7",
33
- "@webiny/project-utils": "0.0.0-unstable.e6f0dc8ca7",
32
+ "@webiny/api": "0.0.0-unstable.eb81deee7e",
33
+ "@webiny/build-tools": "0.0.0-unstable.eb81deee7e",
34
34
  "jest-dynalite": "3.6.1",
35
35
  "rimraf": "6.1.3",
36
- "typescript": "6.0.3"
36
+ "typescript": "7.0.2",
37
+ "vitest": "4.1.11"
37
38
  },
38
39
  "publishConfig": {
39
- "access": "public",
40
- "directory": "dist"
40
+ "access": "public"
41
41
  },
42
- "gitHead": "e6f0dc8ca741c1fcc3fec9a5b9e86fdd49544641"
42
+ "webiny": {
43
+ "publishFrom": "dist"
44
+ }
43
45
  }
@@ -1,28 +1,23 @@
1
1
  import { createStandardEntity, standardEntityAttributes } from "@webiny/db-dynamodb";
2
2
  import { ENTITIES } from "../types.js";
3
- export const createRoleEntity = table => {
4
- return createStandardEntity({
5
- name: ENTITIES.ROLE,
6
- table
7
- });
8
- };
9
- export const createTeamEntity = table => {
10
- return createStandardEntity({
11
- name: ENTITIES.TEAM,
12
- table,
13
- attributes: {
14
- ...standardEntityAttributes
15
- }
16
- });
17
- };
18
- export const createApiKeyEntity = table => {
19
- return createStandardEntity({
20
- name: ENTITIES.API_KEY,
21
- table,
22
- attributes: {
23
- ...standardEntityAttributes
24
- }
25
- });
26
- };
3
+ const createRoleEntity = (table)=>createStandardEntity({
4
+ name: ENTITIES.ROLE,
5
+ table
6
+ });
7
+ const createTeamEntity = (table)=>createStandardEntity({
8
+ name: ENTITIES.TEAM,
9
+ table,
10
+ attributes: {
11
+ ...standardEntityAttributes
12
+ }
13
+ });
14
+ const createApiKeyEntity = (table)=>createStandardEntity({
15
+ name: ENTITIES.API_KEY,
16
+ table,
17
+ attributes: {
18
+ ...standardEntityAttributes
19
+ }
20
+ });
21
+ export { createApiKeyEntity, createRoleEntity, createTeamEntity };
27
22
 
28
23
  //# sourceMappingURL=entities.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStandardEntity","standardEntityAttributes","ENTITIES","createRoleEntity","table","name","ROLE","createTeamEntity","TEAM","attributes","createApiKeyEntity","API_KEY"],"sources":["entities.ts"],"sourcesContent":["import { createStandardEntity, standardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { StorageApiKey, StorageRole, StorageTeam } from \"@webiny/api-core/types/security.js\";\nimport type { Table } from \"@webiny/db-dynamodb/toolbox.js\";\nimport { ENTITIES } from \"../types.js\";\nimport type { IApiKeyEntity, IRoleEntity, ITeamEntity } from \"~/security/definitions/types.js\";\n\nexport const createRoleEntity = (table: Table<string, string, string>): IRoleEntity => {\n return createStandardEntity<StorageRole>({\n name: ENTITIES.ROLE,\n table\n });\n};\n\nexport const createTeamEntity = (table: Table<string, string, string>): ITeamEntity => {\n return createStandardEntity<StorageTeam>({\n name: ENTITIES.TEAM,\n table,\n attributes: {\n ...standardEntityAttributes\n }\n });\n};\n\nexport const createApiKeyEntity = (table: Table<string, string, string>): IApiKeyEntity => {\n return createStandardEntity<StorageApiKey>({\n name: ENTITIES.API_KEY,\n table,\n attributes: {\n ...standardEntityAttributes\n }\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,wBAAwB,QAAQ,qBAAqB;AAGpF,SAASC,QAAQ;AAGjB,OAAO,MAAMC,gBAAgB,GAAIC,KAAoC,IAAkB;EACnF,OAAOJ,oBAAoB,CAAc;IACrCK,IAAI,EAAEH,QAAQ,CAACI,IAAI;IACnBF;EACJ,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMG,gBAAgB,GAAIH,KAAoC,IAAkB;EACnF,OAAOJ,oBAAoB,CAAc;IACrCK,IAAI,EAAEH,QAAQ,CAACM,IAAI;IACnBJ,KAAK;IACLK,UAAU,EAAE;MACR,GAAGR;IACP;EACJ,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMS,kBAAkB,GAAIN,KAAoC,IAAoB;EACvF,OAAOJ,oBAAoB,CAAgB;IACvCK,IAAI,EAAEH,QAAQ,CAACS,OAAO;IACtBP,KAAK;IACLK,UAAU,EAAE;MACR,GAAGR;IACP;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"security/definitions/entities.js","sources":["../../../src/security/definitions/entities.ts"],"sourcesContent":["import { createStandardEntity, standardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { StorageApiKey, StorageRole, StorageTeam } from \"@webiny/api-core/types/security.js\";\nimport type { Table } from \"@webiny/db-dynamodb/toolbox.js\";\nimport { ENTITIES } from \"../types.js\";\nimport type { IApiKeyEntity, IRoleEntity, ITeamEntity } from \"~/security/definitions/types.js\";\n\nexport const createRoleEntity = (table: Table<string, string, string>): IRoleEntity => {\n return createStandardEntity<StorageRole>({\n name: ENTITIES.ROLE,\n table\n });\n};\n\nexport const createTeamEntity = (table: Table<string, string, string>): ITeamEntity => {\n return createStandardEntity<StorageTeam>({\n name: ENTITIES.TEAM,\n table,\n attributes: {\n ...standardEntityAttributes\n }\n });\n};\n\nexport const createApiKeyEntity = (table: Table<string, string, string>): IApiKeyEntity => {\n return createStandardEntity<StorageApiKey>({\n name: ENTITIES.API_KEY,\n table,\n attributes: {\n ...standardEntityAttributes\n }\n });\n};\n"],"names":["createRoleEntity","table","createStandardEntity","ENTITIES","createTeamEntity","standardEntityAttributes","createApiKeyEntity"],"mappings":";;AAMO,MAAMA,mBAAmB,CAACC,QACtBC,qBAAkC;QACrC,MAAMC,SAAS,IAAI;QACnBF;IACJ;AAGG,MAAMG,mBAAmB,CAACH,QACtBC,qBAAkC;QACrC,MAAMC,SAAS,IAAI;QACnBF;QACA,YAAY;YACR,GAAGI,wBAAwB;QAC/B;IACJ;AAGG,MAAMC,qBAAqB,CAACL,QACxBC,qBAAoC;QACvC,MAAMC,SAAS,OAAO;QACtBF;QACA,YAAY;YACR,GAAGI,wBAAwB;QAC/B;IACJ"}
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map