@or-sdk/identifiers 0.27.11-beta.4281.0 → 0.28.1-beta.4282.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/CHANGELOG.md +9 -0
- package/README.md +58 -2
- package/package.json +22 -14
- package/src/__tests__/identifiers.spec.ts +2 -2
- package/src/identifiers.ts +3 -3
- package/tsconfig.build.json +0 -9
- package/tsconfig.dev.json +0 -7
- package/tsconfig.esm.json +0 -11
- package/tsconfig.json +0 -6
- package/tsconfig.types.json +0 -10
- package/vitest.config.mjs +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.28.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/identifiers@0.27.10...@or-sdk/identifiers@0.28.0) (2026-08-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **packages:** add package descriptions and published files metadata ([801f823](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/801f823034717ef8b961405a73d51ebc2ec07649))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [0.27.10](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/identifiers@0.27.5...@or-sdk/identifiers@0.27.10) (2026-08-04)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @or-sdk/identifiers
|
package/README.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# `@or-sdk/identifiers`
|
|
2
|
+
|
|
3
|
+
OneReach SDK client for Identifiers.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Use this package when integrating with the Identifiers capability on the OneReach platform.
|
|
8
|
+
- Use its typed client and exported models instead of hand-writing requests to that service.
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- Do not use it for a different platform capability; choose the dedicated `@or-sdk/*` package instead.
|
|
13
|
+
- Do not use it for generic third-party HTTP calls.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
2
16
|
```
|
|
3
17
|
$ npm i @or-sdk/identifiers
|
|
4
18
|
```
|
|
5
19
|
|
|
6
|
-
## Usage
|
|
20
|
+
## Usage
|
|
7
21
|
```typescript
|
|
8
22
|
import { Identifiers } from '@or-sdk/identifiers'
|
|
9
23
|
|
|
@@ -19,3 +33,45 @@ const identifiers = new Identifiers({
|
|
|
19
33
|
discoveryUrl: 'http://example.discovery/endpoint'
|
|
20
34
|
});
|
|
21
35
|
```
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
- Prefer `sdkUrl` when the service URL is known; it avoids a discovery request.
|
|
40
|
+
- Use `discoveryUrl` only when the service URL is not available.
|
|
41
|
+
- Provide `token` as a bearer-token string or getter where supported.
|
|
42
|
+
|
|
43
|
+
## Common pitfalls
|
|
44
|
+
|
|
45
|
+
- Keep the client token current when it can expire; a token getter is preferable where the constructor accepts one.
|
|
46
|
+
- Treat the generated TypeScript types as the authoritative contract for optional parameters and response shapes.
|
|
47
|
+
|
|
48
|
+
## Method map
|
|
49
|
+
|
|
50
|
+
| Method | Purpose |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `init(...)` | See the exported TypeScript signature for parameters and result. |
|
|
53
|
+
| `listIdentifiers(...)` | See the exported TypeScript signature for parameters and result. |
|
|
54
|
+
| `listIdentifierGroups(...)` | See the exported TypeScript signature for parameters and result. |
|
|
55
|
+
| `getIdentifier(...)` | See the exported TypeScript signature for parameters and result. |
|
|
56
|
+
| `getIdentifierGroup(...)` | See the exported TypeScript signature for parameters and result. |
|
|
57
|
+
| `listObtainableIdentifiers(...)` | See the exported TypeScript signature for parameters and result. |
|
|
58
|
+
| `releaseIdentifier(...)` | See the exported TypeScript signature for parameters and result. |
|
|
59
|
+
| `buyIdentifier(...)` | See the exported TypeScript signature for parameters and result. |
|
|
60
|
+
| `createProvider(...)` | See the exported TypeScript signature for parameters and result. |
|
|
61
|
+
| `listProviders(...)` | See the exported TypeScript signature for parameters and result. |
|
|
62
|
+
| `deleteProvider(...)` | See the exported TypeScript signature for parameters and result. |
|
|
63
|
+
|
|
64
|
+
## More detail
|
|
65
|
+
|
|
66
|
+
Full signatures and exported types are available in `src/` and `dist/types/`.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Additional API reference
|
|
70
|
+
|
|
71
|
+
Methods below were missing from the package guide. Signatures and return types are taken directly from the exported source API.
|
|
72
|
+
|
|
73
|
+
### `Identifiers`
|
|
74
|
+
|
|
75
|
+
| Method | Returns | Purpose |
|
|
76
|
+
|---|---|---|
|
|
77
|
+
| `listIdentifiersTriggers(identifiers: List<SingleIdentifier>)` | `Promise<List<IdentifierTrigger>>` | Load list of identifier gateway triggers by identifier list. |
|
package/package.json
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/identifiers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.1-beta.4282.0",
|
|
4
|
+
"description": "OneReach SDK client for Identifiers",
|
|
4
5
|
"license": "Apache-2.0",
|
|
5
6
|
"main": "dist/cjs/index.js",
|
|
6
7
|
"module": "dist/esm/index.js",
|
|
7
8
|
"types": "dist/types/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@or-sdk/base": "^0.44.8-beta.4282.0",
|
|
17
|
+
"@or-sdk/sdk-api": "^0.30.1-beta.4282.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"concurrently": "^9.2.0",
|
|
21
|
+
"typescript": "^5.6.2",
|
|
22
|
+
"vitest": "^4.1.10"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
8
27
|
"scripts": {
|
|
9
|
-
"build": "
|
|
28
|
+
"build": "concurrently 'pnpm:build:*(!watch)'",
|
|
10
29
|
"build:cjs": "tsc --project tsconfig.json",
|
|
11
30
|
"build:esm": "tsc --project tsconfig.esm.json",
|
|
12
31
|
"build:types": "tsc --project tsconfig.types.json",
|
|
@@ -19,16 +38,5 @@
|
|
|
19
38
|
"dev": "pnpm build:watch:esm",
|
|
20
39
|
"test": "vitest --run",
|
|
21
40
|
"test:watch": "vitest --watch"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@or-sdk/base": "^0.44.7",
|
|
25
|
-
"@or-sdk/sdk-api": "^0.29.6-beta.4281.0"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"concurrently": "9.0.1",
|
|
29
|
-
"typescript": "5.6.2"
|
|
30
|
-
},
|
|
31
|
-
"publishConfig": {
|
|
32
|
-
"access": "public"
|
|
33
41
|
}
|
|
34
|
-
}
|
|
42
|
+
}
|
|
@@ -32,7 +32,7 @@ describe('identifiers.Identifiers', () => {
|
|
|
32
32
|
} catch (error) {
|
|
33
33
|
const e = error as TokenIsMissedError;
|
|
34
34
|
expect(e.message).toBe(
|
|
35
|
-
new TokenIsMissedError().message
|
|
35
|
+
new TokenIsMissedError().message,
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -64,7 +64,7 @@ describe('identifiers.Identifiers', () => {
|
|
|
64
64
|
} catch (error) {
|
|
65
65
|
const e = error as SdkUrlOrDiscoveryUrlIsMissedError;
|
|
66
66
|
expect(e.message).toBe(
|
|
67
|
-
new SdkUrlOrDiscoveryUrlIsMissedError().message
|
|
67
|
+
new SdkUrlOrDiscoveryUrlIsMissedError().message,
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
});
|
package/src/identifiers.ts
CHANGED
|
@@ -166,7 +166,7 @@ export class Identifiers {
|
|
|
166
166
|
* @return List<ObtainableIdentifier>
|
|
167
167
|
*/
|
|
168
168
|
public async listObtainableIdentifiers(
|
|
169
|
-
params: ObtainableIdentifierRequestParams = {}
|
|
169
|
+
params: ObtainableIdentifierRequestParams = {},
|
|
170
170
|
): Promise<List<ObtainableIdentifier>> {
|
|
171
171
|
const result = await this._sdkApi.makeRequest<ObtainableIdentifier[]>({
|
|
172
172
|
method: 'GET',
|
|
@@ -209,7 +209,7 @@ export class Identifiers {
|
|
|
209
209
|
* ```
|
|
210
210
|
*/
|
|
211
211
|
public async buyIdentifier(
|
|
212
|
-
identifiers: ObtainableIdentifier | ObtainableIdentifier[]
|
|
212
|
+
identifiers: ObtainableIdentifier | ObtainableIdentifier[],
|
|
213
213
|
): Promise<BuyIdentifierResponse> {
|
|
214
214
|
const data = {
|
|
215
215
|
identifiers: Array.isArray(identifiers) ? identifiers : [identifiers],
|
|
@@ -236,7 +236,7 @@ export class Identifiers {
|
|
|
236
236
|
*/
|
|
237
237
|
public async createProvider(
|
|
238
238
|
provider: IdentifierProvider['name'],
|
|
239
|
-
settings: IdentifierProvider['settings'] = {}
|
|
239
|
+
settings: IdentifierProvider['settings'] = {},
|
|
240
240
|
): Promise<void> {
|
|
241
241
|
const data = {
|
|
242
242
|
provider,
|
package/tsconfig.build.json
DELETED
package/tsconfig.dev.json
DELETED
package/tsconfig.esm.json
DELETED
package/tsconfig.json
DELETED
package/tsconfig.types.json
DELETED
package/vitest.config.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
reporters: ['junit', 'default'],
|
|
6
|
-
outputFile: 'test-results/junit.xml',
|
|
7
|
-
include: ['src/**/*.{test,spec}.ts'],
|
|
8
|
-
exclude: ['dist/**'],
|
|
9
|
-
coverage: {
|
|
10
|
-
reporter: ['text', 'json', 'html', 'cobertura', 'text-summary'],
|
|
11
|
-
clean: true,
|
|
12
|
-
include: [
|
|
13
|
-
'src/**',
|
|
14
|
-
],
|
|
15
|
-
exclude: [
|
|
16
|
-
'src/types.ts',
|
|
17
|
-
'**/*.spec.ts',
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
globals: true,
|
|
21
|
-
environment: 'node',
|
|
22
|
-
clearMocks: true,
|
|
23
|
-
watch: false,
|
|
24
|
-
},
|
|
25
|
-
});
|