arocapi 0.0.0 → 1.0.4

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.
Files changed (63) hide show
  1. package/README.md +64 -0
  2. package/dist/app.d.ts +7 -0
  3. package/dist/app.js +21 -0
  4. package/dist/app.js.map +1 -0
  5. package/dist/express.d.ts +3 -0
  6. package/dist/express.js +14 -0
  7. package/dist/express.js.map +1 -0
  8. package/dist/plugins/cors.d.ts +3 -0
  9. package/dist/plugins/cors.js +6 -0
  10. package/dist/plugins/cors.js.map +1 -0
  11. package/dist/plugins/opensearch.d.ts +9 -0
  12. package/dist/plugins/opensearch.js +22 -0
  13. package/dist/plugins/opensearch.js.map +1 -0
  14. package/dist/plugins/prisma.d.ts +8 -0
  15. package/dist/plugins/prisma.js +11 -0
  16. package/dist/plugins/prisma.js.map +1 -0
  17. package/dist/plugins/sensible.d.ts +3 -0
  18. package/dist/plugins/sensible.js +6 -0
  19. package/dist/plugins/sensible.js.map +1 -0
  20. package/dist/plugins/support.d.ts +9 -0
  21. package/dist/plugins/support.js +5 -0
  22. package/dist/plugins/support.js.map +1 -0
  23. package/dist/plugins/validation.d.ts +3 -0
  24. package/dist/plugins/validation.js +32 -0
  25. package/dist/plugins/validation.js.map +1 -0
  26. package/dist/routes/entities/index.d.ts +3 -0
  27. package/dist/routes/entities/index.js +63 -0
  28. package/dist/routes/entities/index.js.map +1 -0
  29. package/dist/routes/entity/index.d.ts +3 -0
  30. package/dist/routes/entity/index.js +24 -0
  31. package/dist/routes/entity/index.js.map +1 -0
  32. package/dist/routes/search/index.d.ts +3 -0
  33. package/dist/routes/search/index.js +224 -0
  34. package/dist/routes/search/index.js.map +1 -0
  35. package/dist/scripts/loadEntities.d.ts +1 -0
  36. package/dist/scripts/loadEntities.js +170 -0
  37. package/dist/scripts/loadEntities.js.map +1 -0
  38. package/dist/type.d.ts +6 -0
  39. package/dist/type.js +2 -0
  40. package/dist/type.js.map +1 -0
  41. package/package.json +78 -5
  42. package/prisma/migrations/20250515034400_entities/migration.sql +14 -0
  43. package/prisma/migrations/20250515050009_extend_entity_fields/migration.sql +7 -0
  44. package/prisma/migrations/20250804225438_add_record_type/migration.sql +8 -0
  45. package/prisma/migrations/20250805040110_add_rocrate_field/migration.sql +2 -0
  46. package/prisma/migrations/migration_lock.toml +3 -0
  47. package/prisma/schema.prisma +36 -0
  48. package/prisma.config.ts +12 -0
  49. package/src/app.ts +40 -0
  50. package/src/express.ts +20 -0
  51. package/src/plugins/README.md +16 -0
  52. package/src/plugins/cors.ts +11 -0
  53. package/src/plugins/opensearch.ts +32 -0
  54. package/src/plugins/prisma.ts +23 -0
  55. package/src/plugins/sensible.ts +11 -0
  56. package/src/plugins/support.ts +20 -0
  57. package/src/plugins/validation.ts +48 -0
  58. package/src/routes/README.md +29 -0
  59. package/src/routes/entities/index.ts +83 -0
  60. package/src/routes/entity/index.ts +28 -0
  61. package/src/routes/search/index.ts +269 -0
  62. package/src/scripts/loadEntities.ts +223 -0
  63. package/src/type.ts +7 -0
