@remkoj/optimizely-graph-client 1.0.3 → 2.0.0-pre1

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 (81) hide show
  1. package/dist/admin-api/client/OptimizelyGraphAdminApi.js +1 -1
  2. package/dist/admin-api/client/core/OpenAPI.js +1 -1
  3. package/dist/admin-api/client/index.d.ts +1 -0
  4. package/dist/admin-api/client/index.js +1 -0
  5. package/dist/admin-api/client/index.js.map +1 -1
  6. package/dist/admin-api/client/models/DeleteMode.d.ts +5 -0
  7. package/dist/admin-api/client/models/DeleteMode.js +11 -0
  8. package/dist/admin-api/client/models/DeleteMode.js.map +1 -0
  9. package/dist/admin-api/client/models/PropertyType_V3.d.ts +2 -0
  10. package/dist/admin-api/client/services/DefinitionV3Service.d.ts +25 -11
  11. package/dist/admin-api/client/services/DefinitionV3Service.js +25 -12
  12. package/dist/admin-api/client/services/DefinitionV3Service.js.map +1 -1
  13. package/dist/admin-api/client/services/LogsService.d.ts +1 -1
  14. package/dist/admin-api/client/services/LogsService.js +1 -1
  15. package/dist/admin-api/client/services/ResourcesService.d.ts +20 -2
  16. package/dist/admin-api/client/services/ResourcesService.js +40 -2
  17. package/dist/admin-api/client/services/ResourcesService.js.map +1 -1
  18. package/dist/admin-api/client/services/WebhooksService.d.ts +10 -8
  19. package/dist/admin-api/client/services/WebhooksService.js +10 -8
  20. package/dist/admin-api/client/services/WebhooksService.js.map +1 -1
  21. package/dist/admin-api/index.d.ts +37 -2
  22. package/dist/admin-api/index.js +69 -14
  23. package/dist/admin-api/index.js.map +1 -1
  24. package/dist/admin-api/request/OptiHttpRequest.d.ts +18 -0
  25. package/dist/admin-api/request/OptiHttpRequest.js +27 -0
  26. package/dist/admin-api/request/OptiHttpRequest.js.map +1 -0
  27. package/dist/admin-api/request/index.d.ts +2 -0
  28. package/dist/admin-api/request/index.js +3 -0
  29. package/dist/admin-api/request/index.js.map +1 -0
  30. package/dist/admin-api/request/request.d.ts +14 -0
  31. package/dist/admin-api/request/request.js +70 -0
  32. package/dist/admin-api/request/request.js.map +1 -0
  33. package/dist/admin-api/types.d.ts +12 -0
  34. package/dist/admin-api/types.js +2 -0
  35. package/dist/admin-api/types.js.map +1 -0
  36. package/dist/client/client.d.ts +1 -1
  37. package/dist/client/client.js +4 -2
  38. package/dist/client/client.js.map +1 -1
  39. package/dist/client/index.d.ts +1 -1
  40. package/dist/client/index.js +1 -1
  41. package/dist/client/index.js.map +1 -1
  42. package/dist/client/types.d.ts +21 -0
  43. package/dist/{client/hmac-fetch.js → hmac-fetch.js} +3 -3
  44. package/dist/hmac-fetch.js.map +1 -0
  45. package/dist/services/channel-repository/definition.d.ts +7 -1
  46. package/dist/services/channel-repository/definition.js +14 -0
  47. package/dist/services/channel-repository/definition.js.map +1 -1
  48. package/dist/services/channel-repository/repository.js +3 -3
  49. package/dist/services/channel-repository/repository.js.map +1 -1
  50. package/dist/services/channel-repository/types.d.ts +9 -5
  51. package/dist/services/index.d.ts +5 -3
  52. package/dist/services/index.js +2 -1
  53. package/dist/services/index.js.map +1 -1
  54. package/dist/services/routing/index.d.ts +4 -83
  55. package/dist/services/routing/index.js +2 -242
  56. package/dist/services/routing/index.js.map +1 -1
  57. package/dist/services/routing/queries/getAllRoutes.d.ts +28 -0
  58. package/dist/services/routing/queries/getAllRoutes.js +31 -0
  59. package/dist/services/routing/queries/getAllRoutes.js.map +1 -0
  60. package/dist/services/routing/queries/getRouteById.d.ts +13 -0
  61. package/dist/services/routing/queries/getRouteById.js +24 -0
  62. package/dist/services/routing/queries/getRouteById.js.map +1 -0
  63. package/dist/services/routing/queries/getRouteByPath.d.ts +12 -0
  64. package/dist/services/routing/queries/getRouteByPath.js +30 -0
  65. package/dist/services/routing/queries/getRouteByPath.js.map +1 -0
  66. package/dist/services/routing/resolver.d.ts +45 -0
  67. package/dist/services/routing/resolver.js +137 -0
  68. package/dist/services/routing/resolver.js.map +1 -0
  69. package/dist/services/routing/types.d.ts +3 -18
  70. package/dist/services/types.d.ts +14 -0
  71. package/dist/services/types.js +2 -0
  72. package/dist/services/types.js.map +1 -0
  73. package/dist/services/utils.d.ts +69 -0
  74. package/dist/services/utils.js +135 -0
  75. package/dist/services/utils.js.map +1 -0
  76. package/package.json +12 -7
  77. package/dist/admin-api/request.d.ts +0 -5
  78. package/dist/admin-api/request.js +0 -32
  79. package/dist/admin-api/request.js.map +0 -1
  80. package/dist/client/hmac-fetch.js.map +0 -1
  81. /package/dist/{client/hmac-fetch.d.ts → hmac-fetch.d.ts} +0 -0
