@kubun/scalars 0.10.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.
Files changed (2) hide show
  1. package/lib/index.js +36 -1
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -1 +1,36 @@
1
- import{GraphQLBigInt as t,GraphQLDateTime as e,GraphQLDID as o,GraphQLDuration as c,GraphQLEmailAddress as a,GraphQLJSONObject as n,GraphQLLatitude as r,GraphQLLocalDate as m,GraphQLLocalDateTime as s,GraphQLLocale as p,GraphQLLocalTime as h,GraphQLLongitude as i,GraphQLTimeZone as l,GraphQLUtcOffset as x}from"graphql-scalars";function S(t){return{...t.extensions.jsonSchema,title:t.name}}export const attachmentIDSchema={type:"string",title:"AttachmentID",pattern:"^k[0-9a-z]{10,120}$"};export const docIDSchema={type:"string",title:"DocID",pattern:"^k[0-9a-z]{10,120}$"};export const urlSchema={type:"string",format:"uri",title:"URL"};export const bigIntSchema=S(t);export const didSchema=S(o);export const dateTimeSchema=S(e);export const durationSchema=S(c);export const emailAddressSchema=S(a);export const jsonObjectSchema=S(n);export const latitudeSchema=S(r);export const localDateSchema=S(m);export const localDateTimeSchema=S(s);export const localTimeSchema=S(h);export const localeSchema=S(p);export const longitudeSchema=S(i);export const timeZoneSchema=S(l);export const utcOffsetSchema=S(x);
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.10.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",