@patternmeshjs/core
    Preparing search index...

    Type Alias ConnectedDb<TTable, E>

    ConnectedDb: { readonly [K in keyof E]: ReturnType<typeof createRepository> } & {
        adapter: DynamoAdapter;
        batchGet: (
            refs: Record<
                string,
                { entity: keyof E & string; key: Record<string, unknown> },
            >,
        ) => Promise<Record<string, unknown>>;
        entities: E;
        explain: { tx: TransactBundle["explain"] };
        lifecycle: {
            archive: (
                spec: {
                    archiveEntity: CompiledEntity;
                    archiveItem: Record<string, unknown>;
                    archiveLabel?: string;
                    clientRequestToken?: string;
                    markDeletedAtEpochSeconds?: number;
                    markFields?: Record<string, unknown>;
                    sourceDisposition?: "mark" | "delete" | "none";
                    sourceEntity: CompiledEntity;
                    sourceKey: Record<string, unknown>;
                },
            ) => Promise<
                Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >,
            >;
            softDelete: (
                spec: {
                    clientRequestToken?: string;
                    deletedAtEpochSeconds: number;
                    entity: CompiledEntity;
                    key: Record<string, unknown>;
                    label?: string;
                    tombstone?: Record<string, unknown>;
                },
            ) => Promise<
                Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >,
            >;
        };
        orchestrate: {
            counterSummary: (
                parts: {
                    primary: (
                        o: {
                            conditionCheck: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                                ifFn: ConditionCheckFn,
                            ) => void;
                            delete: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => void;
                            put: (
                                label: string,
                                ent: CompiledEntity,
                                input: Record<string, unknown>,
                            ) => void;
                            update: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => unknown;
                        },
                    ) => void
                    | Promise<void>;
                    summary?: (
                        o: {
                            conditionCheck: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                                ifFn: ConditionCheckFn,
                            ) => void;
                            delete: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => void;
                            put: (
                                label: string,
                                ent: CompiledEntity,
                                input: Record<string, unknown>,
                            ) => void;
                            update: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => unknown;
                        },
                    ) => void
                    | Promise<void>;
                },
                options?: { clientRequestToken?: string },
            ) => Promise<
                {
                    primary: Record<
                        string,
                        {
                            entity: string;
                            operation: "Put"
                            | "Update"
                            | "Delete"
                            | "ConditionCheck";
                        },
                    >;
                    summary: Record<
                        string,
                        {
                            entity: string;
                            operation: "Put"
                            | "Update"
                            | "Delete"
                            | "ConditionCheck";
                        },
                    >;
                },
            >;
            fanOut: (
                parts: {
                    fanOut?: (
                        o: {
                            conditionCheck: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                                ifFn: ConditionCheckFn,
                            ) => void;
                            delete: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => void;
                            put: (
                                label: string,
                                ent: CompiledEntity,
                                input: Record<string, unknown>,
                            ) => void;
                            update: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => unknown;
                        },
                    ) => void
                    | Promise<void>;
                    primary: (
                        o: {
                            conditionCheck: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                                ifFn: ConditionCheckFn,
                            ) => void;
                            delete: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => void;
                            put: (
                                label: string,
                                ent: CompiledEntity,
                                input: Record<string, unknown>,
                            ) => void;
                            update: (
                                label: string,
                                ent: CompiledEntity,
                                key: Record<string, unknown>,
                            ) => unknown;
                        },
                    ) => void
                    | Promise<void>;
                },
                options?: { clientRequestToken?: string },
            ) => Promise<
                {
                    fanOut: Record<
                        string,
                        {
                            entity: string;
                            operation: "Put"
                            | "Update"
                            | "Delete"
                            | "ConditionCheck";
                        },
                    >;
                    primary: Record<
                        string,
                        {
                            entity: string;
                            operation: "Put"
                            | "Update"
                            | "Delete"
                            | "ConditionCheck";
                        },
                    >;
                },
            >;
            write: (
                fn: (
                    o: {
                        conditionCheck: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                            ifFn: ConditionCheckFn,
                        ) => void;
                        delete: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => void;
                        put: (
                            label: string,
                            ent: CompiledEntity,
                            input: Record<string, unknown>,
                        ) => void;
                        update: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => unknown;
                    },
                ) => void
                | Promise<void>,
                options?: { clientRequestToken?: string },
            ) => Promise<
                Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >,
            >;
        };
        read: {
            explain: (
                bundleName: string,
                input: Record<string, unknown>,
                opts?: { fanOutCap?: number; maxDepth?: number; maxSteps?: number },
            ) => {
                steps: readonly Record<string, unknown>[];
                warnings: readonly string[];
            };
            run: (
                bundleName: string,
                input: Record<string, unknown>,
                opts?: { fanOutCap?: number; maxDepth?: number; maxSteps?: number },
            ) => Promise<Record<string, unknown>>;
        };
        recipes: {
            explain: (
                recipeName: string,
            ) => { steps: readonly Record<string, unknown>[] };
            run: (
                recipeName: string,
                input: Record<string, unknown>,
                options?: { clientRequestToken?: string },
            ) => Promise<
                Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >,
            >;
        };
        table: TTable;
        tx: TransactBundle["tx"];
    }

    Type Parameters

    Type Declaration

    • Readonlyadapter: DynamoAdapter
    • ReadonlybatchGet: (
          refs: Record<
              string,
              { entity: keyof E & string; key: Record<string, unknown> },
          >,
      ) => Promise<Record<string, unknown>>
    • Readonlyentities: E

      Same compiled entities passed to connect(); useful for typing and tx participants.

    • Readonlyexplain: { tx: TransactBundle["explain"] }
    • Readonlylifecycle: {
          archive: (
              spec: {
                  archiveEntity: CompiledEntity;
                  archiveItem: Record<string, unknown>;
                  archiveLabel?: string;
                  clientRequestToken?: string;
                  markDeletedAtEpochSeconds?: number;
                  markFields?: Record<string, unknown>;
                  sourceDisposition?: "mark" | "delete" | "none";
                  sourceEntity: CompiledEntity;
                  sourceKey: Record<string, unknown>;
              },
          ) => Promise<
              Record<
                  string,
                  {
                      entity: string;
                      operation: "Put"
                      | "Update"
                      | "Delete"
                      | "ConditionCheck";
                  },
              >,
          >;
          softDelete: (
              spec: {
                  clientRequestToken?: string;
                  deletedAtEpochSeconds: number;
                  entity: CompiledEntity;
                  key: Record<string, unknown>;
                  label?: string;
                  tombstone?: Record<string, unknown>;
              },
          ) => Promise<
              Record<
                  string,
                  {
                      entity: string;
                      operation: "Put"
                      | "Update"
                      | "Delete"
                      | "ConditionCheck";
                  },
              >,
          >;
      }
    • Readonlyorchestrate: {
          counterSummary: (
              parts: {
                  primary: (
                      o: {
                          conditionCheck: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                              ifFn: ConditionCheckFn,
                          ) => void;
                          delete: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => void;
                          put: (
                              label: string,
                              ent: CompiledEntity,
                              input: Record<string, unknown>,
                          ) => void;
                          update: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => unknown;
                      },
                  ) => void
                  | Promise<void>;
                  summary?: (
                      o: {
                          conditionCheck: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                              ifFn: ConditionCheckFn,
                          ) => void;
                          delete: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => void;
                          put: (
                              label: string,
                              ent: CompiledEntity,
                              input: Record<string, unknown>,
                          ) => void;
                          update: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => unknown;
                      },
                  ) => void
                  | Promise<void>;
              },
              options?: { clientRequestToken?: string },
          ) => Promise<
              {
                  primary: Record<
                      string,
                      {
                          entity: string;
                          operation: "Put"
                          | "Update"
                          | "Delete"
                          | "ConditionCheck";
                      },
                  >;
                  summary: Record<
                      string,
                      {
                          entity: string;
                          operation: "Put"
                          | "Update"
                          | "Delete"
                          | "ConditionCheck";
                      },
                  >;
              },
          >;
          fanOut: (
              parts: {
                  fanOut?: (
                      o: {
                          conditionCheck: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                              ifFn: ConditionCheckFn,
                          ) => void;
                          delete: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => void;
                          put: (
                              label: string,
                              ent: CompiledEntity,
                              input: Record<string, unknown>,
                          ) => void;
                          update: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => unknown;
                      },
                  ) => void
                  | Promise<void>;
                  primary: (
                      o: {
                          conditionCheck: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                              ifFn: ConditionCheckFn,
                          ) => void;
                          delete: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => void;
                          put: (
                              label: string,
                              ent: CompiledEntity,
                              input: Record<string, unknown>,
                          ) => void;
                          update: (
                              label: string,
                              ent: CompiledEntity,
                              key: Record<string, unknown>,
                          ) => unknown;
                      },
                  ) => void
                  | Promise<void>;
              },
              options?: { clientRequestToken?: string },
          ) => Promise<
              {
                  fanOut: Record<
                      string,
                      {
                          entity: string;
                          operation: "Put"
                          | "Update"
                          | "Delete"
                          | "ConditionCheck";
                      },
                  >;
                  primary: Record<
                      string,
                      {
                          entity: string;
                          operation: "Put"
                          | "Update"
                          | "Delete"
                          | "ConditionCheck";
                      },
                  >;
              },
          >;
          write: (
              fn: (
                  o: {
                      conditionCheck: (
                          label: string,
                          ent: CompiledEntity,
                          key: Record<string, unknown>,
                          ifFn: ConditionCheckFn,
                      ) => void;
                      delete: (
                          label: string,
                          ent: CompiledEntity,
                          key: Record<string, unknown>,
                      ) => void;
                      put: (
                          label: string,
                          ent: CompiledEntity,
                          input: Record<string, unknown>,
                      ) => void;
                      update: (
                          label: string,
                          ent: CompiledEntity,
                          key: Record<string, unknown>,
                      ) => unknown;
                  },
              ) => void
              | Promise<void>,
              options?: { clientRequestToken?: string },
          ) => Promise<
              Record<
                  string,
                  {
                      entity: string;
                      operation: "Put"
                      | "Update"
                      | "Delete"
                      | "ConditionCheck";
                  },
              >,
          >;
      }
      • counterSummary: (
            parts: {
                primary: (
                    o: {
                        conditionCheck: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                            ifFn: ConditionCheckFn,
                        ) => void;
                        delete: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => void;
                        put: (
                            label: string,
                            ent: CompiledEntity,
                            input: Record<string, unknown>,
                        ) => void;
                        update: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => unknown;
                    },
                ) => void
                | Promise<void>;
                summary?: (
                    o: {
                        conditionCheck: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                            ifFn: ConditionCheckFn,
                        ) => void;
                        delete: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => void;
                        put: (
                            label: string,
                            ent: CompiledEntity,
                            input: Record<string, unknown>,
                        ) => void;
                        update: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => unknown;
                    },
                ) => void
                | Promise<void>;
            },
            options?: { clientRequestToken?: string },
        ) => Promise<
            {
                primary: Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >;
                summary: Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >;
            },
        >
      • fanOut: (
            parts: {
                fanOut?: (
                    o: {
                        conditionCheck: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                            ifFn: ConditionCheckFn,
                        ) => void;
                        delete: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => void;
                        put: (
                            label: string,
                            ent: CompiledEntity,
                            input: Record<string, unknown>,
                        ) => void;
                        update: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => unknown;
                    },
                ) => void
                | Promise<void>;
                primary: (
                    o: {
                        conditionCheck: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                            ifFn: ConditionCheckFn,
                        ) => void;
                        delete: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => void;
                        put: (
                            label: string,
                            ent: CompiledEntity,
                            input: Record<string, unknown>,
                        ) => void;
                        update: (
                            label: string,
                            ent: CompiledEntity,
                            key: Record<string, unknown>,
                        ) => unknown;
                    },
                ) => void
                | Promise<void>;
            },
            options?: { clientRequestToken?: string },
        ) => Promise<
            {
                fanOut: Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >;
                primary: Record<
                    string,
                    {
                        entity: string;
                        operation: "Put"
                        | "Update"
                        | "Delete"
                        | "ConditionCheck";
                    },
                >;
            },
        >

        Explicit fan-out write primitive for materialized view maintenance. Executes primary and fan-out participants in one transaction.

      • write: (
            fn: (
                o: {
                    conditionCheck: (
                        label: string,
                        ent: CompiledEntity,
                        key: Record<string, unknown>,
                        ifFn: ConditionCheckFn,
                    ) => void;
                    delete: (
                        label: string,
                        ent: CompiledEntity,
                        key: Record<string, unknown>,
                    ) => void;
                    put: (
                        label: string,
                        ent: CompiledEntity,
                        input: Record<string, unknown>,
                    ) => void;
                    update: (
                        label: string,
                        ent: CompiledEntity,
                        key: Record<string, unknown>,
                    ) => unknown;
                },
            ) => void
            | Promise<void>,
            options?: { clientRequestToken?: string },
        ) => Promise<
            Record<
                string,
                {
                    entity: string;
                    operation: "Put"
                    | "Update"
                    | "Delete"
                    | "ConditionCheck";
                },
            >,
        >

        Explicit labeled cross-entity transaction bundle. Callers control each participant; no hidden relation inference.

    • Readonlyread: {
          explain: (
              bundleName: string,
              input: Record<string, unknown>,
              opts?: { fanOutCap?: number; maxDepth?: number; maxSteps?: number },
          ) => {
              steps: readonly Record<string, unknown>[];
              warnings: readonly string[];
          };
          run: (
              bundleName: string,
              input: Record<string, unknown>,
              opts?: { fanOutCap?: number; maxDepth?: number; maxSteps?: number },
          ) => Promise<Record<string, unknown>>;
      }
    • Readonlyrecipes: {
          explain: (
              recipeName: string,
          ) => { steps: readonly Record<string, unknown>[] };
          run: (
              recipeName: string,
              input: Record<string, unknown>,
              options?: { clientRequestToken?: string },
          ) => Promise<
              Record<
                  string,
                  {
                      entity: string;
                      operation: "Put"
                      | "Update"
                      | "Delete"
                      | "ConditionCheck";
                  },
              >,
          >;
      }
    • Readonlytable: TTable
    • Readonlytx: TransactBundle["tx"]