@amityco/ts-sdk 7.27.2-9bed893.0 → 7.27.2-fb0fef3d.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/dist/@types/core/errors.d.ts +1 -2
- package/dist/@types/core/errors.d.ts.map +1 -1
- package/dist/@types/core/transport.d.ts +0 -1
- package/dist/@types/core/transport.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +0 -86
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/client/api/createClient.d.ts.map +1 -1
- package/dist/client/api/index.d.ts +0 -1
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/core/errors.d.ts +0 -20
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/transports/utils.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -228
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2 -227
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
- package/dist/client/api/getModuleSettings.d.ts +0 -25
- package/dist/client/api/getModuleSettings.d.ts.map +0 -1
- package/dist/client/api/tests/integration/moduleSettings.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/moduleSettings.integration.test.d.ts.map +0 -1
- package/dist/client/utils/parseModuleSettings.d.ts +0 -9
- package/dist/client/utils/parseModuleSettings.d.ts.map +0 -1
- package/dist/client/utils/resolveModuleAvailability.d.ts +0 -39
- package/dist/client/utils/resolveModuleAvailability.d.ts.map +0 -1
- package/dist/client/utils/tests/resolveModuleAvailability.test.d.ts +0 -2
- package/dist/client/utils/tests/resolveModuleAvailability.test.d.ts.map +0 -1
- package/dist/core/transports/tests/moduleNotEntitled.test.d.ts +0 -2
- package/dist/core/transports/tests/moduleNotEntitled.test.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { Client } from '@amityco/ts-sdk'
|
|
4
|
-
* const moduleSettings = await Client.getModuleSettings()
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
* Fetches the network's module entitlements: which modules the network was
|
|
8
|
-
* granted, whether core is enforcing those grants, and the catalog of all
|
|
9
|
-
* modules with their dependency chains.
|
|
10
|
-
*
|
|
11
|
-
* The payload is returned whole — `catalog` is the dependency table
|
|
12
|
-
* {@link resolveModuleAvailability} reads, and a client that cannot see it has
|
|
13
|
-
* to hardcode one.
|
|
14
|
-
*
|
|
15
|
-
* The read is **advisory**. It tells a host what to offer; under `enforce` the
|
|
16
|
-
* backend refuses a call to an unowned module regardless of what was resolved
|
|
17
|
-
* here, and that refusal arrives as `AmityModuleNotEntitledError`.
|
|
18
|
-
*
|
|
19
|
-
* @returns A Promise of {@link Amity.ModuleSettings} object
|
|
20
|
-
*
|
|
21
|
-
* @category Client API
|
|
22
|
-
* @async
|
|
23
|
-
*/
|
|
24
|
-
export declare const getModuleSettings: () => Promise<Amity.ModuleSettings>;
|
|
25
|
-
//# sourceMappingURL=getModuleSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getModuleSettings.d.ts","sourceRoot":"","sources":["../../../src/client/api/getModuleSettings.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,iBAAiB,QAAa,QAAQ,MAAM,cAAc,CAQtE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"moduleSettings.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/client/api/tests/integration/moduleSettings.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decodes `GET /api/v3/network-settings/modules`. Nothing is trimmed: the
|
|
3
|
-
* catalog is the dependency table callers resolve against, and a client that
|
|
4
|
-
* cannot see it has to hardcode one.
|
|
5
|
-
*
|
|
6
|
-
* @category private
|
|
7
|
-
*/
|
|
8
|
-
export declare const parseModuleSettings: (raw: Amity.RawModuleSettings) => Amity.ModuleSettings;
|
|
9
|
-
//# sourceMappingURL=parseModuleSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseModuleSettings.d.ts","sourceRoot":"","sources":["../../../src/client/utils/parseModuleSettings.ts"],"names":[],"mappings":"AAkDA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,iBAAiB,KAAG,MAAM,cAIvE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { Client, resolveModuleAvailability } from '@amityco/ts-sdk'
|
|
4
|
-
*
|
|
5
|
-
* const moduleSettings = await Client.getModuleSettings()
|
|
6
|
-
*
|
|
7
|
-
* if (resolveModuleAvailability(moduleSettings, 'live').isAvailable) {
|
|
8
|
-
* // offer the Live entry point
|
|
9
|
-
* }
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* Resolves whether one module is usable on this network.
|
|
13
|
-
*
|
|
14
|
-
* Availability is a function of all three fields of
|
|
15
|
-
* {@link Amity.ModuleSettings} — the enforcement mode, the module's own grant,
|
|
16
|
-
* and its prerequisite chain — combined in that order. Reading `modules`
|
|
17
|
-
* directly contradicts the mode: staging answers `mode: 'off'` with
|
|
18
|
-
* `modules: {}`, and every module still works.
|
|
19
|
-
*
|
|
20
|
-
* The dependency table comes from the payload's `catalog`, never from a
|
|
21
|
-
* hardcoded copy, so a chain the backend changes takes effect without an SDK
|
|
22
|
-
* release.
|
|
23
|
-
*
|
|
24
|
-
* The SDK does not hold the settings — the caller keeps what it fetched and
|
|
25
|
-
* resolves against it. With no settings at all (a fetch that never succeeded)
|
|
26
|
-
* the caller reads that as every module available: under `enforce` the backend
|
|
27
|
-
* refuses the calls anyway, so the exposure is a screen that offers too much,
|
|
28
|
-
* not one that withholds what a customer paid for.
|
|
29
|
-
*
|
|
30
|
-
* @param moduleSettings The network's module settings
|
|
31
|
-
* @param moduleKey The module to resolve — an {@link Amity.ModuleKey}, so the
|
|
32
|
-
* 15 keys this build knows complete and type-check while a catalog entry it
|
|
33
|
-
* does not know still resolves.
|
|
34
|
-
* @returns An {@link Amity.ModuleAvailability} answer
|
|
35
|
-
*
|
|
36
|
-
* @category Client API
|
|
37
|
-
*/
|
|
38
|
-
export declare const resolveModuleAvailability: (moduleSettings: Amity.ModuleSettings, moduleKey: Amity.ModuleKey, seen?: Set<Amity.ModuleKey>) => Amity.ModuleAvailability;
|
|
39
|
-
//# sourceMappingURL=resolveModuleAvailability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModuleAvailability.d.ts","sourceRoot":"","sources":["../../../src/client/utils/resolveModuleAvailability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,yBAAyB,mBACpB,MAAM,cAAc,aACzB,MAAM,SAAS,SACpB,IAAI,MAAM,SAAS,CAAC,KACzB,MAAM,kBAuDR,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModuleAvailability.test.d.ts","sourceRoot":"","sources":["../../../../src/client/utils/tests/resolveModuleAvailability.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"moduleNotEntitled.test.d.ts","sourceRoot":"","sources":["../../../../src/core/transports/tests/moduleNotEntitled.test.ts"],"names":[],"mappings":""}
|