@acmekit/js-sdk 2.13.31 → 2.13.32

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 (121) hide show
  1. package/package.json +2 -2
  2. package/dist/admin/api-key.d.ts +0 -164
  3. package/dist/admin/api-key.d.ts.map +0 -1
  4. package/dist/admin/api-key.js +0 -202
  5. package/dist/admin/api-key.js.map +0 -1
  6. package/dist/admin/index.d.ts +0 -57
  7. package/dist/admin/index.d.ts.map +0 -1
  8. package/dist/admin/index.js +0 -29
  9. package/dist/admin/index.js.map +0 -1
  10. package/dist/admin/invite.d.ts +0 -182
  11. package/dist/admin/invite.d.ts.map +0 -1
  12. package/dist/admin/invite.js +0 -211
  13. package/dist/admin/invite.js.map +0 -1
  14. package/dist/admin/locale.d.ts +0 -95
  15. package/dist/admin/locale.d.ts.map +0 -1
  16. package/dist/admin/locale.js +0 -104
  17. package/dist/admin/locale.js.map +0 -1
  18. package/dist/admin/notification.d.ts +0 -96
  19. package/dist/admin/notification.d.ts.map +0 -1
  20. package/dist/admin/notification.js +0 -107
  21. package/dist/admin/notification.js.map +0 -1
  22. package/dist/admin/plugin.d.ts +0 -27
  23. package/dist/admin/plugin.d.ts.map +0 -1
  24. package/dist/admin/plugin.js +0 -31
  25. package/dist/admin/plugin.js.map +0 -1
  26. package/dist/admin/translation.d.ts +0 -253
  27. package/dist/admin/translation.d.ts.map +0 -1
  28. package/dist/admin/translation.js +0 -284
  29. package/dist/admin/translation.js.map +0 -1
  30. package/dist/admin/upload.d.ts +0 -97
  31. package/dist/admin/upload.d.ts.map +0 -1
  32. package/dist/admin/upload.js +0 -139
  33. package/dist/admin/upload.js.map +0 -1
  34. package/dist/admin/user.d.ts +0 -166
  35. package/dist/admin/user.d.ts.map +0 -1
  36. package/dist/admin/user.js +0 -192
  37. package/dist/admin/user.js.map +0 -1
  38. package/dist/admin/views.d.ts +0 -54
  39. package/dist/admin/views.d.ts.map +0 -1
  40. package/dist/admin/views.js +0 -96
  41. package/dist/admin/views.js.map +0 -1
  42. package/dist/admin/workflow-execution.d.ts +0 -78
  43. package/dist/admin/workflow-execution.d.ts.map +0 -1
  44. package/dist/admin/workflow-execution.js +0 -86
  45. package/dist/admin/workflow-execution.js.map +0 -1
  46. package/dist/auth/index.d.ts +0 -264
  47. package/dist/auth/index.d.ts.map +0 -1
  48. package/dist/auth/index.js +0 -318
  49. package/dist/auth/index.js.map +0 -1
  50. package/dist/client.d.ts +0 -65
  51. package/dist/client.d.ts.map +0 -1
  52. package/dist/client.js +0 -315
  53. package/dist/client.js.map +0 -1
  54. package/dist/esm/admin/api-key.d.ts +0 -164
  55. package/dist/esm/admin/api-key.d.ts.map +0 -1
  56. package/dist/esm/admin/api-key.js +0 -221
  57. package/dist/esm/admin/api-key.js.map +0 -1
  58. package/dist/esm/admin/index.d.ts +0 -57
  59. package/dist/esm/admin/index.d.ts.map +0 -1
  60. package/dist/esm/admin/index.js +0 -25
  61. package/dist/esm/admin/index.js.map +0 -1
  62. package/dist/esm/admin/invite.d.ts +0 -182
  63. package/dist/esm/admin/invite.d.ts.map +0 -1
  64. package/dist/esm/admin/invite.js +0 -239
  65. package/dist/esm/admin/invite.js.map +0 -1
  66. package/dist/esm/admin/locale.d.ts +0 -95
  67. package/dist/esm/admin/locale.d.ts.map +0 -1
  68. package/dist/esm/admin/locale.js +0 -113
  69. package/dist/esm/admin/locale.js.map +0 -1
  70. package/dist/esm/admin/notification.d.ts +0 -96
  71. package/dist/esm/admin/notification.d.ts.map +0 -1
  72. package/dist/esm/admin/notification.js +0 -116
  73. package/dist/esm/admin/notification.js.map +0 -1
  74. package/dist/esm/admin/plugin.d.ts +0 -27
  75. package/dist/esm/admin/plugin.d.ts.map +0 -1
  76. package/dist/esm/admin/plugin.js +0 -38
  77. package/dist/esm/admin/plugin.js.map +0 -1
  78. package/dist/esm/admin/translation.d.ts +0 -253
  79. package/dist/esm/admin/translation.d.ts.map +0 -1
  80. package/dist/esm/admin/translation.js +0 -301
  81. package/dist/esm/admin/translation.js.map +0 -1
  82. package/dist/esm/admin/upload.d.ts +0 -97
  83. package/dist/esm/admin/upload.d.ts.map +0 -1
  84. package/dist/esm/admin/upload.js +0 -150
  85. package/dist/esm/admin/upload.js.map +0 -1
  86. package/dist/esm/admin/user.d.ts +0 -166
  87. package/dist/esm/admin/user.d.ts.map +0 -1
  88. package/dist/esm/admin/user.js +0 -207
  89. package/dist/esm/admin/user.js.map +0 -1
  90. package/dist/esm/admin/views.d.ts +0 -54
  91. package/dist/esm/admin/views.d.ts.map +0 -1
  92. package/dist/esm/admin/views.js +0 -117
  93. package/dist/esm/admin/views.js.map +0 -1
  94. package/dist/esm/admin/workflow-execution.d.ts +0 -78
  95. package/dist/esm/admin/workflow-execution.d.ts.map +0 -1
  96. package/dist/esm/admin/workflow-execution.js +0 -95
  97. package/dist/esm/admin/workflow-execution.js.map +0 -1
  98. package/dist/esm/auth/index.d.ts +0 -264
  99. package/dist/esm/auth/index.d.ts.map +0 -1
  100. package/dist/esm/auth/index.js +0 -325
  101. package/dist/esm/auth/index.js.map +0 -1
  102. package/dist/esm/client.d.ts +0 -65
  103. package/dist/esm/client.d.ts.map +0 -1
  104. package/dist/esm/client.js +0 -317
  105. package/dist/esm/client.js.map +0 -1
  106. package/dist/esm/index.d.ts +0 -18
  107. package/dist/esm/index.d.ts.map +0 -1
  108. package/dist/esm/index.js +0 -21
  109. package/dist/esm/index.js.map +0 -1
  110. package/dist/esm/types.d.ts +0 -60
  111. package/dist/esm/types.d.ts.map +0 -1
  112. package/dist/esm/types.js +0 -2
  113. package/dist/esm/types.js.map +0 -1
  114. package/dist/index.d.ts +0 -18
  115. package/dist/index.d.ts.map +0 -1
  116. package/dist/index.js +0 -28
  117. package/dist/index.js.map +0 -1
  118. package/dist/types.d.ts +0 -60
  119. package/dist/types.d.ts.map +0 -1
  120. package/dist/types.js +0 -3
  121. package/dist/types.js.map +0 -1
