@aerokit/sdk 12.81.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,11 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module db/decorators
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Decorators
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a set of decorators for defining database entities and their properties in a Dirigible application. The decorators are designed to be compatible with both legacy JavaScript environments (like Mozilla Rhino or older GraalJS) and modern JavaScript environments that support the latest decorator specifications.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - **Entity Decorator**: Marks a class as a database entity, allowing it to be registered and managed by the ORM layer.
|
|
11
|
+
* - **Table Decorator**: Specifies the database table name for the entity, with a default naming convention based on the class name.
|
|
12
|
+
* - **Column Decorator**: Marks a class property as a database column, with options for column type, length, nullability, and default values.
|
|
13
|
+
* - **ID Decorator**: Marks a property as the primary key of the entity.
|
|
14
|
+
* - **Generated Decorator**: Indicates that a property is generated by the database (e.g., auto-increment).
|
|
15
|
+
* - **Relationship Decorators**: Defines one-to-many and many-to-one relationships between entities.
|
|
16
|
+
* - **Documentation Decorator**: Adds documentation metadata to classes and properties for better maintainability and clarity.
|
|
17
|
+
*
|
|
18
|
+
* ### Use Cases
|
|
19
|
+
* - Defining database entities in a structured and consistent manner across different tables and relationships.
|
|
20
|
+
* - Abstracting database interactions to allow for easier maintenance and potential database engine changes in the future.
|
|
21
|
+
* - Handling complex entity relationships and ensuring data integrity through validation and association management.
|
|
22
|
+
*
|
|
23
|
+
* ### Example Usage
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { Entity, Table, Column, Id, Generated, OneToMany, ManyToOne, Documentation } from "@aerokit/sdk/db/decorators";
|
|
26
|
+
*
|
|
27
|
+
* @Entity('User')
|
|
28
|
+
* @Table('USERS')
|
|
29
|
+
* @Documentation('Represents a user in the system')
|
|
30
|
+
* class User {
|
|
31
|
+
* @Id()
|
|
32
|
+
* @Generated('IDENTITY')
|
|
33
|
+
* @Column({ type: 'integer' })
|
|
34
|
+
* id!: number;
|
|
35
|
+
*
|
|
36
|
+
* @Column({ type: 'string', length: 100, nullable: false })
|
|
37
|
+
* name!: string;
|
|
38
|
+
*
|
|
39
|
+
* @Column({ type: 'string', length: 255, nullable: false })
|
|
40
|
+
* email!: string;
|
|
41
|
+
*
|
|
42
|
+
* @OneToMany(() => Post, { joinColumn: 'user_id', cascade: 'all' })
|
|
43
|
+
* posts!: Post[];
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @Entity('Post')
|
|
47
|
+
* @Table('POSTS')
|
|
48
|
+
* class Post {
|
|
49
|
+
* @Id()
|
|
50
|
+
* @Generated('IDENTITY')
|
|
51
|
+
* @Column({ type: 'integer' })
|
|
52
|
+
* id!: number;
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* ::: info ECMAScript 2025-compliant ORM decorator implementation
|
|
3
56
|
* Compatible with GraalJS runtime.
|
|
4
|
-
* * Features:
|
|
5
57
|
* - Uses context.addInitializer for stable decorator timing
|
|
6
58
|
* - Stores metadata in a global WeakMap cache
|
|
7
59
|
* - Finalizes entity metadata once per class
|
|
8
60
|
* - Defers finalization via microtask (Promise.resolve().then)
|
|
61
|
+
* :::
|
|
9
62
|
*/
|
|
10
63
|
type ClassFieldDecoratorContext = {
|
|
11
64
|
kind: "field";
|
package/dist/dts/db/index.d.ts
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/index
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides functionalities for database management within the Aerokit SDK. It includes classes and methods for interacting with databases, executing SQL queries, managing transactions, and working with data repositories.
|
|
7
|
+
*
|
|
8
|
+
* The main components of this module are:
|
|
9
|
+
* - Database: Represents a database connection and provides methods to interact with it, such as executing queries and managing transactions.
|
|
10
|
+
* - SQLBuilder: Provides a fluent API for building SQL queries programmatically.
|
|
11
|
+
* - Procedure: Represents a stored procedure in the database and provides methods to execute it.
|
|
12
|
+
* - Sequence: Represents a database sequence and provides methods to interact with it.
|
|
13
|
+
* - Query: Represents a database query and provides methods to execute it and retrieve results.
|
|
14
|
+
* - Update: Represents an update operation in the database and provides methods to execute it.
|
|
15
|
+
* - Insert: Represents an insert operation in the database and provides methods to execute it.
|
|
16
|
+
* - Store: Represents a data store that can be used for caching or temporary storage of data.
|
|
17
|
+
* - Repository: Provides a repository pattern implementation for managing data entities in the database.
|
|
18
|
+
* - Decorators: Provides decorators for defining database entities, repositories, and other related components in a declarative manner
|
|
19
|
+
*/
|
|
1
20
|
export * as dao from "./dao";
|
|
2
21
|
export * from "./database";
|
|
3
22
|
export { Database as database } from "./database";
|
package/dist/dts/db/orm.d.ts
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/orm
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name ORM
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* The `ORM` class provides a way to define an Object-Relational Mapping (ORM) schema for a database entity. It allows developers to specify the structure of their entities, including properties, associations, and constraints, in a declarative manner. The ORM definition can then be used by other modules (e.g., `DAO`, `Repository`) to perform database operations while ensuring data integrity and consistency with the defined schema.
|
|
8
|
+
*
|
|
9
|
+
* ::: warning
|
|
10
|
+
* The `ORM` module is deprecated and will be removed in future releases. It is recommended to use the `Repository/Store` modules instead for managing database entities and operations.
|
|
11
|
+
* :::
|
|
12
|
+
*
|
|
13
|
+
* ### Key Features
|
|
14
|
+
* - **Declarative Schema Definition**: Define your entity's structure, properties, and associations in a clear and structured way.
|
|
15
|
+
* - **Validation**: The ORM class includes validation logic to ensure that the defined schema is consistent and adheres to expected formats.
|
|
16
|
+
* - **Association Management**: Supports defining associations between entities (e.g., one-to-one, one-to-many) to model complex relationships in the database.
|
|
17
|
+
* - **Utility Methods**: Provides methods to retrieve primary keys, mandatory properties, unique properties, and to convert the ORM definition into a table schema format.
|
|
18
|
+
*
|
|
19
|
+
* ### Use Cases
|
|
20
|
+
* - Defining the structure of database entities in a way that can be easily consumed by data access layers.
|
|
21
|
+
* - Ensuring that database operations are performed in accordance with a well-defined schema, improving data integrity and reducing errors.
|
|
22
|
+
* - Modeling complex entity relationships through associations, allowing for more sophisticated data interactions.
|
|
23
|
+
*
|
|
24
|
+
* ### Example Usage
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { ORM } from "@aerokit/sdk/db";
|
|
27
|
+
*
|
|
28
|
+
* const userORM = {
|
|
29
|
+
* table: "Users",
|
|
30
|
+
* properties: [
|
|
31
|
+
* { name: "id", column: "ID", type: "INTEGER", id: true, autoIncrement: true },
|
|
32
|
+
* { name: "name", column: "NAME", type: "VARCHAR", required: true },
|
|
33
|
+
* { name: "email", column: "EMAIL", type: "VARCHAR", unique: true }
|
|
34
|
+
* ],
|
|
35
|
+
* associations: [
|
|
36
|
+
* { name: "profile", joinKey: "PROFILE_ID", type: "one-to-one", targetDao: () => profileDAO }
|
|
37
|
+
* ]
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* const userDAO = new DAO(get(userORM));
|
|
41
|
+
* // Now you can use userDAO to perform CRUD operations on the Users table while adhering to the defined ORM schema.
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
1
44
|
/**
|
|
2
45
|
* Supported ORM schema:
|
|
3
46
|
* ```
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/procedure
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Procedure
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a `Procedure` class for executing stored procedures in a database. It allows for both the creation of stored procedures using DDL statements and the execution of existing stored procedures with parameter support. The `execute` method can handle multiple result sets returned by a stored procedure and returns them as an array of JSON objects.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - **Create Procedures**: Use the `create` method to execute DDL statements for creating or modifying stored procedures.
|
|
11
|
+
* - **Execute Procedures**: The `execute` method allows you to call stored procedures with parameters and handles multiple result sets.
|
|
12
|
+
* - **Parameter Mapping**: Supports both primitive parameters (string and number) and structured parameters using the `ProcedureParameter` interface for explicit type definitions.
|
|
13
|
+
* - **Resource Management**: Ensures proper closing of database resources (connections, statements, result sets) to prevent leaks.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Managing complex database operations encapsulated in stored procedures, allowing for cleaner application code and improved performance.
|
|
17
|
+
* - Handling multiple result sets returned by stored procedures, which is common in scenarios like reporting or batch processing.
|
|
18
|
+
* - Providing a flexible parameter mapping mechanism that can accommodate various data types and structures when calling stored procedures.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Procedure } from "@aerokit/sdk/db";
|
|
23
|
+
*
|
|
24
|
+
* // Create a stored procedure
|
|
25
|
+
* const createSql = `
|
|
26
|
+
* CREATE PROCEDURE GetUserById(IN userId INT)
|
|
27
|
+
* BEGIN
|
|
28
|
+
* SELECT * FROM Users WHERE id = userId;
|
|
29
|
+
* END
|
|
30
|
+
* `;
|
|
31
|
+
* Procedure.create(createSql);
|
|
32
|
+
*
|
|
33
|
+
* // Execute the stored procedure with a parameter
|
|
34
|
+
* const result = Procedure.execute("{CALL GetUserById(?)}", [1]);
|
|
35
|
+
* console.log(result); // Output: [{ id: 1, name: "Alice", email: "alice@example.com" }]
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
1
38
|
/**
|
|
2
39
|
* @interface ProcedureParameter
|
|
3
40
|
* @description Defines a structured parameter for procedure calls, allowing the type
|
package/dist/dts/db/query.d.ts
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module db/query
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Query
|
|
5
|
+
* @overview
|
|
3
6
|
*
|
|
7
|
+
* This module provides a `Query` class for executing parameterized SQL SELECT statements against a database in the Dirigible environment. The `Query` class supports both positional parameters (using '?' placeholders) and named parameters (using ':paramName' placeholders), allowing for flexible query construction and execution. It also includes options for formatting the result set, such as specifying date formats.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - **Parameterized Queries**: Supports both positional and named parameters for secure and efficient query execution.
|
|
11
|
+
* - **Result Formatting**: Allows for custom formatting of query results, including date formatting options.
|
|
12
|
+
* - **JSON Input Support**: Accepts parameters as JSON strings or JavaScript arrays, providing flexibility in how parameters are passed to the query.
|
|
13
|
+
* - **Error Handling**: Provides robust error handling for invalid parameter formats and JSON parsing issues.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Executing complex SQL queries with dynamic parameters in a secure manner to prevent SQL injection.
|
|
17
|
+
* - Formatting query results according to specific requirements, such as date formats or custom data transformations.
|
|
18
|
+
* - Integrating with other modules that generate parameters in JSON format, enabling seamless data flow within the application.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Query } from "@aerokit/sdk/db";
|
|
23
|
+
*
|
|
24
|
+
* // Positional parameters example
|
|
25
|
+
* const result1 = Query.execute("SELECT * FROM Users WHERE age > ?", [30]);
|
|
26
|
+
* console.log(result1); // Output: [{ id: 1, name: "Alice", age: 35 }, { id: 2, name: "Bob", age: 40 }]
|
|
27
|
+
* ```
|
|
4
28
|
*/
|
|
5
29
|
/**
|
|
6
30
|
* Interface used to wrap complex or specific values for non-named queries.
|
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/repository
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Repository
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides an abstract `Repository` class that serves as a base for data access and business logic layers in the Dirigible environment. The `Repository` class wraps the underlying `store` API, providing a structured way to perform CRUD operations on entities while also handling entity metadata, translation, and event triggering. It is designed to be extended by specific repositories for different entities, allowing for customization of behavior and event handling.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - Abstract base class for repositories with built-in support for entity metadata management.
|
|
11
|
+
* - CRUD operations (Create, Read, Update, Delete) with automatic translation of results.
|
|
12
|
+
* - Event triggering mechanism for create, update, and delete operations, allowing for custom logic to be executed in response to these events.
|
|
13
|
+
* - Type safety through TypeScript generics, ensuring that repositories are strongly typed according to their entity definitions.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Implementing data access layers for various entities in an application, providing a consistent and reusable approach to database interactions.
|
|
17
|
+
* - Adding custom business logic or side effects in response to entity lifecycle events (e.g., logging, notifications, cache invalidation).
|
|
18
|
+
* - Managing entity metadata and translations in a centralized manner within the repository layer.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Repository } from "@aerokit/sdk/db";
|
|
23
|
+
*
|
|
24
|
+
* // Define an entity interface
|
|
25
|
+
* interface User {
|
|
26
|
+
* id: number;
|
|
27
|
+
* name: string;
|
|
28
|
+
* email: string;
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* // Create a UserRepository by extending the Repository class
|
|
32
|
+
* class UserRepository extends Repository<User> {
|
|
33
|
+
* constructor() {
|
|
34
|
+
* super(User);
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* // Override triggerEvent to add custom logic on create/update/delete
|
|
38
|
+
* protected async triggerEvent(data: EntityEvent<User>): Promise<void> {
|
|
39
|
+
* console.log(`User ${data.operation}d:`, data.entity);
|
|
40
|
+
* // Additional logic such as sending notifications or updating related data can be added here
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* // Example of using the UserRepository
|
|
45
|
+
* const userRepo = new UserRepository();
|
|
46
|
+
* const newUserId = userRepo.create({ name: "Alice", email: "alice@example.com" });
|
|
47
|
+
* const user = userRepo.findById(newUserId);
|
|
48
|
+
* console.log(user); // Output: { id: 1, name: "Alice", email: "alice@example.com" }
|
|
49
|
+
* userRepo.update({ id: newUserId, name: "Alice Smith", email: "alice.smith@example.com" });
|
|
50
|
+
* userRepo.deleteById(newUserId);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
1
53
|
import { EntityConstructor, Options } from "@aerokit/sdk/db";
|
|
2
54
|
/**
|
|
3
55
|
* Represents the data structure passed to the event trigger method before/after an operation.
|
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module db/sequence
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Sequence
|
|
5
|
+
* @overview
|
|
3
6
|
*
|
|
4
|
-
*
|
|
7
|
+
* This module provides a `Sequence` class for managing database sequences in the Dirigible environment. The `Sequence` class offers static methods to retrieve the next value from a sequence, create new sequences, and drop existing sequences. It abstracts the underlying database interactions, allowing developers to work with sequences in a consistent manner across different database systems supported by Dirigible.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - Retrieve the next value from a specified database sequence.
|
|
11
|
+
* - Create new sequences with optional starting values.
|
|
12
|
+
* - Drop existing sequences when they are no longer needed.
|
|
13
|
+
* - Support for specifying datasource names to target specific database connections.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Generating unique identifiers for records in a database table using sequences.
|
|
17
|
+
* - Managing database sequences as part of application setup or migration processes.
|
|
18
|
+
* - Abstracting sequence management to allow for easier maintenance and potential database engine changes in the future.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Sequence } from "@aerokit/sdk/db";
|
|
23
|
+
*
|
|
24
|
+
* // Create a new sequence named "user_id_seq" starting at 1000
|
|
25
|
+
* Sequence.create("user_id_seq", 1000);
|
|
26
|
+
*
|
|
27
|
+
* // Get the next value from the "user_id_seq" sequence
|
|
28
|
+
* const nextUserId = Sequence.nextval("user_id_seq");
|
|
29
|
+
* console.log(nextUserId); // Output: 1000
|
|
30
|
+
*
|
|
31
|
+
* // Drop the "user_id_seq" sequence when it's no longer needed
|
|
32
|
+
* Sequence.drop("user_id_seq");
|
|
33
|
+
* ```
|
|
5
34
|
*/
|
|
6
35
|
/**
|
|
7
36
|
* Utility class for interacting with database sequence objects.
|
package/dist/dts/db/sql.d.ts
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/sql
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name SQL
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a fluent API for building SQL statements in a database-agnostic way. It includes builders for SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP statements, as well as a builder for retrieving the next value from a sequence. The builders allow for method chaining to construct complex SQL queries while managing parameters separately to prevent SQL injection. The module abstracts away differences in SQL dialects and provides a consistent interface for constructing SQL statements across different databases.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - Fluent API for building SQL statements with method chaining.
|
|
11
|
+
* - Support for SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP statements.
|
|
12
|
+
* - Separate parameter management to prevent SQL injection.
|
|
13
|
+
* - Database-agnostic design that abstracts away SQL dialect differences.
|
|
14
|
+
* - Integration with the underlying database connection for executing built statements.
|
|
15
|
+
*
|
|
16
|
+
* ### Use Cases
|
|
17
|
+
* - Constructing complex SQL queries in a readable and maintainable way.
|
|
18
|
+
* - Building SQL statements dynamically based on application logic or user input.
|
|
19
|
+
* - Abstracting database interactions to allow for easier maintenance and potential database engine changes in the future.
|
|
20
|
+
*
|
|
21
|
+
* ### Example Usage
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { SQLBuilder } from "@aerokit/sdk/db";
|
|
24
|
+
*
|
|
25
|
+
* // Example of building a SELECT statement
|
|
26
|
+
* const sqlBuilder = SQLBuilder.getDialect();
|
|
27
|
+
* const selectQuery = sqlBuilder.select()
|
|
28
|
+
* .column("id")
|
|
29
|
+
* .column("name")
|
|
30
|
+
* .from("users")
|
|
31
|
+
* .where("id = ?", 1);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
1
34
|
import { Connection } from "./database";
|
|
2
35
|
/**
|
|
3
36
|
* Union type representing all supported SQL data types.
|
package/dist/dts/db/store.d.ts
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/store
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Store
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a `Store` class that serves as a facade for interacting with the underlying Dirigible Data Store. The `Store` class offers methods for performing CRUD operations, executing parameterized queries, and retrieving metadata about entities. It abstracts away the complexities of JSON serialization and deserialization when communicating with the native Java facade, allowing developers to work with plain JavaScript objects and arrays seamlessly.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - CRUD Operations: Create, read, update, and delete entries in the data store using simple methods.
|
|
11
|
+
* - Query Execution: Execute parameterized queries with support for both primitive and complex parameters.
|
|
12
|
+
* - Metadata Retrieval: Access metadata about entities, such as table names and ID fields.
|
|
13
|
+
* - JSON Handling: Automatically handles JSON serialization and deserialization of JavaScript objects when interacting with the native Java APIs.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Managing application data in a structured way using the data store.
|
|
17
|
+
* - Executing complex queries with dynamic parameters to retrieve specific subsets of data.
|
|
18
|
+
* - Abstracting away database interactions to allow for easier maintenance and potential future changes to the underlying data storage mechanism.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Store } from "@aerokit/sdk/db";
|
|
23
|
+
*
|
|
24
|
+
* // Save a new entry to the "users" entity
|
|
25
|
+
* const userId = Store.save("users", { name: "Alice", email: "alice@example.com" });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
1
28
|
/**
|
|
2
29
|
* Defines the available comparison operators for query conditions.
|
|
3
30
|
*/
|
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module db/translator
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Translator
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides static methods for translating entity properties based on a dedicated language table.
|
|
3
8
|
* Translation is achieved by querying a separate table (e.g., 'BASE_TABLE_LANG') and merging
|
|
4
9
|
* the translated fields back into the original data.
|
|
10
|
+
*
|
|
11
|
+
* ### Key Features
|
|
12
|
+
* - Translates properties for a list of entities based on a specified language code.
|
|
13
|
+
* - Translates properties for a single entity based on its ID and a specified language code.
|
|
14
|
+
* - Handles cases where the language table may not be present, providing error logging.
|
|
15
|
+
*
|
|
16
|
+
* ### Use Cases
|
|
17
|
+
* - Supporting multilingual applications by translating entity properties according to user preferences or locale settings.
|
|
18
|
+
* - Integrating with existing database schemas that use separate language tables for translations.
|
|
19
|
+
* - Providing a consistent translation mechanism across different modules that require localized data.
|
|
20
|
+
*
|
|
21
|
+
* ### Example Usage
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { Translator } from "@aerokit/sdk/db";
|
|
24
|
+
*
|
|
25
|
+
* // Example: Translating a list of products to German
|
|
26
|
+
* const products = [
|
|
27
|
+
* { Id: 1, Name: "Laptop", Description: "A portable computer" },
|
|
28
|
+
* { Id: 2, Name: "Phone", Description: "A mobile device" }
|
|
29
|
+
* ];
|
|
30
|
+
* const translatedProducts = Translator.translateList(products, 'de', 'PRODUCTS');
|
|
31
|
+
* console.log(translatedProducts);
|
|
32
|
+
*
|
|
33
|
+
* // Example: Translating a single user entity to French
|
|
34
|
+
* const user = { Id: 1, FirstName: "John", LastName: "Doe" };
|
|
35
|
+
* const translatedUser = Translator.translateEntity(user, 1, 'fr', 'USERS');
|
|
36
|
+
* console.log(translatedUser);
|
|
37
|
+
* ```
|
|
5
38
|
*/
|
|
6
39
|
export declare class Translator {
|
|
7
40
|
/**
|
package/dist/dts/db/update.d.ts
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module db/update
|
|
3
|
+
* @package @aerokit/sdk/db
|
|
4
|
+
* @name Update
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides the `Update` class, which serves as a facade for executing SQL UPDATE, INSERT, and DELETE statements in the Dirigible environment. The `execute` method allows for parameterized queries using either primitive values or structured parameter objects that specify both type and value. This flexibility enables developers to work with various data types and database-specific requirements when performing update operations.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - **Parameterized Queries**: Supports both primitive parameters and structured parameter objects for flexible query execution.
|
|
11
|
+
* - **Named Parameters**: Allows for named parameters in the form of `:paramName` placeholders, enhancing readability and maintainability of SQL statements.
|
|
12
|
+
* - **Type Specification**: Structured parameters can include type information, which is useful for databases that require explicit type definitions for certain operations.
|
|
13
|
+
* - **Datasource Support**: The method accepts an optional datasource name, enabling execution against specific database connections in a multi-database environment.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Performing update operations on database records with dynamic values.
|
|
17
|
+
* - Executing complex SQL statements that require specific data types or named parameters.
|
|
18
|
+
* - Integrating with other modules that generate parameters in JSON format, allowing for seamless data flow within the application.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Update } from "@aerokit/sdk/db";
|
|
23
|
+
*
|
|
24
|
+
* // Example with primitive parameters
|
|
25
|
+
* const rowsAffected1 = Update.execute("UPDATE Users SET name = ? WHERE id = ?", ["Alice", 1]);
|
|
26
|
+
* console.log(rowsAffected1); // Output: number of rows updated
|
|
27
|
+
*
|
|
28
|
+
* // Example with structured parameters
|
|
29
|
+
* const rowsAffected2 = Update.execute(
|
|
30
|
+
* "INSERT INTO Orders (order_number, total) VALUES (:order_number, :total)",
|
|
31
|
+
* [
|
|
32
|
+
* { name: "order_number", type: "CHAR", value: "ORD12345" },
|
|
33
|
+
* { name: "total", type: "DECIMAL", value: 99.99 }
|
|
34
|
+
* ]
|
|
35
|
+
* );
|
|
36
|
+
* console.log(rowsAffected2); // Output: number of rows inserted
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
1
39
|
/**
|
|
2
40
|
* Interface used for complex parameter types if needed, otherwise primitive types are used directly.
|
|
3
41
|
*/
|
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module etcd/client
|
|
3
|
+
* @package @aerokit/sdk/etcd
|
|
4
|
+
* @name Client
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a `Client` class for interacting with the Etcd key-value store within the Dirigible environment. The `Client` class allows developers to perform basic operations such as putting (writing) values, getting values, and deleting keys in Etcd. It also includes utility functions for converting between JavaScript types and the native Java/Etcd types used by the underlying Etcd client library.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - Put string or byte array values to Etcd keys.
|
|
11
|
+
* - Get values from Etcd keys with options for string or byte array formats.
|
|
12
|
+
* - Retrieve metadata about the Etcd cluster and key-value store through response headers.
|
|
13
|
+
* - Delete keys from Etcd.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Storing configuration data or application state in Etcd for distributed applications.
|
|
17
|
+
* - Retrieving and managing key-value pairs in Etcd for service discovery, configuration management, or coordination tasks.
|
|
18
|
+
* - Integrating with other modules that require a consistent interface for interacting with Etcd as a backend store.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Client } from "@aerokit/sdk/etcd";
|
|
23
|
+
*
|
|
24
|
+
* const etcdClient = new Client();
|
|
25
|
+
*
|
|
26
|
+
* // Put a string value to a key
|
|
27
|
+
* etcdClient.putStringValue("config/appName", "MyApp");
|
|
28
|
+
*
|
|
29
|
+
* // Get the string value of a key
|
|
30
|
+
* const appName = etcdClient.getKvsStringValue("config/appName");
|
|
31
|
+
* console.log(appName); // Output: { "config/appName": "MyApp" }
|
|
32
|
+
*
|
|
33
|
+
* // Delete a key
|
|
34
|
+
* etcdClient.delete("config/appName");
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
1
37
|
/**
|
|
2
38
|
* Represents the header metadata of an Etcd response.
|
|
3
39
|
*/
|
package/dist/dts/etcd/index.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module etcd/index
|
|
3
|
+
* @package @aerokit/sdk/etcd
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides functionalities for interacting with an etcd key-value store within the Aerokit SDK. It includes classes and methods for connecting to an etcd server, performing CRUD operations on keys, and managing etcd clusters.
|
|
7
|
+
*
|
|
8
|
+
* The main components of this module are:
|
|
9
|
+
* - Client: Represents a client for connecting to an etcd server and provides methods to perform operations on the key-value store.
|
|
10
|
+
*/
|
|
1
11
|
export * from "./client";
|
|
2
12
|
export { Client as client } from "./client";
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module extensions/decorators
|
|
3
|
+
* @package @aerokit/sdk/extensions
|
|
4
|
+
* @name Decorators
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a set of decorators for defining and managing extensions within the Dirigible environment. The decorators are designed to be compatible with both legacy JavaScript environments (like Mozilla Rhino or older GraalJS) and modern JavaScript environments that support the latest decorator specifications.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - **Extension Decorator**: Marks a class as an extension, allowing it to be registered and associated with a specific extension point in the Dirigible application.
|
|
11
|
+
* - **Metadata Storage**: Uses symbols to store extension metadata on the class, ensuring that the metadata is encapsulated and does not interfere with other properties or methods.
|
|
12
|
+
* - **Hybrid Decorator Support**: The decorators are implemented to work seamlessly in both legacy and modern JavaScript environments, ensuring broad compatibility across different runtime contexts.
|
|
13
|
+
*
|
|
14
|
+
* ### Use Cases
|
|
15
|
+
* - Defining extensions that can be dynamically loaded and integrated into the application at runtime.
|
|
16
|
+
* - Associating extensions with specific extension points to enable modular and extensible application design.
|
|
17
|
+
* - Leveraging the extension mechanism to allow for third-party contributions or customizations without modifying the core application code.
|
|
18
|
+
*
|
|
19
|
+
* ### Example Usage
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { Extension } from "@aerokit/sdk/extensions";
|
|
22
|
+
*
|
|
23
|
+
* @Extension({ name: "MyExtension", to: "my-extension-point" })
|
|
24
|
+
* class MyExtension {
|
|
25
|
+
* // Extension implementation
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
1
29
|
export interface ExtensionOptions {
|
|
2
30
|
name: string;
|
|
3
31
|
to: string;
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @module extensions/extensions
|
|
3
|
+
* @package @aerokit/sdk/extensions
|
|
4
|
+
* @name Extensions
|
|
5
|
+
* @overview
|
|
3
6
|
*
|
|
7
|
+
* This module provides the `Extensions` class, which offers functionality for discovering and loading extensions defined against the Dirigible extension model. The `Extensions` class allows developers to retrieve registered extensions for specific extension points and to load those extensions as modules, ensuring that they meet specified requirements (e.g., exporting certain functions).
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - Retrieve registered extension module paths for specific extension points.
|
|
11
|
+
* - Load extension modules with support for both synchronous and asynchronous loading mechanisms.
|
|
12
|
+
* - Validate loaded extensions against required function exports to ensure they meet expected interfaces.
|
|
13
|
+
* - Configurable error handling to either log issues or throw exceptions based on the use case.
|
|
14
|
+
*
|
|
15
|
+
* ### Use Cases
|
|
16
|
+
* - Dynamically loading and integrating extensions at runtime based on the application's needs.
|
|
17
|
+
* - Ensuring that loaded extensions conform to expected interfaces by checking for required functions.
|
|
18
|
+
* - Managing extensions in a modular application design, allowing for third-party contributions without modifying core code.
|
|
19
|
+
*
|
|
20
|
+
* ### Example Usage
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Extensions } from "@aerokit/sdk/extensions";
|
|
23
|
+
*
|
|
24
|
+
* // Load extensions for a specific extension point, requiring certain functions to be exported
|
|
25
|
+
* const loadedExtensions = await Extensions.load("my.extension.point", ["initialize", "execute"], true);
|
|
26
|
+
*
|
|
27
|
+
* // Use the loaded extensions
|
|
28
|
+
* loadedExtensions.forEach(extension => {
|
|
29
|
+
* extension.initialize();
|
|
30
|
+
* extension.execute();
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
4
33
|
*/
|
|
5
34
|
/**
|
|
6
35
|
* Provides functionality for discovering and loading extensions defined
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module extensions/index
|
|
3
|
+
* @package @aerokit/sdk/extensions
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides functionalities for managing extensions within the Aerokit SDK. It includes classes and methods for defining, registering, and managing extensions that can enhance the capabilities of the SDK.
|
|
7
|
+
*
|
|
8
|
+
* The main components of this module are:
|
|
9
|
+
* - Extensions: Represents a registry for managing extensions and provides methods to register and retrieve extensions.
|
|
10
|
+
* - Decorators: Provides decorators for defining extensions and their properties in a declarative manner.
|
|
11
|
+
*/
|
|
1
12
|
export * from "./extensions";
|
|
2
13
|
export { Extensions as extensions } from "./extensions";
|
|
3
14
|
export * as decorators from "./decorators";
|
package/dist/dts/git/client.d.ts
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module git/client
|
|
3
|
+
* @package @aerokit/sdk/git
|
|
4
|
+
* @name Client
|
|
5
|
+
* @overview
|
|
6
|
+
*
|
|
7
|
+
* This module provides a `Client` class for interacting with Git repositories within the Dirigible environment. The `Client` class offers methods for initializing repositories, committing changes, managing branches, and retrieving repository information such as status and history. It abstracts the underlying Git operations through a native Java facade, providing a simplified interface for common Git tasks in the context of workspace projects.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features
|
|
10
|
+
* - Repository initialization with an initial commit.
|
|
11
|
+
* - Committing changes with options for staging and commit messages.
|
|
12
|
+
* - Branch management, including creation, deletion, and renaming of local and remote branches.
|
|
13
|
+
* - Pulling and pushing changes to remote repositories.
|
|
14
|
+
* - Retrieving repository status, current branch, and commit history.
|
|
15
|
+
*
|
|
16
|
+
* ### Use Cases
|
|
17
|
+
* - Managing Git repositories for projects within the Dirigible workspace.
|
|
18
|
+
* - Automating Git operations as part of application workflows or CI/CD pipelines.
|
|
19
|
+
* - Integrating Git functionality into custom applications or modules that require version control capabilities.
|
|
20
|
+
*
|
|
21
|
+
* ### Example Usage
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { Client } from "@aerokit/sdk/git";
|
|
24
|
+
*
|
|
25
|
+
* // Initialize a new Git repository for a project
|
|
26
|
+
* Client.initRepository("Alice", "alice@example.com");
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
1
29
|
/**
|
|
2
30
|
* Describes a file within the workspace, potentially with Git status information.
|
|
3
31
|
*/
|
package/dist/dts/git/index.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module git/index
|
|
3
|
+
* @package @aerokit/sdk/git
|
|
4
|
+
* @overview
|
|
5
|
+
*
|
|
6
|
+
* This module provides functionalities for interacting with Git repositories within the Aerokit SDK. It includes classes and methods for connecting to Git repositories, performing operations such as cloning, committing, pushing, and pulling changes, and managing Git configurations.
|
|
7
|
+
*
|
|
8
|
+
* The main components of this module are:
|
|
9
|
+
* - Client: Represents a client for connecting to a Git repository and provides methods to perform various Git operations.
|
|
10
|
+
*/
|
|
1
11
|
export * from "./client";
|
|
2
12
|
export { Client as client } from "./client";
|