@webiny/api-websockets 6.5.2-beta.0 → 6.5.2-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-websockets",
3
- "version": "6.5.2-beta.0",
3
+ "version": "6.5.2-beta.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,21 +16,21 @@
16
16
  },
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@webiny/api": "6.5.2-beta.0",
20
- "@webiny/api-core": "6.5.2-beta.0",
21
- "@webiny/error": "6.5.2-beta.0",
22
- "@webiny/feature": "6.5.2-beta.0",
23
- "@webiny/handler": "6.5.2-beta.0",
24
- "@webiny/plugins": "6.5.2-beta.0"
19
+ "@webiny/api": "6.5.2-beta.1",
20
+ "@webiny/api-core": "6.5.2-beta.1",
21
+ "@webiny/error": "6.5.2-beta.1",
22
+ "@webiny/feature": "6.5.2-beta.1",
23
+ "@webiny/handler": "6.5.2-beta.1",
24
+ "@webiny/plugins": "6.5.2-beta.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@webiny/api-headless-cms": "6.5.2-beta.0",
28
- "@webiny/aws-sdk": "6.5.2-beta.0",
29
- "@webiny/build-tools": "6.5.2-beta.0",
30
- "@webiny/handler-aws": "6.5.2-beta.0",
31
- "@webiny/handler-db": "6.5.2-beta.0",
32
- "@webiny/handler-graphql": "6.5.2-beta.0",
33
- "@webiny/project-utils": "6.5.2-beta.0",
27
+ "@webiny/api-headless-cms": "6.5.2-beta.1",
28
+ "@webiny/aws-sdk": "6.5.2-beta.1",
29
+ "@webiny/build-tools": "6.5.2-beta.1",
30
+ "@webiny/handler-aws": "6.5.2-beta.1",
31
+ "@webiny/handler-db": "6.5.2-beta.1",
32
+ "@webiny/handler-graphql": "6.5.2-beta.1",
33
+ "@webiny/project-utils": "6.5.2-beta.1",
34
34
  "graphql": "16.14.2",
35
35
  "rimraf": "6.1.3",
36
36
  "type-fest": "5.10.0",
