@contember/client 2.0.0-alpha.19 → 2.0.0-alpha.20

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 (181) hide show
  1. package/dist/development/index.cjs +7 -29
  2. package/dist/development/index.cjs.map +1 -1
  3. package/dist/development/index.js +3 -29
  4. package/dist/development/index.js.map +1 -1
  5. package/dist/development/src/{content/upload/GenerateUploadUrlMutationBuilder.cjs → GenerateUploadUrlMutationBuilder.cjs} +2 -4
  6. package/dist/development/src/GenerateUploadUrlMutationBuilder.cjs.map +1 -0
  7. package/dist/development/src/{content/upload/GenerateUploadUrlMutationBuilder.js → GenerateUploadUrlMutationBuilder.js} +2 -4
  8. package/dist/development/src/GenerateUploadUrlMutationBuilder.js.map +1 -0
  9. package/dist/production/index.cjs +7 -29
  10. package/dist/production/index.cjs.map +1 -1
  11. package/dist/production/index.js +3 -29
  12. package/dist/production/index.js.map +1 -1
  13. package/dist/production/src/{content/upload/GenerateUploadUrlMutationBuilder.cjs → GenerateUploadUrlMutationBuilder.cjs} +2 -4
  14. package/dist/production/src/GenerateUploadUrlMutationBuilder.cjs.map +1 -0
  15. package/dist/production/src/{content/upload/GenerateUploadUrlMutationBuilder.js → GenerateUploadUrlMutationBuilder.js} +2 -4
  16. package/dist/production/src/GenerateUploadUrlMutationBuilder.js.map +1 -0
  17. package/dist/types/{content/upload/GenerateUploadUrlMutationBuilder.d.ts → GenerateUploadUrlMutationBuilder.d.ts} +1 -2
  18. package/dist/types/GenerateUploadUrlMutationBuilder.d.ts.map +1 -0
  19. package/dist/types/index.d.ts +2 -14
  20. package/dist/types/index.d.ts.map +1 -1
  21. package/dist/types/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +5 -5
  23. package/src/{content/upload/GenerateUploadUrlMutationBuilder.ts → GenerateUploadUrlMutationBuilder.ts} +2 -6
  24. package/src/index.ts +2 -19
  25. package/tests/cases/unit/generateUploadUrlMutationBuilder.spec.ts +1 -2
  26. package/dist/development/src/content/formatContentApiRelativeUrl.cjs +0 -5
  27. package/dist/development/src/content/formatContentApiRelativeUrl.cjs.map +0 -1
  28. package/dist/development/src/content/formatContentApiRelativeUrl.js +0 -5
  29. package/dist/development/src/content/formatContentApiRelativeUrl.js.map +0 -1
  30. package/dist/development/src/content/params/whereToFilter.cjs +0 -17
  31. package/dist/development/src/content/params/whereToFilter.cjs.map +0 -1
  32. package/dist/development/src/content/params/whereToFilter.js +0 -17
  33. package/dist/development/src/content/params/whereToFilter.js.map +0 -1
  34. package/dist/development/src/content/replaceGraphQlLiteral.cjs +0 -15
  35. package/dist/development/src/content/replaceGraphQlLiteral.cjs.map +0 -1
  36. package/dist/development/src/content/replaceGraphQlLiteral.js +0 -15
  37. package/dist/development/src/content/replaceGraphQlLiteral.js.map +0 -1
  38. package/dist/development/src/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +0 -1
  39. package/dist/development/src/content/upload/GenerateUploadUrlMutationBuilder.js.map +0 -1
  40. package/dist/development/src/graphQlBuilder/GraphQlLiteral.cjs +0 -15
  41. package/dist/development/src/graphQlBuilder/GraphQlLiteral.cjs.map +0 -1
  42. package/dist/development/src/graphQlBuilder/GraphQlLiteral.js +0 -15
  43. package/dist/development/src/graphQlBuilder/GraphQlLiteral.js.map +0 -1
  44. package/dist/development/src/graphQlClient/GraphQlClient.cjs +0 -26
  45. package/dist/development/src/graphQlClient/GraphQlClient.cjs.map +0 -1
  46. package/dist/development/src/graphQlClient/GraphQlClient.js +0 -26
  47. package/dist/development/src/graphQlClient/GraphQlClient.js.map +0 -1
  48. package/dist/development/src/system/formatSystemApiRelativeUrl.cjs +0 -5
  49. package/dist/development/src/system/formatSystemApiRelativeUrl.cjs.map +0 -1
  50. package/dist/development/src/system/formatSystemApiRelativeUrl.js +0 -5
  51. package/dist/development/src/system/formatSystemApiRelativeUrl.js.map +0 -1
  52. package/dist/development/src/tenant/loginMutation.cjs +0 -34
  53. package/dist/development/src/tenant/loginMutation.cjs.map +0 -1
  54. package/dist/development/src/tenant/loginMutation.js +0 -34
  55. package/dist/development/src/tenant/loginMutation.js.map +0 -1
  56. package/dist/development/src/tenant/tenantApiRelativeUrl.cjs +0 -5
  57. package/dist/development/src/tenant/tenantApiRelativeUrl.cjs.map +0 -1
  58. package/dist/development/src/tenant/tenantApiRelativeUrl.js +0 -5
  59. package/dist/development/src/tenant/tenantApiRelativeUrl.js.map +0 -1
  60. package/dist/development/src/tenant/tenantErrorMessages.cjs +0 -18
  61. package/dist/development/src/tenant/tenantErrorMessages.cjs.map +0 -1
  62. package/dist/development/src/tenant/tenantErrorMessages.js +0 -18
  63. package/dist/development/src/tenant/tenantErrorMessages.js.map +0 -1
  64. package/dist/production/src/content/formatContentApiRelativeUrl.cjs +0 -5
  65. package/dist/production/src/content/formatContentApiRelativeUrl.cjs.map +0 -1
  66. package/dist/production/src/content/formatContentApiRelativeUrl.js +0 -5
  67. package/dist/production/src/content/formatContentApiRelativeUrl.js.map +0 -1
  68. package/dist/production/src/content/params/whereToFilter.cjs +0 -17
  69. package/dist/production/src/content/params/whereToFilter.cjs.map +0 -1
  70. package/dist/production/src/content/params/whereToFilter.js +0 -17
  71. package/dist/production/src/content/params/whereToFilter.js.map +0 -1
  72. package/dist/production/src/content/replaceGraphQlLiteral.cjs +0 -15
  73. package/dist/production/src/content/replaceGraphQlLiteral.cjs.map +0 -1
  74. package/dist/production/src/content/replaceGraphQlLiteral.js +0 -15
  75. package/dist/production/src/content/replaceGraphQlLiteral.js.map +0 -1
  76. package/dist/production/src/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +0 -1
  77. package/dist/production/src/content/upload/GenerateUploadUrlMutationBuilder.js.map +0 -1
  78. package/dist/production/src/graphQlBuilder/GraphQlLiteral.cjs +0 -12
  79. package/dist/production/src/graphQlBuilder/GraphQlLiteral.cjs.map +0 -1
  80. package/dist/production/src/graphQlBuilder/GraphQlLiteral.js +0 -12
  81. package/dist/production/src/graphQlBuilder/GraphQlLiteral.js.map +0 -1
  82. package/dist/production/src/graphQlClient/GraphQlClient.cjs +0 -26
  83. package/dist/production/src/graphQlClient/GraphQlClient.cjs.map +0 -1
  84. package/dist/production/src/graphQlClient/GraphQlClient.js +0 -26
  85. package/dist/production/src/graphQlClient/GraphQlClient.js.map +0 -1
  86. package/dist/production/src/system/formatSystemApiRelativeUrl.cjs +0 -5
  87. package/dist/production/src/system/formatSystemApiRelativeUrl.cjs.map +0 -1
  88. package/dist/production/src/system/formatSystemApiRelativeUrl.js +0 -5
  89. package/dist/production/src/system/formatSystemApiRelativeUrl.js.map +0 -1
  90. package/dist/production/src/tenant/loginMutation.cjs +0 -34
  91. package/dist/production/src/tenant/loginMutation.cjs.map +0 -1
  92. package/dist/production/src/tenant/loginMutation.js +0 -34
  93. package/dist/production/src/tenant/loginMutation.js.map +0 -1
  94. package/dist/production/src/tenant/tenantApiRelativeUrl.cjs +0 -5
  95. package/dist/production/src/tenant/tenantApiRelativeUrl.cjs.map +0 -1
  96. package/dist/production/src/tenant/tenantApiRelativeUrl.js +0 -5
  97. package/dist/production/src/tenant/tenantApiRelativeUrl.js.map +0 -1
  98. package/dist/production/src/tenant/tenantErrorMessages.cjs +0 -18
  99. package/dist/production/src/tenant/tenantErrorMessages.cjs.map +0 -1
  100. package/dist/production/src/tenant/tenantErrorMessages.js +0 -18
  101. package/dist/production/src/tenant/tenantErrorMessages.js.map +0 -1
  102. package/dist/types/content/formatContentApiRelativeUrl.d.ts +0 -2
  103. package/dist/types/content/formatContentApiRelativeUrl.d.ts.map +0 -1
  104. package/dist/types/content/index.d.ts +0 -5
  105. package/dist/types/content/index.d.ts.map +0 -1
  106. package/dist/types/content/params/index.d.ts +0 -2
  107. package/dist/types/content/params/index.d.ts.map +0 -1
  108. package/dist/types/content/params/whereToFilter.d.ts +0 -4
  109. package/dist/types/content/params/whereToFilter.d.ts.map +0 -1
  110. package/dist/types/content/replaceGraphQlLiteral.d.ts +0 -6
  111. package/dist/types/content/replaceGraphQlLiteral.d.ts.map +0 -1
  112. package/dist/types/content/upload/GenerateUploadUrlMutationBuilder.d.ts.map +0 -1
  113. package/dist/types/content/upload/index.d.ts +0 -2
  114. package/dist/types/content/upload/index.d.ts.map +0 -1
  115. package/dist/types/crudQueryBuilder/index.d.ts +0 -2
  116. package/dist/types/crudQueryBuilder/index.d.ts.map +0 -1
  117. package/dist/types/crudQueryBuilder/types.d.ts +0 -4
  118. package/dist/types/crudQueryBuilder/types.d.ts.map +0 -1
  119. package/dist/types/graphQlBuilder/GraphQlLiteral.d.ts +0 -9
  120. package/dist/types/graphQlBuilder/GraphQlLiteral.d.ts.map +0 -1
  121. package/dist/types/graphQlBuilder/QueryBuilder.d.ts +0 -11
  122. package/dist/types/graphQlBuilder/QueryBuilder.d.ts.map +0 -1
  123. package/dist/types/graphQlBuilder/index.d.ts +0 -3
  124. package/dist/types/graphQlBuilder/index.d.ts.map +0 -1
  125. package/dist/types/graphQlClient/GraphQlClient.d.ts +0 -17
  126. package/dist/types/graphQlClient/GraphQlClient.d.ts.map +0 -1
  127. package/dist/types/graphQlClient/index.d.ts +0 -4
  128. package/dist/types/graphQlClient/index.d.ts.map +0 -1
  129. package/dist/types/system/events/RelationFilter.d.ts +0 -5
  130. package/dist/types/system/events/RelationFilter.d.ts.map +0 -1
  131. package/dist/types/system/events/SystemEvent.d.ts +0 -10
  132. package/dist/types/system/events/SystemEvent.d.ts.map +0 -1
  133. package/dist/types/system/events/TreeFilter.d.ts +0 -7
  134. package/dist/types/system/events/TreeFilter.d.ts.map +0 -1
  135. package/dist/types/system/events/index.d.ts +0 -4
  136. package/dist/types/system/events/index.d.ts.map +0 -1
  137. package/dist/types/system/formatSystemApiRelativeUrl.d.ts +0 -2
  138. package/dist/types/system/formatSystemApiRelativeUrl.d.ts.map +0 -1
  139. package/dist/types/system/index.d.ts +0 -3
  140. package/dist/types/system/index.d.ts.map +0 -1
  141. package/dist/types/tenant/index.d.ts +0 -4
  142. package/dist/types/tenant/index.d.ts.map +0 -1
  143. package/dist/types/tenant/loginMutation.d.ts +0 -32
  144. package/dist/types/tenant/loginMutation.d.ts.map +0 -1
  145. package/dist/types/tenant/tenantApiRelativeUrl.d.ts +0 -2
  146. package/dist/types/tenant/tenantApiRelativeUrl.d.ts.map +0 -1
  147. package/dist/types/tenant/tenantErrorMessages.d.ts +0 -5
  148. package/dist/types/tenant/tenantErrorMessages.d.ts.map +0 -1
  149. package/dist/types/utils/index.d.ts +0 -3
  150. package/dist/types/utils/index.d.ts.map +0 -1
  151. package/dist/types/utils/isEmptyObject.d.ts +0 -2
  152. package/dist/types/utils/isEmptyObject.d.ts.map +0 -1
  153. package/dist/types/utils/readFileAsArrayBuffer.d.ts +0 -2
  154. package/dist/types/utils/readFileAsArrayBuffer.d.ts.map +0 -1
  155. package/src/content/formatContentApiRelativeUrl.ts +0 -2
  156. package/src/content/index.ts +0 -4
  157. package/src/content/params/index.ts +0 -1
  158. package/src/content/params/whereToFilter.ts +0 -19
  159. package/src/content/replaceGraphQlLiteral.ts +0 -22
  160. package/src/content/upload/index.ts +0 -1
  161. package/src/crudQueryBuilder/index.ts +0 -1
  162. package/src/crudQueryBuilder/types.ts +0 -8
  163. package/src/graphQlBuilder/GraphQlLiteral.ts +0 -14
  164. package/src/graphQlBuilder/QueryBuilder.ts +0 -13
  165. package/src/graphQlBuilder/index.ts +0 -2
  166. package/src/graphQlClient/GraphQlClient.ts +0 -40
  167. package/src/graphQlClient/index.ts +0 -8
  168. package/src/system/events/RelationFilter.ts +0 -4
  169. package/src/system/events/SystemEvent.ts +0 -9
  170. package/src/system/events/TreeFilter.ts +0 -7
  171. package/src/system/events/index.ts +0 -3
  172. package/src/system/formatSystemApiRelativeUrl.ts +0 -1
  173. package/src/system/index.ts +0 -2
  174. package/src/tenant/index.ts +0 -3
  175. package/src/tenant/loginMutation.ts +0 -61
  176. package/src/tenant/tenantApiRelativeUrl.ts +0 -1
  177. package/src/tenant/tenantErrorMessages.ts +0 -14
  178. package/src/utils/index.ts +0 -2
  179. package/src/utils/isEmptyObject.ts +0 -9
  180. package/src/utils/readFileAsArrayBuffer.ts +0 -12
  181. package/tests/cases/unit/params.spec.ts +0 -26
