@salesforce/b2c-tooling-sdk 1.11.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +1 -4
  2. package/dist/esm/auth/api-key.d.ts +6 -0
  3. package/dist/esm/auth/api-key.js +9 -2
  4. package/dist/esm/auth/api-key.js.map +1 -1
  5. package/dist/esm/auth/basic.d.ts +20 -0
  6. package/dist/esm/auth/basic.js +23 -3
  7. package/dist/esm/auth/basic.js.map +1 -1
  8. package/dist/esm/auth/dispatch-fetch.d.ts +28 -0
  9. package/dist/esm/auth/dispatch-fetch.js +37 -0
  10. package/dist/esm/auth/dispatch-fetch.js.map +1 -0
  11. package/dist/esm/auth/oauth-implicit.d.ts +5 -0
  12. package/dist/esm/auth/oauth-implicit.js +9 -3
  13. package/dist/esm/auth/oauth-implicit.js.map +1 -1
  14. package/dist/esm/auth/oauth-jwt.d.ts +11 -0
  15. package/dist/esm/auth/oauth-jwt.js +15 -3
  16. package/dist/esm/auth/oauth-jwt.js.map +1 -1
  17. package/dist/esm/auth/oauth.d.ts +38 -0
  18. package/dist/esm/auth/oauth.js +42 -4
  19. package/dist/esm/auth/oauth.js.map +1 -1
  20. package/dist/esm/auth/resolve.d.ts +7 -1
  21. package/dist/esm/auth/resolve.js.map +1 -1
  22. package/dist/esm/auth/stateful-oauth-strategy.d.ts +8 -0
  23. package/dist/esm/auth/stateful-oauth-strategy.js +8 -0
  24. package/dist/esm/auth/stateful-oauth-strategy.js.map +1 -1
  25. package/dist/esm/cli/base-command.d.ts +2 -0
  26. package/dist/esm/cli/base-command.js +2 -0
  27. package/dist/esm/cli/base-command.js.map +1 -1
  28. package/dist/esm/cli/index.d.ts +1 -1
  29. package/dist/esm/cli/index.js.map +1 -1
  30. package/dist/esm/cli/job-command.d.ts +1 -1
  31. package/dist/esm/cli/job-command.js +1 -1
  32. package/dist/esm/cli/mrt-command.d.ts +1 -0
  33. package/dist/esm/cli/mrt-command.js +3 -0
  34. package/dist/esm/cli/mrt-command.js.map +1 -1
  35. package/dist/esm/cli/oauth-command.d.ts +1 -0
  36. package/dist/esm/cli/oauth-command.js +1 -0
  37. package/dist/esm/cli/oauth-command.js.map +1 -1
  38. package/dist/esm/clients/am-api.d.ts +19 -1
  39. package/dist/esm/clients/am-api.js +19 -1
  40. package/dist/esm/clients/am-api.js.map +1 -1
  41. package/dist/esm/clients/cip.js +9 -0
  42. package/dist/esm/clients/cip.js.map +1 -1
  43. package/dist/esm/clients/granular-replications.d.ts +17 -0
  44. package/dist/esm/clients/granular-replications.js +9 -0
  45. package/dist/esm/clients/granular-replications.js.map +1 -1
  46. package/dist/esm/config/dw-json.d.ts +2 -2
  47. package/dist/esm/config/dw-json.js +2 -2
  48. package/dist/esm/config/mapping.d.ts +20 -0
  49. package/dist/esm/config/mapping.js +15 -15
  50. package/dist/esm/config/mapping.js.map +1 -1
  51. package/dist/esm/config/sources/dw-json-source.d.ts +10 -0
  52. package/dist/esm/config/sources/dw-json-source.js +10 -0
  53. package/dist/esm/config/sources/dw-json-source.js.map +1 -1
  54. package/dist/esm/config/types.d.ts +27 -26
  55. package/dist/esm/discovery/detector.d.ts +1 -1
  56. package/dist/esm/discovery/detector.js +1 -1
  57. package/dist/esm/discovery/patterns/sfra.d.ts +1 -1
  58. package/dist/esm/discovery/patterns/sfra.js +1 -1
  59. package/dist/esm/docs/schema.d.ts +25 -0
  60. package/dist/esm/docs/schema.js +25 -0
  61. package/dist/esm/docs/schema.js.map +1 -1
  62. package/dist/esm/i18n/index.d.ts +16 -0
  63. package/dist/esm/i18n/index.js +5 -0
  64. package/dist/esm/i18n/index.js.map +1 -1
  65. package/dist/esm/instance/index.d.ts +6 -2
  66. package/dist/esm/instance/index.js +5 -1
  67. package/dist/esm/instance/index.js.map +1 -1
  68. package/dist/esm/logging/logger.d.ts +59 -0
  69. package/dist/esm/logging/logger.js +59 -0
  70. package/dist/esm/logging/logger.js.map +1 -1
  71. package/dist/esm/logging/types.d.ts +32 -0
  72. package/dist/esm/operations/cap/install.d.ts +14 -0
  73. package/dist/esm/operations/cap/install.js +14 -0
  74. package/dist/esm/operations/cap/install.js.map +1 -1
  75. package/dist/esm/operations/cap/pull.d.ts +49 -0
  76. package/dist/esm/operations/cap/pull.js +24 -0
  77. package/dist/esm/operations/cap/pull.js.map +1 -1
  78. package/dist/esm/operations/cap/validate.js +0 -8
  79. package/dist/esm/operations/cap/validate.js.map +1 -1
  80. package/dist/esm/operations/cip/index.d.ts +24 -0
  81. package/dist/esm/operations/cip/index.js +24 -0
  82. package/dist/esm/operations/cip/index.js.map +1 -1
  83. package/dist/esm/operations/code/download.d.ts +1 -0
  84. package/dist/esm/operations/code/download.js +1 -0
  85. package/dist/esm/operations/code/download.js.map +1 -1
  86. package/dist/esm/operations/code/upload-files.d.ts +1 -0
  87. package/dist/esm/operations/code/upload-files.js +1 -0
  88. package/dist/esm/operations/code/upload-files.js.map +1 -1
  89. package/dist/esm/operations/code/versions.d.ts +3 -0
  90. package/dist/esm/operations/code/versions.js +3 -0
  91. package/dist/esm/operations/code/versions.js.map +1 -1
  92. package/dist/esm/operations/content/validate.d.ts +12 -0
  93. package/dist/esm/operations/content/validate.js +12 -0
  94. package/dist/esm/operations/content/validate.js.map +1 -1
  95. package/dist/esm/operations/debug/sdapi-client.d.ts +25 -0
  96. package/dist/esm/operations/debug/sdapi-client.js +25 -0
  97. package/dist/esm/operations/debug/sdapi-client.js.map +1 -1
  98. package/dist/esm/operations/jobs/index.d.ts +3 -2
  99. package/dist/esm/operations/jobs/index.js +2 -1
  100. package/dist/esm/operations/jobs/index.js.map +1 -1
  101. package/dist/esm/operations/jobs/run.d.ts +9 -0
  102. package/dist/esm/operations/jobs/run.js +9 -0
  103. package/dist/esm/operations/jobs/run.js.map +1 -1
  104. package/dist/esm/operations/jobs/site-archive.d.ts +100 -0
  105. package/dist/esm/operations/jobs/site-archive.js +305 -1
  106. package/dist/esm/operations/jobs/site-archive.js.map +1 -1
  107. package/dist/esm/operations/logs/filter.d.ts +40 -0
  108. package/dist/esm/operations/logs/filter.js +107 -0
  109. package/dist/esm/operations/logs/filter.js.map +1 -0
  110. package/dist/esm/operations/logs/index.d.ts +1 -0
  111. package/dist/esm/operations/logs/index.js +2 -0
  112. package/dist/esm/operations/logs/index.js.map +1 -1
  113. package/dist/esm/operations/logs/tail.d.ts +5 -1
  114. package/dist/esm/operations/logs/tail.js +5 -1
  115. package/dist/esm/operations/logs/tail.js.map +1 -1
  116. package/dist/esm/operations/mrt/bundle.d.ts +15 -25
  117. package/dist/esm/operations/mrt/bundle.js +27 -4
  118. package/dist/esm/operations/mrt/bundle.js.map +1 -1
  119. package/dist/esm/operations/mrt/certificate.d.ts +88 -0
  120. package/dist/esm/operations/mrt/certificate.js +88 -0
  121. package/dist/esm/operations/mrt/certificate.js.map +1 -1
  122. package/dist/esm/operations/mrt/index.d.ts +2 -2
  123. package/dist/esm/operations/mrt/index.js +1 -1
  124. package/dist/esm/operations/mrt/index.js.map +1 -1
  125. package/dist/esm/operations/mrt/organization-member.d.ts +89 -0
  126. package/dist/esm/operations/mrt/organization-member.js +89 -0
  127. package/dist/esm/operations/mrt/organization-member.js.map +1 -1
  128. package/dist/esm/operations/ods/wait-for-clone.d.ts +50 -2
  129. package/dist/esm/operations/ods/wait-for-clone.js +37 -2
  130. package/dist/esm/operations/ods/wait-for-clone.js.map +1 -1
  131. package/dist/esm/operations/ods/wait-for-sandbox.d.ts +50 -0
  132. package/dist/esm/operations/ods/wait-for-sandbox.js +21 -0
  133. package/dist/esm/operations/ods/wait-for-sandbox.js.map +1 -1
  134. package/dist/esm/operations/orgs/index.d.ts +12 -5
  135. package/dist/esm/operations/orgs/index.js +5 -5
  136. package/dist/esm/operations/orgs/index.js.map +1 -1
  137. package/dist/esm/plugins/discovery.d.ts +6 -0
  138. package/dist/esm/plugins/discovery.js.map +1 -1
  139. package/dist/esm/scaffold/engine.d.ts +11 -3
  140. package/dist/esm/scaffold/engine.js +11 -3
  141. package/dist/esm/scaffold/engine.js.map +1 -1
  142. package/dist/esm/scaffold/registry.d.ts +8 -2
  143. package/dist/esm/scaffold/registry.js +8 -2
  144. package/dist/esm/scaffold/registry.js.map +1 -1
  145. package/dist/esm/scaffold/sources.d.ts +2 -1
  146. package/dist/esm/scaffold/sources.js +2 -1
  147. package/dist/esm/scaffold/sources.js.map +1 -1
  148. package/dist/esm/scaffold/types.d.ts +2 -2
  149. package/dist/esm/schemas/index.d.ts +4 -0
  150. package/dist/esm/schemas/index.js +4 -0
  151. package/dist/esm/schemas/index.js.map +1 -1
  152. package/dist/esm/skills/github.d.ts +9 -0
  153. package/dist/esm/skills/github.js +9 -0
  154. package/dist/esm/skills/github.js.map +1 -1
  155. package/dist/esm/skills/sources.d.ts +18 -0
  156. package/dist/esm/skills/sources.js +26 -0
  157. package/dist/esm/skills/sources.js.map +1 -1
  158. package/dist/esm/skills/types.d.ts +1 -1
  159. package/package.json +3 -3
