@objectstack/objectql 1.0.4 → 1.0.6

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.
@@ -0,0 +1,22 @@
1
+
2
+ > @objectstack/objectql@1.0.6 build /home/runner/work/spec/spec/packages/objectql
3
+ > tsup --config ../../tsup.config.ts
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /home/runner/work/spec/spec/tsup.config.ts
9
+ CLI Target: es2020
10
+ CLI Cleaning output folder
11
+ ESM Build start
12
+ CJS Build start
13
+ ESM dist/index.mjs 23.51 KB
14
+ ESM dist/index.mjs.map 49.71 KB
15
+ ESM ⚡️ Build success in 76ms
16
+ CJS dist/index.js 24.72 KB
17
+ CJS dist/index.js.map 50.17 KB
18
+ CJS ⚡️ Build success in 84ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 10005ms
21
+ DTS dist/index.d.mts 37.73 KB
22
+ DTS dist/index.d.ts 37.73 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @objectstack/objectql
2
2
 
3
+ ## 1.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a7f7b9d]
8
+ - @objectstack/spec@1.0.6
9
+ - @objectstack/core@1.0.6
10
+ - @objectstack/types@1.0.6
11
+
12
+ ## 1.0.5
13
+
14
+ ### Patch Changes
15
+
16
+ - b1d24bd: refactor: migrate build system from tsc to tsup for faster builds
17
+ - Replaced `tsc` with `tsup` (using esbuild) across all packages
18
+ - Added shared `tsup.config.ts` in workspace root
19
+ - Added `tsup` as workspace dev dependency
20
+ - significantly improved build performance
21
+ - Updated dependencies [b1d24bd]
22
+ - @objectstack/core@1.0.5
23
+ - @objectstack/types@1.0.5
24
+ - @objectstack/spec@1.0.5
25
+
3
26
  ## 1.0.4
4
27
 
5
28
  ### Patch Changes
@@ -1,10 +1,13 @@
1
- import { ServiceObject } from '@objectstack/spec/data';
1
+ import { ServiceObject, HookContext, DataEngineQueryOptions, DataEngineInsertOptions, DataEngineUpdateOptions, DataEngineDeleteOptions, DataEngineCountOptions, DataEngineAggregateOptions } from '@objectstack/spec/data';
2
2
  import { ObjectStackManifest } from '@objectstack/spec/kernel';
3
+ import { ObjectStackProtocol, MetadataCacheRequest, MetadataCacheResponse, BatchUpdateRequest, BatchUpdateResponse, UpdateManyDataRequest, DeleteManyDataRequest } from '@objectstack/spec/api';
4
+ import { IDataEngine, DriverInterface, Logger, Plugin, PluginContext } from '@objectstack/core';
5
+
3
6
  /**
4
7
  * Global Schema Registry
5
8
  * Unified storage for all metadata types (Objects, Apps, Flows, Layouts, etc.)
6
9
  */
