@flowcore/sdk 1.20.0 → 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 (118) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/commands/data-core/data-core.request-delete.d.ts +5 -1
  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 +3 -6
  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 +5 -1
  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 +3 -6
  11. package/esm/commands/event-type/event-type.request-truncate.d.ts +5 -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 +3 -6
  14. package/esm/commands/events/event.list.d.ts +5 -1
  15. package/esm/commands/events/event.list.d.ts.map +1 -1
  16. package/esm/commands/events/event.list.js +3 -6
  17. package/esm/commands/events/events.fetch-time-buckets-by-names.d.ts +3 -1
  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 +3 -6
  20. package/esm/commands/events/events.fetch.d.ts +3 -1
  21. package/esm/commands/events/events.fetch.d.ts.map +1 -1
  22. package/esm/commands/events/events.fetch.js +3 -6
  23. package/esm/commands/events/time-bucket.list.d.ts +5 -1
  24. package/esm/commands/events/time-bucket.list.d.ts.map +1 -1
  25. package/esm/commands/events/time-bucket.list.js +3 -6
  26. package/esm/commands/flow-type/flow-type.delete-request.d.ts +0 -2
  27. package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
  28. package/esm/commands/flow-type/flow-type.request-delete.d.ts +5 -1
  29. package/esm/commands/flow-type/flow-type.request-delete.d.ts.map +1 -1
  30. package/esm/commands/flow-type/flow-type.request-delete.js +3 -6
  31. package/esm/commands/index.d.ts +1 -0
  32. package/esm/commands/index.d.ts.map +1 -1
  33. package/esm/commands/index.js +1 -0
  34. package/esm/commands/security/pat.exchange.d.ts.map +1 -1
  35. package/esm/commands/security/permissions.list.d.ts +28 -0
  36. package/esm/commands/security/permissions.list.d.ts.map +1 -0
  37. package/esm/commands/security/permissions.list.js +38 -0
  38. package/esm/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -1
  39. package/esm/common/command-custom.d.ts +0 -2
  40. package/esm/common/command-custom.d.ts.map +1 -1
  41. package/esm/common/command.d.ts +9 -5
  42. package/esm/common/command.d.ts.map +1 -1
  43. package/esm/common/command.js +33 -11
  44. package/esm/common/flowcore-client.d.ts +5 -6
  45. package/esm/common/flowcore-client.d.ts.map +1 -1
  46. package/esm/common/flowcore-client.js +20 -35
  47. package/esm/common/tenant.cache.d.ts +17 -0
  48. package/esm/common/tenant.cache.d.ts.map +1 -0
  49. package/esm/common/tenant.cache.js +2 -0
  50. package/esm/contracts/pat.d.ts.map +1 -1
  51. package/esm/contracts/permission.d.ts +21 -0
  52. package/esm/contracts/permission.d.ts.map +1 -0
  53. package/esm/contracts/permission.js +16 -0
  54. package/esm/utils/local-cache.d.ts +11 -0
  55. package/esm/utils/local-cache.d.ts.map +1 -0
  56. package/esm/utils/local-cache.js +45 -0
  57. package/esm/utils/try-catch.d.ts +12 -0
  58. package/esm/utils/try-catch.d.ts.map +1 -0
  59. package/esm/utils/try-catch.js +10 -0
  60. package/package.json +1 -2
  61. package/script/commands/data-core/data-core.request-delete.d.ts +5 -1
  62. package/script/commands/data-core/data-core.request-delete.d.ts.map +1 -1
  63. package/script/commands/data-core/data-core.request-delete.js +3 -6
  64. package/script/commands/event-type/event-type.info.d.ts +2 -0
  65. package/script/commands/event-type/event-type.info.d.ts.map +1 -1
  66. package/script/commands/event-type/event-type.info.js +3 -0
  67. package/script/commands/event-type/event-type.request-delete.d.ts +5 -1
  68. package/script/commands/event-type/event-type.request-delete.d.ts.map +1 -1
  69. package/script/commands/event-type/event-type.request-delete.js +3 -6
  70. package/script/commands/event-type/event-type.request-truncate.d.ts +5 -1
  71. package/script/commands/event-type/event-type.request-truncate.d.ts.map +1 -1
  72. package/script/commands/event-type/event-type.request-truncate.js +3 -6
  73. package/script/commands/events/event.list.d.ts +5 -1
  74. package/script/commands/events/event.list.d.ts.map +1 -1
  75. package/script/commands/events/event.list.js +3 -6
  76. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts +3 -1
  77. package/script/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -1
  78. package/script/commands/events/events.fetch-time-buckets-by-names.js +3 -6
  79. package/script/commands/events/events.fetch.d.ts +3 -1
  80. package/script/commands/events/events.fetch.d.ts.map +1 -1
  81. package/script/commands/events/events.fetch.js +3 -6
  82. package/script/commands/events/time-bucket.list.d.ts +5 -1
  83. package/script/commands/events/time-bucket.list.d.ts.map +1 -1
  84. package/script/commands/events/time-bucket.list.js +3 -6
  85. package/script/commands/flow-type/flow-type.delete-request.d.ts +0 -2
  86. package/script/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
  87. package/script/commands/flow-type/flow-type.request-delete.d.ts +5 -1
  88. package/script/commands/flow-type/flow-type.request-delete.d.ts.map +1 -1
  89. package/script/commands/flow-type/flow-type.request-delete.js +3 -6
  90. package/script/commands/index.d.ts +1 -0
  91. package/script/commands/index.d.ts.map +1 -1
  92. package/script/commands/index.js +1 -0
  93. package/script/commands/security/pat.exchange.d.ts.map +1 -1
  94. package/script/commands/security/permissions.list.d.ts +28 -0
  95. package/script/commands/security/permissions.list.d.ts.map +1 -0
  96. package/script/commands/security/permissions.list.js +42 -0
  97. package/script/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -1
  98. package/script/common/command-custom.d.ts +0 -2
  99. package/script/common/command-custom.d.ts.map +1 -1
  100. package/script/common/command.d.ts +9 -5
  101. package/script/common/command.d.ts.map +1 -1
  102. package/script/common/command.js +33 -11
  103. package/script/common/flowcore-client.d.ts +5 -6
  104. package/script/common/flowcore-client.d.ts.map +1 -1
  105. package/script/common/flowcore-client.js +20 -38
  106. package/script/common/tenant.cache.d.ts +17 -0
  107. package/script/common/tenant.cache.d.ts.map +1 -0
  108. package/script/common/tenant.cache.js +5 -0
  109. package/script/contracts/pat.d.ts.map +1 -1
  110. package/script/contracts/permission.d.ts +21 -0
  111. package/script/contracts/permission.d.ts.map +1 -0
  112. package/script/contracts/permission.js +19 -0
  113. package/script/utils/local-cache.d.ts +11 -0
  114. package/script/utils/local-cache.d.ts.map +1 -0
  115. package/script/utils/local-cache.js +49 -0
  116. package/script/utils/try-catch.d.ts +12 -0
  117. package/script/utils/try-catch.d.ts.map +1 -0
  118. 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,12 +15,9 @@ export class Command {
12
15
  writable: true,
13
16
  value: true
14
17
  });
