@betterinternship/schema 1.30.0 → 1.31.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/db.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { Kysely } from "kysely";
2
2
  import { DB } from "./db.types";
3
- import { DB as _InternshipDB } from "./db.internship.types";
4
- import { DB as _DocumentDB } from "./db.doc.types";
5
- import { DB as _InternalDB } from "./db.internal.types";
6
- import { DB as _IomDB } from "./db.iom.types";
7
- export type InternshipDB = _InternshipDB;
8
- export type DocumentDB = _DocumentDB;
9
- export type InternalDB = _InternalDB;
10
- export type IomDB = _IomDB;
3
+ export type Schema = "career" | "documents" | "forms" | "internal" | "iom";
4
+ export type SchemaDB<S extends Schema> = {
5
+ [K in keyof DB as K extends `${S}.${string}` ? K : never]: DB[K];
6
+ };
7
+ export type InternshipDB = SchemaDB<"forms">;
8
+ export type DocumentDB = SchemaDB<"documents">;
9
+ export type InternalDB = SchemaDB<"internal">;
10
+ export type IomDB = SchemaDB<"iom">;
11
11
  export declare const db: Kysely<DB>;
12
- export declare const internshipDb: Kysely<_InternshipDB>;
13
- export declare const documentDb: Kysely<_DocumentDB>;
14
- export declare const internalDb: Kysely<_InternalDB>;
15
- export declare const iomDb: Kysely<_IomDB>;
12
+ export declare const internshipDb: Kysely<InternshipDB>;
13
+ export declare const documentDb: Kysely<DocumentDB>;
14
+ export declare const internalDb: Kysely<InternalDB>;
15
+ export declare const iomDb: Kysely<IomDB>;
16
16
  export declare const handleDBError: (error: any, description?: string) => never;
@@ -1,110 +1,12 @@
1
- import type { ColumnType } from "kysely";
2
- export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
3
- export type Json = JsonValue;
4
- export type JsonArray = JsonValue[];
5
- export type JsonObject = {
6
- [x: string]: JsonValue | undefined;
7
- };
8
- export type JsonPrimitive = boolean | number | string | null;
9
- export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
10
- export type Timestamp = ColumnType<Date, Date | string, Date | string>;
11
- export interface BaseDocuments {
12
- created_at: Generated<Timestamp>;
13
- id: Generated<string>;
14
- name: string;
15
- url: string;
16
- }
17
- export interface BaseImages {
18
- filename: string;
19
- id: Generated<string>;
20
- source_text: string;
21
- url: string;
22
- }
23
- export interface ExternalDocuments {
24
- code: string | null;
25
- effective_date: Timestamp | null;
26
- expiry_date: Timestamp | null;
27
- form_label: string | null;
28
- id: Generated<string>;
29
- uploaded_at: Generated<Timestamp>;
30
- url: string;
31
- }
32
- export interface FieldTemplateRegistry {
33
- field_schema_defaults: Json | null;
34
- id: Generated<string>;
35
- is_phantom: Generated<boolean>;
36
- label: string;
37
- name: string;
38
- party: Generated<string | null>;
39
- prefiller: string | null;
40
- preset: Generated<string>;
41
- shared: Generated<boolean>;
42
- source: string;
43
- tag: string | null;
44
- tooltip_label: string | null;
45
- type: Generated<string>;
46
- validator: string | null;
47
- validator_ir: Json | null;
48
- }
49
- export interface FormGroups {
50
- code: string | null;
51
- coordinator_id: string | null;
52
- description: string;
53
- forms: string[];
54
- id: Generated<string>;
55
- }
56
- export interface FormTemplateRegistry {
57
- base_document_id: string | null;
58
- created_by: string | null;
59
- form_metadata_id: Generated<string>;
60
- id: Generated<string>;
61
- label: string | null;
62
- name: string;
63
- source_kind: string | null;
64
- source_template_id: string | null;
65
- time_generated: Generated<Timestamp | null>;
66
- version: Generated<number>;
67
- }
68
- export interface PendingDocuments {
69
- audit: Json | null;
70
- base_document_id: string | null;
71
- date_made: Generated<Timestamp>;
72
- descriptors: Generated<Json>;
73
- form_label: string | null;
74
- form_name: string | null;
75
- id: Generated<string>;
76
- inputs: Generated<Json>;
77
- latest_document_url: string | null;
78
- pending_parties: Generated<Json>;
79
- signatories: Generated<Json>;
80
- subscribers: Json | null;
81
- version: number | null;
82
- }
83
- export interface SignedDocuments {
84
- base_document_id: string | null;
85
- date_made: Generated<Timestamp>;
86
- descriptors: Generated<Json>;
87
- effective_date: Timestamp | null;
88
- expiry_date: Timestamp | null;
89
- form_label: string | null;
90
- form_name: string | null;
91
- id: Generated<string>;
92
- inputs: Json | null;
93
- inputs_hash: string | null;
94
- notarized_url: string | null;
95
- schema: Json | null;
96
- schema_hash: string | null;
97
- signatories: Json | null;
98
- url: string;
99
- verification_code: string | null;
100
- }
101
- export interface DB {
102
- "documents.base_documents": BaseDocuments;
103
- "documents.base_images": BaseImages;
104
- "documents.external_documents": ExternalDocuments;
105
- "documents.field_template_registry": FieldTemplateRegistry;
106
- "documents.form_groups": FormGroups;
107
- "documents.form_template_registry": FormTemplateRegistry;
108
- "documents.pending_documents": PendingDocuments;
109
- "documents.signed_documents": SignedDocuments;
110
- }
1
+ import type { SchemaDB } from "./db";
2
+ import type { DocumentsBaseDocuments, DocumentsBaseImages, DocumentsExternalDocuments, DocumentsFieldTemplateRegistry, DocumentsFormGroups, DocumentsFormTemplateRegistry, DocumentsPendingDocuments, DocumentsSignedDocuments } from "./db.types";
3
+ export * from "./db.types";
4
+ export type DB = SchemaDB<"documents">;
5
+ export type BaseDocuments = DocumentsBaseDocuments;
6
+ export type BaseImages = DocumentsBaseImages;
7
+ export type ExternalDocuments = DocumentsExternalDocuments;
8
+ export type FieldTemplateRegistry = DocumentsFieldTemplateRegistry;
9
+ export type FormGroups = DocumentsFormGroups;
10
+ export type FormTemplateRegistry = DocumentsFormTemplateRegistry;
11
+ export type PendingDocuments = DocumentsPendingDocuments;
12
+ export type SignedDocuments = DocumentsSignedDocuments;
@@ -1,3 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./db.types"), exports);
3
18
  //# sourceMappingURL=db.doc.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"db.doc.types.js","sourceRoot":"","sources":["../lib/db.doc.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"db.doc.types.js","sourceRoot":"","sources":["../lib/db.doc.types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAsBA,6CAA2B"}