7
- export declare class SchemaRegistry {
10
+ declare class SchemaRegistry {
8
11
  private static metadata;
9
12
  /**
10
13
  * Universal Register Method
@@ -566,4 +569,431 @@ export declare class SchemaRegistry {
566
569
  globs: string[];
567
570
  }[];
568
571
  }
569
- //# sourceMappingURL=registry.d.ts.map
572
+
573
+ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
574
+ private engine;
575
+ constructor(engine: IDataEngine);
576
+ getDiscovery(_request: {}): Promise<{
577
+ version: string;
578
+ apiName: string;
579
+ capabilities: {
580
+ graphql: boolean;
581
+ search: boolean;
582
+ websockets: boolean;
583
+ files: boolean;
584
+ analytics: boolean;
585
+ hub: boolean;
586
+ };
587
+ endpoints: {
588
+ data: string;
589
+ metadata: string;
590
+ auth: string;
591
+ };
592
+ }>;
593
+ getMetaTypes(_request: {}): Promise<{
594
+ types: string[];
595
+ }>;
596
+ getMetaItems(request: {
597
+ type: string;
598
+ }): Promise<{
599
+ type: string;
600
+ items: unknown[];
601
+ }>;
602
+ getMetaItem(request: {
603
+ type: string;
604
+ name: string;
605
+ }): Promise<{
606
+ type: string;
607
+ name: string;
608
+ item: unknown;
609
+ }>;
610
+ getUiView(request: {
611
+ object: string;
612
+ type: 'list' | 'form';
613
+ }): Promise<any>;
614
+ findData(request: {
615
+ object: string;
616
+ query?: any;
617
+ }): Promise<{
618
+ object: string;
619
+ value: any[];
620
+ records: any[];
621
+ total: number;
622
+ hasMore: boolean;
623
+ }>;
624
+ getData(request: {
625
+ object: string;
626
+ id: string;
627
+ }): Promise<{
628
+ object: string;
629
+ id: string;
630
+ record: any;
631
+ }>;
632
+ createData(request: {
633
+ object: string;
634
+ data: any;
635
+ }): Promise<{
636
+ object: string;
637
+ id: any;
638
+ record: any;
639
+ }>;
640
+ updateData(request: {
641
+ object: string;
642
+ id: string;
643
+ data: any;
644
+ }): Promise<{
645
+ object: string;
646
+ id: string;
647
+ record: any;
648
+ }>;
649
+ deleteData(request: {
650
+ object: string;
651
+ id: string;
652
+ }): Promise<{
653
+ object: string;
654
+ id: string;
655
+ success: boolean;
656
+ }>;
657
+ getMetaItemCached(request: {
658
+ type: string;
659
+ name: string;
660
+ cacheRequest?: MetadataCacheRequest;
661
+ }): Promise<MetadataCacheResponse>;
662
+ batchData(_request: {
663
+ object: string;
664
+ request: BatchUpdateRequest;
665
+ }): Promise<BatchUpdateResponse>;
666
+ createManyData(request: {
667
+ object: string;
668
+ records: any[];
669
+ }): Promise<any>;
670
+ updateManyData(_request: UpdateManyDataRequest): Promise<any>;
671
+ analyticsQuery(_request: any): Promise<any>;
672
+ getAnalyticsMeta(_request: any): Promise<any>;
673
+ triggerAutomation(_request: any): Promise<any>;
674
+ listSpaces(_request: any): Promise<any>;
675
+ createSpace(_request: any): Promise<any>;
676
+ installPlugin(_request: any): Promise<any>;
677
+ deleteManyData(request: DeleteManyDataRequest): Promise<any>;
678
+ saveMetaItem(request: {
679
+ type: string;
680
+ name: string;
681
+ item?: any;
682
+ }): Promise<{
683
+ success: boolean;
684
+ message: string;
685
+ }>;
686
+ }
687
+
688
+ type HookHandler = (context: HookContext) => Promise<void> | void;
689
+ /**
690
+ * Host Context provided to plugins (Internal ObjectQL Plugin System)
691
+ */
692
+ interface ObjectQLHostContext {
693
+ ql: ObjectQL;
694
+ logger: Logger;
695
+ [key: string]: any;
696
+ }
697
+ /**
698
+ * ObjectQL Engine
699
+ *
700
+ * Implements the IDataEngine interface for data persistence.
701
+ * Acts as the reference implementation for:
702
+ * - CoreServiceName.data (CRUD)
703
+ * - CoreServiceName.metadata (Schema Registry)
704
+ */
705
+ declare class ObjectQL implements IDataEngine {
706
+ private drivers;
707
+ private defaultDriver;
708
+ private logger;
709
+ private hooks;
710
+ private hostContext;
711
+ constructor(hostContext?: Record<string, any>);
712
+ /**
713
+ * Service Status Report
714
+ * Used by Kernel to verify health and capabilities.
715
+ */
716
+ getStatus(): {
717
+ name: "data";
718
+ status: string;
719
+ version: string;
720
+ features: string[];
721
+ };
722
+ /**
723
+ * Expose the SchemaRegistry for plugins to register metadata
724
+ */
725
+ get registry(): typeof SchemaRegistry;
726
+ /**
727
+ * Load and Register a Plugin
728
+ */
729
+ use(manifestPart: any, runtimePart?: any): Promise<void>;
730
+ /**
731
+ * Register a hook
732
+ * @param event The event name (e.g. 'beforeFind', 'afterInsert')
733
+ * @param handler The handler function
734
+ */
735
+ registerHook(event: string, handler: HookHandler): void;
736
+ triggerHooks(event: string, context: HookContext): Promise<void>;
737
+ /**
738
+ * Register contribution (Manifest)
739
+ */
740
+ registerApp(manifest: any): void;
741
+ /**
742
+ * Register a new storage driver
743
+ */
744
+ registerDriver(driver: DriverInterface, isDefault?: boolean): void;
745
+ /**
746
+ * Helper to get object definition
747
+ */
748
+ getSchema(objectName: string): {
749
+ fields: Record<string, {
750
+ type: "number" | "boolean" | "code" | "date" | "lookup" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "datetime" | "time" | "toggle" | "select" | "multiselect" | "radio" | "checkboxes" | "master_detail" | "tree" | "image" | "file" | "avatar" | "video" | "audio" | "formula" | "summary" | "autonumber" | "location" | "address" | "json" | "color" | "rating" | "slider" | "signature" | "qrcode" | "progress" | "tags" | "vector";
751
+ required: boolean;
752
+ searchable: boolean;
753
+ multiple: boolean;
754
+ unique: boolean;
755
+ deleteBehavior: "set_null" | "cascade" | "restrict";
756
+ auditTrail: boolean;
757
+ hidden: boolean;
758
+ readonly: boolean;
759
+ encryption: boolean;
760
+ index: boolean;
761
+ externalId: boolean;
762
+ options?: {
763
+ value: string;
764
+ label: string;
765
+ color?: string | undefined;
766
+ default?: boolean | undefined;
767
+ }[] | undefined;
768
+ expression?: string | undefined;
769
+ defaultValue?: any;
770
+ min?: number | undefined;
771
+ max?: number | undefined;
772
+ step?: number | undefined;
773
+ language?: string | undefined;
774
+ encryptionConfig?: {
775
+ enabled: boolean;
776
+ algorithm: "aes-256-gcm" | "aes-256-cbc" | "chacha20-poly1305";
777
+ keyManagement: {
778
+ provider: "local" | "aws-kms" | "azure-key-vault" | "gcp-kms" | "hashicorp-vault";
779
+ keyId?: string | undefined;
780
+ rotationPolicy?: {
781
+ enabled: boolean;
782
+ frequencyDays: number;
783
+ retainOldVersions: number;
784
+ autoRotate: boolean;
785
+ } | undefined;
786
+ };
787
+ scope: "table" | "field" | "database" | "record";
788
+ deterministicEncryption: boolean;
789
+ searchableEncryption: boolean;
790
+ } | undefined;
791
+ formula?: string | undefined;
792
+ label?: string | undefined;
793
+ precision?: number | undefined;
794
+ name?: string | undefined;
795
+ description?: string | undefined;
796
+ format?: string | undefined;
797
+ maxLength?: number | undefined;
798
+ minLength?: number | undefined;
799
+ scale?: number | undefined;
800
+ reference?: string | undefined;
801
+ referenceFilters?: string[] | undefined;
802
+ writeRequiresMasterRead?: boolean | undefined;
803
+ summaryOperations?: {
804
+ object: string;
805
+ function: "count" | "sum" | "avg" | "min" | "max";
806
+ field: string;
807
+ } | undefined;
808
+ theme?: string | undefined;
809
+ lineNumbers?: boolean | undefined;
810
+ maxRating?: number | undefined;
811
+ allowHalf?: boolean | undefined;
812
+ displayMap?: boolean | undefined;
813
+ allowGeocoding?: boolean | undefined;
814
+ addressFormat?: "us" | "uk" | "international" | undefined;
815
+ colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined;
816
+ allowAlpha?: boolean | undefined;
817
+ presetColors?: string[] | undefined;
818
+ showValue?: boolean | undefined;
819
+ marks?: Record<string, string> | undefined;
820
+ barcodeFormat?: "qr" | "ean13" | "ean8" | "code128" | "code39" | "upca" | "upce" | undefined;
821
+ qrErrorCorrection?: "L" | "M" | "Q" | "H" | undefined;
822
+ displayValue?: boolean | undefined;
823
+ allowScanning?: boolean | undefined;
824
+ currencyConfig?: {
825
+ precision: number;
826
+ currencyMode: "dynamic" | "fixed";
827
+ defaultCurrency: string;
828
+ } | undefined;
829
+ vectorConfig?: {
830
+ dimensions: number;
831
+ distanceMetric: "cosine" | "euclidean" | "dotProduct" | "manhattan";
832
+ normalized: boolean;
833
+ indexed: boolean;
834
+ indexType?: "flat" | "hnsw" | "ivfflat" | undefined;
835
+ } | undefined;
836
+ fileAttachmentConfig?: {
837
+ virusScan: boolean;
838
+ virusScanOnUpload: boolean;
839
+ quarantineOnThreat: boolean;
840
+ allowMultiple: boolean;
841
+ allowReplace: boolean;
842
+ allowDelete: boolean;
843
+ requireUpload: boolean;
844
+ extractMetadata: boolean;
845
+ extractText: boolean;
846
+ versioningEnabled: boolean;
847
+ publicRead: boolean;
848
+ presignedUrlExpiry: number;
849
+ minSize?: number | undefined;
850
+ maxSize?: number | undefined;
851
+ allowedTypes?: string[] | undefined;
852
+ blockedTypes?: string[] | undefined;
853
+ allowedMimeTypes?: string[] | undefined;
854
+ blockedMimeTypes?: string[] | undefined;
855
+ virusScanProvider?: "custom" | "clamav" | "virustotal" | "metadefender" | undefined;
856
+ storageProvider?: string | undefined;
857
+ storageBucket?: string | undefined;
858
+ storagePrefix?: string | undefined;
859
+ imageValidation?: {
860
+ autoRotate: boolean;
861
+ generateThumbnails: boolean;
862
+ preserveMetadata: boolean;
863
+ minWidth?: number | undefined;
864
+ maxWidth?: number | undefined;
865
+ minHeight?: number | undefined;
866
+ maxHeight?: number | undefined;
867
+ aspectRatio?: string | undefined;
868
+ thumbnailSizes?: {
869
+ name: string;
870
+ width: number;
871
+ height: number;
872
+ crop: boolean;
873
+ }[] | undefined;
874
+ } | undefined;
875
+ maxVersions?: number | undefined;
876
+ } | undefined;
877
+ maskingRule?: {
878
+ field: string;
879
+ strategy: "partial" | "hash" | "redact" | "tokenize" | "randomize" | "nullify" | "substitute";
880
+ preserveFormat: boolean;
881
+ preserveLength: boolean;
882
+ pattern?: string | undefined;
883
+ roles?: string[] | undefined;
884
+ exemptRoles?: string[] | undefined;
885
+ } | undefined;
886
+ dependencies?: string[] | undefined;
887
+ cached?: {
888
+ enabled: boolean;
889
+ ttl: number;
890
+ invalidateOn: string[];
891
+ } | undefined;
892
+ dataQuality?: {
893
+ uniqueness: boolean;
894
+ completeness: number;
895
+ accuracy?: {
896
+ source: string;
897
+ threshold: number;
898
+ } | undefined;
899
+ } | undefined;
900
+ }>;
901
+ name: string;
902
+ active: boolean;
903
+ isSystem: boolean;
904
+ abstract: boolean;
905
+ datasource: string;
906
+ search?: {
907
+ fields: string[];
908
+ displayFields?: string[] | undefined;
909
+ filters?: string[] | undefined;
910
+ } | undefined;
911
+ tags?: string[] | undefined;
912
+ label?: string | undefined;
913
+ description?: string | undefined;
914
+ pluralLabel?: string | undefined;
915
+ icon?: string | undefined;
916
+ tableName?: string | undefined;
917
+ indexes?: {
918
+ type: "hash" | "btree" | "gin" | "gist" | "fulltext";
919
+ fields: string[];
920
+ unique: boolean;
921
+ partial?: string | undefined;
922
+ name?: string | undefined;
923
+ }[] | undefined;
924
+ tenancy?: {
925
+ enabled: boolean;
926
+ strategy: "shared" | "isolated" | "hybrid";
927
+ tenantField: string;
928
+ crossTenantAccess: boolean;
929
+ } | undefined;
930
+ softDelete?: {
931
+ enabled: boolean;
932
+ field: string;
933
+ cascadeDelete: boolean;
934
+ } | undefined;
935
+ versioning?: {
936
+ enabled: boolean;
937
+ strategy: "snapshot" | "delta" | "event-sourcing";
938
+ versionField: string;
939
+ retentionDays?: number | undefined;
940
+ } | undefined;
941
+ partitioning?: {
942
+ enabled: boolean;
943
+ strategy: "hash" | "range" | "list";
944
+ key: string;
945
+ interval?: string | undefined;
946
+ } | undefined;
947
+ cdc?: {
948
+ enabled: boolean;
949
+ events: ("insert" | "update" | "delete")[];
950
+ destination: string;
951
+ } | undefined;
952
+ validations?: any[] | undefined;
953
+ titleFormat?: string | undefined;
954
+ compactLayout?: string[] | undefined;
955
+ enable?: {
956
+ searchable: boolean;
957
+ trackHistory: boolean;
958
+ apiEnabled: boolean;
959
+ files: boolean;
960
+ feeds: boolean;
961
+ activities: boolean;
962
+ trash: boolean;
963
+ mru: boolean;
964
+ clone: boolean;
965
+ apiMethods?: ("search" | "update" | "delete" | "get" | "list" | "create" | "upsert" | "bulk" | "aggregate" | "history" | "restore" | "purge" | "import" | "export")[] | undefined;
966
+ } | undefined;
967
+ } | undefined;
968
+ /**
969
+ * Helper to get the target driver
970
+ */
971
+ private getDriver;
972
+ /**
973
+ * Initialize the engine and all registered drivers
974
+ */
975
+ init(): Promise<void>;
976
+ destroy(): Promise<void>;
977
+ private toQueryAST;
978
+ find(object: string, query?: DataEngineQueryOptions): Promise<any[]>;
979
+ findOne(objectName: string, query?: DataEngineQueryOptions): Promise<any>;
980
+ insert(object: string, data: any | any[], options?: DataEngineInsertOptions): Promise<any>;
981
+ update(object: string, data: any, options?: DataEngineUpdateOptions): Promise<any>;
982
+ delete(object: string, options?: DataEngineDeleteOptions): Promise<any>;
983
+ count(object: string, query?: DataEngineCountOptions): Promise<number>;
984
+ aggregate(object: string, query: DataEngineAggregateOptions): Promise<any[]>;
985
+ execute(command: any, options?: Record<string, any>): Promise<any>;
986
+ }
987
+
988
+ declare class ObjectQLPlugin implements Plugin {
989
+ name: string;
990
+ type: "objectql";
991
+ version: string;
992
+ private ql;
993
+ private hostContext?;
994
+ constructor(ql?: ObjectQL, hostContext?: Record<string, any>);
995
+ init: (ctx: PluginContext) => Promise<void>;
996
+ start: (ctx: PluginContext) => Promise<void>;
997
+ }
998
+
999
+ export { type HookHandler, ObjectQL, type ObjectQLHostContext, ObjectQLPlugin, ObjectStackProtocolImplementation, SchemaRegistry };