@remkoj/optimizely-graph-functions 2.0.4 → 2.1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@remkoj/optimizely-graph-functions",
3
3
  "license": "Apache-2.0",
4
- "version": "2.0.4",
4
+ "version": "2.1.0",
5
5
  "packageManager": "yarn@4.1.1",
6
6
  "repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
7
7
  "author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
@@ -16,7 +16,8 @@
16
16
  "./plugin": "./dist/index.js",
17
17
  "./preset": "./dist/preset.js",
18
18
  "./transform": "./dist/transform.js",
19
- "./documents": "./dist/documents.js"
19
+ "./documents": "./dist/documents/index.js",
20
+ "./loader": "./dist/embedded-loader.js"
20
21
  },
21
22
  "typesVersions": {
22
23
  "*": {
@@ -27,19 +28,22 @@
27
28
  "dist/preset.d.ts"
28
29
  ],
29
30
  "documents": [
30
- "dist/documents.d.ts"
31
+ "dist/documents/index.d.ts"
31
32
  ],
32
33
  "transform": [
33
34
  "dist/transform.d.ts"
35
+ ],
36
+ "loader": [
37
+ "./dist/embedded-loader.d.ts"
34
38
  ]
35
39
  }
36
40
  },
37
41
  "devDependencies": {
38
- "@types/node": "^22.2.0",
42
+ "@types/node": "^22.7.4",
39
43
  "graphql": "^16.9.0",
40
44
  "graphql-request": "^6.1.0",
41
45
  "graphql-tag": "^2.12.6",
42
- "typescript": "^5.5.4"
46
+ "typescript": "^5.6.2"
43
47
  },
44
48
  "dependencies": {
45
49
  "@graphql-codegen/add": "^5.0.3",
@@ -48,21 +52,19 @@
48
52
  "@graphql-codegen/typescript": "^4.0.9",
49
53
  "@graphql-codegen/typescript-graphql-request": "^6.2.0",
50
54
  "@graphql-codegen/typescript-operations": "^4.2.3",
51
- "tslib": "^2.6.3"
55
+ "tslib": "^2.7.0"
52
56
  },
53
57
  "scripts": {
54
- "clean": "tsc --clean",
58
+ "clean": "tsc --build --clean",
55
59
  "prepare": "tsc --build",
56
60
  "recompile": "tsc --build --clean && tsc --build --force",
57
61
  "watch": "yarn tsc --watch"
58
62
  },
59
63
  "peerDependencies": {
60
64
  "@graphql-typed-document-node/core": "*",
65
+ "@remkoj/optimizely-graph-client": "2.1.0",
61
66
  "graphql": "*",
62
67
  "graphql-request": "^6.1.0",
63
68
  "graphql-tag": "*"
64
- },
65
- "optionalDependencies": {
66
- "@remkoj/optimizely-graph-client": "2.0.4"
67
69
  }
68
70
  }