@@ -0,0 +1,69 @@
1
+ import type { ContentLink, ContentLinkWithLocale, InlineContentLink, InlineContentLinkWithLocale } from "./types.js";
2
+ /**
3
+ * Transform a locale code (e.g. en-US) to a Optimizely Graph compatible locale
4
+ * (e.g. en_US).
5
+ *
6
+ * @param locale The locale to transform
7
+ * @returns The Optimizely Graph safe locale
8
+ */
9
+ export declare function localeToGraphLocale<T>(locale: T): T extends string ? string : never;
10
+ /**
11
+ * Tranform an Optimizely Graph locale (e.g. en_US) to an ISO locale (e.g. en-US)
12
+ *
13
+ * @param graphLocale The locale as supported by Optimizely Graph
14
+ * @returns The ISO Locale
15
+ */
16
+ export declare function graphLocaleToLocale<T>(graphLocale: T): T extends string ? string : never;
17
+ /**
18
+ * Check if two ContentLinks point to the same content item, if either of the
19
+ * links set the version or locale, these values must be equal across the ContentLinks
20
+ *
21
+ * @param link1 The first compared link
22
+ * @param link2 The second compared link
23
+ * @returns True if they links point to the same content item, False otherwise
24
+ */
25
+ export declare function contentLinkIsEqual(link1: ContentLink | ContentLinkWithLocale, link2: ContentLink | ContentLinkWithLocale): boolean;
26
+ /**
27
+ * Check if two ContentLinks point to the same content item, if either of the
28
+ * links set the version or locale, these values must be equal across the ContentLinks
29
+ *
30
+ * @param link1 The first compared link
31
+ * @param link2 The second compared link
32
+ * @returns True if they links point to the same content item, False otherwise
33
+ */
34
+ export declare function contentLinkIsEqualIgnoreVersion(link1: ContentLink | ContentLinkWithLocale, link2: ContentLink | ContentLinkWithLocale): boolean;
35
+ /**
36
+ * Test if the provided value can be understood as a ContentLink
37
+ *
38
+ * @param toTest The value under test
39
+ * @returns True if the object can be understood as a ContentLink, False otherwise
40
+ */
41
+ export declare function isContentLink(toTest: any): toTest is ContentLink;
42
+ export declare function isContentLinkWithLocale(toTest: any): toTest is ContentLinkWithLocale;
43
+ /**
44
+ * Test if the variable is an
45
+ *
46
+ * @param toTest
47
+ * @returns
48
+ */
49
+ export declare function isInlineContentLink(toTest: any): toTest is InlineContentLinkWithLocale;
50
+ type Nullable<T> = {
51
+ [K in keyof T]?: T[K] | null;
52
+ } | null | undefined;
53
+ /**
54
+ * Take the normalizable value
55
+ *
56
+ * @param toNormalize
57
+ * @returns
58
+ */
59
+ export declare function normalizeContentLink(toNormalize: Nullable<ContentLink | InlineContentLink>): ContentLink | InlineContentLink | undefined;
60
+ export declare function normalizeContentLinkWithLocale<LT = string>(toNormalize: Nullable<ContentLinkWithLocale<LT>>): ContentLinkWithLocale<LT> | undefined;
61
+ /**
62
+ * Create a textual representation of a content link
63
+ *
64
+ * @param contentLink The (inline) content link to transform to a string
65
+ * @param unique Set to true to ensure that this method returns a string that can be used as key
66
+ * @returns The textual representation of the ContentLink
67
+ */
68
+ export declare function contentLinkToString(contentLink: ContentLink | InlineContentLink | null | undefined, unique?: boolean): string;
69
+ export {};
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Transform a locale code (e.g. en-US) to a Optimizely Graph compatible locale
3
+ * (e.g. en_US).
4
+ *
5
+ * @param locale The locale to transform
6
+ * @returns The Optimizely Graph safe locale
7
+ */
8
+ export function localeToGraphLocale(locale) {
9
+ if (typeof (locale) != 'string' || (locale.length != 2 && locale.length != 5))
10
+ throw new Error(`The value ${locale} is not a supported ISO locale`);
11
+ return locale.replaceAll('-', '_');
12
+ }
13
+ /**
14
+ * Tranform an Optimizely Graph locale (e.g. en_US) to an ISO locale (e.g. en-US)
15
+ *
16
+ * @param graphLocale The locale as supported by Optimizely Graph
17
+ * @returns The ISO Locale
18
+ */
19
+ export function graphLocaleToLocale(graphLocale) {
20
+ if (typeof (graphLocale) != 'string' || (graphLocale.length != 2 && graphLocale.length != 5))
21
+ throw new Error(`The value ${graphLocale} is not a supported ISO locale`);
22
+ return graphLocale.replaceAll('_', '-');
23
+ }
24
+ /**
25
+ * Check if two ContentLinks point to the same content item, if either of the
26
+ * links set the version or locale, these values must be equal across the ContentLinks
27
+ *
28
+ * @param link1 The first compared link
29
+ * @param link2 The second compared link
30
+ * @returns True if they links point to the same content item, False otherwise
31
+ */
32
+ export function contentLinkIsEqual(link1, link2) {
33
+ if (link1.key != link2.key)
34
+ return false;
35
+ if ((link1.version || link2.version) && link1.version != link2.version)
36
+ return false;
37
+ if ((link1.locale || link2.locale) && link1.locale != link2.locale)
38
+ return false;
39
+ return true;
40
+ }
41
+ /**
42
+ * Check if two ContentLinks point to the same content item, if either of the
43
+ * links set the version or locale, these values must be equal across the ContentLinks
44
+ *
45
+ * @param link1 The first compared link
46
+ * @param link2 The second compared link
47
+ * @returns True if they links point to the same content item, False otherwise
48
+ */
49
+ export function contentLinkIsEqualIgnoreVersion(link1, link2) {
50
+ if (link1.key != link2.key)
51
+ return false;
52
+ if ((link1.locale || link2.locale) && link1.locale != link2.locale)
53
+ return false;
54
+ return true;
55
+ }
56
+ /**
57
+ * Test if the provided value can be understood as a ContentLink
58
+ *
59
+ * @param toTest The value under test
60
+ * @returns True if the object can be understood as a ContentLink, False otherwise
61
+ */
62
+ export function isContentLink(toTest) {
63
+ // It must be an object
64
+ if (typeof (toTest) != 'object' || toTest == null)
65
+ return false;
66
+ // The object must have a key, string, miniumum length 1 char
67
+ return typeof (toTest.key) == 'string' && toTest.key.length > 0;
68
+ }
69
+ export function isContentLinkWithLocale(toTest) {
70
+ if (!isContentLink(toTest))
71
+ return false;
72
+ const locale = toTest.locale;
73
+ return locale == undefined || locale == null || (typeof (locale) == 'string' && locale.length >= 2 && locale.length <= 5);
74
+ }
75
+ /**
76
+ * Test if the variable is an
77
+ *
78
+ * @param toTest
79
+ * @returns
80
+ */
81
+ export function isInlineContentLink(toTest) {
82
+ if (typeof toTest != 'object' || toTest == null)
83
+ return false;
84
+ return toTest.key == null &&
85
+ (toTest.version == null || toTest.version == undefined) &&
86
+ (typeof toTest.locale == 'string' || toTest.locale == null || toTest.locale == undefined);
87
+ }
88
+ /**
89
+ * Take the normalizable value
90
+ *
91
+ * @param toNormalize
92
+ * @returns
93
+ */
94
+ export function normalizeContentLink(toNormalize) {
95
+ if (!(isContentLink(toNormalize) || isInlineContentLink(toNormalize)))
96
+ return undefined;
97
+ const newLink = {
98
+ key: toNormalize.key
99
+ };
100
+ if (toNormalize.version)
101
+ newLink.version = toNormalize.version.toString();
102
+ return toNormalize;
103
+ }
104
+ export function normalizeContentLinkWithLocale(toNormalize) {
105
+ const normalized = normalizeContentLink(toNormalize);
106
+ if (toNormalize?.locale != undefined && !(typeof (toNormalize?.locale) == 'string' && (toNormalize.locale.length == 2 || toNormalize.locale.length == 5)))
107
+ normalized.locale = toNormalize.locale;
108
+ return normalized;
109
+ }
110
+ function generateUniqueKey(prefix = "inline::") {
111
+ try {
112
+ return prefix + crypto.randomUUID().replaceAll('-', '');
113
+ }
114
+ catch (e) {
115
+ console.warn("💥 Crypto library unavailable, expect key collisions");
116
+ return prefix + 'default';
117
+ }
118
+ }
119
+ /**
120
+ * Create a textual representation of a content link
121
+ *
122
+ * @param contentLink The (inline) content link to transform to a string
123
+ * @param unique Set to true to ensure that this method returns a string that can be used as key
124
+ * @returns The textual representation of the ContentLink
125
+ */
126
+ export function contentLinkToString(contentLink, unique = false) {
127
+ if (!contentLink)
128
+ return unique ? generateUniqueKey('no-content::') : '[no content]';
129
+ return [
130
+ contentLink.key == null ? (unique ? generateUniqueKey() : "[inline content]") : contentLink.key,
131
+ contentLink.version,
132
+ contentLink.locale
133
+ ].filter(x => x).join('::');
134
+ }
135
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1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,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAA+D,EAAE,SAAkB,KAAK;IAExH,IAAI,CAAC,WAAW;QACZ,OAAO,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAA;IACtE,OAAO;QACH,WAAW,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG;QAC/F,WAAW,CAAC,OAAO;QAClB,WAAqC,CAAC,MAAM;KAChD,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@remkoj/optimizely-graph-client",
3
3
  "license": "Apache-2.0",
