@accelbyte/sdk 0.1.1-alpha.59 → 0.2.0-beta.1
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/CHANGELOG.md +22 -0
- package/dist/index.browser.es.js +804 -354
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.d.ts +10161 -10905
- package/dist/index.node.es.js +804 -354
- package/dist/index.node.es.js.map +1 -1
- package/dist/index.node.js +836 -363
- package/dist/index.node.js.map +1 -1
- package/examples/next/package.json +1 -1
- package/examples/next/pages/index.tsx +15 -14
- package/examples/next/yarn.lock +14 -14
- package/examples/node/index.mjs +13 -12
- package/examples/node/package.json +1 -1
- package/examples/node/yarn.lock +14 -14
- package/examples/vite/package.json +1 -1
- package/examples/vite/src/Sdk.ts +12 -12
- package/examples/vite/yarn.lock +14 -14
- package/package.json +1 -1
- package/examples/next/.env.example +0 -7
- package/examples/node/.env.example +0 -7
- package/examples/vite/.env.example +0 -5
|
@@ -9,22 +9,17 @@ import Head from 'next/head'
|
|
|
9
9
|
import Image from 'next/image'
|
|
10
10
|
import styles from '../styles/Home.module.css'
|
|
11
11
|
|
|
12
|
-
import { Accelbyte, CurrencyInfo, DiscoveryConfigData,
|
|
12
|
+
import { Accelbyte, CurrencyInfo, DiscoveryConfigData, ItemPagingSlicedResult, NamespaceInfo } from '@accelbyte/sdk'
|
|
13
13
|
|
|
14
14
|
const SDK_CONFIG = {
|
|
15
|
-
baseURL:
|
|
16
|
-
clientId:
|
|
17
|
-
namespace:
|
|
18
|
-
redirectURI:
|
|
15
|
+
baseURL: 'https://demo.accelbyte.io',
|
|
16
|
+
clientId: '77f88506b6174c3ea4d925f5b4096ce8',
|
|
17
|
+
namespace: 'accelbyte',
|
|
18
|
+
redirectURI: 'http://localhost:3030'
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const sdk = Accelbyte.SDK({
|
|
22
|
-
options: SDK_CONFIG
|
|
23
|
-
config: {
|
|
24
|
-
headers: {
|
|
25
|
-
Authorization: `Bearer ${process.env.NEXT_SDK_ACCESS_TOKEN}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
22
|
+
options: SDK_CONFIG
|
|
28
23
|
})
|
|
29
24
|
|
|
30
25
|
interface TestSdkReturnType {
|
|
@@ -43,8 +38,14 @@ export const getServerSideProps: GetServerSideProps<{ data: TestSdkReturnType }>
|
|
|
43
38
|
sdk.Platform.Item().fetchItemsByCriteria({}),
|
|
44
39
|
|
|
45
40
|
// These require authentication and we can't use it right away.
|
|
46
|
-
// Ensure that you have
|
|
47
|
-
sdk.Basic.Namespace(
|
|
41
|
+
// Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
|
|
42
|
+
sdk.Basic.Namespace({
|
|
43
|
+
config: {
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: `Bearer <replace-this-with-access-token>`
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}).getNamespaces()
|
|
48
49
|
])
|
|
49
50
|
|
|
50
51
|
return {
|
|
@@ -54,7 +55,7 @@ export const getServerSideProps: GetServerSideProps<{ data: TestSdkReturnType }>
|
|
|
54
55
|
listDiscoveryConfigs: listDiscoveryConfigs.response?.data,
|
|
55
56
|
listOfCurrencies: listOfCurrencies.response?.data,
|
|
56
57
|
listOfItems: listOfItems.response?.data,
|
|
57
|
-
listOfNamespaces: listOfNamespaces.response?.data
|
|
58
|
+
listOfNamespaces: listOfNamespaces.response?.data || null
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
}
|
package/examples/next/yarn.lock
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
# yarn lockfile v1
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
"@accelbyte/sdk@0.1.1-alpha.
|
|
6
|
-
version "0.1.1-alpha.
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.
|
|
8
|
-
integrity sha512-
|
|
5
|
+
"@accelbyte/sdk@0.1.1-alpha.62":
|
|
6
|
+
version "0.1.1-alpha.62"
|
|
7
|
+
resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.62.tgz#418b615631c31ebea4218b3e2e552ef09540e60f"
|
|
8
|
+
integrity sha512-2z/syFPI/3Z/RTUC0XGIaGkzKaWz5LCtjqtOWRml88Tb/vx40n/CeMdXGlR6MFZMjp7xoqJzW+smmrve94Wrbg==
|
|
9
9
|
dependencies:
|
|
10
10
|
axios "0.27.2"
|
|
11
11
|
buffer "6.0.3"
|
|
12
12
|
crypto-js "4.1.1"
|
|
13
13
|
lodash-core "4.17.19"
|
|
14
|
-
nanoid "3.1.
|
|
14
|
+
nanoid "3.1.31"
|
|
15
15
|
platform "1.3.6"
|
|
16
16
|
query-string "7.1.1"
|
|
17
17
|
uuid "8.3.2"
|
|
18
|
-
validator "
|
|
18
|
+
validator "13.7.0"
|
|
19
19
|
zod "3.17.3"
|
|
20
20
|
|
|
21
21
|
"@next/env@13.0.7":
|
|
@@ -247,10 +247,10 @@ mime-types@^2.1.12:
|
|
|
247
247
|
dependencies:
|
|
248
248
|
mime-db "1.52.0"
|
|
249
249
|
|
|
250
|
-
nanoid@3.1.
|
|
251
|
-
version "3.1.
|
|
252
|
-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.
|
|
253
|
-
integrity sha512-
|
|
250
|
+
nanoid@3.1.31:
|
|
251
|
+
version "3.1.31"
|
|
252
|
+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.31.tgz#f5b58a1ce1b7604da5f0605757840598d8974dc6"
|
|
253
|
+
integrity sha512-ZivnJm0o9bb13p2Ot5CpgC2rQdzB9Uxm/mFZweqm5eMViqOJe3PV6LU2E30SiLgheesmcPrjquqraoolONSA0A==
|
|
254
254
|
|
|
255
255
|
nanoid@^3.3.4:
|
|
256
256
|
version "3.3.4"
|
|
@@ -370,10 +370,10 @@ uuid@8.3.2:
|
|
|
370
370
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
|
371
371
|
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
|
372
372
|
|
|
373
|
-
validator@
|
|
374
|
-
version "
|
|
375
|
-
resolved "https://registry.yarnpkg.com/validator/-/validator-
|
|
376
|
-
integrity sha512-
|
|
373
|
+
validator@13.7.0:
|
|
374
|
+
version "13.7.0"
|
|
375
|
+
resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857"
|
|
376
|
+
integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==
|
|
377
377
|
|
|
378
378
|
zod@3.17.3:
|
|
379
379
|
version "3.17.3"
|
package/examples/node/index.mjs
CHANGED
|
@@ -5,19 +5,14 @@ import { config } from 'dotenv'
|
|
|
5
5
|
config()
|
|
6
6
|
|
|
7
7
|
const SDK_CONFIG = {
|
|
8
|
-
baseURL:
|
|
9
|
-
clientId:
|
|
10
|
-
namespace:
|
|
11
|
-
redirectURI:
|
|
8
|
+
baseURL: 'https://demo.accelbyte.io',
|
|
9
|
+
clientId: '77f88506b6174c3ea4d925f5b4096ce8',
|
|
10
|
+
namespace: 'accelbyte',
|
|
11
|
+
redirectURI: 'http://localhost:3030'
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const sdk = Accelbyte.SDK({
|
|
15
|
-
options: SDK_CONFIG
|
|
16
|
-
config: {
|
|
17
|
-
headers: {
|
|
18
|
-
Authorization: `Bearer ${process.env.SDK_ACCESS_TOKEN}`
|
|
19
|
-
}
|
|
20
|
-
}
|
|
15
|
+
options: SDK_CONFIG
|
|
21
16
|
})
|
|
22
17
|
|
|
23
18
|
// Sample SDK calls:
|
|
@@ -43,8 +38,14 @@ async function main() {
|
|
|
43
38
|
console.info(JSON.stringify(listOfItems))
|
|
44
39
|
|
|
45
40
|
// These require authentication and we can't use it right away.
|
|
46
|
-
// Ensure that you have
|
|
47
|
-
const listOfNamespaces =
|
|
41
|
+
// Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
|
|
42
|
+
const listOfNamespaces = sdk.Basic.Namespace({
|
|
43
|
+
config: {
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: `Bearer <replace-this-with-access-token>`
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}).getNamespaces()
|
|
48
49
|
|
|
49
50
|
console.info('List of namespaces:')
|
|
50
51
|
console.info(JSON.stringify(listOfNamespaces))
|
package/examples/node/yarn.lock
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
# yarn lockfile v1
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
"@accelbyte/sdk@0.1.1-alpha.
|
|
6
|
-
version "0.1.1-alpha.
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.
|
|
8
|
-
integrity sha512-
|
|
5
|
+
"@accelbyte/sdk@0.1.1-alpha.62":
|
|
6
|
+
version "0.1.1-alpha.62"
|
|
7
|
+
resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.62.tgz#418b615631c31ebea4218b3e2e552ef09540e60f"
|
|
8
|
+
integrity sha512-2z/syFPI/3Z/RTUC0XGIaGkzKaWz5LCtjqtOWRml88Tb/vx40n/CeMdXGlR6MFZMjp7xoqJzW+smmrve94Wrbg==
|
|
9
9
|
dependencies:
|
|
10
10
|
axios "0.27.2"
|
|
11
11
|
buffer "6.0.3"
|
|
12
12
|
crypto-js "4.1.1"
|
|
13
13
|
lodash-core "4.17.19"
|
|
14
|
-
nanoid "3.1.
|
|
14
|
+
nanoid "3.1.31"
|
|
15
15
|
platform "1.3.6"
|
|
16
16
|
query-string "7.1.1"
|
|
17
17
|
uuid "8.3.2"
|
|
18
|
-
validator "
|
|
18
|
+
validator "13.7.0"
|
|
19
19
|
zod "3.17.3"
|
|
20
20
|
|
|
21
21
|
asynckit@^0.4.0:
|
|
@@ -112,10 +112,10 @@ mime-types@^2.1.12:
|
|
|
112
112
|
dependencies:
|
|
113
113
|
mime-db "1.52.0"
|
|
114
114
|
|
|
115
|
-
nanoid@3.1.
|
|
116
|
-
version "3.1.
|
|
117
|
-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.
|
|
118
|
-
integrity sha512-
|
|
115
|
+
nanoid@3.1.31:
|
|
116
|
+
version "3.1.31"
|
|
117
|
+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.31.tgz#f5b58a1ce1b7604da5f0605757840598d8974dc6"
|
|
118
|
+
integrity sha512-ZivnJm0o9bb13p2Ot5CpgC2rQdzB9Uxm/mFZweqm5eMViqOJe3PV6LU2E30SiLgheesmcPrjquqraoolONSA0A==
|
|
119
119
|
|
|
120
120
|
platform@1.3.6:
|
|
121
121
|
version "1.3.6"
|
|
@@ -147,10 +147,10 @@ uuid@8.3.2:
|
|
|
147
147
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
|
148
148
|
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
|
149
149
|
|
|
150
|
-
validator@
|
|
151
|
-
version "
|
|
152
|
-
resolved "https://registry.yarnpkg.com/validator/-/validator-
|
|
153
|
-
integrity sha512-
|
|
150
|
+
validator@13.7.0:
|
|
151
|
+
version "13.7.0"
|
|
152
|
+
resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857"
|
|
153
|
+
integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==
|
|
154
154
|
|
|
155
155
|
zod@3.17.3:
|
|
156
156
|
version "3.17.3"
|
package/examples/vite/src/Sdk.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
import { Accelbyte } from '@accelbyte/sdk'
|
|
3
2
|
|
|
4
3
|
const SDK_CONFIG = {
|
|
5
4
|
baseURL: '/api',
|
|
6
|
-
clientId:
|
|
7
|
-
namespace:
|
|
8
|
-
redirectURI:
|
|
5
|
+
clientId: '77f88506b6174c3ea4d925f5b4096ce8',
|
|
6
|
+
namespace: 'accelbyte',
|
|
7
|
+
redirectURI: 'http://localhost:3030'
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
const sdk = Accelbyte.SDK({
|
|
12
|
-
options: SDK_CONFIG
|
|
13
|
-
config: {
|
|
14
|
-
headers: {
|
|
15
|
-
Authorization: `Bearer ${import.meta.env.VITE_SDK_ACCESS_TOKEN}`
|
|
16
|
-
}
|
|
17
|
-
}
|
|
11
|
+
options: SDK_CONFIG
|
|
18
12
|
})
|
|
19
13
|
|
|
20
14
|
export async function getSdkTestValues() {
|
|
@@ -25,8 +19,14 @@ export async function getSdkTestValues() {
|
|
|
25
19
|
sdk.Platform.Item().fetchItemsByCriteria({}),
|
|
26
20
|
|
|
27
21
|
// These require authentication and we can't use it right away.
|
|
28
|
-
// Ensure that you have
|
|
29
|
-
sdk.Basic.Namespace(
|
|
22
|
+
// Ensure that you have logged in (have cookies) or pass the access token to the `Authorization` header.
|
|
23
|
+
sdk.Basic.Namespace({
|
|
24
|
+
config: {
|
|
25
|
+
headers: {
|
|
26
|
+
Authorization: `Bearer <replace-this-with-access-token>`
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}).getNamespaces()
|
|
30
30
|
])
|
|
31
31
|
|
|
32
32
|
return {
|
package/examples/vite/yarn.lock
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
# yarn lockfile v1
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
"@accelbyte/sdk@0.1.1-alpha.
|
|
6
|
-
version "0.1.1-alpha.
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.
|
|
8
|
-
integrity sha512-
|
|
5
|
+
"@accelbyte/sdk@0.1.1-alpha.62":
|
|
6
|
+
version "0.1.1-alpha.62"
|
|
7
|
+
resolved "https://registry.yarnpkg.com/@accelbyte/sdk/-/sdk-0.1.1-alpha.62.tgz#418b615631c31ebea4218b3e2e552ef09540e60f"
|
|
8
|
+
integrity sha512-2z/syFPI/3Z/RTUC0XGIaGkzKaWz5LCtjqtOWRml88Tb/vx40n/CeMdXGlR6MFZMjp7xoqJzW+smmrve94Wrbg==
|
|
9
9
|
dependencies:
|
|
10
10
|
axios "0.27.2"
|
|
11
11
|
buffer "6.0.3"
|
|
12
12
|
crypto-js "4.1.1"
|
|
13
13
|
lodash-core "4.17.19"
|
|
14
|
-
nanoid "3.1.
|
|
14
|
+
nanoid "3.1.31"
|
|
15
15
|
platform "1.3.6"
|
|
16
16
|
query-string "7.1.1"
|
|
17
17
|
uuid "8.3.2"
|
|
18
|
-
validator "
|
|
18
|
+
validator "13.7.0"
|
|
19
19
|
zod "3.17.3"
|
|
20
20
|
|
|
21
21
|
"@ampproject/remapping@^2.1.0":
|
|
@@ -681,10 +681,10 @@ ms@2.1.2:
|
|
|
681
681
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
|
682
682
|
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
|
683
683
|
|
|
684
|
-
nanoid@3.1.
|
|
685
|
-
version "3.1.
|
|
686
|
-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.
|
|
687
|
-
integrity sha512-
|
|
684
|
+
nanoid@3.1.31:
|
|
685
|
+
version "3.1.31"
|
|
686
|
+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.31.tgz#f5b58a1ce1b7604da5f0605757840598d8974dc6"
|
|
687
|
+
integrity sha512-ZivnJm0o9bb13p2Ot5CpgC2rQdzB9Uxm/mFZweqm5eMViqOJe3PV6LU2E30SiLgheesmcPrjquqraoolONSA0A==
|
|
688
688
|
|
|
689
689
|
nanoid@^3.3.4:
|
|
690
690
|
version "3.3.4"
|
|
@@ -828,10 +828,10 @@ uuid@8.3.2:
|
|
|
828
828
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
|
829
829
|
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
|
830
830
|
|
|
831
|
-
validator@
|
|
832
|
-
version "
|
|
833
|
-
resolved "https://registry.yarnpkg.com/validator/-/validator-
|
|
834
|
-
integrity sha512-
|
|
831
|
+
validator@13.7.0:
|
|
832
|
+
version "13.7.0"
|
|
833
|
+
resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857"
|
|
834
|
+
integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==
|
|
835
835
|
|
|
836
836
|
vite@^4.0.0:
|
|
837
837
|
version "4.0.2"
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# To use this file, copy this as `.env` file, then replace the values.
|
|
2
|
-
|
|
3
|
-
NEXT_SDK_BASE_URL=${NEXT_SDK_BASE_URL}
|
|
4
|
-
NEXT_SDK_REDIRECT_URI=${NEXT_SDK_REDIRECT_URI}
|
|
5
|
-
NEXT_SDK_CLIENT_ID=${NEXT_SDK_CLIENT_ID}
|
|
6
|
-
NEXT_SDK_NAMESPACE=${NEXT_SDK_NAMESPACE}
|
|
7
|
-
NEXT_SDK_ACCESS_TOKEN=${NEXT_SDK_ACCESS_TOKEN}
|