@localess/js-client 0.3.2-next.20250108-112722.0 → 0.3.2-next.20250109-154209.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/index.d.mts +272 -0
  2. package/dist/index.d.ts +260 -9
  3. package/dist/index.js +215 -5
  4. package/dist/index.mjs +186 -0
  5. package/package.json +8 -11
  6. package/dist/cjs/client.d.ts +0 -88
  7. package/dist/cjs/client.js +0 -165
  8. package/dist/cjs/client.js.map +0 -1
  9. package/dist/cjs/editable.d.ts +0 -5
  10. package/dist/cjs/editable.js +0 -11
  11. package/dist/cjs/editable.js.map +0 -1
  12. package/dist/cjs/index.d.ts +0 -21
  13. package/dist/cjs/index.js +0 -21
  14. package/dist/cjs/index.js.map +0 -1
  15. package/dist/cjs/models/content-asset.d.ts +0 -13
  16. package/dist/cjs/models/content-asset.js +0 -3
  17. package/dist/cjs/models/content-asset.js.map +0 -1
  18. package/dist/cjs/models/content-data.d.ts +0 -27
  19. package/dist/cjs/models/content-data.js +0 -3
  20. package/dist/cjs/models/content-data.js.map +0 -1
  21. package/dist/cjs/models/content-link.d.ts +0 -21
  22. package/dist/cjs/models/content-link.js +0 -3
  23. package/dist/cjs/models/content-link.js.map +0 -1
  24. package/dist/cjs/models/content-metadata.d.ts +0 -41
  25. package/dist/cjs/models/content-metadata.js +0 -3
  26. package/dist/cjs/models/content-metadata.js.map +0 -1
  27. package/dist/cjs/models/content-reference.d.ts +0 -13
  28. package/dist/cjs/models/content-reference.js +0 -3
  29. package/dist/cjs/models/content-reference.js.map +0 -1
  30. package/dist/cjs/models/content-rich-text.d.ts +0 -13
  31. package/dist/cjs/models/content-rich-text.js +0 -3
  32. package/dist/cjs/models/content-rich-text.js.map +0 -1
  33. package/dist/cjs/models/content.d.ts +0 -11
  34. package/dist/cjs/models/content.js +0 -3
  35. package/dist/cjs/models/content.js.map +0 -1
  36. package/dist/cjs/models/index.d.ts +0 -9
  37. package/dist/cjs/models/index.js +0 -26
  38. package/dist/cjs/models/index.js.map +0 -1
  39. package/dist/cjs/models/links.d.ts +0 -7
  40. package/dist/cjs/models/links.js +0 -3
  41. package/dist/cjs/models/links.js.map +0 -1
  42. package/dist/cjs/models/translations.d.ts +0 -6
  43. package/dist/cjs/models/translations.js +0 -3
  44. package/dist/cjs/models/translations.js.map +0 -1
  45. package/dist/cjs/sync.d.ts +0 -6
  46. package/dist/cjs/sync.js +0 -32
  47. package/dist/cjs/sync.js.map +0 -1
  48. package/dist/cjs/utils.d.ts +0 -40
  49. package/dist/cjs/utils.js +0 -51
  50. package/dist/cjs/utils.js.map +0 -1
  51. package/dist/client.d.ts +0 -88
  52. package/dist/client.js +0 -161
  53. package/dist/client.js.map +0 -1
  54. package/dist/editable.d.ts +0 -5
  55. package/dist/editable.js +0 -7
  56. package/dist/editable.js.map +0 -1
  57. package/dist/index.js.map +0 -1
  58. package/dist/models/content-asset.d.ts +0 -13
  59. package/dist/models/content-asset.js +0 -2
  60. package/dist/models/content-asset.js.map +0 -1
  61. package/dist/models/content-data.d.ts +0 -27
  62. package/dist/models/content-data.js +0 -2
  63. package/dist/models/content-data.js.map +0 -1
  64. package/dist/models/content-link.d.ts +0 -21
  65. package/dist/models/content-link.js +0 -2
  66. package/dist/models/content-link.js.map +0 -1
  67. package/dist/models/content-metadata.d.ts +0 -41
  68. package/dist/models/content-metadata.js +0 -2
  69. package/dist/models/content-metadata.js.map +0 -1
  70. package/dist/models/content-reference.d.ts +0 -13
  71. package/dist/models/content-reference.js +0 -2
  72. package/dist/models/content-reference.js.map +0 -1
  73. package/dist/models/content-rich-text.d.ts +0 -13
  74. package/dist/models/content-rich-text.js +0 -2
  75. package/dist/models/content-rich-text.js.map +0 -1
  76. package/dist/models/content.d.ts +0 -11
  77. package/dist/models/content.js +0 -2
  78. package/dist/models/content.js.map +0 -1
  79. package/dist/models/index.d.ts +0 -9
  80. package/dist/models/index.js +0 -10
  81. package/dist/models/index.js.map +0 -1
  82. package/dist/models/links.d.ts +0 -7
  83. package/dist/models/links.js +0 -2
  84. package/dist/models/links.js.map +0 -1
  85. package/dist/models/translations.d.ts +0 -6
  86. package/dist/models/translations.js +0 -2
  87. package/dist/models/translations.js.map +0 -1
  88. package/dist/sync.d.ts +0 -6
  89. package/dist/sync.js +0 -28
  90. package/dist/sync.js.map +0 -1
  91. package/dist/utils.d.ts +0 -40
  92. package/dist/utils.js +0 -47
  93. package/dist/utils.js.map +0 -1
