@flowcore/sdk 1.19.1 → 1.21.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 (110) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/esm/commands/data-core/data-core.request-delete.d.ts +6 -0
  3. package/esm/commands/data-core/data-core.request-delete.d.ts.map +1 -1
  4. package/esm/commands/data-core/data-core.request-delete.js +12 -0
  5. package/esm/commands/event-type/event-type.info.d.ts +2 -0
  6. package/esm/commands/event-type/event-type.info.d.ts.map +1 -1
  7. package/esm/commands/event-type/event-type.info.js +3 -0
  8. package/esm/commands/event-type/event-type.request-delete.d.ts +6 -0
  9. package/esm/commands/event-type/event-type.request-delete.d.ts.map +1 -1
  10. package/esm/commands/event-type/event-type.request-delete.js +12 -0
  11. package/esm/commands/event-type/event-type.request-truncate.d.ts +7 -1
  12. package/esm/commands/event-type/event-type.request-truncate.d.ts.map +1 -1
  13. package/esm/commands/event-type/event-type.request-truncate.js +12 -0
  14. package/esm/commands/events/event.list.d.ts +6 -0
  15. package/esm/commands/events/event.list.d.ts.map +1 -1
  16. package/esm/commands/events/event.list.js +12 -0
  17. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts +4 -0
  18. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -1
  19. package/esm/commands/events/events.fetch-time-buckets-by-names.js +13 -1
  20. package/esm/commands/events/events.fetch.d.ts +4 -0
  21. package/esm/commands/events/events.fetch.d.ts.map +1 -1
  22. package/esm/commands/events/events.fetch.js +12 -0
  23. package/esm/commands/events/time-bucket.list.d.ts +6 -0
  24. package/esm/commands/events/time-bucket.list.d.ts.map +1 -1
  25. package/esm/commands/events/time-bucket.list.js +13 -1
  26. package/esm/commands/flow-type/flow-type.request-delete.d.ts +7 -1
  27. package/esm/commands/flow-type/flow-type.request-delete.d.ts.map +1 -1
  28. package/esm/commands/flow-type/flow-type.request-delete.js +12 -0
  29. package/esm/commands/index.d.ts +1 -0
  30. package/esm/commands/index.d.ts.map +1 -1
  31. package/esm/commands/index.js +1 -0
  32. package/esm/commands/security/pat.exchange.d.ts.map +1 -1
  33. package/esm/commands/security/permissions.list.d.ts +28 -0
  34. package/esm/commands/security/permissions.list.d.ts.map +1 -0
  35. package/esm/commands/security/permissions.list.js +38 -0
  36. package/esm/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -1
  37. package/esm/common/command.d.ts +9 -1
  38. package/esm/common/command.d.ts.map +1 -1
  39. package/esm/common/command.js +39 -3
  40. package/esm/common/flowcore-client.d.ts +9 -0
  41. package/esm/common/flowcore-client.d.ts.map +1 -1
  42. package/esm/common/flowcore-client.js +23 -1
  43. package/esm/common/tenant.cache.d.ts +17 -0
  44. package/esm/common/tenant.cache.d.ts.map +1 -0
  45. package/esm/common/tenant.cache.js +2 -0
  46. package/esm/contracts/pat.d.ts.map +1 -1
  47. package/esm/contracts/permission.d.ts +21 -0
  48. package/esm/contracts/permission.d.ts.map +1 -0
  49. package/esm/contracts/permission.js +16 -0
  50. package/esm/utils/local-cache.d.ts +11 -0
  51. package/esm/utils/local-cache.d.ts.map +1 -0
  52. package/esm/utils/local-cache.js +45 -0
  53. package/esm/utils/try-catch.d.ts +12 -0
  54. package/esm/utils/try-catch.d.ts.map +1 -0
  55. package/esm/utils/try-catch.js +10 -0
  56. package/package.json +1 -1
  57. package/script/commands/data-core/data-core.request-delete.d.ts +6 -0
  58. package/script/commands/data-core/data-core.request-delete.d.ts.map +1 -1
  59. package/script/commands/data-core/data-core.request-delete.js +12 -0
  60. package/script/commands/event-type/event-type.info.d.ts +2 -0
  61. package/script/commands/event-type/event-type.info.d.ts.map +1 -1
  62. package/script/commands/event-type/event-type.info.js +3 -0
  63. package/script/commands/event-type/event-type.request-delete.d.ts +6 -0
  64. package/script/commands/event-type/event-type.request-delete.d.ts.map +1 -1
  65. package/script/commands/event-type/event-type.request-delete.js +12 -0
  66. package/script/commands/event-type/event-type.request-truncate.d.ts +7 -1
  67. package/script/commands/event-type/event-type.request-truncate.d.ts.map +1 -1
  68. package/script/commands/event-type/event-type.request-truncate.js +12 -0
  69. package/script/commands/events/event.list.d.ts +6 -0
  70. package/script/commands/events/event.list.d.ts.map +1 -1
  71. package/script/commands/events/event.list.js +12 -0
  72. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts +4 -0
  73. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -1
  74. package/script/commands/events/events.fetch-time-buckets-by-names.js +13 -1
  75. package/script/commands/events/events.fetch.d.ts +4 -0
  76. package/script/commands/events/events.fetch.d.ts.map +1 -1
  77. package/script/commands/events/events.fetch.js +12 -0
  78. package/script/commands/events/time-bucket.list.d.ts +6 -0
  79. package/script/commands/events/time-bucket.list.d.ts.map +1 -1
  80. package/script/commands/events/time-bucket.list.js +13 -1
  81. package/script/commands/flow-type/flow-type.request-delete.d.ts +7 -1
  82. package/script/commands/flow-type/flow-type.request-delete.d.ts.map +1 -1
  83. package/script/commands/flow-type/flow-type.request-delete.js +12 -0
  84. package/script/commands/index.d.ts +1 -0
  85. package/script/commands/index.d.ts.map +1 -1
  86. package/script/commands/index.js +1 -0
  87. package/script/commands/security/pat.exchange.d.ts.map +1 -1
  88. package/script/commands/security/permissions.list.d.ts +28 -0
  89. package/script/commands/security/permissions.list.d.ts.map +1 -0
  90. package/script/commands/security/permissions.list.js +42 -0
  91. package/script/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -1
  92. package/script/common/command.d.ts +9 -1
  93. package/script/common/command.d.ts.map +1 -1
  94. package/script/common/command.js +39 -3
  95. package/script/common/flowcore-client.d.ts +9 -0
  96. package/script/common/flowcore-client.d.ts.map +1 -1
  97. package/script/common/flowcore-client.js +23 -1
  98. package/script/common/tenant.cache.d.ts +17 -0
  99. package/script/common/tenant.cache.d.ts.map +1 -0
  100. package/script/common/tenant.cache.js +5 -0
  101. package/script/contracts/pat.d.ts.map +1 -1
  102. package/script/contracts/permission.d.ts +21 -0
  103. package/script/contracts/permission.d.ts.map +1 -0
  104. package/script/contracts/permission.js +19 -0
  105. package/script/utils/local-cache.d.ts +11 -0
  106. package/script/utils/local-cache.d.ts.map +1 -0
  107. package/script/utils/local-cache.js +49 -0
  108. package/script/utils/try-catch.d.ts +12 -0
  109. package/script/utils/try-catch.d.ts.map +1 -0
  110. package/script/utils/try-catch.js +13 -0
