Skip to content

Commit e20ed43

Browse files
authored
Merge branch 'main' into feat/sale-price-display
2 parents 011456a + f9ce4e6 commit e20ed43

File tree

90 files changed

+24522
-1535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+24522
-1535
lines changed

packages/sdks/accounts/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @epcc-sdk/sdks-accounts
22

3+
## 0.0.3
4+
5+
### Patch Changes
6+
7+
- d3d3c11: Update to match latest specs
8+
39
## 0.0.2
410

511
### Patch Changes

packages/sdks/accounts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@epcc-sdk/sdks-accounts",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {

packages/sdks/accounts/src/client/types.gen.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export type MetaListResults = {
3131
total?: number
3232
}
3333

34+
/**
35+
* The unique identifier for the Account Member that authenticated. This is useful if `account_member_self_management` is enabled in [Account Authentication Settings](/docs/api/accounts/get-v-2-settings-account-authentication), so that the user can update details for their account.
36+
*/
37+
export type MetaAccountMemberId = string
38+
3439
export type MetaList = {
3540
page?: MetaListPage
3641
results?: MetaListResults
@@ -105,7 +110,7 @@ export type AccountResponse = Account &
105110
}
106111

107112
/**
108-
* Whether a user with [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) can update their own account member details. By default, this is disabled. Set to `update_only` if you want the user to update their own account member details. The user can update their own account member details by updating [User Authentication Info](/docs/authentication/single-sign-on/user-authentication-info-api/overview) and [User Authentication Password Profile Info](/docs/authentication/single-sign-on/user-authentication-password-profiles-api/password-profile-overview).
113+
* Whether a user with an [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) can update their own account member details. By default, this is `disabled`. Set to `update_only` if you want the user to be able to update their own account member details (e.g., name, email, and if applicable their username and password). The user can update their own account member details by updating their [User Authentication Info](/docs/authentication/single-sign-on/user-authentication-info-api/update-a-user-authentication-info) using the `account_member_id` retrieved from the `meta` in the response of [Generating an Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) as the `id` and find the authentication credentials to update by calling the [Get All User Authentication Password Profile Info](/docs/authentication/single-sign-on/user-authentication-password-profiles-api/get-all-user-authentication-password-profile-info) endpoint.
109114
*/
110115
export type AccountMemberSelfManagement = "disabled" | "update_only"
111116