@@ -39,8 +39,8 @@
39
39
  *
40
40
  * @module operations/mrt
41
41
  */
42
- export { createBundle, createGlobFilter, getDefaultMessage, DEFAULT_SSR_PARAMETERS } from './bundle.js';
43
- export type { CreateBundleOptions, Bundle } from './bundle.js';
42
+ export { createBundle, createGlobFilter, getDefaultMessage, DEFAULT_SSR_PARAMETERS, DEFAULT_SSR_ONLY, DEFAULT_SSR_SHARED, } from './bundle.js';
43
+ export type { CreateBundleOptions, Bundle, MrtServerConfig } from './bundle.js';
44
44
  export { pushBundle, uploadBundle, listBundles, downloadBundle, deleteBundle, bulkDeleteBundles } from './push.js';
45
45
  export type { PushOptions, PushResult, ListBundlesOptions, ListBundlesResult, DownloadBundleOptions, DownloadBundleResult, DeleteBundleOptions, BulkDeleteBundlesOptions, BulkDeleteBundlesResult, BulkDeleteRejectedBundle, MrtBundle, } from './push.js';
46
46
  export { listEnvVars, setEnvVar, setEnvVars, deleteEnvVar } from './env-var.js';
@@ -45,7 +45,7 @@
45
45
  * @module operations/mrt