@@ -1,3 +1,6 @@
1
+ import { TenantFetchCommand } from "../commands/tenant/tenant.fetch.js";
2
+ import { CommandError } from "../exceptions/command-error.js";
3
+ import { tenantCache } from "./tenant.cache.js";
1
4
  /**
2
5
  * Abstract command for executing requests
3
6
  */
@@ -12,6 +15,15 @@ export class Command {
12
15
  writable: true,
13
16
  value: true
14
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
+ });
15
27
  /**
16
28
  * The allowed modes for the command
17
29
  */
@@ -35,6 +47,31 @@ export class Command {
35
47
  */
36
48
  this.input = input;
37
49
  }
50
+ /**
51
+ * Get the dedicated base URL
52
+ */
53
+ async getDedicatedBaseUrl(client) {
54
+ if (!this.dedicatedSubdomain) {
55
+ return null;
56
+ }
57
+ const inputTenant = typeof this.input === "object" && this.input !== null && "tenant" in this.input &&
58
+ typeof this.input.tenant === "string" && this.input.tenant;
59
+ if (!inputTenant) {
60
+ return null;
61
+ }
62
+ let tenant = tenantCache.get(inputTenant);
63
+ if (!tenant) {
64
+ tenant = await client.execute(new TenantFetchCommand({ tenant: inputTenant }));
65
+ tenantCache.set(inputTenant, tenant);
66
+ }
67
+ if (!tenant.isDedicated) {
68
+ return null;
69
+ }
70
+ if (!tenant.dedicated?.configuration.domain) {
71
+ throw new CommandError(this.constructor.name, `Tenant ${inputTenant} does not have a dedicated domain configured`);
72
+ }
73
+ return `https://${this.dedicatedSubdomain}.${tenant.dedicated.configuration.domain}`;
74
+ }
38
75
  /**
39
76
  * Get the method for the request
40
77
  */