@@ -1,4 +0,0 @@
1
- export declare const IContentDataProps: string[];
2
- export declare const fragments: string[];
3
- export declare const queries: string[];
4
- export declare const DefaultFunctions: string[];
package/dist/documents.js DELETED
@@ -1,138 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultFunctions = exports.queries = exports.fragments = exports.IContentDataProps = void 0;
4
- exports.IContentDataProps = ["contentType", "id", "locale", "path", "__typename"];
5
- exports.fragments = [
6
- `fragment IContentData on _IContent
7
- {
8
- _metadata {
9
- ...IContentInfo
10
- }
11
- _type: __typename
12
- }`,
13
- `fragment CompositionData on ICompositionNode {
14
- name: displayName
15
- layoutType: nodeType
16
- type
17
- key
18
- template: displayTemplateKey
19
- settings: displaySettings {
20
- key
21
- value
22
- }
23
- ... on ICompositionStructureNode {
24
- nodes @recursive(depth: 10) {
25
- name: displayName
26
- }
27
- }
28
- ... on ICompositionElementNode {
29
- element {
30
- ...ElementData
31
- }
32
- }
33
- }`,
34
- `fragment IElementData on _IElement {
35
- _metadata {
36
- ...IContentInfo
37
- }
38
- _type: __typename
39
- }`,
40
- `fragment ElementData on _IElement {
41
- ...IElementData
42
- }`,
43
- `fragment BlockData on _IContent {
44
- ...IContentData
45
- }`,
46
- `fragment PageData on _IContent {
47
- ...IContentData
48
- }`,
49
- `fragment LinkData on ContentUrl {
50
- base
51
- hierarchical
52
- default
53
- }`,
54
- `fragment ReferenceData on ContentReference {
55
- key
56
- url {
57
- ...LinkData
58
- }
59
- }`,
60
- `fragment IContentInfo on IContentMetadata {
61
- key
62
- locale
63
- types
64
- displayName
65
- version
66
- url {
67
- ...LinkData
68
- }
69
- }`,
70
- `fragment IContentListItem on _IContent {
71
- ...IContentData
72
- }`,
73
- `fragment ExperienceData on _IExperience {
74
- composition {
75
- ...CompositionData
76
- }
77
- }`,
78
- `fragment LinkItemData on Link {
79
- title
80
- text
81
- target
82
- url {
83
- ...LinkData
84
- }
85
- }`
86
- ];
87
- exports.queries = [
88
- `query getContentById($key: String!, $version: String, $locale: [Locales!], $path: String, $domain: String) {
89
- content: _Content(
90
- where: {
91
- _or: [
92
- { _metadata: { key: { eq: $key }, version: { eq: $version } } }
93
- { _metadata: { url: { hierarchical: { eq: $path }, base: { eq: $domain } }, version: { eq: $version } } }
94
- ]
95
- }
96
- locale: $locale
97
- ) {
98
- total
99
- items {
100
- ...BlockData
101
- ...PageData
102
- }
103
- }
104
- }`,
105
- `query getContentByPath($path: String!, $version: String, $locale: [Locales!], $domain: String) {
106
- content: _Content(
107
- where: {
108
- _metadata: { url: { default: { eq: $path }, base: { eq: $domain } }, version: { eq: $version }}
109
- }
110
- locale: $locale
111
- ) {
112
- total
113
- items {
114
- ...PageData
115
- }
116
- }
117
- }`,
118
- `query getContentType($key: String!, $version: String, $locale: [Locales!], $path: String, $domain: String) {
119
- content: _Content(
120
- where: {
121
- _or: [
122
- { _metadata: { key: { eq: $key }, version: { eq: $version } } }
123
- { _metadata: { url: { hierarchical: { eq: $path }, base: { eq: $domain } }, version: { eq: $version } } }
124
- ]
125
- }
126
- locale: $locale
127
- ) {
128
- total
129
- items {
130
- _metadata {
131
- types
132
- }
133
- }
134
- }
135
- }`
136
- ];
137
- exports.DefaultFunctions = ['getContentType', 'getContentByPath', 'getContentById'];
138
- //# sourceMappingURL=documents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,EAAC,YAAY,CAAC,CAAA;AAErE,QAAA,SAAS,GAAG;IACzB;;;;;;EAME;IACF;;;;;;;;;;;;;;;;;;;;EAoBE;IACF;;;;;EAKE;IACF;;EAEE;IACF;;EAEE;IACF;;EAEE;IACF;;;;EAIE;IACF;;;;;EAKE;IACF;;;;;;;;;EASE;IACF;;EAEE;IACF;;;;EAIE;IACF;;;;;;;EAOE;CACD,CAAA;AACY,QAAA,OAAO,GAAG;IACvB;;;;;;;;;;;;;;;;EAgBE;IACF;;;;;;;;;;;;EAYE;IACF;;;;;;;;;;;;;;;;;EAiBE;CACD,CAAA;AAEY,QAAA,gBAAgB,GAAG,CAAC,gBAAgB,EAAC,kBAAkB,EAAC,gBAAgB,CAAC,CAAA"}