@webiny/api-websockets 6.0.0-beta.0 → 6.0.0-rc.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 (125) hide show
  1. package/README.md +10 -9
  2. package/context/WebsocketsContext.d.ts +10 -8
  3. package/context/WebsocketsContext.js +44 -33
  4. package/context/WebsocketsContext.js.map +1 -1
  5. package/context/abstractions/IWebsocketsContext.d.ts +12 -11
  6. package/context/abstractions/IWebsocketsContext.js +1 -5
  7. package/context/abstractions/IWebsocketsContext.js.map +1 -1
  8. package/context/index.d.ts +2 -3
  9. package/context/index.js +11 -42
  10. package/context/index.js.map +1 -1
  11. package/features/WebsocketService/abstractions.d.ts +9 -0
  12. package/features/WebsocketService/abstractions.js +4 -0
  13. package/features/WebsocketService/abstractions.js.map +1 -0
  14. package/features/WebsocketService/errors.d.ts +19 -0
  15. package/features/WebsocketService/errors.js +36 -0
  16. package/features/WebsocketService/errors.js.map +1 -0
  17. package/features/WebsocketService/index.d.ts +1 -0
  18. package/features/WebsocketService/index.js +3 -0
  19. package/features/WebsocketService/index.js.map +1 -0
  20. package/graphql/checkPermissions.d.ts +1 -1
  21. package/graphql/checkPermissions.js +6 -11
  22. package/graphql/checkPermissions.js.map +1 -1
  23. package/graphql/createResolvers.d.ts +2 -3
  24. package/graphql/createResolvers.js +41 -32
  25. package/graphql/createResolvers.js.map +1 -1
  26. package/graphql/createTypeDefs.js +2 -11
  27. package/graphql/createTypeDefs.js.map +1 -1
  28. package/graphql/index.d.ts +1 -1
  29. package/graphql/index.js +7 -14
  30. package/graphql/index.js.map +1 -1
  31. package/graphql/utils.js +5 -13
  32. package/graphql/utils.js.map +1 -1
  33. package/handler/handler.d.ts +1 -1
  34. package/handler/handler.js +45 -48
  35. package/handler/handler.js.map +1 -1
  36. package/handler/headers.d.ts +1 -2
  37. package/handler/headers.js +1 -13
  38. package/handler/headers.js.map +1 -1
  39. package/handler/register.js +5 -7
  40. package/handler/register.js.map +1 -1
  41. package/handler/types.d.ts +6 -9
  42. package/handler/types.js +2 -8
  43. package/handler/types.js.map +1 -1
  44. package/index.d.ts +9 -9
  45. package/index.js +11 -98
  46. package/index.js.map +1 -1
  47. package/package.json +28 -36
  48. package/plugins/WebsocketsActionPlugin.d.ts +3 -3
  49. package/plugins/WebsocketsActionPlugin.js +3 -11
  50. package/plugins/WebsocketsActionPlugin.js.map +1 -1
  51. package/plugins/WebsocketsRoutePlugin.d.ts +6 -7
  52. package/plugins/WebsocketsRoutePlugin.js +3 -11
  53. package/plugins/WebsocketsRoutePlugin.js.map +1 -1
  54. package/plugins/abstrations/IWebsocketsActionPlugin.d.ts +3 -4
  55. package/plugins/abstrations/IWebsocketsActionPlugin.js +1 -5
  56. package/plugins/abstrations/IWebsocketsActionPlugin.js.map +1 -1
  57. package/plugins/index.d.ts +3 -3
  58. package/plugins/index.js +2 -38
  59. package/plugins/index.js.map +1 -1
  60. package/registry/WebsocketsConnectionRegistry.d.ts +3 -3
  61. package/registry/WebsocketsConnectionRegistry.js +34 -59
  62. package/registry/WebsocketsConnectionRegistry.js.map +1 -1
  63. package/registry/abstractions/IWebsocketsConnectionRegistry.d.ts +2 -4
  64. package/registry/abstractions/IWebsocketsConnectionRegistry.js +1 -5
  65. package/registry/abstractions/IWebsocketsConnectionRegistry.js.map +1 -1
  66. package/registry/entity.d.ts +3 -108
  67. package/registry/entity.js +18 -33
  68. package/registry/entity.js.map +1 -1
  69. package/registry/index.d.ts +2 -2
  70. package/registry/index.js +1 -27
  71. package/registry/index.js.map +1 -1
  72. package/response/WebsocketsResponse.d.ts +1 -1
  73. package/response/WebsocketsResponse.js +1 -8
  74. package/response/WebsocketsResponse.js.map +1 -1
  75. package/response/abstractions/IWebsocketsResponse.d.ts +1 -1
  76. package/response/abstractions/IWebsocketsResponse.js +1 -5
  77. package/response/abstractions/IWebsocketsResponse.js.map +1 -1
  78. package/response/index.d.ts +2 -2
  79. package/response/index.js +1 -27
  80. package/response/index.js.map +1 -1
  81. package/runner/WebsocketsRunner.d.ts +6 -6
  82. package/runner/WebsocketsRunner.js +10 -23
  83. package/runner/WebsocketsRunner.js.map +1 -1
  84. package/runner/abstractions/IWebsocketsRunner.d.ts +2 -2
  85. package/runner/abstractions/IWebsocketsRunner.js +1 -5
  86. package/runner/abstractions/IWebsocketsRunner.js.map +1 -1
  87. package/runner/index.d.ts +2 -2
  88. package/runner/index.js +1 -27
  89. package/runner/index.js.map +1 -1
  90. package/runner/routes/connect.d.ts +1 -1
  91. package/runner/routes/connect.js +9 -19
  92. package/runner/routes/connect.js.map +1 -1
  93. package/runner/routes/default.d.ts +1 -1
  94. package/runner/routes/default.js +4 -17
  95. package/runner/routes/default.js.map +1 -1
  96. package/runner/routes/disconnect.d.ts +1 -1
  97. package/runner/routes/disconnect.js +4 -11
  98. package/runner/routes/disconnect.js.map +1 -1
  99. package/runner/routes/index.d.ts +1 -1
  100. package/runner/routes/index.js +5 -12
  101. package/runner/routes/index.js.map +1 -1
  102. package/transport/WebsocketsTransport.d.ts +2 -2
  103. package/transport/WebsocketsTransport.js +5 -12
  104. package/transport/WebsocketsTransport.js.map +1 -1
  105. package/transport/abstractions/IWebsocketsTransport.d.ts +4 -4
  106. package/transport/abstractions/IWebsocketsTransport.js +1 -5
  107. package/transport/abstractions/IWebsocketsTransport.js.map +1 -1
  108. package/transport/index.d.ts +2 -2
  109. package/transport/index.js +1 -27
  110. package/transport/index.js.map +1 -1
  111. package/types.d.ts +5 -5
  112. package/types.js +1 -5
  113. package/types.js.map +1 -1
  114. package/utils/middleware.d.ts +2 -2
  115. package/utils/middleware.js +1 -8
  116. package/utils/middleware.js.map +1 -1
  117. package/validator/WebsocketsEventValidator.d.ts +2 -2
  118. package/validator/WebsocketsEventValidator.js +25 -34
  119. package/validator/WebsocketsEventValidator.js.map +1 -1
  120. package/validator/abstractions/IWebsocketsEventValidator.d.ts +2 -2
  121. package/validator/abstractions/IWebsocketsEventValidator.js +1 -5
  122. package/validator/abstractions/IWebsocketsEventValidator.js.map +1 -1
  123. package/validator/index.d.ts +2 -2
  124. package/validator/index.js +1 -27
  125. package/validator/index.js.map +1 -1
