@aws-amplify/pubsub 6.0.1-unstable.cfbde4c.0 → 6.0.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 (101) hide show
  1. package/{lib → dist/cjs}/Providers/AWSIot.js +3 -1
  2. package/dist/cjs/Providers/AWSIot.js.map +1 -0
  3. package/{lib → dist/cjs}/Providers/MqttOverWS.js +4 -2
  4. package/dist/cjs/Providers/MqttOverWS.js.map +1 -0
  5. package/{lib → dist/cjs}/Providers/PubSub.js +3 -1
  6. package/dist/cjs/Providers/PubSub.js.map +1 -0
  7. package/{lib → dist/cjs}/Providers/constants.js +6 -7
  8. package/dist/cjs/Providers/constants.js.map +1 -0
  9. package/{lib → dist/cjs}/Providers/index.js +3 -1
  10. package/dist/cjs/Providers/index.js.map +1 -0
  11. package/{lib → dist/cjs}/clients/iot.js +3 -1
  12. package/dist/cjs/clients/iot.js.map +1 -0
  13. package/{lib → dist/cjs}/clients/mqtt.js +3 -1
  14. package/dist/cjs/clients/mqtt.js.map +1 -0
  15. package/{lib → dist/cjs}/index.js +3 -1
  16. package/dist/cjs/index.js.map +1 -0
  17. package/{lib → dist/cjs}/types/PubSub.js +5 -6
  18. package/dist/cjs/types/PubSub.js.map +1 -0
  19. package/{lib → dist/cjs}/types/index.js +3 -1
  20. package/dist/cjs/types/index.js.map +1 -0
  21. package/{lib → dist/cjs}/utils/ConnectionStateMonitor.js +3 -1
  22. package/dist/cjs/utils/ConnectionStateMonitor.js.map +1 -0
  23. package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.js +3 -1
  24. package/dist/cjs/utils/ReachabilityMonitor/index.js.map +1 -0
  25. package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.native.js +3 -1
  26. package/dist/cjs/utils/ReachabilityMonitor/index.native.js.map +1 -0
  27. package/{lib → dist/cjs}/utils/ReconnectionMonitor.js +3 -1
  28. package/dist/cjs/utils/ReconnectionMonitor.js.map +1 -0
  29. package/{lib-esm/Providers/AWSIot.js → dist/esm/Providers/AWSIot.mjs} +8 -4
  30. package/dist/esm/Providers/AWSIot.mjs.map +1 -0
  31. package/{lib-esm/Providers/MqttOverWS.js → dist/esm/Providers/MqttOverWS.mjs} +16 -12
  32. package/dist/esm/Providers/MqttOverWS.mjs.map +1 -0
  33. package/{lib-esm/Providers/PubSub.js → dist/esm/Providers/PubSub.mjs} +7 -3
  34. package/dist/esm/Providers/PubSub.mjs.map +1 -0
  35. package/{lib-esm/Providers/constants.js → dist/esm/Providers/constants.mjs} +18 -14
  36. package/dist/esm/Providers/constants.mjs.map +1 -0
  37. package/dist/esm/Providers/index.mjs +4 -0
  38. package/dist/esm/Providers/index.mjs.map +1 -0
  39. package/dist/esm/clients/iot.mjs +4 -0
  40. package/dist/esm/clients/iot.mjs.map +1 -0
  41. package/dist/esm/clients/mqtt.mjs +5 -0
  42. package/dist/esm/clients/mqtt.mjs.map +1 -0
  43. package/dist/esm/index.mjs +6 -0
  44. package/dist/esm/index.mjs.map +1 -0
  45. package/{lib-esm/types/PubSub.js → dist/esm/types/PubSub.mjs} +5 -2
  46. package/dist/esm/types/PubSub.mjs.map +1 -0
  47. package/dist/esm/types/index.mjs +2 -0
  48. package/dist/esm/types/index.mjs.map +1 -0
  49. package/{lib-esm/utils/ConnectionStateMonitor.js → dist/esm/utils/ConnectionStateMonitor.mjs} +9 -5
  50. package/dist/esm/utils/ConnectionStateMonitor.mjs.map +1 -0
  51. package/dist/esm/utils/ReachabilityMonitor/index.d.ts +1 -0
  52. package/{lib-esm/utils/ReachabilityMonitor/index.js → dist/esm/utils/ReachabilityMonitor/index.mjs} +6 -2
  53. package/dist/esm/utils/ReachabilityMonitor/index.mjs.map +1 -0
  54. package/dist/esm/utils/ReachabilityMonitor/index.native.d.ts +1 -0
  55. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs +9 -0
  56. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs.map +1 -0
  57. package/{lib-esm/utils/ReconnectionMonitor.js → dist/esm/utils/ReconnectionMonitor.mjs} +7 -3
  58. package/dist/esm/utils/ReconnectionMonitor.mjs.map +1 -0
  59. package/iot/packages.json +5 -4
  60. package/mqtt/packages.json +5 -4
  61. package/package.json +147 -146
  62. package/src/Providers/MqttOverWS.ts +3 -3
  63. package/src/Providers/PubSub.ts +2 -2
  64. package/lib/Providers/AWSIot.d.ts +0 -10
  65. package/lib/Providers/MqttOverWS.d.ts +0 -58
  66. package/lib/Providers/PubSub.d.ts +0 -11
  67. package/lib/Providers/constants.d.ts +0 -95
  68. package/lib/Providers/index.d.ts +0 -3
  69. package/lib/clients/iot.d.ts +0 -1
  70. package/lib/clients/mqtt.d.ts +0 -1
  71. package/lib/index.d.ts +0 -4
  72. package/lib/tsconfig.tsbuildinfo +0 -1
  73. package/lib/types/PubSub.d.ts +0 -45
  74. package/lib/types/index.d.ts +0 -1
  75. package/lib/utils/ConnectionStateMonitor.d.ts +0 -41
  76. package/lib/utils/ReachabilityMonitor/index.d.ts +0 -1
  77. package/lib/utils/ReachabilityMonitor/index.native.d.ts +0 -1
  78. package/lib/utils/ReconnectionMonitor.d.ts +0 -29
  79. package/lib-esm/Providers/index.js +0 -5
  80. package/lib-esm/clients/iot.js +0 -3
  81. package/lib-esm/clients/mqtt.js +0 -3
  82. package/lib-esm/index.js +0 -6
  83. package/lib-esm/tsconfig.tsbuildinfo +0 -1
  84. package/lib-esm/types/index.js +0 -3
  85. package/lib-esm/utils/ReachabilityMonitor/index.d.ts +0 -1
  86. package/lib-esm/utils/ReachabilityMonitor/index.native.d.ts +0 -1
  87. package/lib-esm/utils/ReachabilityMonitor/index.native.js +0 -5
  88. /package/{lib-esm → dist/cjs}/vendor/paho-mqtt.js +0 -0
  89. /package/{lib-esm → dist/esm}/Providers/AWSIot.d.ts +0 -0
  90. /package/{lib-esm → dist/esm}/Providers/MqttOverWS.d.ts +0 -0
  91. /package/{lib-esm → dist/esm}/Providers/PubSub.d.ts +0 -0
  92. /package/{lib-esm → dist/esm}/Providers/constants.d.ts +0 -0
  93. /package/{lib-esm → dist/esm}/Providers/index.d.ts +0 -0
  94. /package/{lib-esm → dist/esm}/clients/iot.d.ts +0 -0
  95. /package/{lib-esm → dist/esm}/clients/mqtt.d.ts +0 -0
  96. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  97. /package/{lib-esm → dist/esm}/types/PubSub.d.ts +0 -0
  98. /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
  99. /package/{lib-esm → dist/esm}/utils/ConnectionStateMonitor.d.ts +0 -0
  100. /package/{lib-esm → dist/esm}/utils/ReconnectionMonitor.d.ts +0 -0
  101. /package/{lib → dist/esm}/vendor/paho-mqtt.js +0 -0