@@ -12,7 +12,7 @@ const createWebsocketsRouteConnectPlugin = ()=>{
12
12
  if (!tenant) return response.error({
13
13
  message: "Missing tenant."
14
14
  });
15
- else if (!identity) return response.error({
15
+ else if (!identity?.id) return response.error({
16
16
  message: "Missing identity."
17
17
  });
18
18
  await registry.register({
@@ -1 +1 @@
1
- {"version":3,"file":"runner/routes/connect.js","sources":["../../../src/runner/routes/connect.ts"],"sourcesContent":["import type { WebsocketsRoute } from \"~/types.js\";\nimport { createWebsocketsRoutePlugin } from \"~/plugins/WebsocketsRoutePlugin.js\";\n\nconst CONNECT: WebsocketsRoute = \"connect\";\n\nconst getConnectedOn = (connectedAt?: number) => {\n if (!connectedAt) {\n return new Date().toISOString();\n }\n return new Date(connectedAt).toISOString();\n};\n\nexport const createWebsocketsRouteConnectPlugin = () => {\n const plugin = createWebsocketsRoutePlugin(CONNECT, async params => {\n const { registry, event, response, getTenant, getIdentity } = params;\n\n const tenant = getTenant();\n const identity = getIdentity();\n if (!tenant) {\n return response.error({\n message: \"Missing tenant.\"\n });\n } else if (!identity) {\n return response.error({\n message: \"Missing identity.\"\n });\n }\n\n await registry.register({\n identity: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n },\n connectionId: event.context.connectionId,\n tenant,\n endpoint: event.context.endpoint,\n connectedOn: getConnectedOn(event.context.connectedAt)\n });\n\n return response.ok();\n });\n plugin.name = \"websockets.route.connect.default\";\n return plugin;\n};\n"],"names":["CONNECT","getConnectedOn","connectedAt","Date","createWebsocketsRouteConnectPlugin","plugin","createWebsocketsRoutePlugin","params","registry","event","response","getTenant","getIdentity","tenant","identity"],"mappings":";AAGA,MAAMA,UAA2B;AAEjC,MAAMC,iBAAiB,CAACC;IACpB,IAAI,CAACA,aACD,OAAO,IAAIC,OAAO,WAAW;IAEjC,OAAO,IAAIA,KAAKD,aAAa,WAAW;AAC5C;AAEO,MAAME,qCAAqC;IAC9C,MAAMC,SAASC,4BAA4BN,SAAS,OAAMO;QACtD,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAE,GAAGL;QAE9D,MAAMM,SAASF;QACf,MAAMG,WAAWF;QACjB,IAAI,CAACC,QACD,OAAOH,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;aACG,IAAI,CAACI,UACR,OAAOJ,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;QAGJ,MAAMF,SAAS,QAAQ,CAAC;YACpB,UAAU;gBACN,IAAIM,SAAS,EAAE;gBACf,aAAaA,SAAS,WAAW;gBACjC,MAAMA,SAAS,IAAI;YACvB;YACA,cAAcL,MAAM,OAAO,CAAC,YAAY;YACxCI;YACA,UAAUJ,MAAM,OAAO,CAAC,QAAQ;YAChC,aAAaR,eAAeQ,MAAM,OAAO,CAAC,WAAW;QACzD;QAEA,OAAOC,SAAS,EAAE;IACtB;IACAL,OAAO,IAAI,GAAG;IACd,OAAOA;AACX"}
1
+ {"version":3,"file":"runner/routes/connect.js","sources":["../../../src/runner/routes/connect.ts"],"sourcesContent":["import type { WebsocketsRoute } from \"~/types.js\";\nimport { createWebsocketsRoutePlugin } from \"~/plugins/WebsocketsRoutePlugin.js\";\n\nconst CONNECT: WebsocketsRoute = \"connect\";\n\nconst getConnectedOn = (connectedAt?: number) => {\n if (!connectedAt) {\n return new Date().toISOString();\n }\n return new Date(connectedAt).toISOString();\n};\n\nexport const createWebsocketsRouteConnectPlugin = () => {\n const plugin = createWebsocketsRoutePlugin(CONNECT, async params => {\n const { registry, event, response, getTenant, getIdentity } = params;\n\n const tenant = getTenant();\n const identity = getIdentity();\n if (!tenant) {\n return response.error({\n message: \"Missing tenant.\"\n });\n } else if (!identity?.id) {\n return response.error({\n message: \"Missing identity.\"\n });\n }\n\n await registry.register({\n identity: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n },\n connectionId: event.context.connectionId,\n tenant,\n endpoint: event.context.endpoint,\n connectedOn: getConnectedOn(event.context.connectedAt)\n });\n\n return response.ok();\n });\n plugin.name = \"websockets.route.connect.default\";\n return plugin;\n};\n"],"names":["CONNECT","getConnectedOn","connectedAt","Date","createWebsocketsRouteConnectPlugin","plugin","createWebsocketsRoutePlugin","params","registry","event","response","getTenant","getIdentity","tenant","identity"],"mappings":";AAGA,MAAMA,UAA2B;AAEjC,MAAMC,iBAAiB,CAACC;IACpB,IAAI,CAACA,aACD,OAAO,IAAIC,OAAO,WAAW;IAEjC,OAAO,IAAIA,KAAKD,aAAa,WAAW;AAC5C;AAEO,MAAME,qCAAqC;IAC9C,MAAMC,SAASC,4BAA4BN,SAAS,OAAMO;QACtD,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAE,GAAGL;QAE9D,MAAMM,SAASF;QACf,MAAMG,WAAWF;QACjB,IAAI,CAACC,QACD,OAAOH,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;aACG,IAAI,CAACI,UAAU,IAClB,OAAOJ,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;QAGJ,MAAMF,SAAS,QAAQ,CAAC;YACpB,UAAU;gBACN,IAAIM,SAAS,EAAE;gBACf,aAAaA,SAAS,WAAW;gBACjC,MAAMA,SAAS,IAAI;YACvB;YACA,cAAcL,MAAM,OAAO,CAAC,YAAY;YACxCI;YACA,UAAUJ,MAAM,OAAO,CAAC,QAAQ;YAChC,aAAaR,eAAeQ,MAAM,OAAO,CAAC,WAAW;QACzD;QAEA,OAAOC,SAAS,EAAE;IACtB;IACAL,OAAO,IAAI,GAAG;IACd,OAAOA;AACX"}
@@ -8,7 +8,7 @@ const createWebsocketsRouteDefaultPlugin = ()=>{
8
8
  if (!tenant) return response.error({
9
9
  message: "Missing tenant."
10
10
  });
11
- else if (!identity) return response.error({
11
+ else if (!identity?.id) return response.error({
12
12
  message: "Missing identity."
13
13
  });
14
14
  return response.ok();
@@ -1 +1 @@
1
- {"version":3,"file":"runner/routes/default.js","sources":["../../../src/runner/routes/default.ts"],"sourcesContent":["import type { WebsocketsRoute } from \"~/types.js\";\nimport { createWebsocketsRoutePlugin } from \"~/plugins/WebsocketsRoutePlugin.js\";\n\nconst DEFAULT: WebsocketsRoute = \"default\";\n\nexport const createWebsocketsRouteDefaultPlugin = () => {\n const plugin = createWebsocketsRoutePlugin(DEFAULT, async params => {\n const { response, getIdentity, getTenant } = params;\n const tenant = getTenant();\n const identity = getIdentity();\n if (!tenant) {\n return response.error({\n message: \"Missing tenant.\"\n });\n } else if (!identity) {\n return response.error({\n message: \"Missing identity.\"\n });\n }\n\n return response.ok();\n });\n\n plugin.name = \"websockets.route.default.default\";\n return plugin;\n};\n"],"names":["DEFAULT","createWebsocketsRouteDefaultPlugin","plugin","createWebsocketsRoutePlugin","params","response","getIdentity","getTenant","tenant","identity"],"mappings":";AAGA,MAAMA,UAA2B;AAE1B,MAAMC,qCAAqC;IAC9C,MAAMC,SAASC,4BAA4BH,SAAS,OAAMI;QACtD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGH;QAC7C,MAAMI,SAASD;QACf,MAAME,WAAWH;QACjB,IAAI,CAACE,QACD,OAAOH,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;aACG,IAAI,CAACI,UACR,OAAOJ,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;QAGJ,OAAOA,SAAS,EAAE;IACtB;IAEAH,OAAO,IAAI,GAAG;IACd,OAAOA;AACX"}
1
+ {"version":3,"file":"runner/routes/default.js","sources":["../../../src/runner/routes/default.ts"],"sourcesContent":["import type { WebsocketsRoute } from \"~/types.js\";\nimport { createWebsocketsRoutePlugin } from \"~/plugins/WebsocketsRoutePlugin.js\";\n\nconst DEFAULT: WebsocketsRoute = \"default\";\n\nexport const createWebsocketsRouteDefaultPlugin = () => {\n const plugin = createWebsocketsRoutePlugin(DEFAULT, async params => {\n const { response, getIdentity, getTenant } = params;\n const tenant = getTenant();\n const identity = getIdentity();\n if (!tenant) {\n return response.error({\n message: \"Missing tenant.\"\n });\n } else if (!identity?.id) {\n return response.error({\n message: \"Missing identity.\"\n });\n }\n\n return response.ok();\n });\n\n plugin.name = \"websockets.route.default.default\";\n return plugin;\n};\n"],"names":["DEFAULT","createWebsocketsRouteDefaultPlugin","plugin","createWebsocketsRoutePlugin","params","response","getIdentity","getTenant","tenant","identity"],"mappings":";AAGA,MAAMA,UAA2B;AAE1B,MAAMC,qCAAqC;IAC9C,MAAMC,SAASC,4BAA4BH,SAAS,OAAMI;QACtD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGH;QAC7C,MAAMI,SAASD;QACf,MAAME,WAAWH;QACjB,IAAI,CAACE,QACD,OAAOH,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;aACG,IAAI,CAACI,UAAU,IAClB,OAAOJ,SAAS,KAAK,CAAC;YAClB,SAAS;QACb;QAGJ,OAAOA,SAAS,EAAE;IACtB;IAEAH,OAAO,IAAI,GAAG;IACd,OAAOA;AACX"}