46
46
  */
47
47
  // Bundle creation
48
- export { createBundle, createGlobFilter, getDefaultMessage, DEFAULT_SSR_PARAMETERS } from './bundle.js';
48
+ export { createBundle, createGlobFilter, getDefaultMessage, DEFAULT_SSR_PARAMETERS, DEFAULT_SSR_ONLY, DEFAULT_SSR_SHARED, } from './bundle.js';
49
49
  // Push and bundle operations
50
50
  export { pushBundle, uploadBundle, listBundles, downloadBundle, deleteBundle, bulkDeleteBundles } from './push.js';
51
51
  // Environment variable operations
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/operations/mrt/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,kBAAkB;AAClB,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAC;AAGtG,6BAA6B;AAC7B,OAAO,EAAC,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAejH,kCAAkC;AAClC,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAU9E,kCAAkC;AAClC,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAiBjG,wBAAwB;AACxB,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAUlE,0BAA0B;AAC1B,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAQpD,6FAA6F;AAC7F,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAY1B,iCAAiC;AACjC,OAAO,E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a3B,sBAAsB;AACtB,OAAO,EACL,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAC;AAevB,mCAAmC;AACnC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAU7B,mBAAmB;AACnB,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAG3C,kBAAkB;AAClB,OAAO,EAAC,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,sBAAsB,EAAC,MAAM,WAAW,CAAC;AAU/F,iCAAiC;AACjC,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAWvG,yBAAyB;AACzB,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAE,mBAAmB,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC"}
@@ -36,6 +36,26 @@ export interface ListOrgMembersResult {
36
36
  previous: string | null;
37
37
  members: MrtOrgMember[];
38
38
  }
39
+ /**
40
+ * Lists members of an MRT organization.
41
+ *
42
+ * @param options - List options including organization slug and optional pagination/filtering parameters
43
+ * @param auth - Authentication strategy (ApiKeyStrategy or other AuthStrategy implementation)
44
+ * @returns Promise resolving to paginated list of organization members with count, next, previous, and members array
45
+ * @throws Error if the request fails
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
50
+ * import { listOrgMembers } from '@salesforce/b2c-tooling-sdk/operations/mrt';
51
+ *
52
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
53
+ *
54
+ * const result = await listOrgMembers({
55
+ * organizationSlug: 'my-org'
56
+ * }, auth);
57
+ * ```
58
+ */
39
59
  export declare function listOrgMembers(options: ListOrgMembersOptions, auth: AuthStrategy): Promise<ListOrgMembersResult>;