4
- "version": "1.0.3",
4
+ "version": "2.0.0-pre1",
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>",
@@ -19,7 +19,8 @@
19
19
  "./router": "./dist/services/routing/index.js",
20
20
  "./channels": "./dist/services/channel-repository/index.js",
21
21
  "./admin": "./dist/admin-api/index.js",
22
- "./codegen": "./dist/codegen.js"
22
+ "./codegen": "./dist/codegen.js",
23
+ "./utils": "./dist/services/utils.js"
23
24
  },
24
25
  "typesVersions": {
25
26
  "*": {
@@ -43,18 +44,21 @@
43
44
  ],
44
45
  "codegen": [
45
46
  "dist/codegen.d.ts"
47
+ ],
48
+ "utils": [
49
+ "./dist/services/utils.d.ts"
46
50
  ]
47
51
  }
48
52
  },
49
53
  "devDependencies": {
50
54
  "@types/crypto-js": "^4.2.2",
51
- "@types/node": "^20.12.4",
55
+ "@types/node": "^20.12.7",
52
56
  "graphql": "^16.8.1",
53
57
  "graphql-request": "^6.1.0",
54
- "openapi-typescript-codegen": "^0.28.0",
58
+ "openapi-typescript-codegen": "^0.29.0",
55
59
  "prop-types": "^15.8.1",
56
60
  "scheduler": "^0.23.0",
57
- "typescript": "^5.4.3"
61
+ "typescript": "^5.4.5"
58
62
  },