@@ -75,13 +112,12 @@ export class Command {
75
112
  /**
76
113
  * Get the request object
77
114
  */
78
- // deno-lint-ignore require-await
79
- async getRequest(_client) {
115
+ async getRequest(client) {
80
116
  return {
81
117
  allowedModes: this.allowedModes,
82
118
  body: this.getBody(),
83
119
  headers: this.getHeaders(),
84
- baseUrl: this.getBaseUrl(),
120
+ baseUrl: (await this.getDedicatedBaseUrl(client)) ?? this.getBaseUrl(),
85
121
  path: this.getPath(),
86
122
  method: this.getMethod(),
87
123
  parseResponse: this.parseResponse.bind(this),
@@ -51,6 +51,15 @@ export declare class FlowcoreClient {
51
51
  * Execute a command
52
52
  */
53
53
  execute<Input, Output>(command: Command<Input, Output>): Promise<Output>;
54
+ /**
55
+ * Close the client and clean up resources
56
+ * This should be called when the client is no longer needed to prevent memory leaks
57
+ */
58
+ close(): void;
59
+ /**
60
+ * Dispose the client
61
+ */
62
+ [Symbol.dispose](): void;
54
63
  }
55
64
  export {};
56
65
  //# sourceMappingURL=flowcore-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;GAEG;AACH,qBAAa,cAAc;IAIb,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,OAAO,CAAoB;gBAEN,OAAO,EAAE,aAAa;IAiBnD;;OAEG;YACW,aAAa;IAc3B;;OAEG;YACW,YAAY;IAsE1B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGzE"}
1
+ {"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAM3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;GAEG;AACH,qBAAa,cAAc;IAIb,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,OAAO,CAAoB;gBAEN,OAAO,EAAE,aAAa;IAiBnD;;OAEG;YACW,aAAa;IAc3B;;OAEG;YACW,YAAY;IA4E1B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxE;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
@@ -1,5 +1,7 @@
1
1
  import { ClientError } from "../exceptions/client-error.js";
2
2
  import { CommandError } from "../exceptions/command-error.js";
3
+ import { tryCatch } from "../utils/try-catch.js";
4
+ import { tenantCache } from "./tenant.cache.js";
3
5
  const RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504];
4
6
  /**
5
7
  * A base client for executing commands
@@ -67,7 +69,13 @@ export class FlowcoreClient {
67
69
  if (!request.allowedModes.includes(this.mode)) {
68
70
  throw new CommandError(command.constructor.name, `Not allowed in "${this.mode}" mode`);
69
71
  }
70
- const authHeader = await this.getAuthHeader();
72
+ const { data: authHeader, error: authHeaderError } = await tryCatch(this.getAuthHeader());
73
+ if (authHeaderError) {
74
+ throw new ClientError("Failed to get auth header", 0, command.constructor.name, {
75
+ command: command.constructor.name,
76
+ error: authHeaderError,
77
+ });
78
+ }
71
79
  const headers = {
72
80
  ...request.headers,
73
81
  ...(authHeader ? { Authorization: authHeader } : {}),
@@ -126,4 +134,18 @@ export class FlowcoreClient {
126
134
  execute(command) {
127
135
  return this.innerExecute(command, 0);
128
136
  }
137
+ /**
138
+ * Close the client and clean up resources
139
+ * This should be called when the client is no longer needed to prevent memory leaks
140
+ */
141
+ close() {
142
+ // Clear the tenant cache
143
+ tenantCache.clear();
144
+ }
145
+ /**
146
+ * Dispose the client
147
+ */
148
+ [Symbol.dispose]() {
149
+ this.close();
150
+ }
129
151
  }
@@ -0,0 +1,17 @@
1
+ import { LocalCache } from "../utils/local-cache.js";
2
+ export declare const tenantCache: LocalCache<{
3
+ id: string;
4
+ name: string;
5
+ displayName: string;
6
+ description: string;
7
+ websiteUrl: string;
8
+ isDedicated: boolean;
9
+ dedicated: {
10
+ status: "ready" | "degraded" | "offline";
11
+ configuration: {
12
+ domain: string;
13
+ configurationRepoUrl: string;
14
+ };
15
+ } | null;
16
+ }>;
17
+ //# sourceMappingURL=tenant.cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant.cache.d.ts","sourceRoot":"","sources":["../../src/common/tenant.cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EAAoC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { LocalCache } from "../utils/local-cache.js";
2
+ export const tenantCache = new LocalCache(60 * 1000);
@@ -1 +1 @@
1
- {"version":3,"file":"pat.d.ts","sourceRoot":"","sources":["../../src/contracts/pat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC;IAC9B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;CACnB,CAMC,CAAA;AACF;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
1
+ {"version":3,"file":"pat.d.ts","sourceRoot":"","sources":["../../src/contracts/pat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjG;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC;IAC9B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;CACnB,CAMC,CAAA;AACF;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { type Static, type TArray, type TLiteral, type TObject, type TString, type TUnion } from "@sinclair/typebox";
2
+ /**
3
+ * The schema for a permission
4
+ */
5
+ export declare const PermissionSchema: TObject<{
6
+ tenant: TString;
7
+ type: TString;
8
+ id: TString;
9
+ action: TArray<TUnion<[
10
+ TLiteral<"read">,
11
+ TLiteral<"write">,
12
+ TLiteral<"ingest">,
13
+ TLiteral<"fetch">,
14
+ TLiteral<"*">
15
+ ]>>;
16
+ }>;
17
+ /**
18
+ * The type for a permission
19
+ */
20
+ export type Permission = Static<typeof PermissionSchema>;
21
+ //# sourceMappingURL=permission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/contracts/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC;IACrC,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,CACZ,MAAM,CAAC;QACL,QAAQ,CAAC,MAAM,CAAC;QAChB,QAAQ,CAAC,OAAO,CAAC;QACjB,QAAQ,CAAC,QAAQ,CAAC;QAClB,QAAQ,CAAC,OAAO,CAAC;QACjB,QAAQ,CAAC,GAAG,CAAC;KACd,CAAC,CACH,CAAA;CACF,CAaC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { Type, } from "@sinclair/typebox";
2
+ /**
3
+ * The schema for a permission
4
+ */
5
+ export const PermissionSchema = Type.Object({
6
+ tenant: Type.String(),
7
+ type: Type.String(),
8
+ id: Type.String(),
9
+ action: Type.Array(Type.Union([
10
+ Type.Literal("read"),
11
+ Type.Literal("write"),
12
+ Type.Literal("ingest"),
13
+ Type.Literal("fetch"),
14
+ Type.Literal("*"),
15
+ ])),
16
+ });
@@ -0,0 +1,11 @@
1
+ export declare class LocalCache<T> {
2
+ private readonly defaultTtlMs?;
3
+ private cache;
4
+ private timers;
5
+ constructor(defaultTtlMs?: number | undefined);
6
+ get(key: string): T | undefined;
7
+ set(key: string, value: T, ttlMs?: number): void;
8
+ delete(key: string): void;
9
+ clear(): void;
10
+ }
11
+ //# sourceMappingURL=local-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-cache.d.ts","sourceRoot":"","sources":["../../src/utils/local-cache.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU,CAAC,CAAC;IAKX,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAJ1C,OAAO,CAAC,KAAK,CAA4B;IAEzC,OAAO,CAAC,MAAM,CAA8B;gBAEf,YAAY,CAAC,EAAE,MAAM,YAAA;IAElD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM;IASzC,MAAM,CAAC,GAAG,EAAE,MAAM;IAKlB,KAAK;CAON"}
@@ -0,0 +1,45 @@
1
+ export class LocalCache {
2
+ constructor(defaultTtlMs) {
3
+ Object.defineProperty(this, "defaultTtlMs", {
4
+ enumerable: true,
5
+ configurable: true,
6
+ writable: true,
7
+ value: defaultTtlMs
8
+ });
9
+ Object.defineProperty(this, "cache", {
10
+ enumerable: true,
11
+ configurable: true,
12
+ writable: true,
13
+ value: new Map()
14
+ });
15
+ // deno-lint-ignore no-explicit-any
16
+ Object.defineProperty(this, "timers", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: new Map()
21
+ });
22
+ }
23
+ get(key) {
24
+ return this.cache.get(key);
25
+ }
26
+ set(key, value, ttlMs) {
27
+ clearTimeout(this.timers.get(key));
28
+ this.cache.set(key, value);
29
+ if (ttlMs ?? this.defaultTtlMs) {
30
+ const timer = setTimeout(() => this.cache.delete(key), ttlMs ?? this.defaultTtlMs);
31
+ this.timers.set(key, timer);
32
+ }
33
+ }
34
+ delete(key) {
35
+ clearTimeout(this.timers.get(key));
36
+ this.cache.delete(key);
37
+ }
38
+ clear() {
39
+ for (const key of this.timers.keys()) {
40
+ clearTimeout(this.timers.get(key));
41
+ }
42
+ this.cache.clear();
43
+ this.timers.clear();
44
+ }
45
+ }
@@ -0,0 +1,12 @@
1
+ type Success<T> = {
2
+ data: T;
3
+ error: null;
4
+ };
5
+ type Failure<E> = {
6
+ data: null;
7
+ error: E;
8
+ };
9
+ type Result<T, E = Error> = Success<T> | Failure<E>;
10
+ export declare function tryCatch<T, E = Error>(promise: Promise<T>): Promise<Result<T, E>>;
11
+ export {};
12
+ //# sourceMappingURL=try-catch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"try-catch.d.ts","sourceRoot":"","sources":["../../src/utils/try-catch.ts"],"names":[],"mappings":"AACA,KAAK,OAAO,CAAC,CAAC,IAAI;IAChB,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,KAAK,OAAO,CAAC,CAAC,IAAI;IAChB,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,CAAC,CAAA;CACT,CAAA;AAED,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAGnD,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EACzC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAOvB"}
@@ -0,0 +1,10 @@
1
+ // Main wrapper function
2
+ export async function tryCatch(promise) {
3
+ try {
4
+ const data = await promise;
5
+ return { data, error: null };
6
+ }
7
+ catch (error) {
8
+ return { data: null, error: error };
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowcore/sdk",
3
- "version": "1.19.1",
3
+ "version": "1.21.0",
4
4
  "description": "Flowcore SDK",
5
5
  "homepage": "https://github.com/flowcore-io/flowcore-sdk#readme",
6
6
  "repository": {
@@ -5,6 +5,8 @@ import type { FlowcoreClient } from "../../common/flowcore-client.js";
5
5
  * The input for the data core request delete command
6
6
  */
7
7
  export interface DataCoreRequestDeleteInput {
8
+ /** The tenant */
9
+ tenant: string;
8
10
  /** The id of the data core */
9
11
  dataCoreId: string;
10
12
  /** Wait for the data core to be deleted (default: false) */
@@ -21,6 +23,10 @@ export interface DataCoreRequestDeleteOutput {
21
23
  * Request to delete a data core
22
24
  */
23
25
  export declare class DataCoreRequestDeleteCommand extends Command<DataCoreRequestDeleteInput, DataCoreRequestDeleteOutput> {
26
+ /**
27
+ * The dedicated subdomain for the command
28
+ */
29
+ protected dedicatedSubdomain: string;
24
30
  /**
25
31
  * Get the method
26
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"data-core.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,OAAO,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;IAChH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,2BAA2B;IAUnF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,2BAA2B,CAAC;CAkBxC"}
1
+ {"version":3,"file":"data-core.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,OAAO,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;IAChH;;OAEG;IACH,UAAmB,kBAAkB,EAAE,MAAM,CAAmB;IAEhE;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,2BAA2B;IAUnF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,2BAA2B,GACpC,OAAO,CAAC,2BAA2B,CAAC;CAkBxC"}
@@ -10,6 +10,18 @@ const data_core_exists_js_1 = require("./data-core.exists.js");
10
10
  * Request to delete a data core
11
11
  */
12
12
  class DataCoreRequestDeleteCommand extends command_js_1.Command {
13
+ constructor() {
14
+ super(...arguments);
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
18
+ Object.defineProperty(this, "dedicatedSubdomain", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: "delete-manager"
23
+ });
24
+ }
13
25
  /**
14
26
  * Get the method
15
27
  */
@@ -5,6 +5,8 @@ import type { FlowcoreEvent } from "../../contracts/event.js";
5
5
  * The input for the events fetch info command
6
6
  */
7
7
  export interface EventTypeInfoInput {
8
+ /** the tenant */
9
+ tenant: string;
8
10
  /** the event type id or ids */
9
11
  eventTypeId: [string, ...string[]] | string;
10
12
  /** the limit for the number of last events to fetch (default is 5) */
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.info.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;CAC5B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IAC9F;;OAEG;cACsB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAmD7F"}
1
+ {"version":3,"file":"event-type.info.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;CAC5B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IAC9F;;OAEG;cACsB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAsD7F"}
@@ -16,11 +16,13 @@ class EventTypeInfoCommand extends command_custom_js_1.CustomCommand {
16
16
  async customExecute(client) {
17
17
  const lastEventsLimit = this.input.limit ?? 5;
18
18
  const firstTimeBucketCommand = new time_bucket_list_js_1.TimeBucketListCommand({
19
+ tenant: this.input.tenant,
19
20
  eventTypeId: this.input.eventTypeId,
20
21
  order: "asc",
21
22
  pageSize: 1,
22
23
  });
23
24
  const lastTimeBucketCommand = new time_bucket_list_js_1.TimeBucketListCommand({
25
+ tenant: this.input.tenant,
24
26
  eventTypeId: this.input.eventTypeId,
25
27
  order: "desc",
26
28
  pageSize: lastEventsLimit,
@@ -41,6 +43,7 @@ class EventTypeInfoCommand extends command_custom_js_1.CustomCommand {
41
43
  const lastEvents = [];
42
44
  for (const timeBucket of lastTimeBucketResponse.timeBuckets) {
43
45
  const eventListCommand = new event_list_js_1.EventListCommand({
46
+ tenant: this.input.tenant,
44
47
  eventTypeId: this.input.eventTypeId,
45
48
  timeBucket,
46
49
  pageSize: lastEventsLimit - lastEvents.length,
@@ -5,6 +5,8 @@ import type { FlowcoreClient } from "../../common/flowcore-client.js";
5
5
  * The input for the event type request delete command
6
6
  */
7
7
  export interface EventTypeRequestDeleteInput {
8
+ /** The tenant */
9
+ tenant: string;
8
10
  /** The id of the event type */
9
11
  eventTypeId: string;
10
12
  /** Wait for the event type to be deleted (default: false) */
@@ -20,6 +22,10 @@ export interface EventTypeRequestDeleteOutput {
20
22
  * Request to delete an event type
21
23
  */
22
24
  export declare class EventTypeRequestDeleteCommand extends Command<EventTypeRequestDeleteInput, EventTypeRequestDeleteOutput> {
25
+ /**
26
+ * The dedicated subdomain for the command
27
+ */
28
+ protected dedicatedSubdomain: string;
23
29
  /**
24
30
  * Get the method
25
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,OAAO,CAAC,2BAA2B,EAAE,4BAA4B,CAAC;IACnH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,4BAA4B;IAUpF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC,4BAA4B,CAAC;CAkBzC"}
1
+ {"version":3,"file":"event-type.request-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.request-delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,OAAO,CAAC,2BAA2B,EAAE,4BAA4B,CAAC;IACnH;;OAEG;IACH,UAAmB,kBAAkB,EAAE,MAAM,CAAmB;IAEhE;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,4BAA4B;IAUpF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC,4BAA4B,CAAC;CAkBzC"}
@@ -10,6 +10,18 @@ const event_type_exists_js_1 = require("./event-type.exists.js");
10
10
  * Request to delete an event type
11
11
  */
12
12
  class EventTypeRequestDeleteCommand extends command_js_1.Command {
13
+ constructor() {
14
+ super(...arguments);
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
18
+ Object.defineProperty(this, "dedicatedSubdomain", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: "delete-manager"
23
+ });
24
+ }
13
25
  /**
14
26
  * Get the method
15
27
  */
@@ -1,10 +1,12 @@
1
1
  import { Command } from "../../common/command.js";
2
- import type { ClientError } from "../../exceptions/client-error.js";
3
2
  import type { FlowcoreClient } from "../../common/flowcore-client.js";
3
+ import type { ClientError } from "../../exceptions/client-error.js";
4
4
  /**
5
5
  * The input for the event type request truncate command
6
6
  */
7
7
  export interface EventTypeRequestTruncateInput {
8
+ /** The tenant */
9
+ tenant: string;
8
10
  /** The id of the event type */
9
11
  eventTypeId: string;
10
12
  /** Wait for the event type to be truncated (default: false) */
@@ -20,6 +22,10 @@ export interface EventTypeRequestTruncateOutput {
20
22
  * Request to truncate an event type
21
23
  */
22
24
  export declare class EventTypeRequestTruncateCommand extends Command<EventTypeRequestTruncateInput, EventTypeRequestTruncateOutput> {
25
+ /**
26
+ * The dedicated subdomain for the command
27
+ */
28
+ protected dedicatedSubdomain: string;
23
29
  /**
24
30
  * Get the method
25
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.request-truncate.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.request-truncate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,+BACX,SAAQ,OAAO,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;IAC9E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,8BAA8B;IAUtF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,8BAA8B,GACvC,OAAO,CAAC,8BAA8B,CAAC;CAmB3C"}
1
+ {"version":3,"file":"event-type.request-truncate.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.request-truncate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAKnE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,+BACX,SAAQ,OAAO,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;IAC9E;;OAEG;IACH,UAAmB,kBAAkB,EAAE,MAAM,CAAmB;IAEhE;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,8BAA8B;IAUtF;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAS9D;;OAEG;cACsB,eAAe,CACtC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,8BAA8B,GACvC,OAAO,CAAC,8BAA8B,CAAC;CAmB3C"}
@@ -10,6 +10,18 @@ const event_type_fetch_js_1 = require("./event-type.fetch.js");
10
10
  * Request to truncate an event type
11
11
  */
12
12
  class EventTypeRequestTruncateCommand extends command_js_1.Command {
13
+ constructor() {
14
+ super(...arguments);
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
18
+ Object.defineProperty(this, "dedicatedSubdomain", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: "delete-manager"
23
+ });
24
+ }
13
25
  /**
14
26
  * Get the method
15
27
  */
@@ -4,6 +4,8 @@ import { type FlowcoreEvent } from "../../contracts/event.js";
4
4
  * The input for the events fetch indexes command
5
5
  */
6
6
  export interface EventListInput {
7
+ /** The tenant */
8
+ tenant: string;
7
9
  /** the event type id or ids */
8
10
  eventTypeId: [string, ...string[]] | string;
9
11
  /** the time bucket */
@@ -42,6 +44,10 @@ export interface EventListOutput {
42
44
  * Fetch time buckets for an event type
43
45
  */
44
46
  export declare class EventListCommand extends Command<EventListInput, EventListOutput> {
47
+ /**
48
+ * The dedicated subdomain for the command
49
+ */
50
+ protected dedicatedSubdomain: string;
45
51
  /**
46
52
  * Get the method for the request
47
53
  */
@@ -1 +1 @@
1
- {"version":3,"file":"event.list.d.ts","sourceRoot":"","sources":["../../../src/commands/events/event.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAA;AAElF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC;IAC5E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAgBpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,eAAe;CAIxE"}
1
+ {"version":3,"file":"event.list.d.ts","sourceRoot":"","sources":["../../../src/commands/events/event.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAA;AAElF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC;IAC5E;;OAEG;IACH,UAAmB,kBAAkB,EAAE,MAAM,CAAiB;IAE9D;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAgBpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,eAAe;CAIxE"}
@@ -16,6 +16,18 @@ const responseSchema = typebox_1.Type.Object({
16
16
  * Fetch time buckets for an event type
17
17
  */
18
18
  class EventListCommand extends command_js_1.Command {
19
+ constructor() {
20
+ super(...arguments);
21
+ /**
22
+ * The dedicated subdomain for the command
23
+ */
24
+ Object.defineProperty(this, "dedicatedSubdomain", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: "event-source"
29
+ });
30
+ }
19
31
  /**
20
32
  * Get the method for the request
21
33
  */
@@ -33,6 +33,10 @@ export interface EventsFetchTimeBucketsByNamesOutput {
33
33
  * Fetch time buckets for an event type
34
34
  */
35
35
  export declare class EventsFetchTimeBucketsByNamesCommand extends Command<EventsFetchTimeBucketsByNamesInput, EventsFetchTimeBucketsByNamesOutput> {
36
+ /**
37
+ * The dedicated subdomain for the command
38
+ */
39
+ protected dedicatedSubdomain: string;
36
40
  /**
37
41
  * Get the base url for the request
38
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"events.fetch-time-buckets-by-names.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch-time-buckets-by-names.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,uBAAuB;IACvB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,OAAO,CAC/D,kCAAkC,EAClC,mCAAmC,CACpC;IACC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAGpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,mCAAmC;IAK3F;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAItD"}
1
+ {"version":3,"file":"events.fetch-time-buckets-by-names.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch-time-buckets-by-names.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,uBAAuB;IACvB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,OAAO,CAC/D,kCAAkC,EAClC,mCAAmC,CACpC;IACC;;OAEG;IACH,UAAmB,kBAAkB,EAAE,MAAM,CAAiB;IAE9D;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAGpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,mCAAmC;IAK3F;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAItD"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventsFetchTimeBucketsByNamesCommand = void 0;
4
4
  const typebox_1 = require("@sinclair/typebox");
5
- const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
6
5
  const command_js_1 = require("../../common/command.js");
6
+ const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
7
7
  /**
8
8
  * The response schema for the events fetch time buckets by names command
9
9
  */
@@ -15,6 +15,18 @@ const responseSchema = typebox_1.Type.Object({
15
15
  * Fetch time buckets for an event type
16
16
  */
17
17
  class EventsFetchTimeBucketsByNamesCommand extends command_js_1.Command {
18
+ constructor() {
19
+ super(...arguments);
20
+ /**
21
+ * The dedicated subdomain for the command
22
+ */
23
+ Object.defineProperty(this, "dedicatedSubdomain", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: "event-source"
28
+ });
29
+ }
18
30
  /**
19
31
  * Get the base url for the request
20
32
  */
@@ -38,6 +38,10 @@ export interface EventsFetchEventsOutput {
38
38
  * Fetch time buckets for an event type
39
39
  */
40
40
  export declare class EventsFetchCommand extends Command<EventsFetchEventsInput, EventsFetchEventsOutput> {
41
+ /**
42
+ * The dedicated subdomain for the command
43
+ */
44
+ protected dedicatedSubdomain: string;
41
45
  /**
42
46
  * Get the base url for the request
43
47
  */
@@ -1 +1 @@
1
- {"version":3,"file":"events.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAA;AAElF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAC9F;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,uBAAuB;IAK/E;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAStD"}
1
+ {"version":3,"file":"events.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAA;AAElF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAC9F;;OAEG;IACH,UAAmB,kBAAkB,EAAE,MAAM,CAAiB;IAE9D;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAUpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,uBAAuB;IAK/E;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAStD"}
@@ -16,6 +16,18 @@ const responseSchema = typebox_1.Type.Object({
16
16
  * Fetch time buckets for an event type
17
17
  */
18
18
  class EventsFetchCommand extends command_js_1.Command {
19
+ constructor() {
20
+ super(...arguments);
21
+ /**
22
+ * The dedicated subdomain for the command
23
+ */
24
+ Object.defineProperty(this, "dedicatedSubdomain", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: "event-source"
29
+ });
30
+ }
19
31
  /**
20
32
  * Get the base url for the request
21
33
  */