@@ -1,185 +1,3 @@
1
- import type { ColumnType } from "kysely";
2
- export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
3
- export type InternalAuthEventType = "expired" | "impersonation_ended" | "impersonation_started" | "login" | "logout" | "revoked";
4
- export type InternalAuthRealm = "company" | "employer" | "god" | "signatory" | "student" | "university";
5
- export type InternalLinkClickOutcome = "expired" | "invalid" | "revoked" | "valid";
6
- export type InternalLinkDomain = "admin" | "career_api" | "docs" | "employer" | "moa" | "student" | "uni";
7
- export type InternalMqJobStatus = "done" | "failed" | "processing" | "queued";
8
- export type InternalProcessStatus = "canceled" | "failed" | "handled" | "pending";
9
- export type InternalSocialChannel = "facebook" | "telegram";
10
- export type InternalSocialPostStatus = "cancelled" | "failed" | "posted" | "queued" | "released" | "sending" | "skipped";
11
- export type InternalTaskStatus = "failed" | "handled" | "pending" | "retrying";
12
- export type Json = JsonValue;
13
- export type JsonArray = JsonValue[];
14
- export type JsonObject = {
15
- [x: string]: JsonValue | undefined;
16
- };
17
- export type JsonPrimitive = boolean | number | string | null;
18
- export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
19
- export type Timestamp = ColumnType<Date, Date | string, Date | string>;
20
- export interface InternalAppConfig {
21
- key: string;
22
- updated_at: Generated<Timestamp>;
23
- updated_by: string | null;
24
- value: string;
25
- }
26
- export interface InternalAuthEventLog {
27
- at: Generated<Timestamp>;
28
- email: string | null;
29
- event: InternalAuthEventType;
30
- god_id: string | null;
31
- id: Generated<string>;
32
- realm: InternalAuthRealm;
33
- reason: string | null;
34
- session_id: string | null;
35
- subject_id: string;
36
- }
37
- export interface InternalAuthSessions {
38
- created_at: Generated<Timestamp>;
39
- email: string | null;
40
- expires_at: Timestamp;
41
- id: Generated<string>;
42
- impersonated_by_session_id: string | null;
43
- last_seen_at: Generated<Timestamp>;
44
- realm: InternalAuthRealm;
45
- subject_id: string;
46
- token_hash: string;
47
- }
48
- export interface InternalEmailDeliveryEvents {
49
- attempts: number | null;
50
- correlation_detail: string | null;
51
- correlation_id: string | null;
52
- correlation_type: string | null;
53
- created_at: Generated<Timestamp>;
54
- error_message: string | null;
55
- event_type: string;
56
- feedback_id: string;
57
- first_opened_at: Timestamp | null;
58
- handled_at: Timestamp | null;
59
- id: Generated<string>;
60
- message_id: string | null;
61
- open_count: Generated<number>;
62
- recipient_email: string;
63
- resolved_at: Timestamp | null;
64
- subject: string | null;
65
- }
66
- export interface InternalGodAuditLog {
67
- action: string;
68
- at: Generated<Timestamp>;
69
- god_id: string;
70
- id: Generated<string>;
71
- outcome: string;
72
- params: Json | null;
73
- session_id: string | null;
74
- target_id: string | null;
75
- target_type: string | null;
76
- }
77
- export interface InternalGods {
78
- created_at: Generated<Timestamp>;
79
- display_name: string;
80
- email: string;
81
- id: Generated<string>;
82
- is_deactivated: Generated<boolean>;
83
- preferences: Generated<Json>;
84
- }
85
- export interface InternalMqJobs {
86
- created_at: Generated<Timestamp>;
87
- error: string | null;
88
- id: Generated<string>;
89
- owner_id: string | null;
90
- progress_done: number | null;
91
- progress_failed: number | null;
92
- progress_total: number | null;
93
- result: Json | null;
94
- status: Generated<InternalMqJobStatus>;
95
- type: string;
96
- updated_at: Generated<Timestamp>;
97
- }
98
- export interface InternalProcesses {
99
- base_inputs: Generated<Json | null>;
100
- error: Json | null;
101
- id: Generated<string>;
102
- name: string;
103
- result: Json | null;
104
- status: Generated<InternalProcessStatus>;
105
- timestamp: Generated<Timestamp>;
106
- }
107
- export interface InternalRecipientLinkClicks {
108
- context: Json | null;
109
- created_at: Generated<Timestamp>;
110
- id: Generated<string>;
111
- ip: string | null;
112
- link_id: string | null;
113
- link_type: string;
114
- outcome: InternalLinkClickOutcome;
115
- recipient_id: string;
116
- user_agent: string | null;
117
- }
118
- export interface InternalSlugs {
119
- created_at: Generated<Timestamp>;
120
- destination_host: InternalLinkDomain | null;
121
- domain: InternalLinkDomain;
122
- slug: string;
123
- url: string;
124
- }
125
- export interface InternalSocialPosts {
126
- cancelled_by: string | null;
127
- channel: InternalSocialChannel;
128
- error: string | null;
129
- external_post_id: string | null;
130
- finished_at: Timestamp | null;
131
- id: Generated<string>;
132
- job_id: string;
133
- queued_at: Generated<Timestamp>;
134
- released_at: Timestamp | null;
135
- sending_at: Timestamp | null;
136
- skip_reason: string | null;
137
- status: Generated<InternalSocialPostStatus>;
138
- }
139
- export interface InternalTasks {
140
- error: string | null;
141
- handler_id: string;
142
- id: Generated<string>;
143
- inputs: Json | null;
144
- internal_id: string;
145
- parent_ids: string[] | null;
146
- process_id: string;
147
- process_name: string;
148
- result: Json | null;
149
- status: Generated<InternalTaskStatus>;
150
- timestamp: Generated<Timestamp>;
151
- }
152
- export interface InternalTestInboxes {
153
- added_by: string;
154
- created_at: Generated<Timestamp>;
155
- email: string;
156
- id: Generated<string>;
157
- kind: string;
158
- note: string | null;
159
- verified_at: Timestamp | null;
160
- }
161
- export interface InternalTestPresets {
162
- created_by: string;
163
- id: Generated<string>;
164
- name: string;
165
- panel: string;
166
- updated_at: Generated<Timestamp>;
167
- updated_by: string;
168
- values: Json;
169
- }
170
- export interface DB {
171
- "internal.app_config": InternalAppConfig;
172
- "internal.auth_event_log": InternalAuthEventLog;
173
- "internal.auth_sessions": InternalAuthSessions;
174
- "internal.email_delivery_events": InternalEmailDeliveryEvents;
175
- "internal.god_audit_log": InternalGodAuditLog;
176
- "internal.gods": InternalGods;
177
- "internal.mq_jobs": InternalMqJobs;
178
- "internal.processes": InternalProcesses;
179
- "internal.recipient_link_clicks": InternalRecipientLinkClicks;
180
- "internal.slugs": InternalSlugs;
181
- "internal.social_posts": InternalSocialPosts;
182
- "internal.tasks": InternalTasks;
183
- "internal.test_inboxes": InternalTestInboxes;
184
- "internal.test_presets": InternalTestPresets;
185
- }
1
+ import type { SchemaDB } from "./db";
2
+ export * from "./db.types";
3
+ export type DB = SchemaDB<"internal">;
@@ -1,3 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./db.types"), exports);
3
18
  //# sourceMappingURL=db.internal.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"db.internal.types.js","sourceRoot":"","sources":["../lib/db.internal.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"db.internal.types.js","sourceRoot":"","sources":["../lib/db.internal.types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAUA,6CAA2B"}
