@rivet-gg/chat 0.0.5 → 0.0.7

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.
@@ -12,22 +12,37 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
12
12
  const common_1 = require("@rivet-gg/common");
13
13
  class ChatServiceClient extends smithy_client_1.Client {
14
14
  constructor(configuration) {
15
- if (!configuration.hasOwnProperty("requestHandler")) {
16
- if (typeof window !== "undefined")
17
- configuration.requestHandler = common_1.middleware.browser.requestHandlerMiddleware(configuration.token);
18
- else
19
- configuration.requestHandler = common_1.middleware.nodejs.requestHandlerMiddleware(configuration.token);
20
- }
21
15
  function rivetConfig(input) {
22
- var _a, _b, _c;
16
+ var _a, _b, _c, _d, _e;
17
+ let endpoint = (_a = configuration.endpoint) !== null && _a !== void 0 ? _a : null;
18
+ if (endpoint === null) {
19
+ try {
20
+ endpoint = (_b = process.env.RIVET_CHAT_API_URL) !== null && _b !== void 0 ? _b : null;
21
+ }
22
+ catch (_f) {
23
+ }
24
+ if (endpoint === null) {
25
+ endpoint = "https://chat.api.rivet.gg/v1";
26
+ }
27
+ }
28
+ let token = (_c = input.token) !== null && _c !== void 0 ? _c : null;
29
+ if (token === null) {
30
+ try {
31
+ token = (_e = (_d = process.env.RIVET_CHAT_TOKEN) !== null && _d !== void 0 ? _d : process.env.RIVET_TOKEN) !== null && _e !== void 0 ? _e : null;
32
+ }
33
+ catch (_g) {
34
+ }
35
+ }
23
36
  return Object.assign(Object.assign({}, input), {
24
- endpoint: (_a = configuration.endpoint) !== null && _a !== void 0 ? _a : (typeof process !== "undefined" ?
25
- ((_b = process.env.RIVET_CHAT_API_URL) !== null && _b !== void 0 ? _b : "") : ""),
26
- token: (_c = input.token) !== null && _c !== void 0 ? _c : null,
37
+ endpoint,
38
+ token,
27
39
  });
28
40
  }
29
41
  let _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration);
30
42
  let _config_1 = rivetConfig(_config_0);
43
+ if (!configuration.hasOwnProperty("requestHandler")) {
44
+ _config_1.requestHandler = common_1.middleware.requestHandlerMiddleware(_config_1.token);
45
+ }
31
46
  let _config_2 = (0, config_resolver_1.resolveCustomEndpointsConfig)(_config_1);
32
47
  let _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);
33
48
  let _config_4 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_3);
@@ -920,9 +920,9 @@ const deserializeAws_restJson1IdentityExternalLinks = (output, context) => {
920
920
  };
921
921
  const deserializeAws_restJson1IdentityGameActivity = (output, context) => {
922
922
  return {
923
- friendMetadata: (output.friend_metadata !== undefined && output.friend_metadata !== null) ? deserializeAws_restJson1Document(output.friend_metadata, context) : undefined,
924
923
  game: (output.game !== undefined && output.game !== null) ? deserializeAws_restJson1GameHandle(output.game, context) : undefined,
925
924
  message: (0, smithy_client_1.expectString)(output.message),
925
+ mutualMetadata: (output.mutual_metadata !== undefined && output.mutual_metadata !== null) ? deserializeAws_restJson1Document(output.mutual_metadata, context) : undefined,
926
926
  publicMetadata: (output.public_metadata !== undefined && output.public_metadata !== null) ? deserializeAws_restJson1Document(output.public_metadata, context) : undefined,
927
927
  };
928
928
  };
