@kubun/scalars 0.9.0 → 0.11.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/lib/index.js +36 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1 +1,36 @@
|
|
|
1
|
-
import{GraphQLBigInt
|
|
1
|
+
import { GraphQLBigInt, GraphQLDateTime, GraphQLDID, GraphQLDuration, GraphQLEmailAddress, GraphQLJSONObject, GraphQLLatitude, GraphQLLocalDate, GraphQLLocalDateTime, GraphQLLocale, GraphQLLocalTime, GraphQLLongitude, GraphQLTimeZone, GraphQLUtcOffset } from 'graphql-scalars';
|
|
2
|
+
function createScalarSchema(type) {
|
|
3
|
+
return {
|
|
4
|
+
...type.extensions.jsonSchema,
|
|
5
|
+
title: type.name
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export const attachmentIDSchema = {
|
|
9
|
+
type: 'string',
|
|
10
|
+
title: 'AttachmentID',
|
|
11
|
+
pattern: '^k[0-9a-z]{10,120}$'
|
|
12
|
+
};
|
|
13
|
+
export const docIDSchema = {
|
|
14
|
+
type: 'string',
|
|
15
|
+
title: 'DocID',
|
|
16
|
+
pattern: '^k[0-9a-z]{10,120}$'
|
|
17
|
+
};
|
|
18
|
+
export const urlSchema = {
|
|
19
|
+
type: 'string',
|
|
20
|
+
format: 'uri',
|
|
21
|
+
title: 'URL'
|
|
22
|
+
};
|
|
23
|
+
export const bigIntSchema = createScalarSchema(GraphQLBigInt);
|
|
24
|
+
export const didSchema = createScalarSchema(GraphQLDID);
|
|
25
|
+
export const dateTimeSchema = createScalarSchema(GraphQLDateTime);
|
|
26
|
+
export const durationSchema = createScalarSchema(GraphQLDuration);
|
|
27
|
+
export const emailAddressSchema = createScalarSchema(GraphQLEmailAddress);
|
|
28
|
+
export const jsonObjectSchema = createScalarSchema(GraphQLJSONObject);
|
|
29
|
+
export const latitudeSchema = createScalarSchema(GraphQLLatitude);
|
|
30
|
+
export const localDateSchema = createScalarSchema(GraphQLLocalDate);
|
|
31
|
+
export const localDateTimeSchema = createScalarSchema(GraphQLLocalDateTime);
|
|
32
|
+
export const localTimeSchema = createScalarSchema(GraphQLLocalTime);
|
|
33
|
+
export const localeSchema = createScalarSchema(GraphQLLocale);
|
|
34
|
+
export const longitudeSchema = createScalarSchema(GraphQLLongitude);
|
|
35
|
+
export const timeZoneSchema = createScalarSchema(GraphQLTimeZone);
|
|
36
|
+
export const utcOffsetSchema = createScalarSchema(GraphQLUtcOffset);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/scalars",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"license": "see LICENSE.md",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build:clean": "del lib",
|
|
25
|
-
"build:js": "swc src -d ./lib --config-file ../../swc.json --strip-leading-paths",
|
|
25
|
+
"build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
|
|
26
26
|
"build:types": "tsc --emitDeclarationOnly --skipLibCheck",
|
|
27
27
|
"build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
|
|
28
28
|
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|