@@ -1,25 +1,16 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.WebsocketsConnectionRegistry = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _entity = require("./entity");
10
- var _dbDynamodb = require("@webiny/db-dynamodb");
1
+ import WebinyError from "@webiny/error";
2
+ import { createEntity } from "./entity.js";
11
3
  const PK = `WS#CONNECTIONS`;
12
4
  const GSI1_PK = "WS#CONNECTIONS#IDENTITY";
13
- const GSI2_PK = "WS#CONNECTIONS#TENANT#LOCALE";
14
- class WebsocketsConnectionRegistry {
5
+ const GSI2_PK = "WS#CONNECTIONS#TENANT";
6
+ export class WebsocketsConnectionRegistry {
15
7
  constructor(documentClient) {
16
- this.entity = (0, _entity.createEntity)(documentClient);
8
+ this.entity = createEntity(documentClient);
17
9
  }
18
10
  async register(params) {
19
11
  const {
20
12
  connectionId,
21
13
  tenant,
22
- locale,
23
14
  identity,
24
15
  domainName,
25
16
  stage,
@@ -29,7 +20,6 @@ class WebsocketsConnectionRegistry {
29
20
  connectionId,
30
21
  identity,
31
22
  tenant,
32
- locale,
33
23
  domainName,
34
24
  stage,
35
25
  connectedOn
@@ -49,26 +39,23 @@ class WebsocketsConnectionRegistry {
49
39
  if (!original) {
50
40
  const message = `There is no connection with ID "${connectionId}".`;
51
41
  console.error(message);
52
- throw new _error.default(message, "CONNECTION_NOT_FOUND", keys);
42
+ throw new WebinyError(message, "CONNECTION_NOT_FOUND", keys);
53
43
  }
54
44
  try {
55
- await (0, _dbDynamodb.deleteItem)({
56
- entity: this.entity,
57
- keys
58
- });
45
+ await this.entity.delete(keys);
59
46
  } catch (ex) {
60
47
  console.error(`Could not remove connection from the database: ${original.connectionId}`);
61
- throw new _error.default(ex.message, ex.code, keys);
48
+ throw new WebinyError(ex.message, ex.code, keys);
62
49
  }
63
50
  }
64
51
  async getViaConnection(connectionId) {
65
- const item = await (0, _dbDynamodb.get)({
66
- entity: this.entity,
67
- keys: {
68
- PK,
69
- SK: connectionId
70
- }
52
+ const item = await this.entity.get({
53
+ PK,
54
+ SK: connectionId
71
55
  });
56
+ if (!item) {
57
+ return null;
58
+ }
72
59
  return item?.data || null;
73
60
  }
74
61
 
@@ -76,16 +63,15 @@ class WebsocketsConnectionRegistry {
76
63
  * Uses Primary keys
77
64
  */
78
65
  async listViaConnections(connections) {
79
- const items = connections.map(connectionId => {
80
- return this.entity.getBatch({
81
- PK,
82
- SK: connectionId
83
- });
84
- });
85
- const results = await (0, _dbDynamodb.batchReadAll)({
86
- table: this.entity.table,
87
- items
66
+ const reader = this.entity.createEntityReader({
67
+ read: connections.map(id => {
68
+ return {
69
+ PK,
70
+ SK: id
71
+ };
72
+ })
88
73
  });
74
+ const results = await reader.execute();
89
75
  return results.map(item => {
90
76
  return item.data;
91
77
  });
@@ -95,8 +81,7 @@ class WebsocketsConnectionRegistry {
95
81
  * Uses GSI1 keys
96
82
  */
97
83
  async listViaIdentity(identity) {
98
- const items = await (0, _dbDynamodb.queryAll)({
99
- entity: this.entity,
84
+ const items = await this.entity.queryAll({
100
85
  partitionKey: GSI1_PK,
101
86
  options: {
102
87
  index: "GSI1",
@@ -111,17 +96,11 @@ class WebsocketsConnectionRegistry {
111
96
  /**
112
97
  * Uses GSI2 keys
113
98
  */
114
- async listViaTenant(tenant, locale) {
115
- let options = {
116
- beginsWith: `T#${tenant}#L#`
99
+ async listViaTenant(tenant) {
100
+ const options = {
101
+ beginsWith: `T#${tenant}`
117
102
  };
118
- if (locale) {
119
- options = {
120
- eq: `T#${tenant}#L#${locale}`
121
- };
122
- }
123
- const items = await (0, _dbDynamodb.queryAll)({
124
- entity: this.entity,
103
+ const items = await this.entity.queryAll({
125
104
  partitionKey: GSI2_PK,
126
105
  options: {
127
106
  ...options,
@@ -133,8 +112,7 @@ class WebsocketsConnectionRegistry {
133
112
  });
134
113
  }
135
114
  async listAll() {
136
- const items = await (0, _dbDynamodb.queryAll)({
137
- entity: this.entity,
115
+ const items = await this.entity.queryAll({
138
116
  partitionKey: PK,
139
117
  options: {
140
118
  gte: " "
@@ -148,7 +126,6 @@ class WebsocketsConnectionRegistry {
148
126
  const {
149
127
  connectionId,
150
128
  tenant,
151
- locale,
152
129
  identity
153
130
  } = data;
154
131
  const item = {
@@ -158,18 +135,17 @@ class WebsocketsConnectionRegistry {
158
135
  // to find all connections related to given identity
159
136
  GSI1_PK,
160
137
  GSI1_SK: identity.id,
161
- // to find all connections related to given tenant/locale combination
138
+ // to find all connections related to given tenant
162
139
  GSI2_PK,
163
- GSI2_SK: `T#${tenant}#L#${locale}`,
140
+ GSI2_SK: `T#${tenant}`,
141
+ GSI_TENANT: tenant,
142
+ TYPE: "ws.connection",
164
143
  data
165
144
  };
166
145
  try {
167
- return await (0, _dbDynamodb.put)({
168
- entity: this.entity,
169
- item
170
- });
146
+ return await this.entity.put(item);
171
147
  } catch (err) {
172
- throw _error.default.from(err, {
148
+ throw WebinyError.from(err, {
173
149
  message: "Could not store websockets connection data.",
174
150
  code: "STORE_WEBSOCKETS_CONNECTION_DATA_ERROR",
175
151
  data: item
@@ -177,6 +153,5 @@ class WebsocketsConnectionRegistry {
177
153
  }
178
154
  }
179
155
  }
180
- exports.WebsocketsConnectionRegistry = WebsocketsConnectionRegistry;
181
156
 
182
157
  //# sourceMappingURL=WebsocketsConnectionRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_entity","_dbDynamodb","PK","GSI1_PK","GSI2_PK","WebsocketsConnectionRegistry","constructor","documentClient","entity","createEntity","register","params","connectionId","tenant","locale","identity","domainName","stage","connectedOn","data","store","unregister","keys","SK","original","getViaConnection","message","console","error","WebinyError","deleteItem","ex","code","item","get","listViaConnections","connections","items","map","getBatch","results","batchReadAll","table","listViaIdentity","queryAll","partitionKey","options","index","eq","listViaTenant","beginsWith","listAll","gte","GSI1_SK","id","GSI2_SK","put","err","from","exports"],"sources":["WebsocketsConnectionRegistry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n IWebsocketsConnectionRegistry,\n IWebsocketsConnectionRegistryData,\n IWebsocketsConnectionRegistryRegisterParams,\n IWebsocketsConnectionRegistryUnregisterParams\n} from \"./abstractions/IWebsocketsConnectionRegistry\";\nimport { createEntity } from \"~/registry/entity\";\nimport { batchReadAll, deleteItem, get, put, queryAll } from \"@webiny/db-dynamodb\";\nimport { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { EntityQueryOptions } from \"@webiny/db-dynamodb/toolbox\";\n\nconst PK = `WS#CONNECTIONS`;\nconst GSI1_PK = \"WS#CONNECTIONS#IDENTITY\";\nconst GSI2_PK = \"WS#CONNECTIONS#TENANT#LOCALE\";\n\ninterface IWebsocketsConnectionRegistryDbItem {\n PK: string;\n SK: string;\n GSI1_PK: string;\n GSI1_SK: string;\n GSI2_PK: string;\n GSI2_SK: string;\n data: IWebsocketsConnectionRegistryData;\n}\n\nexport class WebsocketsConnectionRegistry implements IWebsocketsConnectionRegistry {\n private readonly entity: ReturnType<typeof createEntity>;\n\n public constructor(documentClient: DynamoDBDocument) {\n this.entity = createEntity(documentClient);\n }\n\n public async register(\n params: IWebsocketsConnectionRegistryRegisterParams\n ): Promise<IWebsocketsConnectionRegistryData> {\n const { connectionId, tenant, locale, identity, domainName, stage, connectedOn } = params;\n\n const data: IWebsocketsConnectionRegistryData = {\n connectionId,\n identity,\n tenant,\n locale,\n domainName,\n stage,\n connectedOn\n };\n await this.store(data);\n return data;\n }\n\n public async unregister(params: IWebsocketsConnectionRegistryUnregisterParams): Promise<void> {\n const { connectionId } = params;\n\n const keys = {\n PK,\n SK: connectionId\n };\n const original = await this.getViaConnection(connectionId);\n if (!original) {\n const message = `There is no connection with ID \"${connectionId}\".`;\n console.error(message);\n throw new WebinyError(message, \"CONNECTION_NOT_FOUND\", keys);\n }\n\n try {\n await deleteItem({\n entity: this.entity,\n keys\n });\n } catch (ex) {\n console.error(\n `Could not remove connection from the database: ${original.connectionId}`\n );\n throw new WebinyError(ex.message, ex.code, keys);\n }\n }\n\n private async getViaConnection(\n connectionId: string\n ): Promise<IWebsocketsConnectionRegistryData | null> {\n const item = await get<IWebsocketsConnectionRegistryDbItem>({\n entity: this.entity,\n keys: {\n PK,\n SK: connectionId\n }\n });\n return item?.data || null;\n }\n\n /**\n * Uses Primary keys\n */\n public async listViaConnections(\n connections: string[]\n ): Promise<IWebsocketsConnectionRegistryData[]> {\n const items = connections.map(connectionId => {\n return this.entity.getBatch({\n PK,\n SK: connectionId\n });\n });\n\n const results = await batchReadAll<IWebsocketsConnectionRegistryDbItem>({\n table: this.entity.table,\n items\n });\n\n return results.map(item => {\n return item.data;\n });\n }\n\n /**\n * Uses GSI1 keys\n */\n public async listViaIdentity(identity: string): Promise<IWebsocketsConnectionRegistryData[]> {\n const items = await queryAll<IWebsocketsConnectionRegistryDbItem>({\n entity: this.entity,\n partitionKey: GSI1_PK,\n options: {\n index: \"GSI1\",\n eq: identity\n }\n });\n return items.map(item => {\n return item.data;\n });\n }\n\n /**\n * Uses GSI2 keys\n */\n public async listViaTenant(\n tenant: string,\n locale?: string\n ): Promise<IWebsocketsConnectionRegistryData[]> {\n let options: Partial<EntityQueryOptions> = {\n beginsWith: `T#${tenant}#L#`\n };\n if (locale) {\n options = {\n eq: `T#${tenant}#L#${locale}`\n };\n }\n const items = await queryAll<IWebsocketsConnectionRegistryDbItem>({\n entity: this.entity,\n partitionKey: GSI2_PK,\n options: {\n ...options,\n index: \"GSI2\"\n }\n });\n return items.map(item => {\n return item.data;\n });\n }\n\n public async listAll(): Promise<IWebsocketsConnectionRegistryData[]> {\n const items = await queryAll<IWebsocketsConnectionRegistryDbItem>({\n entity: this.entity,\n partitionKey: PK,\n options: {\n gte: \" \"\n }\n });\n return items.map(item => {\n return item.data;\n });\n }\n\n private async store(data: IWebsocketsConnectionRegistryData) {\n const { connectionId, tenant, locale, identity } = data;\n const item: IWebsocketsConnectionRegistryDbItem = {\n // to find specific identity related to given connection\n PK,\n SK: connectionId,\n // to find all connections related to given identity\n GSI1_PK,\n GSI1_SK: identity.id,\n // to find all connections related to given tenant/locale combination\n GSI2_PK,\n GSI2_SK: `T#${tenant}#L#${locale}`,\n data\n };\n try {\n return await put({\n entity: this.entity,\n item\n });\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not store websockets connection data.\",\n code: \"STORE_WEBSOCKETS_CONNECTION_DATA_ERROR\",\n data: item\n });\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,MAAMG,EAAE,GAAI,gBAAe;AAC3B,MAAMC,OAAO,GAAG,yBAAyB;AACzC,MAAMC,OAAO,GAAG,8BAA8B;AAYvC,MAAMC,4BAA4B,CAA0C;EAGxEC,WAAWA,CAACC,cAAgC,EAAE;IACjD,IAAI,CAACC,MAAM,GAAG,IAAAC,oBAAY,EAACF,cAAc,CAAC;EAC9C;EAEA,MAAaG,QAAQA,CACjBC,MAAmD,EACT;IAC1C,MAAM;MAAEC,YAAY;MAAEC,MAAM;MAAEC,MAAM;MAAEC,QAAQ;MAAEC,UAAU;MAAEC,KAAK;MAAEC;IAAY,CAAC,GAAGP,MAAM;IAEzF,MAAMQ,IAAuC,GAAG;MAC5CP,YAAY;MACZG,QAAQ;MACRF,MAAM;MACNC,MAAM;MACNE,UAAU;MACVC,KAAK;MACLC;IACJ,CAAC;IACD,MAAM,IAAI,CAACE,KAAK,CAACD,IAAI,CAAC;IACtB,OAAOA,IAAI;EACf;EAEA,MAAaE,UAAUA,CAACV,MAAqD,EAAiB;IAC1F,MAAM;MAAEC;IAAa,CAAC,GAAGD,MAAM;IAE/B,M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;MACnBqC,YAAY,EAAE3C,EAAE;MAChB4C,OAAO,EAAE;QACLM,GAAG,EAAE;MACT;IACJ,CAAC,CAAC;IACF,OAAOf,KAAK,CAACC,GAAG,CAACL,IAAI,IAAI;MACrB,OAAOA,IAAI,CAACd,IAAI;IACpB,CAAC,CAAC;EACN;EAEA,MAAcC,KAAKA,CAACD,IAAuC,EAAE;IACzD,MAAM;MAAEP,YAAY;MAAEC,MAAM;MAAEC,MAAM;MAAEC;IAAS,CAAC,GAAGI,IAAI;IACvD,MAAMc,IAAyC,GAAG;MAC9C;MACA/B,EAAE;MACFqB,EAAE,EAAEX,YAAY;MAChB;MACAT,OAAO;MACPkD,OAAO,EAAEtC,QAAQ,CAACuC,EAAE;MACpB;MACAlD,OAAO;MACPmD,OAAO,EAAG,KAAI1C,MAAO,MAAKC,MAAO,EAAC;MAClCK;IACJ,CAAC;IACD,IAAI;MACA,OAAO,MAAM,IAAAqC,eAAG,EAAC;QACbhD,MAAM,EAAE,IAAI,CAACA,MAAM;QACnByB;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOwB,GAAG,EAAE;MACV,MAAM5B,cAAW,CAAC6B,IAAI,CAACD,GAAG,EAAE;QACxB/B,OAAO,EAAE,6CAA6C;QACtDM,IAAI,EAAE,wCAAwC;QAC9Cb,IAAI,EAAEc;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAAC0B,OAAA,CAAAtD,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","createEntity","PK","GSI1_PK","GSI2_PK","WebsocketsConnectionRegistry","constructor","documentClient","entity","register","params","connectionId","tenant","identity","domainName","stage","connectedOn","data","store","unregister","keys","SK","original","getViaConnection","message","console","error","delete","ex","code","item","get","listViaConnections","connections","reader","createEntityReader","read","map","id","results","execute","listViaIdentity","items","queryAll","partitionKey","options","index","eq","listViaTenant","beginsWith","listAll","gte","GSI1_SK","GSI2_SK","GSI_TENANT","TYPE","put","err","from"],"sources":["WebsocketsConnectionRegistry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n IWebsocketsConnectionRegistry,\n IWebsocketsConnectionRegistryData,\n IWebsocketsConnectionRegistryRegisterParams,\n IWebsocketsConnectionRegistryUnregisterParams\n} from \"./abstractions/IWebsocketsConnectionRegistry.js\";\nimport { createEntity } from \"~/registry/entity.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { EntityQueryOptions } from \"@webiny/db-dynamodb/toolbox.js\";\n\nconst PK = `WS#CONNECTIONS`;\nconst GSI1_PK = \"WS#CONNECTIONS#IDENTITY\";\nconst GSI2_PK = \"WS#CONNECTIONS#TENANT\";\n\nexport class WebsocketsConnectionRegistry implements IWebsocketsConnectionRegistry {\n private readonly entity;\n\n public constructor(documentClient: DynamoDBDocument) {\n this.entity = createEntity(documentClient);\n }\n\n public async register(\n params: IWebsocketsConnectionRegistryRegisterParams\n ): Promise<IWebsocketsConnectionRegistryData> {\n const { connectionId, tenant, identity, domainName, stage, connectedOn } = params;\n\n const data: IWebsocketsConnectionRegistryData = {\n connectionId,\n identity,\n tenant,\n domainName,\n stage,\n connectedOn\n };\n await this.store(data);\n return data;\n }\n\n public async unregister(params: IWebsocketsConnectionRegistryUnregisterParams): Promise<void> {\n const { connectionId } = params;\n\n const keys = {\n PK,\n SK: connectionId\n };\n const original = await this.getViaConnection(connectionId);\n if (!original) {\n const message = `There is no connection with ID \"${connectionId}\".`;\n console.error(message);\n throw new WebinyError(message, \"CONNECTION_NOT_FOUND\", keys);\n }\n\n try {\n await this.entity.delete(keys);\n } catch (ex) {\n console.error(\n `Could not remove connection from the database: ${original.connectionId}`\n );\n throw new WebinyError(ex.message, ex.code, keys);\n }\n }\n\n private async getViaConnection(\n connectionId: string\n ): Promise<IWebsocketsConnectionRegistryData | null> {\n const item = await this.entity.get({\n PK,\n SK: connectionId\n });\n if (!item) {\n return null;\n }\n return item?.data || null;\n }\n\n /**\n * Uses Primary keys\n */\n public async listViaConnections(\n connections: string[]\n ): Promise<IWebsocketsConnectionRegistryData[]> {\n const reader = this.entity.createEntityReader({\n read: connections.map(id => {\n return {\n PK,\n SK: id\n };\n })\n });\n\n const results = await reader.execute();\n\n return results.map(item => {\n return item.data;\n });\n }\n\n /**\n * Uses GSI1 keys\n */\n public async listViaIdentity(identity: string): Promise<IWebsocketsConnectionRegistryData[]> {\n const items = await this.entity.queryAll({\n partitionKey: GSI1_PK,\n options: {\n index: \"GSI1\",\n eq: identity\n }\n });\n return items.map(item => {\n return item.data;\n });\n }\n\n /**\n * Uses GSI2 keys\n */\n public async listViaTenant(tenant: string): Promise<IWebsocketsConnectionRegistryData[]> {\n const options: Partial<EntityQueryOptions> = {\n beginsWith: `T#${tenant}`\n };\n\n const items = await this.entity.queryAll({\n partitionKey: GSI2_PK,\n options: {\n ...options,\n index: \"GSI2\"\n }\n });\n return items.map(item => {\n return item.data;\n });\n }\n\n public async listAll(): Promise<IWebsocketsConnectionRegistryData[]> {\n const items = await this.entity.queryAll({\n partitionKey: PK,\n options: {\n gte: \" \"\n }\n });\n return items.map(item => {\n return item.data;\n });\n }\n\n private async store(data: IWebsocketsConnectionRegistryData) {\n const { connectionId, tenant, identity } = data;\n const item = {\n // to find specific identity related to given connection\n PK,\n SK: connectionId,\n // to find all connections related to given identity\n GSI1_PK,\n GSI1_SK: identity.id,\n // to find all connections related to given tenant\n GSI2_PK,\n GSI2_SK: `T#${tenant}`,\n GSI_TENANT: tenant,\n TYPE: \"ws.connection\",\n data\n };\n try {\n return await this.entity.put(item);\n } catch (err) {\n throw WebinyError.from(err, {\n message: \"Could not store websockets connection data.\",\n code: \"STORE_WEBSOCKETS_CONNECTION_DATA_ERROR\",\n data: item\n });\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAOvC,SAASC,YAAY;AAIrB,MAAMC,EAAE,GAAG,gBAAgB;AAC3B,MAAMC,OAAO,GAAG,yBAAyB;AACzC,MAAMC,OAA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stractions/IWebsocketsContext";
1
+ import type { IWebsocketsIdentity } from "../../context/abstractions/IWebsocketsContext.js";
2
2
  export interface IWebsocketsConnectionRegistryData {
3
3
  connectionId: string;
4
4
  identity: IWebsocketsIdentity;
5
5
  tenant: string;
6
- locale: string;
7
6
  connectedOn: string;
8
7
  domainName: string;
9
8
  stage: string;
@@ -11,7 +10,6 @@ export interface IWebsocketsConnectionRegistryData {
11
10
  export interface IWebsocketsConnectionRegistryRegisterParams {
12
11
  connectionId: string;
13
12
  tenant: string;
14
- locale: string;
15
13
  identity: IWebsocketsIdentity;
16
14
  domainName: string;
17
15
  stage: string;
@@ -28,6 +26,6 @@ export interface IWebsocketsConnectionRegistry {
28
26
  unregister(event: IWebsocketsConnectionRegistryUnregisterParams): Promise<void>;
29
27
  listViaConnections(connections: string[]): Promise<IWebsocketsConnectionRegistryData[]>;
30
28
  listViaIdentity(identity: string): Promise<IWebsocketsConnectionRegistryData[]>;
31
- listViaTenant(tenant: string, locale?: string): Promise<IWebsocketsConnectionRegistryData[]>;
29
+ listViaTenant(tenant: string): Promise<IWebsocketsConnectionRegistryData[]>;
32
30
  listAll(): Promise<IWebsocketsConnectionRegistryData[]>;
33
31
  }
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=IWebsocketsConnectionRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["IWebsocketsConnectionRegistry.ts"],"sourcesContent":["import { IWebsocketsIdentity } from \"~/context/abstractions/IWebsocketsContext\";\n\nexport interface IWebsocketsConnectionRegistryData {\n connectionId: string;\n identity: IWebsocketsIdentity;\n tenant: string;\n locale: string;\n connectedOn: string;\n domainName: string;\n stage: string;\n}\n\nexport interface IWebsocketsConnectionRegistryRegisterParams {\n connectionId: string;\n tenant: string;\n locale: string;\n identity: IWebsocketsIdentity;\n domainName: string;\n stage: string;\n /**\n * A DateTime.toISOString() format.\n */\n connectedOn: string;\n}\n\nexport interface IWebsocketsConnectionRegistryUnregisterParams {\n connectionId: string;\n}\n\nexport interface IWebsocketsConnectionRegistry {\n register(\n event: IWebsocketsConnectionRegistryRegisterParams\n ): Promise<IWebsocketsConnectionRegistryData>;\n unregister(event: IWebsocketsConnectionRegistryUnregisterParams): Promise<void>;\n\n listViaConnections(connections: string[]): Promise<IWebsocketsConnectionRegistryData[]>;\n listViaIdentity(identity: string): Promise<IWebsocketsConnectionRegistryData[]>;\n listViaTenant(tenant: string, locale?: string): Promise<IWebsocketsConnectionRegistryData[]>;\n listAll(): Promise<IWebsocketsConnectionRegistryData[]>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["IWebsocketsConnectionRegistry.ts"],"sourcesContent":["import type { IWebsocketsIdentity } from \"~/context/abstractions/IWebsocketsContext.js\";\n\nexport interface IWebsocketsConnectionRegistryData {\n connectionId: string;\n identity: IWebsocketsIdentity;\n tenant: string;\n connectedOn: string;\n domainName: string;\n stage: string;\n}\n\nexport interface IWebsocketsConnectionRegistryRegisterParams {\n connectionId: string;\n tenant: string;\n identity: IWebsocketsIdentity;\n domainName: string;\n stage: string;\n /**\n * A DateTime.toISOString() format.\n */\n connectedOn: string;\n}\n\nexport interface IWebsocketsConnectionRegistryUnregisterParams {\n connectionId: string;\n}\n\nexport interface IWebsocketsConnectionRegistry {\n register(\n event: IWebsocketsConnectionRegistryRegisterParams\n ): Promise<IWebsocketsConnectionRegistryData>;\n unregister(event: IWebsocketsConnectionRegistryUnregisterParams): Promise<void>;\n\n listViaConnections(connections: string[]): Promise<IWebsocketsConnectionRegistryData[]>;\n listViaIdentity(identity: string): Promise<IWebsocketsConnectionRegistryData[]>;\n listViaTenant(tenant: string): Promise<IWebsocketsConnectionRegistryData[]>;\n listAll(): Promise<IWebsocketsConnectionRegistryData[]>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,108 +1,3 @@
1
- import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
2
- import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
3
- export declare const createEntity: (documentClient: DynamoDBDocument) => Entity<"SocketsConnectionRegistry", undefined, undefined, Table<string, "PK", "SK">, true, true, true, "created", "modified", "entity", false, {
4
- PK: {
5
- partitionKey: true;
6
- };
7
- SK: {
8
- sortKey: true;
9
- };
10
- GSI1_PK: {
11
- type: "string";
12
- };
13
- GSI1_SK: {
14
- type: "string";
15
- };
16
- GSI2_PK: {
17
- type: "string";
18
- };
19
- GSI2_SK: {
20
- type: "string";
21
- };
22
- TYPE: {
23
- type: "string";
24
- default: string;
25
- };
26
- data: {
27
- type: "map";
28
- };
29
- }, {
30
- PK: {
31
- partitionKey: true;
32
- };
33
- SK: {
34
- sortKey: true;
35
- };
36
- GSI1_PK: {
37
- type: "string";
38
- };
39
- GSI1_SK: {
40
- type: "string";
41
- };
42
- GSI2_PK: {
43
- type: "string";
44
- };
45
- GSI2_SK: {
46
- type: "string";
47
- };
48
- TYPE: {
49
- type: "string";
50
- default: string;
51
- };
52
- data: {
53
- type: "map";
54
- };
55
- }, import("dynamodb-toolbox/dist/cjs/classes/Entity").ParseAttributes<{
56
- PK: {
57
- partitionKey: true;
58
- };
59
- SK: {
60
- sortKey: true;
61
- };
62
- GSI1_PK: {
63
- type: "string";
64
- };
65
- GSI1_SK: {
66
- type: "string";
67
- };
68
- GSI2_PK: {
69
- type: "string";
70
- };
71
- GSI2_SK: {
72
- type: "string";
73
- };
74
- TYPE: {
75
- type: "string";
76
- default: string;
77
- };
78
- data: {
79
- type: "map";
80
- };
81
- }, true, "created", "modified", "entity", false, "created" | "modified" | "entity", "TYPE" | "created" | "modified" | "entity", "PK", never, never, "SK", never, never, "PK" | "SK", "modified", "created" | "entity", "data" | "PK" | "SK" | "GSI1_PK" | "GSI1_SK" | "GSI2_PK" | "GSI2_SK" | "TYPE" | "created" | "modified" | "entity", never>, {
82
- data?: any;
83
- GSI1_PK?: string | undefined;
84
- GSI1_SK?: string | undefined;
85
- GSI2_PK?: string | undefined;
86
- GSI2_SK?: string | undefined;
87
- TYPE?: string | undefined;
88
- PK: any;
89
- SK: any;
90
- created: string;
91
- modified: string;
92
- entity: string;
93
- }, {
94
- data?: any;
95
- GSI1_PK?: string | undefined;
96
- GSI1_SK?: string | undefined;
97
- GSI2_PK?: string | undefined;
98
- GSI2_SK?: string | undefined;
99
- TYPE?: string | undefined;
100
- PK: any;
101
- SK: any;
102
- created: string;
103
- modified: string;
104
- entity: string;
105
- }, {
106
- PK: any;
107
- SK: any;
108
- }>;
1
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ import type { IWebsocketsConnectionRegistryData } from "./abstractions/IWebsocketsConnectionRegistry.js";
3
+ export declare const createEntity: (documentClient: DynamoDBDocument) => import("@webiny/db-dynamodb").IEntity<import("@webiny/db-dynamodb").IStandardEntityAttributes<IWebsocketsConnectionRegistryData>>;
@@ -1,33 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
1
+ import { createStandardEntity, createTable } from "@webiny/db-dynamodb";
8
2
  const name = "SocketsConnectionRegistry";
9
- const createEntity = documentClient => {
10
- const table = new _toolbox.Table({
3
+ export const createEntity = documentClient => {
4
+ const table = createTable({
11
5
  name: String(process.env.DB_TABLE),
12
- partitionKey: "PK",
13
- sortKey: "SK",
14
- DocumentClient: documentClient,
15
- indexes: {
16
- GSI1: {
17
- partitionKey: "GSI1_PK",
18
- sortKey: "GSI1_SK"
19
- },
20
- GSI2: {
21
- partitionKey: "GSI2_PK",
22
- sortKey: "GSI2_SK"
23
- }
24
- },
25
- autoExecute: true,
26
- autoParse: true
6
+ documentClient
27
7
  });
28
- return new _toolbox.Entity({
8
+ return createStandardEntity({
29
9
  name,
30
- table,
10
+ table: table.table,
31
11
  attributes: {
32
12
  PK: {
33
13
  partitionKey: true
@@ -36,27 +16,32 @@ const createEntity = documentClient => {
36
16
  sortKey: true
37
17
  },
38
18
  GSI1_PK: {
39
- type: "string"
19
+ type: "string",
20
+ required: true
40
21
  },
41
22
  GSI1_SK: {
42
- type: "string"
23
+ type: "string",
24
+ required: true
43
25
  },
44
26
  GSI2_PK: {
45
- type: "string"
27
+ type: "string",
28
+ required: true
46
29
  },
47
30
  GSI2_SK: {
48
- type: "string"
31
+ type: "string",
32
+ required: true
49
33
  },
50
34
  TYPE: {
51
35
  type: "string",
52
- default: name
36
+ default: name,
37
+ required: true
53
38
  },
54
39
  data: {
55
- type: "map"
40
+ type: "map",
41
+ required: true
56
42
  }
57
43
  }
58
44
  });
59
45
  };
60
- exports.createEntity = createEntity;
61
46
 
62
47
  //# sourceMappingURL=entity.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","name","createEntity","documentClient","table","Table","String","process","env","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1","GSI2","autoExecute","autoParse","Entity","attributes","PK","SK","GSI1_PK","type","GSI1_SK","GSI2_PK","GSI2_SK","TYPE","default","data","exports"],"sources":["entity.ts"],"sourcesContent":["import { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\n\nconst name = \"SocketsConnectionRegistry\";\n\nexport const createEntity = (documentClient: DynamoDBDocument) => {\n const table = new Table({\n name: String(process.env.DB_TABLE),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n },\n GSI2: {\n partitionKey: \"GSI2_PK\",\n sortKey: \"GSI2_SK\"\n }\n },\n autoExecute: true,\n autoParse: true\n });\n\n return new Entity({\n name,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n GSI2_PK: {\n type: \"string\"\n },\n GSI2_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\",\n default: name\n },\n data: {\n type: \"map\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,MAAMC,IAAI,GAAG,2BAA2B;AAEjC,MAAMC,YAAY,GAAIC,cAAgC,IAAK;EAC9D,MAAMC,KAAK,GAAG,IAAIC,cAAK,CAAC;IACpBJ,IAAI,EAAEK,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,CAAC;IAClCC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb,CAAC;MACDI,IAAI,EAAE;QACFL,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb;IACJ,CAAC;IACDK,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC,CAAC;EAEF,OAAO,IAAIC,eAAM,CAAC;IACdjB,IAAI;IACJG,KAAK;IACLe,UAAU,EAAE;MACRC,EAAE,EAAE;QACAV,YAAY,EAAE;MAClB,CAAC;MACDW,EAAE,EAAE;QACAV,OAAO,EAAE;MACb,CAAC;MACDW,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,OAAO,EAAE;QACLF,IAAI,EAAE;MACV,CAAC;MACDG,OAAO,EAAE;QACLH,IAAI,EAAE;MACV,CAAC;MACDI,IAAI,EAAE;QACFJ,IAAI,EAAE,QAAQ;QACdK,OAAO,EAAE3B;MACb,CAAC;MACD4B,IAAI,EAAE;QACFN,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAACO,OAAA,CAAA5B,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["createStandardEntity","createTable","name","createEntity","documentClient","table","String","process","env","DB_TABLE","attributes","PK","partitionKey","SK","sortKey","GSI1_PK","type","required","GSI1_SK","GSI2_PK","GSI2_SK","TYPE","default","data"],"sources":["entity.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createStandardEntity, createTable } from \"@webiny/db-dynamodb\";\nimport type { IWebsocketsConnectionRegistryData } from \"./abstractions/IWebsocketsConnectionRegistry.js\";\n\nconst name = \"SocketsConnectionRegistry\";\n\nexport const createEntity = (documentClient: DynamoDBDocument) => {\n const table = createTable({\n name: String(process.env.DB_TABLE),\n documentClient\n });\n\n return createStandardEntity<IWebsocketsConnectionRegistryData>({\n name,\n table: table.table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\",\n required: true\n },\n GSI1_SK: {\n type: \"string\",\n required: true\n },\n GSI2_PK: {\n type: \"string\",\n required: true\n },\n GSI2_SK: {\n type: \"string\",\n required: true\n },\n TYPE: {\n type: \"string\",\n default: name,\n required: true\n },\n data: {\n type: \"map\",\n required: true\n }\n }\n });\n};\n"],"mappings":"AACA,SAASA,oBAAoB,EAAEC,WAAW,QAAQ,qBAAqB;AAGvE,MAAMC,IAAI,GAAG,2BAA2B;AAExC,OAAO,MAAMC,YAAY,GAAIC,cAAgC,IAAK;EAC9D,MAAMC,KAAK,GAAGJ,WAAW,CAAC;IACtBC,IAAI,EAAEI,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,CAAC;IAClCL;EACJ,CAAC,CAAC;EAEF,OAAOJ,oBAAoB,CAAoC;IAC3DE,IAAI;IACJG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBK,UAAU,EAAE;MACRC,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDC,OAAO,EAAE;QACLF,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDE,OAAO,EAAE;QACLH,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDG,OAAO,EAAE;QACLJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,IAAI,EAAE;QACFL,IAAI,EAAE,QAAQ;QACdM,OAAO,EAAEpB,IAAI;QACbe,QAAQ,EAAE;MACd,CAAC;MACDM,IAAI,EAAE;QACFP,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export * from "./abstractions/IWebsocketsConnectionRegistry";
2
- export * from "./WebsocketsConnectionRegistry";
1
+ export type * from "./abstractions/IWebsocketsConnectionRegistry.js";
2
+ export * from "./WebsocketsConnectionRegistry.js";
package/registry/index.js CHANGED
@@ -1,29 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _IWebsocketsConnectionRegistry = require("./abstractions/IWebsocketsConnectionRegistry");
7
- Object.keys(_IWebsocketsConnectionRegistry).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _IWebsocketsConnectionRegistry[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _IWebsocketsConnectionRegistry[key];
14
- }
15
- });
16
- });
17
- var _WebsocketsConnectionRegistry = require("./WebsocketsConnectionRegistry");
18
- Object.keys(_WebsocketsConnectionRegistry).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _WebsocketsConnectionRegistry[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _WebsocketsConnectionRegistry[key];
25
- }
26
- });
27
- });
1
+ export * from "./WebsocketsConnectionRegistry.js";
28
2
 
29
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_IWebsocketsConnectionRegistry","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebsocketsConnectionRegistry"],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions/IWebsocketsConnectionRegistry\";\nexport * from \"./WebsocketsConnectionRegistry\";\n"],"mappings":";;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,8BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,8BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,8BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,6BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,6BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,6BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,6BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type * from \"./abstractions/IWebsocketsConnectionRegistry.js\";\nexport * from \"./WebsocketsConnectionRegistry.js\";\n"],"mappings":"AACA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { IWebsocketsResponse, IWebsocketsResponseErrorParams, IWebsocketsResponseErrorResult, IWebsocketsResponseOkParams, IWebsocketsResponseOkResult } from "./abstractions/IWebsocketsResponse";
1
+ import type { IWebsocketsResponse, IWebsocketsResponseErrorParams, IWebsocketsResponseErrorResult, IWebsocketsResponseOkParams, IWebsocketsResponseOkResult } from "./abstractions/IWebsocketsResponse.js";
2
2
  export declare class WebsocketsResponse implements IWebsocketsResponse {
3
3
  ok(params?: IWebsocketsResponseOkParams): IWebsocketsResponseOkResult;
4
4
  error(params: IWebsocketsResponseErrorParams): IWebsocketsResponseErrorResult;
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WebsocketsResponse = void 0;
7
- class WebsocketsResponse {
1
+ export class WebsocketsResponse {
8
2
  ok(params) {
9
3
  return {
10
4
  statusCode: 200,
@@ -24,6 +18,5 @@ class WebsocketsResponse {
24
18
  };
25
19
  }
26
20
  }
27
- exports.WebsocketsResponse = WebsocketsResponse;
28
21
 
29
22
  //# sourceMappingURL=WebsocketsResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["WebsocketsResponse","ok","params","statusCode","error","message","code","data","exports"],"sources":["WebsocketsResponse.ts"],"sourcesContent":["import {\n IWebsocketsResponse,\n IWebsocketsResponseErrorParams,\n IWebsocketsResponseErrorResult,\n IWebsocketsResponseOkParams,\n IWebsocketsResponseOkResult\n} from \"./abstractions/IWebsocketsResponse\";\n\nexport class WebsocketsResponse implements IWebsocketsResponse {\n public ok(params?: IWebsocketsResponseOkParams): IWebsocketsResponseOkResult {\n return {\n statusCode: 200,\n ...params\n };\n }\n\n public error(params: IWebsocketsResponseErrorParams): IWebsocketsResponseErrorResult {\n return {\n ...params,\n statusCode: params.statusCode || 200,\n error: {\n ...params.error,\n message: params.error?.message || params.message,\n code: params.error?.code || \"UNKNOWN_ERROR\",\n data: params.error?.data || {}\n }\n };\n }\n}\n"],"mappings":";;;;;;AAQO,MAAMA,kBAAkB,CAAgC;EACpDC,EAAEA,CAACC,MAAoC,EAA+B;IACzE,OAAO;MACHC,UAAU,EAAE,GAAG;MACf,GAAGD;IACP,CAAC;EACL;EAEOE,KAAKA,CAACF,MAAsC,EAAkC;IACjF,OAAO;MACH,GAAGA,MAAM;MACTC,UAAU,EAAED,MAAM,CAACC,UAAU,IAAI,GAAG;MACpCC,KAAK,EAAE;QACH,GAAGF,MAAM,CAACE,KAAK;QACfC,OAAO,EAAEH,MAAM,CAACE,KAAK,EAAEC,OAAO,IAAIH,MAAM,CAACG,OAAO;QAChDC,IAAI,EAAEJ,MAAM,CAACE,KAAK,EAAEE,IAAI,IAAI,eAAe;QAC3CC,IAAI,EAAEL,MAAM,CAACE,KAAK,EAAEG,IAAI,IAAI,CAAC;MACjC;IACJ,CAAC;EACL;AACJ;AAACC,OAAA,CAAAR,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["WebsocketsResponse","ok","params","statusCode","error","message","code","data"],"sources":["WebsocketsResponse.ts"],"sourcesContent":["import type {\n IWebsocketsResponse,\n IWebsocketsResponseErrorParams,\n IWebsocketsResponseErrorResult,\n IWebsocketsResponseOkParams,\n IWebsocketsResponseOkResult\n} from \"./abstractions/IWebsocketsResponse.js\";\n\nexport class WebsocketsResponse implements IWebsocketsResponse {\n public ok(params?: IWebsocketsResponseOkParams): IWebsocketsResponseOkResult {\n return {\n statusCode: 200,\n ...params\n };\n }\n\n public error(params: IWebsocketsResponseErrorParams): IWebsocketsResponseErrorResult {\n return {\n ...params,\n statusCode: params.statusCode || 200,\n error: {\n ...params.error,\n message: params.error?.message || params.message,\n code: params.error?.code || \"UNKNOWN_ERROR\",\n data: params.error?.data || {}\n }\n };\n }\n}\n"],"mappings":"AAQA,OAAO,MAAMA,kBAAkB,CAAgC;EACpDC,EAAEA,CAACC,MAAoC,EAA+B;IACzE,OAAO;MACHC,UAAU,EAAE,GAAG;MACf,GAAGD;IACP,CAAC;EACL;EAEOE,KAAKA,CAACF,MAAsC,EAAkC;IACjF,OAAO;MACH,GAAGA,MAAM;MACTC,UAAU,EAAED,MAAM,CAACC,UAAU,IAAI,GAAG;MACpCC,KAAK,EAAE;QACH,GAAGF,MAAM,CAACE,KAAK;QACfC,OAAO,EAAEH,MAAM,CAACE,KAAK,EAAEC,OAAO,IAAIH,MAAM,CAACG,OAAO;QAChDC,IAAI,EAAEJ,MAAM,CAACE,KAAK,EAAEE,IAAI,IAAI,eAAe;QAC3CC,IAAI,EAAEL,MAAM,CAACE,KAAK,EAAEG,IAAI,IAAI,CAAC;MACjC;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { GenericRecord } from "@webiny/api/types";
1
+ import type { GenericRecord } from "@webiny/api/types.js";
2
2
  export interface IWebsocketsResponseOkParams {
3
3
  message?: string;
4
4
  data?: GenericRecord<string>;
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=IWebsocketsResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["IWebsocketsResponse.ts"],"sourcesContent":["import { GenericRecord } from \"@webiny/api/types\";\n\nexport interface IWebsocketsResponseOkParams {\n message?: string;\n data?: GenericRecord<string>;\n}\n\nexport interface IWebsocketsResponseOkResult {\n statusCode: number;\n data?: GenericRecord<string>;\n message?: string;\n}\n\nexport interface IWebsocketsResponseErrorParams {\n statusCode?: number;\n error?: Omit<IWebsocketsResponseErrorResultError, \"data\"> &\n Partial<Pick<IWebsocketsResponseErrorResultError, \"data\">>;\n message: string;\n}\n\nexport interface IWebsocketsResponseErrorResultError {\n message: string;\n code: string;\n data: GenericRecord<string>;\n stack?: string;\n}\n\nexport interface IWebsocketsResponseErrorResult {\n statusCode: number;\n error: IWebsocketsResponseErrorResultError;\n}\n\nexport interface IWebsocketsResponse {\n ok(params?: IWebsocketsResponseOkParams): IWebsocketsResponseOkResult;\n error(params: IWebsocketsResponseErrorParams): IWebsocketsResponseErrorResult;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["IWebsocketsResponse.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport interface IWebsocketsResponseOkParams {\n message?: string;\n data?: GenericRecord<string>;\n}\n\nexport interface IWebsocketsResponseOkResult {\n statusCode: number;\n data?: GenericRecord<string>;\n message?: string;\n}\n\nexport interface IWebsocketsResponseErrorParams {\n statusCode?: number;\n error?: Omit<IWebsocketsResponseErrorResultError, \"data\"> &\n Partial<Pick<IWebsocketsResponseErrorResultError, \"data\">>;\n message: string;\n}\n\nexport interface IWebsocketsResponseErrorResultError {\n message: string;\n code: string;\n data: GenericRecord<string>;\n stack?: string;\n}\n\nexport interface IWebsocketsResponseErrorResult {\n statusCode: number;\n error: IWebsocketsResponseErrorResultError;\n}\n\nexport interface IWebsocketsResponse {\n ok(params?: IWebsocketsResponseOkParams): IWebsocketsResponseOkResult;\n error(params: IWebsocketsResponseErrorParams): IWebsocketsResponseErrorResult;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export * from "./abstractions/IWebsocketsResponse";
2
- export * from "./WebsocketsResponse";
1
+ export type * from "./abstractions/IWebsocketsResponse.js";
2
+ export * from "./WebsocketsResponse.js";
package/response/index.js CHANGED
@@ -1,29 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _IWebsocketsResponse = require("./abstractions/IWebsocketsResponse");
7
- Object.keys(_IWebsocketsResponse).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _IWebsocketsResponse[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _IWebsocketsResponse[key];
14
- }
15
- });
16
- });
17
- var _WebsocketsResponse = require("./WebsocketsResponse");
18
- Object.keys(_WebsocketsResponse).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _WebsocketsResponse[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _WebsocketsResponse[key];
25
- }
26
- });
27
- });
1
+ export * from "./WebsocketsResponse.js";
28
2
 
29
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_IWebsocketsResponse","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebsocketsResponse"],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions/IWebsocketsResponse\";\nexport * from \"./WebsocketsResponse\";\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,mBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,mBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,mBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,mBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type * from \"./abstractions/IWebsocketsResponse.js\";\nexport * from \"./WebsocketsResponse.js\";\n"],"mappings":"AACA","ignoreList":[]}