@payloadcms/graphql 4.0.0-internal.c3ac604 → 4.0.0-internal.cb69780

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 (32) hide show
  1. package/dist/resolvers/collections/find.js +1 -1
  2. package/dist/resolvers/collections/find.js.map +1 -1
  3. package/dist/resolvers/collections/findByID.js +1 -1
  4. package/dist/resolvers/collections/findByID.js.map +1 -1
  5. package/dist/resolvers/collections/findVersionByID.js +1 -1
  6. package/dist/resolvers/collections/findVersionByID.js.map +1 -1
  7. package/dist/resolvers/collections/findVersions.js +1 -1
  8. package/dist/resolvers/collections/findVersions.js.map +1 -1
  9. package/dist/resolvers/globals/findOne.js +1 -1
  10. package/dist/resolvers/globals/findOne.js.map +1 -1
  11. package/dist/resolvers/globals/findVersionByID.js +1 -1
  12. package/dist/resolvers/globals/findVersionByID.js.map +1 -1
  13. package/dist/resolvers/globals/findVersions.js +1 -1
  14. package/dist/resolvers/globals/findVersions.js.map +1 -1
  15. package/dist/schema/fieldToSchemaMap.js +3 -3
  16. package/dist/schema/fieldToSchemaMap.js.map +1 -1
  17. package/dist/schema/initCollections.d.ts.map +1 -1
  18. package/dist/schema/initCollections.js +9 -6
  19. package/dist/schema/initCollections.js.map +1 -1
  20. package/dist/schema/withOperators.d.ts +6 -0
  21. package/dist/schema/withOperators.d.ts.map +1 -1
  22. package/dist/schema/withOperators.js +15 -0
  23. package/dist/schema/withOperators.js.map +1 -1
  24. package/dist/utilities/select.d.ts +4 -3
  25. package/dist/utilities/select.d.ts.map +1 -1
  26. package/dist/utilities/select.js +83 -45
  27. package/dist/utilities/select.js.map +1 -1
  28. package/package.json +3 -3
  29. package/dist/utilities/formatName.spec.js +0 -57
  30. package/dist/utilities/formatName.spec.js.map +0 -1
  31. package/dist/utilities/formatUtcOffset.spec.js +0 -142
  32. package/dist/utilities/formatUtcOffset.spec.js.map +0 -1