package/package.json CHANGED
@@ -1,148 +1,149 @@
1
1
  {
2
- "name": "@aws-amplify/pubsub",
3
- "version": "6.0.1-unstable.cfbde4c.0+cfbde4c",
4
- "description": "Pubsub category of aws-amplify",
5
- "main": "./lib/index.js",
6
- "module": "./lib-esm/index.js",
7
- "typings": "./lib-esm/index.d.ts",
8
- "react-native": {
9
- "./lib/index": "./lib-esm/index.js"
10
- },
11
- "sideEffects": false,
12
- "publishConfig": {
13
- "access": "public"
14
- },
15
- "scripts": {
16
- "test": "npm run lint && jest -w 1 --coverage",
17
- "test:size": "size-limit",
18
- "build-with-test": "npm run clean && npm test && tsc && webpack",
19
- "build:cjs": "rimraf lib && tsc -m commonjs --outDir lib && cp -R src/vendor lib/vendor && webpack && webpack --config ./webpack.config.dev.js",
20
- "build:esm": "rimraf lib-esm && tsc -m esnext --outDir lib-esm && cp -R src/vendor lib-esm/vendor",
21
- "build:cjs:watch": "rimraf lib && tsc -m commonjs --outDir lib --watch",
22
- "build:esm:watch": "rimraf lib-esm && tsc -m esnext --outDir lib-esm --watch",
23
- "build": "npm run clean && npm run build:esm && npm run build:cjs",
24
- "clean": "npm run clean:size && rimraf lib-esm lib dist",
25
- "clean:size": "rimraf dual-publish-tmp tmp*",
26
- "format": "echo \"Not implemented\"",
27
- "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
28
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 93.0 -i src/vendor/paho-mqtt.js"
29
- },
30
- "typesVersions": {
31
- ">=4.2": {
32
- "iot": [
33
- "./lib-esm/clients/iot.d.ts"
34
- ],
35
- "mqtt": [
36
- "./lib-esm/clients/mqtt.d.ts"
37
- ]
38
- }
39
- },
40
- "exports": {
41
- ".": {
42
- "types": "./lib-esm/index.d.ts",
43
- "import": "./lib-esm/index.js",
44
- "require": "./lib/index.js"
45
- },
46
- "./iot": {
47
- "types": "./lib-esm/clients/iot.d.ts",
48
- "import": "./lib-esm/clients/iot.js",
49
- "require": "./lib/clients/iot.js"
50
- },
51
- "./mqtt": {
52
- "types": "./lib-esm/clients/mqtt.d.ts",
53
- "import": "./lib-esm/clients/mqtt.js",
54
- "require": "./lib/clients/mqtt.js"
55
- }
56
- },
57
- "repository": {
58
- "type": "git",
59
- "url": "https://github.com/aws-amplify/amplify-js.git"
60
- },
61
- "author": "Amazon Web Services",
62
- "license": "Apache-2.0",
63
- "bugs": {
64
- "url": "https://github.com/aws/aws-amplify/issues"
65
- },
66
- "homepage": "https://aws-amplify.github.io/",
67
- "files": [
68
- "lib",
69
- "lib-esm",
70
- "src",
71
- "iot",
72
- "mqtt"
73
- ],
74
- "dependencies": {
75
- "@aws-amplify/auth": "6.0.1-unstable.cfbde4c.0+cfbde4c",
76
- "buffer": "4.9.2",
77
- "graphql": "15.8.0",
78
- "rxjs": "^7.8.1",
79
- "tslib": "^2.5.0",
80
- "url": "0.11.0"
81
- },
82
- "peerDependencies": {
83
- "@aws-amplify/core": "6.0.1-unstable.cfbde4c.0+cfbde4c"
84
- },
85
- "devDependencies": {
86
- "@aws-amplify/core": "6.0.1-unstable.cfbde4c.0+cfbde4c",
87
- "typescript": "5.0.2"
88
- },
89
- "size-limit": [
90
- {
91
- "name": "PubSub (IoT provider)",
92
- "path": "./lib-esm/index.js",
93
- "import": "{ generateClient }",
94
- "limit": "1.2 kB"
95
- },
96
- {
97
- "name": "PubSub (Mqtt provider)",
98
- "path": "./lib-esm/clients/mqtt.js",
99
- "import": "{ generateClient }",
100
- "limit": "1.07 kB"
101
- }
102
- ],
103
- "jest": {
104
- "globals": {
105
- "ts-jest": {
106
- "diagnostics": false,
107
- "tsConfig": {
108
- "allowJs": true,
109
- "noEmitOnError": false
110
- }
111
- },
112
- "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
113
- "testPathIgnorePatterns": [
114
- "__tests__/helpers.ts"
115
- ]
116
- },
117
- "transform": {
118
- "^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
119
- },
120
- "testPathIgnorePatterns": [
121
- "__tests__/helpers.ts"
122
- ],
123
- "moduleFileExtensions": [
124
- "ts",
125
- "tsx",
126
- "js",
127
- "json",
128
- "jsx"
129
- ],
130
- "testEnvironment": "jsdom",
131
- "testURL": "http://localhost/",
132
- "coverageThreshold": {
133
- "global": {
134
- "branches": 0,
135
- "functions": 0,
136
- "lines": 0,
137
- "statements": 0
138
- }
139
- },
140
- "coveragePathIgnorePatterns": [
141
- "node_modules",
142
- "dist",
143
- "lib",
144
- "lib-esm"
145
- ]
146
- },
147
- "gitHead": "cfbde4c7962de77bd43ba20811b84c4d7d333b42"
2
+ "name": "@aws-amplify/pubsub",
3
+ "version": "6.0.1",
4
+ "description": "Pubsub category of aws-amplify",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.mjs",
7
+ "typings": "./dist/esm/index.d.ts",
8
+ "react-native": "./src/index.ts",
9
+ "sideEffects": false,
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "test": "npm run lint && jest -w 1 --coverage",
15
+ "test:size": "size-limit",
16
+ "build-with-test": "npm run clean && npm run build",
17
+ "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
18
+ "build:esm-cjs": "rollup -c rollup.config.mjs && cp -R src/vendor dist/cjs/vendor && cp -R src/vendor dist/esm/vendor",
19
+ "build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
20
+ "build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
21
+ "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
22
+ "clean": "npm run clean:size && rimraf dist lib lib-esm",
23
+ "clean:size": "rimraf dual-publish-tmp tmp*",
24
+ "format": "echo \"Not implemented\"",
25
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
26
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 93.0 -i src/vendor/paho-mqtt.js"
27
+ },
28
+ "typesVersions": {
29
+ ">=4.2": {
30
+ "iot": [
31
+ "./dist/esm/clients/iot.d.ts"
32
+ ],
33
+ "mqtt": [
34
+ "./dist/esm/clients/mqtt.d.ts"
35
+ ]
36
+ }
37
+ },
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/esm/index.d.ts",
41
+ "import": "./dist/esm/index.mjs",
42
+ "require": "./dist/cjs/index.js",
43
+ "react-native": "./src/index.ts"
44
+ },
45
+ "./iot": {
46
+ "types": "./dist/esm/clients/iot.d.ts",
47
+ "import": "./dist/esm/clients/iot.mjs",
48
+ "require": "./dist/cjs/clients/iot.js",
49
+ "react-native": "./src/clients/iot.ts"
50
+ },
51
+ "./mqtt": {
52
+ "types": "./dist/esm/clients/mqtt.d.ts",
53
+ "import": "./dist/esm/clients/mqtt.mjs",
54
+ "require": "./dist/cjs/clients/mqtt.js",
55
+ "react-native": "./src/clients/mqtt.ts"
56
+ }
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/aws-amplify/amplify-js.git"
61
+ },
62
+ "author": "Amazon Web Services",
63
+ "license": "Apache-2.0",
64
+ "bugs": {
65
+ "url": "https://github.com/aws/aws-amplify/issues"
66
+ },
67
+ "homepage": "https://aws-amplify.github.io/",
68
+ "files": [
69
+ "dist/cjs",
70
+ "dist/esm",
71
+ "src",
72
+ "iot",
73
+ "mqtt"
74
+ ],
75
+ "dependencies": {
76
+ "@aws-amplify/auth": "6.0.1",
77
+ "buffer": "4.9.2",
78
+ "graphql": "15.8.0",
79
+ "rxjs": "^7.8.1",
80
+ "tslib": "^2.5.0",
81
+ "url": "0.11.0"
82
+ },
83
+ "peerDependencies": {
84
+ "@aws-amplify/core": "^6.0.0"
85
+ },
86
+ "devDependencies": {
87
+ "@aws-amplify/core": "6.0.1",
88
+ "@rollup/plugin-typescript": "11.1.5",
89
+ "rollup": "3.29.4",
90
+ "typescript": "5.0.2"
91
+ },
92
+ "size-limit": [
93
+ {
94
+ "name": "PubSub (IoT provider)",
95
+ "path": "./dist/esm/index.mjs",
96
+ "import": "{ generateClient }",
97
+ "limit": "1.2 kB"
98
+ },
99
+ {
100
+ "name": "PubSub (Mqtt provider)",
101
+ "path": "./dist/esm/clients/mqtt.mjs",
102
+ "import": "{ generateClient }",
103
+ "limit": "1.07 kB"
104
+ }
105
+ ],
106
+ "jest": {
107
+ "globals": {
108
+ "ts-jest": {
109
+ "diagnostics": false,
110
+ "tsConfig": {
111
+ "allowJs": true,
112
+ "noEmitOnError": false
113
+ }
114
+ },
115
+ "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
116
+ "testPathIgnorePatterns": [
117
+ "__tests__/helpers.ts"
118
+ ]
119
+ },
120
+ "transform": {
121
+ "^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
122
+ },
123
+ "testPathIgnorePatterns": [
124
+ "__tests__/helpers.ts"
125
+ ],
126
+ "moduleFileExtensions": [
127
+ "ts",
128
+ "tsx",
129
+ "js",
130
+ "json",
131
+ "jsx"
132
+ ],
133
+ "testEnvironment": "jsdom",
134
+ "testURL": "http://localhost/",
135
+ "coverageThreshold": {
136
+ "global": {
137
+ "branches": 0,
138
+ "functions": 0,
139
+ "lines": 0,
140
+ "statements": 0
141
+ }
142
+ },
143
+ "coveragePathIgnorePatterns": [
144
+ "node_modules",
145
+ "dist"
146
+ ]
147
+ },
148
+ "gitHead": "f1408db3f570c4a18ada40cecbe7e68a0b31f1fe"
148
149
  }
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  // @ts-ignore
5
- import * as Paho from '../vendor/paho-mqtt';
5
+ import * as Paho from '../vendor/paho-mqtt.js';
6
6
  import { Observable, SubscriptionLike as Subscription, Observer } from 'rxjs';
