@salesforce/b2c-tooling-sdk 0.0.0-nightly.20260122024142 → 0.0.0-nightly.20260122154743

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 (163) hide show
  1. package/dist/cjs/cli/instance-command.d.ts +1 -0
  2. package/dist/cjs/cli/mrt-command.d.ts +2 -1
  3. package/dist/cjs/cli/mrt-command.js +3 -2
  4. package/dist/cjs/cli/mrt-command.js.map +1 -1
  5. package/dist/cjs/cli/oauth-command.d.ts +1 -0
  6. package/dist/cjs/cli/oauth-command.js +6 -0
  7. package/dist/cjs/cli/oauth-command.js.map +1 -1
  8. package/dist/cjs/cli/ods-command.d.ts +1 -0
  9. package/dist/cjs/cli/webdav-command.d.ts +1 -0
  10. package/dist/cjs/clients/cdn-zones.d.ts +154 -0
  11. package/dist/cjs/clients/cdn-zones.generated.d.ts +8330 -0
  12. package/dist/cjs/clients/cdn-zones.generated.js +6 -0
  13. package/dist/cjs/clients/cdn-zones.generated.js.map +1 -0
  14. package/dist/cjs/clients/cdn-zones.js +100 -0
  15. package/dist/cjs/clients/cdn-zones.js.map +1 -0
  16. package/dist/cjs/clients/error-utils.d.ts +35 -0
  17. package/dist/cjs/clients/error-utils.js +69 -0
  18. package/dist/cjs/clients/error-utils.js.map +1 -0
  19. package/dist/cjs/clients/index.d.ts +5 -0
  20. package/dist/cjs/clients/index.js +3 -0
  21. package/dist/cjs/clients/index.js.map +1 -1
  22. package/dist/cjs/clients/middleware-registry.d.ts +1 -1
  23. package/dist/cjs/clients/middleware-registry.js.map +1 -1
  24. package/dist/cjs/clients/mrt-b2c.d.ts +114 -0
  25. package/dist/cjs/clients/mrt-b2c.generated.d.ts +176 -0
  26. package/dist/cjs/clients/mrt-b2c.generated.js +6 -0
  27. package/dist/cjs/clients/mrt-b2c.generated.js.map +1 -0
  28. package/dist/cjs/clients/mrt-b2c.js +86 -0
  29. package/dist/cjs/clients/mrt-b2c.js.map +1 -0
  30. package/dist/cjs/config/dw-json.d.ts +6 -0
  31. package/dist/cjs/config/dw-json.js.map +1 -1
  32. package/dist/cjs/config/mapping.js +3 -0
  33. package/dist/cjs/config/mapping.js.map +1 -1
  34. package/dist/cjs/config/resolver.js +3 -0
  35. package/dist/cjs/config/resolver.js.map +1 -1
  36. package/dist/cjs/config/types.d.ts +2 -0
  37. package/dist/cjs/index.d.ts +2 -2
  38. package/dist/cjs/index.js +1 -1
  39. package/dist/cjs/index.js.map +1 -1
  40. package/dist/cjs/operations/code/deploy.js +9 -3
  41. package/dist/cjs/operations/code/deploy.js.map +1 -1
  42. package/dist/cjs/operations/mrt/access-control.d.ts +192 -0
  43. package/dist/cjs/operations/mrt/access-control.js +152 -0
  44. package/dist/cjs/operations/mrt/access-control.js.map +1 -0
  45. package/dist/cjs/operations/mrt/b2c-config.d.ts +201 -0
  46. package/dist/cjs/operations/mrt/b2c-config.js +195 -0
  47. package/dist/cjs/operations/mrt/b2c-config.js.map +1 -0
  48. package/dist/cjs/operations/mrt/cache.d.ts +80 -0
  49. package/dist/cjs/operations/mrt/cache.js +65 -0
  50. package/dist/cjs/operations/mrt/cache.js.map +1 -0
  51. package/dist/cjs/operations/mrt/deployment.d.ts +157 -0
  52. package/dist/cjs/operations/mrt/deployment.js +109 -0
  53. package/dist/cjs/operations/mrt/deployment.js.map +1 -0
  54. package/dist/cjs/operations/mrt/env.d.ts +141 -0
  55. package/dist/cjs/operations/mrt/env.js +119 -0
  56. package/dist/cjs/operations/mrt/env.js.map +1 -1
  57. package/dist/cjs/operations/mrt/index.d.ts +24 -4
  58. package/dist/cjs/operations/mrt/index.js +23 -3
  59. package/dist/cjs/operations/mrt/index.js.map +1 -1
  60. package/dist/cjs/operations/mrt/member.d.ts +281 -0
  61. package/dist/cjs/operations/mrt/member.js +244 -0
  62. package/dist/cjs/operations/mrt/member.js.map +1 -0
  63. package/dist/cjs/operations/mrt/notification.d.ts +252 -0
  64. package/dist/cjs/operations/mrt/notification.js +206 -0
  65. package/dist/cjs/operations/mrt/notification.js.map +1 -0
  66. package/dist/cjs/operations/mrt/organization.d.ts +80 -0
  67. package/dist/cjs/operations/mrt/organization.js +53 -0
  68. package/dist/cjs/operations/mrt/organization.js.map +1 -0
  69. package/dist/cjs/operations/mrt/project.d.ts +261 -0
  70. package/dist/cjs/operations/mrt/project.js +232 -0
  71. package/dist/cjs/operations/mrt/project.js.map +1 -0
  72. package/dist/cjs/operations/mrt/push.d.ts +122 -8
  73. package/dist/cjs/operations/mrt/push.js +83 -10
  74. package/dist/cjs/operations/mrt/push.js.map +1 -1
  75. package/dist/cjs/operations/mrt/redirect.d.ts +337 -0
  76. package/dist/cjs/operations/mrt/redirect.js +256 -0
  77. package/dist/cjs/operations/mrt/redirect.js.map +1 -0
  78. package/dist/cjs/operations/mrt/user.d.ts +135 -0
  79. package/dist/cjs/operations/mrt/user.js +153 -0
  80. package/dist/cjs/operations/mrt/user.js.map +1 -0
  81. package/dist/esm/cli/instance-command.d.ts +1 -0
  82. package/dist/esm/cli/mrt-command.d.ts +2 -1
  83. package/dist/esm/cli/mrt-command.js +3 -2
  84. package/dist/esm/cli/mrt-command.js.map +1 -1
  85. package/dist/esm/cli/oauth-command.d.ts +1 -0
  86. package/dist/esm/cli/oauth-command.js +6 -0
  87. package/dist/esm/cli/oauth-command.js.map +1 -1
  88. package/dist/esm/cli/ods-command.d.ts +1 -0
  89. package/dist/esm/cli/webdav-command.d.ts +1 -0
  90. package/dist/esm/clients/cdn-zones.d.ts +154 -0
  91. package/dist/esm/clients/cdn-zones.generated.d.ts +8330 -0
  92. package/dist/esm/clients/cdn-zones.generated.js +6 -0
  93. package/dist/esm/clients/cdn-zones.generated.js.map +1 -0
  94. package/dist/esm/clients/cdn-zones.js +100 -0
  95. package/dist/esm/clients/cdn-zones.js.map +1 -0
  96. package/dist/esm/clients/error-utils.d.ts +35 -0
  97. package/dist/esm/clients/error-utils.js +69 -0
  98. package/dist/esm/clients/error-utils.js.map +1 -0
  99. package/dist/esm/clients/index.d.ts +5 -0
  100. package/dist/esm/clients/index.js +3 -0
  101. package/dist/esm/clients/index.js.map +1 -1
  102. package/dist/esm/clients/middleware-registry.d.ts +1 -1
  103. package/dist/esm/clients/middleware-registry.js.map +1 -1
  104. package/dist/esm/clients/mrt-b2c.d.ts +114 -0
  105. package/dist/esm/clients/mrt-b2c.generated.d.ts +176 -0
  106. package/dist/esm/clients/mrt-b2c.generated.js +6 -0
  107. package/dist/esm/clients/mrt-b2c.generated.js.map +1 -0
  108. package/dist/esm/clients/mrt-b2c.js +86 -0
  109. package/dist/esm/clients/mrt-b2c.js.map +1 -0
  110. package/dist/esm/config/dw-json.d.ts +6 -0
  111. package/dist/esm/config/dw-json.js.map +1 -1
  112. package/dist/esm/config/mapping.js +3 -0
  113. package/dist/esm/config/mapping.js.map +1 -1
  114. package/dist/esm/config/resolver.js +3 -0
  115. package/dist/esm/config/resolver.js.map +1 -1
  116. package/dist/esm/config/types.d.ts +2 -0
  117. package/dist/esm/index.d.ts +2 -2
  118. package/dist/esm/index.js +1 -1
  119. package/dist/esm/index.js.map +1 -1
  120. package/dist/esm/operations/code/deploy.js +9 -3
  121. package/dist/esm/operations/code/deploy.js.map +1 -1
  122. package/dist/esm/operations/mrt/access-control.d.ts +192 -0
  123. package/dist/esm/operations/mrt/access-control.js +152 -0
  124. package/dist/esm/operations/mrt/access-control.js.map +1 -0
  125. package/dist/esm/operations/mrt/b2c-config.d.ts +201 -0
  126. package/dist/esm/operations/mrt/b2c-config.js +195 -0
  127. package/dist/esm/operations/mrt/b2c-config.js.map +1 -0
  128. package/dist/esm/operations/mrt/cache.d.ts +80 -0
  129. package/dist/esm/operations/mrt/cache.js +65 -0
  130. package/dist/esm/operations/mrt/cache.js.map +1 -0
  131. package/dist/esm/operations/mrt/deployment.d.ts +157 -0
  132. package/dist/esm/operations/mrt/deployment.js +109 -0
  133. package/dist/esm/operations/mrt/deployment.js.map +1 -0
  134. package/dist/esm/operations/mrt/env.d.ts +141 -0
  135. package/dist/esm/operations/mrt/env.js +119 -0
  136. package/dist/esm/operations/mrt/env.js.map +1 -1
  137. package/dist/esm/operations/mrt/index.d.ts +24 -4
  138. package/dist/esm/operations/mrt/index.js +23 -3
  139. package/dist/esm/operations/mrt/index.js.map +1 -1
  140. package/dist/esm/operations/mrt/member.d.ts +281 -0
  141. package/dist/esm/operations/mrt/member.js +244 -0
  142. package/dist/esm/operations/mrt/member.js.map +1 -0
  143. package/dist/esm/operations/mrt/notification.d.ts +252 -0
  144. package/dist/esm/operations/mrt/notification.js +206 -0
  145. package/dist/esm/operations/mrt/notification.js.map +1 -0
  146. package/dist/esm/operations/mrt/organization.d.ts +80 -0
  147. package/dist/esm/operations/mrt/organization.js +53 -0
  148. package/dist/esm/operations/mrt/organization.js.map +1 -0
  149. package/dist/esm/operations/mrt/project.d.ts +261 -0
  150. package/dist/esm/operations/mrt/project.js +232 -0
  151. package/dist/esm/operations/mrt/project.js.map +1 -0
  152. package/dist/esm/operations/mrt/push.d.ts +122 -8
  153. package/dist/esm/operations/mrt/push.js +83 -10
  154. package/dist/esm/operations/mrt/push.js.map +1 -1
  155. package/dist/esm/operations/mrt/redirect.d.ts +337 -0
  156. package/dist/esm/operations/mrt/redirect.js +256 -0
  157. package/dist/esm/operations/mrt/redirect.js.map +1 -0
  158. package/dist/esm/operations/mrt/user.d.ts +135 -0
  159. package/dist/esm/operations/mrt/user.js +153 -0
  160. package/dist/esm/operations/mrt/user.js.map +1 -0
  161. package/package.json +2 -2
  162. package/specs/cdn-zones-v1.yaml +9324 -0
  163. package/specs/mrt-b2c.json +384 -0