@@ -12,22 +12,37 @@ var ChatServiceClient = (function (_super) {
12
12
  __extends(ChatServiceClient, _super);
13
13
  function ChatServiceClient(configuration) {
14
14
  var _this = this;
15
- if (!configuration.hasOwnProperty("requestHandler")) {
16
- if (typeof window !== "undefined")
17
- configuration.requestHandler = __middleware.browser.requestHandlerMiddleware(configuration.token);
18
- else
19
- configuration.requestHandler = __middleware.nodejs.requestHandlerMiddleware(configuration.token);
20
- }
21
15
  function rivetConfig(input) {
22
- var _a, _b, _c;
16
+ var _a, _b, _c, _d, _e;
17
+ var endpoint = (_a = configuration.endpoint) !== null && _a !== void 0 ? _a : null;
18
+ if (endpoint === null) {
19
+ try {
20
+ endpoint = (_b = process.env.RIVET_CHAT_API_URL) !== null && _b !== void 0 ? _b : null;
21
+ }
22
+ catch (_f) {
23
+ }
24
+ if (endpoint === null) {
25
+ endpoint = "https://chat.api.rivet.gg/v1";
26
+ }
27
+ }
28
+ var token = (_c = input.token) !== null && _c !== void 0 ? _c : null;
29
+ if (token === null) {
30
+ try {
31
+ token = (_e = (_d = process.env.RIVET_CHAT_TOKEN) !== null && _d !== void 0 ? _d : process.env.RIVET_TOKEN) !== null && _e !== void 0 ? _e : null;
32
+ }
33
+ catch (_g) {
34
+ }
35
+ }
23
36
  return Object.assign(Object.assign({}, input), {
24
- endpoint: (_a = configuration.endpoint) !== null && _a !== void 0 ? _a : (typeof process !== "undefined" ?
25
- ((_b = process.env.RIVET_CHAT_API_URL) !== null && _b !== void 0 ? _b : "") : ""),
26
- token: (_c = input.token) !== null && _c !== void 0 ? _c : null,
37
+ endpoint: endpoint,
38
+ token: token,
27
39
  });
28
40
  }
29
41
  var _config_0 = __getRuntimeConfig(configuration);
30
42
  var _config_1 = rivetConfig(_config_0);
43
+ if (!configuration.hasOwnProperty("requestHandler")) {
44
+ _config_1.requestHandler = __middleware.requestHandlerMiddleware(_config_1.token);
45
+ }
31
46
  var _config_2 = resolveCustomEndpointsConfig(_config_1);
32
47
  var _config_3 = resolveRetryConfig(_config_2);
33
48
  var _config_4 = resolveHostHeaderConfig(_config_3);
@@ -1100,9 +1100,9 @@ var deserializeAws_restJson1IdentityExternalLinks = function (output, context) {
1100
1100
  };
1101
1101
  var deserializeAws_restJson1IdentityGameActivity = function (output, context) {
1102
1102
  return {
1103
- friendMetadata: (output.friend_metadata !== undefined && output.friend_metadata !== null) ? deserializeAws_restJson1Document(output.friend_metadata, context) : undefined,
1104
1103
  game: (output.game !== undefined && output.game !== null) ? deserializeAws_restJson1GameHandle(output.game, context) : undefined,
1105
1104
  message: __expectString(output.message),
1105
+ mutualMetadata: (output.mutual_metadata !== undefined && output.mutual_metadata !== null) ? deserializeAws_restJson1Document(output.mutual_metadata, context) : undefined,
1106
1106
  publicMetadata: (output.public_metadata !== undefined && output.public_metadata !== null) ? deserializeAws_restJson1Document(output.public_metadata, context) : undefined,
1107
1107
  };
1108
1108
  };
@@ -7,7 +7,7 @@ export declare enum QueryDirection {
7
7
  */
8
8
  AFTER = "after",
9
9
  /**
10
- * Query messages send before given timestmap.
10
+ * Query messages send before given timestamp.
11
11
  */
12
12
  BEFORE = "before",
13
13
  /**
@@ -283,9 +283,9 @@ export interface IdentityGameActivity {
283
283
  */
284
284
  publicMetadata?: __DocumentType;
285
285
  /**
286
- * JSON data seen only by the given identity and their friends.
286
+ * JSON data seen only by the given identity and their mutual followers.
287
287
  */
288
- friendMetadata?: __DocumentType;
288
+ mutualMetadata?: __DocumentType;
289
289
  }
290
290
  export declare namespace IdentityGameActivity {
291
291
  /**
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"Rivet Gaming, LLC","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"bugs":{"email":"developer@rivet.gg"},"dependencies":{"@aws-crypto/sha256-browser":"2.0.0","@aws-crypto/sha256-js":"2.0.0","@aws-sdk/config-resolver":"3.80.0","@aws-sdk/fetch-http-handler":"3.78.0","@aws-sdk/hash-node":"3.78.0","@aws-sdk/invalid-dependency":"3.78.0","@aws-sdk/middleware-content-length":"3.78.0","@aws-sdk/middleware-host-header":"3.78.0","@aws-sdk/middleware-logger":"3.78.0","@aws-sdk/middleware-retry":"3.80.0","@aws-sdk/middleware-serde":"3.78.0","@aws-sdk/middleware-stack":"3.78.0","@aws-sdk/middleware-user-agent":"3.78.0","@aws-sdk/node-config-provider":"3.80.0","@aws-sdk/node-http-handler":"3.94.0","@aws-sdk/protocol-http":"3.78.0","@aws-sdk/smithy-client":"3.99.0","@aws-sdk/types":"3.78.0","@aws-sdk/url-parser":"3.78.0","@aws-sdk/util-base64-browser":"3.58.0","@aws-sdk/util-base64-node":"3.55.0","@aws-sdk/util-body-length-browser":"3.55.0","@aws-sdk/util-body-length-node":"3.55.0","@aws-sdk/util-defaults-mode-browser":"3.99.0","@aws-sdk/util-defaults-mode-node":"3.99.0","@aws-sdk/util-user-agent-browser":"3.78.0","@aws-sdk/util-user-agent-node":"3.80.0","@aws-sdk/util-utf8-browser":"3.55.0","@aws-sdk/util-utf8-node":"3.55.0","@rivet-gg/common":"git+https://github.com/rivet-gg/rivet-sdk-js.git#ce562016be3be5ce2bdcd2d662c89acb7567ecd1","tslib":"^2.3.1"},"description":"Rivet service enabling identities to send and receive chat messages","devDependencies":{"@aws-sdk/service-client-documentation-generator":"git+https://github.com/rivet-gg/service-client-documentation-generator.git","@tsconfig/recommended":"1.0.1","@types/node":"^12.7.5","concurrently":"7.0.0","downlevel-dts":"0.7.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.6.2"},"engines":{"node":">=12.0.0"},"files":["dist-*"],"homepage":"https://rivet.gg/","license":"Apache-2.0","main":"./dist-cjs/index.js","module":"./dist-es/index.js","name":"@rivet-gg/chat","overrides":{"typedoc":{"typescript":"~4.6.2"}},"private":false,"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"scripts":{"build":"yarn run build:cjs && yarn run build:es && yarn run build:types","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","build:es":"tsc -p tsconfig.es.json","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","prepack":"yarn run clean && yarn run build"},"sideEffects":false,"types":"./dist-types/index.d.ts","typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"version":"0.0.5"}
1
+ {"author":"Rivet Gaming, LLC","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"bugs":{"email":"developer@rivet.gg"},"dependencies":{"@aws-crypto/sha256-browser":"2.0.0","@aws-crypto/sha256-js":"2.0.0","@aws-sdk/config-resolver":"3.80.0","@aws-sdk/fetch-http-handler":"3.78.0","@aws-sdk/hash-node":"3.78.0","@aws-sdk/invalid-dependency":"3.78.0","@aws-sdk/middleware-content-length":"3.78.0","@aws-sdk/middleware-host-header":"3.78.0","@aws-sdk/middleware-logger":"3.78.0","@aws-sdk/middleware-retry":"3.80.0","@aws-sdk/middleware-serde":"3.78.0","@aws-sdk/middleware-stack":"3.78.0","@aws-sdk/middleware-user-agent":"3.78.0","@aws-sdk/node-config-provider":"3.80.0","@aws-sdk/node-http-handler":"3.94.0","@aws-sdk/protocol-http":"3.78.0","@aws-sdk/smithy-client":"3.99.0","@aws-sdk/types":"3.78.0","@aws-sdk/url-parser":"3.78.0","@aws-sdk/util-base64-browser":"3.58.0","@aws-sdk/util-base64-node":"3.55.0","@aws-sdk/util-body-length-browser":"3.55.0","@aws-sdk/util-body-length-node":"3.55.0","@aws-sdk/util-defaults-mode-browser":"3.99.0","@aws-sdk/util-defaults-mode-node":"3.99.0","@aws-sdk/util-user-agent-browser":"3.78.0","@aws-sdk/util-user-agent-node":"3.80.0","@aws-sdk/util-utf8-browser":"3.55.0","@aws-sdk/util-utf8-node":"3.55.0","@rivet-gg/common":"git+https://github.com/rivet-gg/rivet-sdk-js.git#4f439a15506de88c24c0e08ae3e5fe05cb0c60a0","tslib":"^2.3.1"},"description":"Rivet service enabling identities to send and receive chat messages","devDependencies":{"@aws-sdk/service-client-documentation-generator":"git+https://github.com/rivet-gg/service-client-documentation-generator.git","@tsconfig/recommended":"1.0.1","@types/node":"^12.7.5","concurrently":"7.0.0","downlevel-dts":"0.7.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.6.2"},"engines":{"node":">=12.0.0"},"files":["dist-*"],"homepage":"https://rivet.gg/","license":"Apache-2.0","main":"./dist-cjs/index.js","module":"./dist-es/index.js","name":"@rivet-gg/chat","overrides":{"typedoc":{"typescript":"~4.6.2"}},"private":false,"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"scripts":{"build":"yarn run build:cjs && yarn run build:es && yarn run build:types","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","build:es":"tsc -p tsconfig.es.json","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","prepack":"yarn run clean && yarn run build"},"sideEffects":false,"types":"./dist-types/index.d.ts","typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"version":"0.0.7"}