Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sensedeep/dynamodb-onetable
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Aug 18, 2023
2 parents 5d8375c + 18efe2c commit 6e1d526
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/Metrics.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export class Metrics {
constructor(table: any, params?: {}, prior?: {});
table: any;
log: any;
metrics: {
chan: string;
dimensions: string[];
enable: boolean;
env: boolean;
hot: boolean;
max: number;
namespace: string;
period: number;
properties: {};
queries: boolean;
source: string;
tenant: any;
};
add(model: any, op: any, result: any, params: any, mark: any): void;
addMetricGroup(values: any, dimensionValues: any, properties: any): void;
addMetric(key: any, values: any, dimensions: any, dimensionValues: any, properties: any): void;
flushMetrics(timestamp?: number): void;
emitMetrics(timestamp: any, rec: any): void;
}
1 change: 1 addition & 0 deletions src/Model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export type OneParams = {
type?: string
tunnel?: object
where?: string
profile?: string
}

/*
Expand Down
4 changes: 3 additions & 1 deletion src/Table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Paged,
Entity,
} from './Model'
import { Metrics } from './Metrics'
import {DynamoDBRecord} from 'aws-lambda'

export type EntityGroup = {
Expand Down Expand Up @@ -78,6 +79,7 @@ type ExtractModel<M> = M extends Entity<infer X> ? X : never

export class Table<Schema extends OneSchema = any> {
name: string
metrics: Metrics
constructor(params: TableConstructorParams<Schema>)

addContext(context?: {}): Table<Schema>
Expand All @@ -97,7 +99,7 @@ export class Table<Schema extends OneSchema = any> {
getKeys(): Promise<OneIndex>
getModel<T>(
name: T extends ModelNames<Schema> ? T : ModelNames<Schema>,
options?: {nothrow: boolean}
options?: {nothrow?: boolean}
): T extends string ? Model<Entity<Schema['models'][T]>> : Model<Entity<ExtractModel<T>>>
getCurrentSchema(): {}
groupByType(items: AnyEntity[], params?: OneParams): EntityGroup
Expand Down

0 comments on commit 6e1d526

Please sign in to comment.