@adobe/acc-js-sdk 1.1.62 → 1.2.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 (61) hide show
  1. package/.cursor/commands/opsx-apply.md +152 -0
  2. package/.cursor/commands/opsx-archive.md +157 -0
  3. package/.cursor/commands/opsx-explore.md +173 -0
  4. package/.cursor/commands/opsx-propose.md +106 -0
  5. package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
  6. package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
  7. package/.cursor/skills/openspec-explore/SKILL.md +288 -0
  8. package/.cursor/skills/openspec-propose/SKILL.md +110 -0
  9. package/.eslintrc.js +2 -2
  10. package/.github/prompts/opsx-apply.prompt.md +149 -0
  11. package/.github/prompts/opsx-archive.prompt.md +154 -0
  12. package/.github/prompts/opsx-explore.prompt.md +170 -0
  13. package/.github/prompts/opsx-propose.prompt.md +103 -0
  14. package/.github/skills/openspec-apply-change/SKILL.md +156 -0
  15. package/.github/skills/openspec-archive-change/SKILL.md +114 -0
  16. package/.github/skills/openspec-explore/SKILL.md +288 -0
  17. package/.github/skills/openspec-propose/SKILL.md +110 -0
  18. package/.github/workflows/codeql-analysis.yml +5 -4
  19. package/.github/workflows/npm-publish.yml +3 -3
  20. package/AGENTS.md +117 -0
  21. package/CLAUDE.md +2 -0
  22. package/MIGRATION.md +10 -0
  23. package/README.md +6 -2
  24. package/ai-docs/coding-rules.md +95 -0
  25. package/ai-docs/tech-stack.md +43 -0
  26. package/babel.config.js +5 -0
  27. package/docs/changeLog.html +28 -2
  28. package/docs/checkList.html +2 -2
  29. package/docs/quickstart.html +2 -1
  30. package/docs/release.html +1 -1
  31. package/openspec/config.yaml +20 -0
  32. package/package-lock.json +6055 -4036
  33. package/package.json +9 -7
  34. package/src/AGENTS.md +98 -0
  35. package/src/CLAUDE.md +2 -0
  36. package/src/application.js +637 -637
  37. package/src/cache.js +133 -133
  38. package/src/cacheRefresher.js +190 -190
  39. package/src/campaign.js +532 -532
  40. package/src/client.js +1539 -1537
  41. package/src/crypto.js +52 -52
  42. package/src/domUtil.js +346 -346
  43. package/src/entityAccessor.js +61 -61
  44. package/src/index.js +83 -83
  45. package/src/methodCache.js +69 -69
  46. package/src/optionCache.js +26 -26
  47. package/src/soap.js +321 -322
  48. package/src/testUtil.js +13 -13
  49. package/src/transport.js +70 -70
  50. package/src/util.js +147 -147
  51. package/src/web/bundler.js +5 -5
  52. package/src/xtkCaster.js +258 -258
  53. package/src/xtkEntityCache.js +34 -34
  54. package/src/xtkJob.js +185 -185
  55. package/test/AGENTS.md +37 -0
  56. package/test/CLAUDE.md +2 -0
  57. package/test/cacheRefresher.test.js +7 -0
  58. package/test/client.test.js +90 -78
  59. package/test/jest.config.js +6 -0
  60. package/test/observability.test.js +6 -1
  61. package/test/xtkJob.test.js +2 -2
package/src/testUtil.js CHANGED
@@ -12,36 +12,36 @@ OF ANY KIND, either express or implied. See the License for the specific languag
12
12
  governing permissions and limitations under the License.
13
13
  */
