@form-engine-ts/storage-azure-table 6.6.0 → 6.7.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/index.cjs CHANGED
@@ -469,7 +469,7 @@ function createAzureTableStorage(options = {}) {
469
469
  (left, right) => left.submittedAt.localeCompare(right.submittedAt) || left.id.localeCompare(right.id)
470
470
  );
471
471
  };
472
- return {
472
+ const adapter = {
473
473
  async saveSchema(schema) {
474
474
  ensureWritable();
475
475
  (0, import_core.assertValidFormSchema)(schema);
@@ -696,6 +696,23 @@ function createAzureTableStorage(options = {}) {
696
696
  }
697
697
  }
698
698
  };
699
+ return {
700
+ ...adapter,
701
+ async fetchPage(formId, options2) {
702
+ const page = await adapter.listSubmissionPage(formId, {
703
+ ...options2?.pageSize === void 0 ? {} : { pageSize: options2.pageSize },
704
+ ...options2?.fromSubmittedAt === void 0 ? {} : { since: options2.fromSubmittedAt },
705
+ ...options2?.toSubmittedAt === void 0 ? {} : { until: options2.toSubmittedAt },
706
+ ...options2?.locale === void 0 ? {} : { locale: options2.locale },
707
+ ...options2?.cursor === void 0 ? {} : { cursor: options2.cursor },
708
+ ...options2?.metadataFilters === void 0 ? {} : { metadataFilters: options2.metadataFilters }
709
+ });
710
+ return {
711
+ items: page.items,
712
+ ...page.nextCursor === void 0 ? {} : { nextCursor: page.nextCursor }
713
+ };
714
+ }
715
+ };
699
716
  }
700
717
  // Annotate the CommonJS export names for ESM import in node:
701
718
  0 && (module.exports = {
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { FormSubmission, SubmissionPageQueryOptions, BaseSubmissionMetadata, StrictFormSubmission, PagedSubmissionStorageAdapter, SubmissionFilter } from '@form-engine-ts/core';
1
+ import { FormSubmission, BaseSubmissionMetadata, PagedSubmissionStorageAdapter, SubmissionPageQueryOptions, StrictFormSubmission, SubmissionFilter } from '@form-engine-ts/core';
2
2
 
3
3
  interface AzureTableListOptions {
4
4
  readonly queryOptions?: {
@@ -105,6 +105,19 @@ interface AzureTableStorageOptions<T = FormSubmission> {
105
105
  readonly fieldMapping?: AzureTableFieldMapping;
106
106
  readonly readOnly?: boolean;
107
107
  }
108
+ interface AzureTableStorageAdapter<TMeta extends BaseSubmissionMetadata = BaseSubmissionMetadata> extends PagedSubmissionStorageAdapter {
109
+ readonly fetchPage: (formId: string, options?: {
110
+ readonly pageSize?: number;
111
+ readonly fromSubmittedAt?: string;
112
+ readonly toSubmittedAt?: string;
113
+ readonly locale?: string;
114
+ readonly metadataFilters?: Partial<TMeta>;
115
+ readonly cursor?: string;
116
+ }) => Promise<{
117
+ readonly items: readonly FormSubmission<TMeta>[];
118
+ readonly nextCursor?: string;
119
+ }>;
120
+ }
108
121
  interface AzureTextAnswerCursorPayload {
109
122
  readonly formatVersion: 1;
110
123
  readonly formId: string;
@@ -120,4 +133,4 @@ declare function metadataFiltersToOData(options: SubmissionPageQueryOptions, map
120
133
  declare function submissionFilterToOData(filter: SubmissionFilter, mapping?: AzureTableFieldMapping): string | undefined;
121
134
  declare function createAzureTableStorage(options?: AzureTableStorageOptions): PagedSubmissionStorageAdapter;
122
135
 
123
- export { type AzureTableClientLike, type AzureTableEntityCodec, type AzureTableEntityIterator, type AzureTableEntityPage, type AzureTableFieldMapping, type AzureTableLegacyCodec, type AzureTableLegacyEntity, type AzureTableListOptions, type AzureTablePageSettings, type AzureTableStorageOptions, type AzureTableSubmissionCodec, type AzureTableValueCodec, type AzureTextAnswerCursorPayload, type LegacyAnswerArrayEntity, type LegacyArrayAzureTableCodec, createAzureTableStorage, createLegacyArrayAzureTableCodec, createLegacyAzureTableCodec, defaultAzureTableSubmissionCodec, metadataFiltersToOData, submissionFilterToOData };
136
+ export { type AzureTableClientLike, type AzureTableEntityCodec, type AzureTableEntityIterator, type AzureTableEntityPage, type AzureTableFieldMapping, type AzureTableLegacyCodec, type AzureTableLegacyEntity, type AzureTableListOptions, type AzureTablePageSettings, type AzureTableStorageAdapter, type AzureTableStorageOptions, type AzureTableSubmissionCodec, type AzureTableValueCodec, type AzureTextAnswerCursorPayload, type LegacyAnswerArrayEntity, type LegacyArrayAzureTableCodec, createAzureTableStorage, createLegacyArrayAzureTableCodec, createLegacyAzureTableCodec, defaultAzureTableSubmissionCodec, metadataFiltersToOData, submissionFilterToOData };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FormSubmission, SubmissionPageQueryOptions, BaseSubmissionMetadata, StrictFormSubmission, PagedSubmissionStorageAdapter, SubmissionFilter } from '@form-engine-ts/core';
1
+ import { FormSubmission, BaseSubmissionMetadata, PagedSubmissionStorageAdapter, SubmissionPageQueryOptions, StrictFormSubmission, SubmissionFilter } from '@form-engine-ts/core';
2
2
 
3
3
  interface AzureTableListOptions {
4
4
  readonly queryOptions?: {
@@ -105,6 +105,19 @@ interface AzureTableStorageOptions<T = FormSubmission> {
105
105
  readonly fieldMapping?: AzureTableFieldMapping;
106
106
  readonly readOnly?: boolean;
107
107
  }
108
+ interface AzureTableStorageAdapter<TMeta extends BaseSubmissionMetadata = BaseSubmissionMetadata> extends PagedSubmissionStorageAdapter {
109
+ readonly fetchPage: (formId: string, options?: {
110
+ readonly pageSize?: number;
111
+ readonly fromSubmittedAt?: string;
112
+ readonly toSubmittedAt?: string;
113
+ readonly locale?: string;
114
+ readonly metadataFilters?: Partial<TMeta>;
115
+ readonly cursor?: string;
116
+ }) => Promise<{
117
+ readonly items: readonly FormSubmission<TMeta>[];
118
+ readonly nextCursor?: string;
119
+ }>;
120
+ }
108
121
  interface AzureTextAnswerCursorPayload {
109
122
  readonly formatVersion: 1;
110
123
  readonly formId: string;
@@ -120,4 +133,4 @@ declare function metadataFiltersToOData(options: SubmissionPageQueryOptions, map
120
133
  declare function submissionFilterToOData(filter: SubmissionFilter, mapping?: AzureTableFieldMapping): string | undefined;
121
134
  declare function createAzureTableStorage(options?: AzureTableStorageOptions): PagedSubmissionStorageAdapter;
122
135
 
123
- export { type AzureTableClientLike, type AzureTableEntityCodec, type AzureTableEntityIterator, type AzureTableEntityPage, type AzureTableFieldMapping, type AzureTableLegacyCodec, type AzureTableLegacyEntity, type AzureTableListOptions, type AzureTablePageSettings, type AzureTableStorageOptions, type AzureTableSubmissionCodec, type AzureTableValueCodec, type AzureTextAnswerCursorPayload, type LegacyAnswerArrayEntity, type LegacyArrayAzureTableCodec, createAzureTableStorage, createLegacyArrayAzureTableCodec, createLegacyAzureTableCodec, defaultAzureTableSubmissionCodec, metadataFiltersToOData, submissionFilterToOData };
136
+ export { type AzureTableClientLike, type AzureTableEntityCodec, type AzureTableEntityIterator, type AzureTableEntityPage, type AzureTableFieldMapping, type AzureTableLegacyCodec, type AzureTableLegacyEntity, type AzureTableListOptions, type AzureTablePageSettings, type AzureTableStorageAdapter, type AzureTableStorageOptions, type AzureTableSubmissionCodec, type AzureTableValueCodec, type AzureTextAnswerCursorPayload, type LegacyAnswerArrayEntity, type LegacyArrayAzureTableCodec, createAzureTableStorage, createLegacyArrayAzureTableCodec, createLegacyAzureTableCodec, defaultAzureTableSubmissionCodec, metadataFiltersToOData, submissionFilterToOData };
package/dist/index.js CHANGED
@@ -440,7 +440,7 @@ function createAzureTableStorage(options = {}) {
440
440
  (left, right) => left.submittedAt.localeCompare(right.submittedAt) || left.id.localeCompare(right.id)
441
441
  );
442
442
  };
443
- return {
443
+ const adapter = {
444
444
  async saveSchema(schema) {
445
445
  ensureWritable();
446
446
  assertValidFormSchema(schema);
@@ -667,6 +667,23 @@ function createAzureTableStorage(options = {}) {
667
667
  }
668
668
  }
669
669
  };
670
+ return {
671
+ ...adapter,
672
+ async fetchPage(formId, options2) {
673
+ const page = await adapter.listSubmissionPage(formId, {
674
+ ...options2?.pageSize === void 0 ? {} : { pageSize: options2.pageSize },
675
+ ...options2?.fromSubmittedAt === void 0 ? {} : { since: options2.fromSubmittedAt },
676
+ ...options2?.toSubmittedAt === void 0 ? {} : { until: options2.toSubmittedAt },
677
+ ...options2?.locale === void 0 ? {} : { locale: options2.locale },
678
+ ...options2?.cursor === void 0 ? {} : { cursor: options2.cursor },
679
+ ...options2?.metadataFilters === void 0 ? {} : { metadataFilters: options2.metadataFilters }
680
+ });
681
+ return {
682
+ items: page.items,
683
+ ...page.nextCursor === void 0 ? {} : { nextCursor: page.nextCursor }
684
+ };
685
+ }
686
+ };
670
687
  }
671
688
  export {
672
689
  createAzureTableStorage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@form-engine-ts/storage-azure-table",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,7 +39,7 @@
39
39
  "typescript"
40
40
  ],
41
41
  "dependencies": {
42
- "@form-engine-ts/core": "6.6.0"
42
+ "@form-engine-ts/core": "6.7.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@azure/data-tables": "^13.3.2"