@ankhorage/contracts 1.15.0 → 1.17.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/CHANGELOG.md +12 -0
- package/README.md +26 -5
- package/dist/data/apis.d.ts +76 -0
- package/dist/data/apis.d.ts.map +1 -0
- package/dist/data/apis.js +20 -0
- package/dist/data/apis.js.map +1 -0
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/nutrition/capture.d.ts +54 -0
- package/dist/nutrition/capture.d.ts.map +1 -0
- package/dist/nutrition/capture.js +8 -0
- package/dist/nutrition/capture.js.map +1 -0
- package/dist/nutrition/common.d.ts +22 -0
- package/dist/nutrition/common.d.ts.map +1 -0
- package/dist/nutrition/common.js +25 -0
- package/dist/nutrition/common.js.map +1 -0
- package/dist/nutrition/index.d.ts +5 -0
- package/dist/nutrition/index.d.ts.map +1 -0
- package/dist/nutrition/index.js +5 -0
- package/dist/nutrition/index.js.map +1 -0
- package/dist/nutrition/products.d.ts +93 -0
- package/dist/nutrition/products.d.ts.map +1 -0
- package/dist/nutrition/products.js +9 -0
- package/dist/nutrition/products.js.map +1 -0
- package/dist/nutrition/review.d.ts +47 -0
- package/dist/nutrition/review.d.ts.map +1 -0
- package/dist/nutrition/review.js +8 -0
- package/dist/nutrition/review.js.map +1 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -1
- package/package.json +5 -1
- package/src/contracts.test.ts +0 -49
- package/src/data/apis.test.ts +146 -0
- package/src/data/apis.ts +105 -0
- package/src/data/index.ts +1 -1
- package/src/index.ts +1 -0
- package/src/nutrition/capture.ts +80 -0
- package/src/nutrition/common.ts +51 -0
- package/src/nutrition/index.ts +4 -0
- package/src/nutrition/nutrition.test.ts +137 -0
- package/src/nutrition/products.ts +134 -0
- package/src/nutrition/review.ts +65 -0
- package/src/profile-contract.test.ts +33 -0
- package/src/types.ts +13 -0
- package/dist/data/datasets.d.ts +0 -20
- package/dist/data/datasets.d.ts.map +0 -1
- package/dist/data/datasets.js +0 -2
- package/dist/data/datasets.js.map +0 -1
- package/src/data/datasets.ts +0 -24
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
NUTRITION_BARCODE_TYPES,
|
|
5
|
+
NUTRITION_CAPTURE_SUBMISSION_STATUSES,
|
|
6
|
+
NUTRITION_DATA_SOURCES,
|
|
7
|
+
NUTRITION_PRODUCT_STATUSES,
|
|
8
|
+
NUTRITION_REVIEW_DECISIONS,
|
|
9
|
+
type NutritionCaptureSubmission,
|
|
10
|
+
type NutritionProduct,
|
|
11
|
+
type NutritionProductCaptureRequest,
|
|
12
|
+
type NutritionReviewDecisionRequest,
|
|
13
|
+
} from './index';
|
|
14
|
+
|
|
15
|
+
describe('nutrition contracts', () => {
|
|
16
|
+
it('exports stable literal unions for nutrition workflows', () => {
|
|
17
|
+
expect(NUTRITION_BARCODE_TYPES).toEqual([
|
|
18
|
+
'ean_8',
|
|
19
|
+
'ean_13',
|
|
20
|
+
'upc_a',
|
|
21
|
+
'upc_e',
|
|
22
|
+
'gtin_14',
|
|
23
|
+
'unknown',
|
|
24
|
+
]);
|
|
25
|
+
expect(NUTRITION_PRODUCT_STATUSES).toEqual([
|
|
26
|
+
'draft',
|
|
27
|
+
'pending_review',
|
|
28
|
+
'published',
|
|
29
|
+
'rejected',
|
|
30
|
+
'archived',
|
|
31
|
+
]);
|
|
32
|
+
expect(NUTRITION_DATA_SOURCES).toEqual([
|
|
33
|
+
'manual_scan',
|
|
34
|
+
'user_correction',
|
|
35
|
+
'open_food_facts',
|
|
36
|
+
'foodrepo_legacy',
|
|
37
|
+
'retailer_import',
|
|
38
|
+
'admin_import',
|
|
39
|
+
]);
|
|
40
|
+
expect(NUTRITION_CAPTURE_SUBMISSION_STATUSES).toEqual([
|
|
41
|
+
'queued',
|
|
42
|
+
'needs_more_data',
|
|
43
|
+
'accepted',
|
|
44
|
+
'rejected',
|
|
45
|
+
'merged',
|
|
46
|
+
]);
|
|
47
|
+
expect(NUTRITION_REVIEW_DECISIONS).toEqual([
|
|
48
|
+
'accept',
|
|
49
|
+
'reject',
|
|
50
|
+
'merge',
|
|
51
|
+
'request_changes',
|
|
52
|
+
'publish',
|
|
53
|
+
]);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('serializes a published barcode product', () => {
|
|
57
|
+
const product: NutritionProduct = {
|
|
58
|
+
id: 'product_01',
|
|
59
|
+
primaryBarcode: {
|
|
60
|
+
value: '7612345678901',
|
|
61
|
+
type: 'ean_13',
|
|
62
|
+
normalizedValue: '7612345678901',
|
|
63
|
+
},
|
|
64
|
+
name: 'Example Yogurt Nature',
|
|
65
|
+
brand: 'Example Brand',
|
|
66
|
+
quantity: '250 g',
|
|
67
|
+
packageSizeG: 250,
|
|
68
|
+
serving: { label: '1 cup', sizeG: 250, servingsPerPackage: 1 },
|
|
69
|
+
nutrientsPer100g: {
|
|
70
|
+
basis: 'per_100g',
|
|
71
|
+
energyKcal: 62,
|
|
72
|
+
energyKj: 260,
|
|
73
|
+
proteinG: 11,
|
|
74
|
+
carbohydratesG: 3.8,
|
|
75
|
+
sugarsG: 3.8,
|
|
76
|
+
fatG: 0.2,
|
|
77
|
+
saturatedFatG: 0.1,
|
|
78
|
+
fiberG: 0,
|
|
79
|
+
saltG: 0.1,
|
|
80
|
+
sodiumG: 0.04,
|
|
81
|
+
},
|
|
82
|
+
ingredients: { locale: 'de-CH', text: 'Milk, cultures.' },
|
|
83
|
+
allergens: ['milk'],
|
|
84
|
+
stores: [{ countryCode: 'CH', storeChain: 'Example Store' }],
|
|
85
|
+
images: [{ kind: 'nutrition_label', path: 'labels/7612345678901.jpg' }],
|
|
86
|
+
status: 'published',
|
|
87
|
+
source: 'manual_scan',
|
|
88
|
+
sourceConfidence: 'high',
|
|
89
|
+
verifiedByUser: true,
|
|
90
|
+
createdAt: '2026-06-01T12:00:00.000Z',
|
|
91
|
+
updatedAt: '2026-06-01T12:05:00.000Z',
|
|
92
|
+
publishedAt: '2026-06-01T12:10:00.000Z',
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
expect(JSON.parse(JSON.stringify(product))).toEqual(product);
|
|
96
|
+
expect(product.nutrientsPer100g?.proteinG).toBe(11);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('serializes capture submissions and review decisions', () => {
|
|
100
|
+
const capture: NutritionProductCaptureRequest = {
|
|
101
|
+
draft: {
|
|
102
|
+
barcode: { value: '7612345678901', type: 'ean_13' },
|
|
103
|
+
name: 'Example Yogurt Nature',
|
|
104
|
+
nutrientsPer100g: { energyKcal: 62, proteinG: 11 },
|
|
105
|
+
storeObservation: { countryCode: 'CH', storeChain: 'Example Store' },
|
|
106
|
+
rawPayload: { source: 'manual' },
|
|
107
|
+
},
|
|
108
|
+
client: {
|
|
109
|
+
anonymousDeviceId: 'device-1',
|
|
110
|
+
platform: 'ios',
|
|
111
|
+
appVersion: '0.1.0',
|
|
112
|
+
clientCapturedAt: '2026-06-01T12:00:00.000Z',
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const submission: NutritionCaptureSubmission = {
|
|
117
|
+
id: 'submission_01',
|
|
118
|
+
status: 'queued',
|
|
119
|
+
draft: capture.draft,
|
|
120
|
+
client: capture.client,
|
|
121
|
+
matchedProductId: null,
|
|
122
|
+
createdAt: '2026-06-01T12:00:00.000Z',
|
|
123
|
+
updatedAt: '2026-06-01T12:00:00.000Z',
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const decision: NutritionReviewDecisionRequest = {
|
|
127
|
+
submissionId: submission.id,
|
|
128
|
+
decision: 'accept',
|
|
129
|
+
reviewerId: 'reviewer-1',
|
|
130
|
+
note: 'Readable label.',
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
expect(JSON.parse(JSON.stringify(capture))).toEqual(capture);
|
|
134
|
+
expect(JSON.parse(JSON.stringify(submission))).toEqual(submission);
|
|
135
|
+
expect(decision.decision).toBe('accept');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NutritionBarcode,
|
|
3
|
+
NutritionDataSource,
|
|
4
|
+
NutritionIsoDateTime,
|
|
5
|
+
NutritionJsonValue,
|
|
6
|
+
NutritionProductId,
|
|
7
|
+
NutritionProductStatus,
|
|
8
|
+
NutritionSourceConfidence,
|
|
9
|
+
} from './common';
|
|
10
|
+
|
|
11
|
+
export type NutritionMeasurementBasis = 'per_100g' | 'per_100ml';
|
|
12
|
+
|
|
13
|
+
export interface NutritionFactsPer100g {
|
|
14
|
+
readonly basis?: NutritionMeasurementBasis;
|
|
15
|
+
readonly energyKcal?: number;
|
|
16
|
+
readonly energyKj?: number;
|
|
17
|
+
readonly proteinG?: number;
|
|
18
|
+
readonly carbohydratesG?: number;
|
|
19
|
+
readonly sugarsG?: number;
|
|
20
|
+
readonly fatG?: number;
|
|
21
|
+
readonly saturatedFatG?: number;
|
|
22
|
+
readonly fiberG?: number;
|
|
23
|
+
readonly saltG?: number;
|
|
24
|
+
readonly sodiumG?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface NutritionServing {
|
|
28
|
+
readonly label?: string;
|
|
29
|
+
readonly sizeG?: number;
|
|
30
|
+
readonly sizeMl?: number;
|
|
31
|
+
readonly servingsPerPackage?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface NutritionIngredientStatement {
|
|
35
|
+
readonly text?: string;
|
|
36
|
+
readonly locale?: string;
|
|
37
|
+
readonly rawText?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type NutritionAllergenTag =
|
|
41
|
+
| 'celery'
|
|
42
|
+
| 'cereals_containing_gluten'
|
|
43
|
+
| 'crustaceans'
|
|
44
|
+
| 'eggs'
|
|
45
|
+
| 'fish'
|
|
46
|
+
| 'lupin'
|
|
47
|
+
| 'milk'
|
|
48
|
+
| 'molluscs'
|
|
49
|
+
| 'mustard'
|
|
50
|
+
| 'nuts'
|
|
51
|
+
| 'peanuts'
|
|
52
|
+
| 'sesame'
|
|
53
|
+
| 'soybeans'
|
|
54
|
+
| 'sulphur_dioxide_and_sulphites'
|
|
55
|
+
| (string & {});
|
|
56
|
+
|
|
57
|
+
export interface NutritionStoreObservation {
|
|
58
|
+
readonly countryCode?: string;
|
|
59
|
+
readonly storeChain?: string;
|
|
60
|
+
readonly storeName?: string;
|
|
61
|
+
readonly storeLocationLabel?: string;
|
|
62
|
+
readonly observedAt?: NutritionIsoDateTime;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const NUTRITION_IMAGE_KINDS = [
|
|
66
|
+
'front',
|
|
67
|
+
'nutrition_label',
|
|
68
|
+
'ingredients',
|
|
69
|
+
'barcode',
|
|
70
|
+
'package_back',
|
|
71
|
+
'other',
|
|
72
|
+
] as const;
|
|
73
|
+
export type NutritionImageKind = (typeof NUTRITION_IMAGE_KINDS)[number];
|
|
74
|
+
|
|
75
|
+
export interface NutritionImageEvidence {
|
|
76
|
+
readonly id?: string;
|
|
77
|
+
readonly kind: NutritionImageKind;
|
|
78
|
+
readonly storageId?: string;
|
|
79
|
+
readonly bucket?: string;
|
|
80
|
+
readonly path?: string;
|
|
81
|
+
readonly publicUrl?: string;
|
|
82
|
+
readonly contentType?: string;
|
|
83
|
+
readonly width?: number;
|
|
84
|
+
readonly height?: number;
|
|
85
|
+
readonly capturedAt?: NutritionIsoDateTime;
|
|
86
|
+
readonly metadata?: Record<string, NutritionJsonValue>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface NutritionProductSummary {
|
|
90
|
+
readonly id: NutritionProductId;
|
|
91
|
+
readonly primaryBarcode: NutritionBarcode;
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly brand?: string;
|
|
94
|
+
readonly quantity?: string;
|
|
95
|
+
readonly status: NutritionProductStatus;
|
|
96
|
+
readonly source: NutritionDataSource;
|
|
97
|
+
readonly sourceConfidence: NutritionSourceConfidence;
|
|
98
|
+
readonly imageUrl?: string;
|
|
99
|
+
readonly updatedAt: NutritionIsoDateTime;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface NutritionProduct {
|
|
103
|
+
readonly id: NutritionProductId;
|
|
104
|
+
readonly primaryBarcode: NutritionBarcode;
|
|
105
|
+
readonly barcodes?: readonly NutritionBarcode[];
|
|
106
|
+
readonly name: string;
|
|
107
|
+
readonly brand?: string;
|
|
108
|
+
readonly quantity?: string;
|
|
109
|
+
readonly packageSizeG?: number;
|
|
110
|
+
readonly packageSizeMl?: number;
|
|
111
|
+
readonly serving?: NutritionServing;
|
|
112
|
+
readonly nutrientsPer100g?: NutritionFactsPer100g;
|
|
113
|
+
readonly ingredients?: NutritionIngredientStatement;
|
|
114
|
+
readonly allergens?: readonly NutritionAllergenTag[];
|
|
115
|
+
readonly traces?: readonly NutritionAllergenTag[];
|
|
116
|
+
readonly stores?: readonly NutritionStoreObservation[];
|
|
117
|
+
readonly images?: readonly NutritionImageEvidence[];
|
|
118
|
+
readonly status: NutritionProductStatus;
|
|
119
|
+
readonly source: NutritionDataSource;
|
|
120
|
+
readonly sourceConfidence: NutritionSourceConfidence;
|
|
121
|
+
readonly sourcePayload?: NutritionJsonValue;
|
|
122
|
+
readonly verifiedByUser?: boolean;
|
|
123
|
+
readonly createdAt: NutritionIsoDateTime;
|
|
124
|
+
readonly updatedAt: NutritionIsoDateTime;
|
|
125
|
+
readonly publishedAt?: NutritionIsoDateTime | null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface NutritionProductDetail {
|
|
129
|
+
readonly product: NutritionProduct;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface NutritionProductLookupByBarcodeResponse {
|
|
133
|
+
readonly product: NutritionProduct;
|
|
134
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { NutritionCaptureSubmission, NutritionCaptureSubmissionStatus } from './capture';
|
|
2
|
+
import type {
|
|
3
|
+
NutritionCaptureSubmissionId,
|
|
4
|
+
NutritionIsoDateTime,
|
|
5
|
+
NutritionJsonValue,
|
|
6
|
+
NutritionProductId,
|
|
7
|
+
NutritionReviewId,
|
|
8
|
+
NutritionUserId,
|
|
9
|
+
} from './common';
|
|
10
|
+
import type { NutritionProduct } from './products';
|
|
11
|
+
|
|
12
|
+
export const NUTRITION_REVIEW_DECISIONS = [
|
|
13
|
+
'accept',
|
|
14
|
+
'reject',
|
|
15
|
+
'merge',
|
|
16
|
+
'request_changes',
|
|
17
|
+
'publish',
|
|
18
|
+
] as const;
|
|
19
|
+
export type NutritionReviewDecision = (typeof NUTRITION_REVIEW_DECISIONS)[number];
|
|
20
|
+
|
|
21
|
+
export interface NutritionReviewDecisionRequest {
|
|
22
|
+
readonly decision: NutritionReviewDecision;
|
|
23
|
+
readonly submissionId: NutritionCaptureSubmissionId;
|
|
24
|
+
readonly reviewerId?: NutritionUserId;
|
|
25
|
+
readonly targetProductId?: NutritionProductId;
|
|
26
|
+
readonly productOverride?: Partial<NutritionProduct>;
|
|
27
|
+
readonly note?: string;
|
|
28
|
+
readonly metadata?: Record<string, NutritionJsonValue>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface NutritionReviewDecisionResponse {
|
|
32
|
+
readonly reviewId: NutritionReviewId;
|
|
33
|
+
readonly submissionId: NutritionCaptureSubmissionId;
|
|
34
|
+
readonly decision: NutritionReviewDecision;
|
|
35
|
+
readonly status: NutritionCaptureSubmissionStatus;
|
|
36
|
+
readonly productId?: NutritionProductId;
|
|
37
|
+
readonly decidedAt: NutritionIsoDateTime;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface NutritionReviewRecord {
|
|
41
|
+
readonly id: NutritionReviewId;
|
|
42
|
+
readonly submissionId: NutritionCaptureSubmissionId;
|
|
43
|
+
readonly reviewerId?: NutritionUserId;
|
|
44
|
+
readonly decision: NutritionReviewDecision;
|
|
45
|
+
readonly previousStatus: NutritionCaptureSubmissionStatus;
|
|
46
|
+
readonly nextStatus: NutritionCaptureSubmissionStatus;
|
|
47
|
+
readonly targetProductId?: NutritionProductId | null;
|
|
48
|
+
readonly note?: string;
|
|
49
|
+
readonly metadata?: Record<string, NutritionJsonValue>;
|
|
50
|
+
readonly createdAt: NutritionIsoDateTime;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface NutritionReviewSubmissionListRequest {
|
|
54
|
+
readonly status?: NutritionCaptureSubmissionStatus;
|
|
55
|
+
readonly barcode?: string;
|
|
56
|
+
readonly store?: string;
|
|
57
|
+
readonly limit?: number;
|
|
58
|
+
readonly offset?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface NutritionReviewSubmissionListResponse {
|
|
62
|
+
readonly submissions: readonly NutritionCaptureSubmission[];
|
|
63
|
+
readonly limit?: number;
|
|
64
|
+
readonly offset?: number;
|
|
65
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AUTH_PROFILE_CREATE_STRATEGIES,
|
|
5
|
+
AUTH_PROFILE_PRIMARY_KEY_STRATEGIES,
|
|
6
|
+
AUTH_PROFILE_UPDATE_STRATEGIES,
|
|
7
|
+
type AuthSpec,
|
|
8
|
+
} from './index';
|
|
9
|
+
|
|
10
|
+
describe('profile contract', () => {
|
|
11
|
+
it('exports profile strategy lists', () => {
|
|
12
|
+
expect(AUTH_PROFILE_PRIMARY_KEY_STRATEGIES).toEqual(['authUserId']);
|
|
13
|
+
expect(AUTH_PROFILE_CREATE_STRATEGIES).toEqual(['trigger', 'api', 'app']);
|
|
14
|
+
expect(AUTH_PROFILE_UPDATE_STRATEGIES).toEqual(['api', 'app']);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('serializes profile settings on an auth spec', () => {
|
|
18
|
+
const auth: AuthSpec = {
|
|
19
|
+
scope: 'global',
|
|
20
|
+
provider: 'supabase',
|
|
21
|
+
authorization: { kind: 'RBAC', engine: 'native' },
|
|
22
|
+
profile: {
|
|
23
|
+
fields: ['email', 'displayName', 'avatarUrl'],
|
|
24
|
+
table: 'profiles',
|
|
25
|
+
primaryKey: 'authUserId',
|
|
26
|
+
createStrategy: 'trigger',
|
|
27
|
+
updateStrategy: 'api',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
expect(JSON.parse(JSON.stringify(auth))).toEqual(auth);
|
|
32
|
+
});
|
|
33
|
+
});
|
package/src/types.ts
CHANGED
|
@@ -212,6 +212,15 @@ export const AUTH_PROFILE_FIELDS = [
|
|
|
212
212
|
export type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];
|
|
213
213
|
export type AuthProfileField = KnownAuthProfileField | (string & {});
|
|
214
214
|
|
|
215
|
+
export const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;
|
|
216
|
+
export type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];
|
|
217
|
+
|
|
218
|
+
export const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;
|
|
219
|
+
export type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];
|
|
220
|
+
|
|
221
|
+
export const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;
|
|
222
|
+
export type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];
|
|
223
|
+
|
|
215
224
|
export interface IconSpec {
|
|
216
225
|
name: string;
|
|
217
226
|
provider?: string;
|
|
@@ -307,6 +316,10 @@ export interface AuthSignUpSpec {
|
|
|
307
316
|
|
|
308
317
|
export interface AuthProfileSpec {
|
|
309
318
|
fields: AuthProfileField[];
|
|
319
|
+
table?: string;
|
|
320
|
+
primaryKey?: AuthProfilePrimaryKeyStrategy;
|
|
321
|
+
createStrategy?: AuthProfileCreateStrategy;
|
|
322
|
+
updateStrategy?: AuthProfileUpdateStrategy;
|
|
310
323
|
}
|
|
311
324
|
|
|
312
325
|
export interface AuthSpec {
|
package/dist/data/datasets.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { DbCollectionDefinition } from '../db';
|
|
2
|
-
import type { DataContractValue } from './values';
|
|
3
|
-
export declare const APP_DATASET_OPERATIONS: readonly ["create", "delete", "list", "read", "update"];
|
|
4
|
-
export type AppDatasetOperation = (typeof APP_DATASET_OPERATIONS)[number];
|
|
5
|
-
export type AppDatasetId = string;
|
|
6
|
-
export type AppDatasetSeedRecord = Readonly<Record<string, DataContractValue>>;
|
|
7
|
-
export interface AppDatasetDefinition {
|
|
8
|
-
readonly id: AppDatasetId;
|
|
9
|
-
readonly label?: string;
|
|
10
|
-
readonly description?: string;
|
|
11
|
-
readonly collection: DbCollectionDefinition;
|
|
12
|
-
readonly operations?: readonly AppDatasetOperation[];
|
|
13
|
-
readonly seed?: readonly AppDatasetSeedRecord[];
|
|
14
|
-
readonly metadata?: DataContractValue;
|
|
15
|
-
}
|
|
16
|
-
export type AppDatasetRegistry = Readonly<Record<AppDatasetId, AppDatasetDefinition>>;
|
|
17
|
-
export interface AppDataManifest {
|
|
18
|
-
readonly datasets?: AppDatasetRegistry;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=datasets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../../src/data/datasets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,sBAAsB,yDAA0D,CAAC;AAC9F,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAE/E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAEtF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CACxC"}
|
package/dist/data/datasets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../src/data/datasets.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["import type { DbCollectionDefinition } from '../db';\nimport type { DataContractValue } from './values';\n\nexport const APP_DATASET_OPERATIONS = ['create', 'delete', 'list', 'read', 'update'] as const;\nexport type AppDatasetOperation = (typeof APP_DATASET_OPERATIONS)[number];\n\nexport type AppDatasetId = string;\nexport type AppDatasetSeedRecord = Readonly<Record<string, DataContractValue>>;\n\nexport interface AppDatasetDefinition {\n readonly id: AppDatasetId;\n readonly label?: string;\n readonly description?: string;\n readonly collection: DbCollectionDefinition;\n readonly operations?: readonly AppDatasetOperation[];\n readonly seed?: readonly AppDatasetSeedRecord[];\n readonly metadata?: DataContractValue;\n}\n\nexport type AppDatasetRegistry = Readonly<Record<AppDatasetId, AppDatasetDefinition>>;\n\nexport interface AppDataManifest {\n readonly datasets?: AppDatasetRegistry;\n}\n"]}
|
package/src/data/datasets.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { DbCollectionDefinition } from '../db';
|
|
2
|
-
import type { DataContractValue } from './values';
|
|
3
|
-
|
|
4
|
-
export const APP_DATASET_OPERATIONS = ['create', 'delete', 'list', 'read', 'update'] as const;
|
|
5
|
-
export type AppDatasetOperation = (typeof APP_DATASET_OPERATIONS)[number];
|
|
6
|
-
|
|
7
|
-
export type AppDatasetId = string;
|
|
8
|
-
export type AppDatasetSeedRecord = Readonly<Record<string, DataContractValue>>;
|
|
9
|
-
|
|
10
|
-
export interface AppDatasetDefinition {
|
|
11
|
-
readonly id: AppDatasetId;
|
|
12
|
-
readonly label?: string;
|
|
13
|
-
readonly description?: string;
|
|
14
|
-
readonly collection: DbCollectionDefinition;
|
|
15
|
-
readonly operations?: readonly AppDatasetOperation[];
|
|
16
|
-
readonly seed?: readonly AppDatasetSeedRecord[];
|
|
17
|
-
readonly metadata?: DataContractValue;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type AppDatasetRegistry = Readonly<Record<AppDatasetId, AppDatasetDefinition>>;
|
|
21
|
-
|
|
22
|
-
export interface AppDataManifest {
|
|
23
|
-
readonly datasets?: AppDatasetRegistry;
|
|
24
|
-
}
|