14
14
  (function() {
15
- "use strict";
15
+ "use strict";
16
16
 
17
- const { newSchema } = require("./application.js");
17
+ const { newSchema } = require("./application.js");
18
18
 
19
- /**********************************************************************************
19
+ /**********************************************************************************
20
20
  *
21
21
  * Utilities for testing
22
22
  *
23
23
  *********************************************************************************/
24
24
 
25
- /**
25
+ /**
26
26
  * @namespace Utils
27
27
  */
28
28
 
29
- /**
29
+ /**
30
30
  * @memberof Utils
31
31
  * @class
32
32
  * @constructor
33
33
  */
34
- class TestUtil {
34
+ class TestUtil {
35
35
 
36
- static newSchema(xml) {
37
- if (typeof xml === "string")
38
- xml = DomUtil.parse(xml);
39
- return newSchema(xml);
36
+ static newSchema(xml) {
37
+ if (typeof xml === "string")
38
+ xml = DomUtil.parse(xml);
39
+ return newSchema(xml);
40
+ }
40
41
  }
41
- }
42
42
 
43
43
 
44
- // Public expots
45
- exports.TestUtil = TestUtil;
44
+ // Public expots
45
+ exports.TestUtil = TestUtil;
46
46
 
47
47
  })();
package/src/transport.js CHANGED
@@ -10,48 +10,48 @@ OF ANY KIND, either express or implied. See the License for the specific languag
10
10
  governing permissions and limitations under the License.
11
11
  */
12
12
  (function() {
13
- "use strict";
13
+ "use strict";
14
14
 
15
- const { Util } = require('./util.js');
15
+ const { Util } = require('./util.js');
16
16
 
17
- /**
17
+ /**
18
18
  * @memberof Utils
19
19
  * @class
20
20
  * @constructor
21
21
  */
22
- class HttpError {
22
+ class HttpError {
23
23
  /* Encapsulates an error from an HTTP call
24
24
  * @param {string|number} statusCode - The Http status code
25
25
  * @param {string?} statusText - The Http status text corresponding to the error code
26
26
  * @param {any?} data - The payload of the HTTP response, which usually contains details about the error
27
27
  */
28
- constructor(statusCode, statusText, data) {
28
+ constructor(statusCode, statusText, data) {
29
29
  this.statusCode = statusCode;
30
30
  this.statusText = statusText || "";
31
31
  this.data = data;
32
- }
32
+ }
33
33
 
34
- /**
34
+ /**
35
35
  * Returns a short description of the error
36
36
  * @returns {string} a short descrption of the error
37
37
  */
38
- toString() {
39
- return `${this.statusCode}${this.statusText ? " " + this.statusText : ""}`;
38
+ toString() {
39
+ return `${this.statusCode}${this.statusText ? " " + this.statusText : ""}`;
40
+ }
40
41
  }
41
- }
42
42
 
43
- /**********************************************************************************
43
+ /**********************************************************************************
44
44
  *
45
45
  * Node implementation
46
46
  *
47
47
  *********************************************************************************/
48
- /* istanbul ignore else */
49
- if (!Util.isBrowser()) {
48
+ /* istanbul ignore else */
49
+ if (!Util.isBrowser()) {
50
50
 
51
- // Transport layer using axios library
52
- const axios = require('axios');
51
+ // Transport layer using axios library
52
+ const axios = require('axios');
53
53
 
54
- /**
54
+ /**
55
55
  *
56
56
  * Request body (options)
57
57
  * - headers (kv)
@@ -66,78 +66,78 @@ if (!Util.isBrowser()) {
66
66
  * - request
67
67
  */
68
68
 
69
- const request = (options, requestOptions) => {
70
- requestOptions = requestOptions || {};
71
- const request = {
72
- method: options.method || "GET",
73
- url: options.url,
74
- headers: options.headers,
75
- data: options.data,
76
- timeout: requestOptions.timeout || 5000,
77
- signal: requestOptions.signal,
69
+ const request = (options, requestOptions) => {
70
+ requestOptions = requestOptions || {};
71
+ const request = {
72
+ method: options.method || "GET",
73
+ url: options.url,
74
+ headers: options.headers,
75
+ data: options.data,
76
+ timeout: requestOptions.timeout || 5000,
77
+ signal: requestOptions.signal,
78
+ };
79
+ return axios(request)
80
+ .then((response) => {
81
+ // HTTP success (200, 201, etc.) are returned here
82
+ return Promise.resolve(response.data);
83
+ })
84
+ .catch((error) => {
85
+ // Not an HTTP error
86
+ const response = error && error.response;
87
+ if (!response)
88
+ return Promise.reject(new HttpError(500, error ? error.toString() : undefined));
89
+ // HTTP errors (400, 404, 500, etc.) are returned here
90
+ return Promise.reject(new HttpError(response.status, response.statusText, response.data));
91
+ });
78
92
  };
79
- return axios(request)
80
- .then((response) => {
81
- // HTTP success (200, 201, etc.) are returned here
82
- return Promise.resolve(response.data);
83
- })
84
- .catch((error) => {
85
- // Not an HTTP error
86
- const response = error && error.response;
87
- if (!response)
88
- return Promise.reject(new HttpError(500, error ? error.toString() : undefined));
89
- // HTTP errors (400, 404, 500, etc.) are returned here
90
- return Promise.reject(new HttpError(response.status, response.statusText, response.data));
91
- });
92
- };
93
-
94
- exports.request = request;
95
- exports.HttpError = HttpError;
96
-
97
- }
98
-
99
- /**********************************************************************************
93
+
94
+ exports.request = request;
95
+ exports.HttpError = HttpError;
96
+
97
+ }
98
+
99
+ /**********************************************************************************
100
100
  *
101
101
  * Browser-side implementation of the request-promise-native node module.
102
102
  * This simply wraps the fetch API
103
103
  * From https://www.npmjs.com/package/request-promise-native
104
104
  *
105
105
  *********************************************************************************/
106
- else {
106
+ else {
107
107
 
108
- const request = function(options, requestOptions) {
109
- requestOptions = requestOptions || {};
110
- const headers = new Headers();
111
- for (var k in options.headers) {
108
+ const request = function(options, requestOptions) {
109
+ requestOptions = requestOptions || {};
110
+ const headers = new Headers();
111
+ for (var k in options.headers) {
112
112
  headers.append(k, options.headers[k]);
113
- }
114
- const r = new Request(options.url, {
113
+ }
114
+ const r = new Request(options.url, {
115
115
  method: options.method,
116
116
  headers: headers,
117
117
  body: options.data,
118
118
  signal : requestOptions.signal,
119
- });
119
+ });
120
120
 
121
- const p = fetch(r).then(async (response) => {
121
+ const p = fetch(r).then(async (response) => {
122
122
  if (!response.ok)
123
- throw new HttpError(response.status, response.statusText, await response.text());
123
+ throw new HttpError(response.status, response.statusText, await response.text());
124
124
  return response.blob().then((blob) => {
125
- return blob.text();
125
+ return blob.text();
126
126
  });
127
- }).catch((ex) => {
128
- if(ex.name === 'AbortError'){
129
- throw ex;
130
- }
131
- const proto = Object.getPrototypeOf(ex);
132
- if (proto.constructor.name == "HttpError")
133
- throw ex;
134
- throw new HttpError(ex.status, ex.statusText);
135
- });
136
- return p;
137
- };
127
+ }).catch((ex) => {
128
+ if(ex.name === 'AbortError'){
129
+ throw ex;
130
+ }
131
+ const proto = Object.getPrototypeOf(ex);
132
+ if (proto.constructor.name == "HttpError")
133
+ throw ex;
134
+ throw new HttpError(ex.status, ex.statusText);
135
+ });
136
+ return p;
137
+ };
138
138
 
139
- module.exports.request = request;
139
+ module.exports.request = request;
140
140
 
141
- }
141
+ }
142
142
 
143
143
  })();