40
60
  export interface AddOrgMemberOptions {
41
61
  organizationSlug: string;
@@ -45,12 +65,63 @@ export interface AddOrgMemberOptions {
45
65
  customDomainCertPermission?: OrgCertPermission;
46
66
  origin?: string;
47
67
  }
68
+ /**
69
+ * Adds a member to an MRT organization.
70
+ *
71
+ * @param options - Add member options
72
+ * @param options.organizationSlug - Organization slug identifier
73
+ * @param options.email - Email of the member to add
74
+ * @param options.role - Role value (0 = Owner, 1 = Member)
75
+ * @param options.canViewAllProjects - Optional: grant permission to view all projects
76
+ * @param options.customDomainCertPermission - Optional: custom domain certificate permission (1 = Disabled, 2 = Enabled)
77
+ * @param options.origin - Optional: MRT API origin endpoint
78
+ * @param auth - Authentication strategy (e.g., ApiKeyStrategy)
79
+ * @returns The created organization member
80
+ * @throws Error if the request fails
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
85
+ * import { addOrgMember } from '@salesforce/b2c-tooling-sdk/operations/mrt';
86
+ *
87
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
88
+ *
89
+ * const member = await addOrgMember({
90
+ * organizationSlug: 'my-org',
91
+ * email: 'user@example.com',
92
+ * role: 1 // Member
93
+ * }, auth);
94
+ * ```
95
+ */
48
96
  export declare function addOrgMember(options: AddOrgMemberOptions, auth: AuthStrategy): Promise<MrtOrgMember>;
49
97
  export interface GetOrgMemberOptions {
50
98
  organizationSlug: string;
51
99
  email: string;
52
100
  origin?: string;
53
101
  }
102
+ /**
103
+ * Gets an organization member by email.
104
+ *
105
+ * @param options - Get options including organization slug and email
106
+ * @param auth - Authentication strategy (ApiKeyStrategy)
107
+ * @returns The organization member details
108
+ * @throws Error if the request fails or member is not found
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
113
+ * import { getOrgMember } from '@salesforce/b2c-tooling-sdk/operations/mrt';
114
+ *
115
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
116
+ *
117
+ * const member = await getOrgMember({
118
+ * organizationSlug: 'my-org',
119
+ * email: 'user@example.com'
120
+ * }, auth);
121
+ *
122
+ * console.log(`Member role: ${member.role}`);
123
+ * ```
124
+ */
54
125
  export declare function getOrgMember(options: GetOrgMemberOptions, auth: AuthStrategy): Promise<MrtOrgMember>;
55
126
  export interface UpdateOrgMemberOptions {
56
127
  organizationSlug: string;
@@ -59,10 +130,28 @@ export interface UpdateOrgMemberOptions {
59
130
  customDomainCertPermission?: OrgCertPermission;
60
131
  origin?: string;
61
132
  }
133
+ /**
134
+ * Updates an organization member's permissions and settings.
135
+ *
136
+ * @param options - Update options with organizationSlug, email, and optional canViewAllProjects and customDomainCertPermission
137
+ * @param auth - Authentication strategy (required for API authorization)
138
+ * @returns Promise resolving to the updated organization member with full member details
139
+ * @throws Error if the API request fails
140
+ */
62
141
  export declare function updateOrgMember(options: UpdateOrgMemberOptions, auth: AuthStrategy): Promise<MrtOrgMember>;
63
142
  export interface RemoveOrgMemberOptions {
64
143
  organizationSlug: string;
65
144
  email: string;
66
145
  origin?: string;
67
146
  }
147
+ /**
148
+ * Removes a member from an MRT organization.
149
+ *
150
+ * @param options - Remove options
151
+ * @param options.organizationSlug - Slug of the organization
152
+ * @param options.email - Email address of the member to remove
153
+ * @param options.origin - Optional MRT API origin (defaults to DEFAULT_MRT_ORIGIN)
154
+ * @param auth - Authentication strategy
155
+ * @throws {Error} If the API request fails
156
+ */
68
157
  export declare function removeOrgMember(options: RemoveOrgMemberOptions, auth: AuthStrategy): Promise<void>;
@@ -10,6 +10,26 @@ function describeError(error, action) {
10
10
  : JSON.stringify(error);
11
11
  return new Error(`Failed to ${action}: ${message}`);
12
12
  }
13
+ /**
14
+ * Lists members of an MRT organization.
15
+ *
16
+ * @param options - List options including organization slug and optional pagination/filtering parameters
17
+ * @param auth - Authentication strategy (ApiKeyStrategy or other AuthStrategy implementation)
18
+ * @returns Promise resolving to paginated list of organization members with count, next, previous, and members array
19
+ * @throws Error if the request fails
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
24
+ * import { listOrgMembers } from '@salesforce/b2c-tooling-sdk/operations/mrt';
25
+ *
26
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
27
+ *
28
+ * const result = await listOrgMembers({
29
+ * organizationSlug: 'my-org'
30
+ * }, auth);
31
+ * ```
32
+ */
13
33
  export async function listOrgMembers(options, auth) {
14
34
  const logger = getLogger();
15
35
  const { organizationSlug, limit, offset, ordering, search, origin } = options;
@@ -30,6 +50,34 @@ export async function listOrgMembers(options, auth) {
30
50
  members: data.results ?? [],
31
51
  };
32
52
  }
53
+ /**
54
+ * Adds a member to an MRT organization.
55
+ *
56
+ * @param options - Add member options
57
+ * @param options.organizationSlug - Organization slug identifier
58
+ * @param options.email - Email of the member to add
59
+ * @param options.role - Role value (0 = Owner, 1 = Member)
60
+ * @param options.canViewAllProjects - Optional: grant permission to view all projects
61
+ * @param options.customDomainCertPermission - Optional: custom domain certificate permission (1 = Disabled, 2 = Enabled)
62
+ * @param options.origin - Optional: MRT API origin endpoint
63
+ * @param auth - Authentication strategy (e.g., ApiKeyStrategy)
64
+ * @returns The created organization member
65
+ * @throws Error if the request fails
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
70
+ * import { addOrgMember } from '@salesforce/b2c-tooling-sdk/operations/mrt';
71
+ *
72
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
73
+ *
74
+ * const member = await addOrgMember({
75
+ * organizationSlug: 'my-org',
76
+ * email: 'user@example.com',
77
+ * role: 1 // Member
78
+ * }, auth);
79
+ * ```
80
+ */
33
81
  export async function addOrgMember(options, auth) {
34
82
  const logger = getLogger();
35
83
  const { organizationSlug, email, role, canViewAllProjects, customDomainCertPermission, origin } = options;
@@ -49,6 +97,29 @@ export async function addOrgMember(options, auth) {
49
97
  // Re-fetch to get the full member shape (POST response omits email/first_name/last_name).
50
98
  return getOrgMember({ organizationSlug, email, origin }, auth);
51
99
  }
100
+ /**
101
+ * Gets an organization member by email.
102
+ *
103
+ * @param options - Get options including organization slug and email
104
+ * @param auth - Authentication strategy (ApiKeyStrategy)
105
+ * @returns The organization member details
106
+ * @throws Error if the request fails or member is not found
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
111
+ * import { getOrgMember } from '@salesforce/b2c-tooling-sdk/operations/mrt';
112
+ *
113
+ * const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
114
+ *
115
+ * const member = await getOrgMember({
116
+ * organizationSlug: 'my-org',
117
+ * email: 'user@example.com'
118
+ * }, auth);
119
+ *
120
+ * console.log(`Member role: ${member.role}`);
121
+ * ```
122
+ */
52
123
  export async function getOrgMember(options, auth) {
53
124
  const { organizationSlug, email, origin } = options;
54
125
  const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
@@ -59,6 +130,14 @@ export async function getOrgMember(options, auth) {
59
130
  throw describeError(error, 'get organization member');
60
131
  return data;
61
132
  }
133
+ /**
134
+ * Updates an organization member's permissions and settings.
135
+ *
136
+ * @param options - Update options with organizationSlug, email, and optional canViewAllProjects and customDomainCertPermission
137
+ * @param auth - Authentication strategy (required for API authorization)
138
+ * @returns Promise resolving to the updated organization member with full member details
139
+ * @throws Error if the API request fails
140
+ */
62
141
  export async function updateOrgMember(options, auth) {
63
142
  const { organizationSlug, email, canViewAllProjects, customDomainCertPermission, origin } = options;
64
143
  const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
@@ -76,6 +155,16 @@ export async function updateOrgMember(options, auth) {
76
155
  // Re-fetch to get the full member shape (PATCH response omits email/first_name/last_name).
77
156
  return getOrgMember({ organizationSlug, email, origin }, auth);
78
157
  }
158
+ /**
159
+ * Removes a member from an MRT organization.
160
+ *
161
+ * @param options - Remove options
162
+ * @param options.organizationSlug - Slug of the organization
163
+ * @param options.email - Email address of the member to remove
164
+ * @param options.origin - Optional MRT API origin (defaults to DEFAULT_MRT_ORIGIN)
165
+ * @param auth - Authentication strategy
166
+ * @throws {Error} If the API request fails
167
+ */
79
168
  export async function removeOrgMember(options, auth) {
80
169
  const { organizationSlug, email, origin } = options;
81
170
  const client = createMrtClient({ origin: origin || DEFAULT_MRT_ORIGIN }, auth);
@@ -1 +1 @@
1
- {"version":3,"file":"organization-member.js","sourceRoot":"","sources":["../../../../src/operations/mrt/organization-member.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEzE,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAYlD,MAAM,CAAC,MAAM,SAAS,GAAiC;IACrD,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,QAAQ;CACZ,CAAC;AAOF,SAAS,aAAa,CAAC,KAAc,EAAE,MAAc;IACnD,MAAM,OAAO,GACX,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,IAAI,KAAK;QAC/D,CAAC,CAAC,MAAM,CAAE,KAA4B,CAAC,OAAO,CAAC;QAC/C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,IAAI,KAAK,CAAC,aAAa,MAAM,KAAK,OAAO,EAAE,CAAC,CAAC;AACtD,CAAC;AAkBD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAA8B,EAC9B,IAAkB;IAElB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAC,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAC,GAAG,OAAO,CAAC;IAE5E,MAAM,CAAC,KAAK,CAAC,EAA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;QAAE,IAAI,CAAC,qBAAqB,GAAG,kBAAkB,CAAC;IACtF,IAAI,0BAA0B,KAAK,SAAS;QAAE,IAAI,CAAC,6BAA6B,GAAG,0BAA0B,CAAC;IAE9G,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,yDAAyD,EAAE;QAC5F,MAAM,EAAE,EAAC,IAAI,EAAE,EAAC,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,EAAC,EAAC;QAC5D,IAAI;KACL,CAAC,CAAC;IAEH,IAAI,KAAK;QAAE,MAAM,aAAa,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;IAEpE,2FAA2F;IAC3F,OAAO,YAAY,CAAC,EAAC,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAC,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC;AAQD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA+B,EAAE,IAAkB;IACvF,MAAM,EAAC,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAC,GAAG,OAAO,CAAC;IAClD,MAAM,MAAM,GAAG,eAAe,CAAC,EAAC,MAAM,EAAE,MAAM,IAAI,kBAAkB,EAAC,EAAE,IAAI,CAAC,CAAC;IAE7E,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,yDAAyD,EAAE;QAC7F,MAAM,EAAE,EAAC,IAAI,EAAE,EAAC,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,EAAC,EAAC;KAC7D,CAAC,CAAC;IAEH,IAAI,KAAK;QAAE,MAAM,aAAa,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;AACtE,CAAC"}
@@ -1,5 +1,21 @@
1
1
  import type { OdsClient } from '../../clients/ods.js';
2
+ /**
3
+ * Status of a sandbox clone operation in the ODS system.
4
+ *
5
+ * Standard values are `COMPLETED`, `FAILED`, `IN_PROGRESS`, and `PENDING`. Any
6
+ * other string value is also accepted for forward compatibility with future
7
+ * statuses returned by the API.
8
+ */
2
9
  export type CloneState = 'COMPLETED' | 'FAILED' | 'IN_PROGRESS' | 'PENDING' | (string & {});
10
+ /**
11
+ * Error thrown when a sandbox clone operation does not complete within the
12
+ * configured timeout while polling.
13
+ *
14
+ * @param sandboxId - ID of the source sandbox
15
+ * @param cloneId - ID of the clone operation
16
+ * @param timeoutSeconds - Timeout duration in seconds
17
+ * @param lastStatus - Last observed clone status before the timeout occurred, if any
18
+ */
3
19
  export declare class ClonePollingTimeoutError extends Error {
4
20
  readonly sandboxId: string;
5
21
  readonly cloneId: string;
@@ -7,17 +23,34 @@ export declare class ClonePollingTimeoutError extends Error {
7
23
  readonly lastStatus?: CloneState | undefined;
8
24
  constructor(sandboxId: string, cloneId: string, timeoutSeconds: number, lastStatus?: CloneState | undefined);
9
25
  }
26
+ /**
27
+ * Error thrown when an API request to fetch clone status fails.
28
+ *
29
+ * @param sandboxId - ID of the source sandbox
30
+ * @param cloneId - ID of the clone operation
31
+ * @param message - Underlying error message from the API call
32
+ */
10
33
  export declare class ClonePollingError extends Error {
11
34
  readonly sandboxId: string;
12
35
  readonly cloneId: string;
13
36
  constructor(sandboxId: string, cloneId: string, message: string);
14
37
  }
38
+ /**
39
+ * Error thrown when a sandbox clone operation enters the `FAILED` state.
40
+ *
41
+ * @param sandboxId - ID of the source sandbox
42
+ * @param cloneId - ID of the clone operation
43
+ * @param status - Clone status observed when the failure was detected
44
+ */
15
45
  export declare class CloneFailedError extends Error {
16
46
  readonly sandboxId: string;
17
47
  readonly cloneId: string;
18
48
  readonly status: CloneState;
19
49
  constructor(sandboxId: string, cloneId: string, status: CloneState);
20
50
  }
51
+ /**
52
+ * Information passed to the `onPoll` callback on each clone status poll.
53
+ */
21
54
  export interface WaitForClonePollInfo {
22
55
  sandboxId: string;
23
56
  cloneId: string;
@@ -25,6 +58,9 @@ export interface WaitForClonePollInfo {
25
58
  status: CloneState;
26
59
  progressPercentage?: number;
27
60
  }
61
+ /**
62
+ * Configuration options for {@link waitForClone} polling behavior.
63
+ */
28
64
  export interface WaitForCloneOptions {
29
65
  sandboxId: string;
30
66
  cloneId: string;
@@ -34,11 +70,23 @@ export interface WaitForCloneOptions {
34
70
  sleep?: (ms: number) => Promise<void>;
35
71
  }
36
72
  /**
37
- * Waits for a sandbox clone to reach COMPLETED or FAILED state by polling its status.
73
+ * Waits for a sandbox clone to reach `COMPLETED` or `FAILED` state by polling
74
+ * its status against the ODS API.
75
+ *
76
+ * Polls at `pollIntervalSeconds` until the clone completes, the configured
77
+ * timeout is exceeded, or the clone enters a failed state. An initial poll
78
+ * delay equal to `pollIntervalSeconds` is applied before the first status
79
+ * check.
38
80
  *
39
81
  * @param client - ODS client for API calls
40
82
  * @param options - Polling configuration options
41
- *
83
+ * @param options.sandboxId - ID of the source sandbox
84
+ * @param options.cloneId - ID of the clone operation to monitor
85
+ * @param options.pollIntervalSeconds - Seconds between status checks
86
+ * @param options.timeoutSeconds - Maximum seconds to wait (`0` disables the timeout)
87
+ * @param options.onPoll - Optional callback invoked after each status poll
88
+ * @param options.sleep - Optional custom sleep function (primarily for testing)
89
+ * @returns Promise that resolves when the clone reaches `COMPLETED`
42
90
  * @throws {ClonePollingTimeoutError} If the timeout is exceeded before completion
43
91
  * @throws {ClonePollingError} If the API request fails
44
92
  * @throws {CloneFailedError} If the clone enters the FAILED state
@@ -4,6 +4,15 @@
4
4
  * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { getLogger } from '../../logging/logger.js';
7
+ /**
8
+ * Error thrown when a sandbox clone operation does not complete within the
9
+ * configured timeout while polling.
10
+ *
11
+ * @param sandboxId - ID of the source sandbox
12
+ * @param cloneId - ID of the clone operation
13
+ * @param timeoutSeconds - Timeout duration in seconds
14
+ * @param lastStatus - Last observed clone status before the timeout occurred, if any
15
+ */
7
16
  export class ClonePollingTimeoutError extends Error {
8
17
  sandboxId;
9
18
  cloneId;
@@ -18,6 +27,13 @@ export class ClonePollingTimeoutError extends Error {
18
27
  this.name = 'ClonePollingTimeoutError';
19
28
  }
20
29
  }
30
+ /**
31
+ * Error thrown when an API request to fetch clone status fails.
32
+ *
33
+ * @param sandboxId - ID of the source sandbox
34
+ * @param cloneId - ID of the clone operation
35
+ * @param message - Underlying error message from the API call
36
+ */
21
37
  export class ClonePollingError extends Error {
22
38
  sandboxId;
23
39
  cloneId;
@@ -28,6 +44,13 @@ export class ClonePollingError extends Error {
28
44
  this.name = 'ClonePollingError';
29
45
  }
30
46
  }
47
+ /**
48
+ * Error thrown when a sandbox clone operation enters the `FAILED` state.
49
+ *
50
+ * @param sandboxId - ID of the source sandbox
51
+ * @param cloneId - ID of the clone operation
52
+ * @param status - Clone status observed when the failure was detected
53
+ */
31
54
  export class CloneFailedError extends Error {
32
55
  sandboxId;
33
56
  cloneId;
@@ -46,11 +69,23 @@ async function defaultSleep(ms) {
46
69
  });
47
70
  }
48
71
  /**
49
- * Waits for a sandbox clone to reach COMPLETED or FAILED state by polling its status.
72
+ * Waits for a sandbox clone to reach `COMPLETED` or `FAILED` state by polling
73
+ * its status against the ODS API.
74
+ *
75
+ * Polls at `pollIntervalSeconds` until the clone completes, the configured
76
+ * timeout is exceeded, or the clone enters a failed state. An initial poll
77
+ * delay equal to `pollIntervalSeconds` is applied before the first status
78
+ * check.
50
79
  *
51
80
  * @param client - ODS client for API calls
52
81
  * @param options - Polling configuration options
53
- *
82
+ * @param options.sandboxId - ID of the source sandbox
83
+ * @param options.cloneId - ID of the clone operation to monitor
84
+ * @param options.pollIntervalSeconds - Seconds between status checks
85
+ * @param options.timeoutSeconds - Maximum seconds to wait (`0` disables the timeout)
86
+ * @param options.onPoll - Optional callback invoked after each status poll
87
+ * @param options.sleep - Optional custom sleep function (primarily for testing)
88
+ * @returns Promise that resolves when the clone reaches `COMPLETED`
54
89
  * @throws {ClonePollingTimeoutError} If the timeout is exceeded before completion
55
90
  * @throws {ClonePollingError} If the API request fails
56
91
  * @throws {CloneFailedError} If the clone enters the FAILED state
@@ -1 +1 @@
1
- {"version":3,"file":"wait-for-clone.js","sourceRoot":"","sources":["../../../../src/operations/ods/wait-for-clone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAIlD,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAE/B;IACA;IACA;IACA;IAJlB,YACkB,SAAiB,EACjB,OAAe,EACf,cAAsB,EACtB,UAAuB;QAEvC,KAAK,CACH,6BAA6B,OAAO,eAAe,SAAS,UAAU,cAAc,WAClF,UAAU,CAAC,CAAC,CAAC,gBAAgB,UAAU,GAAG,CAAC,CAAC,CAAC,EAC/C,EAAE,CACH,CAAC;QATc,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAa;QAOvC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAExB;IACA;IAFlB,YACkB,SAAiB,EACjB,OAAe,EAC/B,OAAe;QAEf,KAAK,CAAC,oCAAoC,OAAO,eAAe,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;QAJzE,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QAI/B,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAEvB;IACA;IACA;IAHlB,YACkB,SAAiB,EACjB,OAAe,EACf,MAAkB;QAElC,KAAK,CAAC,SAAS,OAAO,eAAe,SAAS,SAAS,CAAC,CAAC;QAJzC,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAY;QAGlC,IAAI,CAAC,IAAI,GAAG,kB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EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAC,EAAE,kBAAkB,CAAC,CAAC;QAC9F,OAAO,CAAC,MAAM,EAAE,CAAC;YACf,SAAS;YACT,OAAO;YACP,cAAc;YACd,MAAM,EAAE,aAAa;YACrB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;SAC7C,CAAC,CAAC;QAEH,IAAI,aAAa,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO;QACT,CAAC;QAED,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -1,5 +1,25 @@
1
1
  import type { OdsClient } from '../../clients/ods.js';
2
+ /**
3
+ * State of a sandbox in the ODS system.
4
+ *
5
+ * Standard states:
6
+ * - `deleted` - Sandbox has been deleted
7
+ * - `failed` - Sandbox creation or operation failed
8
+ * - `started` - Sandbox is running
9
+ * - `stopped` - Sandbox is stopped
10
+ *
11
+ * Also accepts any other string value via `(string & {})` for forward compatibility
12
+ * with future ODS API states.
13
+ */
2
14
  export type SandboxState = 'deleted' | 'failed' | 'started' | 'stopped' | (string & {});
15
+ /**
16
+ * Error thrown when a sandbox does not reach its target state within the specified timeout period.
17
+ *
18
+ * @param sandboxId - ID of the sandbox being monitored
19
+ * @param targetState - The desired state that was not reached before timeout
20
+ * @param timeoutSeconds - Timeout duration in seconds that was exceeded
21
+ * @param lastState - Optional last observed state before timeout occurred
22
+ */
3
23
  export declare class SandboxPollingTimeoutError extends Error {
4
24
  readonly sandboxId: string;
5
25
  readonly targetState: SandboxState;
@@ -7,22 +27,52 @@ export declare class SandboxPollingTimeoutError extends Error {
7
27
  readonly lastState?: SandboxState | undefined;
8
28
  constructor(sandboxId: string, targetState: SandboxState, timeoutSeconds: number, lastState?: SandboxState | undefined);
9
29
  }
30
+ /**
31
+ * Error thrown when fetching sandbox status fails during polling.
32
+ *
33
+ * @param sandboxId - ID of the sandbox being polled
34
+ * @param message - Error message or details from the API response
35
+ */
10
36
  export declare class SandboxPollingError extends Error {
11
37
  readonly sandboxId: string;
12
38
  readonly message: string;
13
39
  constructor(sandboxId: string, message: string);
14
40
  }
41
+ /**
42
+ * Error thrown when a sandbox reaches a terminal error state (failed or deleted) during polling.
43
+ *
44
+ * @param sandboxId - ID of the sandbox that reached a terminal state
45
+ * @param targetState - The desired state that was being waited for
46
+ * @param state - The terminal state that was reached
47
+ */
15
48
  export declare class SandboxTerminalStateError extends Error {
16
49
  readonly sandboxId: string;
17
50
  readonly targetState: SandboxState;
18
51
  readonly state: SandboxState;
19
52
  constructor(sandboxId: string, targetState: SandboxState, state: SandboxState);
20
53
  }
54
+ /**
55
+ * Information provided to the `onPoll` callback on each poll during sandbox state monitoring.
56
+ *
57
+ * @property sandboxId - ID of the sandbox being monitored
58
+ * @property elapsedSeconds - Total elapsed time in seconds since polling started
59
+ * @property state - Current observed state of the sandbox
60
+ */
21
61
  export interface WaitForSandboxPollInfo {
22
62
  sandboxId: string;
23
63
  elapsedSeconds: number;
24
64
  state: SandboxState;
25
65
  }
66
+ /**
67
+ * Configuration options for {@link waitForSandbox} sandbox state polling.
68
+ *
69
+ * @property sandboxId - ID of the sandbox to monitor
70
+ * @property targetState - Desired sandbox state to wait for
71
+ * @property pollIntervalSeconds - Interval between status checks in seconds
72
+ * @property timeoutSeconds - Maximum time to wait in seconds (0 = no timeout)
73
+ * @property onPoll - Optional callback invoked on each poll with current state
74
+ * @property sleep - Optional custom sleep function (primarily for testing)
75
+ */
26
76
  export interface WaitForSandboxOptions {
27
77
  sandboxId: string;
28
78
  targetState: SandboxState;
@@ -4,6 +4,14 @@
4
4
  * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { getLogger } from '../../logging/logger.js';
7
+ /**
8
+ * Error thrown when a sandbox does not reach its target state within the specified timeout period.
9
+ *
10
+ * @param sandboxId - ID of the sandbox being monitored
11
+ * @param targetState - The desired state that was not reached before timeout
12
+ * @param timeoutSeconds - Timeout duration in seconds that was exceeded
13
+ * @param lastState - Optional last observed state before timeout occurred
14
+ */
7
15
  export class SandboxPollingTimeoutError extends Error {
8
16
  sandboxId;
9
17
  targetState;
@@ -18,6 +26,12 @@ export class SandboxPollingTimeoutError extends Error {
18
26
  this.name = 'SandboxPollingTimeoutError';
19
27
  }
20
28
  }
29
+ /**
30
+ * Error thrown when fetching sandbox status fails during polling.
31
+ *
32
+ * @param sandboxId - ID of the sandbox being polled
33
+ * @param message - Error message or details from the API response
34
+ */
21
35
  export class SandboxPollingError extends Error {
22
36
  sandboxId;
23
37
  message;
@@ -28,6 +42,13 @@ export class SandboxPollingError extends Error {
28
42
  this.name = 'SandboxPollingError';
29
43
  }
30
44
  }
45
+ /**
46
+ * Error thrown when a sandbox reaches a terminal error state (failed or deleted) during polling.
47
+ *
48
+ * @param sandboxId - ID of the sandbox that reached a terminal state
49
+ * @param targetState - The desired state that was being waited for
50
+ * @param state - The terminal state that was reached
51
+ */
31
52
  export class SandboxTerminalStateError extends Error {
32
53
  sandboxId;
33
54
  targetState;
@@ -1 +1 @@
1
- {"version":3,"file":"wait-for-sandbox.js","sourceRoot":"","sources":["../../../../src/operations/ods/wait-for-sandbox.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAIlD,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAEjC;IACA;IACA;IACA;IAJlB,YACkB,SAAiB,EACjB,WAAyB,EACzB,cAAsB,EACtB,SAAwB;QAExC,KAAK,CACH,+BAA+B,SAAS,mBAAmB,WAAW,UAAU,cAAc,WAC5F,SAAS,CAAC,CAAC,CAAC,eAAe,SAAS,GAAG,CAAC,CAAC,CAAC,EAC5C,EAAE,CACH,CAAC;QATc,cAAS,GA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ccountManagerOrgsClient, AccountManagerOrganization, OrganizationCollection, ListOrgsOptions } from '../../clients/am-api.js';
48
+ /**
49
+ * Core organization types re-exported for convenience:
50
+ *
51
+ * - {@link AccountManagerOrganization} - Single organization from Account Manager
52
+ * - {@link OrganizationCollection} - Paginated collection of organizations with pagination metadata (totalElements, totalPages, number, size)
53
+ * - {@link ListOrgsOptions} - Options for listing organizations with pagination and bulk retrieval (size, page, all)
54
+ */
48
55
  export type { AccountManagerOrganization, OrganizationCollection, ListOrgsOptions } from '../../clients/am-api.js';
49
56
  /**
50
57
  * Gets an organization by ID.
@@ -52,23 +59,23 @@ export type { AccountManagerOrganization, OrganizationCollection, ListOrgsOption
52
59
  * @param client - Account Manager Organizations client
53
60
  * @param orgId - Organization ID
54
61
  * @returns Organization details
55
- * @throws Error if organization is not found
62
+ * @throws {Error} If the organization is not found (404), authentication fails (401), permission is denied (403), or other request failures occur
56
63
  */
57
64
  export declare function getOrg(client: AccountManagerOrgsClient, orgId: string): Promise<AccountManagerOrganization>;
58
65
  /**
59
- * Gets an organization by name (searches for exact or partial match).
66
+ * Gets an organization by name (performs case-sensitive prefix search using startsWith, filters to exact match if multiple results are found, throws if ambiguous).
60
67
  *
61
68
  * @param client - Account Manager Organizations client
62
69
  * @param name - Organization name
63
70
  * @returns Organization details
64
- * @throws Error if organization is not found or ambiguous
71
+ * @throws {Error} If the organization is not found or if multiple organizations match the name
65
72
  */
66
73
  export declare function getOrgByName(client: AccountManagerOrgsClient, name: string): Promise<AccountManagerOrganization>;
67
74
  /**
68
75
  * Lists organizations with pagination.
69
76
  *
70
77
  * @param client - Account Manager Organizations client
71
- * @param options - List options (size, page, all)
72
- * @returns Organization collection
78
+ * @param options - Pagination options. Set `all: true` to retrieve all organizations using the max page size of 5000
79
+ * @returns {OrganizationCollection} Paginated organization collection with pagination metadata (totalElements, totalPages, number, size)
73
80
  */
74
81
  export declare function listOrgs(client: AccountManagerOrgsClient, options?: ListOrgsOptions): Promise<OrganizationCollection>;