15
- Object.defineProperty(this, "supportsDedicatedUrl", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: false
20
- });
18
+ /**
19
+ * The dedicated subdomain for the command
20
+ */
21
21
  Object.defineProperty(this, "dedicatedSubdomain", {
22
22
  enumerable: true,
23
23
  configurable: true,
@@ -47,6 +47,31 @@ export class Command {
47
47
  */
48
48
  this.input = input;
49
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
+ }
50
75
  /**
51
76
  * Get the method for the request
52
77
  */
@@ -87,21 +112,18 @@ export class Command {
87
112
  /**
88
113
  * Get the request object
89
114
  */
90
- // deno-lint-ignore require-await
91
- async getRequest(_client) {
115
+ async getRequest(client) {
92
116
  return {
93
117
  allowedModes: this.allowedModes,
94
118
  body: this.getBody(),
95
119
  headers: this.getHeaders(),
96
- baseUrl: this.getBaseUrl(),
120
+ baseUrl: (await this.getDedicatedBaseUrl(client)) ?? this.getBaseUrl(),
97
121
  path: this.getPath(),
98
122
  method: this.getMethod(),
99
123
  parseResponse: this.parseResponse.bind(this),
100
124
  processResponse: this.processResponse.bind(this),
101
125
  handleClientError: this.handleClientError.bind(this),
102
126
  retryOnFailure: this.retryOnFailure,
103
- supportsDedicatedUrl: this.supportsDedicatedUrl,
104
- dedicatedSubdomain: this.dedicatedSubdomain,
105
127
  };
106
128
  }
107
129
  /**
@@ -34,7 +34,6 @@ export declare class FlowcoreClient {
34
34
  private readonly options;
35
35
  private mode;
36
36
  private baseUrl;
37
- private dedicatedTenantCache;
38
37
  constructor(options: ClientOptions);
39
38
  /**
40
39
  * Get the auth header
@@ -51,16 +50,16 @@ export declare class FlowcoreClient {
51
50
  /**
52
51
  * Execute a command
53
52
  */
54
- execute<Input, Output>(command: Command<Input, Output>, dedicatedTenantId?: string): Promise<Output>;
55
- /**
56
- * Clear the dedicated tenant cache
57
- */
58
- clearDedicatedTenantCache(): void;
53
+ execute<Input, Output>(command: Command<Input, Output>): Promise<Output>;
59
54
  /**
60
55
  * Close the client and clean up resources
61
56
  * This should be called when the client is no longer needed to prevent memory leaks
62
57
  */
63
58
  close(): void;
59
+ /**
60
+ * Dispose the client
61
+ */
62
+ [Symbol.dispose](): void;
64
63
  }
65
64
  export {};
66
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":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C;;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;AAIrE;;GAEG;AACH,qBAAa,cAAc;IAKb,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,oBAAoB,CAAmB;gBAElB,OAAO,EAAE,aAAa;IAiBnD;;OAEG;YACW,aAAa;IAc3B;;OAEG;YACW,YAAY;IAuF1B;;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,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIpG;;OAEG;IACH,yBAAyB,IAAI,IAAI;IAIjC;;;OAGG;IACH,KAAK,IAAI,IAAI;CAId"}
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,9 +1,8 @@
1
- import NodeCache from "node-cache";
2
- import { TenantFetchCommand } from "../commands/index.js";
3
1
  import { ClientError } from "../exceptions/client-error.js";
4
2
  import { CommandError } from "../exceptions/command-error.js";
3
+ import { tryCatch } from "../utils/try-catch.js";
4
+ import { tenantCache } from "./tenant.cache.js";
5
5
  const RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504];
6
- const getDedicatedTenantCacheKey = (tenantId) => `dedicated-tenant-${tenantId}`;
7
6
  /**
8
7
  * A base client for executing commands
9
8
  */
@@ -27,12 +26,6 @@ export class FlowcoreClient {
27
26
  writable: true,
28
27
  value: void 0
29
28
  });