@@ -0,0 +1,83 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+ import type { ZodTypeProvider } from 'fastify-type-provider-zod';
3
+ import { z } from 'zod/v4';
4
+ import type { EntityWhereInput } from '../../generated/prisma/models.js';
5
+
6
+ const querySchema = z.object({
7
+ memberOf: z.string().optional(),
8
+ conformsTo: z
9
+ .string()
10
+ .optional()
11
+ .transform((val) => {
12
+ if (!val) return undefined;
13
+ return val.split(',').map((item) => item.trim());
14
+ })
15
+ .pipe(
16
+ z.array(z.enum(['https://w3id.org/ldac/profile#Collection', 'https://w3id.org/ldac/profile#Object'])).optional(),
17
+ ),
18
+ limit: z.coerce.number().int().min(1).max(1000).default(100),
19
+ offset: z.coerce.number().int().min(0).default(0),
20
+ sort: z.enum(['id', 'name', 'createdAt', 'updatedAt']).default('id'),
21
+ order: z.enum(['asc', 'desc']).default('asc'),
22
+ });
23
+
24
+ const entities: FastifyPluginAsync = async (fastify, _opts) => {
25
+ fastify.withTypeProvider<ZodTypeProvider>().get(
26
+ '/',
27
+ {
28
+ schema: {
29
+ querystring: querySchema,
30
+ },
31
+ },
32
+ async (request, _reply) => {
33
+ const { memberOf, conformsTo, limit, offset, sort, order } = request.query;
34
+ console.log('🪚 request.query:', JSON.stringify(request.query, null, 2));
35
+
36
+ const where: EntityWhereInput = {};
37
+
38
+ if (memberOf) {
39
+ where.memberOf = memberOf;
40
+ }
41
+
42
+ if (conformsTo && conformsTo.length > 0) {
43
+ where.conformsTo = {
44
+ in: conformsTo,
45
+ };
46
+ }
47
+
48
+ // Map sort field to database field
49
+ const sortField = sort === 'id' ? 'rocrateId' : sort;
50
+
51
+ const dbEntities = await fastify.prisma.entity.findMany({
52
+ where,
53
+ orderBy: {
54
+ [sortField]: order,
55
+ },
56
+ skip: offset,
57
+ take: limit,
58
+ });
59
+
60
+ // Get total count for pagination metadata
61
+ const total = await fastify.prisma.entity.count({ where });
62
+
63
+ const entities = dbEntities.map((entity) => ({
64
+ id: entity.rocrateId,
65
+ name: entity.name,
66
+ description: entity.description,
67
+ conformsTo: entity.conformsTo,
68
+ recordType: entity.recordType,
69
+ memberOf: entity.memberOf,
70
+ root: entity.root,
71
+ createdAt: entity.createdAt,
72
+ updatedAt: entity.updatedAt,
73
+ }));
74
+
75
+ return {
76
+ total,
77
+ entities,
78
+ };
79
+ },
80
+ );
81
+ };
82
+
83
+ export default entities;
@@ -0,0 +1,28 @@
1
+ import type { FastifyPluginAsync } from 'fastify';
2
+
3
+ const entity: FastifyPluginAsync = async (fastify, _opts) => {
4
+ fastify.get<{ Params: { id: string } }>('/:id', async (request, reply) => {
5
+ const { id } = request.params;
6
+ console.log('🪚 request:', request);
7
+
8
+ try {
9
+ const entity = await fastify.prisma.entity.findFirst({
10
+ where: {
11
+ rocrateId: id,
12
+ },
13
+ });
14
+ console.log('🪚 id:', JSON.stringify(id, null, 2));
15
+
16
+ if (!entity) {
17
+ return reply.code(404).send({ message: 'Entity not found' });
18
+ }
19
+
20
+ return entity.rocrate;
21
+ } catch (error) {
22
+ fastify.log.error('Database error:', error);
23
+ return reply.code(500).send({ message: 'Internal server error' });
24
+ }
25
+ });
26
+ };
27
+
28
+ export default entity;
@@ -0,0 +1,269 @@
1
+ import type { MultiBucketAggregateBaseFiltersBucket } from '@opensearch-project/opensearch/api/_types/_common.aggregations.js';
2
+ import type { BoolQuery } from '@opensearch-project/opensearch/api/_types/_common.query_dsl.js';
3
+ import type { Search_Request, Search_RequestBody } from '@opensearch-project/opensearch/api/index.js';
4
+ import type { FastifyPluginAsync } from 'fastify';
5
+ import type { ZodTypeProvider } from 'fastify-type-provider-zod';
6
+ import { z } from 'zod/v4';
7
+
8
+ const boundingBoxSchema = z.object({
9
+ topRight: z.object({
10
+ lat: z.number(),
11
+ lng: z.number(),
12
+ }),
13
+ bottomLeft: z.object({
14
+ lat: z.number(),
15
+ lng: z.number(),
16
+ }),
17
+ });
18
+
19
+ const searchParamsSchema = z.object({
20
+ searchType: z.enum(['basic', 'advanced']).default('basic'),
21
+ query: z.string(),
22
+ filters: z.record(z.string(), z.array(z.string())).optional(),
23
+ boundingBox: boundingBoxSchema.optional(),
24
+ geohashPrecision: z.number().int().min(0).max(12).default(5),
25
+ limit: z.number().int().min(1).max(1000).default(100),
26
+ offset: z.number().int().min(0).default(0),
27
+ sort: z.enum(['id', 'name', 'createdAt', 'updatedAt', 'relevance']).default('relevance'),
28
+ order: z.enum(['asc', 'desc']).default('asc'),
29
+ });
30
+ type SearchParams = z.infer<typeof searchParamsSchema>;
31
+
32
+ const buildQuery = (
33
+ searchType: SearchParams['searchType'],
34
+ query: SearchParams['query'],
35
+ filters: SearchParams['filters'],
36
+ boundingBox: SearchParams['boundingBox'],
37
+ ) => {
38
+ const must: BoolQuery['must'] = [];
39
+ const filter: BoolQuery['filter'] = [];
40
+
41
+ if (searchType === 'basic') {
42
+ must.push({
43
+ multi_match: {
44
+ query,
45
+ fields: ['name^2', 'description'],
46
+ type: 'best_fields',
47
+ fuzziness: 'AUTO',
48
+ },
49
+ });
50
+ } else {
51
+ must.push({
52
+ query_string: {
53
+ query,
54
+ fields: ['name^2', 'description'],
55
+ default_operator: 'AND',
56
+ },
57
+ });
58
+ }
59
+
60
+ if (filters) {
61
+ Object.entries(filters).forEach(([field, values]) => {
62
+ filter.push({
63
+ terms: {
64
+ [field]: values,
65
+ },
66
+ });
67
+ });
68
+ }
69
+
70
+ if (boundingBox) {
71
+ filter.push({
72
+ geo_bounding_box: {
73
+ location: {
74
+ top_left: {
75
+ lat: boundingBox.topRight.lat,
76
+ lon: boundingBox.bottomLeft.lng,
77
+ },
78
+ bottom_right: {
79
+ lat: boundingBox.bottomLeft.lat,
80
+ lon: boundingBox.topRight.lng,
81
+ },
82
+ },
83
+ },
84
+ });
85
+ }
86
+
87
+ return {
88
+ bool: {
89
+ must,
90
+ filter,
91
+ },
92
+ };
93
+ };
94
+
95
+ // TODO: Pull these from a config file
96
+ const buildAggregations = (
97
+ geohashPrecision: SearchParams['geohashPrecision'],
98
+ boundingBox: SearchParams['boundingBox'],
99
+ ) => {
100
+ const aggs: Search_RequestBody['aggs'] = {
101
+ inLanguage: {
102
+ terms: {
103
+ field: 'inLanguage',
104
+ size: 20,
105
+ },
106
+ },
107
+ mediaType: {
108
+ terms: {
109
+ field: 'mediaType',
110
+ size: 20,
111
+ },
112
+ },
113
+ communicationMode: {
114
+ terms: {
115
+ field: 'communicationMode',
116
+ size: 20,
117
+ },
118
+ },
119
+ conformsTo: {
120
+ terms: {
121
+ field: 'conformsTo',
122
+ size: 20,
123
+ },
124
+ },
125
+ };
126
+
127
+ // Add geohash aggregation if precision is specified
128
+ if (geohashPrecision && boundingBox) {
129
+ aggs.geohash_grid = {
130
+ geohash_grid: {
131
+ field: 'location',
132
+ precision: geohashPrecision,
133
+ bounds: {
134
+ top_left: {
135
+ lat: boundingBox.topRight.lat,
136
+ lon: boundingBox.bottomLeft.lng,
137
+ },
138
+ bottom_right: {
139
+ lat: boundingBox.bottomLeft.lat,
140
+ lon: boundingBox.topRight.lng,
141
+ },
142
+ },
143
+ },
144
+ };
145
+ }
146
+
147
+ return aggs;
148
+ };
149
+
150
+ const buildSort = (sort: SearchParams['sort'], order: SearchParams['order']) => {
151
+ if (sort === 'relevance') {
152
+ return;
153
+ }
154
+
155
+ const sortField = sort === 'id' ? 'rocrateId' : sort;
156
+
157
+ if (sortField === 'name') {
158
+ return [{ 'name.keyword': order }];
159
+ }
160
+
161
+ return [{ [sortField]: order }];
162
+ };
163
+
164
+ const search: FastifyPluginAsync = async (fastify, _opts) => {
165
+ fastify.withTypeProvider<ZodTypeProvider>().post(
166
+ '/',
167
+ {
168
+ schema: {
169
+ body: searchParamsSchema,
170
+ },
171
+ },
172
+ async (request, reply) => {
173
+ const { searchType, query, filters, boundingBox, geohashPrecision, limit, offset, sort, order } = request.body;
174
+
175
+ try {
176
+ const opensearchQuery: Search_Request = {
177
+ index: 'entities',
178
+ body: {
179
+ query: buildQuery(searchType, query, filters, boundingBox),
180
+ aggs: buildAggregations(geohashPrecision, boundingBox),
181
+ highlight: {
182
+ fields: {
183
+ name: {},
184
+ description: {},
185
+ },
186
+ },
187
+ sort: buildSort(sort, order),
188
+ from: offset,
189
+ size: limit,
190
+ },
191
+ };
192
+
193
+ const response = await fastify.opensearch.search(opensearchQuery);
194
+
195
+ // Transform response
196
+
197
+ const entities = response.body.hits.hits.map((hit) => {
198
+ if (!hit._source) {
199
+ throw new Error('Missing _source in search hit');
200
+ }
201
+ return {
202
+ id: hit._source.rocrateId,
203
+ name: hit._source.name,
204
+ description: hit._source.description,
205
+ conformsTo: hit._source.conformsTo,
206
+ recordType: hit._source.recordType,
207
+ memberOf: hit._source.memberOf,
208
+ root: hit._source.root,
209
+ createdAt: hit._source.createdAt,
210
+ updatedAt: hit._source.updatedAt,
211
+ searchExtra: {
212
+ score: hit._score,
213
+ highlight: hit.highlight,
214
+ },
215
+ };
216
+ });
217
+
218
+ const facets: Record<string, Array<{ name: string; count: number }>> = {};
219
+ if (response.body.aggregations) {
220
+ Object.keys(response.body.aggregations).forEach((key) => {
221
+ if (key !== 'geohash_grid') {
222
+ const agg = response.body.aggregations?.[key] as MultiBucketAggregateBaseFiltersBucket;
223
+ if (agg?.buckets && Array.isArray(agg.buckets)) {
224
+ facets[key] = agg.buckets.map((bucket) => ({
225
+ name: bucket.key,
226
+ count: bucket.doc_count,
227
+ }));
228
+ }
229
+ }
230
+ });
231
+ }
232
+
233
+ let geohashGrid: Record<string, number> | undefined;
234
+ if (response.body.aggregations?.geohash_grid) {
235
+ const geohashAgg = response.body.aggregations.geohash_grid as MultiBucketAggregateBaseFiltersBucket;
236
+ if (geohashAgg?.buckets && Array.isArray(geohashAgg.buckets)) {
237
+ geohashAgg.buckets.forEach((bucket) => {
238
+ geohashGrid ||= {};
239
+ geohashGrid[bucket.key] = bucket.doc_count;
240
+ });
241
+ }
242
+ }
243
+
244
+ const total =
245
+ typeof response.body.hits.total === 'number'
246
+ ? response.body.hits.total
247
+ : response.body.hits.total?.value || 0;
248
+
249
+ const result = {
250
+ total,
251
+ searchTime: response.body.took,
252
+ entities,
253
+ facets: Object.keys(facets).length > 0 ? facets : undefined,
254
+ geohashGrid,
255
+ };
256
+
257
+ return result;
258
+ } catch (error) {
259
+ const err = error as Error;
260
+ console.error(err);
261
+ fastify.log.error('Search error:', err.message);
262
+
263
+ return reply.code(500).send({ message: 'Search failed' });
264
+ }
265
+ },
266
+ );
267
+ };
268
+
269
+ export default search;
@@ -0,0 +1,223 @@
1
+ import { Client } from '@opensearch-project/opensearch';
2
+ import { PrismaClient } from '../generated/prisma/client.js';
3
+
4
+ const prisma = new PrismaClient();
5
+
6
+ if (!process.env.OPENSEARCH_URL) {
7
+ throw new Error('OPENSEARCH_URL environment variable is not set');
8
+ }
9
+
10
+ // Initialize OpenSearch client
11
+ const opensearch = new Client({
12
+ node: process.env.OPENSEARCH_URL,
13
+ });
14
+
15
+ const INDEX_NAME = 'entities';
16
+
17
+ const BATCH_SIZE = 100;
18
+ const TOTAL_RECORDS = 1000;
19
+ const API_URL = 'https://catalog.paradisec.org.au/api/v1/oni';
20
+
21
+ interface EntityResponse {
22
+ total: number;
23
+ entities: {
24
+ id: string;
25
+ name: string;
26
+ description: string;
27
+ conformsTo: string;
28
+ recordType: string[];
29
+ memberOf?: string;
30
+ root?: string;
31
+ // extra: Record<string, any>;
32
+ // searchExtra: Record<string, any>;
33
+ }[];
34
+ }
35
+
36
+ const fetchEntities = async (limit: number, offset: number) => {
37
+ const url = `${API_URL}/entities?limit=${limit}&offset=${offset}`;
38
+ console.log(`Fetching ${url}`);
39
+
40
+ const response = await fetch(url);
41
+ if (!response.ok) {
42
+ throw new Error(`API request failed with status ${response.status}`);
43
+ }
44
+
45
+ const result = (await response.json()) as EntityResponse;
46
+
47
+ return result;
48
+ };
49
+
50
+ const fetchEntityRocrate = async (entityId: string) => {
51
+ const url = `${API_URL}/entity/${encodeURIComponent(entityId)}`;
52
+ console.log(`Fetching ROCrate for ${entityId}`);
53
+
54
+ const response = await fetch(url);
55
+ if (!response.ok) {
56
+ throw new Error(`ROCrate API request failed with status ${response.status} for entity ${entityId}`);
57
+ }
58
+
59
+ const rocrate = await response.json();
60
+ return rocrate;
61
+ };
62
+
63
+ const generateDummyData = () => {
64
+ const languages = ['English', 'Japanese', 'French', 'Spanish', 'German', 'Italian'];
65
+ const mediaTypes = ['audio/wav', 'audio/mp3', 'video/mp4', 'text/plain', 'image/jpeg'];
66
+ const communicationModes = ['SpokenLanguage', 'WrittenLanguage', 'SignedLanguage', 'Song'];
67
+
68
+ // Australian bounding box coordinates
69
+ const lat = -25 + (Math.random() - 0.5) * 20; // -35 to -15
70
+ const lng = 134 + (Math.random() - 0.5) * 40; // 114 to 154
71
+
72
+ return {
73
+ inLanguage: languages[Math.floor(Math.random() * languages.length)],
74
+ mediaType: mediaTypes[Math.floor(Math.random() * mediaTypes.length)],
75
+ communicationMode: communicationModes[Math.floor(Math.random() * communicationModes.length)],
76
+ location: {
77
+ lat,
78
+ lon: lng,
79
+ },
80
+ };
81
+ };
82
+
83
+ const createIndex = async () => {
84
+ try {
85
+ const indexExists = await opensearch.indices.exists({ index: INDEX_NAME });
86
+
87
+ if (indexExists.body) {
88
+ console.log(`Index ${INDEX_NAME} already exists, deleting...`);
89
+ await opensearch.indices.delete({ index: INDEX_NAME });
90
+ }
91
+
92
+ console.log(`Creating index ${INDEX_NAME}...`);
93
+ await opensearch.indices.create({
94
+ index: INDEX_NAME,
95
+ body: {
96
+ mappings: {
97
+ properties: {
98
+ rocrateId: { type: 'keyword' },
99
+ name: {
100
+ type: 'text',
101
+ fields: {
102
+ keyword: { type: 'keyword' },
103
+ },
104
+ },
105
+ description: { type: 'text' },
106
+ conformsTo: { type: 'keyword' },
107
+ recordType: { type: 'keyword' },
108
+ memberOf: { type: 'keyword' },
109
+ root: { type: 'keyword' },
110
+ inLanguage: { type: 'keyword' },
111
+ mediaType: { type: 'keyword' },
112
+ communicationMode: { type: 'keyword' },
113
+ location: { type: 'geo_point' },
114
+ createdAt: { type: 'date' },
115
+ updatedAt: { type: 'date' },
116
+ rocrate: { type: 'text' },
117
+ },
118
+ },
119
+ },
120
+ });
121
+
122
+ console.log('Index created successfully');
123
+ } catch (error) {
124
+ console.error('Error creating index:', error);
125
+ throw error;
126
+ }
127
+ };
128
+
129
+ // Index entity to OpenSearch
130
+ // biome-ignore lint/suspicious/noExplicitAny: FIXME
131
+ const indexEntity = async (entity: any, dummyData: any, rocrate: any) => {
132
+ const document = {
133
+ rocrateId: entity.id,
134
+ name: entity.name,
135
+ description: entity.description,
136
+ conformsTo: entity.conformsTo,
137
+ recordType: entity.recordType,
138
+ memberOf: entity.memberOf || null,
139
+ root: entity.root || null,
140
+ inLanguage: dummyData.inLanguage,
141
+ mediaType: dummyData.mediaType,
142
+ communicationMode: dummyData.communicationMode,
143
+ location: dummyData.location,
144
+ createdAt: new Date().toISOString(),
145
+ updatedAt: new Date().toISOString(),
146
+ rocrate: JSON.stringify(rocrate),
147
+ };
148
+
149
+ await opensearch.index({
150
+ index: INDEX_NAME,
151
+ id: entity.id,
152
+ body: document,
153
+ });
154
+ };
155
+
156
+ const loadEntities = async (): Promise<void> => {
157
+ try {
158
+ console.log('Starting to load entities...');
159
+ await prisma.$connect();
160
+
161
+ await createIndex();
162
+
163
+ let processedCount = 0;
164
+
165
+ while (processedCount < TOTAL_RECORDS) {
166
+ const remainingToFetch = Math.min(BATCH_SIZE, TOTAL_RECORDS - processedCount);
167
+ const data = await fetchEntities(remainingToFetch, processedCount);
168
+
169
+ console.log(
170
+ `Fetched ${data.entities.length} entities (${processedCount + data.entities.length}/${TOTAL_RECORDS})`,
171
+ );
172
+
173
+ for (const entity of data.entities) {
174
+ const dummyData = generateDummyData();
175
+
176
+ // Fetch ROCrate data for this entity
177
+ const rocrate = await fetchEntityRocrate(entity.id);
178
+
179
+ await prisma.entity.create({
180
+ data: {
181
+ rocrateId: entity.id,
182
+ name: entity.name,
183
+ description: entity.description,
184
+ conformsTo: entity.conformsTo,
185
+ memberOf: entity.memberOf || null,
186
+ root: entity.root || null,
187
+ recordType: entity.recordType,
188
+ rocrate: rocrate,
189
+ },
190
+ });
191
+
192
+ await indexEntity(entity, dummyData, rocrate);
193
+ }
194
+
195
+ processedCount += data.entities.length;
196
+ console.log(`Processed ${processedCount}/${TOTAL_RECORDS} entities`);
197
+
198
+ if (data.entities.length < remainingToFetch) {
199
+ console.log('Reached the end of available entities');
200
+ break;
201
+ }
202
+ }
203
+
204
+ await opensearch.indices.refresh({ index: INDEX_NAME });
205
+
206
+ console.log(`Successfully loaded ${processedCount} entities into database and OpenSearch`);
207
+ } catch (error) {
208
+ console.error('Error loading entities:', error);
209
+ process.exit(1);
210
+ } finally {
211
+ await prisma.$disconnect();
212
+ }
213
+ };
214
+
215
+ loadEntities()
216
+ .then(() => {
217
+ console.log('Script completed successfully');
218
+ process.exit(0);
219
+ })
220
+ .catch((error) => {
221
+ console.error('Script failed:', error);
222
+ process.exit(1);
223
+ });
package/src/type.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare global {
2
+ namespace PrismaJson {
3
+ type RecordType = 'DataSet' | ' RepositoryCollection' | ' RepositoryObject';
4
+ }
5
+ }
6
+
7
+ export {};