@@ -123,7 +128,7 @@ export type AccountAuthenticationSettings = {
123128
*/
124129
auto_create_account_for_account_members?: boolean
125130
/**
126-
* Whether a user with [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) can update their own account member details. By default, this is disabled. Set to `update_only` if you want the user to update their own account member details. The user can update their own account member details by updating [User Authentication Info](/docs/authentication/single-sign-on/user-authentication-info-api/overview) and [User Authentication Password Profile Info](/docs/authentication/single-sign-on/user-authentication-password-profiles-api/password-profile-overview).
131+
* Whether a user with an [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) can update their own account member details. By default, this is `disabled`. Set to `update_only` if you want the user to be able to update their own account member details (e.g., name, email, and if applicable their username and password). The user can update their own account member details by updating their [User Authentication Info](/docs/authentication/single-sign-on/user-authentication-info-api/update-a-user-authentication-info) using the `account_member_id` retrieved from the `meta` in the response of [Generating an Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) as the `id` and find the authentication credentials to update by calling the [Get All User Authentication Password Profile Info](/docs/authentication/single-sign-on/user-authentication-password-profiles-api/get-all-user-authentication-password-profile-info) endpoint.
127132
*/
128133
account_member_self_management?: "disabled" | "update_only"
129134
/**
@@ -1438,7 +1443,9 @@ export type PostV2AccountMembersTokensResponses = {
14381443
*/
14391444
201: {
14401445
data?: Array<AccountManagementAuthenticationTokenResponse>
1441-
meta?: MetaList
1446+
meta?: MetaList & {
1447+
account_member_id?: MetaAccountMemberId
1448+
}
14421449
links?: {
14431450
/**
14441451
* Always the current page.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# @epcc-sdk/sdks-authentication-realms
2+
3+
## 0.0.1
4+
5+
### Patch Changes
6+
7+
- 77a4840: add authentication realms sdk
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
# @epcc-sdk/sdks-authentication-realms SDK
2+
3+
Below you’ll find instructions on how to install, set up, and use the client, along with a list of available operations.
4+
5+
## Features
6+
7+
- type-safe response data and errors
8+
- response data validation and transformation
9+
- access to the original request and response
10+
- granular request and response customization options
11+
- minimal learning curve thanks to extending the underlying technology
12+
13+
---
14+
15+
## Installation
16+
17+
```bash
18+
npm install @epcc-sdk/sdks-authentication-realms
19+
# or
20+
pnpm install @epcc-sdk/sdks-authentication-realms
21+
# or
22+
yarn add @epcc-sdk/sdks-authentication-realms
23+
```
24+
25+
---
26+
27+
## Client Usage
28+
29+
30+
Clients are responsible for sending the actual HTTP requests.
31+
32+
The Fetch client is built as a thin wrapper on top of Fetch API, extending its functionality. If you're already familiar with Fetch, configuring your client will feel like working directly with Fetch API.
33+
34+
You can configure the client in two ways:
35+
36+
- Configuring the internal `client` instance directly
37+
- Using the `createClient` function
38+
39+
**When using the operation function to make requests, by default the global client will be used unless another is provided.**
40+
41+
42+
### 1. Configure the internal `client` instance directly
43+
44+
This is the simpler approach. You can call the setConfig() method at the beginning of your application or anytime you need to update the client configuration. You can pass any Fetch API configuration option to setConfig(), and even your own Fetch implementation.
45+
46+
```ts
47+
import { client } from "@epcc-sdk/sdks-authentication-realms";
48+
49+
client.setConfig({
50+
// set default base url for requests
51+
baseUrl: 'https://euwest.api.elasticpath.com',
52+
53+
// set default headers for requests
54+
headers: {
55+
Authorization: 'Bearer YOUR_AUTH_TOKEN',
56+
},
57+
});
58+
```
59+
60+
The disadvantage of this approach is that your code may call the client instance before it's configured for the first time. Depending on your use case, you might need to use the second approach.
61+
62+
### 2. Using the `createClient` function
63+
64+
This is useful when you want to use a different instance of the client for different parts of your application or when you want to use different configurations for different parts of your application.
65+
66+
```ts
67+
import { createClient } from "@epcc-sdk/sdks-authentication-realms";
68+
69+
// Create the client with your API base URL.
70+
const client = createClient({
71+
// set default base url for requests
72+
baseUrl: "https://euwest.api.elasticpath.com",
73+
/**
74+
* Set default headers only for requests made by this client.
75+
*/
76+
headers: {
77+
"Custom-Header": 'My Value',
78+
},
79+
});
80+
```
81+
82+
You can also pass this instance to any SDK function through the client option. This will override the default instance from `import { client } from "@epcc-sdk/sdks-authentication-realms>".
83+
84+
```ts
85+
const response = await getPasswordProfileInfo({
86+
client: myClient,
87+
});
88+
```
89+
90+
### Direct configuration
91+
92+
Alternatively, you can pass the client configuration options to each SDK function. This is useful if you don't want to create a client instance for one-off use cases.
93+
94+
```ts
95+
const response = await getPasswordProfileInfo({
96+
baseUrl: 'https://example.com', // <-- override default configuration
97+
});
98+
```
99+
100+
## Interceptors (Middleware)
101+
102+
Interceptors (middleware) can be used to modify requests before they're sent or responses before they're returned to your application. They can be added with use and removed with eject. Below is an example request interceptor
103+
104+
```ts
105+
import { client } from "@epcc-sdk/sdks-authentication-realms";
106+
107+
// Supports async functions
108+
client.interceptors.request.use(async (request) => {
109+
// do something
110+
return request;
111+
});
112+
113+
client.interceptors.request.eject((request) => {
114+
// do something
115+
return request;
116+
});
117+
118+
```
119+
120+
and an example response interceptor
121+
122+
```ts
123+
import { client } from "@epcc-sdk/sdks-authentication-realms";
124+
125+
client.interceptors.response.use((response) => {
126+
// do something
127+
return response;
128+
});
129+
130+
client.interceptors.response.eject((response) => {
131+
// do something
132+
return response;
133+
});
134+
```
135+
136+
> **_Tip:_** To eject, you must provide a reference to the function that was passed to use().
137+
138+
## Authentication
139+
140+
We are working to provide helpers to handle auth easier for you but for now using an interceptor is the easiest method.
141+
142+
```ts
143+
import { client } from "@epcc-sdk/sdks-authentication-realms";
144+
145+
client.interceptors.request.use((request, options) => {
146+
request.headers.set('Authorization', 'Bearer MY_TOKEN');
147+
return request;
148+
});
149+
```
150+
151+
## Build URL
152+
153+
If you need to access the compiled URL, you can use the buildUrl() method. It's loosely typed by default to accept almost any value; in practice, you will want to pass a type hint.
154+
155+
```ts
156+
type FooData = {
157+
path: {
158+
fooId: number;
159+
};
160+
query?: {
161+
bar?: string;
162+
};
163+
url: '/foo/{fooId}';
164+
};
165+
166+
const url = client.buildUrl<FooData>({
167+
path: {
168+
fooId: 1,
169+
},
170+
query: {
171+
bar: 'baz',
172+
},
173+
url: '/foo/{fooId}',
174+
});
175+
console.log(url); // prints '/foo/1?bar=baz'
176+
```
177+
178+
179+
---
180+
181+
182+
183+
184+
185+
## Operation Usage
186+
The following examples demonstrate how to use the operation function to make requests.
187+
188+
```ts
189+
import { getPasswordProfileInfo } from "@epcc-sdk/sdks-authentication-realms";
190+
191+
const product = await getPasswordProfileInfo({
192+
// client: localClient, // optional if you have a client instance you want to use otherwise the global client will be used
193+
path: {
194+
...
195+
},
196+
query: {
197+
...
198+
},
199+
});
200+
```
201+
202+
---
203+
204+
205+
206+
## Available Operations
207+
208+
209+
210+
- **`getAllAuthenticationRealms`** (`GET /v2/authentication-realms`)
211+
212+
- **`getAuthenticationRealm`** (`GET /v2/authentication-realms/{realmId}`)
213+
214+
- **`updateAuthenticationRealm`** (`PUT /v2/authentication-realms/{realmId}`)
215+
216+
- **`getAllOidcProfiles`** (`GET /v2/authentication-realms/{realmId}/openid-connect-profiles`)
217+
218+
- **`createOidcProfile`** (`POST /v2/authentication-realms/{realmId}/openid-connect-profiles`)
219+
220+
- **`deleteOidcProfile`** (`DELETE /v2/authentication-realms/{realmId}/openid-connect-profiles/{oidcProfileId}`)
221+
222+
- **`getOidcProfile`** (`GET /v2/authentication-realms/{realmId}/openid-connect-profiles/{oidcProfileId}`)
223+
224+
- **`updateOidcProfile`** (`PUT /v2/authentication-realms/{realmId}/openid-connect-profiles/{oidcProfileId}`)
225+
226+
- **`getAllPasswordProfiles`** (`GET /v2/authentication-realms/{realmId}/password-profiles`)
227+
228+
- **`createPasswordProfile`** (`POST /v2/authentication-realms/{realmId}/password-profiles`)
229+
230+
- **`deletePasswordProfile`** (`DELETE /v2/authentication-realms/{realmId}/password-profiles/{passwordProfileId}`)
231+
232+
- **`getPasswordProfile`** (`GET /v2/authentication-realms/{realmId}/password-profiles/{passwordProfileId}`)
233+
234+
- **`updatePasswordProfile`** (`PUT /v2/authentication-realms/{realmId}/password-profiles/{passwordProfileId}`)
235+
236+
- **`createOneTimePasswordTokenRequest`** (`POST /v2/authentication-realms/{realmId}/password-profiles/one-time-password-token-request`)
237+
238+
- **`getAllUserAuthenticationInfo`** (`GET /v2/authentication-realms/{realmId}/user-authentication-info`)
239+
240+
- **`createUserAuthenticationInfo`** (`POST /v2/authentication-realms/{realmId}/user-authentication-info`)
241+
242+
- **`deleteUserAuthenticationInfo`** (`DELETE /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}`)
243+
244+
- **`getUserAuthenticationInfo`** (`GET /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}`)
245+
246+
- **`updateUserAuthenticationInfo`** (`PUT /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}`)
247+
248+
- **`getAllUserAuthenticationOidcProfileInfo`** (`GET /v2/authentication-realms/{realmId}/user-authentication-openid-connect-profile-info`)
249+
250+
- **`createUserAuthenticationOidcProfileInfo`** (`POST /v2/authentication-realms/{realmId}/user-authentication-openid-connect-profile-info`)
251+
252+
- **`deleteUserAuthenticationOidcProfileInfo`** (`DELETE /v2/authentication-realms/{realmId}/user-authentication-openid-connect-profile-info/{userAuthenticationOidcProfileInfoId}`)
253+
254+
- **`getUserAuthenticationOidcProfileInfo`** (`GET /v2/authentication-realms/{realmId}/user-authentication-openid-connect-profile-info/{userAuthenticationOidcProfileInfoId}`)
255+
256+
- **`updateUserAuthenticationOidcProfileInfo`** (`PUT /v2/authentication-realms/{realmId}/user-authentication-openid-connect-profile-info/{userAuthenticationOidcProfileInfoId}`)
257+
258+
- **`listPasswordProfileInfos`** (`GET /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}/user-authentication-password-profile-info`)
259+
260+
- **`createPasswordProfileInfo`** (`POST /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}/user-authentication-password-profile-info`)
261+
262+
- **`deletePasswordProfileInfo`** (`DELETE /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}/user-authentication-password-profile-info/{userAuthenticationPasswordProfileInfoId}`)
263+
264+
- **`getPasswordProfileInfo`** (`GET /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}/user-authentication-password-profile-info/{userAuthenticationPasswordProfileInfoId}`)
265+
266+
- **`updatePasswordProfileInfo`** (`PUT /v2/authentication-realms/{realmId}/user-authentication-info/{userAuthenticationInfoId}/user-authentication-password-profile-info/{userAuthenticationPasswordProfileInfoId}`)
267+
268+
269+
270+
---
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts"
2+
import { defineConfig as defineReadmeConfig } from "../specs/heyapi/plugins"
3+
4+
export default defineConfig({
5+
client: "@hey-api/client-fetch",
6+
experimentalParser: true,
7+
input: "../specs/authentication-realms.yaml",
8+
output: { path: "src/client", format: "prettier" },
9+
plugins: [
10+
...defaultPlugins,
11+
{
12+
exportInlineEnums: true,
13+
name: "@hey-api/typescript",
14+
},
15+
{
16+
dates: true,
17+
name: "@hey-api/transformers",
18+
},
19+
defineReadmeConfig({
20+
name: "generate-readme",
21+
targetOperation: "getPasswordProfileInfo",
22+
}),
23+
],
24+
})

0 commit comments

Comments
 (0)