@or-sdk/identifiers 0.6.0 → 0.9.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/dist/cjs/Identifiers.js
CHANGED
|
@@ -72,18 +72,24 @@ var Identifiers = (function (_super) {
|
|
|
72
72
|
};
|
|
73
73
|
Identifiers.prototype.listIdentifiers = function (id) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
var params;
|
|
75
|
+
var params, result;
|
|
76
76
|
return __generator(this, function (_a) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
switch (_a.label) {
|
|
78
|
+
case 0:
|
|
79
|
+
params = {
|
|
80
|
+
fullInfo: true,
|
|
81
|
+
groupDetails: true,
|
|
82
|
+
identifier: id ? id : undefined,
|
|
83
|
+
};
|
|
84
|
+
return [4, this.callApi({
|
|
85
|
+
method: 'GET',
|
|
86
|
+
route: '/identifiers',
|
|
87
|
+
params: params,
|
|
88
|
+
})];
|
|
89
|
+
case 1:
|
|
90
|
+
result = _a.sent();
|
|
91
|
+
return [2, (0, base_1.makeList)(result)];
|
|
92
|
+
}
|
|
87
93
|
});
|
|
88
94
|
});
|
|
89
95
|
};
|
|
@@ -95,7 +101,7 @@ var Identifiers = (function (_super) {
|
|
|
95
101
|
case 0: return [4, this.listIdentifiers(id)];
|
|
96
102
|
case 1:
|
|
97
103
|
result = _a.sent();
|
|
98
|
-
return [2, result[0]];
|
|
104
|
+
return [2, result.rows[0]];
|
|
99
105
|
}
|
|
100
106
|
});
|
|
101
107
|
});
|
|
@@ -103,12 +109,18 @@ var Identifiers = (function (_super) {
|
|
|
103
109
|
Identifiers.prototype.listObtainableIdentifiers = function (params) {
|
|
104
110
|
if (params === void 0) { params = {}; }
|
|
105
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var result;
|
|
106
113
|
return __generator(this, function (_a) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
switch (_a.label) {
|
|
115
|
+
case 0: return [4, this.callApi({
|
|
116
|
+
method: 'GET',
|
|
117
|
+
route: '/obtainable-identifiers',
|
|
118
|
+
params: params,
|
|
119
|
+
})];
|
|
120
|
+
case 1:
|
|
121
|
+
result = _a.sent();
|
|
122
|
+
return [2, (0, base_1.makeList)(result)];
|
|
123
|
+
}
|
|
112
124
|
});
|
|
113
125
|
});
|
|
114
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Identifiers.js","sourceRoot":"","sources":["../../src/Identifiers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Identifiers.js","sourceRoot":"","sources":["../../src/Identifiers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAA8E;AAQ9E,yCAA0C;AAC1C,iCAA6D;AAS7D;IAAiC,+BAAI;IAOnC,qBAAY,MAAyB;QAArC,iBAQC;QAPS,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,YAAY,GAAK,MAAM,aAAX,CAAY;QAEvC,QAAA,kBAAM;YACJ,KAAK,OAAA;YACL,YAAY,cAAA;YACZ,UAAU,EAAE,uBAAW;SACxB,CAAC,SAAC;;IACL,CAAC;IAED,gCAAU,GAAV,UAAW,IAA8B;QACvC,OAAO,UAAG,IAAI,CAAC,GAAG,mBAAgB,CAAC;IACrC,CAAC;IAUY,qCAAe,GAA5B,UAA6B,EAAqB;;;;;;wBAC1C,MAAM,GAAG;4BACb,QAAQ,EAAE,IAAI;4BACd,YAAY,EAAE,IAAI;4BAClB,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE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BACrB,IAAI,MAAA;qBACL,CAAC,EAAC;;;KACJ;IAQY,oCAAc,GAA3B,UAA4B,QAAoC,EAAE,QAA6C;QAA7C,yBAAA,EAAA,aAA6C;;;;gBACvG,IAAI,GAAG;oBACX,QAAQ,UAAA;oBACR,QAAQ,UAAA;iBACT,CAAC;gBAEF,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,uBAAuB;wBAC9B,IAAI,MAAA;qBACL,CAAC,EAAC;;;KACJ;IAQY,mCAAa,GAA1B;;;;;4BACe,WAAM,IAAI,CAAC,OAAO,CAAwB;4BACrD,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,uBAAuB;yBAC/B,CAAC,EAAA;;wBAHI,IAAI,GAAG,SAGX;wBAEF,WAAO,IAAA,0CAAkC,EAAC,IAAI,CAAC,EAAC;;;;KACjD;IAQY,oCAAc,GAA3B,UAA4B,QAAoC;;;;gBACxD,MAAM,GAAG;oBACb,QAAQ,UAAA;iBACT,CAAC;gBAEF,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,QAAQ;wBAChB,KAAK,EAAE,uBAAuB;wBAC9B,MAAM,QAAA;qBACP,CAAC,EAAC;;;KACJ;IACH,kBAAC;AAAD,CAAC,AAvKD,CAAiC,WAAI,GAuKpC;AAvKY,kCAAW"}
|
package/dist/esm/Identifiers.js
CHANGED
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Base } from '@or-sdk/base';
|
|
10
|
+
import { Base, makeList } from '@or-sdk/base';
|
|
11
11
|
import { SERVICE_KEY } from './constants';
|
|
12
12
|
import { extractIdentifierProvidersResponse } from './utils';
|
|
13
13
|
export class Identifiers extends Base {
|
|
@@ -29,26 +29,28 @@ export class Identifiers extends Base {
|
|
|
29
29
|
groupDetails: true,
|
|
30
30
|
identifier: id ? id : undefined,
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
const result = yield this.callApi({
|
|
33
33
|
method: 'GET',
|
|
34
34
|
route: '/identifiers',
|
|
35
35
|
params,
|
|
36
36
|
});
|
|
37
|
+
return makeList(result);
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
getIdentifier(id) {
|
|
40
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
42
|
const result = yield this.listIdentifiers(id);
|
|
42
|
-
return result[0];
|
|
43
|
+
return result.rows[0];
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
listObtainableIdentifiers(params = {}) {
|
|
46
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
|
|
48
|
+
const result = yield this.callApi({
|
|
48
49
|
method: 'GET',
|
|
49
50
|
route: '/obtainable-identifiers',
|
|
50
51
|
params,
|
|
51
52
|
});
|
|
53
|
+
return makeList(result);
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
releaseIdentifier(id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Identifiers.js","sourceRoot":"","sources":["../../src/Identifiers.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"Identifiers.js","sourceRoot":"","sources":["../../src/Identifiers.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAkC,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQ9E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAS7D,MAAM,OAAO,WAAY,SAAQ,IAAI;IAOnC,YAAY,MAAyB;QACnC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QAEvC,KAAK,CAAC;YACJ,KAAK;YACL,YAAY;YACZ,UAA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C,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;aACtE,CAAC;YAEF,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,cAAc;gBACrB,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAQY,cAAc,CAAC,QAAoC,EAAE,WAA2C,EAAE;;YAC7G,MAAM,IAAI,GAAG;gBACX,QAAQ;gBACR,QAAQ;aACT,CAAC;YAEF,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,uBAAuB;gBAC9B,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAQY,aAAa;;YACxB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAwB;gBACrD,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,uBAAuB;aAC/B,CAAC,CAAC;YAEH,OAAO,kCAAkC,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC;KAAA;IAQY,cAAc,CAAC,QAAoC;;YAC9D,MAAM,MAAM,GAAG;gBACb,QAAQ;aACT,CAAC;YAEF,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,uBAAuB;gBAC9B,MAAM;aACP,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Base, ServiceDiscoveryResponse } from '@or-sdk/base';
|
|
1
|
+
import { Base, ServiceDiscoveryResponse, List } from '@or-sdk/base';
|
|
2
2
|
import { IdentifiersConfig, Identifier, ObtainableIdentifierRequestParams, ObtainableIdentifier, BuyIdentifierResponse, IdentifierProvider } from './types';
|
|
3
3
|
export declare class Identifiers extends Base {
|
|
4
4
|
constructor(params: IdentifiersConfig);
|
|
5
5
|
makeApiUrl(data: ServiceDiscoveryResponse): string;
|
|
6
|
-
listIdentifiers(id?: Identifier['id']): Promise<Identifier
|
|
6
|
+
listIdentifiers(id?: Identifier['id']): Promise<List<Identifier>>;
|
|
7
7
|
getIdentifier(id: Identifier['id']): Promise<Identifier>;
|
|
8
|
-
listObtainableIdentifiers(params?: ObtainableIdentifierRequestParams): Promise<ObtainableIdentifier
|
|
8
|
+
listObtainableIdentifiers(params?: ObtainableIdentifierRequestParams): Promise<List<ObtainableIdentifier>>;
|
|
9
9
|
releaseIdentifier(id: Identifier['id']): Promise<void>;
|
|
10
10
|
buyIdentifier(identifiers: ObtainableIdentifier | ObtainableIdentifier[]): Promise<BuyIdentifierResponse>;
|
|
11
11
|
createProvider(provider: IdentifierProvider['name'], settings?: IdentifierProvider['settings']): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.9.1",
|
|
3
3
|
"name": "@or-sdk/identifiers",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@or-sdk/base": "^0.
|
|
27
|
+
"@or-sdk/base": "^0.9.1",
|
|
28
28
|
"lodash": "^4.17.21"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "19c2221d6f95694979b32f51d729771a558ef189"
|
|
31
31
|
}
|
package/src/Identifiers.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Base, ServiceDiscoveryResponse } from '@or-sdk/base';
|
|
1
|
+
import { Base, ServiceDiscoveryResponse, List, makeList } from '@or-sdk/base';
|
|
2
2
|
import {
|
|
3
3
|
IdentifiersConfig,
|
|
4
4
|
Identifier,
|
|
@@ -45,18 +45,20 @@ export class Identifiers extends Base {
|
|
|
45
45
|
* const identifierList = await identifiers.listIdentifiers();
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
public async listIdentifiers(id?: Identifier['id']): Promise<Identifier
|
|
48
|
+
public async listIdentifiers(id?: Identifier['id']): Promise<List<Identifier>> {
|
|
49
49
|
const params = {
|
|
50
50
|
fullInfo: true,
|
|
51
51
|
groupDetails: true,
|
|
52
52
|
identifier: id ? id : undefined,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
const result = await this.callApi<Identifier[]>({
|
|
56
56
|
method: 'GET',
|
|
57
57
|
route: '/identifiers',
|
|
58
58
|
params,
|
|
59
59
|
});
|
|
60
|
+
|
|
61
|
+
return makeList<Identifier>(result);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
/**
|
|
@@ -68,7 +70,7 @@ export class Identifiers extends Base {
|
|
|
68
70
|
public async getIdentifier(id: Identifier['id']): Promise<Identifier> {
|
|
69
71
|
const result = await this.listIdentifiers(id);
|
|
70
72
|
|
|
71
|
-
return result[0];
|
|
73
|
+
return result.rows[0];
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
/**
|
|
@@ -84,12 +86,14 @@ export class Identifiers extends Base {
|
|
|
84
86
|
* });
|
|
85
87
|
* ```
|
|
86
88
|
*/
|
|
87
|
-
public async listObtainableIdentifiers(params: ObtainableIdentifierRequestParams = {}): Promise<ObtainableIdentifier
|
|
88
|
-
|
|
89
|
+
public async listObtainableIdentifiers(params: ObtainableIdentifierRequestParams = {}): Promise<List<ObtainableIdentifier>> {
|
|
90
|
+
const result = await this.callApi<ObtainableIdentifier[]>({
|
|
89
91
|
method: 'GET',
|
|
90
92
|
route: '/obtainable-identifiers',
|
|
91
93
|
params,
|
|
92
94
|
});
|
|
95
|
+
|
|
96
|
+
return makeList<ObtainableIdentifier>(result);
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
/**
|