@comapeo/core 4.4.0 → 5.0.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/blob-store/downloader.d.ts +5 -2
- package/dist/blob-store/downloader.d.ts.map +1 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/datatype/index.d.ts +1 -1
- package/dist/datatype/index.d.ts.map +1 -1
- package/dist/discovery/local-discovery.d.ts.map +1 -1
- package/dist/import-categories.d.ts +19 -0
- package/dist/import-categories.d.ts.map +1 -0
- package/dist/intl/iso639.d.ts +4 -0
- package/dist/intl/iso639.d.ts.map +1 -0
- package/dist/intl/parse-bcp-47.d.ts +22 -0
- package/dist/intl/parse-bcp-47.d.ts.map +1 -0
- package/dist/invite/invite-api.d.ts.map +1 -1
- package/dist/lib/drizzle-helpers.d.ts +19 -1
- package/dist/lib/drizzle-helpers.d.ts.map +1 -1
- package/dist/mapeo-manager.d.ts +15 -9
- package/dist/mapeo-manager.d.ts.map +1 -1
- package/dist/mapeo-project.d.ts +4968 -3017
- package/dist/mapeo-project.d.ts.map +1 -1
- package/dist/schema/client.d.ts +246 -232
- package/dist/schema/client.d.ts.map +1 -1
- package/dist/schema/comapeo-to-drizzle.d.ts +65 -0
- package/dist/schema/comapeo-to-drizzle.d.ts.map +1 -0
- package/dist/schema/json-schema-to-drizzle.d.ts +18 -0
- package/dist/schema/json-schema-to-drizzle.d.ts.map +1 -0
- package/dist/schema/project.d.ts +2711 -1835
- package/dist/schema/project.d.ts.map +1 -1
- package/dist/schema/types.d.ts +73 -66
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/translation-api.d.ts +111 -189
- package/dist/translation-api.d.ts.map +1 -1
- package/dist/utils.d.ts +10 -0
- package/dist/utils.d.ts.map +1 -1
- package/drizzle/client/0004_glorious_shape.sql +1 -0
- package/drizzle/client/meta/0000_snapshot.json +13 -9
- package/drizzle/client/meta/0001_snapshot.json +13 -9
- package/drizzle/client/meta/0002_snapshot.json +13 -9
- package/drizzle/client/meta/0003_snapshot.json +13 -9
- package/drizzle/client/meta/0004_snapshot.json +239 -0
- package/drizzle/client/meta/_journal.json +7 -0
- package/drizzle/project/meta/0000_snapshot.json +43 -24
- package/drizzle/project/meta/0001_snapshot.json +47 -26
- package/drizzle/project/meta/0002_snapshot.json +47 -26
- package/package.json +16 -8
- package/src/constants.js +0 -3
- package/src/datatype/index.js +8 -5
- package/src/discovery/local-discovery.js +3 -2
- package/src/import-categories.js +364 -0
- package/src/index-writer/index.js +1 -1
- package/src/intl/iso639.js +8118 -0
- package/src/intl/parse-bcp-47.js +91 -0
- package/src/invite/invite-api.js +2 -0
- package/src/lib/drizzle-helpers.js +70 -18
- package/src/mapeo-manager.js +138 -88
- package/src/mapeo-project.js +56 -218
- package/src/roles.js +1 -1
- package/src/schema/client.js +22 -28
- package/src/schema/comapeo-to-drizzle.js +57 -0
- package/src/schema/{schema-to-drizzle.js → json-schema-to-drizzle.js} +25 -25
- package/src/schema/project.js +24 -37
- package/src/schema/types.ts +138 -99
- package/src/translation-api.js +64 -12
- package/src/utils.js +13 -0
- package/dist/config-import.d.ts +0 -74
- package/dist/config-import.d.ts.map +0 -1
- package/dist/schema/schema-to-drizzle.d.ts +0 -20
- package/dist/schema/schema-to-drizzle.d.ts.map +0 -1
- package/dist/schema/utils.d.ts +0 -55
- package/dist/schema/utils.d.ts.map +0 -1
- package/src/config-import.js +0 -603
- package/src/schema/utils.js +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/schema/project.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/schema/project.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAGE"}
|
package/dist/schema/types.d.ts
CHANGED
|
@@ -1,83 +1,67 @@
|
|
|
1
1
|
import { Includes, ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import { JSONSchema7 as JSONSchema7Writable, JSONSchema7Type } from 'json-schema';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[K in keyof T]-?: undefined extends T[K] ? T[K] | null : T[K];
|
|
6
|
-
};
|
|
3
|
+
import type { SQLiteBooleanBuilder, SQLiteIntegerBuilder, SQLiteRealBuilder, SQLiteTableWithColumns, SQLiteTextBuilder, SQLiteTextJsonBuilder } from 'drizzle-orm/sqlite-core';
|
|
4
|
+
import type { $Type, BuildColumns, ColumnBuilderBase, HasDefault, IsPrimaryKey, NotNull } from 'drizzle-orm';
|
|
7
5
|
/** Convert a readonly array/object to writeable */
|
|
8
6
|
type Writable<T> = {
|
|
9
7
|
-readonly [P in keyof T]: T[P];
|
|
10
8
|
};
|
|
11
|
-
/** Type returned by text(columnName, { enum: [] }) */
|
|
12
|
-
type TextBuilder<TName extends string, TEnum extends readonly [string, ...string[]], TNotNull extends boolean, THasDefault extends boolean> = import('drizzle-orm/sqlite-core').SQLiteTextBuilder<{
|
|
13
|
-
name: TName;
|
|
14
|
-
data: Writable<TEnum>[number];
|
|
15
|
-
driverParam: string;
|
|
16
|
-
columnType: 'SQLiteText';
|
|
17
|
-
dataType: 'string';
|
|
18
|
-
enumValues: Writable<TEnum>;
|
|
19
|
-
notNull: TNotNull;
|
|
20
|
-
hasDefault: THasDefault;
|
|
21
|
-
}>;
|
|
22
|
-
/** Type returned by integer(columnName, { mode: 'boolean' }) */
|
|
23
|
-
type BooleanBuilder<TName extends string, TNotNull extends boolean, THasDefault extends boolean> = import('drizzle-orm/sqlite-core').SQLiteBooleanBuilder<{
|
|
24
|
-
name: TName;
|
|
25
|
-
data: boolean;
|
|
26
|
-
driverParam: number;
|
|
27
|
-
columnType: 'SQLiteBoolean';
|
|
28
|
-
dataType: 'boolean';
|
|
29
|
-
notNull: TNotNull;
|
|
30
|
-
hasDefault: THasDefault;
|
|
31
|
-
enumValues: undefined;
|
|
32
|
-
}>;
|
|
33
|
-
/** Type returned by real(columnName) */
|
|
34
|
-
type RealBuilder<TName extends string, TNotNull extends boolean, THasDefault extends boolean> = import('drizzle-orm/sqlite-core').SQLiteRealBuilder<{
|
|
35
|
-
name: TName;
|
|
36
|
-
data: number;
|
|
37
|
-
driverParam: number;
|
|
38
|
-
columnType: 'SQLiteReal';
|
|
39
|
-
dataType: 'number';
|
|
40
|
-
notNull: TNotNull;
|
|
41
|
-
hasDefault: THasDefault;
|
|
42
|
-
enumValues: undefined;
|
|
43
|
-
}>;
|
|
44
|
-
/** Type returned by integer(columnName) */
|
|
45
|
-
type IntegerBuilder<TName extends string, TNotNull extends boolean, THasDefault extends boolean> = import('drizzle-orm/sqlite-core').SQLiteIntegerBuilder<{
|
|
46
|
-
name: TName;
|
|
47
|
-
data: number;
|
|
48
|
-
driverParam: number;
|
|
49
|
-
columnType: 'SQLiteInteger';
|
|
50
|
-
dataType: 'number';
|
|
51
|
-
notNull: TNotNull;
|
|
52
|
-
hasDefault: THasDefault;
|
|
53
|
-
enumValues: undefined;
|
|
54
|
-
}>;
|
|
55
|
-
/** Type returned by the `customJson` custom type */
|
|
56
|
-
type JsonBuilder<TName extends string, TData extends unknown, TNotNull extends boolean, THasDefault extends boolean> = import('drizzle-orm/sqlite-core').SQLiteCustomColumnBuilder<{
|
|
57
|
-
name: TName;
|
|
58
|
-
data: TData;
|
|
59
|
-
dataType: 'custom';
|
|
60
|
-
driverParam: string;
|
|
61
|
-
columnType: 'SQLiteCustomColumn';
|
|
62
|
-
notNull: TNotNull;
|
|
63
|
-
hasDefault: THasDefault;
|
|
64
|
-
enumValues: undefined;
|
|
65
|
-
}>;
|
|
66
9
|
export type JSONSchema7 = ReadonlyDeep<JSONSchema7Writable>;
|
|
67
10
|
type JsonSchema7Properties = {
|
|
68
11
|
readonly [K: string]: JSONSchema7;
|
|
69
12
|
};
|
|
70
|
-
export type
|
|
13
|
+
export type JSONSchema7Object = Omit<JSONSchema7, 'properties' | 'type'> & {
|
|
14
|
+
readonly type: 'object';
|
|
71
15
|
readonly properties: JsonSchema7Properties;
|
|
72
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Create a Drizzle SQLite table definition from a JSONSchema object. All
|
|
19
|
+
* top-level properties map to SQLite columns, with `required` properties marked
|
|
20
|
+
* as `NOT NULL`, and JSONSchema `default` will map to SQLite defaults.
|
|
21
|
+
*
|
|
22
|
+
* Any properties that are of type `object` or `array` in the JSONSchema will be
|
|
23
|
+
* mapped to a text field, which drizzle will parse and stringify. Types for
|
|
24
|
+
* `object` and `array` properties will be derived from `TObjectType`.
|
|
25
|
+
*/
|
|
26
|
+
export type JsonSchemaToDrizzleSqliteTable<
|
|
27
|
+
/** Typescript type for the object defined in the JSONSchema */
|
|
28
|
+
TObjectType extends {
|
|
29
|
+
[K in keyof TSchema['properties']]?: any;
|
|
30
|
+
},
|
|
31
|
+
/** The JSONSchema object schema */
|
|
32
|
+
TSchema extends JSONSchema7Object,
|
|
33
|
+
/** Name of the table to create */
|
|
34
|
+
TTableName extends string,
|
|
35
|
+
/** Additional columns to add to the table definition (e.g. not defined in JSONSchema ) */
|
|
36
|
+
TColumnsMap extends Record<string, ColumnBuilderBase> = {},
|
|
37
|
+
/** Name of the property to use as primary key */
|
|
38
|
+
TPrimaryKey extends keyof TSchema['properties'] | undefined = undefined> = SQLiteTableWithColumns<{
|
|
39
|
+
name: TTableName;
|
|
40
|
+
schema: undefined;
|
|
41
|
+
columns: BuildColumns<TTableName, JsonSchemaToDrizzleColumns<TObjectType, TSchema, TPrimaryKey> & TColumnsMap, 'sqlite'>;
|
|
42
|
+
dialect: 'sqlite';
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Convert a JSONSchema Object Schema to a Drizzle Columns map (e.g. parameter
|
|
46
|
+
* for `sqliteTable()`). All top-level properties map to SQLite columns, with
|
|
47
|
+
* `required` properties marked as `NOT NULL`, and JSONSchema `default` will map
|
|
48
|
+
* to SQLite defaults.
|
|
49
|
+
*
|
|
50
|
+
* Any properties that are of type `object` or `array` in the JSONSchema will be
|
|
51
|
+
* mapped to a text field, which drizzle will parse and stringify. Types for
|
|
52
|
+
* `object` and `array` properties will be derived from `TObjectType`.
|
|
53
|
+
*/
|
|
54
|
+
type JsonSchemaToDrizzleColumns<TObjectType extends {
|
|
55
|
+
[K in keyof TSchema['properties']]?: any;
|
|
56
|
+
}, TSchema extends JSONSchema7Object, TPrimaryKey extends keyof TSchema['properties'] | undefined = undefined> = AddJSONSchemaDefaults<TSchema, AddJSONSchemaRequired<TSchema, SchemaToDrizzleColumnsBase<TSchema, TObjectType>>>;
|
|
73
57
|
/** Get the type of a JSONSchema string: array of constants for an enum,
|
|
74
58
|
otherwise string[]. Strangeness is to convert it into the format expected by
|
|
75
59
|
drizzle, which results in the correct type for the field from SQLite */
|
|
76
60
|
type Enum<T extends JSONSchema7, TEnum extends T['enum'] = T['enum']> = TEnum extends readonly [string, ...string[]] ? Writable<TEnum> : T['const'] extends string ? [T['const']] : [string, ...string[]];
|
|
77
61
|
/** True if JSONSchema object has a default */
|
|
78
|
-
type
|
|
62
|
+
type HasJSONSchemaDefault<T extends JSONSchema7> = T['default'] extends JSONSchema7Type ? true : false;
|
|
79
63
|
/** True if JSONSchema value is required */
|
|
80
|
-
type
|
|
64
|
+
type IsJSONSchemaRequired<T extends JSONSchema7Object, U extends string, V extends JSONSchema7['required'] = T['required']> = V extends readonly any[] ? Includes<V, U> : false;
|
|
81
65
|
/**
|
|
82
66
|
* Convert a JSONSchema to a Drizzle Columns map (e.g. parameter for
|
|
83
67
|
* `sqliteTable()`). All top-level properties map to SQLite columns, with
|
|
@@ -86,12 +70,35 @@ type IsRequired<T extends JSONSchema7WithProps, U extends string, V extends JSON
|
|
|
86
70
|
* the JSONSchema will be mapped to a text field, which drizzle will parse and
|
|
87
71
|
* stringify. Types for parsed JSON will be derived from MapeoDoc types.
|
|
88
72
|
*/
|
|
89
|
-
export type SchemaToDrizzleColumns<
|
|
73
|
+
export type SchemaToDrizzleColumns<TSchema extends JSONSchema7Object,
|
|
74
|
+
/** This is the type matching the JSONSchema */
|
|
75
|
+
TObjectType extends {
|
|
76
|
+
[K in keyof TSchema['properties']]?: any;
|
|
77
|
+
}, TPrimaryKey extends keyof TSchema['properties'] | undefined = undefined> = AddPrimaryKey<AddJSONSchemaDefaults<TSchema, AddJSONSchemaRequired<TSchema, SchemaToDrizzleColumnsBase<TSchema, TObjectType>>>, TPrimaryKey>;
|
|
78
|
+
/**
|
|
79
|
+
* Add `HasDefault` to columns if the JSONSchema has a default for that property
|
|
80
|
+
*/
|
|
81
|
+
type AddJSONSchemaDefaults<TJSONSchema extends JSONSchema7Object, TColumns extends Record<string, ColumnBuilderBase>, U extends JsonSchema7Properties = TJSONSchema['properties']> = {
|
|
82
|
+
[K in keyof TColumns]: K extends keyof U ? HasJSONSchemaDefault<U[K]> extends true ? HasDefault<TColumns[K]> : TColumns[K] : TColumns[K];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Mark columns as NotNull if they are required in the JSONSchema
|
|
86
|
+
*/
|
|
87
|
+
type AddJSONSchemaRequired<TJSONSchema extends JSONSchema7Object, TColumns extends Record<string, ColumnBuilderBase>> = {
|
|
88
|
+
[K in keyof TColumns]: K extends string ? IsJSONSchemaRequired<TJSONSchema, K> extends true ? NotNull<TColumns[K]> : TColumns[K] : TColumns[K];
|
|
89
|
+
};
|
|
90
|
+
type AddPrimaryKey<TColumns extends Record<string, ColumnBuilderBase>, TKey extends keyof TColumns | undefined> = TKey extends string ? Omit<TColumns, TKey> & {
|
|
91
|
+
[K in TKey]: IsPrimaryKey<TColumns[TKey]>;
|
|
92
|
+
} : TColumns;
|
|
93
|
+
/**
|
|
94
|
+
* Map JSONSchema object properties to Drizzle column types.
|
|
95
|
+
*/
|
|
96
|
+
type SchemaToDrizzleColumnsBase<TSchema extends JSONSchema7Object, TObjectType extends {
|
|
90
97
|
[K in keyof U]?: any;
|
|
91
|
-
}, U extends JsonSchema7Properties =
|
|
92
|
-
[K in keyof U]: K extends string ? U[K]['type'] extends 'string' ?
|
|
98
|
+
}, U extends JsonSchema7Properties = TSchema['properties']> = {
|
|
99
|
+
[K in keyof U]: K extends string ? U[K]['type'] extends 'string' ? SQLiteTextBuilder<Enum<U[K]>> : U[K]['type'] extends 'boolean' ? SQLiteBooleanBuilder : U[K]['type'] extends 'number' ? SQLiteRealBuilder : U[K]['type'] extends 'integer' ? SQLiteIntegerBuilder : U[K]['type'] extends 'array' | 'object' ? $Type<SQLiteTextJsonBuilder, TObjectType[K]> : never : never;
|
|
93
100
|
} & {
|
|
94
|
-
forks:
|
|
101
|
+
forks: $Type<SQLiteTextJsonBuilder, string[]>;
|
|
95
102
|
};
|
|
96
103
|
export type NonEmptyArray<T> = [T, ...T[]];
|
|
97
104
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EACL,WAAW,IAAI,mBAAmB,EAClC,eAAe,EAChB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EACL,WAAW,IAAI,mBAAmB,EAClC,eAAe,EAChB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,YAAY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C,QAAQ,CAAC,IAAI,CAAC,CAAC;CAAE,GACpE,QAAQ,CAAA;AAEZ;;GAEG;AACH,KAAK,0BAA0B,CAC7B,OAAO,SAAS,iBAAiB,EACjC,WAAW,SAAS;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG;CAAE,EAC5C,CAAC,SAAS,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,IACrD;KACD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,MAAM,GAC5B,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GAC3B,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC7B,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,SAAS,GAC9B,oBAAoB,GACpB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GAC7B,iBAAiB,GACjB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,SAAS,GAC9B,oBAAoB,GACpB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,OAAO,GAAG,QAAQ,GACvC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAC5C,KAAK,GACP,KAAK;CACV,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC,qBAAqB,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAA;AAErD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @import { Translation, TranslationValue } from '@comapeo/schema' */
|
|
1
|
+
/** @import { MapeoDoc, Translation, TranslationValue } from '@comapeo/schema' */
|
|
2
2
|
/** @import { SetOptional } from 'type-fest' */
|
|
3
3
|
export const ktranslatedLanguageCodeToSchemaNames: unique symbol;
|
|
4
4
|
export default class TranslationApi {
|
|
@@ -56,196 +56,118 @@ export default class TranslationApi {
|
|
|
56
56
|
* @param {TranslationValue} doc
|
|
57
57
|
*/
|
|
58
58
|
index(doc: TranslationValue): void;
|
|
59
|
-
get dataType(): import("./datatype/index.js").DataType<import("./datastore/index.js").DataStore<"config", "translation" | "preset" | "field" | "projectSettings" | "deviceInfo" | "icon">, import("
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
readonly schemaName:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
dataType: "custom";
|
|
139
|
-
columnType: "SQLiteCustomColumn";
|
|
140
|
-
data: string[];
|
|
141
|
-
driverParam: string;
|
|
142
|
-
notNull: true;
|
|
143
|
-
hasDefault: false;
|
|
144
|
-
enumValues: undefined;
|
|
145
|
-
baseColumn: never;
|
|
146
|
-
}, object>;
|
|
147
|
-
readonly deleted: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
148
|
-
name: "deleted";
|
|
149
|
-
tableName: "translation";
|
|
150
|
-
dataType: "boolean";
|
|
151
|
-
columnType: "SQLiteBoolean";
|
|
152
|
-
data: boolean;
|
|
153
|
-
driverParam: number;
|
|
154
|
-
notNull: true;
|
|
155
|
-
hasDefault: false;
|
|
156
|
-
enumValues: undefined;
|
|
157
|
-
baseColumn: never;
|
|
158
|
-
}, object>;
|
|
159
|
-
readonly docRef: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
160
|
-
name: "docRef";
|
|
161
|
-
tableName: "translation";
|
|
162
|
-
dataType: "custom";
|
|
163
|
-
columnType: "SQLiteCustomColumn";
|
|
164
|
-
data: {
|
|
165
|
-
docId: string;
|
|
166
|
-
versionId: string;
|
|
59
|
+
get dataType(): import("./datatype/index.js").DataType<import("./datastore/index.js").DataStore<"config", "translation" | "preset" | "field" | "projectSettings" | "deviceInfo" | "icon">, import("./schema/types.js").JsonSchemaToDrizzleSqliteTable<{
|
|
60
|
+
schemaName: "translation";
|
|
61
|
+
docRef: {
|
|
62
|
+
docId: string;
|
|
63
|
+
versionId: string;
|
|
64
|
+
};
|
|
65
|
+
docRefType: "type_unspecified" | "deviceInfo" | "preset" | "field" | "observation" | "projectSettings" | "role" | "track" | "UNRECOGNIZED";
|
|
66
|
+
propertyRef: string;
|
|
67
|
+
languageCode: string;
|
|
68
|
+
regionCode?: string | undefined;
|
|
69
|
+
message: string;
|
|
70
|
+
docId: string;
|
|
71
|
+
versionId: string;
|
|
72
|
+
originalVersionId: string;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
updatedAt: string;
|
|
75
|
+
links: string[];
|
|
76
|
+
deleted: boolean;
|
|
77
|
+
}, {
|
|
78
|
+
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
79
|
+
readonly $id: "http://mapeo.world/schemas/translation/v1.json";
|
|
80
|
+
readonly description: "A translation is a translated message in a single language for a string property/field of any Mapeo record type";
|
|
81
|
+
readonly title: "translation";
|
|
82
|
+
readonly type: "object";
|
|
83
|
+
readonly properties: {
|
|
84
|
+
readonly docId: {
|
|
85
|
+
readonly description: "Hex-encoded 32-byte buffer";
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
readonly minLength: 1;
|
|
88
|
+
};
|
|
89
|
+
readonly versionId: {
|
|
90
|
+
readonly description: "core discovery id (hex-encoded 32-byte buffer) and core index number, separated by '/'";
|
|
91
|
+
readonly type: "string";
|
|
92
|
+
readonly minLength: 1;
|
|
93
|
+
};
|
|
94
|
+
readonly originalVersionId: {
|
|
95
|
+
readonly description: "Version ID of the original version of this document. For the original version, matches `versionId`.";
|
|
96
|
+
readonly type: "string";
|
|
97
|
+
readonly minLength: 1;
|
|
98
|
+
};
|
|
99
|
+
readonly schemaName: {
|
|
100
|
+
readonly type: "string";
|
|
101
|
+
readonly const: "translation";
|
|
102
|
+
};
|
|
103
|
+
readonly createdAt: {
|
|
104
|
+
readonly description: "RFC3339-formatted datetime of when the first version of the element was created";
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly format: "date-time";
|
|
107
|
+
};
|
|
108
|
+
readonly updatedAt: {
|
|
109
|
+
readonly description: "RFC3339-formatted datetime of when this version of the element was created";
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
readonly format: "date-time";
|
|
112
|
+
};
|
|
113
|
+
readonly links: {
|
|
114
|
+
readonly description: "Version ids of the previous document versions this one is replacing. Each link is id (hex-encoded 32 byte buffer) and index number, separated by '/'";
|
|
115
|
+
readonly type: "array";
|
|
116
|
+
readonly uniqueItems: true;
|
|
117
|
+
readonly items: {
|
|
118
|
+
readonly type: "string";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
readonly deleted: {
|
|
122
|
+
readonly description: "Indicates whether the document has been deleted";
|
|
123
|
+
readonly type: "boolean";
|
|
124
|
+
};
|
|
125
|
+
readonly docRef: {
|
|
126
|
+
readonly type: "object";
|
|
127
|
+
readonly properties: {
|
|
128
|
+
readonly docId: {
|
|
129
|
+
readonly description: "hex-encoded id of the element that this observation references";
|
|
130
|
+
readonly type: "string";
|
|
131
|
+
readonly minLength: 1;
|
|
132
|
+
};
|
|
133
|
+
readonly versionId: {
|
|
134
|
+
readonly description: "core discovery id (hex-encoded 32-byte buffer) and core index number, separated by '/'";
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly minLength: 1;
|
|
137
|
+
};
|
|
167
138
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
readonly
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
baseColumn: never;
|
|
197
|
-
}, object>;
|
|
198
|
-
readonly languageCode: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
199
|
-
name: "languageCode";
|
|
200
|
-
tableName: "translation";
|
|
201
|
-
dataType: "string";
|
|
202
|
-
columnType: "SQLiteText";
|
|
203
|
-
data: string;
|
|
204
|
-
driverParam: string;
|
|
205
|
-
notNull: true;
|
|
206
|
-
hasDefault: false;
|
|
207
|
-
enumValues: [string, ...string[]];
|
|
208
|
-
baseColumn: never;
|
|
209
|
-
}, object>;
|
|
210
|
-
readonly regionCode: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
211
|
-
name: "regionCode";
|
|
212
|
-
tableName: "translation";
|
|
213
|
-
dataType: "string";
|
|
214
|
-
columnType: "SQLiteText";
|
|
215
|
-
data: string;
|
|
216
|
-
driverParam: string;
|
|
217
|
-
notNull: false;
|
|
218
|
-
hasDefault: false;
|
|
219
|
-
enumValues: [string, ...string[]];
|
|
220
|
-
baseColumn: never;
|
|
221
|
-
}, object>;
|
|
222
|
-
readonly message: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
223
|
-
name: "message";
|
|
224
|
-
tableName: "translation";
|
|
225
|
-
dataType: "string";
|
|
226
|
-
columnType: "SQLiteText";
|
|
227
|
-
data: string;
|
|
228
|
-
driverParam: string;
|
|
229
|
-
notNull: true;
|
|
230
|
-
hasDefault: false;
|
|
231
|
-
enumValues: [string, ...string[]];
|
|
232
|
-
baseColumn: never;
|
|
233
|
-
}, object>;
|
|
234
|
-
forks: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
235
|
-
name: "forks";
|
|
236
|
-
tableName: "translation";
|
|
237
|
-
dataType: "custom";
|
|
238
|
-
columnType: "SQLiteCustomColumn";
|
|
239
|
-
data: string[];
|
|
240
|
-
driverParam: string;
|
|
241
|
-
notNull: true;
|
|
242
|
-
hasDefault: false;
|
|
243
|
-
enumValues: undefined;
|
|
244
|
-
baseColumn: never;
|
|
245
|
-
}, object>;
|
|
139
|
+
readonly required: readonly ["docId", "versionId"];
|
|
140
|
+
};
|
|
141
|
+
readonly docRefType: {
|
|
142
|
+
readonly description: "type of the element that this translation references";
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
readonly enum: readonly ["type_unspecified", "deviceInfo", "preset", "field", "observation", "projectSettings", "role", "track", "UNRECOGNIZED"];
|
|
145
|
+
};
|
|
146
|
+
readonly propertyRef: {
|
|
147
|
+
readonly type: "string";
|
|
148
|
+
readonly description: "identifier for translated field/property in dot-prop notation";
|
|
149
|
+
readonly minLength: 1;
|
|
150
|
+
};
|
|
151
|
+
readonly languageCode: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
readonly description: "three-letter ISO 169-3 language code";
|
|
154
|
+
readonly minLength: 1;
|
|
155
|
+
readonly maxLength: 3;
|
|
156
|
+
};
|
|
157
|
+
readonly regionCode: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
readonly description: "two-letter country code from ISO 3166-1 alpha-2 or a three-digit code from UN M.49 for geographical regions";
|
|
160
|
+
readonly minLength: 2;
|
|
161
|
+
readonly maxLength: 3;
|
|
162
|
+
};
|
|
163
|
+
readonly message: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly description: "the translated string";
|
|
166
|
+
};
|
|
246
167
|
};
|
|
247
|
-
|
|
248
|
-
|
|
168
|
+
readonly required: readonly ["schemaName", "docRef", "docRefType", "propertyRef", "languageCode", "message", "docId", "createdAt", "updatedAt", "links", "versionId", "originalVersionId", "deleted"];
|
|
169
|
+
readonly additionalProperties: false;
|
|
170
|
+
}, "translation", import("./schema/comapeo-to-drizzle.js").AdditionalColumns, "docId">, "translation", {
|
|
249
171
|
schemaName: "translation";
|
|
250
172
|
docRef: {
|
|
251
173
|
docId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-api.d.ts","sourceRoot":"","sources":["../src/translation-api.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation-api.d.ts","sourceRoot":"","sources":["../src/translation-api.js"],"names":[],"mappings":"AAOA,iFAAiF;AACjF,+CAA+C;AAE/C,iEAEC;AACD;IAWE;;;;;;;;;OASG;IACH,0BARG;QAMS,QAAQ,EANT,OAAO,qBAAqB,EAAE,QAAQ,CAChD,OAAW,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,EACtD,cAAkB,qBAAqB,EAAE,gBAAgB,EACzD,aAAiB,EACjB,WAAe,EACf,gBAAoB,CACjB;KACH,EAWA;IAED,+BAA+B;IAC/B,SADc,OAAO,CAAC,IAAI,CAAC,CAG1B;IAED;;OAEG;IACH,WAFW,gBAAgB;;;;;;;;;;;;;;;;;;wDAW1B;IAED,kGAAkG;IAElG;;;;;OAKG;IACH,WALW,YACR,IAAI,CAAC,gBAAgB,EAAC,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC,EAC5D,aAAe,GAAG,YAAY,CAAC,GAAG;QAAC,MAAM;;;UAA6B;KAAC,GAC3D,OAAO,CAAC,OAAO,iBAAiB,EAAE,WAAW,EAAE,CAAC,CAqE5D;IAED;;OAEG;IACH,WAFW,gBAAgB,QAqB1B;IAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEC;IALD,mHAEC;;CAIF;sCAnL4D,iBAAiB;iCAC7C,WAAW;iCADiB,iBAAiB"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -114,6 +114,16 @@ export function hashObject(obj: Object): string;
|
|
|
114
114
|
* @returns {BlobId}
|
|
115
115
|
*/
|
|
116
116
|
export function buildBlobId(attachment: Attachment, requestedVariant: "original" | "thumbnail" | "preview"): BlobId;
|
|
117
|
+
/**
|
|
118
|
+
* Get typed entries from an object. Use this only on objects that you are
|
|
119
|
+
* certain have no extra properties - TS does not check for extra properties on
|
|
120
|
+
* an object, which is why Object.entries is untyped by default.
|
|
121
|
+
*
|
|
122
|
+
* @template {Record<string, unknown>} T
|
|
123
|
+
* @param {T} obj - The object to get entries from (must _not_ have extra properties)
|
|
124
|
+
* @returns {import('type-fest').Entries<T>}
|
|
125
|
+
*/
|
|
126
|
+
export function typedEntries<T extends Record<string, unknown>>(obj: T): import("type-fest").Entries<T>;
|
|
117
127
|
export class ExhaustivenessError extends Error {
|
|
118
128
|
/** @param {never} value */
|
|
119
129
|
constructor(value: never);
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts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