30
- Object.defineProperty(this, "dedicatedTenantCache", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: new NodeCache()
35
- });
36
29
  if (this.options.getBearerToken) {
37
30
  this.mode = "bearer";
38
31
  }
@@ -68,29 +61,21 @@ export class FlowcoreClient {
68
61
  /**
69
62
  * Execute a command (inner method)
70
63
  */
71
- async innerExecute(command, retryCount = 0, dedicatedTenantId) {
64
+ async innerExecute(command, retryCount = 0) {
72
65
  const request = await command.getRequest(this);
73
- if (request.supportsDedicatedUrl && request.dedicatedSubdomain && dedicatedTenantId) {
74
- let tenantConfig = this.dedicatedTenantCache.get(getDedicatedTenantCacheKey(dedicatedTenantId));
75
- if (tenantConfig === undefined) {
76
- const tenant = await this.execute(new TenantFetchCommand({ tenantId: dedicatedTenantId }));
77
- tenantConfig = tenant;
78
- this.dedicatedTenantCache.set(getDedicatedTenantCacheKey(dedicatedTenantId), tenant, 60 * 5);
79
- }
80
- if (tenantConfig.isDedicated) {
81
- if (!tenantConfig.dedicated?.configuration.domain) {
82
- throw new CommandError(command.constructor.name, `Tenant ${dedicatedTenantId} does not have a dedicated domain configured`);
83
- }
84
- this.baseUrl = `https://${request.dedicatedSubdomain}.${tenantConfig.dedicated?.configuration.domain}`;
85
- }
86
- }
87
66
  if (request.customExecute) {
88
67
  return request.customExecute(this);
89
68
  }
90
69
  if (!request.allowedModes.includes(this.mode)) {
91
70
  throw new CommandError(command.constructor.name, `Not allowed in "${this.mode}" mode`);
92
71
  }
93
- 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
+ }
94
79
  const headers = {
95
80
  ...request.headers,
96
81
  ...(authHeader ? { Authorization: authHeader } : {}),
@@ -146,21 +131,21 @@ export class FlowcoreClient {
146
131
  /**
147
132
  * Execute a command
148
133
  */
149
- execute(command, dedicatedTenantId) {
150
- return this.innerExecute(command, 0, dedicatedTenantId);
151
- }
152
- /**
153
- * Clear the dedicated tenant cache
154
- */
155
- clearDedicatedTenantCache() {
156
- this.dedicatedTenantCache.flushAll();
134
+ execute(command) {
135
+ return this.innerExecute(command, 0);
157
136
  }
158
137
  /**
159
138
  * Close the client and clean up resources
160
139
  * This should be called when the client is no longer needed to prevent memory leaks
161
140
  */
162
141
  close() {
163
- // Close the NodeCache instance to prevent timer leaks
164
- this.dedicatedTenantCache.close();
142
+ // Clear the tenant cache
143
+ tenantCache.clear();
144
+ }
145
+ /**
146
+ * Dispose the client
147
+ */
148
+ [Symbol.dispose]() {
149
+ this.close();
165
150
  }
166
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.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Flowcore SDK",
5
5
  "homepage": "https://github.com/flowcore-io/flowcore-sdk#readme",
6
6
  "repository": {
@@ -21,7 +21,6 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@sinclair/typebox": "0.32.15",
24
- "node-cache": "5.1.2",
25
24
  "rxjs": "^7.8.1",
26
25
  "@deno/shim-deno": "~0.18.0",
27
26
  "ws": "^8.13.0"
@@ -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,7 +23,9 @@ export interface DataCoreRequestDeleteOutput {
21
23
  * Request to delete a data core
22
24
  */
23
25
  export declare class DataCoreRequestDeleteCommand extends Command<DataCoreRequestDeleteInput, DataCoreRequestDeleteOutput> {
24
- protected supportsDedicatedUrl: boolean;
26
+ /**
27
+ * The dedicated subdomain for the command
28
+ */
25
29
  protected dedicatedSubdomain: string;
26
30
  /**
27
31
  * Get the method
@@ -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,UAAmB,oBAAoB,EAAE,OAAO,CAAO;IACvD,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"}
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"}
@@ -12,12 +12,9 @@ const data_core_exists_js_1 = require("./data-core.exists.js");
12
12
  class DataCoreRequestDeleteCommand extends command_js_1.Command {
13
13
  constructor() {
14
14
  super(...arguments);
15
- Object.defineProperty(this, "supportsDedicatedUrl", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: true
20
- });
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
21
18
  Object.defineProperty(this, "dedicatedSubdomain", {
22
19
  enumerable: true,
23
20
  configurable: true,
@@ -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,7 +22,9 @@ export interface EventTypeRequestDeleteOutput {
20
22
  * Request to delete an event type
21
23
  */
22
24
  export declare class EventTypeRequestDeleteCommand extends Command<EventTypeRequestDeleteInput, EventTypeRequestDeleteOutput> {
23
- protected supportsDedicatedUrl: boolean;
25
+ /**
26
+ * The dedicated subdomain for the command
27
+ */
24
28
  protected dedicatedSubdomain: string;
25
29
  /**
26
30
  * Get the method
@@ -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,UAAmB,oBAAoB,EAAE,OAAO,CAAO;IACvD,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"}
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"}
@@ -12,12 +12,9 @@ const event_type_exists_js_1 = require("./event-type.exists.js");
12
12
  class EventTypeRequestDeleteCommand extends command_js_1.Command {
13
13
  constructor() {
14
14
  super(...arguments);
15
- Object.defineProperty(this, "supportsDedicatedUrl", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: true
20
- });
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
21
18
  Object.defineProperty(this, "dedicatedSubdomain", {
22
19
  enumerable: true,
23
20
  configurable: true,
@@ -5,6 +5,8 @@ import type { ClientError } from "../../exceptions/client-error.js";
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,7 +22,9 @@ export interface EventTypeRequestTruncateOutput {
20
22
  * Request to truncate an event type
21
23
  */
22
24
  export declare class EventTypeRequestTruncateCommand extends Command<EventTypeRequestTruncateInput, EventTypeRequestTruncateOutput> {
23
- protected supportsDedicatedUrl: boolean;
25
+ /**
26
+ * The dedicated subdomain for the command
27
+ */
24
28
  protected dedicatedSubdomain: string;
25
29
  /**
26
30
  * Get the method
@@ -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;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,+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,UAAmB,oBAAoB,EAAE,OAAO,CAAO;IACvD,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"}
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"}
@@ -12,12 +12,9 @@ const event_type_fetch_js_1 = require("./event-type.fetch.js");
12
12
  class EventTypeRequestTruncateCommand extends command_js_1.Command {
13
13
  constructor() {
14
14
  super(...arguments);
15
- Object.defineProperty(this, "supportsDedicatedUrl", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: true
20
- });
15
+ /**
16
+ * The dedicated subdomain for the command
17
+ */
21
18
  Object.defineProperty(this, "dedicatedSubdomain", {
22
19
  enumerable: true,
23
20
  configurable: true,
@@ -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,7 +44,9 @@ export interface EventListOutput {
42
44
  * Fetch time buckets for an event type
43
45
  */
44
46
  export declare class EventListCommand extends Command<EventListInput, EventListOutput> {
45
- protected supportsDedicatedUrl: boolean;
47
+ /**
48
+ * The dedicated subdomain for the command
49
+ */
46
50
  protected dedicatedSubdomain: string;
47
51
  /**
48
52
  * Get the method for the request
@@ -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,UAAmB,oBAAoB,EAAE,OAAO,CAAO;IACvD,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"}
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"}
@@ -18,12 +18,9 @@ const responseSchema = typebox_1.Type.Object({
18
18
  class EventListCommand extends command_js_1.Command {
19
19
  constructor() {
20
20
  super(...arguments);
21
- Object.defineProperty(this, "supportsDedicatedUrl", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: true
26
- });
21
+ /**
22
+ * The dedicated subdomain for the command
23
+ */
27
24
  Object.defineProperty(this, "dedicatedSubdomain", {
28
25
  enumerable: true,
29
26
  configurable: true,
@@ -33,7 +33,9 @@ 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
- protected supportsDedicatedUrl: boolean;
36
+ /**
37
+ * The dedicated subdomain for the command
38
+ */
37
39
  protected dedicatedSubdomain: string;
38
40
  /**
39
41
  * Get the base url for the request
@@ -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":"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,UAAmB,oBAAoB,EAAE,OAAO,CAAO;IACvD,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"}
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"}