@@ -1,7 +1,4 @@
1
- import { GraphQlLiteral } from '../../graphQlBuilder'
2
1
  import { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'
3
- import { GraphQlBuilder } from '../../index'
4
- import { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'
5
2
 
6
3
  class GenerateUploadUrlMutationBuilder {
7
4
  private static generateUploadUrlFields = [
@@ -21,7 +18,7 @@ class GenerateUploadUrlMutationBuilder {
21
18
  for (const alias in parameters) {
22
19
  const fileParameters = parameters[alias]
23
20
  if (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {
24
- const { contentType, prefix, expiration, acl, size, suffix, fileName, extension } = replaceGraphQlLiteral(fileParameters)
21
+ const { contentType, prefix, expiration, acl, size, suffix, fileName, extension } = fileParameters
25
22
  selectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {
26
23
  input: {
27
24
  value: { contentType, prefix, expiration, acl, size, suffix, fileName, extension },
@@ -44,7 +41,7 @@ class GenerateUploadUrlMutationBuilder {
44
41
  },
45
42
  acl: {
46
43
  graphQlType: 'S3Acl',
47
- value: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,
44
+ value: fileParameters.acl,
48
45
  },
49
46
  }, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))
50
47
  }
@@ -60,7 +57,6 @@ namespace GenerateUploadUrlMutationBuilder {
60
57
  | 'PUBLIC_READ'
61
58
  | 'PRIVATE'
62
59
  | 'NONE'
63
- | GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>
64
60
 
65
61
  export type FileParameters = {
66
62
  contentType: string
package/src/index.ts CHANGED
@@ -1,23 +1,6 @@
1
- import * as CrudQueryBuilderTmp from './crudQueryBuilder'
2
-
3
- import * as GraphQlBuilderTmp from './graphQlBuilder'
4
-
5
- export { GraphQlLiteral } from './graphQlBuilder'
6
-
7
- export namespace GraphQlBuilder {
8
- export import GraphqlLiteral = GraphQlBuilderTmp.GraphQlLiteral
9
- export import GraphQlLiteral = GraphQlBuilderTmp.GraphQlLiteral
10
- }
11
-
12
- export namespace CrudQueryBuilder {
13
- export type OrderDirection = CrudQueryBuilderTmp.OrderDirection
14
- }
15
-
16
- export * from './content'
17
- export * from './graphQlClient'
18
- export * from './system'
19
- export * from './tenant'
1
+ export * from './GenerateUploadUrlMutationBuilder'
20
2
 
21
3
  export * from '@contember/client-content'
4
+ export * from '@contember/graphql-client'
22
5
 
23
6
  export type { Input, Value, Result, Writable } from '@contember/schema'
@@ -1,6 +1,5 @@
1
1
  import { expect, it, describe } from 'vitest'
2
- import { GenerateUploadUrlMutationBuilder } from '../../../src/content'
3
- import { GraphQlLiteral } from '../../../src/graphQlBuilder'
2
+ import { GenerateUploadUrlMutationBuilder } from '../../../src'
4
3
 
5
4
  describe('generate upload url mutation builder', () => {
6
5
  it('correctly creates a simple mutation', () => {
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const formatContentApiRelativeUrl = (projectSlug, stageSlug) => `/content/${projectSlug}/${stageSlug}`;
4
- exports.formatContentApiRelativeUrl = formatContentApiRelativeUrl;
5
- //# sourceMappingURL=formatContentApiRelativeUrl.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatContentApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;;"}
@@ -1,5 +0,0 @@
1
- const formatContentApiRelativeUrl = (projectSlug, stageSlug) => `/content/${projectSlug}/${stageSlug}`;
2
- export {
3
- formatContentApiRelativeUrl
4
- };
5
- //# sourceMappingURL=formatContentApiRelativeUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatContentApiRelativeUrl.js","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":"AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const GraphQlLiteral = require("../../graphQlBuilder/GraphQlLiteral.cjs");
4
- const whereToFilter = (by) => {
5
- const where = {};
6
- for (const key in by) {
7
- const value = by[key];
8
- if (value instanceof GraphQlLiteral.GraphQlLiteral || typeof value === "string" || typeof value === "number") {
9
- where[key] = { eq: value };
10
- } else {
11
- where[key] = whereToFilter(value);
12
- }
13
- }
14
- return where;
15
- };
16
- exports.whereToFilter = whereToFilter;
17
- //# sourceMappingURL=whereToFilter.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whereToFilter.cjs","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiBA,eAAAA,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;;"}
@@ -1,17 +0,0 @@
1
- import { GraphQlLiteral } from "../../graphQlBuilder/GraphQlLiteral.js";
2
- const whereToFilter = (by) => {
3
- const where = {};
4
- for (const key in by) {
5
- const value = by[key];
6
- if (value instanceof GraphQlLiteral || typeof value === "string" || typeof value === "number") {
7
- where[key] = { eq: value };
8
- } else {
9
- where[key] = whereToFilter(value);
10
- }
11
- }
12
- return where;
13
- };
14
- export {
15
- whereToFilter
16
- };
17
- //# sourceMappingURL=whereToFilter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whereToFilter.js","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":[],"mappings":";AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiB,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const GraphQlLiteral = require("../graphQlBuilder/GraphQlLiteral.cjs");
4
- const replaceGraphQlLiteral = (input) => {
5
- if (input instanceof GraphQlLiteral.GraphQlLiteral) {
6
- return input.value;
7
- } else if (Array.isArray(input)) {
8
- return input.map(replaceGraphQlLiteral);
9
- } else if (typeof input === "object" && input !== null) {
10
- return Object.fromEntries(Object.entries(input).map(([key, value]) => value !== void 0 ? [key, replaceGraphQlLiteral(value)] : void 0).filter(Boolean));
11
- }
12
- return input;
13
- };
14
- exports.replaceGraphQlLiteral = replaceGraphQlLiteral;
15
- //# sourceMappingURL=replaceGraphQlLiteral.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceGraphQlLiteral.cjs","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiBA,eAAAA,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;;"}
@@ -1,15 +0,0 @@
1
- import { GraphQlLiteral } from "../graphQlBuilder/GraphQlLiteral.js";
2
- const replaceGraphQlLiteral = (input) => {
3
- if (input instanceof GraphQlLiteral) {
4
- return input.value;
5
- } else if (Array.isArray(input)) {
6
- return input.map(replaceGraphQlLiteral);
7
- } else if (typeof input === "object" && input !== null) {
8
- return Object.fromEntries(Object.entries(input).map(([key, value]) => value !== void 0 ? [key, replaceGraphQlLiteral(value)] : void 0).filter(Boolean));
9
- }
10
- return input;
11
- };
12
- export {
13
- replaceGraphQlLiteral
14
- };
15
- //# sourceMappingURL=replaceGraphQlLiteral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceGraphQlLiteral.js","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":[],"mappings":";AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiB,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateUploadUrlMutationBuilder.cjs","sources":["../../../../../../packages/client/src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"sourcesContent":["import { GraphQlLiteral } from '../../graphQlBuilder'\nimport { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'\nimport { GraphQlBuilder } from '../../index'\nimport { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'\n\nclass GenerateUploadUrlMutationBuilder {\n\tprivate static generateUploadUrlFields = [\n\t\tnew GraphQlField(null, 'url'),\n\t\tnew GraphQlField(null, 'publicUrl'),\n\t\tnew GraphQlField(null, 'method'),\n\t\tnew GraphQlField(null, 'headers', {}, [\n\t\t\tnew GraphQlField(null, 'key'),\n\t\t\tnew GraphQlField(null, 'value'),\n\t\t]),\n\t]\n\t/**\n\t * @internal\n\t */\n\tpublic static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult {\n\t\tconst selectionItems: GraphQlSelectionSetItem[] = []\n\t\tfor (const alias in parameters) {\n\t\t\tconst fileParameters = parameters[alias]\n\t\t\tif (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {\n\t\t\t\tconst { contentType, prefix, expiration, acl, size, suffix, fileName, extension } = replaceGraphQlLiteral(fileParameters)\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tvalue: { contentType, prefix, expiration, acl, size, suffix, fileName, extension },\n\t\t\t\t\t\tgraphQlType: 'S3GenerateSignedUploadInput',\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t} else {\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tcontentType: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.contentType,\n\t\t\t\t\t},\n\t\t\t\t\texpiration: {\n\t\t\t\t\t\tgraphQlType: 'Int',\n\t\t\t\t\t\tvalue: fileParameters.expiration,\n\t\t\t\t\t},\n\t\t\t\t\tprefix: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.prefix,\n\t\t\t\t\t},\n\t\t\t\t\tacl: {\n\t\t\t\t\t\tgraphQlType: 'S3Acl',\n\t\t\t\t\t\tvalue: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t}\n\t\t}\n\n\t\tconst printer = new GraphQlQueryPrinter()\n\t\treturn printer.printDocument('mutation', selectionItems, {})\n\t}\n}\n\nnamespace GenerateUploadUrlMutationBuilder {\n\texport type Acl =\n\t\t| 'PUBLIC_READ'\n\t\t| 'PRIVATE'\n\t\t| 'NONE'\n\t\t| GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>\n\n\texport type FileParameters = {\n\t\tcontentType: string\n\t\texpiration?: number\n\t\tsize?: number\n\t\tprefix?: string\n\t\textension?: string\n\t\tsuffix?: string\n\t\tfileName?: string\n\t\tacl?: Acl\n\t}\n\n\texport interface MutationParameters {\n\t\t[alias: string]: FileParameters\n\t}\n\n\texport interface ResponseBody {\n\t\turl: string\n\t\tpublicUrl: string\n\t\tmethod: string\n\t\theaders: Array<{\n\t\t\tkey: string\n\t\t\tvalue: string\n\t\t}>\n\t}\n\n\texport interface MutationResponse {\n\t\t[alias: string]: ResponseBody\n\t}\n}\n\nexport { GenerateUploadUrlMutationBuilder }\n"],"names":["_GenerateUploadUrlMutationBuilder","replaceGraphQlLiteral","GraphQlField","GraphQlBuilder","GraphQlQueryPrinter"],"mappings":";;;;;;;;AAKA,MAAM,oCAAN,MAAMA,mCAAiC;AAAA;AAAA;AAAA;AAAA,EAatC,OAAc,WAAW,YAAqF;AAC7G,UAAM,iBAA4C,CAAA;AAClD,eAAW,SAAS,YAAY;AACzB,YAAA,iBAAiB,WAAW,KAAK;AACvC,UAAI,eAAe,UAAU,eAAe,YAAY,eAAe,WAAW;AAC3E,cAAA,EAAE,aAAa,QAAQ,YAAY,KAAK,MAAM,QAAQ,UAAU,UAAA,IAAcC,sBAAA,sBAAsB,cAAc;AACxH,uBAAe,KAAK,IAAIC,4BAAa,OAAO,qBAAqB;AAAA,UAChE,OAAO;AAAA,YACN,OAAO,EAAE,aAAa,QAAQ,YAAY,KAAK,MAAM,QAAQ,UAAU,UAAU;AAAA,YACjF,aAAa;AAAA,UACd;AAAA,QAAA,GACEF,mCAAiC,uBAAuB,CAAC;AAAA,MAAA,OACtD;AACN,uBAAe,KAAK,IAAIE,4BAAa,OAAO,qBAAqB;AAAA,UAChE,aAAa;AAAA,YACZ,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,YAAY;AAAA,YACX,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,YACP,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,KAAK;AAAA,YACJ,aAAa;AAAA,YACb,OAAO,eAAe,eAAeC,4BAAe,iBAAiB,eAAe,KAAK,QAAQ,eAAe;AAAA,UACjH;AAAA,QAAA,GACEH,mCAAiC,uBAAuB,CAAC;AAAA,MAC7D;AAAA,IACD;AAEM,UAAA,UAAU,IAAII,eAAAA;AACpB,WAAO,QAAQ,cAAc,YAAY,gBAAgB,CAAE,CAAA;AAAA,EAC5D;AACD;AAjDC,cADK,mCACU,2BAA0B;AAAA,EACxC,IAAIF,eAAa,aAAA,MAAM,KAAK;AAAA,EAC5B,IAAIA,eAAa,aAAA,MAAM,WAAW;AAAA,EAClC,IAAIA,eAAa,aAAA,MAAM,QAAQ;AAAA,EAC/B,IAAIA,4BAAa,MAAM,WAAW,IAAI;AAAA,IACrC,IAAIA,eAAa,aAAA,MAAM,KAAK;AAAA,IAC5B,IAAIA,eAAa,aAAA,MAAM,OAAO;AAAA,EAAA,CAC9B;AACF,CAAA;AATD,IAAM,mCAAN;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenerateUploadUrlMutationBuilder.js","sources":["../../../../../../packages/client/src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"sourcesContent":["import { GraphQlLiteral } from '../../graphQlBuilder'\nimport { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'\nimport { GraphQlBuilder } from '../../index'\nimport { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'\n\nclass GenerateUploadUrlMutationBuilder {\n\tprivate static generateUploadUrlFields = [\n\t\tnew GraphQlField(null, 'url'),\n\t\tnew GraphQlField(null, 'publicUrl'),\n\t\tnew GraphQlField(null, 'method'),\n\t\tnew GraphQlField(null, 'headers', {}, [\n\t\t\tnew GraphQlField(null, 'key'),\n\t\t\tnew GraphQlField(null, 'value'),\n\t\t]),\n\t]\n\t/**\n\t * @internal\n\t */\n\tpublic static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult {\n\t\tconst selectionItems: GraphQlSelectionSetItem[] = []\n\t\tfor (const alias in parameters) {\n\t\t\tconst fileParameters = parameters[alias]\n\t\t\tif (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {\n\t\t\t\tconst { contentType, prefix, expiration, acl, size, suffix, fileName, extension } = replaceGraphQlLiteral(fileParameters)\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tvalue: { contentType, prefix, expiration, acl, size, suffix, fileName, extension },\n\t\t\t\t\t\tgraphQlType: 'S3GenerateSignedUploadInput',\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t} else {\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tcontentType: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.contentType,\n\t\t\t\t\t},\n\t\t\t\t\texpiration: {\n\t\t\t\t\t\tgraphQlType: 'Int',\n\t\t\t\t\t\tvalue: fileParameters.expiration,\n\t\t\t\t\t},\n\t\t\t\t\tprefix: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.prefix,\n\t\t\t\t\t},\n\t\t\t\t\tacl: {\n\t\t\t\t\t\tgraphQlType: 'S3Acl',\n\t\t\t\t\t\tvalue: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t}\n\t\t}\n\n\t\tconst printer = new GraphQlQueryPrinter()\n\t\treturn printer.printDocument('mutation', selectionItems, {})\n\t}\n}\n\nnamespace GenerateUploadUrlMutationBuilder {\n\texport type Acl =\n\t\t| 'PUBLIC_READ'\n\t\t| 'PRIVATE'\n\t\t| 'NONE'\n\t\t| GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>\n\n\texport type FileParameters = {\n\t\tcontentType: string\n\t\texpiration?: number\n\t\tsize?: number\n\t\tprefix?: string\n\t\textension?: string\n\t\tsuffix?: string\n\t\tfileName?: string\n\t\tacl?: Acl\n\t}\n\n\texport interface MutationParameters {\n\t\t[alias: string]: FileParameters\n\t}\n\n\texport interface ResponseBody {\n\t\turl: string\n\t\tpublicUrl: string\n\t\tmethod: string\n\t\theaders: Array<{\n\t\t\tkey: string\n\t\t\tvalue: string\n\t\t}>\n\t}\n\n\texport interface MutationResponse {\n\t\t[alias: string]: ResponseBody\n\t}\n}\n\nexport { GenerateUploadUrlMutationBuilder }\n"],"names":["_GenerateUploadUrlMutationBuilder"],"mappings":";;;;;;AAKA,MAAM,oCAAN,MAAMA,mCAAiC;AAAA;AAAA;AAAA;AAAA,EAatC,OAAc,WAAW,YAAqF;AAC7G,UAAM,iBAA4C,CAAA;AAClD,eAAW,SAAS,YAAY;AACzB,YAAA,iBAAiB,WAAW,KAAK;AACvC,UAAI,eAAe,UAAU,eAAe,YAAY,eAAe,WAAW;AAC3E,cAAA,EAAE,aAAa,QAAQ,YAAY,KAAK,MAAM,QAAQ,UAAU,UAAA,IAAc,sBAAsB,cAAc;AACxH,uBAAe,KAAK,IAAI,aAAa,OAAO,qBAAqB;AAAA,UAChE,OAAO;AAAA,YACN,OAAO,EAAE,aAAa,QAAQ,YAAY,KAAK,MAAM,QAAQ,UAAU,UAAU;AAAA,YACjF,aAAa;AAAA,UACd;AAAA,QAAA,GACEA,mCAAiC,uBAAuB,CAAC;AAAA,MAAA,OACtD;AACN,uBAAe,KAAK,IAAI,aAAa,OAAO,qBAAqB;AAAA,UAChE,aAAa;AAAA,YACZ,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,YAAY;AAAA,YACX,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,YACP,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,KAAK;AAAA,YACJ,aAAa;AAAA,YACb,OAAO,eAAe,eAAe,eAAe,iBAAiB,eAAe,KAAK,QAAQ,eAAe;AAAA,UACjH;AAAA,QAAA,GACEA,mCAAiC,uBAAuB,CAAC;AAAA,MAC7D;AAAA,IACD;AAEM,UAAA,UAAU,IAAI;AACpB,WAAO,QAAQ,cAAc,YAAY,gBAAgB,CAAE,CAAA;AAAA,EAC5D;AACD;AAjDC,cADK,mCACU,2BAA0B;AAAA,EACxC,IAAI,aAAa,MAAM,KAAK;AAAA,EAC5B,IAAI,aAAa,MAAM,WAAW;AAAA,EAClC,IAAI,aAAa,MAAM,QAAQ;AAAA,EAC/B,IAAI,aAAa,MAAM,WAAW,IAAI;AAAA,IACrC,IAAI,aAAa,MAAM,KAAK;AAAA,IAC5B,IAAI,aAAa,MAAM,OAAO;AAAA,EAAA,CAC9B;AACF,CAAA;AATD,IAAM,mCAAN;"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- class GraphQlLiteral {
4
- constructor(value) {
5
- this.value = value;
6
- {
7
- console.warn("GraphQlLiteral is deprecated, use the value directly instead.");
8
- }
9
- }
10
- toString() {
11
- return `Literal(${this.value})`;
12
- }
13
- }
14
- exports.GraphQlLiteral = GraphQlLiteral;
15
- //# sourceMappingURL=GraphQlLiteral.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQlLiteral.cjs","sources":["../../../../../packages/client/src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["/**\n * @deprecated Directly use the value instead.\n */\nexport class GraphQlLiteral<Value extends string = string> {\n\tconstructor(public readonly value: Value) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.warn('GraphQlLiteral is deprecated, use the value directly instead.')\n\t\t}\n\t}\n\n\tpublic toString() {\n\t\treturn `Literal(${this.value})`\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAA8C;AAAA,EAC1D,YAA4B,OAAc;AAAd,SAAA,QAAA;AACF;AACxB,cAAQ,KAAK,+DAA+D;AAAA,IAC7E;AAAA,EACD;AAAA,EAEO,WAAW;AACV,WAAA,WAAW,KAAK,KAAK;AAAA,EAC7B;AACD;;"}
@@ -1,15 +0,0 @@
1
- class GraphQlLiteral {
2
- constructor(value) {
3
- this.value = value;
4
- {
5
- console.warn("GraphQlLiteral is deprecated, use the value directly instead.");
6
- }
7
- }
8
- toString() {
9
- return `Literal(${this.value})`;
10
- }
11
- }
12
- export {
13
- GraphQlLiteral
14
- };
15
- //# sourceMappingURL=GraphQlLiteral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQlLiteral.js","sources":["../../../../../packages/client/src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["/**\n * @deprecated Directly use the value instead.\n */\nexport class GraphQlLiteral<Value extends string = string> {\n\tconstructor(public readonly value: Value) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.warn('GraphQlLiteral is deprecated, use the value directly instead.')\n\t\t}\n\t}\n\n\tpublic toString() {\n\t\treturn `Literal(${this.value})`\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,eAA8C;AAAA,EAC1D,YAA4B,OAAc;AAAd,SAAA,QAAA;AACF;AACxB,cAAQ,KAAK,+DAA+D;AAAA,IAC7E;AAAA,EACD;AAAA,EAEO,WAAW;AACV,WAAA,WAAW,KAAK,KAAK;AAAA,EAC7B;AACD;"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const graphqlClient = require("@contember/graphql-client");
4
- class GraphQlClient extends graphqlClient.GraphQlClient {
5
- /**
6
- * @deprecated use execute
7
- */
8
- async sendRequest(query, options = {}) {
9
- console.debug(query);
10
- const response = await this.doExecute(query, {
11
- ...options,
12
- apiToken: options.apiTokenOverride ?? options.apiToken
13
- });
14
- if (response.ok) {
15
- return await response.json();
16
- }
17
- const failedRequest = {
18
- status: response.status,
19
- statusText: response.statusText,
20
- responseText: await response.text()
21
- };
22
- return Promise.reject(failedRequest);
23
- }
24
- }
25
- exports.GraphQlClient = GraphQlClient;
26
- //# sourceMappingURL=GraphQlClient.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQlClient.cjs","sources":["../../../../../packages/client/src/graphQlClient/GraphQlClient.ts"],"sourcesContent":["import { GraphQlClient as BaseGraphQLClient, GraphQlClientRequestOptions as BaseGraphQlClientRequestOptions } from '@contember/graphql-client'\n\nexport interface GraphQlClientRequestOptions extends BaseGraphQlClientRequestOptions {\n\t/**\n\t * @deprecated use apiToken\n\t */\n\tapiTokenOverride?: string\n}\n\nexport type GraphQlClientFailedRequestMetadata = Pick<Response, 'status' | 'statusText'> & {\n\tresponseText: string\n}\n\nexport class GraphQlClient extends BaseGraphQLClient {\n\t/**\n\t * @deprecated use execute\n\t */\n\tasync sendRequest<T = unknown>(query: string, options: GraphQlClientRequestOptions = {}): Promise<T> {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.debug(query)\n\t\tconst response = await this.doExecute(query, {\n\t\t\t...options,\n\t\t\tapiToken: options.apiTokenOverride ?? options.apiToken,\n\t\t})\n\n\t\tif (response.ok) {\n\t\t\t// It may still have errors (e.g. unfilled fields) but as far as the request goes, it is ok.\n\t\t\treturn await response.json()\n\t\t}\n\n\t\tconst failedRequest: GraphQlClientFailedRequestMetadata = {\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\tresponseText: await response.text(),\n\t\t}\n\n\t\treturn Promise.reject(failedRequest)\n\t}\n\n}\n"],"names":["BaseGraphQLClient"],"mappings":";;;AAaO,MAAM,sBAAsBA,cAAAA,cAAkB;AAAA;AAAA;AAAA;AAAA,EAIpD,MAAM,YAAyB,OAAe,UAAuC,IAAgB;AAEpG,YAAQ,MAAM,KAAK;AACnB,UAAM,WAAW,MAAM,KAAK,UAAU,OAAO;AAAA,MAC5C,GAAG;AAAA,MACH,UAAU,QAAQ,oBAAoB,QAAQ;AAAA,IAAA,CAC9C;AAED,QAAI,SAAS,IAAI;AAET,aAAA,MAAM,SAAS;IACvB;AAEA,UAAM,gBAAoD;AAAA,MACzD,QAAQ,SAAS;AAAA,MACjB,YAAY,SAAS;AAAA,MACrB,cAAc,MAAM,SAAS,KAAK;AAAA,IAAA;AAG5B,WAAA,QAAQ,OAAO,aAAa;AAAA,EACpC;AAED;;"}
@@ -1,26 +0,0 @@
1
- import { GraphQlClient as GraphQlClient$1 } from "@contember/graphql-client";
2
- class GraphQlClient extends GraphQlClient$1 {
3
- /**
4
- * @deprecated use execute
5
- */
6
- async sendRequest(query, options = {}) {
7
- console.debug(query);
8
- const response = await this.doExecute(query, {
9
- ...options,
10
- apiToken: options.apiTokenOverride ?? options.apiToken
11
- });
12
- if (response.ok) {
13
- return await response.json();
14
- }
15
- const failedRequest = {
16
- status: response.status,
17
- statusText: response.statusText,
18
- responseText: await response.text()
19
- };
20
- return Promise.reject(failedRequest);
21
- }
22
- }
23
- export {
24
- GraphQlClient
25
- };
26
- //# sourceMappingURL=GraphQlClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQlClient.js","sources":["../../../../../packages/client/src/graphQlClient/GraphQlClient.ts"],"sourcesContent":["import { GraphQlClient as BaseGraphQLClient, GraphQlClientRequestOptions as BaseGraphQlClientRequestOptions } from '@contember/graphql-client'\n\nexport interface GraphQlClientRequestOptions extends BaseGraphQlClientRequestOptions {\n\t/**\n\t * @deprecated use apiToken\n\t */\n\tapiTokenOverride?: string\n}\n\nexport type GraphQlClientFailedRequestMetadata = Pick<Response, 'status' | 'statusText'> & {\n\tresponseText: string\n}\n\nexport class GraphQlClient extends BaseGraphQLClient {\n\t/**\n\t * @deprecated use execute\n\t */\n\tasync sendRequest<T = unknown>(query: string, options: GraphQlClientRequestOptions = {}): Promise<T> {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.debug(query)\n\t\tconst response = await this.doExecute(query, {\n\t\t\t...options,\n\t\t\tapiToken: options.apiTokenOverride ?? options.apiToken,\n\t\t})\n\n\t\tif (response.ok) {\n\t\t\t// It may still have errors (e.g. unfilled fields) but as far as the request goes, it is ok.\n\t\t\treturn await response.json()\n\t\t}\n\n\t\tconst failedRequest: GraphQlClientFailedRequestMetadata = {\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\tresponseText: await response.text(),\n\t\t}\n\n\t\treturn Promise.reject(failedRequest)\n\t}\n\n}\n"],"names":["BaseGraphQLClient"],"mappings":";AAaO,MAAM,sBAAsBA,gBAAkB;AAAA;AAAA;AAAA;AAAA,EAIpD,MAAM,YAAyB,OAAe,UAAuC,IAAgB;AAEpG,YAAQ,MAAM,KAAK;AACnB,UAAM,WAAW,MAAM,KAAK,UAAU,OAAO;AAAA,MAC5C,GAAG;AAAA,MACH,UAAU,QAAQ,oBAAoB,QAAQ;AAAA,IAAA,CAC9C;AAED,QAAI,SAAS,IAAI;AAET,aAAA,MAAM,SAAS;IACvB;AAEA,UAAM,gBAAoD;AAAA,MACzD,QAAQ,SAAS;AAAA,MACjB,YAAY,SAAS;AAAA,MACrB,cAAc,MAAM,SAAS,KAAK;AAAA,IAAA;AAG5B,WAAA,QAAQ,OAAO,aAAa;AAAA,EACpC;AAED;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const formatSystemApiRelativeUrl = (projectSlug) => `/system/${projectSlug}`;
4
- exports.formatSystemApiRelativeUrl = formatSystemApiRelativeUrl;
5
- //# sourceMappingURL=formatSystemApiRelativeUrl.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatSystemApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/system/formatSystemApiRelativeUrl.ts"],"sourcesContent":["export const formatSystemApiRelativeUrl = (projectSlug: string) => `/system/${projectSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,6BAA6B,CAAC,gBAAwB,WAAW,WAAW;;"}
@@ -1,5 +0,0 @@
1
- const formatSystemApiRelativeUrl = (projectSlug) => `/system/${projectSlug}`;
2
- export {
3
- formatSystemApiRelativeUrl
4
- };
5
- //# sourceMappingURL=formatSystemApiRelativeUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatSystemApiRelativeUrl.js","sources":["../../../../../packages/client/src/system/formatSystemApiRelativeUrl.ts"],"sourcesContent":["export const formatSystemApiRelativeUrl = (projectSlug: string) => `/system/${projectSlug}`\n"],"names":[],"mappings":"AAAO,MAAM,6BAA6B,CAAC,gBAAwB,WAAW,WAAW;"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const loginMutation = `
4
- mutation($email: String!, $password: String!, $expiration: Int) {
5
- signIn(email: $email, password: $password, expiration: $expiration) {
6
- ok
7
- errors {
8
- endUserMessage
9
- code
10
- }
11
- result {
12
- token
13
- person {
14
- id
15
- email
16
- identity {
17
- id
18
- projects {
19
- project {
20
- id
21
- slug
22
- }
23
- memberships {
24
- role
25
- }
26
- }
27
- }
28
- }
29
- }
30
- }
31
- }
32
- `;
33
- exports.loginMutation = loginMutation;
34
- //# sourceMappingURL=loginMutation.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loginMutation.cjs","sources":["../../../../../packages/client/src/tenant/loginMutation.ts"],"sourcesContent":["export interface LoginMutationResponse {\n\tdata: {\n\t\tsignIn: {\n\t\t\tok: boolean\n\t\t\terrors: Array<{\n\t\t\t\tendUserMessage: string | null\n\t\t\t\tcode: string\n\t\t\t}>\n\t\t\tresult: {\n\t\t\t\ttoken: string\n\t\t\t\tperson: {\n\t\t\t\t\tid: string\n\t\t\t\t\temail: string\n\t\t\t\t\tidentity: {\n\t\t\t\t\t\tid: string\n\t\t\t\t\t\tprojects: Array<{\n\t\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t\tid: string\n\t\t\t\t\t\t\t\tslug: string\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships: Array<{\n\t\t\t\t\t\t\t\trole: string\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t}>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} | null\n\t\t}\n\t}\n}\n\nexport const loginMutation = `\n\tmutation($email: String!, $password: String!, $expiration: Int) {\n\t\tsignIn(email: $email, password: $password, expiration: $expiration) {\n\t\t\tok\n\t\t\terrors {\n\t\t\t\tendUserMessage\n\t\t\t\tcode\n\t\t\t}\n\t\t\tresult {\n\t\t\t\ttoken\n\t\t\t\tperson {\n\t\t\t\t\tid\n\t\t\t\t\temail\n\t\t\t\t\tidentity {\n\t\t\t\t\t\tid\n\t\t\t\t\t\tprojects {\n\t\t\t\t\t\t\tproject {\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships {\n\t\t\t\t\t\t\t\trole\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n`\n"],"names":[],"mappings":";;AA+BO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;"}
@@ -1,34 +0,0 @@
1
- const loginMutation = `
2
- mutation($email: String!, $password: String!, $expiration: Int) {
3
- signIn(email: $email, password: $password, expiration: $expiration) {
4
- ok
5
- errors {
6
- endUserMessage
7
- code
8
- }
9
- result {
10
- token
11
- person {
12
- id
13
- email
14
- identity {
15
- id
16
- projects {
17
- project {
18
- id
19
- slug
20
- }
21
- memberships {
22
- role
23
- }
24
- }
25
- }
26
- }
27
- }
28
- }
29
- }
30
- `;
31
- export {
32
- loginMutation
33
- };
34
- //# sourceMappingURL=loginMutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loginMutation.js","sources":["../../../../../packages/client/src/tenant/loginMutation.ts"],"sourcesContent":["export interface LoginMutationResponse {\n\tdata: {\n\t\tsignIn: {\n\t\t\tok: boolean\n\t\t\terrors: Array<{\n\t\t\t\tendUserMessage: string | null\n\t\t\t\tcode: string\n\t\t\t}>\n\t\t\tresult: {\n\t\t\t\ttoken: string\n\t\t\t\tperson: {\n\t\t\t\t\tid: string\n\t\t\t\t\temail: string\n\t\t\t\t\tidentity: {\n\t\t\t\t\t\tid: string\n\t\t\t\t\t\tprojects: Array<{\n\t\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t\tid: string\n\t\t\t\t\t\t\t\tslug: string\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships: Array<{\n\t\t\t\t\t\t\t\trole: string\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t}>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} | null\n\t\t}\n\t}\n}\n\nexport const loginMutation = `\n\tmutation($email: String!, $password: String!, $expiration: Int) {\n\t\tsignIn(email: $email, password: $password, expiration: $expiration) {\n\t\t\tok\n\t\t\terrors {\n\t\t\t\tendUserMessage\n\t\t\t\tcode\n\t\t\t}\n\t\t\tresult {\n\t\t\t\ttoken\n\t\t\t\tperson {\n\t\t\t\t\tid\n\t\t\t\t\temail\n\t\t\t\t\tidentity {\n\t\t\t\t\t\tid\n\t\t\t\t\t\tprojects {\n\t\t\t\t\t\t\tproject {\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships {\n\t\t\t\t\t\t\t\trole\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n`\n"],"names":[],"mappings":"AA+BO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tenantApiRelativeUrl = "/tenant";
4
- exports.tenantApiRelativeUrl = tenantApiRelativeUrl;
5
- //# sourceMappingURL=tenantApiRelativeUrl.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenantApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/tenant/tenantApiRelativeUrl.ts"],"sourcesContent":["export const tenantApiRelativeUrl = '/tenant'\n"],"names":[],"mappings":";;AAAO,MAAM,uBAAuB;;"}
@@ -1,5 +0,0 @@
1
- const tenantApiRelativeUrl = "/tenant";
2
- export {
3
- tenantApiRelativeUrl
4
- };
5
- //# sourceMappingURL=tenantApiRelativeUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenantApiRelativeUrl.js","sources":["../../../../../packages/client/src/tenant/tenantApiRelativeUrl.ts"],"sourcesContent":["export const tenantApiRelativeUrl = '/tenant'\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB;"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tenantErrorMessages = {
4
- TOO_WEAK: "Password is too weak.",
5
- EMAIL_ALREADY_EXISTS: "Email already exists.",
6
- UNKNOWN_EMAIL: "Unknown email.",
7
- INVALID_PASSWORD: "Password is invalid.",
8
- ALREADY_MEMBER: "User is already a member of this project."
9
- };
10
- const getTenantErrorMessage = (errorCode) => {
11
- if (errorCode in tenantErrorMessages) {
12
- return tenantErrorMessages[errorCode];
13
- }
14
- return `Unknown error occurred. [${errorCode}]`;
15
- };
16
- exports.getTenantErrorMessage = getTenantErrorMessage;
17
- exports.tenantErrorMessages = tenantErrorMessages;
18
- //# sourceMappingURL=tenantErrorMessages.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenantErrorMessages.cjs","sources":["../../../../../packages/client/src/tenant/tenantErrorMessages.ts"],"sourcesContent":["export const tenantErrorMessages: { [key: string]: string } = {\n\tTOO_WEAK: 'Password is too weak.',\n\tEMAIL_ALREADY_EXISTS: 'Email already exists.',\n\tUNKNOWN_EMAIL: 'Unknown email.',\n\tINVALID_PASSWORD: 'Password is invalid.',\n\tALREADY_MEMBER: 'User is already a member of this project.',\n}\n\nexport const getTenantErrorMessage = (errorCode: string): string => {\n\tif (errorCode in tenantErrorMessages) {\n\t\treturn tenantErrorMessages[errorCode]\n\t}\n\treturn `Unknown error occurred. [${errorCode}]`\n}\n"],"names":[],"mappings":";;AAAO,MAAM,sBAAiD;AAAA,EAC7D,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,gBAAgB;AACjB;AAEa,MAAA,wBAAwB,CAAC,cAA8B;AACnE,MAAI,aAAa,qBAAqB;AACrC,WAAO,oBAAoB,SAAS;AAAA,EACrC;AACA,SAAO,4BAA4B,SAAS;AAC7C;;;"}
@@ -1,18 +0,0 @@
1
- const tenantErrorMessages = {
2
- TOO_WEAK: "Password is too weak.",
3
- EMAIL_ALREADY_EXISTS: "Email already exists.",
4
- UNKNOWN_EMAIL: "Unknown email.",
5
- INVALID_PASSWORD: "Password is invalid.",
6
- ALREADY_MEMBER: "User is already a member of this project."
7
- };
8
- const getTenantErrorMessage = (errorCode) => {
9
- if (errorCode in tenantErrorMessages) {
10
- return tenantErrorMessages[errorCode];
11
- }
12
- return `Unknown error occurred. [${errorCode}]`;
13
- };
14
- export {
15
- getTenantErrorMessage,
16
- tenantErrorMessages
17
- };
18
- //# sourceMappingURL=tenantErrorMessages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenantErrorMessages.js","sources":["../../../../../packages/client/src/tenant/tenantErrorMessages.ts"],"sourcesContent":["export const tenantErrorMessages: { [key: string]: string } = {\n\tTOO_WEAK: 'Password is too weak.',\n\tEMAIL_ALREADY_EXISTS: 'Email already exists.',\n\tUNKNOWN_EMAIL: 'Unknown email.',\n\tINVALID_PASSWORD: 'Password is invalid.',\n\tALREADY_MEMBER: 'User is already a member of this project.',\n}\n\nexport const getTenantErrorMessage = (errorCode: string): string => {\n\tif (errorCode in tenantErrorMessages) {\n\t\treturn tenantErrorMessages[errorCode]\n\t}\n\treturn `Unknown error occurred. [${errorCode}]`\n}\n"],"names":[],"mappings":"AAAO,MAAM,sBAAiD;AAAA,EAC7D,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,gBAAgB;AACjB;AAEa,MAAA,wBAAwB,CAAC,cAA8B;AACnE,MAAI,aAAa,qBAAqB;AACrC,WAAO,oBAAoB,SAAS;AAAA,EACrC;AACA,SAAO,4BAA4B,SAAS;AAC7C;"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const formatContentApiRelativeUrl = (projectSlug, stageSlug) => `/content/${projectSlug}/${stageSlug}`;
4
- exports.formatContentApiRelativeUrl = formatContentApiRelativeUrl;
5
- //# sourceMappingURL=formatContentApiRelativeUrl.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatContentApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;;"}
@@ -1,5 +0,0 @@
1
- const formatContentApiRelativeUrl = (projectSlug, stageSlug) => `/content/${projectSlug}/${stageSlug}`;
2
- export {
3
- formatContentApiRelativeUrl
4
- };
5
- //# sourceMappingURL=formatContentApiRelativeUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatContentApiRelativeUrl.js","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":"AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const GraphQlLiteral = require("../../graphQlBuilder/GraphQlLiteral.cjs");
4
- const whereToFilter = (by) => {
5
- const where = {};
6
- for (const key in by) {
7
- const value = by[key];
8
- if (value instanceof GraphQlLiteral.GraphQlLiteral || typeof value === "string" || typeof value === "number") {
9
- where[key] = { eq: value };
10
- } else {
11
- where[key] = whereToFilter(value);
12
- }
13
- }
14
- return where;
15
- };
16
- exports.whereToFilter = whereToFilter;
17
- //# sourceMappingURL=whereToFilter.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whereToFilter.cjs","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiBA,eAAAA,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;;"}
@@ -1,17 +0,0 @@
1
- import { GraphQlLiteral } from "../../graphQlBuilder/GraphQlLiteral.js";
2
- const whereToFilter = (by) => {
3
- const where = {};
4
- for (const key in by) {
5
- const value = by[key];
6
- if (value instanceof GraphQlLiteral || typeof value === "string" || typeof value === "number") {
7
- where[key] = { eq: value };
8
- } else {
9
- where[key] = whereToFilter(value);
10
- }
11
- }
12
- return where;
13
- };
14
- export {
15
- whereToFilter
16
- };
17
- //# sourceMappingURL=whereToFilter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whereToFilter.js","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":[],"mappings":";AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiB,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const GraphQlLiteral = require("../graphQlBuilder/GraphQlLiteral.cjs");
4
- const replaceGraphQlLiteral = (input) => {
5
- if (input instanceof GraphQlLiteral.GraphQlLiteral) {
6
- return input.value;
7
- } else if (Array.isArray(input)) {
8
- return input.map(replaceGraphQlLiteral);
9
- } else if (typeof input === "object" && input !== null) {
10
- return Object.fromEntries(Object.entries(input).map(([key, value]) => value !== void 0 ? [key, replaceGraphQlLiteral(value)] : void 0).filter(Boolean));
11
- }
12
- return input;
13
- };
14
- exports.replaceGraphQlLiteral = replaceGraphQlLiteral;
15
- //# sourceMappingURL=replaceGraphQlLiteral.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceGraphQlLiteral.cjs","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiBA,eAAAA,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;;"}
@@ -1,15 +0,0 @@
1
- import { GraphQlLiteral } from "../graphQlBuilder/GraphQlLiteral.js";
2
- const replaceGraphQlLiteral = (input) => {
3
- if (input instanceof GraphQlLiteral) {
4
- return input.value;
5
- } else if (Array.isArray(input)) {
6
- return input.map(replaceGraphQlLiteral);
7
- } else if (typeof input === "object" && input !== null) {
8
- return Object.fromEntries(Object.entries(input).map(([key, value]) => value !== void 0 ? [key, replaceGraphQlLiteral(value)] : void 0).filter(Boolean));
9
- }
10
- return input;
11
- };
12
- export {
13
- replaceGraphQlLiteral
14
- };
15
- //# sourceMappingURL=replaceGraphQlLiteral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceGraphQlLiteral.js","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":[],"mappings":";AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiB,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;"}