@@ -1,57 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { formatName } from './formatName';
3
- describe('formatName', ()=>{
4
- it.each`
5
- char | expected
6
- ${'á'} | ${'a'}
7
- ${'è'} | ${'e'}
8
- ${'í'} | ${'i'}
9
- ${'ó'} | ${'o'}
10
- ${'ú'} | ${'u'}
11
- ${'ñ'} | ${'n'}
12
- ${'ü'} | ${'u'}
13
- `('should convert accented character: $char', ({ char, expected })=>{
14
- expect(formatName(char)).toEqual(expected);
15
- });
16
- describe('UTC offset handling', ()=>{
17
- it.each`
18
- offset | expected
19
- ${'+00:00'} | ${'_TZOFFSET_PLUS_00_00'}
20
- ${'+05:30'} | ${'_TZOFFSET_PLUS_05_30'}
21
- ${'+05:45'} | ${'_TZOFFSET_PLUS_05_45'}
22
- ${'+08:00'} | ${'_TZOFFSET_PLUS_08_00'}
23
- ${'+12:00'} | ${'_TZOFFSET_PLUS_12_00'}
24
- ${'+14:00'} | ${'_TZOFFSET_PLUS_14_00'}
25
- ${'-00:00'} | ${'_TZOFFSET_MINUS_00_00'}
26
- ${'-03:30'} | ${'_TZOFFSET_MINUS_03_30'}
27
- ${'-05:00'} | ${'_TZOFFSET_MINUS_05_00'}
28
- ${'-08:00'} | ${'_TZOFFSET_MINUS_08_00'}
29
- ${'-12:00'} | ${'_TZOFFSET_MINUS_12_00'}
30
- `('should convert UTC offset $offset to $expected', ({ offset, expected })=>{
31
- expect(formatName(offset)).toEqual(expected);
32
- });
33
- it('should not collide between positive and negative offsets', ()=>{
34
- const plusFive = formatName('+05:00');
35
- const minusFive = formatName('-05:00');
36
- expect(plusFive).not.toEqual(minusFive);
37
- expect(plusFive).toEqual('_TZOFFSET_PLUS_05_00');
38
- expect(minusFive).toEqual('_TZOFFSET_MINUS_05_00');
39
- });
40
- it('should not treat IANA timezone names as offsets', ()=>{
41
- // These should use standard formatting, not UTC offset formatting
42
- expect(formatName('America/New_York')).toEqual('America_New_York');
43
- expect(formatName('Europe/London')).toEqual('Europe_London');
44
- expect(formatName('Asia/Tokyo')).toEqual('Asia_Tokyo');
45
- });
46
- it('should not treat partial offset patterns as offsets', ()=>{
47
- // These don't match the strict ±HH:mm pattern, so they use standard formatting
48
- expect(formatName('+5')).toEqual('_5');
49
- expect(formatName('+05')).toEqual('_05');
50
- expect(formatName('+0530')).toEqual('_0530');
51
- // 05:30 without sign is not a UTC offset, starts with number so gets _ prefix
52
- expect(formatName('05:30')).toEqual('_05:30');
53
- });
54
- });
55
- });
56
-
57
- //# sourceMappingURL=formatName.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utilities/formatName.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { formatName } from './formatName'\n\ndescribe('formatName', () => {\n it.each`\n char | expected\n ${'á'} | ${'a'}\n ${'è'} | ${'e'}\n ${'í'} | ${'i'}\n ${'ó'} | ${'o'}\n ${'ú'} | ${'u'}\n ${'ñ'} | ${'n'}\n ${'ü'} | ${'u'}\n `('should convert accented character: $char', ({ char, expected }) => {\n expect(formatName(char)).toEqual(expected)\n })\n\n describe('UTC offset handling', () => {\n it.each`\n offset | expected\n ${'+00:00'} | ${'_TZOFFSET_PLUS_00_00'}\n ${'+05:30'} | ${'_TZOFFSET_PLUS_05_30'}\n ${'+05:45'} | ${'_TZOFFSET_PLUS_05_45'}\n ${'+08:00'} | ${'_TZOFFSET_PLUS_08_00'}\n ${'+12:00'} | ${'_TZOFFSET_PLUS_12_00'}\n ${'+14:00'} | ${'_TZOFFSET_PLUS_14_00'}\n ${'-00:00'} | ${'_TZOFFSET_MINUS_00_00'}\n ${'-03:30'} | ${'_TZOFFSET_MINUS_03_30'}\n ${'-05:00'} | ${'_TZOFFSET_MINUS_05_00'}\n ${'-08:00'} | ${'_TZOFFSET_MINUS_08_00'}\n ${'-12:00'} | ${'_TZOFFSET_MINUS_12_00'}\n `('should convert UTC offset $offset to $expected', ({ offset, expected }) => {\n expect(formatName(offset)).toEqual(expected)\n })\n\n it('should not collide between positive and negative offsets', () => {\n const plusFive = formatName('+05:00')\n const minusFive = formatName('-05:00')\n expect(plusFive).not.toEqual(minusFive)\n expect(plusFive).toEqual('_TZOFFSET_PLUS_05_00')\n expect(minusFive).toEqual('_TZOFFSET_MINUS_05_00')\n })\n\n it('should not treat IANA timezone names as offsets', () => {\n // These should use standard formatting, not UTC offset formatting\n expect(formatName('America/New_York')).toEqual('America_New_York')\n expect(formatName('Europe/London')).toEqual('Europe_London')\n expect(formatName('Asia/Tokyo')).toEqual('Asia_Tokyo')\n })\n\n it('should not treat partial offset patterns as offsets', () => {\n // These don't match the strict ±HH:mm pattern, so they use standard formatting\n expect(formatName('+5')).toEqual('_5')\n expect(formatName('+05')).toEqual('_05')\n expect(formatName('+0530')).toEqual('_0530')\n // 05:30 without sign is not a UTC offset, starts with number so gets _ prefix\n expect(formatName('05:30')).toEqual('_05:30')\n })\n })\n})\n"],"names":["describe","it","expect","formatName","each","char","expected","toEqual","offset","plusFive","minusFive","not"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,SAAQ;AAC7C,SAASC,UAAU,QAAQ,eAAc;AAEzCH,SAAS,cAAc;IACrBC,GAAGG,IAAI,CAAC;;IAEN,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;IACf,EAAE,IAAI,GAAG,EAAE,IAAI;EACjB,CAAC,CAAC,4CAA4C,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAE;QAC/DJ,OAAOC,WAAWE,OAAOE,OAAO,CAACD;IACnC;IAEAN,SAAS,uBAAuB;QAC9BC,GAAGG,IAAI,CAAC;;MAEN,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,uBAAuB;MACvC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;MACxC,EAAE,SAAS,GAAG,EAAE,wBAAwB;IAC1C,CAAC,CAAC,kDAAkD,CAAC,EAAEI,MAAM,EAAEF,QAAQ,EAAE;YACvEJ,OAAOC,WAAWK,SAASD,OAAO,CAACD;QACrC;QAEAL,GAAG,4DAA4D;YAC7D,MAAMQ,WAAWN,WAAW;YAC5B,MAAMO,YAAYP,WAAW;YAC7BD,OAAOO,UAAUE,GAAG,CAACJ,OAAO,CAACG;YAC7BR,OAAOO,UAAUF,OAAO,CAAC;YACzBL,OAAOQ,WAAWH,OAAO,CAAC;QAC5B;QAEAN,GAAG,mDAAmD;YACpD,kEAAkE;YAClEC,OAAOC,WAAW,qBAAqBI,OAAO,CAAC;YAC/CL,OAAOC,WAAW,kBAAkBI,OAAO,CAAC;YAC5CL,OAAOC,WAAW,eAAeI,OAAO,CAAC;QAC3C;QAEAN,GAAG,uDAAuD;YACxD,+EAA+E;YAC/EC,OAAOC,WAAW,OAAOI,OAAO,CAAC;YACjCL,OAAOC,WAAW,QAAQI,OAAO,CAAC;YAClCL,OAAOC,WAAW,UAAUI,OAAO,CAAC;YACpC,8EAA8E;YAC9EL,OAAOC,WAAW,UAAUI,OAAO,CAAC;QACtC;IACF;AACF"}
@@ -1,142 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { formatUtcOffset } from './formatUtcOffset.js';
3
- describe('formatUtcOffset', ()=>{
4
- describe('valid UTC offsets', ()=>{
5
- it.each([
6
- [
7
- '+00:00',
8
- '_TZOFFSET_PLUS_00_00'
9
- ],
10
- [
11
- '+05:30',
12
- '_TZOFFSET_PLUS_05_30'
13
- ],
14
- [
15
- '+05:45',
16
- '_TZOFFSET_PLUS_05_45'
17
- ],
18
- [
19
- '+08:00',
20
- '_TZOFFSET_PLUS_08_00'
21
- ],
22
- [
23
- '+09:30',
24
- '_TZOFFSET_PLUS_09_30'
25
- ],
26
- [
27
- '+12:00',
28
- '_TZOFFSET_PLUS_12_00'
29
- ],
30
- [
31
- '+14:00',
32
- '_TZOFFSET_PLUS_14_00'
33
- ]
34
- ])('should convert positive offset %s to %s', (offset, expected)=>{
35
- expect(formatUtcOffset(offset)).toEqual(expected);
36
- });
37
- it.each([
38
- [
39
- '-00:00',
40
- '_TZOFFSET_MINUS_00_00'
41
- ],
42
- [
43
- '-03:30',
44
- '_TZOFFSET_MINUS_03_30'
45
- ],
46
- [
47
- '-05:00',
48
- '_TZOFFSET_MINUS_05_00'
49
- ],
50
- [
51
- '-08:00',
52
- '_TZOFFSET_MINUS_08_00'
53
- ],
54
- [
55
- '-09:30',
56
- '_TZOFFSET_MINUS_09_30'
57
- ],
58
- [
59
- '-12:00',
60
- '_TZOFFSET_MINUS_12_00'
61
- ]
62
- ])('should convert negative offset %s to %s', (offset, expected)=>{
63
- expect(formatUtcOffset(offset)).toEqual(expected);
64
- });
65
- });
66
- describe('non-offset values', ()=>{
67
- it.each([
68
- 'UTC',
69
- 'America/New_York',
70
- 'Europe/London',
71
- 'Asia/Tokyo',
72
- 'Pacific/Auckland'
73
- ])('should return null for IANA timezone: %s', (timezone)=>{
74
- expect(formatUtcOffset(timezone)).toBeNull();
75
- });
76
- it.each([
77
- '+5',
78
- '-8',
79
- '+05',
80
- '-08',
81
- '+0530',
82
- '-0800',
83
- '05:30',
84
- '0530',
85
- 'invalid',
86
- ''
87
- ])('should return null for non-standard format: %s', (value)=>{
88
- expect(formatUtcOffset(value)).toBeNull();
89
- });
90
- });
91
- describe('uniqueness', ()=>{
92
- it('should produce unique names for positive and negative offsets', ()=>{
93
- const testCases = [
94
- [
95
- '+05:00',
96
- '-05:00'
97
- ],
98
- [
99
- '+08:00',
100
- '-08:00'
101
- ],
102
- [
103
- '+00:00',
104
- '-00:00'
105
- ],
106
- [
107
- '+12:00',
108
- '-12:00'
109
- ]
110
- ];
111
- for (const [positive, negative] of testCases){
112
- const positiveName = formatUtcOffset(positive);
113
- const negativeName = formatUtcOffset(negative);
114
- expect(positiveName).not.toEqual(negativeName);
115
- }
116
- });
117
- it('should produce unique names for different hour offsets', ()=>{
118
- const offsets = [
119
- '+05:00',
120
- '+06:00',
121
- '+07:00',
122
- '+08:00'
123
- ];
124
- const names = offsets.map(formatUtcOffset);
125
- const uniqueNames = new Set(names);
126
- expect(uniqueNames.size).toEqual(offsets.length);
127
- });
128
- it('should produce unique names for different minute offsets', ()=>{
129
- const offsets = [
130
- '+05:00',
131
- '+05:15',
132
- '+05:30',
133
- '+05:45'
134
- ];
135
- const names = offsets.map(formatUtcOffset);
136
- const uniqueNames = new Set(names);
137
- expect(uniqueNames.size).toEqual(offsets.length);
138
- });
139
- });
140
- });
141
-
142
- //# sourceMappingURL=formatUtcOffset.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utilities/formatUtcOffset.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport { formatUtcOffset } from './formatUtcOffset.js'\n\ndescribe('formatUtcOffset', () => {\n describe('valid UTC offsets', () => {\n it.each([\n ['+00:00', '_TZOFFSET_PLUS_00_00'],\n ['+05:30', '_TZOFFSET_PLUS_05_30'],\n ['+05:45', '_TZOFFSET_PLUS_05_45'],\n ['+08:00', '_TZOFFSET_PLUS_08_00'],\n ['+09:30', '_TZOFFSET_PLUS_09_30'],\n ['+12:00', '_TZOFFSET_PLUS_12_00'],\n ['+14:00', '_TZOFFSET_PLUS_14_00'],\n ])('should convert positive offset %s to %s', (offset, expected) => {\n expect(formatUtcOffset(offset)).toEqual(expected)\n })\n\n it.each([\n ['-00:00', '_TZOFFSET_MINUS_00_00'],\n ['-03:30', '_TZOFFSET_MINUS_03_30'],\n ['-05:00', '_TZOFFSET_MINUS_05_00'],\n ['-08:00', '_TZOFFSET_MINUS_08_00'],\n ['-09:30', '_TZOFFSET_MINUS_09_30'],\n ['-12:00', '_TZOFFSET_MINUS_12_00'],\n ])('should convert negative offset %s to %s', (offset, expected) => {\n expect(formatUtcOffset(offset)).toEqual(expected)\n })\n })\n\n describe('non-offset values', () => {\n it.each(['UTC', 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Pacific/Auckland'])(\n 'should return null for IANA timezone: %s',\n (timezone) => {\n expect(formatUtcOffset(timezone)).toBeNull()\n },\n )\n\n it.each(['+5', '-8', '+05', '-08', '+0530', '-0800', '05:30', '0530', 'invalid', ''])(\n 'should return null for non-standard format: %s',\n (value) => {\n expect(formatUtcOffset(value)).toBeNull()\n },\n )\n })\n\n describe('uniqueness', () => {\n it('should produce unique names for positive and negative offsets', () => {\n const testCases = [\n ['+05:00', '-05:00'],\n ['+08:00', '-08:00'],\n ['+00:00', '-00:00'],\n ['+12:00', '-12:00'],\n ]\n\n for (const [positive, negative] of testCases) {\n const positiveName = formatUtcOffset(positive)\n const negativeName = formatUtcOffset(negative)\n expect(positiveName).not.toEqual(negativeName)\n }\n })\n\n it('should produce unique names for different hour offsets', () => {\n const offsets = ['+05:00', '+06:00', '+07:00', '+08:00']\n const names = offsets.map(formatUtcOffset)\n const uniqueNames = new Set(names)\n expect(uniqueNames.size).toEqual(offsets.length)\n })\n\n it('should produce unique names for different minute offsets', () => {\n const offsets = ['+05:00', '+05:15', '+05:30', '+05:45']\n const names = offsets.map(formatUtcOffset)\n const uniqueNames = new Set(names)\n expect(uniqueNames.size).toEqual(offsets.length)\n })\n })\n})\n"],"names":["describe","expect","it","formatUtcOffset","each","offset","expected","toEqual","timezone","toBeNull","value","testCases","positive","negative","positiveName","negativeName","not","offsets","names","map","uniqueNames","Set","size","length"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EA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