contentful-management 12.0.0-beta.1 → 12.0.0-beta.3
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/README.md +3 -0
- package/dist/cjs/adapters/REST/endpoints/access-token.cjs +136 -0
- package/dist/cjs/adapters/REST/endpoints/ai-action-invocation.cjs +9 -0
- package/dist/cjs/adapters/REST/endpoints/ai-action.cjs +53 -0
- package/dist/cjs/adapters/REST/endpoints/api-key.cjs +48 -0
- package/dist/cjs/adapters/REST/endpoints/app-access-token.cjs +9 -0
- package/dist/cjs/adapters/REST/endpoints/app-action-call.cjs +65 -0
- package/dist/cjs/adapters/REST/endpoints/app-action.cjs +42 -0
- package/dist/cjs/adapters/REST/endpoints/app-bundle.cjs +39 -0
- package/dist/cjs/adapters/REST/endpoints/app-definition.cjs +47 -0
- package/dist/cjs/adapters/REST/endpoints/app-details.cjs +17 -0
- package/dist/cjs/adapters/REST/endpoints/app-event-subscription.cjs +17 -0
- package/dist/cjs/adapters/REST/endpoints/app-installation.cjs +42 -0
- package/dist/cjs/adapters/REST/endpoints/app-key.cjs +21 -0
- package/dist/cjs/adapters/REST/endpoints/app-signed-request.cjs +9 -0
- package/dist/cjs/adapters/REST/endpoints/app-signing-secret.cjs +17 -0
- package/dist/cjs/adapters/REST/endpoints/app-upload.cjs +28 -0
- package/dist/cjs/adapters/REST/endpoints/asset-key.cjs +34 -0
- package/dist/cjs/adapters/REST/endpoints/asset.cjs +185 -0
- package/dist/cjs/adapters/REST/endpoints/bulk-action.cjs +21 -0
- package/dist/cjs/adapters/REST/endpoints/comment.cjs +92 -0
- package/dist/cjs/adapters/REST/endpoints/concept-scheme.cjs +44 -0
- package/dist/cjs/adapters/REST/endpoints/concept.cjs +65 -0
- package/dist/cjs/adapters/REST/endpoints/content-type.cjs +56 -0
- package/dist/cjs/adapters/REST/endpoints/editor-interface.cjs +24 -0
- package/dist/cjs/adapters/REST/endpoints/entry.cjs +104 -0
- package/dist/cjs/adapters/REST/endpoints/environment-alias.cjs +44 -0
- package/dist/cjs/adapters/REST/endpoints/environment-template-installation.cjs +23 -0
- package/dist/cjs/adapters/REST/endpoints/environment-template.cjs +49 -0
- package/dist/cjs/adapters/REST/endpoints/environment.cjs +47 -0
- package/dist/cjs/adapters/REST/endpoints/extension.cjs +44 -0
- package/dist/cjs/adapters/REST/endpoints/function-log.cjs +23 -0
- package/dist/cjs/adapters/REST/endpoints/function.cjs +25 -0
- package/dist/cjs/adapters/REST/endpoints/http.cjs +29 -0
- package/dist/cjs/adapters/REST/endpoints/index.cjs +139 -0
- package/dist/cjs/adapters/REST/endpoints/locale.cjs +37 -0
- package/dist/cjs/adapters/REST/endpoints/oauth-application.cjs +147 -0
- package/dist/cjs/adapters/REST/endpoints/organization-invitation.cjs +23 -0
- package/dist/cjs/adapters/REST/endpoints/organization-membership.cjs +32 -0
- package/dist/cjs/adapters/REST/endpoints/organization.cjs +28 -0
- package/dist/cjs/adapters/REST/endpoints/personal-access-token.cjs +37 -0
- package/dist/cjs/adapters/REST/endpoints/preview-api-key.cjs +15 -0
- package/dist/cjs/adapters/REST/endpoints/raw.cjs +44 -0
- package/dist/cjs/adapters/REST/endpoints/release-action.cjs +21 -0
- package/dist/cjs/adapters/REST/endpoints/release.cjs +61 -0
- package/dist/cjs/adapters/REST/endpoints/resource-provider.cjs +18 -0
- package/dist/cjs/adapters/REST/endpoints/resource-type.cjs +30 -0
- package/dist/cjs/adapters/REST/endpoints/resource.cjs +10 -0
- package/dist/cjs/adapters/REST/endpoints/role.cjs +48 -0
- package/dist/cjs/adapters/REST/endpoints/scheduled-action.cjs +44 -0
- package/dist/cjs/adapters/REST/endpoints/snapshot.cjs +30 -0
- package/dist/cjs/adapters/REST/endpoints/space-member.cjs +11 -0
- package/dist/cjs/adapters/REST/endpoints/space-membership.cjs +60 -0
- package/dist/cjs/adapters/REST/endpoints/space.cjs +34 -0
- package/dist/cjs/adapters/REST/endpoints/tag.cjs +37 -0
- package/dist/cjs/adapters/REST/endpoints/task.cjs +40 -0
- package/dist/cjs/adapters/REST/endpoints/team-membership.cjs +35 -0
- package/dist/cjs/adapters/REST/endpoints/team-space-membership.cjs +46 -0
- package/dist/cjs/adapters/REST/endpoints/team.cjs +36 -0
- package/dist/cjs/adapters/REST/endpoints/ui-config.cjs +22 -0
- package/dist/cjs/adapters/REST/endpoints/upload-credentials.cjs +16 -0
- package/dist/cjs/adapters/REST/endpoints/upload.cjs +42 -0
- package/dist/cjs/adapters/REST/endpoints/usage.cjs +17 -0
- package/dist/cjs/adapters/REST/endpoints/user-ui-config.cjs +22 -0
- package/dist/cjs/adapters/REST/endpoints/user.cjs +27 -0
- package/dist/cjs/adapters/REST/endpoints/utils.cjs +20 -0
- package/dist/cjs/adapters/REST/endpoints/webhook.cjs +98 -0
- package/dist/cjs/adapters/REST/endpoints/workflow-definition.cjs +41 -0
- package/dist/cjs/adapters/REST/endpoints/workflow.cjs +49 -0
- package/dist/cjs/adapters/REST/endpoints/workflows-changelog.cjs +11 -0
- package/dist/cjs/adapters/REST/make-request.cjs +19 -0
- package/dist/cjs/adapters/REST/rest-adapter.cjs +32 -0
- package/dist/cjs/common-types.cjs +6 -0
- package/dist/cjs/common-utils.cjs +38 -0
- package/dist/cjs/constants/editor-interface-defaults/controls-defaults.cjs +161 -0
- package/dist/cjs/constants/editor-interface-defaults/editors-defaults.cjs +40 -0
- package/dist/cjs/constants/editor-interface-defaults/index.cjs +14 -0
- package/dist/cjs/constants/editor-interface-defaults/sidebar-defaults.cjs +71 -0
- package/dist/cjs/constants/editor-interface-defaults/types.cjs +18 -0
- package/dist/cjs/create-adapter.cjs +21 -0
- package/dist/cjs/create-app-definition-api.cjs +254 -0
- package/dist/cjs/create-contentful-api.cjs +592 -0
- package/dist/cjs/create-entry-api.cjs +481 -0
- package/dist/cjs/create-environment-api.cjs +2403 -0
- package/dist/cjs/create-environment-template-api.cjs +270 -0
- package/dist/cjs/create-organization-api.cjs +1136 -0
- package/dist/cjs/create-space-api.cjs +1591 -0
- package/dist/cjs/create-ui-config-api.cjs +55 -0
- package/dist/cjs/create-user-ui-config-api.cjs +55 -0
- package/dist/cjs/enhance-with-methods.cjs +26 -0
- package/dist/cjs/entities/access-token.cjs +36 -0
- package/dist/cjs/entities/ai-action-invocation.cjs +46 -0
- package/dist/cjs/entities/ai-action.cjs +94 -0
- package/dist/cjs/entities/api-key.cjs +59 -0
- package/dist/cjs/entities/app-access-token.cjs +17 -0
- package/dist/cjs/entities/app-action-call.cjs +67 -0
- package/dist/cjs/entities/app-action.cjs +48 -0
- package/dist/cjs/entities/app-bundle.cjs +48 -0
- package/dist/cjs/entities/app-definition.cjs +29 -0
- package/dist/cjs/entities/app-details.cjs +39 -0
- package/dist/cjs/entities/app-event-subscription.cjs +34 -0
- package/dist/cjs/entities/app-installation.cjs +55 -0
- package/dist/cjs/entities/app-key.cjs +44 -0
- package/dist/cjs/entities/app-signed-request.cjs +17 -0
- package/dist/cjs/entities/app-signing-secret.cjs +34 -0
- package/dist/cjs/entities/app-upload.cjs +47 -0
- package/dist/cjs/entities/asset-key.cjs +17 -0
- package/dist/cjs/entities/asset.cjs +124 -0
- package/dist/cjs/entities/bulk-action.cjs +60 -0
- package/dist/cjs/entities/comment.cjs +63 -0
- package/dist/cjs/entities/concept-scheme.cjs +2 -0
- package/dist/cjs/entities/concept.cjs +2 -0
- package/dist/cjs/entities/content-type.cjs +120 -0
- package/dist/cjs/entities/editor-interface.cjs +50 -0
- package/dist/cjs/entities/entry.cjs +27 -0
- package/dist/cjs/entities/environment-alias.cjs +58 -0
- package/dist/cjs/entities/environment-template-installation.cjs +23 -0
- package/dist/cjs/entities/environment-template.cjs +18 -0
- package/dist/cjs/entities/environment.cjs +34 -0
- package/dist/cjs/entities/extension.cjs +54 -0
- package/dist/cjs/entities/function-log.cjs +26 -0
- package/dist/cjs/entities/function.cjs +66 -0
- package/dist/cjs/entities/index.cjs +131 -0
- package/dist/cjs/entities/locale.cjs +57 -0
- package/dist/cjs/entities/oauth-application.cjs +66 -0
- package/dist/cjs/entities/organization-invitation.cjs +17 -0
- package/dist/cjs/entities/organization-membership.cjs +53 -0
- package/dist/cjs/entities/organization.cjs +32 -0
- package/dist/cjs/entities/personal-access-token.cjs +36 -0
- package/dist/cjs/entities/preview-api-key.cjs +31 -0
- package/dist/cjs/entities/release-action.cjs +55 -0
- package/dist/cjs/entities/release.cjs +111 -0
- package/dist/cjs/entities/resource-provider.cjs +139 -0
- package/dist/cjs/entities/resource-type.cjs +98 -0
- package/dist/cjs/entities/resource.cjs +13 -0
- package/dist/cjs/entities/role.cjs +53 -0
- package/dist/cjs/entities/scheduled-action.cjs +154 -0
- package/dist/cjs/entities/snapshot.cjs +36 -0
- package/dist/cjs/entities/space-member.cjs +23 -0
- package/dist/cjs/entities/space-membership.cjs +53 -0
- package/dist/cjs/entities/space.cjs +33 -0
- package/dist/cjs/entities/tag.cjs +56 -0
- package/dist/cjs/entities/task.cjs +57 -0
- package/dist/cjs/entities/team-membership.cjs +54 -0
- package/dist/cjs/entities/team-space-membership.cjs +53 -0
- package/dist/cjs/entities/team.cjs +53 -0
- package/dist/cjs/entities/ui-config.cjs +20 -0
- package/dist/cjs/entities/upload.cjs +38 -0
- package/dist/cjs/entities/usage.cjs +25 -0
- package/dist/cjs/entities/user-ui-config.cjs +20 -0
- package/dist/cjs/entities/user.cjs +28 -0
- package/dist/cjs/entities/webhook.cjs +77 -0
- package/dist/cjs/entities/workflow-definition.cjs +79 -0
- package/dist/cjs/index.cjs +65 -0
- package/dist/cjs/methods/action.cjs +53 -0
- package/dist/cjs/methods/content-type.cjs +51 -0
- package/dist/cjs/methods/utils.cjs +11 -0
- package/dist/cjs/plain/as-iterator.cjs +32 -0
- package/dist/cjs/plain/checks.cjs +15 -0
- package/dist/cjs/plain/pagination-helper.cjs +56 -0
- package/dist/cjs/plain/plain-client.cjs +516 -0
- package/dist/cjs/plain/wrappers/wrap.cjs +26 -0
- package/dist/cjs/upload-http-client.cjs +17 -0
- package/dist/contentful-management.browser.js +50 -34
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.cjs +35 -19
- package/dist/esm/create-contentful-api.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plain/plain-client.js +1 -1
- package/dist/stats-browser-min.html +1 -1
- package/package.json +6 -6
- package/types.d.ts +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var copy = require('fast-copy');
|
|
4
|
+
var raw = require('./raw.js');
|
|
5
|
+
|
|
6
|
+
const apiPath = (organizationId, ...pathSegments) => `/organizations/${organizationId}/environment_templates/` + pathSegments.join('/');
|
|
7
|
+
const get = (http, { organizationId, environmentTemplateId, version, query = {} }, headers) => version
|
|
8
|
+
? raw.get(http, apiPath(organizationId, environmentTemplateId, 'versions', version), {
|
|
9
|
+
params: query,
|
|
10
|
+
headers,
|
|
11
|
+
})
|
|
12
|
+
: raw.get(http, apiPath(organizationId, environmentTemplateId), {
|
|
13
|
+
params: query,
|
|
14
|
+
headers,
|
|
15
|
+
});
|
|
16
|
+
const getMany = (http, { organizationId, query = {} }, headers) => raw.get(http, apiPath(organizationId), { params: query, headers });
|
|
17
|
+
const create = (http, { organizationId }, payload, headers) => raw.post(http, apiPath(organizationId), payload, { headers });
|
|
18
|
+
const update = (http, { organizationId, environmentTemplateId }, payload, headers) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const data = copy(payload);
|
|
21
|
+
delete data.sys;
|
|
22
|
+
return raw.put(http, apiPath(organizationId, environmentTemplateId), data, {
|
|
23
|
+
headers: Object.assign({ 'X-Contentful-Version': (_a = payload.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const versionUpdate = (http, { organizationId, version, environmentTemplateId }, payload, headers) => raw.patch(http, apiPath(organizationId, environmentTemplateId, 'versions', version), payload, {
|
|
27
|
+
headers,
|
|
28
|
+
});
|
|
29
|
+
const del = (http, { organizationId, environmentTemplateId }, headers) => raw.del(http, apiPath(organizationId, environmentTemplateId), { headers });
|
|
30
|
+
const versions = (http, { organizationId, environmentTemplateId, query = {} }, headers) => raw.get(http, apiPath(organizationId, environmentTemplateId, 'versions'), {
|
|
31
|
+
params: query,
|
|
32
|
+
headers,
|
|
33
|
+
});
|
|
34
|
+
const validate = (http, { spaceId, environmentId, environmentTemplateId, version }, payload, headers) => raw.put(http, version
|
|
35
|
+
? `/spaces/${spaceId}/environments/${environmentId}/template_installations/${environmentTemplateId}/versions/${version}/validated`
|
|
36
|
+
: `/spaces/${spaceId}/environments/${environmentId}/template_installations/${environmentTemplateId}/validated`, payload, { headers });
|
|
37
|
+
const install = (http, { spaceId, environmentId, environmentTemplateId }, payload, headers) => raw.post(http, `/spaces/${spaceId}/environments/${environmentId}/template_installations/${environmentTemplateId}/versions`, payload, { headers });
|
|
38
|
+
const disconnect = (http, { spaceId, environmentId, environmentTemplateId }, headers) => raw.del(http, `/spaces/${spaceId}/environments/${environmentId}/template_installations/${environmentTemplateId}`, { headers });
|
|
39
|
+
|
|
40
|
+
exports.create = create;
|
|
41
|
+
exports.del = del;
|
|
42
|
+
exports.disconnect = disconnect;
|
|
43
|
+
exports.get = get;
|
|
44
|
+
exports.getMany = getMany;
|
|
45
|
+
exports.install = install;
|
|
46
|
+
exports.update = update;
|
|
47
|
+
exports.validate = validate;
|
|
48
|
+
exports.versionUpdate = versionUpdate;
|
|
49
|
+
exports.versions = versions;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var copy = require('fast-copy');
|
|
4
|
+
var raw = require('./raw.js');
|
|
5
|
+
|
|
6
|
+
const get = (http, params) => {
|
|
7
|
+
return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}`);
|
|
8
|
+
};
|
|
9
|
+
const getMany = (http, params) => {
|
|
10
|
+
return raw.get(http, `/spaces/${params.spaceId}/environments`, {
|
|
11
|
+
params: params.query,
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const update = (http, params, rawData, headers) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const data = copy(rawData);
|
|
17
|
+
delete data.sys;
|
|
18
|
+
return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}`, data, {
|
|
19
|
+
headers: Object.assign(Object.assign({}, headers), { 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }),
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const del = (http, params) => {
|
|
23
|
+
return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}`);
|
|
24
|
+
};
|
|
25
|
+
const create = (http, params, rawData, headers) => {
|
|
26
|
+
const data = copy(rawData);
|
|
27
|
+
return raw.post(http, `/spaces/${params.spaceId}/environments`, data, {
|
|
28
|
+
headers,
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const createWithId = (http, params, rawData, headers) => {
|
|
32
|
+
const data = copy(rawData);
|
|
33
|
+
return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}`, data, {
|
|
34
|
+
headers: Object.assign(Object.assign({}, headers), (params.sourceEnvironmentId
|
|
35
|
+
? {
|
|
36
|
+
'X-Contentful-Source-Environment': params.sourceEnvironmentId,
|
|
37
|
+
}
|
|
38
|
+
: {})),
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.create = create;
|
|
43
|
+
exports.createWithId = createWithId;
|
|
44
|
+
exports.del = del;
|
|
45
|
+
exports.get = get;
|
|
46
|
+
exports.getMany = getMany;
|
|
47
|
+
exports.update = update;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var copy = require('fast-copy');
|
|
4
|
+
var raw = require('./raw.js');
|
|
5
|
+
var utils = require('./utils.js');
|
|
6
|
+
|
|
7
|
+
const getBaseUrl = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/extensions`;
|
|
8
|
+
const getExtensionUrl = (params) => getBaseUrl(params) + `/${params.extensionId}`;
|
|
9
|
+
const get = (http, params) => {
|
|
10
|
+
return raw.get(http, getExtensionUrl(params), {
|
|
11
|
+
params: utils.normalizeSelect(params.query),
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const getMany = (http, params) => {
|
|
15
|
+
return raw.get(http, getBaseUrl(params), {
|
|
16
|
+
params: utils.normalizeSelect(params.query),
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const create = (http, params, rawData, headers) => {
|
|
20
|
+
return raw.post(http, getBaseUrl(params), rawData, { headers });
|
|
21
|
+
};
|
|
22
|
+
const createWithId = (http, params, rawData, headers) => {
|
|
23
|
+
const data = copy(rawData);
|
|
24
|
+
return raw.put(http, getExtensionUrl(params), data, { headers });
|
|
25
|
+
};
|
|
26
|
+
const update = async (http, params, rawData, headers) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const data = copy(rawData);
|
|
29
|
+
delete data.sys;
|
|
30
|
+
return raw.put(http, getExtensionUrl(params), data, {
|
|
31
|
+
headers: Object.assign({ 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }, headers),
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const del = (http, params) => {
|
|
35
|
+
return raw.del(http, getExtensionUrl(params));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.create = create;
|
|
39
|
+
exports.createWithId = createWithId;
|
|
40
|
+
exports.del = del;
|
|
41
|
+
exports.get = get;
|
|
42
|
+
exports.getExtensionUrl = getExtensionUrl;
|
|
43
|
+
exports.getMany = getMany;
|
|
44
|
+
exports.update = update;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
const FunctionLogAlphaHeaders = {
|
|
6
|
+
'x-contentful-enable-alpha-feature': 'function-logs',
|
|
7
|
+
};
|
|
8
|
+
const baseURL = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/app_installations/${params.appInstallationId}/functions/${params.functionId}/logs`;
|
|
9
|
+
const getURL = (params) => `/spaces/${params.spaceId}/environments/${params.environmentId}/app_installations/${params.appInstallationId}/functions/${params.functionId}/logs/${params.logId}`;
|
|
10
|
+
const get = (http, params) => {
|
|
11
|
+
return raw.get(http, getURL(params), {
|
|
12
|
+
headers: Object.assign({}, FunctionLogAlphaHeaders),
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const getMany = (http, params) => {
|
|
16
|
+
return raw.get(http, baseURL(params), {
|
|
17
|
+
params: params.query,
|
|
18
|
+
headers: Object.assign({}, FunctionLogAlphaHeaders),
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.get = get;
|
|
23
|
+
exports.getMany = getMany;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
// Base URL
|
|
6
|
+
const getManyUrl = (params) => `/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/functions`;
|
|
7
|
+
const getFunctionUrl = (params) => `${getManyUrl(params)}/${params.functionId}`;
|
|
8
|
+
const getFunctionsEnvURL = (params) => {
|
|
9
|
+
return `/spaces/${params.spaceId}/environments/${params.environmentId}/app_installations/${params.appInstallationId}/functions`;
|
|
10
|
+
};
|
|
11
|
+
const get = (http, params) => {
|
|
12
|
+
return raw.get(http, getFunctionUrl(params));
|
|
13
|
+
};
|
|
14
|
+
const getMany = (http, params) => {
|
|
15
|
+
return raw.get(http, getManyUrl(params), { params: params.query });
|
|
16
|
+
};
|
|
17
|
+
const getManyForEnvironment = (http, params) => {
|
|
18
|
+
return raw.get(http, getFunctionsEnvURL(params), {
|
|
19
|
+
params: params.query,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.get = get;
|
|
24
|
+
exports.getMany = getMany;
|
|
25
|
+
exports.getManyForEnvironment = getManyForEnvironment;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
const get = (http, { url, config }) => {
|
|
6
|
+
return raw.get(http, url, config);
|
|
7
|
+
};
|
|
8
|
+
const post = (http, { url, config }, payload) => {
|
|
9
|
+
return raw.post(http, url, payload, config);
|
|
10
|
+
};
|
|
11
|
+
const put = (http, { url, config }, payload) => {
|
|
12
|
+
return raw.put(http, url, payload, config);
|
|
13
|
+
};
|
|
14
|
+
const patch = (http, { url, config }, payload) => {
|
|
15
|
+
return raw.patch(http, url, payload, config);
|
|
16
|
+
};
|
|
17
|
+
const del = (http, { url, config }) => {
|
|
18
|
+
return raw.del(http, url, config);
|
|
19
|
+
};
|
|
20
|
+
const request = (http, { url, config }) => {
|
|
21
|
+
return raw.http(http, url, config);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.del = del;
|
|
25
|
+
exports.get = get;
|
|
26
|
+
exports.patch = patch;
|
|
27
|
+
exports.post = post;
|
|
28
|
+
exports.put = put;
|
|
29
|
+
exports.request = request;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aiAction = require('./ai-action.js');
|
|
4
|
+
var aiActionInvocation = require('./ai-action-invocation.js');
|
|
5
|
+
var accessToken = require('./access-token.js');
|
|
6
|
+
var apiKey = require('./api-key.js');
|
|
7
|
+
var appAccessToken = require('./app-access-token.js');
|
|
8
|
+
var appAction = require('./app-action.js');
|
|
9
|
+
var appActionCall = require('./app-action-call.js');
|
|
10
|
+
var appBundle = require('./app-bundle.js');
|
|
11
|
+
var appDefinition = require('./app-definition.js');
|
|
12
|
+
var appDetails = require('./app-details.js');
|
|
13
|
+
var appEventSubscription = require('./app-event-subscription.js');
|
|
14
|
+
var appInstallation = require('./app-installation.js');
|
|
15
|
+
var appKey = require('./app-key.js');
|
|
16
|
+
var appSignedRequest = require('./app-signed-request.js');
|
|
17
|
+
var appSigningSecret = require('./app-signing-secret.js');
|
|
18
|
+
var appUpload = require('./app-upload.js');
|
|
19
|
+
var asset = require('./asset.js');
|
|
20
|
+
var assetKey = require('./asset-key.js');
|
|
21
|
+
var bulkAction = require('./bulk-action.js');
|
|
22
|
+
var comment = require('./comment.js');
|
|
23
|
+
var concept = require('./concept.js');
|
|
24
|
+
var conceptScheme = require('./concept-scheme.js');
|
|
25
|
+
var contentType = require('./content-type.js');
|
|
26
|
+
var editorInterface = require('./editor-interface.js');
|
|
27
|
+
var entry = require('./entry.js');
|
|
28
|
+
var environment = require('./environment.js');
|
|
29
|
+
var environmentAlias = require('./environment-alias.js');
|
|
30
|
+
var environmentTemplate = require('./environment-template.js');
|
|
31
|
+
var environmentTemplateInstallation = require('./environment-template-installation.js');
|
|
32
|
+
var extension = require('./extension.js');
|
|
33
|
+
var _function = require('./function.js');
|
|
34
|
+
var functionLog = require('./function-log.js');
|
|
35
|
+
var http = require('./http.js');
|
|
36
|
+
var locale = require('./locale.js');
|
|
37
|
+
var organization = require('./organization.js');
|
|
38
|
+
var organizationInvitation = require('./organization-invitation.js');
|
|
39
|
+
var organizationMembership = require('./organization-membership.js');
|
|
40
|
+
var oauthApplication = require('./oauth-application.js');
|
|
41
|
+
var personalAccessToken = require('./personal-access-token.js');
|
|
42
|
+
var previewApiKey = require('./preview-api-key.js');
|
|
43
|
+
var release = require('./release.js');
|
|
44
|
+
var releaseAction = require('./release-action.js');
|
|
45
|
+
var resource = require('./resource.js');
|
|
46
|
+
var resourceProvider = require('./resource-provider.js');
|
|
47
|
+
var resourceType = require('./resource-type.js');
|
|
48
|
+
var role = require('./role.js');
|
|
49
|
+
var scheduledAction = require('./scheduled-action.js');
|
|
50
|
+
var snapshot = require('./snapshot.js');
|
|
51
|
+
var space = require('./space.js');
|
|
52
|
+
var spaceMember = require('./space-member.js');
|
|
53
|
+
var spaceMembership = require('./space-membership.js');
|
|
54
|
+
var tag = require('./tag.js');
|
|
55
|
+
var task = require('./task.js');
|
|
56
|
+
var team = require('./team.js');
|
|
57
|
+
var teamMembership = require('./team-membership.js');
|
|
58
|
+
var teamSpaceMembership = require('./team-space-membership.js');
|
|
59
|
+
var uiConfig = require('./ui-config.js');
|
|
60
|
+
var upload = require('./upload.js');
|
|
61
|
+
var uploadCredentials = require('./upload-credentials.js');
|
|
62
|
+
var usage = require('./usage.js');
|
|
63
|
+
var user = require('./user.js');
|
|
64
|
+
var userUiConfig = require('./user-ui-config.js');
|
|
65
|
+
var webhook = require('./webhook.js');
|
|
66
|
+
var workflow = require('./workflow.js');
|
|
67
|
+
var workflowDefinition = require('./workflow-definition.js');
|
|
68
|
+
var workflowsChangelog = require('./workflows-changelog.js');
|
|
69
|
+
|
|
70
|
+
var endpoints = {
|
|
71
|
+
AiAction: aiAction,
|
|
72
|
+
AiActionInvocation: aiActionInvocation,
|
|
73
|
+
ApiKey: apiKey,
|
|
74
|
+
AppAction: appAction,
|
|
75
|
+
AppActionCall: appActionCall,
|
|
76
|
+
AppBundle: appBundle,
|
|
77
|
+
AppDefinition: appDefinition,
|
|
78
|
+
AppInstallation: appInstallation,
|
|
79
|
+
AppUpload: appUpload,
|
|
80
|
+
AppSignedRequest: appSignedRequest,
|
|
81
|
+
AppSigningSecret: appSigningSecret,
|
|
82
|
+
AppEventSubscription: appEventSubscription,
|
|
83
|
+
AppKey: appKey,
|
|
84
|
+
AppAccessToken: appAccessToken,
|
|
85
|
+
AppDetails: appDetails,
|
|
86
|
+
Asset: asset,
|
|
87
|
+
AssetKey: assetKey,
|
|
88
|
+
BulkAction: bulkAction,
|
|
89
|
+
Comment: comment,
|
|
90
|
+
Concept: concept,
|
|
91
|
+
ConceptScheme: conceptScheme,
|
|
92
|
+
ContentType: contentType,
|
|
93
|
+
EditorInterface: editorInterface,
|
|
94
|
+
Entry: entry,
|
|
95
|
+
Environment: environment,
|
|
96
|
+
EnvironmentAlias: environmentAlias,
|
|
97
|
+
EnvironmentTemplate: environmentTemplate,
|
|
98
|
+
EnvironmentTemplateInstallation: environmentTemplateInstallation,
|
|
99
|
+
Extension: extension,
|
|
100
|
+
Function: _function,
|
|
101
|
+
FunctionLog: functionLog,
|
|
102
|
+
Http: http,
|
|
103
|
+
Locale: locale,
|
|
104
|
+
Organization: organization,
|
|
105
|
+
OrganizationInvitation: organizationInvitation,
|
|
106
|
+
OrganizationMembership: organizationMembership,
|
|
107
|
+
OAuthApplication: oauthApplication,
|
|
108
|
+
PersonalAccessToken: personalAccessToken,
|
|
109
|
+
AccessToken: accessToken,
|
|
110
|
+
PreviewApiKey: previewApiKey,
|
|
111
|
+
Release: release,
|
|
112
|
+
ReleaseAction: releaseAction,
|
|
113
|
+
Resource: resource,
|
|
114
|
+
ResourceProvider: resourceProvider,
|
|
115
|
+
ResourceType: resourceType,
|
|
116
|
+
Role: role,
|
|
117
|
+
ScheduledAction: scheduledAction,
|
|
118
|
+
Snapshot: snapshot,
|
|
119
|
+
Space: space,
|
|
120
|
+
SpaceMember: spaceMember,
|
|
121
|
+
SpaceMembership: spaceMembership,
|
|
122
|
+
Tag: tag,
|
|
123
|
+
Task: task,
|
|
124
|
+
Team: team,
|
|
125
|
+
TeamMembership: teamMembership,
|
|
126
|
+
TeamSpaceMembership: teamSpaceMembership,
|
|
127
|
+
UIConfig: uiConfig,
|
|
128
|
+
Upload: upload,
|
|
129
|
+
UploadCredential: uploadCredentials,
|
|
130
|
+
Usage: usage,
|
|
131
|
+
User: user,
|
|
132
|
+
UserUIConfig: userUiConfig,
|
|
133
|
+
Webhook: webhook,
|
|
134
|
+
WorkflowDefinition: workflowDefinition,
|
|
135
|
+
Workflow: workflow,
|
|
136
|
+
WorkflowsChangelog: workflowsChangelog,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
module.exports = endpoints;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var copy = require('fast-copy');
|
|
4
|
+
var raw = require('./raw.js');
|
|
5
|
+
var utils = require('./utils.js');
|
|
6
|
+
|
|
7
|
+
const get = (http, params) => {
|
|
8
|
+
return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/locales/${params.localeId}`);
|
|
9
|
+
};
|
|
10
|
+
const getMany = (http, params) => {
|
|
11
|
+
return raw.get(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/locales`, {
|
|
12
|
+
params: utils.normalizeSelect(params.query),
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const create = (http, params, data, headers) => {
|
|
16
|
+
return raw.post(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/locales`, data, {
|
|
17
|
+
headers,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const update = (http, params, rawData, headers) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const data = copy(rawData);
|
|
23
|
+
delete data.sys;
|
|
24
|
+
delete data.default; // we should not send this back
|
|
25
|
+
return raw.put(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/locales/${params.localeId}`, data, {
|
|
26
|
+
headers: Object.assign(Object.assign({}, headers), { 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }),
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const del = (http, params) => {
|
|
30
|
+
return raw.del(http, `/spaces/${params.spaceId}/environments/${params.environmentId}/locales/${params.localeId}`);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.create = create;
|
|
34
|
+
exports.del = del;
|
|
35
|
+
exports.get = get;
|
|
36
|
+
exports.getMany = getMany;
|
|
37
|
+
exports.update = update;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves details of a specific OAuth application. by its unique user ID and oauth application ID.
|
|
7
|
+
*
|
|
8
|
+
* @param {AxiosInstance} http - An Axios HTTP client instance.
|
|
9
|
+
* @param {Object} params - Parameters for the request.
|
|
10
|
+
* @param {string} params.userId - The unique user ID of the user.
|
|
11
|
+
* @param {string} params.oauthApplicationId - The unique application ID of the OAuth application.
|
|
12
|
+
* @returns {Promise<OAuthApplicationProps>} A Promise that resolves with the retrieved OAuth Application.
|
|
13
|
+
* @example ```javascript
|
|
14
|
+
* const contentful = require('contentful-management')
|
|
15
|
+
*
|
|
16
|
+
* const plainClient = contentful.createClient(
|
|
17
|
+
* {
|
|
18
|
+
* accessToken: '<content_management_api_key>'
|
|
19
|
+
* },
|
|
20
|
+
* { type: 'plain' }
|
|
21
|
+
* )
|
|
22
|
+
* plainClient.get({userId: 'TestUserId', oauthApplicationId: 'TestOAuthAppId'})
|
|
23
|
+
* .then(oauthApplication => console.log(oauthApplication))
|
|
24
|
+
* .catch(console.error)
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
const get = (http, params) => {
|
|
28
|
+
return raw.get(http, `/users/${params.userId}/oauth_applications/${params.oauthApplicationId}`);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves a list of OAuth applications associated with the current user.
|
|
32
|
+
*
|
|
33
|
+
* @param {AxiosInstance} http - An Axios HTTP client instance.
|
|
34
|
+
* @param {Object} params - Parameters for the request.
|
|
35
|
+
* @param {string} params.userId - The unique user ID of the user.
|
|
36
|
+
* @param {QueryParams} params - Query parameters to filter and customize the request.
|
|
37
|
+
* @returns {Promise<CursorPaginatedCollectionProp<OAuthApplicationProps>>} A Promise that resolves with a collection of oauth application properties.
|
|
38
|
+
* @example ```javascript
|
|
39
|
+
* const contentful = require('contentful-management')
|
|
40
|
+
*
|
|
41
|
+
* const plainClient = contentful.createClient(
|
|
42
|
+
* {
|
|
43
|
+
* accessToken: '<content_management_api_key>'
|
|
44
|
+
* },
|
|
45
|
+
* { type: 'plain' }
|
|
46
|
+
* )
|
|
47
|
+
* plainClient.getManyForUser({userId: 'TestUserId'})
|
|
48
|
+
* .then(result => console.log(result.items))
|
|
49
|
+
* .catch(console.error)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
const getManyForUser = (http, params) => {
|
|
53
|
+
return raw.get(http, `/users/${params.userId}/oauth_applications`, {
|
|
54
|
+
params: params.query,
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new OAuth application for current authenticated user.
|
|
59
|
+
*
|
|
60
|
+
* @param {AxiosInstance} http - Axios instance for making the HTTP request.
|
|
61
|
+
* @param {Object} params - Parameters for the request.
|
|
62
|
+
* @param {string} params.userId - The unique user ID of the user.
|
|
63
|
+
* @param {RawAxiosRequestHeaders} [headers] - Optional HTTP headers for the request.
|
|
64
|
+
* @returns {Promise<OAuthApplicationProps>} A Promise that resolves with the created oauth application.
|
|
65
|
+
* @example ```javascript
|
|
66
|
+
* const contentful = require('contentful-management')
|
|
67
|
+
*
|
|
68
|
+
* const plainClient = contentful.createClient(
|
|
69
|
+
* {
|
|
70
|
+
* accessToken: '<content_management_api_key>',
|
|
71
|
+
* },
|
|
72
|
+
* { type: 'plain' }
|
|
73
|
+
* )
|
|
74
|
+
* plainClient.create(
|
|
75
|
+
* {userId: 'TestUserId'},
|
|
76
|
+
* {name: 'Test-Name', description: 'Test-Desc', scopes: ['content_management_manage'], redirectUri: 'https://redirect.uri.com', confidential: true}
|
|
77
|
+
* )
|
|
78
|
+
* .then(oauthApplication => console.log(oauthApplication))
|
|
79
|
+
* .catch(console.error)
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
const create = (http, params, rawData, headers) => {
|
|
83
|
+
return raw.post(http, `/users/${params.userId}/oauth_applications`, rawData, {
|
|
84
|
+
headers,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Updates details of a specific OAuth application.
|
|
89
|
+
*
|
|
90
|
+
* @param {AxiosInstance} http - The Axios HTTP client instance.
|
|
91
|
+
* @param {Object} params - The parameters for updating oauth application.
|
|
92
|
+
* @param {string} params.userId - The unique user ID of the user.
|
|
93
|
+
* @param {string} params.oauthApplicationId - The unique application ID of the OAuth application.
|
|
94
|
+
* @returns {Promise<OAuthApplicationProps>} A Promise that resolves with the updated oauth application.
|
|
95
|
+
* @example ```javascript
|
|
96
|
+
* const contentful = require('contentful-management')
|
|
97
|
+
*
|
|
98
|
+
* const plainClient = contentful.createClient(
|
|
99
|
+
* {
|
|
100
|
+
* accessToken: '<content_management_api_key>'
|
|
101
|
+
* },
|
|
102
|
+
* { type: 'plain' }
|
|
103
|
+
* )
|
|
104
|
+
* plainClient.update(
|
|
105
|
+
* {userId: 'TestUserId', oauthApplicationId: 'TestOAuthAppId'},
|
|
106
|
+
* {name: 'Test-Name', description: 'Test-Desc', scope: ['content_management_manage'], redirectUri: 'https://redirect.uri.com', confidential: true}
|
|
107
|
+
* )
|
|
108
|
+
* .then(oauthApplication => console.log(oauthApplication))
|
|
109
|
+
* .catch(console.error)
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
const update = (http, params, rawData, headers) => {
|
|
113
|
+
return raw.put(http, `/users/${params.userId}/oauth_applications/${params.oauthApplicationId}`, rawData, {
|
|
114
|
+
headers,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Deletes a specific OAuth application.
|
|
119
|
+
*
|
|
120
|
+
* @param {AxiosInstance} http - The Axios HTTP client instance.
|
|
121
|
+
* @param {Object} params - The parameters for deleting oauth application.
|
|
122
|
+
* @param {string} params.userId - The unique user ID of the user.
|
|
123
|
+
* @param {string} params.oauthApplicationId - The unique application ID of the OAuth application.
|
|
124
|
+
* @returns {Promise<void>}
|
|
125
|
+
* @example ```javascript
|
|
126
|
+
* const contentful = require('contentful-management')
|
|
127
|
+
*
|
|
128
|
+
* const plainClient = contentful.createClient(
|
|
129
|
+
* {
|
|
130
|
+
* accessToken: '<content_management_api_key>'
|
|
131
|
+
* },
|
|
132
|
+
* { type: 'plain' }
|
|
133
|
+
* )
|
|
134
|
+
* plainClient.del({userId: 'TestUserId', oauthApplicationId: 'TestOAuthAppId'}) })
|
|
135
|
+
* .then(result => console.log(result.items))
|
|
136
|
+
* .catch(console.error)
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
const del = (http, params) => {
|
|
140
|
+
return raw.del(http, `/users/${params.userId}/oauth_applications/${params.oauthApplicationId}`);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
exports.create = create;
|
|
144
|
+
exports.del = del;
|
|
145
|
+
exports.get = get;
|
|
146
|
+
exports.getManyForUser = getManyForUser;
|
|
147
|
+
exports.update = update;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
const OrganizationUserManagementAlphaHeaders = {
|
|
6
|
+
'x-contentful-enable-alpha-feature': 'organization-user-management-api',
|
|
7
|
+
};
|
|
8
|
+
const InvitationAlphaHeaders = {
|
|
9
|
+
'x-contentful-enable-alpha-feature': 'pending-org-membership',
|
|
10
|
+
};
|
|
11
|
+
const create = (http, params, data, headers) => {
|
|
12
|
+
return raw.post(http, `/organizations/${params.organizationId}/invitations`, data, {
|
|
13
|
+
headers: Object.assign(Object.assign({}, InvitationAlphaHeaders), headers),
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const get = (http, params, headers) => {
|
|
17
|
+
return raw.get(http, `/organizations/${params.organizationId}/invitations/${params.invitationId}`, {
|
|
18
|
+
headers: Object.assign(Object.assign({}, OrganizationUserManagementAlphaHeaders), headers),
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.create = create;
|
|
23
|
+
exports.get = get;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var copy = require('fast-copy');
|
|
4
|
+
var raw = require('./raw.js');
|
|
5
|
+
|
|
6
|
+
const getBaseUrl = (params) => `/organizations/${params.organizationId}/organization_memberships`;
|
|
7
|
+
const getEntityUrl = (params) => `${getBaseUrl(params)}/${params.organizationMembershipId}`;
|
|
8
|
+
const get = (http, params) => {
|
|
9
|
+
return raw.get(http, getEntityUrl(params));
|
|
10
|
+
};
|
|
11
|
+
const getMany = (http, params) => {
|
|
12
|
+
return raw.get(http, getBaseUrl(params), {
|
|
13
|
+
params: params.query,
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const update = (http, params, rawData, headers) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const data = copy(rawData);
|
|
19
|
+
delete data.sys;
|
|
20
|
+
const { role } = data;
|
|
21
|
+
return raw.put(http, getEntityUrl(params), { role }, {
|
|
22
|
+
headers: Object.assign(Object.assign({}, headers), { 'X-Contentful-Version': (_a = rawData.sys.version) !== null && _a !== void 0 ? _a : 0 }),
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const del = (http, params) => {
|
|
26
|
+
return raw.del(http, getEntityUrl(params));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.del = del;
|
|
30
|
+
exports.get = get;
|
|
31
|
+
exports.getMany = getMany;
|
|
32
|
+
exports.update = update;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
const getMany = (http, params) => {
|
|
6
|
+
return raw.get(http, `/organizations`, {
|
|
7
|
+
params: params === null || params === void 0 ? void 0 : params.query,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const get = (http, params) => {
|
|
11
|
+
return getMany(http, { query: { limit: 100 } }).then((data) => {
|
|
12
|
+
const org = data.items.find((org) => org.sys.id === params.organizationId);
|
|
13
|
+
if (!org) {
|
|
14
|
+
const error = new Error(`No organization was found with the ID ${params.organizationId} instead got ${JSON.stringify(data)}`);
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
error.status = 404;
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
error.statusText = 'Not Found';
|
|
21
|
+
return Promise.reject(error);
|
|
22
|
+
}
|
|
23
|
+
return org;
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.get = get;
|
|
28
|
+
exports.getMany = getMany;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var raw = require('./raw.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use `access-token.get` instead `personal-access-token.get`
|
|
7
|
+
*/
|
|
8
|
+
const get = (http, params) => {
|
|
9
|
+
return raw.get(http, `/users/me/access_tokens/${params.tokenId}`);
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated use `access-token.getMany` instead `personal-access-token.getMany`
|
|
13
|
+
*/
|
|
14
|
+
const getMany = (http, params) => {
|
|
15
|
+
return raw.get(http, '/users/me/access_tokens', {
|
|
16
|
+
params: params.query,
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated use `access-token.createPersonalAccessToken` instead. `personal-access-token.create`
|
|
21
|
+
*/
|
|
22
|
+
const create = (http, _params, rawData, headers) => {
|
|
23
|
+
return raw.post(http, '/users/me/access_tokens', rawData, {
|
|
24
|
+
headers,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated use `access-token.rovoke` instead. `personal-access-token.revoke`
|
|
29
|
+
*/
|
|
30
|
+
const revoke = (http, params) => {
|
|
31
|
+
return raw.put(http, `/users/me/access_tokens/${params.tokenId}/revoked`, null);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.create = create;
|
|
35
|
+
exports.get = get;
|
|
36
|
+
exports.getMany = getMany;
|
|
37
|
+
exports.revoke = revoke;
|