7
7
 
8
8
  import { AbstractPubSub } from './PubSub';
@@ -14,7 +14,7 @@ import {
14
14
  PublishInput,
15
15
  SubscribeInput,
16
16
  } from '../types/PubSub';
17
- import { Hub, HubPayload, ConsoleLogger as Logger } from '@aws-amplify/core';
17
+ import { Hub, HubPayload, ConsoleLogger } from '@aws-amplify/core';
18
18
  import { amplifyUuid } from '@aws-amplify/core/internals/utils';
19
19
  import {
20
20
  ConnectionStateMonitor,
@@ -26,7 +26,7 @@ import {
26
26
  } from '../utils/ReconnectionMonitor';
27
27
  import { AMPLIFY_SYMBOL, CONNECTION_STATE_CHANGE } from './constants';
28
28
 
29
- const logger = new Logger('MqttOverWS');
29
+ const logger = new ConsoleLogger('MqttOverWS');
30
30
 
31
31
  export function mqttTopicMatch(filter: string, topic: string) {
32
32
  const filterArray = filter.split('/');
@@ -8,8 +8,8 @@ import {
8
8
  PublishInput,
9
9
  SubscribeInput,
10
10
  } from '../types/PubSub';
11
- import { ConsoleLogger as Logger } from '@aws-amplify/core';
12
- const logger = new Logger('AbstractPubSubProvider');
11
+ import { ConsoleLogger } from '@aws-amplify/core';
12
+ const logger = new ConsoleLogger('AbstractPubSubProvider');
13
13
 
14
14
  export abstract class AbstractPubSub<T extends PubSubOptions>
15
15
  implements PubSubBase
@@ -1,10 +0,0 @@
1
- import { MqttOverWS, MqttOptions } from './MqttOverWS';
2
- export interface AWSIoTOptions extends MqttOptions {
3
- region?: string;
4
- endpoint?: string;
5
- }
6
- export declare class AWSIoT extends MqttOverWS {
7
- constructor(options?: AWSIoTOptions);
8
- protected get region(): string | undefined;
9
- protected get endpoint(): Promise<string>;
10
- }
@@ -1,58 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { AbstractPubSub } from './PubSub';
3
- import { PubSubContentObserver, PubSubContent, PubSubOptions, PublishInput, SubscribeInput } from '../types/PubSub';
4
- export declare function mqttTopicMatch(filter: string, topic: string): boolean;
5
- export interface MqttOptions extends PubSubOptions {
6
- clientId?: string;
7
- url?: string;
8
- endpoint?: string;
9
- }
10
- interface PahoClient {
11
- onMessageArrived: (params: {
12
- destinationName: string;
13
- payloadString: string;
14
- }) => void;
15
- onConnectionLost: (params: {
16
- errorCode: number;
17
- }) => void;
18
- connect: (params: {
19
- [k: string]: string | number | boolean | (() => void);
20
- }) => void;
21
- disconnect: () => void;
22
- isConnected: () => boolean;
23
- subscribe: (topic: string) => void;
24
- unsubscribe: (topic: string) => void;
25
- send(topic: string, message: string): void;
26
- }
27
- declare class ClientsQueue {
28
- private promises;
29
- get(clientId: string, clientFactory?: (input: string) => Promise<PahoClient | undefined>): Promise<PahoClient | undefined>;
30
- get allClients(): string[];
31
- remove(clientId: string): void;
32
- }
33
- export declare class MqttOverWS extends AbstractPubSub<MqttOptions> {
34
- private _clientsQueue;
35
- private connectionState?;
36
- private readonly connectionStateMonitor;
37
- private readonly reconnectionMonitor;
38
- constructor(options?: MqttOptions);
39
- protected get clientId(): string;
40
- protected get endpoint(): Promise<string | undefined>;
41
- protected get clientsQueue(): ClientsQueue;
42
- protected get isSSLEnabled(): boolean;
43
- onDisconnect({ clientId, errorCode, ...args }: {
44
- clientId?: string;
45
- errorCode?: number;
46
- }): void;
47
- newClient({ url, clientId }: MqttOptions): Promise<PahoClient>;
48
- protected connect(clientId: string, options?: MqttOptions): Promise<PahoClient | undefined>;
49
- protected disconnect(clientId: string): Promise<void>;
50
- publish({ topics, message }: PublishInput): Promise<void>;
51
- protected _topicObservers: Map<string, Set<PubSubContentObserver>>;
52
- protected _clientIdObservers: Map<string, Set<PubSubContentObserver>>;
53
- private _onMessage;
54
- subscribe({ topics, options, }: SubscribeInput & {
55
- options?: MqttOptions;
56
- }): Observable<PubSubContent>;
57
- }
58
- export {};
@@ -1,11 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { PubSubBase, PubSubOptions, PubSubContent, PublishInput, SubscribeInput } from '../types/PubSub';
3
- export declare abstract class AbstractPubSub<T extends PubSubOptions> implements PubSubBase {
4
- private _config;
5
- constructor(options: T);
6
- configure(config: T): T;
7
- protected get options(): T;
8
- abstract newClient(clientOptions: T): Promise<any>;
9
- abstract publish(input: PublishInput): void;
10
- abstract subscribe(input: SubscribeInput): Observable<PubSubContent>;
11
- }
@@ -1,95 +0,0 @@
1
- export { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';
2
- export declare const MAX_DELAY_MS = 5000;
3
- export declare const NON_RETRYABLE_CODES: number[];
4
- export declare const CONNECTION_STATE_CHANGE = "ConnectionStateChange";
5
- export declare enum MESSAGE_TYPES {
6
- /**
7
- * Client -> Server message.
8
- * This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
9
- */
10
- GQL_CONNECTION_INIT = "connection_init",
11
- /**
12
- * Server -> Client message
13
- * This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
14
- */
15
- GQL_CONNECTION_ERROR = "connection_error",
16
- /**
17
- * Server -> Client message.
18
- * This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
19
- */
20
- GQL_CONNECTION_ACK = "connection_ack",
21
- /**
22
- * Client -> Server message.
23
- * This message type is for register subscriptions with AWS AppSync RealTime
24
- */
25
- GQL_START = "start",
26
- /**
27
- * Server -> Client message.
28
- * This message type is for the ack response from AWS AppSync RealTime for GQL_START message
29
- */
30
- GQL_START_ACK = "start_ack",
31
- /**
32
- * Server -> Client message.
33
- * This message type is for subscription message from AWS AppSync RealTime
34
- */
35
- GQL_DATA = "data",
36
- /**
37
- * Server -> Client message.
38
- * This message type helps the client to know is still receiving messages from AWS AppSync RealTime
39
- */
40
- GQL_CONNECTION_KEEP_ALIVE = "ka",
41
- /**
42
- * Client -> Server message.
43
- * This message type is for unregister subscriptions with AWS AppSync RealTime
44
- */
45
- GQL_STOP = "stop",
46
- /**
47
- * Server -> Client message.
48
- * This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
49
- */
50
- GQL_COMPLETE = "complete",
51
- /**
52
- * Server -> Client message.
53
- * This message type is for sending error messages from AWS AppSync RealTime to the client
54
- */
55
- GQL_ERROR = "error"
56
- }
57
- export declare enum SUBSCRIPTION_STATUS {
58
- PENDING = 0,
59
- CONNECTED = 1,
60
- FAILED = 2
61
- }
62
- export declare enum SOCKET_STATUS {
63
- CLOSED = 0,
64
- READY = 1,
65
- CONNECTING = 2
66
- }
67
- export declare const AWS_APPSYNC_REALTIME_HEADERS: {
68
- accept: string;
69
- 'content-encoding': string;
70
- 'content-type': string;
71
- };
72
- /**
73
- * Time in milleseconds to wait for GQL_CONNECTION_INIT message
74
- */
75
- export declare const CONNECTION_INIT_TIMEOUT = 15000;
76
- /**
77
- * Time in milleseconds to wait for GQL_START_ACK message
78
- */
79
- export declare const START_ACK_TIMEOUT = 15000;
80
- /**
81
- * Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
82
- */
83
- export declare const DEFAULT_KEEP_ALIVE_TIMEOUT: number;
84
- /**
85
- * Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
86
- */
87
- export declare const DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT: number;
88
- /**
89
- * Default delay time in milleseconds between when reconnect is triggered vs when it is attempted
90
- */
91
- export declare const RECONNECT_DELAY: number;
92
- /**
93
- * Default interval time in milleseconds between when reconnect is re-attempted
94
- */
95
- export declare const RECONNECT_INTERVAL: number;
@@ -1,3 +0,0 @@
1
- export { AbstractPubSub } from './PubSub';
2
- export { AWSIoT, AWSIoTOptions } from './AWSIot';
3
- export { MqttOptions, MqttOverWS, mqttTopicMatch } from './MqttOverWS';
@@ -1 +0,0 @@
1
- export { AWSIoT as PubSub, AWSIoTOptions as PubSubOptions } from '../Providers';
@@ -1 +0,0 @@
1
- export { MqttOverWS as PubSub, MqttOptions as PubSubOptions, } from '../Providers';
package/lib/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { CONNECTION_STATE_CHANGE } from './Providers/constants';
2
- export { ConnectionState, CONTROL_MSG } from './types';
3
- export { mqttTopicMatch } from './Providers';
4
- export { PubSub, PubSubOptions } from './clients/iot';