@@ -0,0 +1,256 @@
1
+ import { createMrtClient, DEFAULT_MRT_ORIGIN } from '../../clients/mrt.js';
2
+ import { getLogger } from '../../logging/logger.js';
3
+ /**
4
+ * Lists redirects for an MRT environment.
5
+ *
6
+ * @param options - List options
7
+ * @param auth - Authentication strategy (ApiKeyStrategy)
8
+ * @returns Paginated list of redirects
9
+ * @throws Error if request fails
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
14
+ * import { listRedirects } from '@salesforce/b2c-tooling-sdk/operations/mrt';
15
+ *
16
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
17
+ *
18
+ * const result = await listRedirects({
19
+ * projectSlug: 'my-storefront',
20
+ * targetSlug: 'staging'
21
+ * }, auth);
22
+ *
23
+ * for (const redirect of result.redirects) {
24
+ * console.log(`${redirect.from_path} -> ${redirect.to_url}`);
25
+ * }
26
+ * ```
27
+ */
28
+ export async function listRedirects(options, auth) {
29
+ const logger = getLogger();
30
+ const { projectSlug, targetSlug, limit, offset, search, ordering, origin } = options;
31
+ logger.debug({ projectSlug, targetSlug }, '[MRT] Listing redirects');
32
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
33
+ const { data, error } = await client.GET('/api/projects/{project_slug}/target/{target_slug}/redirect/', {
34
+ params: {
35
+ path: { project_slug: projectSlug, target_slug: targetSlug },
36
+ query: {
37
+ limit,
38
+ offset,
39
+ search,
40
+ ordering,
41
+ },
42
+ },
43
+ });
44
+ if (error) {
45
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
46
+ ? String(error.message)
47
+ : JSON.stringify(error);
48
+ throw new Error(`Failed to list redirects: ${errorMessage}`);
49
+ }
50
+ logger.debug({ count: data.count }, '[MRT] Redirects listed');
51
+ return {
52
+ count: data.count ?? 0,
53
+ next: data.next ?? null,
54
+ previous: data.previous ?? null,
55
+ redirects: data.results ?? [],
56
+ };
57
+ }
58
+ /**
59
+ * Creates a redirect for an MRT environment.
60
+ *
61
+ * @param options - Create redirect options
62
+ * @param auth - Authentication strategy (ApiKeyStrategy)
63
+ * @returns The created redirect
64
+ * @throws Error if request fails
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
69
+ * import { createRedirect } from '@salesforce/b2c-tooling-sdk/operations/mrt';
70
+ *
71
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
72
+ *
73
+ * const redirect = await createRedirect({
74
+ * projectSlug: 'my-storefront',
75
+ * targetSlug: 'staging',
76
+ * fromPath: '/old-page',
77
+ * toUrl: '/new-page',
78
+ * httpStatusCode: 301
79
+ * }, auth);
80
+ * ```
81
+ */
82
+ export async function createRedirect(options, auth) {
83
+ const logger = getLogger();
84
+ const { projectSlug, targetSlug, fromPath, toUrl, httpStatusCode, forwardQuerystring, forwardWildcard, origin } = options;
85
+ logger.debug({ projectSlug, targetSlug, fromPath, toUrl }, '[MRT] Creating redirect');
86
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
87
+ const body = {
88
+ from_path: fromPath,
89
+ to_url: toUrl,
90
+ http_status_code: httpStatusCode,
91
+ forward_querystring: forwardQuerystring,
92
+ forward_wildcard: forwardWildcard,
93
+ };
94
+ const { data, error } = await client.POST('/api/projects/{project_slug}/target/{target_slug}/redirect/', {
95
+ params: {
96
+ path: { project_slug: projectSlug, target_slug: targetSlug },
97
+ },
98
+ body,
99
+ });
100
+ if (error) {
101
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
102
+ ? String(error.message)
103
+ : JSON.stringify(error);
104
+ throw new Error(`Failed to create redirect: ${errorMessage}`);
105
+ }
106
+ logger.debug({ fromPath }, '[MRT] Redirect created');
107
+ return data;
108
+ }
109
+ /**
110
+ * Gets a redirect from an MRT environment.
111
+ *
112
+ * @param options - Get redirect options
113
+ * @param auth - Authentication strategy (ApiKeyStrategy)
114
+ * @returns The redirect
115
+ * @throws Error if request fails
116
+ */
117
+ export async function getRedirect(options, auth) {
118
+ const logger = getLogger();
119
+ const { projectSlug, targetSlug, fromPath, origin } = options;
120
+ logger.debug({ projectSlug, targetSlug, fromPath }, '[MRT] Getting redirect');
121
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
122
+ const { data, error } = await client.GET('/api/projects/{project_slug}/target/{target_slug}/redirect/{from_path}', {
123
+ params: {
124
+ path: { project_slug: projectSlug, target_slug: targetSlug, from_path: fromPath },
125
+ },
126
+ });
127
+ if (error) {
128
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
129
+ ? String(error.message)
130
+ : JSON.stringify(error);
131
+ throw new Error(`Failed to get redirect: ${errorMessage}`);
132
+ }
133
+ logger.debug({ fromPath }, '[MRT] Redirect retrieved');
134
+ return data;
135
+ }
136
+ /**
137
+ * Updates a redirect in an MRT environment.
138
+ *
139
+ * @param options - Update redirect options
140
+ * @param auth - Authentication strategy (ApiKeyStrategy)
141
+ * @returns The updated redirect
142
+ * @throws Error if request fails
143
+ */
144
+ export async function updateRedirect(options, auth) {
145
+ const logger = getLogger();
146
+ const { projectSlug, targetSlug, fromPath, toUrl, httpStatusCode, forwardQuerystring, forwardWildcard, origin } = options;
147
+ logger.debug({ projectSlug, targetSlug, fromPath }, '[MRT] Updating redirect');
148
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
149
+ const body = {};
150
+ if (toUrl !== undefined) {
151
+ body.to_url = toUrl;
152
+ }
153
+ if (httpStatusCode !== undefined) {
154
+ body.http_status_code = httpStatusCode;
155
+ }
156
+ if (forwardQuerystring !== undefined) {
157
+ body.forward_querystring = forwardQuerystring;
158
+ }
159
+ if (forwardWildcard !== undefined) {
160
+ body.forward_wildcard = forwardWildcard;
161
+ }
162
+ const { data, error } = await client.PATCH('/api/projects/{project_slug}/target/{target_slug}/redirect/{from_path}', {
163
+ params: {
164
+ path: { project_slug: projectSlug, target_slug: targetSlug, from_path: fromPath },
165
+ },
166
+ body,
167
+ });
168
+ if (error) {
169
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
170
+ ? String(error.message)
171
+ : JSON.stringify(error);
172
+ throw new Error(`Failed to update redirect: ${errorMessage}`);
173
+ }
174
+ logger.debug({ fromPath }, '[MRT] Redirect updated');
175
+ return data;
176
+ }
177
+ /**
178
+ * Deletes a redirect from an MRT environment.
179
+ *
180
+ * @param options - Delete redirect options
181
+ * @param auth - Authentication strategy (ApiKeyStrategy)
182
+ * @throws Error if request fails
183
+ */
184
+ export async function deleteRedirect(options, auth) {
185
+ const logger = getLogger();
186
+ const { projectSlug, targetSlug, fromPath, origin } = options;
187
+ logger.debug({ projectSlug, targetSlug, fromPath }, '[MRT] Deleting redirect');
188
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
189
+ const { error } = await client.DELETE('/api/projects/{project_slug}/target/{target_slug}/redirect/{from_path}', {
190
+ params: {
191
+ path: { project_slug: projectSlug, target_slug: targetSlug, from_path: fromPath },
192
+ },
193
+ });
194
+ if (error) {
195
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
196
+ ? String(error.message)
197
+ : JSON.stringify(error);
198
+ throw new Error(`Failed to delete redirect: ${errorMessage}`);
199
+ }
200
+ logger.debug({ fromPath }, '[MRT] Redirect deleted');
201
+ }
202
+ /**
203
+ * Clones redirects from one target to another.
204
+ *
205
+ * Important: When you clone redirects, you're replacing all redirects
206
+ * in the destination target with all redirects from the source target.
207
+ *
208
+ * @param options - Clone redirects options
209
+ * @param auth - Authentication strategy (ApiKeyStrategy)
210
+ * @returns Result with cloned redirects
211
+ * @throws Error if request fails
212
+ *
213
+ * @example
214
+ * ```typescript
215
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
216
+ * import { cloneRedirects } from '@salesforce/b2c-tooling-sdk/operations/mrt';
217
+ *
218
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
219
+ *
220
+ * const result = await cloneRedirects({
221
+ * projectSlug: 'my-storefront',
222
+ * fromTargetSlug: 'staging',
223
+ * toTargetSlug: 'production'
224
+ * }, auth);
225
+ *
226
+ * console.log(`Cloned ${result.count} redirects`);
227
+ * ```
228
+ */
229
+ export async function cloneRedirects(options, auth) {
230
+ const logger = getLogger();
231
+ const { projectSlug, fromTargetSlug, toTargetSlug, origin } = options;
232
+ logger.debug({ projectSlug, fromTargetSlug, toTargetSlug }, '[MRT] Cloning redirects');
233
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
234
+ const { data, error } = await client.POST('/api/projects/{project_slug}/target/{to_target_slug}/redirect/clone/', {
235
+ params: {
236
+ path: { project_slug: projectSlug, to_target_slug: toTargetSlug },
237
+ },
238
+ body: {
239
+ from_target_slug: fromTargetSlug,
240
+ },
241
+ });
242
+ if (error) {
243
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
244
+ ? String(error.message)
245
+ : JSON.stringify(error);
246
+ throw new Error(`Failed to clone redirects: ${errorMessage}`);
247
+ }
248
+ // The clone API may return a paginated response or just confirmation
249
+ const responseData = data;
250
+ logger.debug({ count: responseData.count }, '[MRT] Redirects cloned');
251
+ return {
252
+ count: responseData.count ?? 0,
253
+ redirects: responseData.results ?? [],
254
+ };
255
+ }
256
+ //# sourceMappingURL=redirect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/operations/mrt/redirect.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAmFlD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA6B,EAAE,IAAkB;IACnF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAC,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAC,GAAG,OAAO,CAAC;IAEnF,MAAM,CAAC,KAAK,CAAC,EAAC,WAAW,EAAE,UAAU,EAAC,EAAE,yBAAyB,CAAC,CAAC;IAEnE,MAAM,MAAM,GAAG,eAAe,CAAC,EAAC,MAAM,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
6
+ * @module operations/mrt/user
7
+ */
8
+ import type { AuthStrategy } from '../../auth/types.js';
9
+ import type { components } from '../../clients/mrt.js';
10
+ /**
11
+ * User profile type from API.
12
+ */
13
+ export type MrtUserProfile = components['schemas']['APIUserProfile'];
14
+ /**
15
+ * User email preferences type from API.
16
+ */
17
+ export type MrtEmailPreferences = components['schemas']['UserEmailPreferences'];
18
+ /**
19
+ * Patched email preferences type from API.
20
+ */
21
+ export type PatchedMrtEmailPreferences = components['schemas']['PatchedUserEmailPreferences'];
22
+ /**
23
+ * Base options for user operations.
24
+ */
25
+ export interface UserOperationOptions {
26
+ /**
27
+ * MRT API origin URL.
28
+ * @default "https://cloud.mobify.com"
29
+ */
30
+ origin?: string;
31
+ }
32
+ /**
33
+ * Result of API key generation/reset.
34
+ */
35
+ export interface ApiKeyResult {
36
+ /**
37
+ * The generated or reset API key.
38
+ */
39
+ api_key: string;
40
+ }
41
+ /**
42
+ * Options for updating email preferences.
43
+ */
44
+ export interface UpdateEmailPreferencesOptions extends UserOperationOptions {
45
+ /**
46
+ * Whether to receive Node.js deprecation notifications.
47
+ */
48
+ nodeDeprecationNotifications?: boolean;
49
+ }
50
+ /**
51
+ * Gets the profile information for the authenticated user.
52
+ *
53
+ * @param options - Operation options
54
+ * @param auth - Authentication strategy (ApiKeyStrategy)
55
+ * @returns User profile
56
+ * @throws Error if request fails
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
61
+ * import { getProfile } from '@salesforce/b2c-tooling-sdk/operations/mrt';
62
+ *
63
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
64
+ *
65
+ * const profile = await getProfile({}, auth);
66
+ * console.log(`User: ${profile.first_name} ${profile.last_name}`);
67
+ * ```
68
+ */
69
+ export declare function getProfile(options: UserOperationOptions, auth: AuthStrategy): Promise<MrtUserProfile>;
70
+ /**
71
+ * Generates or resets the API key for the authenticated user.
72
+ *
73
+ * Warning: This will invalidate your current API key.
74
+ *
75
+ * @param options - Operation options
76
+ * @param auth - Authentication strategy (ApiKeyStrategy)
77
+ * @returns The new API key
78
+ * @throws Error if request fails
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
83
+ * import { resetApiKey } from '@salesforce/b2c-tooling-sdk/operations/mrt';
84
+ *
85
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
86
+ *
87
+ * const result = await resetApiKey({}, auth);
88
+ * console.log(`New API key: ${result.api_key}`);
89
+ * // Important: Update your stored API key!
90
+ * ```
91
+ */
92
+ export declare function resetApiKey(options: UserOperationOptions, auth: AuthStrategy): Promise<ApiKeyResult>;
93
+ /**
94
+ * Gets email notification preferences for the authenticated user.
95
+ *
96
+ * @param options - Operation options
97
+ * @param auth - Authentication strategy (ApiKeyStrategy)
98
+ * @returns Email preferences
99
+ * @throws Error if request fails
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
104
+ * import { getEmailPreferences } from '@salesforce/b2c-tooling-sdk/operations/mrt';
105
+ *
106
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
107
+ *
108
+ * const prefs = await getEmailPreferences({}, auth);
109
+ * console.log(`Node deprecation notifications: ${prefs.node_deprecation_notifications}`);
110
+ * ```
111
+ */
112
+ export declare function getEmailPreferences(options: UserOperationOptions, auth: AuthStrategy): Promise<MrtEmailPreferences>;
113
+ /**
114
+ * Updates email notification preferences for the authenticated user.
115
+ *
116
+ * @param options - Update options
117
+ * @param auth - Authentication strategy (ApiKeyStrategy)
118
+ * @returns Updated email preferences
119
+ * @throws Error if request fails
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
124
+ * import { updateEmailPreferences } from '@salesforce/b2c-tooling-sdk/operations/mrt';
125
+ *
126
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
127
+ *
128
+ * const prefs = await updateEmailPreferences({
129
+ * nodeDeprecationNotifications: false
130
+ * }, auth);
131
+ *
132
+ * console.log(`Updated: ${prefs.node_deprecation_notifications}`);
133
+ * ```
134
+ */
135
+ export declare function updateEmailPreferences(options: UpdateEmailPreferencesOptions, auth: AuthStrategy): Promise<MrtEmailPreferences>;
@@ -0,0 +1,153 @@
1
+ import { createMrtClient, DEFAULT_MRT_ORIGIN } from '../../clients/mrt.js';
2
+ import { getLogger } from '../../logging/logger.js';
3
+ /**
4
+ * Gets the profile information for the authenticated user.
5
+ *
6
+ * @param options - Operation options
7
+ * @param auth - Authentication strategy (ApiKeyStrategy)
8
+ * @returns User profile
9
+ * @throws Error if request fails
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
14
+ * import { getProfile } from '@salesforce/b2c-tooling-sdk/operations/mrt';
15
+ *
16
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
17
+ *
18
+ * const profile = await getProfile({}, auth);
19
+ * console.log(`User: ${profile.first_name} ${profile.last_name}`);
20
+ * ```
21
+ */
22
+ export async function getProfile(options, auth) {
23
+ const logger = getLogger();
24
+ const { origin } = options;
25
+ logger.debug('[MRT] Getting user profile');
26
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
27
+ const { data, error } = await client.GET('/api/users/me/profile/');
28
+ if (error) {
29
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
30
+ ? String(error.message)
31
+ : JSON.stringify(error);
32
+ throw new Error(`Failed to get user profile: ${errorMessage}`);
33
+ }
34
+ logger.debug({ email: data.email }, '[MRT] User profile retrieved');
35
+ return data;
36
+ }
37
+ /**
38
+ * Generates or resets the API key for the authenticated user.
39
+ *
40
+ * Warning: This will invalidate your current API key.
41
+ *
42
+ * @param options - Operation options
43
+ * @param auth - Authentication strategy (ApiKeyStrategy)
44
+ * @returns The new API key
45
+ * @throws Error if request fails
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
50
+ * import { resetApiKey } from '@salesforce/b2c-tooling-sdk/operations/mrt';
51
+ *
52
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
53
+ *
54
+ * const result = await resetApiKey({}, auth);
55
+ * console.log(`New API key: ${result.api_key}`);
56
+ * // Important: Update your stored API key!
57
+ * ```
58
+ */
59
+ export async function resetApiKey(options, auth) {
60
+ const logger = getLogger();
61
+ const { origin } = options;
62
+ logger.debug('[MRT] Resetting API key');
63
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
64
+ const { data, error } = await client.POST('/api/users/me/api_key/');
65
+ if (error) {
66
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
67
+ ? String(error.message)
68
+ : JSON.stringify(error);
69
+ throw new Error(`Failed to reset API key: ${errorMessage}`);
70
+ }
71
+ logger.debug('[MRT] API key reset successfully');
72
+ // Response schema is loose in spec, cast to expected shape
73
+ const response = data;
74
+ return response;
75
+ }
76
+ /**
77
+ * Gets email notification preferences for the authenticated user.
78
+ *
79
+ * @param options - Operation options
80
+ * @param auth - Authentication strategy (ApiKeyStrategy)
81
+ * @returns Email preferences
82
+ * @throws Error if request fails
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
87
+ * import { getEmailPreferences } from '@salesforce/b2c-tooling-sdk/operations/mrt';
88
+ *
89
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
90
+ *
91
+ * const prefs = await getEmailPreferences({}, auth);
92
+ * console.log(`Node deprecation notifications: ${prefs.node_deprecation_notifications}`);
93
+ * ```
94
+ */
95
+ export async function getEmailPreferences(options, auth) {
96
+ const logger = getLogger();
97
+ const { origin } = options;
98
+ logger.debug('[MRT] Getting email preferences');
99
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
100
+ const { data, error } = await client.GET('/api/users/me/email-preferences/');
101
+ if (error) {
102
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
103
+ ? String(error.message)
104
+ : JSON.stringify(error);
105
+ throw new Error(`Failed to get email preferences: ${errorMessage}`);
106
+ }
107
+ logger.debug('[MRT] Email preferences retrieved');
108
+ return data;
109
+ }
110
+ /**
111
+ * Updates email notification preferences for the authenticated user.
112
+ *
113
+ * @param options - Update options
114
+ * @param auth - Authentication strategy (ApiKeyStrategy)
115
+ * @returns Updated email preferences
116
+ * @throws Error if request fails
117
+ *
118
+ * @example
119
+ * ```typescript
120
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
121
+ * import { updateEmailPreferences } from '@salesforce/b2c-tooling-sdk/operations/mrt';
122
+ *
123
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
124
+ *
125
+ * const prefs = await updateEmailPreferences({
126
+ * nodeDeprecationNotifications: false
127
+ * }, auth);
128
+ *
129
+ * console.log(`Updated: ${prefs.node_deprecation_notifications}`);
130
+ * ```
131
+ */
132
+ export async function updateEmailPreferences(options, auth) {
133
+ const logger = getLogger();
134
+ const { origin, nodeDeprecationNotifications } = options;
135
+ logger.debug({ nodeDeprecationNotifications }, '[MRT] Updating email preferences');
136
+ const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
137
+ const body = {};
138
+ if (nodeDeprecationNotifications !== undefined) {
139
+ body.node_deprecation_notifications = nodeDeprecationNotifications;
140
+ }
141
+ const { data, error } = await client.PATCH('/api/users/me/email-preferences/', {
142
+ body,
143
+ });
144
+ if (error) {
145
+ const errorMessage = typeof error === 'object' && error !== null && 'message' in error
146
+ ? String(error.message)
147
+ : JSON.stringify(error);
148
+ throw new Error(`Failed to update email preferences: ${errorMessage}`);
149
+ }
150
+ logger.debug('[MRT] Email preferences updated');
151
+ return data;
152
+ }
153
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../src/operations/mrt/user.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAgDlD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA6B,EAAE,IAAkB;IAChF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAC,MAAM,EAAC,GAAG,OAAO,CAAC;IAEzB,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAE3C,MAAM,MAAM,GAAG,eAAe,CAAC,EAAC,MAAM,EAAE,MAAM,IAAI,kBAAkB,EAAC,EAAE,IAAI,CAAC,CAAC;IAE7E,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEjE,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,YAAY,GAChB,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,IAAI,KAAK;YAC/D,CAAC,CAAC,MAAM,CAAE,KAA4B,CAAC,OAAO,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,+BAA+B,YAAY,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,EAAE,8BAA8B,CAAC,CAAC;IAElE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC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AAI,IAAI,SAAS,IAAI,KAAK;YAC/D,CAAC,CAAC,MAAM,CAAE,KAA4B,CAAC,OAAO,CAAC;YAC/C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,uCAAuC,YAAY,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAEhD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -41,6 +41,7 @@ export declare abstract class InstanceCommand<T extends typeof Command> extends
41
41
  'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
