@flowcore/data-pump 0.1.2
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.
- package/CHANGELOG.md +32 -0
- package/README.md +28 -0
- package/esm/_dnt.shims.d.ts +9 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +64 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.create.d.ts +46 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.create.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.create.js +94 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.delete.d.ts +28 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.delete.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.delete.js +60 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.list.d.ts +27 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.list.js +58 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.create.d.ts +43 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.create.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.create.js +44 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.delete-request.d.ts +37 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.delete-request.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.delete-request.js +94 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.exists.d.ts +37 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.exists.js +33 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.fetch.d.ts +55 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.fetch.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.fetch.js +59 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.list.d.ts +33 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.list.js +40 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.update.d.ts +41 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.update.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.update.js +43 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.create.d.ts +39 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.create.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.create.js +44 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.delete-request.d.ts +41 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.delete-request.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.delete-request.js +107 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.exists.d.ts +37 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.exists.js +33 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.fetch.d.ts +49 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.fetch.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.fetch.js +59 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.list.d.ts +31 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.list.js +36 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.truncate-request.d.ts +41 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.truncate-request.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.truncate-request.js +107 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.update.d.ts +37 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.update.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.update.js +39 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch-time-buckets-by-names.d.ts +53 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch-time-buckets-by-names.js +41 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch.d.ts +58 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch.js +54 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.create.d.ts +39 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.create.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.create.js +44 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.delete-request.d.ts +54 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.delete-request.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.delete-request.js +127 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.exists.d.ts +39 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.exists.js +33 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.fetch.d.ts +55 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.fetch.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.fetch.js +59 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.list.d.ts +31 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.list.js +36 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.update.d.ts +37 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.update.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.update.js +39 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/index.d.ts +33 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/index.js +40 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.create.d.ts +30 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.create.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.create.js +60 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.delete.d.ts +28 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.delete.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.delete.js +60 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.list.d.ts +26 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.list.js +63 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.fetch.d.ts +42 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.fetch.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.fetch.js +79 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.list.d.ts +20 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.list.js +65 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.create.d.ts +31 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.create.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.create.js +66 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.delete.d.ts +28 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.delete.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.delete.js +63 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.list.d.ts +27 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.list.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.list.js +69 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/command.d.ts +85 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/command.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/command.js +129 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/flowcore-client.d.ts +56 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/flowcore-client.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/flowcore-client.js +126 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.d.ts +90 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.js +247 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/api-key.d.ts +14 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/api-key.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/api-key.js +9 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/data-core.d.ts +41 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/data-core.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/data-core.js +42 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event-type.d.ts +37 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event-type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event-type.js +39 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event.d.ts +20 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event.js +15 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/flow-type.d.ts +34 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/flow-type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/flow-type.js +34 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/index.d.ts +6 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/index.js +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/tenant.d.ts +50 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/tenant.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/tenant.js +33 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/variable.d.ts +13 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/variable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/variable.js +8 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/client-error.d.ts +9 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/client-error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/client-error.js +20 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/command-error.d.ts +7 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/command-error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/command-error.js +8 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/index.d.ts +5 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/index.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/index.js +4 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/invalid-response.d.ts +8 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/invalid-response.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/invalid-response.js +15 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/not-found.d.ts +7 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/not-found.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/not-found.js +8 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/mod.d.ts +8 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/mod.js +7 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/logger.d.ts +8 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/logger.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/logger.js +14 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/parse-response-helper.d.ts +6 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/parse-response-helper.d.ts.map +1 -0
- package/esm/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/parse-response-helper.js +16 -0
- package/esm/lib/data-pump-client.d.ts +30 -0
- package/esm/lib/data-pump-client.d.ts.map +1 -0
- package/esm/lib/data-pump-client.js +52 -0
- package/esm/lib/data-pump.d.ts +75 -0
- package/esm/lib/data-pump.d.ts.map +1 -0
- package/esm/lib/data-pump.js +364 -0
- package/esm/lib/nats-notifier.d.ts +18 -0
- package/esm/lib/nats-notifier.d.ts.map +1 -0
- package/esm/lib/nats-notifier.js +88 -0
- package/esm/lib/time-uuid.d.ts +13 -0
- package/esm/lib/time-uuid.d.ts.map +1 -0
- package/esm/lib/time-uuid.js +36 -0
- package/esm/lib/ws-notifier.d.ts +28 -0
- package/esm/lib/ws-notifier.d.ts.map +1 -0
- package/esm/lib/ws-notifier.js +87 -0
- package/esm/mod.d.ts +3 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +2 -0
- package/esm/package.json +3 -0
- package/package.json +38 -0
- package/script/_dnt.shims.d.ts +9 -0
- package/script/_dnt.shims.d.ts.map +1 -0
- package/script/_dnt.shims.js +72 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.create.d.ts +46 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.create.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.create.js +98 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.delete.d.ts +28 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.delete.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.delete.js +64 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.list.d.ts +27 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/api-key/api-key.list.js +62 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.create.d.ts +43 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.create.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.create.js +48 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.delete-request.d.ts +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.delete-request.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.delete-request.js +98 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.exists.d.ts +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.exists.js +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.fetch.d.ts +55 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.fetch.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.fetch.js +63 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.list.d.ts +33 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.list.js +44 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.update.d.ts +41 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.update.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/data-core/data-core.update.js +47 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.create.d.ts +39 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.create.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.create.js +48 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.delete-request.d.ts +41 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.delete-request.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.delete-request.js +111 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.exists.d.ts +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.exists.js +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.fetch.d.ts +49 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.fetch.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.fetch.js +63 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.list.d.ts +31 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.list.js +40 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.truncate-request.d.ts +41 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.truncate-request.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.truncate-request.js +111 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.update.d.ts +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.update.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/event-type/event-type.update.js +43 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch-time-buckets-by-names.d.ts +53 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch-time-buckets-by-names.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch-time-buckets-by-names.js +45 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch.d.ts +58 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/events/events.fetch.js +58 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.create.d.ts +39 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.create.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.create.js +48 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.delete-request.d.ts +54 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.delete-request.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.delete-request.js +131 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.exists.d.ts +39 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.exists.js +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.fetch.d.ts +55 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.fetch.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.fetch.js +63 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.list.d.ts +31 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.list.js +40 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.update.d.ts +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.update.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/flow-type/flow-type.update.js +43 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/index.d.ts +33 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/index.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/index.js +56 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.create.d.ts +30 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.create.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.create.js +64 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.delete.d.ts +28 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.delete.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.delete.js +64 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.list.d.ts +26 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/secret/secret.list.js +67 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.fetch.d.ts +42 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.fetch.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.fetch.js +83 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.list.d.ts +20 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/tenant/tenant.list.js +69 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.create.d.ts +31 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.create.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.create.js +70 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.delete.d.ts +28 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.delete.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.delete.js +67 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.list.d.ts +27 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.list.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/commands/variable/variable.list.js +73 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/command.d.ts +85 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/command.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/command.js +134 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/flowcore-client.d.ts +56 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/flowcore-client.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/flowcore-client.js +130 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.d.ts +90 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.js +274 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/api-key.d.ts +14 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/api-key.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/api-key.js +12 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/data-core.d.ts +41 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/data-core.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/data-core.js +46 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event-type.d.ts +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event-type.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event-type.js +43 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event.d.ts +20 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/event.js +18 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/flow-type.d.ts +34 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/flow-type.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/flow-type.js +38 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/index.d.ts +6 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/index.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/index.js +2 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/tenant.d.ts +50 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/tenant.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/tenant.js +37 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/variable.d.ts +13 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/variable.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/contracts/variable.js +11 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/client-error.d.ts +9 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/client-error.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/client-error.js +24 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/command-error.d.ts +7 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/command-error.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/command-error.js +12 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/index.d.ts +5 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/index.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/index.js +20 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/invalid-response.d.ts +8 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/invalid-response.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/invalid-response.js +19 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/not-found.d.ts +7 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/not-found.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/exceptions/not-found.js +12 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/mod.d.ts +8 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/mod.js +23 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/logger.d.ts +8 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/logger.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/logger.js +17 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/parse-response-helper.d.ts +6 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/parse-response-helper.d.ts.map +1 -0
- package/script/deps/jsr.io/@flowcore/sdk/1.11.4/src/utils/parse-response-helper.js +20 -0
- package/script/lib/data-pump-client.d.ts +30 -0
- package/script/lib/data-pump-client.d.ts.map +1 -0
- package/script/lib/data-pump-client.js +58 -0
- package/script/lib/data-pump.d.ts +75 -0
- package/script/lib/data-pump.d.ts.map +1 -0
- package/script/lib/data-pump.js +368 -0
- package/script/lib/nats-notifier.d.ts +18 -0
- package/script/lib/nats-notifier.d.ts.map +1 -0
- package/script/lib/nats-notifier.js +115 -0
- package/script/lib/time-uuid.d.ts +13 -0
- package/script/lib/time-uuid.d.ts.map +1 -0
- package/script/lib/time-uuid.js +40 -0
- package/script/lib/ws-notifier.d.ts +28 -0
- package/script/lib/ws-notifier.d.ts.map +1 -0
- package/script/lib/ws-notifier.js +94 -0
- package/script/mod.d.ts +3 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +18 -0
- package/script/package.json +3 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphQlCommand = exports.Command = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Abstract command for executing requests
|
|
6
|
+
*/
|
|
7
|
+
class Command {
|
|
8
|
+
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 allowed modes for the command
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(this, "allowedModes", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: ["apiKey", "bearer"]
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* The input for the command
|
|
29
|
+
*/
|
|
30
|
+
Object.defineProperty(this, "input", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: void 0
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* The input for the command
|
|
38
|
+
*/
|
|
39
|
+
this.input = input;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the method for the request
|
|
43
|
+
*/
|
|
44
|
+
getMethod() {
|
|
45
|
+
return "POST";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the path for the request
|
|
49
|
+
*/
|
|
50
|
+
getPath() {
|
|
51
|
+
return "/";
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get the body for the request
|
|
55
|
+
*/
|
|
56
|
+
getBody() {
|
|
57
|
+
if (this.getMethod() === "GET") {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return this.input ?? undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the headers for the request
|
|
64
|
+
*/
|
|
65
|
+
getHeaders() {
|
|
66
|
+
return typeof this.getBody() === "object"
|
|
67
|
+
? {
|
|
68
|
+
"Content-Type": "application/json",
|
|
69
|
+
}
|
|
70
|
+
: {};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Handle the client error
|
|
74
|
+
*/
|
|
75
|
+
handleClientError(error) {
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get the request object
|
|
80
|
+
*/
|
|
81
|
+
// deno-lint-ignore require-await
|
|
82
|
+
async getRequest(_client) {
|
|
83
|
+
return {
|
|
84
|
+
allowedModes: this.allowedModes,
|
|
85
|
+
body: this.getBody(),
|
|
86
|
+
headers: this.getHeaders(),
|
|
87
|
+
baseUrl: this.getBaseUrl(),
|
|
88
|
+
path: this.getPath(),
|
|
89
|
+
method: this.getMethod(),
|
|
90
|
+
parseResponse: this.parseResponse.bind(this),
|
|
91
|
+
processResponse: this.processResponse.bind(this),
|
|
92
|
+
handleClientError: this.handleClientError.bind(this),
|
|
93
|
+
retryOnFailure: this.retryOnFailure,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Wait for the response
|
|
98
|
+
*/
|
|
99
|
+
// deno-lint-ignore require-await
|
|
100
|
+
async processResponse(_client, response) {
|
|
101
|
+
return response;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.Command = Command;
|
|
105
|
+
/**
|
|
106
|
+
* Abstract command for executing GraphQL requests
|
|
107
|
+
*/
|
|
108
|
+
class GraphQlCommand extends Command {
|
|
109
|
+
constructor() {
|
|
110
|
+
super(...arguments);
|
|
111
|
+
/**
|
|
112
|
+
* The allowed modes for the command
|
|
113
|
+
*/
|
|
114
|
+
Object.defineProperty(this, "allowedModes", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
configurable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
value: ["bearer"]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get the base URL for the request
|
|
123
|
+
*/
|
|
124
|
+
getBaseUrl() {
|
|
125
|
+
return "https://graph.api.flowcore.io";
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get the path for the request
|
|
129
|
+
*/
|
|
130
|
+
getPath() {
|
|
131
|
+
return "/graphql";
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.GraphQlCommand = GraphQlCommand;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Command } from "./command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The options for the bearer token
|
|
4
|
+
*/
|
|
5
|
+
interface ClientOptionsBearer {
|
|
6
|
+
getBearerToken: () => Promise<string | null> | string | null;
|
|
7
|
+
apiKeyId?: never;
|
|
8
|
+
apiKey?: never;
|
|
9
|
+
retry?: {
|
|
10
|
+
delay: number;
|
|
11
|
+
maxRetries: number;
|
|
12
|
+
} | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The options for the api key
|
|
16
|
+
*/
|
|
17
|
+
interface ClientOptionsApiKey {
|
|
18
|
+
apiKeyId: string;
|
|
19
|
+
apiKey: string;
|
|
20
|
+
getBearerToken?: never;
|
|
21
|
+
retry?: {
|
|
22
|
+
delay: number;
|
|
23
|
+
maxRetries: number;
|
|
24
|
+
} | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The options for the client
|
|
28
|
+
*/
|
|
29
|
+
export type ClientOptions = ClientOptionsBearer | ClientOptionsApiKey;
|
|
30
|
+
/**
|
|
31
|
+
* A base client for executing commands
|
|
32
|
+
*/
|
|
33
|
+
export declare class FlowcoreClient {
|
|
34
|
+
private readonly options;
|
|
35
|
+
private mode;
|
|
36
|
+
private baseUrl;
|
|
37
|
+
constructor(options: ClientOptions);
|
|
38
|
+
/**
|
|
39
|
+
* Get the auth header
|
|
40
|
+
*/
|
|
41
|
+
private getAuthHeader;
|
|
42
|
+
/**
|
|
43
|
+
* Execute a command (inner method)
|
|
44
|
+
*/
|
|
45
|
+
private innerExecute;
|
|
46
|
+
/**
|
|
47
|
+
* Override the base URL for all commands
|
|
48
|
+
*/
|
|
49
|
+
setBaseUrl(baseUrl: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Execute a command
|
|
52
|
+
*/
|
|
53
|
+
execute<Input, Output>(command: Command<Input, Output>): Promise<Output>;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=flowcore-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@flowcore/sdk/1.11.4/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;IAiE1B;;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"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowcoreClient = void 0;
|
|
4
|
+
const client_error_js_1 = require("../exceptions/client-error.js");
|
|
5
|
+
const command_error_js_1 = require("../exceptions/command-error.js");
|
|
6
|
+
const RETRYABLE_ERROR_CODES = [408, 429, 500, 502, 503, 504];
|
|
7
|
+
/**
|
|
8
|
+
* A base client for executing commands
|
|
9
|
+
*/
|
|
10
|
+
class FlowcoreClient {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
Object.defineProperty(this, "options", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: options
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "mode", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "baseUrl", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
if (this.options.getBearerToken) {
|
|
31
|
+
this.mode = "bearer";
|
|
32
|
+
}
|
|
33
|
+
else if (this.options.apiKeyId && this.options.apiKey) {
|
|
34
|
+
this.mode = "apiKey";
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
throw new Error("Invalid client options");
|
|
38
|
+
}
|
|
39
|
+
if (this.options.retry === undefined) {
|
|
40
|
+
this.options.retry = {
|
|
41
|
+
delay: 250,
|
|
42
|
+
maxRetries: 3,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get the auth header
|
|
48
|
+
*/
|
|
49
|
+
async getAuthHeader() {
|
|
50
|
+
if (this.options.getBearerToken) {
|
|
51
|
+
const bearerToken = await this.options.getBearerToken();
|
|
52
|
+
if (!bearerToken) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return `Bearer ${bearerToken}`;
|
|
56
|
+
}
|
|
57
|
+
if (this.options.apiKeyId && this.options.apiKey) {
|
|
58
|
+
return `ApiKey ${this.options.apiKeyId}:${this.options.apiKey}`;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Execute a command (inner method)
|
|
64
|
+
*/
|
|
65
|
+
async innerExecute(command, retryCount = 0) {
|
|
66
|
+
const request = await command.getRequest(this);
|
|
67
|
+
if (!request.allowedModes.includes(this.mode)) {
|
|
68
|
+
throw new command_error_js_1.CommandError(command.constructor.name, `Not allowed in "${this.mode}" mode`);
|
|
69
|
+
}
|
|
70
|
+
const authHeader = await this.getAuthHeader();
|
|
71
|
+
const headers = {
|
|
72
|
+
...request.headers,
|
|
73
|
+
...(authHeader ? { Authorization: authHeader } : {}),
|
|
74
|
+
};
|
|
75
|
+
let response;
|
|
76
|
+
const url = this.baseUrl ? this.baseUrl + request.path : request.baseUrl + request.path;
|
|
77
|
+
let body;
|
|
78
|
+
if (typeof request.body === "object") {
|
|
79
|
+
body = JSON.stringify(request.body);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
response = await fetch(url, {
|
|
83
|
+
method: request.method,
|
|
84
|
+
headers,
|
|
85
|
+
body,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (request.retryOnFailure && this.options.retry && retryCount < this.options.retry.maxRetries) {
|
|
90
|
+
const delay = this.options.retry.delay;
|
|
91
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
92
|
+
return this.innerExecute(command, retryCount + 1);
|
|
93
|
+
}
|
|
94
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
95
|
+
throw new client_error_js_1.ClientError(`Failed to execute command: ${message}`, 0, {
|
|
96
|
+
command: command.constructor.name,
|
|
97
|
+
error: error,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
if (request.retryOnFailure &&
|
|
102
|
+
this.options.retry && RETRYABLE_ERROR_CODES.includes(response.status) &&
|
|
103
|
+
retryCount < this.options.retry.maxRetries) {
|
|
104
|
+
const delay = this.options.retry.delay;
|
|
105
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
106
|
+
return this.innerExecute(command, retryCount + 1);
|
|
107
|
+
}
|
|
108
|
+
const body = await response.json().catch(() => undefined);
|
|
109
|
+
const commandName = command.constructor.name;
|
|
110
|
+
const error = new client_error_js_1.ClientError(`${commandName} failed with ${response.status}: ${response.statusText}`, response.status, body);
|
|
111
|
+
request.handleClientError(error);
|
|
112
|
+
}
|
|
113
|
+
const responseBody = await response.json();
|
|
114
|
+
const parsedBody = await request.parseResponse(responseBody);
|
|
115
|
+
return request.processResponse(this, parsedBody);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Override the base URL for all commands
|
|
119
|
+
*/
|
|
120
|
+
setBaseUrl(baseUrl) {
|
|
121
|
+
this.baseUrl = baseUrl;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Execute a command
|
|
125
|
+
*/
|
|
126
|
+
execute(command) {
|
|
127
|
+
return this.innerExecute(command, 0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.FlowcoreClient = FlowcoreClient;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Subject } from "rxjs";
|
|
2
|
+
import { type Logger } from "../utils/logger.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents an event notification from the Flowcore system
|
|
5
|
+
*/
|
|
6
|
+
export type NotificationEvent = {
|
|
7
|
+
pattern: string;
|
|
8
|
+
data: {
|
|
9
|
+
tenant: string;
|
|
10
|
+
eventId: string;
|
|
11
|
+
dataCoreId: string;
|
|
12
|
+
flowType: string;
|
|
13
|
+
eventType: string;
|
|
14
|
+
validTime: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Interface for OIDC authentication client
|
|
19
|
+
*/
|
|
20
|
+
export type OidcClient = {
|
|
21
|
+
getToken: () => Promise<{
|
|
22
|
+
accessToken: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Configuration options for the NotificationClient
|
|
27
|
+
*/
|
|
28
|
+
export type NotificationClientOptions = {
|
|
29
|
+
reconnectInterval: number;
|
|
30
|
+
maxReconnects?: number;
|
|
31
|
+
maxEvents?: number;
|
|
32
|
+
logger?: Logger;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Client for handling WebSocket connections to the Flowcore notification system.
|
|
36
|
+
* Manages connection lifecycle, authentication, and event handling.
|
|
37
|
+
*/
|
|
38
|
+
export declare class NotificationClient {
|
|
39
|
+
private readonly observer;
|
|
40
|
+
private readonly oidcClient;
|
|
41
|
+
private readonly subscriptionSpec;
|
|
42
|
+
private url;
|
|
43
|
+
private webSocket;
|
|
44
|
+
private options;
|
|
45
|
+
private logger;
|
|
46
|
+
private eventCount;
|
|
47
|
+
private reconnectInterval;
|
|
48
|
+
private reconnectAttempts;
|
|
49
|
+
private _isOpen;
|
|
50
|
+
private _isConnecting;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new NotificationClient instance
|
|
53
|
+
* @param observer - RxJS Subject for emitting notification events
|
|
54
|
+
* @param oidcClient - Client for handling OIDC authentication
|
|
55
|
+
* @param subscriptionSpec - Specification for what notifications to subscribe to
|
|
56
|
+
* @param options - Configuration options for the client
|
|
57
|
+
*/
|
|
58
|
+
constructor(observer: Subject<NotificationEvent>, oidcClient: OidcClient, subscriptionSpec: {
|
|
59
|
+
tenant: string;
|
|
60
|
+
dataCore: string;
|
|
61
|
+
flowType?: string;
|
|
62
|
+
eventType?: string;
|
|
63
|
+
}, options?: Partial<NotificationClientOptions>);
|
|
64
|
+
/**
|
|
65
|
+
* Is the websocket connection open
|
|
66
|
+
*/
|
|
67
|
+
get isOpen(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Is the websocket connection currently connecting
|
|
70
|
+
*/
|
|
71
|
+
get isConnecting(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Establishes WebSocket connection and sets up event handlers
|
|
74
|
+
*/
|
|
75
|
+
connect(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Attempts to reconnect to the WebSocket server using exponential backoff
|
|
78
|
+
*/
|
|
79
|
+
private attemptReconnect;
|
|
80
|
+
/**
|
|
81
|
+
* Closes the WebSocket connection
|
|
82
|
+
*/
|
|
83
|
+
disconnect(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Overrides the base WebSocket URL for testing or different environments
|
|
86
|
+
* @param url - The new base URL to use
|
|
87
|
+
*/
|
|
88
|
+
overrideBaseUrl(url: string): void;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=notification-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-client.d.ts","sourceRoot":"","sources":["../../../../../../../../src/deps/jsr.io/@flowcore/sdk/1.11.4/src/common/notification-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AASnC,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAM/D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;QACf,UAAU,EAAE,MAAM,CAAA;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,OAAO,CAAC;QACtB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAC,CAAA;CACH,CAAA;AAcD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAKD;;;GAGG;AACH,qBAAa,kBAAkB;IAmB3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IApBnC,OAAO,CAAC,GAAG,CAA+C;IAC1D,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,iBAAiB,CAAQ;IACjC,OAAO,CAAC,iBAAiB,CAAI;IAC7B,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,aAAa,CAAiB;IAEtC;;;;;;OAMG;gBAEgB,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,EACpC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE;QACjC,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,EACD,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAU9C;;OAEG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED;;OAEG;IACH,IAAW,YAAY,IAAI,OAAO,CAEjC;IAED;;OAEG;IACG,OAAO;IAmIb;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAqBxB;;OAEG;IACH,UAAU;IAMV;;;OAGG;IACI,eAAe,CAAC,GAAG,EAAE,MAAM;CAGnC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.NotificationClient = void 0;
|
|
27
|
+
const dntShim = __importStar(require("../../../../../../../_dnt.shims.js"));
|
|
28
|
+
const mod_js_1 = require("../mod.js");
|
|
29
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
30
|
+
const flowcore_client_js_1 = require("./flowcore-client.js");
|
|
31
|
+
const node_buffer_1 = require("node:buffer");
|
|
32
|
+
// Maximum reconnection interval in milliseconds
|
|
33
|
+
const MAX_RECONNECT_INTERVAL = 30_000;
|
|
34
|
+
/**
|
|
35
|
+
* Client for handling WebSocket connections to the Flowcore notification system.
|
|
36
|
+
* Manages connection lifecycle, authentication, and event handling.
|
|
37
|
+
*/
|
|
38
|
+
class NotificationClient {
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new NotificationClient instance
|
|
41
|
+
* @param observer - RxJS Subject for emitting notification events
|
|
42
|
+
* @param oidcClient - Client for handling OIDC authentication
|
|
43
|
+
* @param subscriptionSpec - Specification for what notifications to subscribe to
|
|
44
|
+
* @param options - Configuration options for the client
|
|
45
|
+
*/
|
|
46
|
+
constructor(observer, oidcClient, subscriptionSpec, options) {
|
|
47
|
+
Object.defineProperty(this, "observer", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: observer
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "oidcClient", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: oidcClient
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(this, "subscriptionSpec", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: subscriptionSpec
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(this, "url", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true,
|
|
69
|
+
value: "wss://tenant.api.flowcore.io/notifications"
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(this, "webSocket", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
configurable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
value: void 0
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(this, "options", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
value: void 0
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(this, "logger", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
configurable: true,
|
|
86
|
+
writable: true,
|
|
87
|
+
value: void 0
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(this, "eventCount", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
value: 0
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(this, "reconnectInterval", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: void 0
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(this, "reconnectAttempts", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
configurable: true,
|
|
104
|
+
writable: true,
|
|
105
|
+
value: 0
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(this, "_isOpen", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
configurable: true,
|
|
110
|
+
writable: true,
|
|
111
|
+
value: false
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(this, "_isConnecting", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
writable: true,
|
|
117
|
+
value: false
|
|
118
|
+
});
|
|
119
|
+
this.options = {
|
|
120
|
+
reconnectInterval: 1000,
|
|
121
|
+
...options,
|
|
122
|
+
};
|
|
123
|
+
this.logger = options?.logger ?? logger_js_1.defaultLogger;
|
|
124
|
+
this.reconnectInterval = options?.reconnectInterval ?? 1000;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Is the websocket connection open
|
|
128
|
+
*/
|
|
129
|
+
get isOpen() {
|
|
130
|
+
return this._isOpen;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Is the websocket connection currently connecting
|
|
134
|
+
*/
|
|
135
|
+
get isConnecting() {
|
|
136
|
+
return this._isConnecting;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Establishes WebSocket connection and sets up event handlers
|
|
140
|
+
*/
|
|
141
|
+
async connect() {
|
|
142
|
+
if (this._isConnecting || this._isOpen) {
|
|
143
|
+
this.logger.debug("Is already connecting or open");
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this._isConnecting = true;
|
|
147
|
+
const token = await this.oidcClient.getToken();
|
|
148
|
+
const flowcoreClient = new flowcore_client_js_1.FlowcoreClient({
|
|
149
|
+
getBearerToken: () => Promise.resolve(token.accessToken),
|
|
150
|
+
});
|
|
151
|
+
const tenant = await flowcoreClient.execute(new mod_js_1.TenantFetchCommand({
|
|
152
|
+
tenant: this.subscriptionSpec.tenant,
|
|
153
|
+
}));
|
|
154
|
+
const dataCore = await flowcoreClient.execute(new mod_js_1.DataCoreFetchCommand({
|
|
155
|
+
tenantId: tenant.id,
|
|
156
|
+
dataCore: this.subscriptionSpec.dataCore,
|
|
157
|
+
}));
|
|
158
|
+
let flowType;
|
|
159
|
+
let eventType;
|
|
160
|
+
if (this.subscriptionSpec.flowType) {
|
|
161
|
+
flowType = await flowcoreClient.execute(new mod_js_1.FlowTypeFetchCommand({
|
|
162
|
+
dataCoreId: dataCore.id,
|
|
163
|
+
flowType: this.subscriptionSpec.flowType,
|
|
164
|
+
}));
|
|
165
|
+
if (this.subscriptionSpec.eventType) {
|
|
166
|
+
eventType = await flowcoreClient.execute(new mod_js_1.EventTypeFetchCommand({
|
|
167
|
+
flowTypeId: flowType?.id,
|
|
168
|
+
eventType: this.subscriptionSpec.eventType,
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
this.webSocket = new dntShim.WebSocket(`${this.url}?token=${encodeURIComponent(token.accessToken)}`);
|
|
173
|
+
this.webSocket.onopen = () => {
|
|
174
|
+
this._isOpen = true;
|
|
175
|
+
this._isConnecting = false;
|
|
176
|
+
this.logger.info("WebSocket connection opened.");
|
|
177
|
+
this.reconnectInterval = this.options.reconnectInterval;
|
|
178
|
+
this.reconnectAttempts = 0;
|
|
179
|
+
this.webSocket.send(JSON.stringify({
|
|
180
|
+
tenant: this.subscriptionSpec.tenant,
|
|
181
|
+
dataCoreId: dataCore.id,
|
|
182
|
+
flowTypeId: flowType?.id,
|
|
183
|
+
eventTypeId: eventType?.id,
|
|
184
|
+
}));
|
|
185
|
+
};
|
|
186
|
+
this.webSocket.onmessage = (event) => {
|
|
187
|
+
let parsedData;
|
|
188
|
+
if (event.data instanceof ArrayBuffer) {
|
|
189
|
+
parsedData = new TextDecoder().decode(event.data);
|
|
190
|
+
}
|
|
191
|
+
else if (node_buffer_1.Buffer.isBuffer(event.data)) {
|
|
192
|
+
parsedData = event.data.toString();
|
|
193
|
+
}
|
|
194
|
+
else if (Array.isArray(event.data)) {
|
|
195
|
+
// Handle Buffer arrays by concatenating them
|
|
196
|
+
parsedData = node_buffer_1.Buffer.concat(event.data).toString();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
parsedData = event.data;
|
|
200
|
+
}
|
|
201
|
+
const data = JSON.parse(parsedData);
|
|
202
|
+
if (data.type === "validation") {
|
|
203
|
+
this.logger.error(`Bad request: ${data.summary} - ${data.message} - ${data.found} - ${data.errors}`);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const parsed = JSON.parse(data.message);
|
|
207
|
+
this.logger.debug(`Received event: ${parsed.pattern}`);
|
|
208
|
+
this.observer.next({
|
|
209
|
+
pattern: parsed.pattern,
|
|
210
|
+
data: {
|
|
211
|
+
tenant: parsed.data.tenantId,
|
|
212
|
+
eventId: parsed.data.eventId,
|
|
213
|
+
dataCoreId: parsed.data.dataCore,
|
|
214
|
+
flowType: parsed.data.aggregator,
|
|
215
|
+
eventType: parsed.data.eventType,
|
|
216
|
+
validTime: parsed.data.validTime,
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
this.eventCount++;
|
|
220
|
+
if (this.options.maxEvents && this.options.maxEvents <= this.eventCount) {
|
|
221
|
+
this.observer.complete();
|
|
222
|
+
this.eventCount = 0;
|
|
223
|
+
this.webSocket.close(1000, "Max events received");
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
this.webSocket.onclose = (event) => {
|
|
227
|
+
this._isOpen = false;
|
|
228
|
+
this.logger.info(`Connection closed: Code [${event.code}], Reason: ${event.reason}`);
|
|
229
|
+
if (![1000].includes(event.code)) {
|
|
230
|
+
this.attemptReconnect();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this._isConnecting = false;
|
|
234
|
+
this.observer.complete();
|
|
235
|
+
};
|
|
236
|
+
this.webSocket.onerror = (error) => {
|
|
237
|
+
this.logger.error(`WebSocket encountered error: ${error}`);
|
|
238
|
+
this.observer.error(error);
|
|
239
|
+
this.webSocket.close();
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Attempts to reconnect to the WebSocket server using exponential backoff
|
|
244
|
+
*/
|
|
245
|
+
attemptReconnect() {
|
|
246
|
+
if (this.options.maxReconnects && this.reconnectAttempts >= this.options.maxReconnects) {
|
|
247
|
+
this.logger.error(`Max reconnect attempts ${this.reconnectAttempts}/${this.options.maxReconnects} reached. Giving up.`);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
this.reconnectAttempts++;
|
|
251
|
+
this._isConnecting = true;
|
|
252
|
+
this.logger.info(`Attempting reconnection ${this.reconnectAttempts}${this.options.maxReconnects ? `/${this.options.maxReconnects}` : ""} in ${this.reconnectInterval} ms...`);
|
|
253
|
+
setTimeout(() => {
|
|
254
|
+
this.connect();
|
|
255
|
+
}, this.reconnectInterval);
|
|
256
|
+
this.reconnectInterval = Math.min(MAX_RECONNECT_INTERVAL, this.reconnectInterval * 2);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Closes the WebSocket connection
|
|
260
|
+
*/
|
|
261
|
+
disconnect() {
|
|
262
|
+
if (this.webSocket) {
|
|
263
|
+
this.webSocket.close(1000, "Disconnected by user");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Overrides the base WebSocket URL for testing or different environments
|
|
268
|
+
* @param url - The new base URL to use
|
|
269
|
+
*/
|
|
270
|
+
overrideBaseUrl(url) {
|
|
271
|
+
this.url = url;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
exports.NotificationClient = NotificationClient;
|