@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,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Plugin = void 0;
4
- class Plugin {
5
- /**
6
- * @ignore
7
- */
8
- constructor(client) {
9
- this.client = client;
10
- }
11
- /**
12
- * This method retrieves the list of plugins installed in a AcmeKit application.
13
- *
14
- * @param headers - Headers to pass in the request.
15
- * @returns The list of plugins.
16
- *
17
- * @example
18
- * sdk.admin.plugin.list()
19
- * .then(({ plugins }) => {
20
- * console.log(plugins)
21
- * })
22
- */
23
- async list(headers) {
24
- return await this.client.fetch(`/admin/plugins`, {
25
- headers,
26
- query: {},
27
- });
28
- }
29
- }
30
- exports.Plugin = Plugin;
31
- //# sourceMappingURL=plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/admin/plugin.ts"],"names":[],"mappings":";;;AAIA,MAAa,MAAM;IAMjB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gBAAgB,EAChB;YACE,OAAO;YACP,KAAK,EAAE,EAAE;SACV,CACF,CAAA;IACH,CAAC;CACF;AAlCD,wBAkCC"}
@@ -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,284 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Translation = void 0;
4
- class Translation {
5
- /**
6
- * @ignore
7
- */
8
- constructor(client) {
9
- this.client = client;
10
- }
11
- /**
12
- * This method retrieves a paginated list of translations. It sends a request to the
13
- * [List Translations](https://docs.acmekit.com/api/admin#translations_gettranslations)
14
- * API route.
15
- *
16
- * @param query - Filters and pagination configurations.
17
- * @param headers - Headers to pass in the request.
18
- * @returns The paginated list of translations.
19
- *
20
- * @example
21
- * To retrieve the list of translations:
22
- *
23
- * ```ts
24
- * sdk.admin.translation.list()
25
- * .then(({ translations, count, limit, offset }) => {
26
- * console.log(translations)
27
- * })
28
- * ```
29
- *
30
- * To configure the pagination, pass the `limit` and `offset` query parameters.
31
- *
32
- * For example, to retrieve only 10 items and skip 10 items:
33
- *
34
- * ```ts
35
- * sdk.admin.translation.list({
36
- * limit: 10,
37
- * offset: 10
38
- * })
39
- * .then(({ translations, count, limit, offset }) => {
40
- * console.log(translations)
41
- * })
42
- * ```
43
- *
44
- * Using the `fields` query parameter, you can specify the fields and relations to retrieve
45
- * in each translation:
46
- *
47
- * ```ts
48
- * sdk.admin.translation.list({
49
- * fields: "id,name"
50
- * })
51
- * .then(({ translations, count, limit, offset }) => {
52
- * console.log(translations)
53
- * })
54
- * ```
55
- *
56
- * Learn more about the `fields` property in the [API reference](https://docs.acmekit.com/api/store#select-fields-and-relations).
57
- */
58
- async list(query, headers) {
59
- return await this.client.fetch(`/admin/translations`, {
60
- headers,
61
- query,
62
- });
63
- }
64
- /**
65
- * This method allows bulk operations on translations. It sends a request to the
66
- * [Manage Translations](https://docs.acmekit.com/api/admin#translations_posttranslationsbatch)
67
- * API route.
68
- *
69
- * @param payload - The translations to create, update, or delete.
70
- * @param headers - Headers to pass in the request.
71
- * @returns The translations' details.
72
- *
73
- * @example
74
- * sdk.admin.translation.batch({
75
- * create: [
76
- * {
77
- * reference_id: "prod_123",
78
- * reference: "product",
79
- * locale_code: "en-US",
80
- * translations: { title: "Shirt" }
81
- * }
82
- * ],
83
- * update: [
84
- * {
85
- * id: "trans_123",
86
- * translations: { title: "Pants" }
87
- * }
88
- * ],
89
- * delete: ["trans_321"]
90
- * })
91
- * .then(({ created, updated, deleted }) => {
92
- * console.log(created, updated, deleted)
93
- * })
94
- */
95
- async batch(body, headers) {
96
- return await this.client.fetch(`/admin/translations/batch`, {
97
- method: "POST",
98
- headers,
99
- body,
100
- });
101
- }
102
- /**
103
- * This method retrieves the settings for the translations for a given entity type or all entity types if no entity type is provided.
104
- * It sends a request to the
105
- * [Get Translation Settings](https://docs.acmekit.com/api/admin#translations_gettranslationssettings) API route.
106
- *
107
- * @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.
108
- * @param headers - Headers to pass in the request.
109
- * @returns The translation settings.
110
- *
111
- * @example
112
- * To retrieve the settings for the translations for a given entity type:
113
- *
114
- * ```ts
115
- * sdk.admin.translation.settings({
116
- * entity_type: "product"
117
- * })
118
- * .then(({ translation_settings }) => {
119
- * console.log(translation_settings)
120
- * })
121
- * ```
122
- *
123
- * To retrieve the settings for all entity types:
124
- *
125
- * ```ts
126
- * sdk.admin.translation.settings()
127
- * .then(({ translation_settings }) => {
128
- * console.log(translation_settings)
129
- * })
130
- * ```
131
- *
132
- * To retrieve the settings for active entities only:
133
- *
134
- * ```ts
135
- * sdk.admin.translation.settings({
136
- * is_active: true
137
- * })
138
- * .then(({ translation_settings }) => {
139
- * console.log(translation_settings)
140
- * })
141
- * ```
142
- *
143
- * To retrieve the settings for inactive entities only:
144
- *
145
- * ```ts
146
- * sdk.admin.translation.settings({
147
- * is_active: false
148
- * })
149
- * .then(({ translation_settings }) => {
150
- * console.log(translation_settings)
151
- * })
152
- * ```
153
- */
154
- async settings(query, headers) {
155
- return await this.client.fetch(`/admin/translations/settings`, {
156
- headers,
157
- query,
158
- });
159
- }
160
- /**
161
- * This method allows bulk operations on translation settings. It sends a request to the
162
- * [Batch Translation Settings](https://docs.acmekit.com/api/admin#translations_posttranslationssettingsbatch)
163
- * API route.
164
- *
165
- * @since 2.12.6
166
- *
167
- * @param body - The translation settings to create, update, or delete.
168
- * @param headers - Headers to pass in the request.
169
- * @returns The translation settings' details.
170
- *
171
- * @example
172
- * sdk.admin.translation.batchSettings({
173
- * create: [
174
- * {
175
- * entity_type: "product",
176
- * fields: ["title", "description"],
177
- * is_active: true
178
- * }
179
- * ],
180
- * update: [
181
- * {
182
- * id: "trset_123",
183
- * fields: ["title", "description", "subtitle"],
184
- * is_active: true
185
- * }
186
- * ],
187
- * delete: ["trset_456"]
188
- * })
189
- * .then(({ created, updated, deleted }) => {
190
- * console.log(created, updated, deleted)
191
- * })
192
- * ```
193
- */
194
- async batchSettings(body, headers) {
195
- return await this.client.fetch(`/admin/translations/settings/batch`, {
196
- method: "POST",
197
- headers,
198
- body,
199
- });
200
- }
201
- /**
202
- * This method retrieves a paginated list of entities for a given entity type with only their
203
- * translatable fields.
204
- * It sends a request to the
205
- * [Get Translation Entities](https://docs.acmekit.com/api/admin#translations_gettranslationentities) API route.
206
- *
207
- * @since 2.12.4
208
- *
209
- * @param query - The query parameters including the entity type and pagination configurations.
210
- * @param headers - Headers to pass in the request.
211
- * @returns The paginated list of entities with their translatable fields.
212
- *
213
- * @example
214
- * To retrieve the entities for a given entity type:
215
- *
216
- * ```ts
217
- * sdk.admin.translation.entities({
218
- * type: "product"
219
- * })
220
- * .then(({ data, count, offset, limit }) => {
221
- * console.log(data)
222
- * })
223
- * ```
224
- *
225
- * To configure the pagination, pass the `limit` and `offset` query parameters.
226
- *
227
- * For example, to retrieve only 10 items and skip 10 items:
228
- *
229
- * ```ts
230
- * sdk.admin.translation.entities({
231
- * type: "product",
232
- * limit: 10,
233
- * offset: 10
234
- * })
235
- * .then(({ data, count, offset, limit }) => {
236
- * console.log(data)
237
- * })
238
- * ```
239
- */
240
- async entities(query, headers) {
241
- return await this.client.fetch(`/admin/translations/entities`, {
242
- headers,
243
- query,
244
- });
245
- }
246
- /**
247
- * This method retrieves the statistics for the translations for a given entity type or all entity types if no entity type is provided.
248
- * It sends a request to the
249
- * [Get Translation Statistics](https://docs.acmekit.com/api/admin#translations_gettranslationsstatistics) API route.
250
- *
251
- * @param query - The query parameters which can optionally include the entity type to get the statistics for.
252
- * @param headers - Headers to pass in the request.
253
- * @returns The translation statistics.
254
- *
255
- * @example
256
- * To retrieve the statistics for the translations for a given entity type:
257
- *
258
- * ```ts
259
- * sdk.admin.translation.statistics({
260
- * entity_type: "product"
261
- * })
262
- * .then(({ statistics }) => {
263
- * console.log(statistics)
264
- * })
265
- * ```
266
- *
267
- * To retrieve the statistics for all entity types:
268
- *
269
- * ```ts
270
- * sdk.admin.translation.statistics()
271
- * .then(({ statistics }) => {
272
- * console.log(statistics)
273
- * })
274
- * ```
275
- */
276
- async statistics(query, headers) {
277
- return await this.client.fetch(`/admin/translations/statistics`, {
278
- headers,
279
- query,
280
- });
281
- }
282
- }
283
- exports.Translation = Translation;
284
- //# sourceMappingURL=translation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/admin/translation.ts"],"names":[],"mappings":";;;AAIA,MAAa,WAAW;IAMtB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,KAAK,CAAC,IAAI,CACR,KAA6C,EAC7C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,qBAAqB,EACrB;YACE,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,KAAK,CAAC,KAAK,CAAC,IAAsC,EAAE,OAAuB;QACzE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,EAC3B;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,KAAK,CAAC,QAAQ,CACZ,KAAgD,EAChD,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,8BAA8B,EAC9B;YACE,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,KAAK,CAAC,aAAa,CACjB,IAA6C,EAC7C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oCAAoC,EACpC;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,KAAK,CAAC,QAAQ,CACZ,KAA+C,EAC/C,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,8BAA8B,EAC9B;YACE,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,KAAK,CAAC,UAAU,CACd,KAAkD,EAClD,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gCAAgC,EAChC;YACE,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;CACF;AAlUD,kCAkUC"}
@@ -1,97 +0,0 @@
1
- import { HttpTypes, SelectParams } from "@acmekit/types";
2
- import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
4
- export declare class Upload {
5
- /**
6
- * @ignore
7
- */
8
- private client;
9
- /**
10
- * @ignore
11
- */
12
- constructor(client: Client);
13
- /**
14
- * This method creates a new upload. It sends a request to the
15
- * [Upload Files](https://docs.acmekit.com/api/admin#uploads_postuploads)
16
- * API route.
17
- *
18
- * @param body - The details of the files to upload.
19
- * @param query - Configure the fields and relations to retrieve in the uploaded files.
20
- * @param headers - Headers to pass in the request.
21
- * @returns The upload files' details.
22
- *
23
- * @privateRemarks
24
- *
25
- * Note: The creation/upload flow be made more advanced, with support for streaming and progress, but for now we keep it simple
26
- *
27
- * @example
28
- * sdk.admin.upload.create(
29
- * {
30
- * files: [
31
- * // file uploaded as a binary string
32
- * {
33
- * name: "test.txt",
34
- * content: "test", // Should be the binary string of the file
35
- * },
36
- * // file uploaded as a File object
37
- * new File(["test"], "test.txt", { type: "text/plain" })
38
- * ],
39
- * }
40
- * )
41
- * .then(({ files }) => {
42
- * console.log(files)
43
- * })
44
- */
45
- create(body: HttpTypes.AdminUploadFile, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFileListResponse>;
46
- /**
47
- * This method retrieves a file's details by its ID. It sends a request to the
48
- * [Get File](https://docs.acmekit.com/api/admin#uploads_getuploadsid)
49
- * API route.
50
- *
51
- * @param id - The ID of the file to retrieve.
52
- * @param query - Query parameters to pass in the request.
53
- * @param headers - Headers to pass in the request.
54
- * @returns The file's details.
55
- *
56
- * @example
57
- * sdk.admin.upload.retrieve("test.txt")
58
- * .then(({ file }) => {
59
- * console.log(file)
60
- * })
61
- */
62
- retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFileResponse>;
63
- /**
64
- * This method deletes a file by its ID from the configured File Module Provider. It sends a request to the
65
- * [Delete File](https://docs.acmekit.com/api/admin#uploads_deleteuploadsid)
66
- * API route.
67
- *
68
- * @param id - The ID of the file to delete.
69
- * @param headers - Headers to pass in the request.
70
- * @returns The deletion's details.
71
- *
72
- * @example
73
- * sdk.admin.upload.delete("test.txt")
74
- * .then(({ deleted }) => {
75
- * console.log(deleted)
76
- * })
77
- */
78
- delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminFileDeleteResponse>;
79
- /**
80
- * This method creates a presigned URL for a file upload. It sends a request to the
81
- * `/admin/uploads/presigned-urls` API route.
82
- *
83
- * @param body - The details of the file to upload.
84
- * @param query - Query parameters to pass in the request.
85
- * @param headers - Headers to pass in the request.
86
- * @returns The presigned URL for the file upload.
87
- *
88
- * @example
89
- * sdk.admin.upload.presignedUrl({
90
- * name: "test.txt",
91
- * size: 1000,
92
- * type: "text/plain",
93
- * }))
94
- */
95
- presignedUrl(body: HttpTypes.AdminUploadPreSignedUrlRequest, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminUploadPreSignedUrlResponse>;
96
- }
97
- //# sourceMappingURL=upload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/admin/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACxD,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;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,eAAe,EAC/B,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAoCzB;;;;;;;;;;;;;;;OAeG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa;IAUxE;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAUhD;;;;;;;;;;;;;;;OAeG;IACG,YAAY,CAChB,IAAI,EAAE,SAAS,CAAC,8BAA8B,EAC9C,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;CAY1B"}