42
42
  scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
43
43
  'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
44
+ 'tenant-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
44
45
  'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
45
46
  'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
46
47
  'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -21,7 +21,8 @@ import type { MrtProject } from '../platform/mrt.js';
21
21
  * Cloud origin resolution:
22
22
  * 1. --cloud-origin flag
23
23
  * 2. SFCC_MRT_CLOUD_ORIGIN environment variable
24
- * 3. Default: https://cloud.mobify.com
24
+ * 3. dw.json (mrtOrigin field)
25
+ * 4. Default: https://cloud.mobify.com
25
26
  */
26
27
  export declare abstract class MrtCommand<T extends typeof Command> extends BaseCommand<T> {
27
28
  static baseFlags: {
@@ -26,7 +26,8 @@ import { DEFAULT_MRT_ORIGIN } from '../clients/mrt.js';
26
26
  * Cloud origin resolution:
27
27
  * 1. --cloud-origin flag
28
28
  * 2. SFCC_MRT_CLOUD_ORIGIN environment variable
29
- * 3. Default: https://cloud.mobify.com
29
+ * 3. dw.json (mrtOrigin field)
30
+ * 4. Default: https://cloud.mobify.com
30
31
  */
31
32
  export class MrtCommand extends BaseCommand {
32
33
  static baseFlags = {
@@ -47,7 +48,7 @@ export class MrtCommand extends BaseCommand {
47
48
  env: 'SFCC_MRT_ENVIRONMENT',
48
49
  }),
49
50
  'cloud-origin': Flags.string({
50
- description: `MRT cloud origin URL (default: ${DEFAULT_MRT_ORIGIN})`,
51
+ description: `MRT cloud origin URL (or set mrtOrigin in dw.json; default: ${DEFAULT_MRT_ORIGIN})`,
51
52
  env: 'SFCC_MRT_CLOUD_ORIGIN',
52
53
  }),
53
54
  'credentials-file': Flags.string({
@@ -1 +1 @@
1
- {"version":3,"file":"mrt-command.js","sourceRoot":"","sources":["../../../src/cli/mrt-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,OAAO,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAC,CAAC,EAAC,MAAM,kBAAkB,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAgB,UAAqC,SAAQ,WAAc;IAC/E,MAAM,CAAC,SAAS,GAAG;QACjB,GAAG,WAAW,CAAC,SAAS;QACxB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,aAAa;YAC1B,GAAG,EAAE,kBAAkB;YACvB,SAAS,EAAE,MAAM;SAClB,CAAC;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AE,IAAI,CAAC,KAAK,CAAC,WAAiC;YAC5D,wBAAwB;YACxB,SAAS,EAAE,WAAW;SACvB,CAAC;QAEF,MAAM,aAAa,GAAkB;YACnC,MAAM,EAAE,IAAI,CAAC,mBAAmB;YAChC,KAAK,EAAE,IAAI,CAAC,kBAAkB;SAC/B,CAAC;QAEF,OAAO,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACO,UAAU;QAClB,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QAC7C,CAAC;QAED,MAAM,IAAI,KAAK,CACb,CAAC,CACC,yBAAyB,EACzB,uFAAuF,CACxF,CACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IAC5C,CAAC;IAED;;OAEG;IACO,qBAAqB;QAC7B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CACR,CAAC,CACC,yBAAyB,EACzB,uFAAuF,CACxF,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACO,eAAe,CAAC,OAAmB;QAC3C,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE7B,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACnD,CAAC"}
@@ -20,6 +20,7 @@ export declare abstract class OAuthCommand<T extends typeof Command> extends Bas
20
20
  'client-secret': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
21
  scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
22
  'short-code': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ 'tenant-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
24
  'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
25
  'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
26
  'log-level': import("@oclif/core/interfaces").OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -46,6 +46,11 @@ export class OAuthCommand extends BaseCommand {
46
46
  env: 'SFCC_SHORTCODE',
47
47
  helpGroup: 'AUTH',
48
48
  }),
49
+ 'tenant-id': Flags.string({
50
+ description: 'Organization/tenant ID',
51
+ env: 'SFCC_TENANT_ID',
52
+ helpGroup: 'AUTH',
53
+ }),
49
54
  'auth-methods': Flags.string({
50
55
  description: 'Allowed auth methods in priority order (comma-separated)',
51
56
  env: 'SFCC_AUTH_METHODS',
@@ -85,6 +90,7 @@ export class OAuthCommand extends BaseCommand {
85
90
  clientId: this.flags['client-id'],
86
91
  clientSecret: this.flags['client-secret'],
87
92
  shortCode: this.flags['short-code'],
93
+ tenantId: this.flags['tenant-id'],
88
94
  authMethods: this.parseAuthMethods(),
89
95
  accountManagerHost: this.flags['account-manager-host'],
90
96
  // Merge scopes from flags (if provided)