@flowcore/sdk 1.49.0 → 1.50.0

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 (149) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +47 -0
  3. package/esm/_dnt.shims.d.ts +1 -1
  4. package/esm/commands/adapter/reset-adapter.d.ts +52 -0
  5. package/esm/commands/adapter/reset-adapter.d.ts.map +1 -0
  6. package/esm/commands/adapter/reset-adapter.js +38 -0
  7. package/esm/commands/ai-agent-coordinator/conversation-stream.command.js +1 -6
  8. package/esm/commands/api-key/api-key.create.js +8 -21
  9. package/esm/commands/api-key/api-key.delete.js +4 -12
  10. package/esm/commands/api-key/api-key.list.js +4 -12
  11. package/esm/commands/data-core/data-core.create.js +4 -12
  12. package/esm/commands/data-core/data-core.request-delete.js +4 -12
  13. package/esm/commands/event-type/event-type.create.js +4 -12
  14. package/esm/commands/event-type/event-type.request-delete.js +4 -12
  15. package/esm/commands/event-type/event-type.request-truncate.js +4 -12
  16. package/esm/commands/events/event.list.js +4 -12
  17. package/esm/commands/events/events.fetch-time-buckets-by-names.js +4 -12
  18. package/esm/commands/events/events.fetch.js +4 -12
  19. package/esm/commands/events/time-bucket.list.js +4 -12
  20. package/esm/commands/flow-type/flow-type.create.js +4 -12
  21. package/esm/commands/flow-type/flow-type.request-delete.js +4 -12
  22. package/esm/commands/index.d.ts +1 -7
  23. package/esm/commands/index.d.ts.map +1 -1
  24. package/esm/commands/index.js +2 -8
  25. package/esm/commands/ingestion/ingest.batch.js +5 -18
  26. package/esm/commands/ingestion/ingest.event.js +5 -18
  27. package/esm/commands/scenario/scenario.create.js +4 -12
  28. package/esm/commands/scenario/scenario.delete.js +4 -12
  29. package/esm/commands/scenario/scenario.fetch.js +4 -12
  30. package/esm/commands/scenario/scenario.list.js +4 -12
  31. package/esm/commands/scenario/scenario.update.js +4 -12
  32. package/esm/commands/secret/secret.create.js +4 -12
  33. package/esm/commands/secret/secret.delete.js +4 -12
  34. package/esm/commands/secret/secret.list.js +4 -12
  35. package/esm/commands/security/pat.create.js +4 -12
  36. package/esm/commands/security/pat.delete.js +4 -12
  37. package/esm/commands/security/pat.exchange.js +4 -12
  38. package/esm/commands/security/pat.get.js +4 -12
  39. package/esm/commands/security/pat.list.js +4 -12
  40. package/esm/commands/tenant/tenant.list.js +4 -12
  41. package/esm/commands/variable/variable.create.js +4 -12
  42. package/esm/commands/variable/variable.delete.js +4 -12
  43. package/esm/commands/variable/variable.list.js +4 -12
  44. package/esm/common/command-graphql.js +4 -12
  45. package/esm/common/command.js +20 -45
  46. package/esm/common/flowcore-client.js +4 -18
  47. package/esm/common/notification-client.js +15 -72
  48. package/esm/common/websocket-client.js +16 -80
  49. package/esm/exceptions/client-error.js +6 -18
  50. package/esm/exceptions/invalid-response.js +2 -6
  51. package/esm/utils/local-cache.js +5 -19
  52. package/package.json +1 -1
  53. package/script/_dnt.shims.d.ts +1 -1
  54. package/script/commands/adapter/reset-adapter.d.ts +52 -0
  55. package/script/commands/adapter/reset-adapter.d.ts.map +1 -0
  56. package/script/commands/adapter/reset-adapter.js +42 -0
  57. package/script/commands/ai-agent-coordinator/conversation-stream.command.js +1 -6
  58. package/script/commands/api-key/api-key.create.js +8 -21
  59. package/script/commands/api-key/api-key.delete.js +4 -12
  60. package/script/commands/api-key/api-key.list.js +4 -12
  61. package/script/commands/data-core/data-core.create.js +4 -12
  62. package/script/commands/data-core/data-core.request-delete.js +4 -12
  63. package/script/commands/event-type/event-type.create.js +4 -12
  64. package/script/commands/event-type/event-type.request-delete.js +4 -12
  65. package/script/commands/event-type/event-type.request-truncate.js +4 -12
  66. package/script/commands/events/event.list.js +4 -12
  67. package/script/commands/events/events.fetch-time-buckets-by-names.js +4 -12
  68. package/script/commands/events/events.fetch.js +4 -12
  69. package/script/commands/events/time-bucket.list.js +4 -12
  70. package/script/commands/flow-type/flow-type.create.js +4 -12
  71. package/script/commands/flow-type/flow-type.request-delete.js +4 -12
  72. package/script/commands/index.d.ts +1 -7
  73. package/script/commands/index.d.ts.map +1 -1
  74. package/script/commands/index.js +2 -8
  75. package/script/commands/ingestion/ingest.batch.js +5 -18
  76. package/script/commands/ingestion/ingest.event.js +5 -18
  77. package/script/commands/scenario/scenario.create.js +4 -12
  78. package/script/commands/scenario/scenario.delete.js +4 -12
  79. package/script/commands/scenario/scenario.fetch.js +4 -12
  80. package/script/commands/scenario/scenario.list.js +4 -12
  81. package/script/commands/scenario/scenario.update.js +4 -12
  82. package/script/commands/secret/secret.create.js +4 -12
  83. package/script/commands/secret/secret.delete.js +4 -12
  84. package/script/commands/secret/secret.list.js +4 -12
  85. package/script/commands/security/pat.create.js +4 -12
  86. package/script/commands/security/pat.delete.js +4 -12
  87. package/script/commands/security/pat.exchange.js +4 -12
  88. package/script/commands/security/pat.get.js +4 -12
  89. package/script/commands/security/pat.list.js +4 -12
  90. package/script/commands/tenant/tenant.list.js +4 -12
  91. package/script/commands/variable/variable.create.js +4 -12
  92. package/script/commands/variable/variable.delete.js +4 -12
  93. package/script/commands/variable/variable.list.js +4 -12
  94. package/script/common/command-graphql.js +4 -12
  95. package/script/common/command.js +20 -45
  96. package/script/common/flowcore-client.js +4 -18
  97. package/script/common/notification-client.js +15 -72
  98. package/script/common/websocket-client.js +16 -80
  99. package/script/exceptions/client-error.js +6 -18
  100. package/script/exceptions/invalid-response.js +2 -6
  101. package/script/utils/local-cache.js +5 -19
  102. package/esm/commands/iam/api-key-role-association.create.d.ts +0 -45
  103. package/esm/commands/iam/api-key-role-association.create.d.ts.map +0 -1
  104. package/esm/commands/iam/api-key-role-association.create.js +0 -44
  105. package/esm/commands/iam/api-key-role-association.delete.d.ts +0 -45
  106. package/esm/commands/iam/api-key-role-association.delete.d.ts.map +0 -1
  107. package/esm/commands/iam/api-key-role-association.delete.js +0 -44
  108. package/esm/commands/iam/api-key-role-association.list.d.ts +0 -31
  109. package/esm/commands/iam/api-key-role-association.list.d.ts.map +0 -1
  110. package/esm/commands/iam/api-key-role-association.list.js +0 -37
  111. package/esm/commands/iam/role.list.d.ts +0 -33
  112. package/esm/commands/iam/role.list.d.ts.map +0 -1
  113. package/esm/commands/iam/role.list.js +0 -41
  114. package/esm/commands/iam/user-role-association.create.d.ts +0 -42
  115. package/esm/commands/iam/user-role-association.create.d.ts.map +0 -1
  116. package/esm/commands/iam/user-role-association.create.js +0 -40
  117. package/esm/commands/iam/user-role-association.delete.d.ts +0 -42
  118. package/esm/commands/iam/user-role-association.delete.d.ts.map +0 -1
  119. package/esm/commands/iam/user-role-association.delete.js +0 -40
  120. package/esm/commands/iam/user-role-association.list.d.ts +0 -33
  121. package/esm/commands/iam/user-role-association.list.d.ts.map +0 -1
  122. package/esm/commands/iam/user-role-association.list.js +0 -39
  123. package/esm/contracts/iam.d.ts +0 -13
  124. package/esm/contracts/iam.d.ts.map +0 -1
  125. package/esm/contracts/iam.js +0 -9
  126. package/script/commands/iam/api-key-role-association.create.d.ts +0 -45
  127. package/script/commands/iam/api-key-role-association.create.d.ts.map +0 -1
  128. package/script/commands/iam/api-key-role-association.create.js +0 -48
  129. package/script/commands/iam/api-key-role-association.delete.d.ts +0 -45
  130. package/script/commands/iam/api-key-role-association.delete.d.ts.map +0 -1
  131. package/script/commands/iam/api-key-role-association.delete.js +0 -48
  132. package/script/commands/iam/api-key-role-association.list.d.ts +0 -31
  133. package/script/commands/iam/api-key-role-association.list.d.ts.map +0 -1
  134. package/script/commands/iam/api-key-role-association.list.js +0 -41
  135. package/script/commands/iam/role.list.d.ts +0 -33
  136. package/script/commands/iam/role.list.d.ts.map +0 -1
  137. package/script/commands/iam/role.list.js +0 -45
  138. package/script/commands/iam/user-role-association.create.d.ts +0 -42
  139. package/script/commands/iam/user-role-association.create.d.ts.map +0 -1
  140. package/script/commands/iam/user-role-association.create.js +0 -44
  141. package/script/commands/iam/user-role-association.delete.d.ts +0 -42
  142. package/script/commands/iam/user-role-association.delete.d.ts.map +0 -1
  143. package/script/commands/iam/user-role-association.delete.js +0 -44
  144. package/script/commands/iam/user-role-association.list.d.ts +0 -33
  145. package/script/commands/iam/user-role-association.list.d.ts.map +0 -1
  146. package/script/commands/iam/user-role-association.list.js +0 -43
  147. package/script/contracts/iam.d.ts +0 -13
  148. package/script/contracts/iam.d.ts.map +0 -1
  149. package/script/contracts/iam.js +0 -12
