@aerokit/sdk 12.80.0 → 12.82.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.
- package/dist/cjs/bpm/deployer.js +1 -1
- package/dist/cjs/bpm/index.js +1 -1
- package/dist/cjs/bpm/process.js +1 -1
- package/dist/cjs/bpm/tasks.js +1 -1
- package/dist/cjs/bpm/tracer.js +1 -1
- package/dist/cjs/bpm/values.js +1 -1
- package/dist/cjs/cache/cache.js +1 -1
- package/dist/cjs/cache/index.js +1 -1
- package/dist/cjs/cms/cmis.js +1 -1
- package/dist/cjs/cms/index.js +1 -1
- package/dist/cjs/component/decorators.js +1 -1
- package/dist/cjs/component/index.js +1 -1
- package/dist/cjs/core/configurations.js +1 -1
- package/dist/cjs/core/context.js +1 -1
- package/dist/cjs/core/env.js +1 -1
- package/dist/cjs/core/globals.js +1 -1
- package/dist/cjs/core/index.js +1 -1
- package/dist/cjs/db/dao.js +1 -1
- package/dist/cjs/db/database.js +1 -1
- package/dist/cjs/db/decorators.js +1 -1
- package/dist/cjs/db/index.js +1 -1
- package/dist/cjs/db/insert.js +1 -1
- package/dist/cjs/db/orm.js +1 -1
- package/dist/cjs/db/ormstatements.js +1 -1
- package/dist/cjs/db/procedure.js +1 -1
- package/dist/cjs/db/query.js +1 -1
- package/dist/cjs/db/repository.js +1 -1
- package/dist/cjs/db/sequence.js +1 -1
- package/dist/cjs/db/sql.js +1 -1
- package/dist/cjs/db/store.js +1 -1
- package/dist/cjs/db/translator.js +1 -1
- package/dist/cjs/db/update.js +1 -1
- package/dist/cjs/etcd/client.js +1 -1
- package/dist/cjs/etcd/index.js +1 -1
- package/dist/cjs/extensions/decorators.js +1 -1
- package/dist/cjs/extensions/extensions.js +1 -1
- package/dist/cjs/extensions/index.js +1 -1
- package/dist/cjs/git/client.js +1 -1
- package/dist/cjs/git/index.js +1 -1
- package/dist/cjs/http/client-async.js +1 -1
- package/dist/cjs/http/client.js +1 -1
- package/dist/cjs/http/decorators.js +1 -1
- package/dist/cjs/http/errors/ForbiddenError.js +1 -1
- package/dist/cjs/http/errors/ValidationError.js +1 -1
- package/dist/cjs/http/errors.js +1 -1
- package/dist/cjs/http/index.js +1 -1
- package/dist/cjs/http/request.js +1 -1
- package/dist/cjs/http/response.js +1 -1
- package/dist/cjs/http/rs/resource-http-controller.js +1 -1
- package/dist/cjs/http/rs/resource-mappings.js +1 -1
- package/dist/cjs/http/rs/resource-method.js +1 -1
- package/dist/cjs/http/rs/resource.js +1 -1
- package/dist/cjs/http/rs.js +1 -1
- package/dist/cjs/http/session.js +1 -1
- package/dist/cjs/http/upload.js +1 -1
- package/dist/cjs/http/utils.js +1 -1
- package/dist/cjs/indexing/index.js +1 -1
- package/dist/cjs/indexing/searcher.js +1 -1
- package/dist/cjs/indexing/writer.js +1 -1
- package/dist/cjs/integrations/index.js +1 -1
- package/dist/cjs/integrations/integrations.js +1 -1
- package/dist/cjs/io/bytes.js +1 -1
- package/dist/cjs/io/files.js +1 -1
- package/dist/cjs/io/image.js +1 -1
- package/dist/cjs/io/index.js +1 -1
- package/dist/cjs/io/streams.js +1 -1
- package/dist/cjs/io/zip.js +1 -1
- package/dist/cjs/job/decorators.js +1 -1
- package/dist/cjs/job/index.js +1 -1
- package/dist/cjs/job/scheduler.js +1 -1
- package/dist/cjs/junit/index.js +1 -1
- package/dist/cjs/junit/junit.js +1 -1
- package/dist/cjs/kafka/consumer.js +1 -1
- package/dist/cjs/kafka/index.js +1 -1
- package/dist/cjs/kafka/producer.js +1 -1
- package/dist/cjs/log/index.js +1 -1
- package/dist/cjs/log/logging.js +1 -1
- package/dist/cjs/mail/client.js +1 -1
- package/dist/cjs/mail/index.js +1 -1
- package/dist/cjs/messaging/consumer.js +1 -1
- package/dist/cjs/messaging/decorators.js +1 -1
- package/dist/cjs/messaging/index.js +1 -1
- package/dist/cjs/messaging/producer.js +1 -1
- package/dist/cjs/mongodb/client.js +1 -1
- package/dist/cjs/mongodb/dao.js +1 -1
- package/dist/cjs/mongodb/index.js +1 -1
- package/dist/cjs/net/decorators.js +1 -1
- package/dist/cjs/net/index.js +1 -1
- package/dist/cjs/net/soap.js +1 -1
- package/dist/cjs/net/websockets.js +1 -1
- package/dist/cjs/pdf/index.js +1 -1
- package/dist/cjs/pdf/pdf.js +3 -3
- package/dist/cjs/platform/command.js +1 -1
- package/dist/cjs/platform/engines.js +1 -1
- package/dist/cjs/platform/index.js +1 -1
- package/dist/cjs/platform/lifecycle.js +1 -1
- package/dist/cjs/platform/os.js +1 -1
- package/dist/cjs/platform/problems.js +1 -1
- package/dist/cjs/platform/registry.js +1 -1
- package/dist/cjs/platform/repository.js +1 -1
- package/dist/cjs/platform/workspace.js +1 -1
- package/dist/cjs/qldb/index.js +1 -1
- package/dist/cjs/qldb/qldb.js +1 -1
- package/dist/cjs/rabbitmq/consumer.js +1 -1
- package/dist/cjs/rabbitmq/index.js +1 -1
- package/dist/cjs/rabbitmq/producer.js +1 -1
- package/dist/cjs/redis/client.js +1 -1
- package/dist/cjs/redis/index.js +1 -1
- package/dist/cjs/security/decorators.js +1 -1
- package/dist/cjs/security/index.js +1 -1
- package/dist/cjs/security/oauth.js +1 -1
- package/dist/cjs/security/user.js +1 -1
- package/dist/cjs/template/engines.js +1 -1
- package/dist/cjs/template/index.js +1 -1
- package/dist/cjs/utils/alphanumeric.js +2 -2
- package/dist/cjs/utils/base64.js +1 -1
- package/dist/cjs/utils/converter.js +1 -1
- package/dist/cjs/utils/digest.js +1 -1
- package/dist/cjs/utils/escape.js +1 -1
- package/dist/cjs/utils/hex.js +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/jsonpath.js +1 -1
- package/dist/cjs/utils/qrcode.js +1 -1
- package/dist/cjs/utils/url.js +1 -1
- package/dist/cjs/utils/utf8.js +1 -1
- package/dist/cjs/utils/uuid.js +1 -1
- package/dist/cjs/utils/xml.js +1 -1
- package/dist/dts/bpm/deployer.d.ts +35 -3
- package/dist/dts/bpm/index.d.ts +14 -0
- package/dist/dts/bpm/process.d.ts +28 -3
- package/dist/dts/bpm/tasks.d.ts +32 -1
- package/dist/dts/bpm/tracer.d.ts +35 -0
- package/dist/dts/bpm/values.d.ts +17 -3
- package/dist/dts/cache/cache.d.ts +38 -0
- package/dist/dts/cache/index.d.ts +10 -0
- package/dist/dts/cms/cmis.d.ts +28 -3
- package/dist/dts/cms/index.d.ts +10 -0
- package/dist/dts/component/decorators.d.ts +35 -5
- package/dist/dts/component/index.d.ts +10 -0
- package/dist/dts/core/configurations.d.ts +43 -4
- package/dist/dts/core/context.d.ts +35 -2
- package/dist/dts/core/env.d.ts +29 -2
- package/dist/dts/core/globals.d.ts +34 -2
- package/dist/dts/core/index.d.ts +13 -0
- package/dist/dts/db/database.d.ts +34 -0
- package/dist/dts/db/decorators.d.ts +55 -2
- package/dist/dts/db/index.d.ts +19 -0
- package/dist/dts/db/orm.d.ts +43 -0
- package/dist/dts/db/procedure.d.ts +37 -0
- package/dist/dts/db/query.d.ts +25 -1
- package/dist/dts/db/repository.d.ts +52 -0
- package/dist/dts/db/sequence.d.ts +31 -2
- package/dist/dts/db/sql.d.ts +33 -0
- package/dist/dts/db/store.d.ts +27 -0
- package/dist/dts/db/translator.d.ts +34 -1
- package/dist/dts/db/update.d.ts +38 -0
- package/dist/dts/etcd/client.d.ts +36 -0
- package/dist/dts/etcd/index.d.ts +10 -0
- package/dist/dts/extensions/decorators.d.ts +28 -0
- package/dist/dts/extensions/extensions.d.ts +30 -1
- package/dist/dts/extensions/index.d.ts +11 -0
- package/dist/dts/git/client.d.ts +28 -0
- package/dist/dts/git/index.d.ts +10 -0
- package/dist/dts/http/client-async.d.ts +29 -1
- package/dist/dts/http/client.d.ts +29 -1
- package/dist/dts/http/decorators.d.ts +38 -0
- package/dist/dts/http/errors/ForbiddenError.d.ts +6 -2
- package/dist/dts/http/errors/ValidationError.d.ts +6 -2
- package/dist/dts/http/errors.d.ts +14 -0
- package/dist/dts/http/index.d.ts +18 -0
- package/dist/dts/http/request.d.ts +30 -3
- package/dist/dts/http/response.d.ts +40 -3
- package/dist/dts/http/rs/resource-mappings.d.ts +30 -0
- package/dist/dts/http/rs.d.ts +38 -0
- package/dist/dts/http/session.d.ts +34 -3
- package/dist/dts/http/upload.d.ts +27 -2
- package/dist/dts/http/utils.d.ts +42 -0
- package/dist/dts/indexing/index.d.ts +11 -0
- package/dist/dts/indexing/searcher.d.ts +35 -2
- package/dist/dts/indexing/writer.d.ts +23 -2
- package/dist/dts/integrations/index.d.ts +10 -0
- package/dist/dts/integrations/integrations.d.ts +27 -3
- package/dist/dts/io/bytes.d.ts +33 -2
- package/dist/dts/io/files.d.ts +34 -2
- package/dist/dts/io/image.d.ts +27 -2
- package/dist/dts/io/index.d.ts +14 -0
- package/dist/dts/io/streams.d.ts +40 -0
- package/dist/dts/io/zip.d.ts +32 -0
- package/dist/dts/job/decorators.d.ts +29 -0
- package/dist/dts/job/index.d.ts +11 -0
- package/dist/dts/job/scheduler.d.ts +33 -2
- package/dist/dts/junit/index.d.ts +10 -0
- package/dist/dts/junit/junit.d.ts +31 -0
- package/dist/dts/kafka/consumer.d.ts +31 -0
- package/dist/dts/kafka/index.d.ts +11 -0
- package/dist/dts/kafka/producer.d.ts +31 -0
- package/dist/dts/log/index.d.ts +10 -0
- package/dist/dts/log/logging.d.ts +32 -0
- package/dist/dts/mail/client.d.ts +27 -0
- package/dist/dts/mail/index.d.ts +10 -0
- package/dist/dts/messaging/consumer.d.ts +29 -2
- package/dist/dts/messaging/decorators.d.ts +32 -0
- package/dist/dts/messaging/index.d.ts +12 -0
- package/dist/dts/messaging/producer.d.ts +27 -2
- package/dist/dts/mongodb/client.d.ts +37 -0
- package/dist/dts/mongodb/dao.d.ts +53 -0
- package/dist/dts/mongodb/index.d.ts +11 -0
- package/dist/dts/net/decorators.d.ts +27 -0
- package/dist/dts/net/index.d.ts +13 -0
- package/dist/dts/net/soap.d.ts +34 -0
- package/dist/dts/net/websockets.d.ts +34 -0
- package/dist/dts/pdf/index.d.ts +10 -0
- package/dist/dts/pdf/pdf.d.ts +41 -2
- package/dist/dts/platform/command.d.ts +26 -0
- package/dist/dts/platform/engines.d.ts +38 -0
- package/dist/dts/platform/index.d.ts +19 -0
- package/dist/dts/platform/lifecycle.d.ts +29 -0
- package/dist/dts/platform/os.d.ts +30 -0
- package/dist/dts/platform/problems.d.ts +36 -0
- package/dist/dts/platform/registry.d.ts +39 -0
- package/dist/dts/platform/repository.d.ts +40 -0
- package/dist/dts/platform/workspace.d.ts +42 -0
- package/dist/dts/qldb/index.d.ts +12 -0
- package/dist/dts/qldb/qldb.d.ts +14 -0
- package/dist/dts/rabbitmq/consumer.d.ts +24 -3
- package/dist/dts/rabbitmq/index.d.ts +13 -0
- package/dist/dts/rabbitmq/producer.d.ts +20 -3
- package/dist/dts/redis/client.d.ts +31 -3
- package/dist/dts/redis/index.d.ts +12 -0
- package/dist/dts/security/decorators.d.ts +34 -0
- package/dist/dts/security/index.d.ts +14 -0
- package/dist/dts/security/oauth.d.ts +27 -0
- package/dist/dts/security/user.d.ts +39 -0
- package/dist/dts/template/engines.d.ts +31 -0
- package/dist/dts/template/index.d.ts +12 -0
- package/dist/dts/utils/alphanumeric.d.ts +36 -2
- package/dist/dts/utils/base64.d.ts +30 -0
- package/dist/dts/utils/converter.d.ts +37 -2
- package/dist/dts/utils/digest.d.ts +31 -0
- package/dist/dts/utils/escape.d.ts +28 -3
- package/dist/dts/utils/hex.d.ts +30 -0
- package/dist/dts/utils/index.d.ts +23 -0
- package/dist/dts/utils/jsonpath.d.ts +43 -0
- package/dist/dts/utils/qrcode.d.ts +24 -3
- package/dist/dts/utils/url.d.ts +37 -3
- package/dist/dts/utils/utf8.d.ts +34 -3
- package/dist/dts/utils/uuid.d.ts +28 -2
- package/dist/dts/utils/xml.d.ts +31 -2
- package/dist/esm/bpm/deployer.mjs +1 -1
- package/dist/esm/bpm/index.mjs +1 -1
- package/dist/esm/bpm/process.mjs +1 -1
- package/dist/esm/bpm/tasks.mjs +1 -1
- package/dist/esm/bpm/tracer.mjs +1 -1
- package/dist/esm/bpm/values.mjs +1 -1
- package/dist/esm/cache/cache.mjs +1 -1
- package/dist/esm/cache/index.mjs +1 -1
- package/dist/esm/cms/cmis.mjs +1 -1
- package/dist/esm/cms/index.mjs +1 -1
- package/dist/esm/component/decorators.mjs +1 -1
- package/dist/esm/component/index.mjs +1 -1
- package/dist/esm/core/configurations.mjs +1 -1
- package/dist/esm/core/context.mjs +1 -1
- package/dist/esm/core/env.mjs +1 -1
- package/dist/esm/core/globals.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/db/dao.mjs +1 -1
- package/dist/esm/db/database.mjs +1 -1
- package/dist/esm/db/decorators.mjs +1 -1
- package/dist/esm/db/index.mjs +1 -1
- package/dist/esm/db/insert.mjs +1 -1
- package/dist/esm/db/orm.mjs +1 -1
- package/dist/esm/db/ormstatements.mjs +1 -1
- package/dist/esm/db/procedure.mjs +1 -1
- package/dist/esm/db/query.mjs +1 -1
- package/dist/esm/db/repository.mjs +1 -1
- package/dist/esm/db/sequence.mjs +1 -1
- package/dist/esm/db/sql.mjs +1 -1
- package/dist/esm/db/store.mjs +1 -1
- package/dist/esm/db/translator.mjs +1 -1
- package/dist/esm/db/update.mjs +1 -1
- package/dist/esm/etcd/client.mjs +1 -1
- package/dist/esm/etcd/index.mjs +1 -1
- package/dist/esm/extensions/decorators.mjs +1 -1
- package/dist/esm/extensions/extensions.mjs +1 -1
- package/dist/esm/extensions/index.mjs +1 -1
- package/dist/esm/git/client.mjs +1 -1
- package/dist/esm/git/index.mjs +1 -1
- package/dist/esm/http/client-async.mjs +1 -1
- package/dist/esm/http/client.mjs +1 -1
- package/dist/esm/http/decorators.mjs +1 -1
- package/dist/esm/http/errors/ForbiddenError.mjs +1 -1
- package/dist/esm/http/errors/ValidationError.mjs +1 -1
- package/dist/esm/http/errors.mjs +1 -1
- package/dist/esm/http/index.mjs +1 -1
- package/dist/esm/http/request.mjs +1 -1
- package/dist/esm/http/response.mjs +1 -1
- package/dist/esm/http/rs/resource-http-controller.mjs +1 -1
- package/dist/esm/http/rs/resource-mappings.mjs +1 -1
- package/dist/esm/http/rs/resource-method.mjs +1 -1
- package/dist/esm/http/rs/resource.mjs +1 -1
- package/dist/esm/http/rs.mjs +1 -1
- package/dist/esm/http/session.mjs +1 -1
- package/dist/esm/http/upload.mjs +1 -1
- package/dist/esm/http/utils.mjs +1 -1
- package/dist/esm/indexing/index.mjs +1 -1
- package/dist/esm/indexing/searcher.mjs +1 -1
- package/dist/esm/indexing/writer.mjs +1 -1
- package/dist/esm/integrations/index.mjs +1 -1
- package/dist/esm/integrations/integrations.mjs +1 -1
- package/dist/esm/io/bytes.mjs +1 -1
- package/dist/esm/io/files.mjs +1 -1
- package/dist/esm/io/image.mjs +1 -1
- package/dist/esm/io/index.mjs +1 -1
- package/dist/esm/io/streams.mjs +1 -1
- package/dist/esm/io/zip.mjs +1 -1
- package/dist/esm/job/decorators.mjs +1 -1
- package/dist/esm/job/index.mjs +1 -1
- package/dist/esm/job/scheduler.mjs +1 -1
- package/dist/esm/junit/index.mjs +1 -1
- package/dist/esm/junit/junit.mjs +1 -1
- package/dist/esm/kafka/consumer.mjs +1 -1
- package/dist/esm/kafka/index.mjs +1 -1
- package/dist/esm/kafka/producer.mjs +1 -1
- package/dist/esm/log/index.mjs +1 -1
- package/dist/esm/log/logging.mjs +1 -1
- package/dist/esm/mail/client.mjs +1 -1
- package/dist/esm/mail/index.mjs +1 -1
- package/dist/esm/messaging/consumer.mjs +1 -1
- package/dist/esm/messaging/decorators.mjs +1 -1
- package/dist/esm/messaging/index.mjs +1 -1
- package/dist/esm/messaging/producer.mjs +1 -1
- package/dist/esm/mongodb/client.mjs +2 -2
- package/dist/esm/mongodb/dao.mjs +1 -1
- package/dist/esm/mongodb/index.mjs +1 -1
- package/dist/esm/net/decorators.mjs +1 -1
- package/dist/esm/net/index.mjs +1 -1
- package/dist/esm/net/soap.mjs +1 -1
- package/dist/esm/net/websockets.mjs +1 -1
- package/dist/esm/pdf/index.mjs +1 -1
- package/dist/esm/pdf/pdf.mjs +3 -3
- package/dist/esm/platform/command.mjs +1 -1
- package/dist/esm/platform/engines.mjs +1 -1
- package/dist/esm/platform/index.mjs +1 -1
- package/dist/esm/platform/lifecycle.mjs +1 -1
- package/dist/esm/platform/os.mjs +1 -1
- package/dist/esm/platform/problems.mjs +1 -1
- package/dist/esm/platform/registry.mjs +1 -1
- package/dist/esm/platform/repository.mjs +1 -1
- package/dist/esm/platform/workspace.mjs +1 -1
- package/dist/esm/qldb/index.mjs +1 -1
- package/dist/esm/qldb/qldb.mjs +1 -1
- package/dist/esm/rabbitmq/consumer.mjs +1 -1
- package/dist/esm/rabbitmq/index.mjs +1 -1
- package/dist/esm/rabbitmq/producer.mjs +1 -1
- package/dist/esm/redis/client.mjs +1 -1
- package/dist/esm/redis/index.mjs +1 -1
- package/dist/esm/security/decorators.mjs +1 -1
- package/dist/esm/security/index.mjs +1 -1
- package/dist/esm/security/oauth.mjs +1 -1
- package/dist/esm/security/user.mjs +1 -1
- package/dist/esm/template/engines.mjs +1 -1
- package/dist/esm/template/index.mjs +1 -1
- package/dist/esm/utils/alphanumeric.mjs +2 -2
- package/dist/esm/utils/base64.mjs +1 -1
- package/dist/esm/utils/converter.mjs +1 -1
- package/dist/esm/utils/digest.mjs +1 -1
- package/dist/esm/utils/escape.mjs +1 -1
- package/dist/esm/utils/hex.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/jsonpath.mjs +1 -1
- package/dist/esm/utils/qrcode.mjs +1 -1
- package/dist/esm/utils/url.mjs +1 -1
- package/dist/esm/utils/utf8.mjs +1 -1
- package/dist/esm/utils/uuid.mjs +1 -1
- package/dist/esm/utils/xml.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module platform/workspace
|
|
3
|
+
* @package @aerokit/sdk/platform
|
|
4
|
+
* @name Workspace
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Workspace module provides a wrapper for the platform's WorkspaceFacade, allowing developers to manage workspaces, projects, folders, and files in a structured manner. It abstracts the underlying Java API, providing a more intuitive and JavaScript-friendly interface for interacting with the platform's filesystem and project management capabilities.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Workspace Management**: Create, retrieve, list, and delete workspaces.
|
|
11
|
+
* - **Project Management**: Create, retrieve, list, copy, move, and delete projects within a workspace.
|
|
12
|
+
* - **Folder and File Management**: Create, retrieve, list, and delete folders and files within projects.
|
|
13
|
+
* - **Content Access**: Read and write file content as byte arrays or text strings.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases:
|
|
16
|
+
* - **Project Organization**: This module is ideal for applications that need to organize code and resources into projects and workspaces on the platform.
|
|
17
|
+
* - **File Manipulation**: Developers can use this module to manage files and folders within their projects, including reading and writing file content.
|
|
18
|
+
*
|
|
19
|
+
* ### Example Usage:
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Workspace } from "@aerokit/sdk/platform";
|
|
22
|
+
*
|
|
23
|
+
* // Create a new workspace
|
|
24
|
+
* const workspace = Workspace.createWorkspace("MyWorkspace");
|
|
25
|
+
*
|
|
26
|
+
* // Create a new project within the workspace
|
|
27
|
+
* const project = workspace.createProject("MyProject");
|
|
28
|
+
*
|
|
29
|
+
* // Create a new folder within the project
|
|
30
|
+
* const folder = project.createFolder("src");
|
|
31
|
+
*
|
|
32
|
+
* // Create a new file within the folder with initial content
|
|
33
|
+
* const file = folder.createFile("index.js", [...]); // Initial content as byte array
|
|
34
|
+
*
|
|
35
|
+
* // Read file content as text
|
|
36
|
+
* const content = file.getText();
|
|
37
|
+
* console.log("File Content:", content);
|
|
38
|
+
*
|
|
39
|
+
* // Update file content with new text
|
|
40
|
+
* file.setText("console.log('Hello, World!');");
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
1
43
|
/**
|
|
2
44
|
* @class Workspace
|
|
3
45
|
* @description Represents a logical container for projects, providing static methods for
|
package/dist/dts/qldb/index.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module qldb/index
|
|
3
|
+
* @package @aerokit/sdk/qldb
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* Provides simplified integration with Amazon QLDB (Quantum Ledger Database) for Aerokit SDK.
|
|
7
|
+
* The module exposes repository abstractions to interact with QLDB ledgers, execute statements,
|
|
8
|
+
* manage sessions and handle results in a structured way.
|
|
9
|
+
*
|
|
10
|
+
* The main components of this module are:
|
|
11
|
+
* - QLDBRepository: Primary interface for connecting to and operating on QLDB ledgers.
|
|
12
|
+
*/
|
|
1
13
|
export * from "./qldb";
|
|
2
14
|
export { QLDBRepository as qldb } from "./qldb";
|
package/dist/dts/qldb/qldb.d.ts
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module qldb/qldb
|
|
3
|
+
* @package @aerokit/sdk/qldb
|
|
4
|
+
* @name QLDBRepository
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* Entry point for Amazon QLDB repository integration in Aerokit SDK.
|
|
8
|
+
*
|
|
9
|
+
* Exposes the `QLDBRepository` class alias to the underlying Java implementation:
|
|
10
|
+
* `org.eclipse.dirigible.components.api.qldb.QLDBRepository`.
|
|
11
|
+
*
|
|
12
|
+
* This object is used to create and manage QLDB ledger sessions, execute statements,
|
|
13
|
+
* and handle transaction lifecycles from JavaScript code.
|
|
14
|
+
*/
|
|
1
15
|
export declare const QLDBRepository: any;
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module rabbitmq/consumer
|
|
3
|
+
* @package @aerokit/sdk/rabbitmq
|
|
4
|
+
* @name Consumer
|
|
5
|
+
* @overview
|
|
3
6
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
7
|
+
* The RabbitMQ Consumer module provides a facade for managing message listeners on RabbitMQ queues. It allows developers to start and stop listening for messages on specified queues, delegating the handling of incoming messages to designated components or scripts. This module abstracts the underlying Java implementation, providing a simple interface for integrating RabbitMQ message consumption into applications built on the platform.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Start Listening**: The `startListening` method enables the application to begin consuming messages from a specified RabbitMQ queue, with a designated handler for processing incoming messages.
|
|
11
|
+
* - **Stop Listening**: The `stopListening` method allows the application to cease consuming messages from a specified queue for a given handler, providing control over message consumption.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **Message-Driven Architecture**: This module is ideal for applications that follow a message-driven architecture, allowing them to react to events or data changes by consuming messages from RabbitMQ queues.
|
|
15
|
+
* - **Integration with External Systems**: Developers can use this module to integrate their applications with external systems that communicate via RabbitMQ, enabling seamless data exchange and event handling.
|
|
16
|
+
*
|
|
17
|
+
* ### Example Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Consumer } from "@aerokit/sdk/rabbitmq";
|
|
20
|
+
*
|
|
21
|
+
* // Start listening on a RabbitMQ queue
|
|
22
|
+
* Consumer.startListening("myQueue", "myHandler");
|
|
23
|
+
*
|
|
24
|
+
* // Stop listening on the RabbitMQ queue
|
|
25
|
+
* Consumer.stopListening("myQueue", "myHandler");
|
|
26
|
+
* ```
|
|
6
27
|
*/
|
|
7
28
|
export declare class Consumer {
|
|
8
29
|
/**
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module rabbitmq/index
|
|
3
|
+
* @package @aerokit/sdk/rabbitmq
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides RabbitMQ messaging capabilities for the Aerokit SDK.
|
|
7
|
+
* It includes consumer and producer abstractions to connect to AMQP brokers,
|
|
8
|
+
* send and receive messages, and manage queues/exchanges.
|
|
9
|
+
*
|
|
10
|
+
* The main components of this module are:
|
|
11
|
+
* - Consumer: Receives messages from queues and handles message processing.
|
|
12
|
+
* - Producer: Publishes messages to exchanges or queues.
|
|
13
|
+
*/
|
|
1
14
|
export * from "./consumer";
|
|
2
15
|
export { Consumer as consumer } from "./consumer";
|
|
3
16
|
export * from "./producer";
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module rabbitmq/producer
|
|
3
|
+
* @package @aerokit/sdk/rabbitmq
|
|
4
|
+
* @name Producer
|
|
5
|
+
* @overview
|
|
3
6
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
7
|
+
* The RabbitMQ Producer module provides a simple facade for sending messages to RabbitMQ queues. It abstracts the underlying Java implementation, allowing developers to easily integrate message sending capabilities into their applications built on the platform. This module is designed to facilitate communication with RabbitMQ by providing a straightforward interface for sending messages to specified queues.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Message Sending**: The `send` method allows developers to send messages to a specified RabbitMQ queue with ease.
|
|
11
|
+
*
|
|
12
|
+
* ### Use Cases:
|
|
13
|
+
* - **Event-Driven Architecture**: This module is ideal for applications that follow an event-driven architecture, enabling them to publish events or data changes to RabbitMQ queues for consumption by other services or components.
|
|
14
|
+
* - **Integration with External Systems**: Developers can use this module to integrate their applications with external systems that communicate via RabbitMQ, facilitating seamless data exchange and event handling.
|
|
15
|
+
*
|
|
16
|
+
* ### Example Usage:
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { Producer } from "@aerokit/sdk/rabbitmq";
|
|
19
|
+
*
|
|
20
|
+
* // Send a message to a RabbitMQ queue
|
|
21
|
+
* Producer.send("myQueue", "Hello, RabbitMQ!");
|
|
22
|
+
* ```
|
|
6
23
|
*/
|
|
7
24
|
export declare class Producer {
|
|
8
25
|
/**
|
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module redis/client
|
|
3
|
+
* @package @aerokit/sdk/redis
|
|
4
|
+
* @name Client
|
|
5
|
+
* @overview
|
|
3
6
|
*
|
|
4
|
-
* This
|
|
5
|
-
*
|
|
7
|
+
* The Redis Client module provides a JavaScript interface for interacting with Redis, a popular in-memory data structure store. This module serves as a facade for the underlying Java Redis client implementation, allowing developers to perform common Redis operations such as key-value manipulation and list management using a simple and intuitive API. The Client class abstracts the complexities of the Java implementation, providing a seamless experience for developers working with Redis in their applications built on the platform.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Key-Value Operations**: Methods for setting, getting, deleting, and checking the existence of keys, as well as incrementing and decrementing numeric values.
|
|
11
|
+
* - **List Operations**: Methods for managing lists, including pushing and popping elements from both ends of the list and retrieving list elements by index or range.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **Caching**: The Redis Client can be used to implement caching mechanisms in applications, improving performance by storing frequently accessed data in memory.
|
|
15
|
+
* - **Session Management**: Developers can use this module to manage user sessions in web applications by storing session data in Redis.
|
|
16
|
+
* - **Real-Time Data Processing**: The Redis Client is ideal for applications that require real-time data processing and quick access to data structures like lists and sets.
|
|
17
|
+
*
|
|
18
|
+
* ### Example Usage:
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { Client } from "@aerokit/sdk/redis";
|
|
21
|
+
*
|
|
22
|
+
* const redisClient = new Client();
|
|
23
|
+
*
|
|
24
|
+
* // Set a key-value pair
|
|
25
|
+
* redisClient.set("myKey", "Hello, Redis!");
|
|
26
|
+
*
|
|
27
|
+
* // Get the value of a key
|
|
28
|
+
* const value = redisClient.get("myKey");
|
|
29
|
+
* console.log(value); // Output: Hello, Redis!
|
|
30
|
+
*
|
|
31
|
+
* // Push values to a list
|
|
32
|
+
* redisClient.rpush("myList", "item1", "item2", "item3");
|
|
33
|
+
* ```
|
|
6
34
|
*/
|
|
7
35
|
export declare class Client {
|
|
8
36
|
private readonly native;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module redis/index
|
|
3
|
+
* @package @aerokit/sdk/redis
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides Redis client integration for the Aerokit SDK.
|
|
7
|
+
* It exposes capabilities to connect to Redis servers, execute commands,
|
|
8
|
+
* and manage data structures and transactions.
|
|
9
|
+
*
|
|
10
|
+
* The main components of this module are:
|
|
11
|
+
* - Client: Redis client wrapper with command execution and connection management.
|
|
12
|
+
*/
|
|
1
13
|
export * from "./client";
|
|
2
14
|
export { Client as client } from "./client";
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module security/decorators
|
|
3
|
+
* @package @aerokit/sdk/security
|
|
4
|
+
* @name Decorators
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides security-related decorators for enforcing role-based access control on classes and methods. The primary decorator, `@Roles`, allows developers to specify which user roles are required to access certain functionality within their application. By applying the `@Roles` decorator to a class or method, developers can ensure that only users with the appropriate roles can execute the associated code, enhancing the security of their applications.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Role-Based Access Control**: The `@Roles` decorator enables developers to define access control rules based on user roles, ensuring that only authorized users can access specific functionality.
|
|
11
|
+
* - **Class and Method Level Security**: The `@Roles` decorator can be applied at both the class and method levels, allowing for flexible security configurations.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **Securing API Endpoints**: Developers can use the `@Roles` decorator to protect API endpoints, ensuring that only users with the necessary roles can access certain routes or perform specific actions.
|
|
15
|
+
* - **Enforcing Business Logic**: By applying the `@Roles` decorator to methods that contain critical business logic, developers can prevent unauthorized access and maintain the integrity of their applications.
|
|
16
|
+
*
|
|
17
|
+
* ### Example Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Roles } from "@aerokit/sdk/security";
|
|
20
|
+
*
|
|
21
|
+
* @Roles(["admin"])
|
|
22
|
+
* class AdminController {
|
|
23
|
+
* @Roles(["admin", "manager"])
|
|
24
|
+
* deleteUser(userId: string) {
|
|
25
|
+
* // Logic to delete a user, accessible only to admin and manager roles
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* @Roles(["admin"])
|
|
29
|
+
* createUser(userData: any) {
|
|
30
|
+
* // Logic to create a new user, accessible only to admin role
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
1
35
|
/**
|
|
2
36
|
* @param {string[]} roles
|
|
3
37
|
*/
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module security/index
|
|
3
|
+
* @package @aerokit/sdk/security
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* Provides security helpers for user authentication, OAuth flows, and metadata decorators.
|
|
7
|
+
* It exposes user management utilities, OAuth integration, and useful security decorators
|
|
8
|
+
* for protected route handling and role-based access control.
|
|
9
|
+
*
|
|
10
|
+
* The main components of this module are:
|
|
11
|
+
* - User: User identity and authentication utilities.
|
|
12
|
+
* - OAuth: OAuth2 integration helpers for authentication flows.
|
|
13
|
+
* - Decorators: Security decorators for endpoint access control.
|
|
14
|
+
*/
|
|
1
15
|
export * from "./user";
|
|
2
16
|
export { User as user } from "./user";
|
|
3
17
|
export * from "./oauth";
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module security/oauth
|
|
3
|
+
* @package @aerokit/sdk/security
|
|
4
|
+
* @name OAuthClient
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The OAuthClient class provides a simple interface for obtaining OAuth access tokens using the client credentials grant type. It abstracts the process of making HTTP requests to an OAuth token endpoint, allowing developers to easily integrate OAuth authentication into their applications. By providing the necessary configuration parameters such as the token endpoint URL, client ID, and client secret, developers can use this class to retrieve access tokens that can be used for authenticating API requests or accessing protected resources.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Token Retrieval**: The `getToken` method sends a POST request to the specified OAuth token endpoint with the client credentials and retrieves the access token.
|
|
11
|
+
* - **Configurable Grant Type**: While the default grant type is set to 'client_credentials', developers can specify other grant types if needed by providing it in the configuration.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **API Authentication**: The OAuthClient can be used to authenticate API requests by obtaining access tokens that are required for accessing protected endpoints.
|
|
15
|
+
* - **Integration with OAuth Providers**: Developers can use this class to integrate their applications with various OAuth providers that support the client credentials grant type, enabling secure access to resources.
|
|
16
|
+
*
|
|
17
|
+
* ### Example Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { OAuthClient } from "@aerokit/sdk/security";
|
|
20
|
+
*
|
|
21
|
+
* const oauthClient = new OAuthClient({
|
|
22
|
+
* url: "https://example.com/oauth/token",
|
|
23
|
+
* clientId: "your-client-id",
|
|
24
|
+
* clientSecret: "your-client-secret"
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
1
28
|
/**
|
|
2
29
|
* Configuration structure for the OAuth client.
|
|
3
30
|
*/
|
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module security/user
|
|
3
|
+
* @package @aerokit/sdk/security
|
|
4
|
+
* @name User
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The User class provides static methods to access the security and session context of the currently authenticated user. It serves as a facade for the underlying UserFacade component, allowing developers to easily retrieve information about the user's identity, roles, session timeout, authentication type, security token, invocation count, and preferred language. This class is essential for implementing role-based access control and managing user sessions within applications built on the platform.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **User Identity**: Retrieve the principal name (username or ID) of the currently authenticated user.
|
|
11
|
+
* - **Role Checking**: Determine if the user is assigned to specific security roles, enabling role-based access control.
|
|
12
|
+
* - **Session Information**: Access session-related information such as remaining timeout and security tokens.
|
|
13
|
+
* - **Invocation Tracking**: Monitor the number of requests made by the user during their session.
|
|
14
|
+
* - **Localization Support**: Retrieve the user's preferred language setting for localization purposes.
|
|
15
|
+
*
|
|
16
|
+
* ### Use Cases:
|
|
17
|
+
* - **Access Control**: Use the `isInRole` method to enforce role-based access control in your application, ensuring that only authorized users can access certain functionality.
|
|
18
|
+
* - **Session Management**: Utilize session information to manage user sessions effectively, such as implementing session timeouts or tracking user activity.
|
|
19
|
+
* - **Localization**: Leverage the user's preferred language to provide localized content and enhance the user experience.
|
|
20
|
+
*
|
|
21
|
+
* ### Example Usage:
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { User } from "@aerokit/sdk/security";
|
|
24
|
+
*
|
|
25
|
+
* // Check if the current user is an administrator
|
|
26
|
+
* if (User.isInRole("Administrator")) {
|
|
27
|
+
* console.log(`Welcome, ${User.getName()}! You have administrator access.`);
|
|
28
|
+
* } else {
|
|
29
|
+
* console.log(`Hello, ${User.getName()}. You do not have administrator access.`);
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // Get session information
|
|
33
|
+
* const timeout = User.getTimeout();
|
|
34
|
+
* const authType = User.getAuthType();
|
|
35
|
+
* const securityToken = User.getSecurityToken();
|
|
36
|
+
* const invocationCount = User.getInvocationCount();
|
|
37
|
+
* const preferredLanguage = User.getLanguage();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
1
40
|
/**
|
|
2
41
|
* Provides static access to the currently authenticated user's security and session context.
|
|
3
42
|
* This class acts as a facade for the underlying UserFacade component.
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module template/engines
|
|
3
|
+
* @package @aerokit/sdk/template
|
|
4
|
+
* @name TemplateEngines
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The TemplateEngines module provides a unified interface for working with various server-side template engines, including Velocity, Mustache, and JavaScript. It allows developers to generate dynamic content by processing templates with provided parameters. The module abstracts the underlying template engine implementations, offering a consistent API for generating output from both raw template strings and templates stored in the registry.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Multiple Template Engines**: Supports Velocity, Mustache, and JavaScript template engines, allowing developers to choose the most suitable one for their use case.
|
|
11
|
+
* - **Dynamic Content Generation**: Enables the generation of dynamic content by processing templates with context parameters.
|
|
12
|
+
* - **File-Based Templates**: Provides functionality to load templates from the public registry and generate output based on their content.
|
|
13
|
+
*
|
|
14
|
+
* ### Use Cases:
|
|
15
|
+
* - **Email Templating**: Generate dynamic email content using templates stored in the registry.
|
|
16
|
+
* - **Report Generation**: Create dynamic reports by processing templates with data retrieved from various sources.
|
|
17
|
+
* - **Server-Side Rendering**: Use JavaScript templates for server-side rendering of HTML content.
|
|
18
|
+
*
|
|
19
|
+
* ### Example Usage:
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { TemplateEngines } from "@aerokit/sdk/template";
|
|
22
|
+
*
|
|
23
|
+
* // Generate content from a raw template string
|
|
24
|
+
* const output = TemplateEngines.generate("template1", "Hello, {{name}}!", { name: "World" });
|
|
25
|
+
* console.log(output); // Output: Hello, World!
|
|
26
|
+
*
|
|
27
|
+
* // Generate content from a template file in the registry
|
|
28
|
+
* const fileOutput = TemplateEngines.generateFromFile("templates/email.mustache", { name: "Alice" });
|
|
29
|
+
* console.log(fileOutput); // Output depends on the content of 'email.mustache'
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
1
32
|
/**
|
|
2
33
|
* An internal wrapper class that adapts a native template engine implementation.
|
|
3
34
|
* It manages the engine instance and optional custom start/end markers.
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module template/index
|
|
3
|
+
* @package @aerokit/sdk/template
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides template engine utilities for the Aerokit SDK.
|
|
7
|
+
* It exposes various template engines for rendering dynamic content,
|
|
8
|
+
* supporting multiple template languages and formatting options.
|
|
9
|
+
*
|
|
10
|
+
* The main components of this module are:
|
|
11
|
+
* - TemplateEngines: Registry and management of available template engines.
|
|
12
|
+
*/
|
|
1
13
|
export { TemplateEngines as engines } from "./engines";
|
|
2
14
|
export * from "./engines";
|
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @
|
|
2
|
+
* @module utils/alphanumeric
|
|
3
|
+
* @package @aerokit/sdk/utils
|
|
4
|
+
* @name Alphanumeric
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Alphanumeric class provides a collection of static utility methods for generating and validating alphanumeric strings. It includes methods for transforming strings to alphanumeric format, generating random alphanumeric sequences, and validating whether a given string is numeric or alphanumeric. These utilities are essential for scenarios where input sanitization, random identifier generation, or format validation is required, making it easier for developers to handle common string manipulation tasks in a consistent manner.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **String Transformation**: The `toAlphanumeric` method transforms a given string into an alphanumeric sequence by removing non-conformant characters.
|
|
11
|
+
* - **Random String Generation**: Methods like `randomString`, `alphanumeric`, and `alpha` allow for generating random strings of specified lengths and character sets.
|
|
12
|
+
* - **Validation Methods**: The `isNumeric` and `isAlphanumeric` methods provide a way to validate whether a string is purely numeric or alphanumeric, respectively.
|
|
13
|
+
*
|
|
14
|
+
* ### Use Cases:
|
|
15
|
+
* - **Input Sanitization**: The `toAlphanumeric` method can be used to sanitize user input by stripping out unwanted characters, ensuring that only valid alphanumeric characters are retained.
|
|
16
|
+
* - **Identifier Generation**: The random string generation methods are useful for creating unique identifiers, such as user IDs, session tokens, or any other scenario where a random string is needed.
|
|
17
|
+
* - **Format Validation**: The validation methods can be used to check if user input or data conforms to expected formats, such as ensuring that a string is numeric before processing it as a number.
|
|
18
|
+
*
|
|
19
|
+
* ### Example Usage:
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Alphanumeric } from "@aerokit/sdk/utils";
|
|
22
|
+
*
|
|
23
|
+
* // Transform a string to alphanumeric format
|
|
24
|
+
* const sanitized = Alphanumeric.toAlphanumeric("Hello, World! 123");
|
|
25
|
+
* console.log(sanitized); // Output: "HelloWorld123"
|
|
26
|
+
*
|
|
27
|
+
* // Generate a random alphanumeric string of length 8
|
|
28
|
+
* const randomId = Alphanumeric.alphanumeric(8, true);
|
|
29
|
+
* console.log(randomId); // Output: e.g., "a1b2c3d4"
|
|
30
|
+
*
|
|
31
|
+
* // Validate if a string is numeric
|
|
32
|
+
* const isNumeric = Alphanumeric.isNumeric("12345");
|
|
33
|
+
* console.log(isNumeric); // Output: true
|
|
34
|
+
*
|
|
35
|
+
* // Validate if a string is alphanumeric * const isAlphanumeric = Alphanumeric.isAlphanumeric("abc123");
|
|
36
|
+
* console.log(isAlphanumeric); // Output: true
|
|
37
|
+
* ```
|
|
4
38
|
*/
|
|
5
39
|
export declare class Alphanumeric {
|
|
6
40
|
static toAlphanumeric(string: string): string;
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module utils/base64
|
|
3
|
+
* @package @aerokit/sdk/utils
|
|
4
|
+
* @name Base64
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Base64 class provides static utility methods for encoding and decoding data using the Base64 encoding scheme. It supports both string and byte array inputs, allowing developers to easily convert data to and from Base64 format. The class abstracts the underlying Java implementation, providing a simple interface for performing Base64 operations in JavaScript.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Encoding**: Methods to encode strings or byte arrays into Base64 format, returning either a Base64 string or a byte array.
|
|
11
|
+
* - **Decoding**: Methods to decode Base64 strings or byte arrays back into their original byte array form.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **Data Serialization**: Base64 encoding is commonly used for serializing binary data (like images or files) into a text format that can be easily transmitted over text-based protocols such as HTTP.
|
|
15
|
+
* - **Authentication**: Base64 encoding is often used in authentication schemes (e.g., Basic Authentication) to encode credentials before transmission.
|
|
16
|
+
* - **Data Storage**: Developers can use Base64 encoding to store binary data in databases that only support text formats.
|
|
17
|
+
*
|
|
18
|
+
* ### Example Usage:
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { Base64 } from "@aerokit/sdk/utils";
|
|
21
|
+
*
|
|
22
|
+
* // Encoding a string to Base64
|
|
23
|
+
* const encodedString = Base64.encode("Hello, World!");
|
|
24
|
+
* console.log(encodedString); // Output: SGVsbG8sIFdvcmxkIQ==
|
|
25
|
+
*
|
|
26
|
+
* // Decoding a Base64 string back to bytes
|
|
27
|
+
* const decodedBytes = Base64.decode(encodedString);
|
|
28
|
+
* console.log(decodedBytes); // Output: [72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33]
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
1
31
|
/**
|
|
2
32
|
* Utility class for performing **Base64 encoding and decoding** of data.
|
|
3
33
|
* It handles conversion between JavaScript strings, JavaScript byte arrays (any[]),
|
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* @module utils/converter
|
|
3
|
+
* @package @aerokit/sdk/utils
|
|
4
|
+
* @name Converter
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Converter class provides static utility methods for converting and normalizing common data types such as Date and Boolean within an object structure. It is designed to facilitate the preparation of data for persistence or API consumption by ensuring that date values are consistently represented as timestamps or ISO strings, and that boolean values are strictly coerced to true or false. This class abstracts common data transformation patterns, allowing developers to easily convert and normalize their data without having to implement repetitive conversion logic throughout their codebase.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Date Conversion**: Methods to convert date properties into Unix timestamps or ISO 8601 strings, with handling for local timezone offsets.
|
|
11
|
+
* - **Boolean Conversion**: A method to coerce any truthy or falsy value into a strict boolean type.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **Data Preparation**: This class is useful for preparing data objects before saving them to a database or sending them in API requests, ensuring that date and boolean fields are in the expected format.
|
|
15
|
+
* - **Consistency**: By using these conversion methods, developers can maintain consistency in how dates and booleans are represented across their application, reducing bugs related to data formatting.
|
|
16
|
+
*
|
|
17
|
+
* ### Example Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Converter } from "@aerokit/sdk/utils";
|
|
20
|
+
*
|
|
21
|
+
* const obj = {
|
|
22
|
+
* dateCreated: "2024-01-01T10:00:00Z",
|
|
23
|
+
* birthday: "1990-05-15",
|
|
24
|
+
* isActive: 1
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* Converter.setDate(obj, 'dateCreated');
|
|
28
|
+
* Converter.setLocalDate(obj, 'birthday');
|
|
29
|
+
* Converter.setBoolean(obj, 'isActive');
|
|
30
|
+
*
|
|
31
|
+
* console.log(obj);
|
|
32
|
+
* // Output:
|
|
33
|
+
* // {
|
|
34
|
+
* // dateCreated: 1704096000000,
|
|
35
|
+
* // birthday: "1990-05-15T00:00:00.000Z",
|
|
36
|
+
* // isActive: true
|
|
37
|
+
* // }
|
|
38
|
+
* ```
|
|
4
39
|
*/
|
|
5
40
|
export declare class Converter {
|
|
6
41
|
/**
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module utils/digest
|
|
3
|
+
* @package @aerokit/sdk/utils
|
|
4
|
+
* @name Digest
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Digest class provides static utility methods for calculating cryptographic hash digests (MD5, SHA1, SHA256, SHA384, SHA512) from input data. It supports both string and byte array inputs, allowing developers to easily compute digests in various formats. The class abstracts the underlying Java implementation, providing a simple interface for performing digest operations in JavaScript.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Multiple Digest Algorithms**: Supports MD5, SHA1, SHA256, SHA384, and SHA512 digest algorithms.
|
|
11
|
+
* - **Flexible Input Types**: Accepts both string and byte array inputs for digest calculation.
|
|
12
|
+
* - **Output Formats**: Provides methods to return digest results as byte arrays or hexadecimal strings.
|
|
13
|
+
*
|
|
14
|
+
* ### Use Cases:
|
|
15
|
+
* - **Data Integrity**: Compute digests to verify the integrity of data by comparing computed digests with expected values.
|
|
16
|
+
* - **Password Hashing**: Use digest functions to hash passwords before storing them in a database (note: consider using a stronger hashing algorithm with salt for password storage).
|
|
17
|
+
* - **Unique Identifiers**: Generate unique identifiers for data based on their content by computing their digests.
|
|
18
|
+
*
|
|
19
|
+
* ### Example Usage:
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Digest } from "@aerokit/sdk/utils";
|
|
22
|
+
*
|
|
23
|
+
* // Calculate MD5 digest of a string and get it as a hex string
|
|
24
|
+
* const md5Hex = Digest.md5Hex("Hello, World!");
|
|
25
|
+
* console.log(md5Hex); // Output: 65a8e27d8879283831b664bd8b7f0ad4
|
|
26
|
+
*
|
|
27
|
+
* // Calculate SHA256 digest of a byte array and get it as a byte array
|
|
28
|
+
* const sha256Bytes = Digest.sha256([72, 101, 108, 108, 111]); // "Hello" in bytes
|
|
29
|
+
* console.log(sha256Bytes); // Output: [185, 105, 241, 149, 122, 223, 173, 190, ...]
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
1
32
|
export declare class Digest {
|
|
2
33
|
/**
|
|
3
34
|
* Calculate MD5 digest from input (text or byte array) and return result as byte array
|
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @module utils/escape
|
|
3
|
+
* @package @aerokit/sdk/utils
|
|
4
|
+
* @name Escape
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Escape class provides static utility methods for performing context-aware string escaping and unescaping operations. These methods are essential for ensuring that strings are safely embedded in various contexts (like HTML, JavaScript, JSON, etc.) without introducing security vulnerabilities such as injection attacks. The class delegates the actual escaping logic to a native Java EscapeFacade, providing a simple interface for JavaScript developers to utilize these functionalities.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Context-Aware Escaping**: Methods to escape strings for specific contexts such as CSV, JavaScript, HTML (3.2 and 4.0), Java, JSON, and XML.
|
|
11
|
+
* - **Unescaping Support**: Corresponding unescape methods to reverse the escaping process for each context.
|
|
12
|
+
* - **Security**: Helps prevent injection attacks by properly escaping special characters in strings before embedding them in different formats.
|
|
13
|
+
*
|
|
14
|
+
* ### Use Cases:
|
|
15
|
+
* - **Data Serialization**: Safely serialize data into formats like JSON or XML by escaping special characters.
|
|
16
|
+
* - **Web Development**: Escape user-generated content before embedding it in HTML or JavaScript to prevent XSS attacks.
|
|
17
|
+
* - **CSV Handling**: Escape values that contain commas, quotes, or newlines when generating CSV files.
|
|
18
|
+
*
|
|
19
|
+
* ### Example Usage:
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Escape } from "@aerokit/sdk/utils";
|
|
22
|
+
* // Escape a string for use in HTML
|
|
23
|
+
* const htmlSafe = Escape.escapeHtml4("<script>alert('XSS');</script>");
|
|
24
|
+
* console.log(htmlSafe); // Output: <script>alert('XSS');</script>
|
|
25
|
+
*
|
|
26
|
+
* // Unescape the previously escaped HTML string
|
|
27
|
+
* const original = Escape.unescapeHtml4(htmlSafe);
|
|
28
|
+
* console.log(original); // Output: <script>alert('XSS');</script>
|
|
29
|
+
* ```
|
|
5
30
|
*/
|
|
6
31
|
export declare class Escape {
|
|
7
32
|
/**
|
package/dist/dts/utils/hex.d.ts
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module utils/hex
|
|
3
|
+
* @package @aerokit/sdk/utils
|
|
4
|
+
* @name Hex
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The Hex class provides static utility methods for encoding and decoding data using hexadecimal representation. It supports both string and byte array inputs, allowing developers to easily convert data to and from hexadecimal format. The class abstracts the underlying Java implementation, providing a simple interface for performing hexadecimal operations in JavaScript.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
* - **Encoding**: Methods to encode strings or byte arrays into hexadecimal format, returning either a hexadecimal string or a byte array.
|
|
11
|
+
* - **Decoding**: Methods to decode hexadecimal strings or byte arrays back into their original byte array form.
|
|
12
|
+
*
|
|
13
|
+
* ### Use Cases:
|
|
14
|
+
* - **Data Serialization**: Hexadecimal encoding is commonly used for representing binary data in a human-readable format, which can be useful for debugging or logging purposes.
|
|
15
|
+
* - **Cryptographic Operations**: Hexadecimal encoding is often used in cryptographic contexts to represent hash digests, keys, or other binary data in a readable format.
|
|
16
|
+
* - **Data Transmission**: Developers can use hexadecimal encoding to transmit binary data over text-based protocols where Base64 might not be suitable.
|
|
17
|
+
*
|
|
18
|
+
* ### Example Usage:
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { Hex } from "@aerokit/sdk/utils";
|
|
21
|
+
*
|
|
22
|
+
* // Encoding a string to hexadecimal
|
|
23
|
+
* const hexString = Hex.encode("Hello, World!");
|
|
24
|
+
* console.log(hexString); // Output: 48656c6c6f2c20576f726c6421
|
|
25
|
+
*
|
|
26
|
+
* // Decoding a hexadecimal string back to bytes
|
|
27
|
+
* const decodedBytes = Hex.decode(hexString);
|
|
28
|
+
* console.log(decodedBytes); // Output: [72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33]
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
1
31
|
/**
|
|
2
32
|
* Utility class for performing **Hexadecimal encoding and decoding** of data.
|
|
3
33
|
* It handles conversion between JavaScript strings, JavaScript byte arrays (any[]),
|