@@ -1,27 +0,0 @@
1
- import { HttpTypes } from "@acmekit/types";
2
- import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
4
- export declare class Plugin {
5
- /**
6
- * @ignore
7
- */
8
- private client;
9
- /**
10
- * @ignore
11
- */
12
- constructor(client: Client);
13
- /**
14
- * This method retrieves the list of plugins installed in a AcmeKit application.
15
- *
16
- * @param headers - Headers to pass in the request.
17
- * @returns The list of plugins.
18
- *
19
- * @example
20
- * sdk.admin.plugin.list()
21
- * .then(({ plugins }) => {
22
- * console.log(plugins)
23
- * })
24
- */
25
- list(headers?: ClientHeaders): Promise<HttpTypes.AdminPluginsListResponse>;
26
- }
27
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/admin/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,MAAM;IACjB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IAEtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;OAWG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa;CASnC"}
@@ -1,38 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- export class Plugin {
11
- /**
12
- * @ignore
13
- */
14
- constructor(client) {
15
- this.client = client;
16
- }
17
- /**
18
- * This method retrieves the list of plugins installed in a AcmeKit application.
19
- *
20
- * @param headers - Headers to pass in the request.
21
- * @returns The list of plugins.
22
- *
23
- * @example
24
- * sdk.admin.plugin.list()
25
- * .then(({ plugins }) => {
26
- * console.log(plugins)
27
- * })
28
- */
29
- list(headers) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return yield this.client.fetch(`/admin/plugins`, {
32
- headers,
33
- query: {},
34
- });
35
- });
36
- }
37
- }
38
- //# sourceMappingURL=plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/admin/plugin.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,MAAM;IAMjB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;OAWG;IACG,IAAI,CAAC,OAAuB;;YAChC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gBAAgB,EAChB;gBACE,OAAO;gBACP,KAAK,EAAE,EAAE;aACV,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
@@ -1,253 +0,0 @@
1
- import { HttpTypes } from "@acmekit/types";
2
- import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
4
- export declare class Translation {
5
- /**
6
- * @ignore
7
- */
8
- private client;
9
- /**
10
- * @ignore
11
- */
12
- constructor(client: Client);
13
- /**
14
- * This method retrieves a paginated list of translations. It sends a request to the
15
- * [List Translations](https://docs.acmekit.com/api/admin#translations_gettranslations)
16
- * API route.
17
- *
18
- * @param query - Filters and pagination configurations.
19
- * @param headers - Headers to pass in the request.
20
- * @returns The paginated list of translations.
21
- *
22
- * @example
23
- * To retrieve the list of translations:
24
- *
25
- * ```ts
26
- * sdk.admin.translation.list()
27
- * .then(({ translations, count, limit, offset }) => {
28
- * console.log(translations)
29
- * })
30
- * ```
31
- *
32
- * To configure the pagination, pass the `limit` and `offset` query parameters.
33
- *
34
- * For example, to retrieve only 10 items and skip 10 items:
35
- *
36
- * ```ts
37
- * sdk.admin.translation.list({
38
- * limit: 10,
39
- * offset: 10
40
- * })
41
- * .then(({ translations, count, limit, offset }) => {
42
- * console.log(translations)
43
- * })
44
- * ```
45
- *
46
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
47
- * in each translation:
48
- *
49
- * ```ts
50
- * sdk.admin.translation.list({
51
- * fields: "id,name"
52
- * })
53
- * .then(({ translations, count, limit, offset }) => {
54
- * console.log(translations)
55
- * })
56
- * ```
57
- *
58
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
59
- */
60
- list(query?: HttpTypes.AdminTranslationsListParams, headers?: ClientHeaders): Promise<HttpTypes.AdminTranslationsListResponse>;
61
- /**
62
- * This method allows bulk operations on translations. It sends a request to the
63
- * [Manage Translations](https://docs.acmekit.com/api/admin#translations_posttranslationsbatch)
64
- * API route.
65
- *
66
- * @param payload - The translations to create, update, or delete.
67
- * @param headers - Headers to pass in the request.
68
- * @returns The translations' details.
69
- *
70
- * @example
71
- * sdk.admin.translation.batch({
72
- * create: [
73
- * {
74
- * reference_id: "prod_123",
75
- * reference: "product",
76
- * locale_code: "en-US",
77
- * translations: { title: "Shirt" }
78
- * }
79
- * ],
80
- * update: [
81
- * {
82
- * id: "trans_123",
83
- * translations: { title: "Pants" }
84
- * }
85
- * ],
86
- * delete: ["trans_321"]
87
- * })
88
- * .then(({ created, updated, deleted }) => {
89
- * console.log(created, updated, deleted)
90
- * })
91
- */
92
- batch(body: HttpTypes.AdminBatchTranslations, headers?: ClientHeaders): Promise<HttpTypes.AdminTranslationsBatchResponse>;
93
- /**
94
- * This method retrieves the settings for the translations for a given entity type or all entity types if no entity type is provided.
95
- * It sends a request to the
96
- * [Get Translation Settings](https://docs.acmekit.com/api/admin#translations_gettranslationssettings) API route.
97
- *
98
- * @param query - The query parameters which can optionally include the entity type to get the settings for and whether to get the settings for active/inactive entities only.
99
- * @param headers - Headers to pass in the request.
100
- * @returns The translation settings.
101
- *
102
- * @example
103
- * To retrieve the settings for the translations for a given entity type:
104
- *
105
- * ```ts
106
- * sdk.admin.translation.settings({
107
- * entity_type: "product"
108
- * })
109
- * .then(({ translation_settings }) => {
110
- * console.log(translation_settings)
111
- * })
112
- * ```
113
- *
114
- * To retrieve the settings for all entity types:
115
- *
116
- * ```ts
117
- * sdk.admin.translation.settings()
118
- * .then(({ translation_settings }) => {
119
- * console.log(translation_settings)
120
- * })
121
- * ```
122
- *
123
- * To retrieve the settings for active entities only:
124
- *
125
- * ```ts
126
- * sdk.admin.translation.settings({
127
- * is_active: true
128
- * })
129
- * .then(({ translation_settings }) => {
130
- * console.log(translation_settings)
131
- * })
132
- * ```
133
- *
134
- * To retrieve the settings for inactive entities only:
135
- *
136
- * ```ts
137
- * sdk.admin.translation.settings({
138
- * is_active: false
139
- * })
140
- * .then(({ translation_settings }) => {
141
- * console.log(translation_settings)
142
- * })
143
- * ```
144
- */
145
- settings(query?: HttpTypes.AdminTranslationSettingsParams, headers?: ClientHeaders): Promise<HttpTypes.AdminTranslationSettingsResponse>;
146
- /**
147
- * This method allows bulk operations on translation settings. It sends a request to the
148
- * [Batch Translation Settings](https://docs.acmekit.com/api/admin#translations_posttranslationssettingsbatch)
149
- * API route.
150
- *
151
- * @since 2.12.6
152
- *
153
- * @param body - The translation settings to create, update, or delete.
154
- * @param headers - Headers to pass in the request.
155
- * @returns The translation settings' details.
156
- *
157
- * @example
158
- * sdk.admin.translation.batchSettings({
159
- * create: [
160
- * {
161
- * entity_type: "product",
162
- * fields: ["title", "description"],
163
- * is_active: true
164
- * }
165
- * ],
166
- * update: [
167
- * {
168
- * id: "trset_123",
169
- * fields: ["title", "description", "subtitle"],
170
- * is_active: true
171
- * }
172
- * ],
173
- * delete: ["trset_456"]
174
- * })
175
- * .then(({ created, updated, deleted }) => {
176
- * console.log(created, updated, deleted)
177
- * })
178
- * ```
179
- */
180
- batchSettings(body: HttpTypes.AdminBatchTranslationSettings, headers?: ClientHeaders): Promise<HttpTypes.AdminBatchTranslationSettingsResponse>;
181
- /**
182
- * This method retrieves a paginated list of entities for a given entity type with only their
183
- * translatable fields.
184
- * It sends a request to the
185
- * [Get Translation Entities](https://docs.acmekit.com/api/admin#translations_gettranslationentities) API route.
186
- *
187
- * @since 2.12.4
188
- *
189
- * @param query - The query parameters including the entity type and pagination configurations.
190
- * @param headers - Headers to pass in the request.
191
- * @returns The paginated list of entities with their translatable fields.
192
- *
193
- * @example
194
- * To retrieve the entities for a given entity type:
195
- *
196
- * ```ts
197
- * sdk.admin.translation.entities({
198
- * type: "product"
199
- * })
200
- * .then(({ data, count, offset, limit }) => {
201
- * console.log(data)
202
- * })
203
- * ```
204
- *
205
- * To configure the pagination, pass the `limit` and `offset` query parameters.
206
- *
207
- * For example, to retrieve only 10 items and skip 10 items:
208
- *
209
- * ```ts
210
- * sdk.admin.translation.entities({
211
- * type: "product",
212
- * limit: 10,
213
- * offset: 10
214
- * })
215
- * .then(({ data, count, offset, limit }) => {
216
- * console.log(data)
217
- * })
218
- * ```
219
- */
220
- entities(query: HttpTypes.AdminTranslationEntitiesParams, headers?: ClientHeaders): Promise<HttpTypes.AdminTranslationEntitiesResponse>;
221
- /**
222
- * This method retrieves the statistics for the translations for a given entity type or all entity types if no entity type is provided.
223
- * It sends a request to the
224
- * [Get Translation Statistics](https://docs.acmekit.com/api/admin#translations_gettranslationsstatistics) API route.
225
- *
226
- * @param query - The query parameters which can optionally include the entity type to get the statistics for.
227
- * @param headers - Headers to pass in the request.
228
- * @returns The translation statistics.
229
- *
230
- * @example
231
- * To retrieve the statistics for the translations for a given entity type:
232
- *
233
- * ```ts
234
- * sdk.admin.translation.statistics({
235
- * entity_type: "product"
236
- * })
237
- * .then(({ statistics }) => {
238
- * console.log(statistics)
239
- * })
240
- * ```
241
- *
242
- * To retrieve the statistics for all entity types:
243
- *
244
- * ```ts
245
- * sdk.admin.translation.statistics()
246
- * .then(({ statistics }) => {
247
- * console.log(statistics)
248
- * })
249
- * ```
250
- */
251
- statistics(query?: HttpTypes.AdminTranslationStatisticsParams, headers?: ClientHeaders): Promise<HttpTypes.AdminTranslationStatisticsResponse>;
252
- }
253
- //# sourceMappingURL=translation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../src/admin/translation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,WAAW;IACtB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IAEtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,EAC7C,OAAO,CAAC,EAAE,aAAa;IAWzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACG,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,EAAE,aAAa;IAW3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACG,QAAQ,CACZ,KAAK,CAAC,EAAE,SAAS,CAAC,8BAA8B,EAChD,OAAO,CAAC,EAAE,aAAa;IAWzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,aAAa,CACjB,IAAI,EAAE,SAAS,CAAC,6BAA6B,EAC7C,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACG,QAAQ,CACZ,KAAK,EAAE,SAAS,CAAC,8BAA8B,EAC/C,OAAO,CAAC,EAAE,aAAa;IAWzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,UAAU,CACd,KAAK,CAAC,EAAE,SAAS,CAAC,gCAAgC,EAClD,OAAO,CAAC,EAAE,aAAa;CAU1B"}
@@ -1,301 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- export class Translation {
11
- /**
12
- * @ignore
13
- */
14
- constructor(client) {
15
- this.client = client;
16
- }
17
- /**
18
- * This method retrieves a paginated list of translations. It sends a request to the
19
- * [List Translations](https://docs.acmekit.com/api/admin#translations_gettranslations)
20
- * API route.
21
- *
22
- * @param query - Filters and pagination configurations.
23
- * @param headers - Headers to pass in the request.
24
- * @returns The paginated list of translations.
25
- *
26
- * @example
27
- * To retrieve the list of translations:
28
- *
29
- * ```ts
30
- * sdk.admin.translation.list()
31
- * .then(({ translations, count, limit, offset }) => {
32
- * console.log(translations)
33
- * })
34
- * ```
35
- *
36
- * To configure the pagination, pass the `limit` and `offset` query parameters.
37
- *
38
- * For example, to retrieve only 10 items and skip 10 items:
39
- *
40
- * ```ts
41
- * sdk.admin.translation.list({
42
- * limit: 10,
43
- * offset: 10
44
- * })
45
- * .then(({ translations, count, limit, offset }) => {
46
- * console.log(translations)
47
- * })
48
- * ```
49
- *
50
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
51
- * in each translation:
52
- *
53
- * ```ts
54
- * sdk.admin.translation.list({
55
- * fields: "id,name"
56
- * })
57
- * .then(({ translations, count, limit, offset }) => {
58
- * console.log(translations)
59
- * })
60
- * ```
61
- *
62
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
63
- */
64
- list(query, headers) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- return yield this.client.fetch(`/admin/translations`, {
67
- headers,
68
- query,
69
- });
70
- });
71
- }
72
- /**
73
- * This method allows bulk operations on translations. It sends a request to the
74
- * [Manage Translations](https://docs.acmekit.com/api/admin#translations_posttranslationsbatch)
75
- * API route.
76
- *
77
- * @param payload - The translations to create, update, or delete.
78
- * @param headers - Headers to pass in the request.
79
- * @returns The translations' details.
80
- *
81
- * @example
82
- * sdk.admin.translation.batch({
83
- * create: [
84
- * {
85
- * reference_id: "prod_123",
86
- * reference: "product",
87
- * locale_code: "en-US",
88
- * translations: { title: "Shirt" }
89
- * }
90
- * ],
91
- * update: [
92
- * {
93
- * id: "trans_123",
94
- * translations: { title: "Pants" }
95
- * }
96
- * ],
97
- * delete: ["trans_321"]
98
- * })
99
- * .then(({ created, updated, deleted }) => {
100
- * console.log(created, updated, deleted)
101
- * })
102
- */
103
- batch(body, headers) {
104
- return __awaiter(this, void 0, void 0, function* () {
105
- return yield this.client.fetch(`/admin/translations/batch`, {
106
- method: "POST",
107
- headers,
108
- body,
109
- });
110
- });
111
- }
112
- /**
113
- * This method retrieves the settings for the translations for a given entity type or all entity types if no entity type is provided.
114
- * It sends a request to the
115
- * [Get Translation Settings](https://docs.acmekit.com/api/admin#translations_gettranslationssettings) API route.
116
- *
117
- * @param query - The query parameters which can optionally include the entity type to get the settings for and whether to get the settings for active/inactive entities only.
118
- * @param headers - Headers to pass in the request.
119
- * @returns The translation settings.
120
- *
121
- * @example
122
- * To retrieve the settings for the translations for a given entity type:
123
- *
124
- * ```ts
125
- * sdk.admin.translation.settings({
126
- * entity_type: "product"
127
- * })
128
- * .then(({ translation_settings }) => {
129
- * console.log(translation_settings)
130
- * })
131
- * ```
132
- *
133
- * To retrieve the settings for all entity types:
134
- *
135
- * ```ts
136
- * sdk.admin.translation.settings()
137
- * .then(({ translation_settings }) => {
138
- * console.log(translation_settings)
139
- * })
140
- * ```
141
- *
142
- * To retrieve the settings for active entities only:
143
- *
144
- * ```ts
145
- * sdk.admin.translation.settings({
146
- * is_active: true
147
- * })
148
- * .then(({ translation_settings }) => {
149
- * console.log(translation_settings)
150
- * })
151
- * ```
152
- *
153
- * To retrieve the settings for inactive entities only:
154
- *
155
- * ```ts
156
- * sdk.admin.translation.settings({
157
- * is_active: false
158
- * })
159
- * .then(({ translation_settings }) => {
160
- * console.log(translation_settings)
161
- * })
162
- * ```
163
- */
164
- settings(query, headers) {
165
- return __awaiter(this, void 0, void 0, function* () {
166
- return yield this.client.fetch(`/admin/translations/settings`, {
167
- headers,
168
- query,
169
- });
170
- });
171
- }
172
- /**
173
- * This method allows bulk operations on translation settings. It sends a request to the
174
- * [Batch Translation Settings](https://docs.acmekit.com/api/admin#translations_posttranslationssettingsbatch)
175
- * API route.
176
- *
177
- * @since 2.12.6
178
- *
179
- * @param body - The translation settings to create, update, or delete.
180
- * @param headers - Headers to pass in the request.
181
- * @returns The translation settings' details.
182
- *
183
- * @example
184
- * sdk.admin.translation.batchSettings({
185
- * create: [
186
- * {
187
- * entity_type: "product",
188
- * fields: ["title", "description"],
189
- * is_active: true
190
- * }
191
- * ],
192
- * update: [
193
- * {
194
- * id: "trset_123",
195
- * fields: ["title", "description", "subtitle"],
196
- * is_active: true
197
- * }
198
- * ],
199
- * delete: ["trset_456"]
200
- * })
201
- * .then(({ created, updated, deleted }) => {
202
- * console.log(created, updated, deleted)
203
- * })
204
- * ```
205
- */
206
- batchSettings(body, headers) {
207
- return __awaiter(this, void 0, void 0, function* () {
208
- return yield this.client.fetch(`/admin/translations/settings/batch`, {
209
- method: "POST",
210
- headers,
211
- body,
212
- });
213
- });
214
- }
215
- /**
216
- * This method retrieves a paginated list of entities for a given entity type with only their
217
- * translatable fields.
218
- * It sends a request to the
219
- * [Get Translation Entities](https://docs.acmekit.com/api/admin#translations_gettranslationentities) API route.
220
- *
221
- * @since 2.12.4
222
- *
223
- * @param query - The query parameters including the entity type and pagination configurations.
224
- * @param headers - Headers to pass in the request.
225
- * @returns The paginated list of entities with their translatable fields.
226
- *
227
- * @example
228
- * To retrieve the entities for a given entity type:
229
- *
230
- * ```ts
231
- * sdk.admin.translation.entities({
232
- * type: "product"
233
- * })
234
- * .then(({ data, count, offset, limit }) => {
235
- * console.log(data)
236
- * })
237
- * ```
238
- *
239
- * To configure the pagination, pass the `limit` and `offset` query parameters.
240
- *
241
- * For example, to retrieve only 10 items and skip 10 items:
242
- *
243
- * ```ts
244
- * sdk.admin.translation.entities({
245
- * type: "product",
246
- * limit: 10,
247
- * offset: 10
248
- * })
249
- * .then(({ data, count, offset, limit }) => {
250
- * console.log(data)
251
- * })
252
- * ```
253
- */
254
- entities(query, headers) {
255
- return __awaiter(this, void 0, void 0, function* () {
256
- return yield this.client.fetch(`/admin/translations/entities`, {
257
- headers,
258
- query,
259
- });
260
- });
261
- }
262
- /**
263
- * This method retrieves the statistics for the translations for a given entity type or all entity types if no entity type is provided.
264
- * It sends a request to the
265
- * [Get Translation Statistics](https://docs.acmekit.com/api/admin#translations_gettranslationsstatistics) API route.
266
- *
267
- * @param query - The query parameters which can optionally include the entity type to get the statistics for.
268
- * @param headers - Headers to pass in the request.
269
- * @returns The translation statistics.
270
- *
271
- * @example
272
- * To retrieve the statistics for the translations for a given entity type:
273
- *
274
- * ```ts
275
- * sdk.admin.translation.statistics({
276
- * entity_type: "product"
277
- * })
278
- * .then(({ statistics }) => {
279
- * console.log(statistics)
280
- * })
281
- * ```
282
- *
283
- * To retrieve the statistics for all entity types:
284
- *
285
- * ```ts
286
- * sdk.admin.translation.statistics()
287
- * .then(({ statistics }) => {
288
- * console.log(statistics)
289
- * })
290
- * ```
291
- */
292
- statistics(query, headers) {
293
- return __awaiter(this, void 0, void 0, function* () {
294
- return yield this.client.fetch(`/admin/translations/statistics`, {
295
- headers,
296
- query,
297
- });
298
- });
299
- }
300
- }
301
- //# sourceMappingURL=translation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../src/admin/translation.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,WAAW;IAMtB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,KAA6C,EAC7C,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,qBAAqB,EACrB;gBACE,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACG,KAAK,CAAC,IAAsC,EAAE,OAAuB;;YACzE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,EAC3B;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;aACL,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACG,QAAQ,CACZ,KAAgD,EAChD,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,8BAA8B,EAC9B;gBACE,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,aAAa,CACjB,IAA6C,EAC7C,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oCAAoC,EACpC;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;aACL,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACG,QAAQ,CACZ,KAA+C,EAC/C,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,8BAA8B,EAC9B;gBACE,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,UAAU,CACd,KAAkD,EAClD,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gCAAgC,EAChC;gBACE,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}