@@ -1,96 +1,3 @@
1
- import type { ColumnType } from "kysely";
2
- export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
3
- export type Json = JsonValue;
4
- export type JsonArray = JsonValue[];
5
- export type JsonObject = {
6
- [x: string]: JsonValue | undefined;
7
- };
8
- export type JsonPrimitive = boolean | number | string | null;
9
- export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
10
- export type Timestamp = ColumnType<Date, Date | string, Date | string>;
11
- export interface FormsCoordinatorAccounts {
12
- created_at: Generated<Timestamp>;
13
- email: string;
14
- forms: string[];
15
- id: Generated<string>;
16
- name: string | null;
17
- signatory_account_id: string | null;
18
- }
19
- export interface FormsFormProcesses {
20
- created_at: Generated<Timestamp>;
21
- display_information: Json | null;
22
- form_inputs: Generated<Json | null>;
23
- form_label: string | null;
24
- form_name: string;
25
- form_version: Generated<number>;
26
- id: Generated<string>;
27
- initiator_id: string | null;
28
- latest_document_url: string | null;
29
- prefilled_document_id: string | null;
30
- rejection_reason: string | null;
31
- schema_version: Generated<number>;
32
- signed_document_id: string | null;
33
- signees: Generated<Json>;
34
- signing_parties: Generated<Json>;
35
- subscribers: Generated<Json>;
36
- timestamp: Generated<Timestamp>;
37
- }
38
- export interface FormsGods {
39
- id: Generated<string>;
40
- signatory_account: Generated<string>;
41
- }
42
- export interface FormsSignatoryAccounts {
43
- auto_form_permissions: Json | null;
44
- autofill: Generated<Json | null>;
45
- created_at: Generated<Timestamp>;
46
- email: string;
47
- honorific: string | null;
48
- id: Generated<string>;
49
- name: string | null;
50
- signature: string | null;
51
- title: string | null;
52
- }
53
- export interface FormsSignatoryAudits {
54
- audit: Generated<Json>;
55
- created_at: Generated<Timestamp>;
56
- id: Generated<string>;
57
- ip_address: string | null;
58
- signatory_id: string;
59
- }
60
- export interface FormsSignatoryForms {
61
- first_viewed: Timestamp | null;
62
- form_label: string | null;
63
- form_name: string;
64
- form_process_id: string;
65
- form_process_status: string | null;
66
- id: Generated<string>;
67
- signatory_id: string | null;
68
- signing_keyring_id: string | null;
69
- signing_party_id: string | null;
70
- timestamp: Generated<Timestamp>;
71
- }
72
- export interface FormsSignatoryFormSettings {
73
- created_at: Generated<Timestamp>;
74
- form_name: string;
75
- id: Generated<string>;
76
- settings: Json;
77
- signatory_id: string;
78
- }
79
- export interface FormsSignatoryKeyring {
80
- consumed: Generated<boolean>;
81
- consumed_at: Timestamp | null;
82
- created_at: Generated<Timestamp>;
83
- hash: string;
84
- id: Generated<string>;
85
- signatory_account_id: string;
86
- }
87
- export interface DB {
88
- "forms.coordinator_accounts": FormsCoordinatorAccounts;
89
- "forms.form_processes": FormsFormProcesses;
90
- "forms.gods": FormsGods;
91
- "forms.signatory_accounts": FormsSignatoryAccounts;
92
- "forms.signatory_audits": FormsSignatoryAudits;
93
- "forms.signatory_form_settings": FormsSignatoryFormSettings;
94
- "forms.signatory_forms": FormsSignatoryForms;
95
- "forms.signatory_keyring": FormsSignatoryKeyring;
96
- }
1
+ import type { SchemaDB } from "./db";
2
+ export * from "./db.types";
3
+ export type DB = SchemaDB<"forms">;
@@ -1,3 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./db.types"), exports);
3
18
  //# sourceMappingURL=db.internship.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"db.internship.types.js","sourceRoot":"","sources":["../lib/db.internship.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"db.internship.types.js","sourceRoot":"","sources":["../lib/db.internship.types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAWA,6CAA2B"}