@betterinternship/core 1.7.0 → 1.7.2

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.
@@ -1,91 +1,91 @@
1
- import { IFormMetadata } from "@betterinternship/core/forms";
2
- export interface OldIFormMetadata {
3
- name: string;
4
- label: string;
5
- schema_version: number;
6
- schema: OldIFormField[];
7
- schema_phantoms?: OldIFormPhantomField[];
8
- subscribers: OldIFormSubscriber[];
9
- signatories: OldIFormSignatory[];
10
- required_parties: OldIFormPendingParties[];
11
- params?: OldIFormParams;
12
- }
13
- export interface OldIFormParams {
14
- [key: string]: string | OldIFormParams;
15
- }
16
- export interface OldIFormContact {
17
- name: string;
18
- honorific: string;
19
- title: string;
20
- email: string;
21
- }
22
- export type OldIFormSubscriber = OldIFormContact;
23
- export interface OldIFormSignatory extends OldIFormContact {
24
- field: string;
25
- }
26
- export type OldIFormPendingParties = {
27
- party: string;
28
- order: number;
29
- };
30
- export interface OldIFormField {
31
- field: string;
32
- type: "text" | "signature";
33
- x: number;
34
- y: number;
35
- w: number;
36
- h: number;
37
- page: number;
38
- align_h?: "left" | "center" | "right";
39
- align_v?: "top" | "middle" | "bottom";
40
- label: string;
41
- source: "auto" | "prefill" | "derived" | "manual";
42
- party: "university" | "entity" | "student" | "student-guardian" | string;
43
- shared: boolean;
44
- descriptor?: boolean;
45
- tooltip_label: string;
46
- validator: string;
47
- prefiller: string;
48
- }
49
- export interface OldIFormPhantomField {
50
- field: string;
51
- label: string;
52
- type: "email" | "param";
53
- source: "auto" | "prefill" | "derived" | "manual";
54
- party: "university" | "entity" | "student" | "student-guardian" | string;
55
- shared: boolean;
56
- descriptor?: boolean;
57
- tooltip_label: string;
58
- validator: string;
59
- prefiller: string;
60
- }
61
- export interface MigrationOptions {
62
- partyIdStrategy?: "index" | "name" | "uuid";
63
- accountIdStrategy?: "email-hash" | "uuid" | "email";
64
- preserveDescriptors?: boolean;
65
- partyMapping?: Record<string, string>;
66
- accountMapping?: Record<string, string>;
67
- }
68
- export declare class FormMetadataMigrator {
69
- private options;
70
- private partyMap;
71
- private accountMap;
72
- private blockIdCounter;
73
- constructor(options?: MigrationOptions);
74
- migrate(oldForm: OldIFormMetadata): IFormMetadata;
75
- private buildSigningParties;
76
- private fieldsToBlocks;
77
- private phantomFieldsToBlocks;
78
- private migrateSubscribers;
79
- private generateOrMapPartyId;
80
- private getOrGeneratePartyId;
81
- private generateOrMapAccountId;
82
- private isSignatoryForParty;
83
- private generateBlockId;
84
- private hashEmail;
85
- private generateUUID;
86
- }
87
- export declare function migrateFormMetadata(oldForm: OldIFormMetadata, options?: MigrationOptions): IFormMetadata;
88
- export declare function migrateFormMetadataBatch(oldForms: OldIFormMetadata[], options?: MigrationOptions): IFormMetadata[];
89
- export declare function isFormMetadataV0(form: any): boolean;
90
- export declare function isFormMetadataV1(form: any): boolean;
91
- export declare function autoMigrateFormMetadata(form: any, options?: MigrationOptions): IFormMetadata;
1
+ import { IFormMetadata } from "@betterinternship/core/forms";
2
+ export interface OldIFormMetadata {
3
+ name: string;
4
+ label: string;
5
+ schema_version: number;
6
+ schema: OldIFormField[];
7
+ schema_phantoms?: OldIFormPhantomField[];
8
+ subscribers: OldIFormSubscriber[];
9
+ signatories: OldIFormSignatory[];
10
+ required_parties: OldIFormPendingParties[];
11
+ params?: OldIFormParams;
12
+ }
13
+ export interface OldIFormParams {
14
+ [key: string]: string | OldIFormParams;
15
+ }
16
+ export interface OldIFormContact {
17
+ name: string;
18
+ honorific: string;
19
+ title: string;
20
+ email: string;
21
+ }
22
+ export type OldIFormSubscriber = OldIFormContact;
23
+ export interface OldIFormSignatory extends OldIFormContact {
24
+ field: string;
25
+ }
26
+ export type OldIFormPendingParties = {
27
+ party: string;
28
+ order: number;
29
+ };
30
+ export interface OldIFormField {
31
+ field: string;
32
+ type: "text" | "signature";
33
+ x: number;
34
+ y: number;
35
+ w: number;
36
+ h: number;
37
+ page: number;
38
+ align_h?: "left" | "center" | "right";
39
+ align_v?: "top" | "middle" | "bottom";
40
+ label: string;
41
+ source: "auto" | "prefill" | "derived" | "manual";
42
+ party: "university" | "entity" | "student" | "student-guardian" | string;
43
+ shared: boolean;
44
+ descriptor?: boolean;
45
+ tooltip_label: string;
46
+ validator: string;
47
+ prefiller: string;
48
+ }
49
+ export interface OldIFormPhantomField {
50
+ field: string;
51
+ label: string;
52
+ type: "email" | "param";
53
+ source: "auto" | "prefill" | "derived" | "manual";
54
+ party: "university" | "entity" | "student" | "student-guardian" | string;
55
+ shared: boolean;
56
+ descriptor?: boolean;
57
+ tooltip_label: string;
58
+ validator: string;
59
+ prefiller: string;
60
+ }
61
+ export interface MigrationOptions {
62
+ partyIdStrategy?: "index" | "name" | "uuid";
63
+ accountIdStrategy?: "email-hash" | "uuid" | "email";
64
+ preserveDescriptors?: boolean;
65
+ partyMapping?: Record<string, string>;
66
+ accountMapping?: Record<string, string>;
67
+ }
68
+ export declare class FormMetadataMigrator {
69
+ private options;
70
+ private partyMap;
71
+ private accountMap;
72
+ private blockIdCounter;
73
+ constructor(options?: MigrationOptions);
74
+ migrate(oldForm: OldIFormMetadata): IFormMetadata;
75
+ private buildSigningParties;
76
+ private fieldsToBlocks;
77
+ private phantomFieldsToBlocks;
78
+ private migrateSubscribers;
79
+ private generateOrMapPartyId;
80
+ private getOrGeneratePartyId;
81
+ private generateOrMapAccountId;
82
+ private isSignatoryForParty;
83
+ private generateBlockId;
84
+ private hashEmail;
85
+ private generateUUID;
86
+ }
87
+ export declare function migrateFormMetadata(oldForm: OldIFormMetadata, options?: MigrationOptions): IFormMetadata;
88
+ export declare function migrateFormMetadataBatch(oldForms: OldIFormMetadata[], options?: MigrationOptions): IFormMetadata[];
89
+ export declare function isFormMetadataV0(form: any): boolean;
90
+ export declare function isFormMetadataV1(form: any): boolean;
91
+ export declare function autoMigrateFormMetadata(form: any, options?: MigrationOptions): IFormMetadata;
@@ -1,225 +1,225 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormMetadataMigrator = void 0;
4
- exports.migrateFormMetadata = migrateFormMetadata;
5
- exports.migrateFormMetadataBatch = migrateFormMetadataBatch;
6
- exports.isFormMetadataV0 = isFormMetadataV0;
7
- exports.isFormMetadataV1 = isFormMetadataV1;
8
- exports.autoMigrateFormMetadata = autoMigrateFormMetadata;
9
- const crypto_1 = require("crypto");
10
- const forms_1 = require("@betterinternship/core/forms");
11
- class FormMetadataMigrator {
12
- options;
13
- partyMap = new Map();
14
- accountMap = new Map();
15
- blockIdCounter = 0;
16
- constructor(options = {}) {
17
- this.options = {
18
- partyIdStrategy: options.partyIdStrategy ?? "index",
19
- accountIdStrategy: options.accountIdStrategy ?? "email-hash",
20
- preserveDescriptors: options.preserveDescriptors ?? true,
21
- partyMapping: options.partyMapping ?? {},
22
- accountMapping: options.accountMapping ?? {},
23
- };
24
- }
25
- migrate(oldForm) {
26
- const signingParties = this.buildSigningParties(oldForm.required_parties, oldForm.signatories);
27
- const fieldBlocks = this.fieldsToBlocks(oldForm.schema);
28
- const phantomBlocks = this.phantomFieldsToBlocks(oldForm.schema_phantoms || []);
29
- return {
30
- name: oldForm.name,
31
- label: oldForm.label,
32
- schema_version: forms_1.SCHEMA_VERSION,
33
- schema: {
34
- blocks: [...fieldBlocks, ...phantomBlocks],
35
- },
36
- signing_parties: signingParties,
37
- subscribers: this.migrateSubscribers(oldForm.subscribers),
38
- };
39
- }
40
- buildSigningParties(requiredParties, signatories) {
41
- return requiredParties
42
- .sort((a, b) => a.order - b.order)
43
- .map((party, index) => {
44
- const partyId = this.generateOrMapPartyId(party.party, index);
45
- this.partyMap.set(party.party, partyId);
46
- const matchingSignatory = signatories.find((sig) => this.isSignatoryForParty(sig.field, party.party));
47
- const signingParty = {
48
- _id: partyId,
49
- order: party.order,
50
- signed: false,
51
- };
52
- if (matchingSignatory) {
53
- const accountId = this.generateOrMapAccountId(matchingSignatory.field, matchingSignatory.email);
54
- this.accountMap.set(matchingSignatory.field, accountId);
55
- signingParty.signatory_account = {
56
- account_id: accountId,
57
- name: matchingSignatory.name,
58
- email: matchingSignatory.email,
59
- title: matchingSignatory.title,
60
- honorific: matchingSignatory.honorific,
61
- };
62
- }
63
- return signingParty;
64
- });
65
- }
66
- fieldsToBlocks(oldFields) {
67
- return oldFields
68
- .sort((a, b) => {
69
- if (a.page !== b.page)
70
- return a.page - b.page;
71
- if (a.y !== b.y)
72
- return a.y - b.y;
73
- return a.x - b.x;
74
- })
75
- .map((field, index) => {
76
- const partyId = this.getOrGeneratePartyId(field.party);
77
- const newField = {
78
- field: field.field,
79
- type: field.type,
80
- x: field.x,
81
- y: field.y,
82
- w: field.w,
83
- h: field.h,
84
- page: field.page,
85
- align_h: field.align_h,
86
- align_v: field.align_v,
87
- label: field.label,
88
- tooltip_label: field.tooltip_label,
89
- shared: field.shared,
90
- signing_party_id: partyId,
91
- source: field.source,
92
- validator: field.validator,
93
- prefiller: field.prefiller,
94
- };
95
- const block = {
96
- _id: this.generateBlockId("field", index),
97
- block_type: "form_field",
98
- order: index,
99
- signing_party_id: partyId,
100
- field_schema: newField,
101
- };
102
- return block;
103
- });
104
- }
105
- phantomFieldsToBlocks(oldPhantomFields) {
106
- return oldPhantomFields.map((phantom, index) => {
107
- const partyId = this.getOrGeneratePartyId(phantom.party);
108
- const fieldType = phantom.type === "email" ? "text" : "text";
109
- const newPhantomField = {
110
- field: phantom.field,
111
- type: fieldType,
112
- label: phantom.label,
113
- tooltip_label: phantom.tooltip_label,
114
- shared: phantom.shared,
115
- signing_party_id: partyId,
116
- source: phantom.source,
117
- validator: phantom.validator,
118
- prefiller: phantom.prefiller,
119
- };
120
- const block = {
121
- _id: this.generateBlockId("phantom", index),
122
- block_type: "form_phantom_field",
123
- order: index + 1000,
124
- signing_party_id: partyId,
125
- phantom_field_schema: newPhantomField,
126
- };
127
- return block;
128
- });
129
- }
130
- migrateSubscribers(oldSubscribers) {
131
- return oldSubscribers.map((subscriber) => {
132
- const accountId = this.generateOrMapAccountId(`subscriber-${subscriber.email}`, subscriber.email);
133
- return {
134
- account_id: accountId,
135
- name: subscriber.name,
136
- email: subscriber.email,
137
- };
138
- });
139
- }
140
- generateOrMapPartyId(partyName, index) {
141
- if (this.options.partyMapping[partyName]) {
142
- return this.options.partyMapping[partyName];
143
- }
144
- switch (this.options.partyIdStrategy) {
145
- case "name":
146
- return `party-${partyName.toLowerCase().replace(/\s+/g, "-")}`;
147
- case "uuid":
148
- return `party-${this.generateUUID()}`;
149
- case "index":
150
- default:
151
- return `party-${index}`;
152
- }
153
- }
154
- getOrGeneratePartyId(partyName) {
155
- if (this.partyMap.has(partyName)) {
156
- return this.partyMap.get(partyName);
157
- }
158
- const id = this.generateOrMapPartyId(partyName, this.partyMap.size);
159
- this.partyMap.set(partyName, id);
160
- return id;
161
- }
162
- generateOrMapAccountId(key, email) {
163
- if (this.options.accountMapping[key]) {
164
- return this.options.accountMapping[key];
165
- }
166
- switch (this.options.accountIdStrategy) {
167
- case "email":
168
- return email;
169
- case "uuid":
170
- return `account-${this.generateUUID()}`;
171
- case "email-hash":
172
- default:
173
- return `account-${this.hashEmail(email)}`;
174
- }
175
- }
176
- isSignatoryForParty(field, party) {
177
- const fieldPrefix = field.split(".")[0];
178
- const partyPrefix = party.replace("-", "_");
179
- return fieldPrefix.toLowerCase() === partyPrefix.toLowerCase() || field.includes(party);
180
- }
181
- generateBlockId(type, index) {
182
- return `block-${type}-${this.blockIdCounter++}`;
183
- }
184
- hashEmail(email) {
185
- return crypto_1.default.createHash("sha256").update(email).digest("hex").slice(0, 12);
186
- }
187
- generateUUID() {
188
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
189
- const r = (Math.random() * 16) | 0;
190
- const v = c === "x" ? r : (r & 0x3) | 0x8;
191
- return v.toString(16);
192
- });
193
- }
194
- }
195
- exports.FormMetadataMigrator = FormMetadataMigrator;
196
- function migrateFormMetadata(oldForm, options) {
197
- const migrator = new FormMetadataMigrator(options);
198
- return migrator.migrate(oldForm);
199
- }
200
- function migrateFormMetadataBatch(oldForms, options) {
201
- const migrator = new FormMetadataMigrator(options);
202
- return oldForms.map((form) => migrator.migrate(form));
203
- }
204
- function isFormMetadataV0(form) {
205
- return (form.schema_version === 0 &&
206
- Array.isArray(form.schema) &&
207
- Array.isArray(form.required_parties) &&
208
- Array.isArray(form.signatories));
209
- }
210
- function isFormMetadataV1(form) {
211
- return (form.schema_version === 1 &&
212
- form.schema &&
213
- Array.isArray(form.schema.blocks) &&
214
- Array.isArray(form.signing_parties));
215
- }
216
- function autoMigrateFormMetadata(form, options) {
217
- if (isFormMetadataV0(form)) {
218
- return migrateFormMetadata(form, options);
219
- }
220
- if (isFormMetadataV1(form)) {
221
- return form;
222
- }
223
- throw new Error(`Unknown form metadata version: ${form.schema_version}`);
224
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormMetadataMigrator = void 0;
4
+ exports.migrateFormMetadata = migrateFormMetadata;
5
+ exports.migrateFormMetadataBatch = migrateFormMetadataBatch;
6
+ exports.isFormMetadataV0 = isFormMetadataV0;
7
+ exports.isFormMetadataV1 = isFormMetadataV1;
8
+ exports.autoMigrateFormMetadata = autoMigrateFormMetadata;
9
+ const crypto_1 = require("crypto");
10
+ const forms_1 = require("@betterinternship/core/forms");
11
+ class FormMetadataMigrator {
12
+ options;
13
+ partyMap = new Map();
14
+ accountMap = new Map();
15
+ blockIdCounter = 0;
16
+ constructor(options = {}) {
17
+ this.options = {
18
+ partyIdStrategy: options.partyIdStrategy ?? "index",
19
+ accountIdStrategy: options.accountIdStrategy ?? "email-hash",
20
+ preserveDescriptors: options.preserveDescriptors ?? true,
21
+ partyMapping: options.partyMapping ?? {},
22
+ accountMapping: options.accountMapping ?? {},
23
+ };
24
+ }
25
+ migrate(oldForm) {
26
+ const signingParties = this.buildSigningParties(oldForm.required_parties, oldForm.signatories);
27
+ const fieldBlocks = this.fieldsToBlocks(oldForm.schema);
28
+ const phantomBlocks = this.phantomFieldsToBlocks(oldForm.schema_phantoms || []);
29
+ return {
30
+ name: oldForm.name,
31
+ label: oldForm.label,
32
+ schema_version: forms_1.SCHEMA_VERSION,
33
+ schema: {
34
+ blocks: [...fieldBlocks, ...phantomBlocks],
35
+ },
36
+ signing_parties: signingParties,
37
+ subscribers: this.migrateSubscribers(oldForm.subscribers),
38
+ };
39
+ }
40
+ buildSigningParties(requiredParties, signatories) {
41
+ return requiredParties
42
+ .sort((a, b) => a.order - b.order)
43
+ .map((party, index) => {
44
+ const partyId = this.generateOrMapPartyId(party.party, index);
45
+ this.partyMap.set(party.party, partyId);
46
+ const matchingSignatory = signatories.find((sig) => this.isSignatoryForParty(sig.field, party.party));
47
+ const signingParty = {
48
+ _id: partyId,
49
+ order: party.order,
50
+ signed: false,
51
+ };
52
+ if (matchingSignatory) {
53
+ const accountId = this.generateOrMapAccountId(matchingSignatory.field, matchingSignatory.email);
54
+ this.accountMap.set(matchingSignatory.field, accountId);
55
+ signingParty.signatory_account = {
56
+ account_id: accountId,
57
+ name: matchingSignatory.name,
58
+ email: matchingSignatory.email,
59
+ title: matchingSignatory.title,
60
+ honorific: matchingSignatory.honorific,
61
+ };
62
+ }
63
+ return signingParty;
64
+ });
65
+ }
66
+ fieldsToBlocks(oldFields) {
67
+ return oldFields
68
+ .sort((a, b) => {
69
+ if (a.page !== b.page)
70
+ return a.page - b.page;
71
+ if (a.y !== b.y)
72
+ return a.y - b.y;
73
+ return a.x - b.x;
74
+ })
75
+ .map((field, index) => {
76
+ const partyId = this.getOrGeneratePartyId(field.party);
77
+ const newField = {
78
+ field: field.field,
79
+ type: field.type,
80
+ x: field.x,
81
+ y: field.y,
82
+ w: field.w,
83
+ h: field.h,
84
+ page: field.page,
85
+ align_h: field.align_h,
86
+ align_v: field.align_v,
87
+ label: field.label,
88
+ tooltip_label: field.tooltip_label,
89
+ shared: field.shared,
90
+ signing_party_id: partyId,
91
+ source: field.source,
92
+ validator: field.validator,
93
+ prefiller: field.prefiller,
94
+ };
95
+ const block = {
96
+ _id: this.generateBlockId("field", index),
97
+ block_type: "form_field",
98
+ order: index,
99
+ signing_party_id: partyId,
100
+ field_schema: newField,
101
+ };
102
+ return block;
103
+ });
104
+ }
105
+ phantomFieldsToBlocks(oldPhantomFields) {
106
+ return oldPhantomFields.map((phantom, index) => {
107
+ const partyId = this.getOrGeneratePartyId(phantom.party);
108
+ const fieldType = phantom.type === "email" ? "text" : "text";
109
+ const newPhantomField = {
110
+ field: phantom.field,
111
+ type: fieldType,
112
+ label: phantom.label,
113
+ tooltip_label: phantom.tooltip_label,
114
+ shared: phantom.shared,
115
+ signing_party_id: partyId,
116
+ source: phantom.source,
117
+ validator: phantom.validator,
118
+ prefiller: phantom.prefiller,
119
+ };
120
+ const block = {
121
+ _id: this.generateBlockId("phantom", index),
122
+ block_type: "form_phantom_field",
123
+ order: index + 1000,
124
+ signing_party_id: partyId,
125
+ phantom_field_schema: newPhantomField,
126
+ };
127
+ return block;
128
+ });
129
+ }
130
+ migrateSubscribers(oldSubscribers) {
131
+ return oldSubscribers.map((subscriber) => {
132
+ const accountId = this.generateOrMapAccountId(`subscriber-${subscriber.email}`, subscriber.email);
133
+ return {
134
+ account_id: accountId,
135
+ name: subscriber.name,
136
+ email: subscriber.email,
137
+ };
138
+ });
139
+ }
140
+ generateOrMapPartyId(partyName, index) {
141
+ if (this.options.partyMapping[partyName]) {
142
+ return this.options.partyMapping[partyName];
143
+ }
144
+ switch (this.options.partyIdStrategy) {
145
+ case "name":
146
+ return `party-${partyName.toLowerCase().replace(/\s+/g, "-")}`;
147
+ case "uuid":
148
+ return `party-${this.generateUUID()}`;
149
+ case "index":
150
+ default:
151
+ return `party-${index}`;
152
+ }
153
+ }
154
+ getOrGeneratePartyId(partyName) {
155
+ if (this.partyMap.has(partyName)) {
156
+ return this.partyMap.get(partyName);
157
+ }
158
+ const id = this.generateOrMapPartyId(partyName, this.partyMap.size);
159
+ this.partyMap.set(partyName, id);
160
+ return id;
161
+ }
162
+ generateOrMapAccountId(key, email) {
163
+ if (this.options.accountMapping[key]) {
164
+ return this.options.accountMapping[key];
165
+ }
166
+ switch (this.options.accountIdStrategy) {
167
+ case "email":
168
+ return email;
169
+ case "uuid":
170
+ return `account-${this.generateUUID()}`;
171
+ case "email-hash":
172
+ default:
173
+ return `account-${this.hashEmail(email)}`;
174
+ }
175
+ }
176
+ isSignatoryForParty(field, party) {
177
+ const fieldPrefix = field.split(".")[0];
178
+ const partyPrefix = party.replace("-", "_");
179
+ return fieldPrefix.toLowerCase() === partyPrefix.toLowerCase() || field.includes(party);
180
+ }
181
+ generateBlockId(type, index) {
182
+ return `block-${type}-${this.blockIdCounter++}`;
183
+ }
184
+ hashEmail(email) {
185
+ return crypto_1.default.createHash("sha256").update(email).digest("hex").slice(0, 12);
186
+ }
187
+ generateUUID() {
188
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
189
+ const r = (Math.random() * 16) | 0;
190
+ const v = c === "x" ? r : (r & 0x3) | 0x8;
191
+ return v.toString(16);
192
+ });
193
+ }
194
+ }
195
+ exports.FormMetadataMigrator = FormMetadataMigrator;
196
+ function migrateFormMetadata(oldForm, options) {
197
+ const migrator = new FormMetadataMigrator(options);
198
+ return migrator.migrate(oldForm);
199
+ }
200
+ function migrateFormMetadataBatch(oldForms, options) {
201
+ const migrator = new FormMetadataMigrator(options);
202
+ return oldForms.map((form) => migrator.migrate(form));
203
+ }
204
+ function isFormMetadataV0(form) {
205
+ return (form.schema_version === 0 &&
206
+ Array.isArray(form.schema) &&
207
+ Array.isArray(form.required_parties) &&
208
+ Array.isArray(form.signatories));
209
+ }
210
+ function isFormMetadataV1(form) {
211
+ return (form.schema_version === 1 &&
212
+ form.schema &&
213
+ Array.isArray(form.schema.blocks) &&
214
+ Array.isArray(form.signing_parties));
215
+ }
216
+ function autoMigrateFormMetadata(form, options) {
217
+ if (isFormMetadataV0(form)) {
218
+ return migrateFormMetadata(form, options);
219
+ }
220
+ if (isFormMetadataV1(form)) {
221
+ return form;
222
+ }
223
+ throw new Error(`Unknown form metadata version: ${form.schema_version}`);
224
+ }
225
225
  //# sourceMappingURL=form-metadata-migration.js.map
@@ -1,5 +1,5 @@
1
- export * from './lib/chat';
2
- export * from './lib/env';
3
- export * from './lib/notice';
4
- export * from './lib/email';
5
- export * from './lib/forms';
1
+ export * from './lib/chat';
2
+ export * from './lib/env';
3
+ export * from './lib/notice';
4
+ export * from './lib/email';
5
+ export * from './lib/forms';