import { BaseClient, ClientConfig, Response } from "@commerce-apps/core";
import type { CommonParameters } from "@commerce-apps/core";
import type { OperationOptions } from "retry";
import type { RequestInit } from "node-fetch";
import type { CompositeParameters, CustomRequestBody, QueryParameters, RequireParametersUnlessAllAreOptional } from "../../types";
import type { SearchRequest, SourceCodeGroup, SourceCodeGroupSearchResult } from '../models/index';
/**
* [Source Code Groups](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=source-code-groups:Summary)
* ==================================
*
* *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/source-code-groups/source-code-groups-oas-v1-public.yaml)
# API Overview
APIs that support the creation, update, deletions and search of source code groups.
## Authentication & Authorization
The client requesting the source code information must have access to the Source Code resource. For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request. The client must first authenticate against Account Manager to log in.
You must include the relevant scope(s) in the client ID used to generate the token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)
For detailed setup instructions, see [Authorization for Admin APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html).*
*
* For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html
* Example with admin auth
*
* ```typescript
* import { SourceCodeGroups, ClientConfig } from "commerce-sdk";
* // or
* const { SourceCodeGroups, ClientConfig } = require("commerce-sdk");
*
* const clientConfig: ClientConfig = {
* parameters: {
* clientId: "XXXXXX",
* organizationId: "XXXX",
* shortCode: "XXX",
* siteId: "XX"
* }
* };
*
* token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' };
*
* clientConfig.headers['authorization'] = `Bearer ${token.access_token}`;
* const sourceCodeGroupsClient = new SourceCodeGroups(clientConfig);
* ```
*
*
* API Version: 1.4.4
* Last Updated:
*
*
*/
export declare class SourceCodeGroups extends BaseClient {
constructor(config: ClientConfig);
/**
*
*
* If you would like to get a raw Response object use the other createSourceCodeGroup function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type SourceCodeGroup.
*/
createSourceCodeGroup(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SourceCodeGroup & CustomRequestBody;
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type SourceCodeGroup otherwise.
*/
createSourceCodeGroup(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SourceCodeGroup & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other deleteSourceCodeGroup function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type void.
*/
deleteSourceCodeGroup(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
deleteSourceCodeGroup(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other getSourceCodeGroup function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type SourceCodeGroup.
*/
getSourceCodeGroup(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type SourceCodeGroup otherwise.
*/
getSourceCodeGroup(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
*
The following query attributes can be used to narrow the search:
| Attribute | Type |
|-----------|--------|
| id| String |
| description | String |
| sourceCode | String |
| startTime | DateTime |
| endTime | DateTime |
| creationDate | DateTime |
| enabled | Boolean |
| active | Boolean |
The sourceCode and active fields can only be used in queries as conjunctions (using AND). If the field is used in a disjunction
(OR), an exception is thrown.
The query output can also be sorted with the following attributes:
| Attribute | Type |
|-----------|--------|
| id| String |
| description | String |
| enabled | Boolean |
| creationDate | DateTime |
*
* If you would like to get a raw Response object use the other sourceCodeGroupsSearch function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type SourceCodeGroupSearchResult.
*/
sourceCodeGroupsSearch(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SearchRequest & CustomRequestBody;
}>): Promise;
/**
*
The following query attributes can be used to narrow the search:
| Attribute | Type |
|-----------|--------|
| id| String |
| description | String |
| sourceCode | String |
| startTime | DateTime |
| endTime | DateTime |
| creationDate | DateTime |
| enabled | Boolean |
| active | Boolean |
The sourceCode and active fields can only be used in queries as conjunctions (using AND). If the field is used in a disjunction
(OR), an exception is thrown.
The query output can also be sorted with the following attributes:
| Attribute | Type |
|-----------|--------|
| id| String |
| description | String |
| enabled | Boolean |
| creationDate | DateTime |
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type SourceCodeGroupSearchResult otherwise.
*/
sourceCodeGroupsSearch(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SearchRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
*
*
* If you would like to get a raw Response object use the other updateSourceCodeGroup function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type SourceCodeGroup.
*/
updateSourceCodeGroup(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SourceCodeGroup & CustomRequestBody;
}>): Promise;
/**
*
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
* @param options.parameters.id - The ID of the source code group
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type SourceCodeGroup otherwise.
*/
updateSourceCodeGroup(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
id: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: SourceCodeGroup & CustomRequestBody;
}>, rawResponse?: T): Promise;
}