@@ -12,24 +12,11 @@ const responseSchema = Type.Object({
12
12
  * Ingest an event
13
13
  */
14
14
  export class IngestEventCommand extends Command {
15
- constructor() {
16
- super(...arguments);
17
- /**
18
- * The dedicated subdomain for the command
19
- */
20
- Object.defineProperty(this, "dedicatedSubdomain", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: "webhook"
25
- });
26
- Object.defineProperty(this, "allowedModes", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: ["apiKey"]
31
- });
32
- }
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
18
+ dedicatedSubdomain = "webhook";
19
+ allowedModes = ["apiKey"];
33
20
  getMethod() {
34
21
  return "POST";
35
22
  }
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Create a scenario
6
6
  */
7
7
  export class ScenarioCreateCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -8,18 +8,10 @@ const ScenarioDeleteOutputSchema = Type.Object({
8
8
  * Delete a scenario
9
9
  */
10
10
  export class ScenarioDeleteCommand extends Command {
11
- constructor() {
12
- super(...arguments);
13
- /**
14
- * Whether the command should retry on failure
15
- */
16
- Object.defineProperty(this, "retryOnFailure", {
17
- enumerable: true,
18
- configurable: true,
19
- writable: true,
20
- value: false
21
- });
22
- }
11
+ /**
12
+ * Whether the command should retry on failure
13
+ */
14
+ retryOnFailure = false;
23
15
  /**
24
16
  * Get the method
25
17
  */
@@ -12,18 +12,10 @@ function isScenarioFetchByNameAndTenantInput(input) {
12
12
  * fetch a scenario
13
13
  */
14
14
  export class ScenarioFetchCommand extends Command {
15
- constructor() {
16
- super(...arguments);
17
- /**
18
- * Whether the command should retry on failure
19
- */
20
- Object.defineProperty(this, "retryOnFailure", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: false
25
- });
26
- }
15
+ /**
16
+ * Whether the command should retry on failure
17
+ */
18
+ retryOnFailure = false;
27
19
  /**
28
20
  * Get the method
29
21
  */
@@ -10,18 +10,10 @@ const ScenarioListOutputSchema = Type.Object({
10
10
  * list all scenarios
11
11
  */
12
12
  export class ScenarioListCommand extends Command {
13
- constructor() {
14
- super(...arguments);
15
- /**
16
- * Whether the command should retry on failure
17
- */
18
- Object.defineProperty(this, "retryOnFailure", {
19
- enumerable: true,
20
- configurable: true,
21
- writable: true,
22
- value: false
23
- });
24
- }
13
+ /**
14
+ * Whether the command should retry on failure
15
+ */
16
+ retryOnFailure = false;
25
17
  /**
26
18
  * Get the method
27
19
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Update a scenario
6
6
  */
7
7
  export class ScenarioUpdateCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -23,18 +23,10 @@ const responseSchema = Type.Object({
23
23
  * List secrets
24
24
  */
25
25
  export class SecretCreateCommand extends GraphQlCommand {
26
- constructor() {
27
- super(...arguments);
28
- /**
29
- * The allowed modes for the command
30
- */
31
- Object.defineProperty(this, "allowedModes", {
32
- enumerable: true,
33
- configurable: true,
34
- writable: true,
35
- value: ["bearer"]
36
- });
37
- }
26
+ /**
27
+ * The allowed modes for the command
28
+ */
29
+ allowedModes = ["bearer"];
38
30
  /**
39
31
  * Parse the response
40
32
  */
@@ -23,18 +23,10 @@ const responseSchema = Type.Object({
23
23
  * List secrets
24
24
  */
25
25
  export class SecretDeleteCommand extends GraphQlCommand {
26
- constructor() {
27
- super(...arguments);
28
- /**
29
- * The allowed modes for the command
30
- */
31
- Object.defineProperty(this, "allowedModes", {
32
- enumerable: true,
33
- configurable: true,
34
- writable: true,
35
- value: ["bearer"]
36
- });
37
- }
26
+ /**
27
+ * The allowed modes for the command
28
+ */
29
+ allowedModes = ["bearer"];
38
30
  /**
39
31
  * Parse the response
40
32
  */
@@ -26,18 +26,10 @@ const responseSchema = Type.Object({
26
26
  * List secrets
27
27
  */
28
28
  export class SecretListCommand extends GraphQlCommand {
29
- constructor() {
30
- super(...arguments);
31
- /**
32
- * The allowed modes for the command
33
- */
34
- Object.defineProperty(this, "allowedModes", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: ["bearer"]
39
- });
40
- }
29
+ /**
30
+ * The allowed modes for the command
31
+ */
32
+ allowedModes = ["bearer"];
41
33
  /**
42
34
  * Parse the response
43
35
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Create a Personal Access Token (PAT)
6
6
  */
7
7
  export class SecurityCreatePATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Delete a Personal Access Token (PAT)
6
6
  */
7
7
  export class SecurityDeletePATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Exchange a Personal Access Token (PAT) for an access token
6
6
  */
7
7
  export class SecurityExchangePATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -5,18 +5,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
5
  * Get a Personal Access Token (PAT)
6
6
  */
7
7
  export class SecurityGetPATCommand extends Command {
8
- constructor() {
9
- super(...arguments);
10
- /**
11
- * Whether the command should retry on failure
12
- */
13
- Object.defineProperty(this, "retryOnFailure", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: false
18
- });
19
- }
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = false;
20
12
  /**
21
13
  * Get the method
22
14
  */
@@ -6,18 +6,10 @@ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
6
6
  * List all your Personal Access Token (PAT)
7
7
  */
8
8
  export class SecurityListPATCommand extends Command {
9
- constructor() {
10
- super(...arguments);
11
- /**
12
- * Whether the command should retry on failure
13
- */
14
- Object.defineProperty(this, "retryOnFailure", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: false
19
- });
20
- }
9
+ /**
10
+ * Whether the command should retry on failure
11
+ */
12
+ retryOnFailure = false;
21
13
  /**
22
14
  * Get the method
23
15
  */
@@ -45,18 +45,10 @@ const responseSchema = Type.Object({
45
45
  * List tenants
46
46
  */
47
47
  export class TenantListCommand extends GraphQlCommand {
48
- constructor() {
49
- super(...arguments);
50
- /**
51
- * The allowed modes for the command
52
- */
53
- Object.defineProperty(this, "allowedModes", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: ["bearer"]
58
- });
59
- }
48
+ /**
49
+ * The allowed modes for the command
50
+ */
51
+ allowedModes = ["bearer"];
60
52
  /**
61
53
  * Parse the response
62
54
  */
@@ -26,18 +26,10 @@ const responseSchema = Type.Object({
26
26
  * Create a variable
27
27
  */
28
28
  export class VariableCreateCommand extends GraphQlCommand {
29
- constructor() {
30
- super(...arguments);
31
- /**
32
- * The allowed modes for the command
33
- */
34
- Object.defineProperty(this, "allowedModes", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: ["bearer"]
39
- });
40
- }
29
+ /**
30
+ * The allowed modes for the command
31
+ */
32
+ allowedModes = ["bearer"];
41
33
  /**
42
34
  * Parse the response
43
35
  */
@@ -26,18 +26,10 @@ const responseSchema = Type.Object({
26
26
  * Create a variable
27
27
  */
28
28
  export class VariableDeleteCommand extends GraphQlCommand {
29
- constructor() {
30
- super(...arguments);
31
- /**
32
- * The allowed modes for the command
33
- */
34
- Object.defineProperty(this, "allowedModes", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: ["bearer"]
39
- });
40
- }
29
+ /**
30
+ * The allowed modes for the command
31
+ */
32
+ allowedModes = ["bearer"];
41
33
  /**
42
34
  * Parse the response
43
35
  */
@@ -32,18 +32,10 @@ const responseSchema = Type.Object({
32
32
  * List variables
33
33
  */
34
34
  export class VariableListCommand extends GraphQlCommand {
35
- constructor() {
36
- super(...arguments);
37
- /**
38
- * The allowed modes for the command
39
- */
40
- Object.defineProperty(this, "allowedModes", {
41
- enumerable: true,
42
- configurable: true,
43
- writable: true,
44
- value: ["bearer"]
45
- });
46
- }
35
+ /**
36
+ * The allowed modes for the command
37
+ */
38
+ allowedModes = ["bearer"];
47
39
  /**
48
40
  * Parse the response
49
41
  */
@@ -3,18 +3,10 @@ import { Command } from "./command.js";
3
3
  * Abstract command for executing GraphQL requests
4
4
  */
5
5
  export class GraphQlCommand extends Command {
6
- constructor() {
7
- super(...arguments);
8
- /**
9
- * The allowed modes for the command
10
- */
11
- Object.defineProperty(this, "allowedModes", {
12
- enumerable: true,
13
- configurable: true,
14
- writable: true,
15
- value: ["bearer"]
16
- });
17
- }
6
+ /**
7
+ * The allowed modes for the command
8
+ */
9
+ allowedModes = ["bearer"];
18
10
  /**
19
11
  * Get the base URL for the request
20
12
  */
@@ -5,52 +5,27 @@ import { tenantCache } from "./tenant.cache.js";
5
5
  * Abstract command for executing requests
6
6
  */
7
7
  export class Command {
8
+ /**
9
+ * Whether the command should retry on failure
10
+ */
11
+ retryOnFailure = true;
12
+ /**
13
+ * The dedicated subdomain for the command
14
+ */
15
+ dedicatedSubdomain;
16
+ /**
17
+ * The allowed modes for the command
18
+ */
19
+ allowedModes = ["apiKey", "bearer"];
20
+ /**
21
+ * The input for the command
22
+ */
23
+ input;
24
+ /**
25
+ * The client auth options
26
+ */
27
+ clientAuthOptions = {};
8
28
  constructor(input) {
9
- /**
10
- * Whether the command should retry on failure
11
- */
12
- Object.defineProperty(this, "retryOnFailure", {
13
- enumerable: true,
14
- configurable: true,
15
- writable: true,
16
- value: true
17
- });
18
- /**
19
- * The dedicated subdomain for the command
20
- */
21
- Object.defineProperty(this, "dedicatedSubdomain", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: void 0
26
- });
27
- /**
28
- * The allowed modes for the command
29
- */
30
- Object.defineProperty(this, "allowedModes", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: ["apiKey", "bearer"]
35
- });
36
- /**
37
- * The input for the command
38
- */
39
- Object.defineProperty(this, "input", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: void 0
44
- });
45
- /**
46
- * The client auth options
47
- */
48
- Object.defineProperty(this, "clientAuthOptions", {
49
- enumerable: true,
50
- configurable: true,
51
- writable: true,
52
- value: {}
53
- });
54
29
  /**
55
30
  * The input for the command
56
31
  */
@@ -7,25 +7,11 @@ const RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504];
7
7
  * A base client for executing commands
8
8
  */
9
9
  export class FlowcoreClient {
10
+ options;
11
+ mode;
12
+ baseUrl;
10
13
  constructor(options) {
11
- Object.defineProperty(this, "options", {
12
- enumerable: true,
13
- configurable: true,
14
- writable: true,
15
- value: options
16
- });
17
- Object.defineProperty(this, "mode", {
18
- enumerable: true,
19
- configurable: true,
20
- writable: true,
21
- value: void 0
22
- });
23
- Object.defineProperty(this, "baseUrl", {
24
- enumerable: true,
25
- configurable: true,
26
- writable: true,
27
- value: void 0
28
- });
14
+ this.options = options;
29
15
  if (this.options.getBearerToken) {
30
16
  this.mode = "bearer";
31
17
  }
@@ -12,6 +12,18 @@ const MAX_RECONNECT_INTERVAL = 30_000;
12
12
  * Manages connection lifecycle, authentication, and event handling.
13
13
  */
14
14
  export class NotificationClient {
15
+ observer;
16
+ authOptions;
17
+ subscriptionSpec;
18
+ url = "wss://tenant.api.flowcore.io/notifications";
19
+ webSocket;
20
+ options;
21
+ logger;
22
+ eventCount = 0;
23
+ reconnectInterval;
24
+ reconnectAttempts = 0;
25
+ _isOpen = false;
26
+ _isConnecting = false;
15
27
  /**
16
28
  * Creates a new NotificationClient instance
17
29
  * @param observer - RxJS Subject for emitting notification events
@@ -20,78 +32,9 @@ export class NotificationClient {
20
32
  * @param options - Configuration options for the client
21
33
  */
22
34
  constructor(observer, authOptions, subscriptionSpec, options) {
23
- Object.defineProperty(this, "observer", {
24
- enumerable: true,
25
- configurable: true,
26
- writable: true,
27
- value: observer
28
- });
29
- Object.defineProperty(this, "authOptions", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: authOptions
34
- });
35
- Object.defineProperty(this, "subscriptionSpec", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: subscriptionSpec
40
- });
41
- Object.defineProperty(this, "url", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: "wss://tenant.api.flowcore.io/notifications"
46
- });
47
- Object.defineProperty(this, "webSocket", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: void 0
52
- });
53
- Object.defineProperty(this, "options", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: void 0
58
- });
59
- Object.defineProperty(this, "logger", {
60
- enumerable: true,
61
- configurable: true,
62
- writable: true,
63
- value: void 0
64
- });
65
- Object.defineProperty(this, "eventCount", {
66
- enumerable: true,
67
- configurable: true,
68
- writable: true,
69
- value: 0
70
- });
71
- Object.defineProperty(this, "reconnectInterval", {
72
- enumerable: true,
73
- configurable: true,
74
- writable: true,
75
- value: void 0
76
- });
77
- Object.defineProperty(this, "reconnectAttempts", {
78
- enumerable: true,
79
- configurable: true,
80
- writable: true,
81
- value: 0
82
- });
83
- Object.defineProperty(this, "_isOpen", {
84
- enumerable: true,
85
- configurable: true,
86
- writable: true,
87
- value: false
88
- });
89
- Object.defineProperty(this, "_isConnecting", {
90
- enumerable: true,
91
- configurable: true,
92
- writable: true,
93
- value: false
94
- });
35
+ this.observer = observer;
36
+ this.authOptions = authOptions;
37
+ this.subscriptionSpec = subscriptionSpec;
95
38
  this.options = {
96
39
  reconnectInterval: 1000,
97
40
  ...options,