@adobe/acc-js-sdk 1.1.61 → 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.
- package/.cursor/commands/opsx-apply.md +152 -0
- package/.cursor/commands/opsx-archive.md +157 -0
- package/.cursor/commands/opsx-explore.md +173 -0
- package/.cursor/commands/opsx-propose.md +106 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
- package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
- package/.cursor/skills/openspec-explore/SKILL.md +288 -0
- package/.cursor/skills/openspec-propose/SKILL.md +110 -0
- package/.eslintrc.js +2 -2
- package/.github/prompts/opsx-apply.prompt.md +149 -0
- package/.github/prompts/opsx-archive.prompt.md +154 -0
- package/.github/prompts/opsx-explore.prompt.md +170 -0
- package/.github/prompts/opsx-propose.prompt.md +103 -0
- package/.github/skills/openspec-apply-change/SKILL.md +156 -0
- package/.github/skills/openspec-archive-change/SKILL.md +114 -0
- package/.github/skills/openspec-explore/SKILL.md +288 -0
- package/.github/skills/openspec-propose/SKILL.md +110 -0
- package/.github/workflows/codeql-analysis.yml +5 -4
- package/.github/workflows/npm-publish.yml +3 -3
- package/AGENTS.md +117 -0
- package/CLAUDE.md +2 -0
- package/MIGRATION.md +10 -0
- package/README.md +6 -2
- package/ai-docs/coding-rules.md +95 -0
- package/ai-docs/tech-stack.md +43 -0
- package/babel.config.js +5 -0
- package/docs/changeLog.html +34 -0
- package/docs/checkList.html +2 -2
- package/docs/connectionParameters.html +5 -0
- package/docs/quickstart.html +2 -1
- package/docs/release.html +1 -1
- package/openspec/config.yaml +20 -0
- package/package-lock.json +7437 -3924
- package/package.json +9 -7
- package/src/AGENTS.md +98 -0
- package/src/CLAUDE.md +2 -0
- package/src/application.js +637 -637
- package/src/cache.js +133 -133
- package/src/cacheRefresher.js +190 -190
- package/src/campaign.js +532 -532
- package/src/client.js +1539 -1532
- package/src/crypto.js +52 -52
- package/src/domUtil.js +346 -346
- package/src/entityAccessor.js +61 -61
- package/src/index.js +83 -83
- package/src/methodCache.js +69 -69
- package/src/optionCache.js +26 -26
- package/src/soap.js +321 -322
- package/src/testUtil.js +13 -13
- package/src/transport.js +70 -70
- package/src/util.js +147 -147
- package/src/web/bundler.js +5 -5
- package/src/xtkCaster.js +258 -258
- package/src/xtkEntityCache.js +34 -34
- package/src/xtkJob.js +185 -185
- package/test/AGENTS.md +37 -0
- package/test/CLAUDE.md +2 -0
- package/test/cacheRefresher.test.js +7 -0
- package/test/client.test.js +123 -81
- package/test/jest.config.js +6 -0
- package/test/observability.test.js +6 -1
- 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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
80
|
-
.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
106
|
+
else {
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
|
|
121
|
+
const p = fetch(r).then(async (response) => {
|
|
122
122
|
if (!response.ok)
|
|
123
|
-
|
|
123
|
+
throw new HttpError(response.status, response.statusText, await response.text());
|
|
124
124
|
return response.blob().then((blob) => {
|
|
125
|
-
|
|
125
|
+
return blob.text();
|
|
126
126
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
139
|
+
module.exports.request = request;
|
|
140
140
|
|
|
141
|
-
}
|
|
141
|
+
}
|
|
142
142
|
|
|
143
143
|
})();
|