package/dist/cjs/utils.js DELETED
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BG_BRIGHT_WHITE = exports.BG_BRIGHT_CYAN = exports.BG_BRIGHT_MAGENTA = exports.BG_BRIGHT_BLUE = exports.BG_BRIGHT_YELLOW = exports.BG_BRIGHT_GREEN = exports.BG_BRIGHT_RED = exports.BG_GRAY = exports.BG_WHITE = exports.BG_CYAN = exports.BG_MAGENTA = exports.BG_BLUE = exports.BG_YELLOW = exports.BG_GREEN = exports.BG_RED = exports.BG_BLACK = exports.FG_BRIGHT_WHITE = exports.FG_BRIGHT_CYAN = exports.FG_BRIGHT_MAGENTA = exports.FG_BRIGHT_BLUE = exports.FG_BRIGHT_YELLOW = exports.FG_BRIGHT_GREEN = exports.FG_BRIGHT_RED = exports.FG_GRAY = exports.FG_WHITE = exports.FG_CYAN = exports.FG_MAGENTA = exports.FG_BLUE = exports.FG_YELLOW = exports.FG_GREEN = exports.FG_RED = exports.FG_BLACK = exports.HIDDEN = exports.REVERSE = exports.BLINK = exports.UNDERSCORE = exports.DIM = exports.BRIGHT = exports.RESET = exports.proxyURIFromEnv = void 0;
4
- function proxyURIFromEnv() {
5
- return (process.env.HTTPS_PROXY ||
6
- process.env.https_proxy ||
7
- process.env.HTTP_PROXY ||
8
- process.env.http_proxy ||
9
- undefined);
10
- }
11
- exports.proxyURIFromEnv = proxyURIFromEnv;
12
- exports.RESET = "\x1b[0m";
13
- exports.BRIGHT = "\x1b[1m";
14
- exports.DIM = "\x1b[2m";
15
- exports.UNDERSCORE = "\x1b[4m";
16
- exports.BLINK = "\x1b[5m";
17
- exports.REVERSE = "\x1b[7m";
18
- exports.HIDDEN = "\x1b[8m";
19
- exports.FG_BLACK = "\x1b[30m";
20
- exports.FG_RED = "\x1b[31m";
21
- exports.FG_GREEN = "\x1b[32m";
22
- exports.FG_YELLOW = "\x1b[33m";
23
- exports.FG_BLUE = "\x1b[34m";
24
- exports.FG_MAGENTA = "\x1b[35m";
25
- exports.FG_CYAN = "\x1b[36m";
26
- exports.FG_WHITE = "\x1b[37m";
27
- exports.FG_GRAY = "\x1b[90m";
28
- exports.FG_BRIGHT_RED = "\x1b[91m";
29
- exports.FG_BRIGHT_GREEN = "\x1b[92m";
30
- exports.FG_BRIGHT_YELLOW = "\x1b[93m";
31
- exports.FG_BRIGHT_BLUE = "\x1b[94m";
32
- exports.FG_BRIGHT_MAGENTA = "\x1b[95m";
33
- exports.FG_BRIGHT_CYAN = "\x1b[96m";
34
- exports.FG_BRIGHT_WHITE = "\x1b[97m";
35
- exports.BG_BLACK = "\x1b[40m";
36
- exports.BG_RED = "\x1b[41m";
37
- exports.BG_GREEN = "\x1b[42m";
38
- exports.BG_YELLOW = "\x1b[43m";
39
- exports.BG_BLUE = "\x1b[44m";
40
- exports.BG_MAGENTA = "\x1b[45m";
41
- exports.BG_CYAN = "\x1b[46m";
42
- exports.BG_WHITE = "\x1b[47m";
43
- exports.BG_GRAY = "\x1b[100m";
44
- exports.BG_BRIGHT_RED = "\x1b[101m";
45
- exports.BG_BRIGHT_GREEN = "\x1b[102m";
46
- exports.BG_BRIGHT_YELLOW = "\x1b[103m";
47
- exports.BG_BRIGHT_BLUE = "\x1b[104m";
48
- exports.BG_BRIGHT_MAGENTA = "\x1b[105m";
49
- exports.BG_BRIGHT_CYAN = "\x1b[106m";
50
- exports.BG_BRIGHT_WHITE = "\x1b[107m";
51
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
-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AU,CAAA;AACrB,QAAA,SAAS,GAAG,UAAU,CAAA;AACtB,QAAA,OAAO,GAAG,UAAU,CAAA;AACpB,QAAA,UAAU,GAAG,UAAU,CAAA;AACvB,QAAA,OAAO,GAAG,UAAU,CAAA;AACpB,QAAA,QAAQ,GAAG,UAAU,CAAA;AACrB,QAAA,OAAO,GAAG,WAAW,CAAA;AAErB,QAAA,aAAa,GAAG,WAAW,CAAA;AAC3B,QAAA,eAAe,GAAG,WAAW,CAAA;AAC7B,QAAA,gBAAgB,GAAG,WAAW,CAAA;AAC9B,QAAA,cAAc,GAAG,WAAW,CAAA;AAC5B,QAAA,iBAAiB,GAAG,WAAW,CAAA;AAC/B,QAAA,cAAc,GAAG,WAAW,CAAA;AAC5B,QAAA,eAAe,GAAG,WAAW,CAAA"}
package/dist/client.d.ts DELETED
@@ -1,88 +0,0 @@
1
- import { Content, ContentAsset, Links, Translations } from "./models";
2
- export type LocalessClientOptions = {
3
- /**
4
- * A fully qualified domain name with protocol (http/https) and port.
5
- *
6
- * Example: https://my-localess.web.app
7
- */
8
- origin: string;
9
- /**
10
- * Localess space ID, cna be found in the Localess Space settings
11
- */
12
- spaceId: string;
13
- /**
14
- * Localess API token, can be found in the Localess Space settings
15
- */
16
- token: string;
17
- /**
18
- * Content version to fetch, leave empty for 'published' or 'draft' for the latest draft
19
- */
20
- version?: 'draft' | string;
21
- /**
22
- * Enable debug mode
23
- */
24
- debug?: boolean;
25
- };
26
- export type LinksFetchParams = {
27
- /**
28
- * Content Kind. FOLDER or DOCUMENT. If not provided, it will return all.
29
- * @example 'DOCUMENT'
30
- */
31
- kind?: 'DOCUMENT' | 'FOLDER';
32
- /**
33
- * Content parent slug.
34
- * @example 'legal/policy'
35
- */
36
- parentSlug?: string;
37
- /**
38
- * If **true**, exclude all sub slugs, otherwise include all content under current selected **parent slug**.
39
- * @example false
40
- */
41
- excludeChildren?: boolean;
42
- };
43
- export type ContentFetchParams = {
44
- /**
45
- * Content version to fetch, leave empty for 'published' or 'draft' for the latest draft.
46
- * Overrides the version set in the client options.
47
- */
48
- version?: 'draft' | string;
49
- /**
50
- * Locale identifier (ISO 639-1) to fetch content in, leave empty for default locale.
51
- *
52
- * Example: en
53
- */
54
- locale?: string;
55
- };
56
- /**
57
- * Create a Localess API Client
58
- * @param {LocalessClientOptions} options connection details
59
- */
60
- export declare function localessClient(options: LocalessClientOptions): {
61
- /**
62
- * Get all links
63
- * @param params{LinksFetchParams} - Fetch parameters
64
- * @returns {Promise<Links>}
65
- */
66
- getLinks(params?: LinksFetchParams): Promise<Links>;
67
- /**
68
- * Get content by SLUG
69
- * @param slug{string} - Content SLUG
70
- * @param params{ContentFetchParams} - Fetch parameters
71
- * @returns {Promise<Content>}
72
- */
73
- getContentBySlug(slug: string, params?: ContentFetchParams): Promise<Content>;
74
- /**
75
- * Get content by ID
76
- * @param id{string} - Content ID
77
- * @param params{ContentFetchParams} - Fetch parameters
78
- * @returns {Promise<Content>}
79
- */
80
- getContentById(id: string, params?: ContentFetchParams): Promise<Content>;
81
- /**
82
- * Get translations for the given locale
83
- * @param locale{string} - Locale identifier (ISO 639-1)
84
- */
85
- getTranslations(locale: string): Promise<Translations>;
86
- syncScriptUrl(): string;
87
- assetLink(asset: ContentAsset | string): string;
88
- };
package/dist/client.js DELETED
@@ -1,161 +0,0 @@
1
- import { FG_BLUE, RESET } from "./utils";
2
- const LOG_GROUP = `${FG_BLUE}[Localess:Client]${RESET}`;
3
- /**
4
- * Create a Localess API Client
5
- * @param {LocalessClientOptions} options connection details
6
- */
7
- export function localessClient(options) {
8
- if (options.debug) {
9
- console.log(LOG_GROUP, 'Client Options : ', options);
10
- }
11
- const fetchOptions = {
12
- redirect: 'follow',
13
- headers: {
14
- 'Content-Type': 'application/json',
15
- 'Accept': 'application/json',
16
- 'X-Localess-Agent': 'Localess-JS-Client',
17
- 'X-Localess-Agent-Version': '0.3.0'
18
- }
19
- };
20
- return {
21
- /**
22
- * Get all links
23
- * @param params{LinksFetchParams} - Fetch parameters
24
- * @returns {Promise<Links>}
25
- */
26
- async getLinks(params) {
27
- if (options.debug) {
28
- console.log(LOG_GROUP, 'getLinks() params : ' + params);
29
- }
30
- let kind = '';
31
- if (params?.kind) {
32
- kind = `&kind=${params.kind}`;
33
- }
34
- let parentSlug = '';
35
- if (params?.parentSlug) {
36
- parentSlug = `&parentSlug=${params.parentSlug}`;
37
- }
38
- let excludeChildren = '';
39
- if (params?.excludeChildren) {
40
- excludeChildren = `&excludeChildren=${params.excludeChildren}`;
41
- }
42
- let url = `${options.origin}/api/v1/spaces/${options.spaceId}/links?token=${options.token}${kind}${parentSlug}${excludeChildren}`;
43
- if (options.debug) {
44
- console.log(LOG_GROUP, 'getLinks fetch url : ', url);
45
- }
46
- try {
47
- const response = await fetch(url, fetchOptions);
48
- if (options.debug) {
49
- console.log(LOG_GROUP, 'getLinks status : ', response.status);
50
- }
51
- const data = await response.json();
52
- return data;
53
- }
54
- catch (error) {
55
- console.error(LOG_GROUP, 'getLinks error : ', error);
56
- return {};
57
- }
58
- },
59
- /**
60
- * Get content by SLUG
61
- * @param slug{string} - Content SLUG
62
- * @param params{ContentFetchParams} - Fetch parameters
63
- * @returns {Promise<Content>}
64
- */
65
- async getContentBySlug(slug, params) {
66
- if (options.debug) {
67
- console.log(LOG_GROUP, 'getContentBySlug() slug : ', slug);
68
- console.log(LOG_GROUP, 'getContentBySlug() params : ', params);
69
- }
70
- let version = '';
71
- // Options
72
- if (options?.version && options.version == 'draft') {
73
- version = `&version=${options.version}`;
74
- }
75
- // Params
76
- if (params?.version && params.version == 'draft') {
77
- version = `&version=${params.version}`;
78
- }
79
- const locale = params?.locale ? `&locale=${params.locale}` : '';
80
- let url = `${options.origin}/api/v1/spaces/${options.spaceId}/contents/slugs/${slug}?token=${options.token}${version}${locale}`;
81
- if (options.debug) {
82
- console.log(LOG_GROUP, 'getContentBySlug fetch url : ', url);
83
- }
84
- try {
85
- const response = await fetch(url, fetchOptions);
86
- if (options.debug) {
87
- console.log(LOG_GROUP, 'getContentBySlug status : ', response.status);
88
- }
89
- const data = await response.json();
90
- return data;
91
- }
92
- catch (error) {
93
- console.error(LOG_GROUP, 'getContentBySlug error : ', error);
94
- return {};
95
- }
96
- },
97
- /**
98
- * Get content by ID
99
- * @param id{string} - Content ID
100
- * @param params{ContentFetchParams} - Fetch parameters
101
- * @returns {Promise<Content>}
102
- */
103
- async getContentById(id, params) {
104
- if (options.debug) {
105
- console.log(LOG_GROUP, 'getContentById() id : ', id);
106
- console.log(LOG_GROUP, 'getContentById() params : ', params);
107
- }
108
- let version = '';
109
- // Options
110
- if (options?.version && options.version == 'draft') {
111
- version = `&version=${options.version}`;
112
- }
113
- // Params
114
- if (params?.version && params.version == 'draft') {
115
- version = `&version=${params.version}`;
116
- }
117
- const locale = params?.locale ? `&locale=${params.locale}` : '';
118
- let url = `${options.origin}/api/v1/spaces/${options.spaceId}/contents/${id}?token=${options.token}${version}${locale}`;
119
- if (options.debug) {
120
- console.log(LOG_GROUP, 'getContentById fetch url : ', url);
121
- }
122
- const response = await fetch(url, fetchOptions);
123
- if (options.debug) {
124
- console.log(LOG_GROUP, 'getContentById status : ', response.status);
125
- }
126
- const data = await response.json();
127
- return data;
128
- },
129
- /**
130
- * Get translations for the given locale
131
- * @param locale{string} - Locale identifier (ISO 639-1)
132
- */
133
- async getTranslations(locale) {
134
- if (options.debug) {
135
- console.log(LOG_GROUP, 'getTranslations() locale : ', locale);
136
- }
137
- let url = `${options.origin}/api/v1/spaces/${options.spaceId}/translations/${locale}`;
138
- if (options.debug) {
139
- console.log(LOG_GROUP, 'getTranslations fetch url : ', url);
140
- }
141
- const response = await fetch(url, fetchOptions);
142
- if (options.debug) {
143
- console.log(LOG_GROUP, 'getTranslations status : ', response.status);
144
- }
145
- const data = await response.json();
146
- return data;
147
- },
148
- syncScriptUrl() {
149
- return `${options.origin}/scripts/sync-v1.js`;
150
- },
151
- assetLink(asset) {
152
- if (typeof asset === 'string') {
153
- return `${options.origin}/api/v1/spaces/${options.spaceId}/assets/${asset}`;
154
- }
155
- else {
156
- return `${options.origin}/api/v1/spaces/${options.spaceId}/assets/${asset.uri}`;
157
- }
158
- }
159
- };
160
- }
161
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AA4DvC,MAAM,SAAS,GAAG,GAAG,OAAO,oBAAoB,KAAK,EAAE,CAAA;AAEvD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAA8B;IAC3D,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,YAAY,GAAgB;QAChC,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;YAC5B,kBAAkB,EAAE,oBAAoB;YACxC,0BAA0B,EAAE,OAAO;SACpC;KACF,CAAC;IAEF,OAAO;QAEL;;;;WAIG;QACH,KAAK,CAAC,QAAQ,CAAC,MAAyB;YACtC,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBAClB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,sBAAsB,GAAG,MAAM,CAAC,CAAC;YAC1D,CAAC;YACD,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;gBACjB,IAAI,GAAG,SAAS,MAAM,CAAC,IAAI,EAAE,CAAC;YAChC,CAAC;YACD,IAAI,UAAU,GAAG,EAAE,CAAC;YACpB,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC;gBACvB,UAAU,GAAG,eAAe,MAAM,CAAC,UAAU,EAAE,CAAC;YAClD,CAAC;YACD,IAAI,eAAe,GAAG,EAAE,CAAC;YAC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 'data-ll-id': string;
4
- 'data-ll-schema': string;
5
- };
package/dist/editable.js DELETED
@@ -1,7 +0,0 @@
1
- export function llEditable(content) {
2
- return {
3
- 'data-ll-id': content._id,
4
- 'data-ll-schema': content.schema,
5
- };
6
- }
7
- //# sourceMappingURL=editable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editable.js","sourceRoot":"","sources":["../src/editable.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,UAAU,CAAC,OAA0B;IACnD,OAAO;QACL,YAAY,EAAE,OAAO,CAAC,GAAG;QACzB,gBAAgB,EAAE,OAAO,CAAC,MAAM;KACjC,CAAA;AACH,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Content Asset define reference to a Asset.
3
- */
4
- export interface ContentAsset {
5
- /**
6
- * Define the type of Asset
7
- */
8
- kind: 'ASSET';
9
- /**
10
- * Unique identifier for the asset.
11
- */
12
- uri: string;
13
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content-asset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-asset.js","sourceRoot":"","sources":["../../src/models/content-asset.ts"],"names":[],"mappings":""}
@@ -1,27 +0,0 @@
1
- import { ContentAsset } from "./content-asset";
2
- import { ContentLink } from "./content-link";
3
- import { ContentRichText } from "./content-rich-text";
4
- import { ContentReference } from "./content-reference";
5
- export type ContentDataField = any | string | string[] | number | boolean | ContentLink | ContentRichText | ContentData | ContentData[] | ContentAsset | ContentAsset[] | ContentReference | ContentReference[];
6
- /**
7
- * Content Data Schema related information.
8
- */
9
- export interface ContentDataSchema {
10
- /**
11
- * Unique identifier of a component in a content.
12
- */
13
- _id: string;
14
- /**
15
- * Unique identifier for the Schema object.
16
- */
17
- schema: string;
18
- }
19
- /**
20
- * ContentData defined Object to connect all possible root Schemas.
21
- */
22
- export interface ContentData extends ContentDataSchema {
23
- /**
24
- * Other Schema specific fields
25
- */
26
- [field: string]: ContentDataField | undefined;
27
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-data.js","sourceRoot":"","sources":["../../src/models/content-data.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- /**
2
- * Content Link define reference to a Link.
3
- */
4
- export interface ContentLink {
5
- /**
6
- * Define the type of Link
7
- */
8
- kind: 'LINK';
9
- /**
10
- * Define the target of the link. _blank for new tab and _self for same tab.
11
- */
12
- target: '_blank' | '_self';
13
- /**
14
- * Define the type of Link. URL for external links and Content for internal links.
15
- */
16
- type: 'url' | 'content';
17
- /**
18
- * If type is content, then it will be Content ID. Otherwise it will be URL.
19
- */
20
- uri: string;
21
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content-link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-link.js","sourceRoot":"","sources":["../../src/models/content-link.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- /**
2
- * Content Metadata define short information about a Content for navigation reason.
3
- */
4
- export interface ContentMetadata {
5
- /**
6
- * Date and Time at which the Content was created.
7
- */
8
- createdAt: string;
9
- /**
10
- * Combination of SLUG and Parent SLUG of the Content
11
- */
12
- fullSlug: string;
13
- /**
14
- * Unique identifier for the object.
15
- */
16
- id: string;
17
- /**
18
- * Define the type of Content, whether it is a FOLDER or DOCUMENT.
19
- */
20
- kind: 'FOLDER' | 'DOCUMENT';
21
- /**
22
- * Name of the Content
23
- */
24
- name: string;
25
- /**
26
- * Parent SLUG of the Content
27
- */
28
- parentSlug: string;
29
- /**
30
- * Date and Time at which the Content was published.
31
- */
32
- publishedAt?: string;
33
- /**
34
- * SLUG of the Content
35
- */
36
- slug: string;
37
- /**
38
- * Date and Time at which the Content was updated.
39
- */
40
- updatedAt: string;
41
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content-metadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-metadata.js","sourceRoot":"","sources":["../../src/models/content-metadata.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- /**
2
- * Content Reference define reference to a Content.
3
- */
4
- export interface ContentReference {
5
- /**
6
- * Define the type of REFERENCE
7
- */
8
- kind: 'REFERENCE';
9
- /**
10
- * Unique identifier for the Content Document.
11
- */
12
- uri: string;
13
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content-reference.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-reference.js","sourceRoot":"","sources":["../../src/models/content-reference.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- /**
2
- * Content RichText define content as JSON Object.
3
- */
4
- export interface ContentRichText {
5
- /**
6
- * Define the type of Content Node
7
- */
8
- type?: string;
9
- /**
10
- * List of Content Nodes
11
- */
12
- content?: ContentRichText[];
13
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content-rich-text.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-rich-text.js","sourceRoot":"","sources":["../../src/models/content-rich-text.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import { ContentData } from './content-data';
2
- import { ContentMetadata } from "./content-metadata";
3
- /**
4
- * Content define shared object for all possible Content Types.
5
- */
6
- export interface Content extends ContentMetadata {
7
- /**
8
- * Content Data
9
- */
10
- data?: ContentData;
11
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/models/content.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export * from './content';
2
- export * from './content-asset';
3
- export * from './content-data';
4
- export * from './content-link';
5
- export * from './content-metadata';
6
- export * from './content-reference';
7
- export * from './content-rich-text';
8
- export * from './links';
9
- export * from './translations';
@@ -1,10 +0,0 @@
1
- export * from './content';
2
- export * from './content-asset';
3
- export * from './content-data';
4
- export * from './content-link';
5
- export * from './content-metadata';
6
- export * from './content-reference';
7
- export * from './content-rich-text';
8
- export * from './links';
9
- export * from './translations';
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
@@ -1,7 +0,0 @@
1
- import { ContentMetadata } from './content-metadata';
2
- /**
3
- * Key-Value Object. Where Key is Unique identifier for the Content object and Value is Content Metadata.
4
- */
5
- export interface Links {
6
- [key: string]: ContentMetadata;
7
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=links.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/models/links.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- /**
2
- * Key-Value Object. Where Key is Translation ID and Value is Translated Content
3
- */
4
- export interface Translations {
5
- [key: string]: string;
6
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=translations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translations.js","sourceRoot":"","sources":["../../src/models/translations.ts"],"names":[],"mappings":""}
package/dist/sync.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Inject Localess Sync Script in Header
3
- * @param {string} origin A fully qualified domain name with protocol (http/https) and port.
4
- * @param {boolean} force Force Script Injection even if the application is not in Visual Editor.
5
- */
6
- export declare function loadLocalessSync(origin: string, force?: boolean): void;
package/dist/sync.js DELETED
@@ -1,28 +0,0 @@
1
- const JS_SYNC_ID = 'localess-js-sync';
2
- /**
3
- * Inject Localess Sync Script in Header
4
- * @param {string} origin A fully qualified domain name with protocol (http/https) and port.
5
- * @param {boolean} force Force Script Injection even if the application is not in Visual Editor.
6
- */
7
- export function loadLocalessSync(origin, force = false) {
8
- const isServer = typeof window === 'undefined';
9
- if (isServer)
10
- return; // Skip Server Injection
11
- if (window.top === window.self)
12
- return; // Skip if the page is not loaded in Visual Editor
13
- const isSyncLoaded = typeof window.localess !== 'undefined';
14
- if (isSyncLoaded)
15
- return; // Skip if Sync is already loaded
16
- const scriptEl = document.getElementById(JS_SYNC_ID);
17
- if (scriptEl)
18
- return; // Skip if script is already loaded
19
- const script = document.createElement('script');
20
- script.id = JS_SYNC_ID;
21
- script.type = 'text/javascript';
22
- script.src = `${origin}/scripts/sync-v1.js`;
23
- script.async = true;
24
- script.onerror = (error) => console.error(error);
25
- script.onload = (event) => console.info('Localess Sync Script loaded');
26
- document.head.appendChild(script);
27
- }
28
- //# sourceMappingURL=sync.js.map
package/dist/sync.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAAiB,KAAK;IACrE,MAAM,QAAQ,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;IAC/C,IAAI,QAAQ;QAAE,OAAO,CAAC,wBAAwB;IAC9C,IAAI,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,IAAI;QAAE,OAAO,CAAC,kDAAkD;IAC1F,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC;IAC5D,IAAI,YAAY;QAAE,OAAO,CAAC,iCAAiC;IAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,QAAQ;QAAE,OAAO,CAAC,mCAAmC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC;IACvB,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,qBAAqB,CAAA;IAC3C,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IAEpB,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAEvE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}