59
63
  "dependencies": {
60
64
  "crypto-js": "^4.2.0"
@@ -66,8 +70,9 @@
66
70
  "clean": "tsc --build --clean",
67
71
  "compile-ts": "tsc --build",
68
72
  "prepare": "openapi --input https://cg.optimizely.com/app/swagger/swagger.json --output ./src/admin-api/client --name OptimizelyGraphAdminApi && node ./build/update-imports.cjs && tsc --build",
69
- "watch": "tsc --watch",
73
+ "watch": "yarn tsc --watch",
70
74
  "recompile": "tsc --build --clean && tsc --build --force",
71
75
  "generate-admin": "openapi --input https://cg.optimizely.com/app/swagger/swagger.json --output ./src/admin-api/client --name OptimizelyGraphAdminApi && node ./build/update-imports.cjs"
72
- }
76
+ },
77
+ "stableVersion": "1.0.4"
73
78
  }
@@ -1,5 +0,0 @@
1
- import type { ApiRequestOptions } from './client/core/ApiRequestOptions.js';
2
- import { CancelablePromise } from './client/core/CancelablePromise.js';
3
- import type { OpenAPIConfig } from './client/core/OpenAPI.js';
4
- export declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
5
- export default request;
@@ -1,32 +0,0 @@
1
- import { CancelablePromise } from './client/core/CancelablePromise.js';
2
- export const request = (config, options) => {
3
- return new CancelablePromise((resolve, reject, onCancel) => {
4
- const cancelToken = new AbortController();
5
- onCancel(() => cancelToken.abort("Request aborted"));
6
- /*
7
- // Get the request URL. Depending on your needs, this might need additional processing,
8
- // @see ./src/templates/core/functions/getUrl.hbs
9
- const url = `${config.BASE}${options.path}`;
10
-
11
- // Optional: Get and link the cancelation token, so the request can be aborted.
12
- const source = axiosInstance.CancelToken.source();
13
- onCancel(() => source.cancel('The user aborted a request.'));
14
-
15
- // Execute the request. This is a minimal example, in real world scenarios
16
- // you will need to add headers, process form data, etc.
17
- // @see ./src/templates/core/axios/request.hbs
18
- axiosInstance.request({
19
- url,
20
- data: options.body,
21
- method: options.method,
22
- cancelToken: source.token,
23
- }).then(data => {
24
- resolve(data);
25
- }).catch(error => {
26
- reject(error);
27
- });
28
- */
29
- });
30
- };
31
- export default request;
32
- //# sourceMappingURL=request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/admin-api/request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAKtE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,MAAqB,EAAE,OAA0B,EAAwB,EAAE;IAClG,OAAO,IAAI,iBAAiB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QAEvD,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAA;QACzC,QAAQ,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;QAEpD;;;;;;;;;;;;;;;;;;;;;;UAsBE;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,OAAO,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hmac-fetch.js","sourceRoot":"","sources":["../../src/client/hmac-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,GAAG,MAAM,kBAAkB,CAAA;AAIlC,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,MAAc;IAE1D,SAAS,SAAS,CAAC,MAAW;QAE1B,IAAI,OAAM,CAAC,MAAM,CAAC,IAAI,QAAQ,IAAI,MAAM,IAAI,IAAI;YAC5C,OAAO,KAAK,CAAA;QAChB,OAAQ,MAAkB,CAAC,GAAG,CAAC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