@cinerino/sdk 5.0.0-alpha.0 → 5.0.0-alpha.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/example/src/chevre/searchEvents.ts +12 -10
- package/example/src/chevre/searchTransactions.ts +3 -2
- package/example/src/chevre/transaction/processPlaceOrder.ts +6 -4
- package/lib/abstract/chevre.d.ts +40 -20
- package/lib/abstract/chevre.js +294 -342
- package/lib/abstract/chevreAdmin.d.ts +108 -56
- package/lib/abstract/chevreAdmin.js +876 -1062
- package/lib/abstract/chevreTxn.d.ts +18 -9
- package/lib/abstract/chevreTxn.js +107 -111
- package/lib/abstract/index.d.ts +3 -6
- package/lib/abstract/index.js +23 -7
- package/lib/bundle.js +1333 -1555
- package/package.json +1 -1
|
@@ -18,34 +18,36 @@ async function main() {
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
startTime = process.hrtime();
|
|
21
|
-
let chevre = await client.loadChevre(
|
|
21
|
+
let chevre = await client.loadChevre({
|
|
22
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
23
|
+
auth: authClient
|
|
24
|
+
});
|
|
22
25
|
diff = process.hrtime(startTime);
|
|
23
26
|
console.log(`laoding chevre took ${diff[0]} seconds and ${diff[1]} nanoseconds.`);
|
|
24
27
|
|
|
25
28
|
startTime = process.hrtime();
|
|
26
|
-
chevre = await client.loadChevre(
|
|
29
|
+
chevre = await client.loadChevre({
|
|
30
|
+
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
31
|
+
auth: authClient
|
|
32
|
+
});
|
|
27
33
|
diff = process.hrtime(startTime);
|
|
28
34
|
console.log(`laoding chevre took ${diff[0]} seconds and ${diff[1]} nanoseconds.`);
|
|
29
35
|
|
|
30
36
|
startTime = process.hrtime();
|
|
31
|
-
let eventService = await chevre.
|
|
32
|
-
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
33
|
-
auth: authClient,
|
|
37
|
+
let eventService = await chevre.createEventInstance({
|
|
34
38
|
project: { id: PROJECT_ID },
|
|
35
39
|
seller: { id: '' }
|
|
36
40
|
});
|
|
37
41
|
diff = process.hrtime(startTime);
|
|
38
|
-
console.log(`creating service
|
|
42
|
+
console.log(`creating service instance took ${diff[0]} seconds and ${diff[1]} nanoseconds.`);
|
|
39
43
|
|
|
40
44
|
startTime = process.hrtime();
|
|
41
|
-
eventService = await chevre.
|
|
42
|
-
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
43
|
-
auth: authClient,
|
|
45
|
+
eventService = await chevre.createEventInstance({
|
|
44
46
|
project: { id: PROJECT_ID },
|
|
45
47
|
seller: { id: '' }
|
|
46
48
|
});
|
|
47
49
|
diff = process.hrtime(startTime);
|
|
48
|
-
console.log(`creating service
|
|
50
|
+
console.log(`creating service instance took ${diff[0]} seconds and ${diff[1]} nanoseconds.`);
|
|
49
51
|
|
|
50
52
|
const result = await eventService.search({
|
|
51
53
|
page: 1,
|
|
@@ -12,9 +12,10 @@ async function main() {
|
|
|
12
12
|
state: ''
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
const transactionService = await (await client.loadChevreAdmin(
|
|
15
|
+
const transactionService = await (await client.loadChevreAdmin({
|
|
16
16
|
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
17
|
-
auth: authClient
|
|
17
|
+
auth: authClient
|
|
18
|
+
})).createAssetTransactionInstance({
|
|
18
19
|
project,
|
|
19
20
|
seller: { id: '' }
|
|
20
21
|
});
|
|
@@ -23,14 +23,16 @@ async function main() {
|
|
|
23
23
|
const loginTicket = authClient.verifyIdToken({});
|
|
24
24
|
console.log('username is', loginTicket.getUsername());
|
|
25
25
|
|
|
26
|
-
const sellerService = await (await client.loadChevre(
|
|
26
|
+
const sellerService = await (await client.loadChevre({
|
|
27
27
|
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
28
|
-
auth: authClient
|
|
28
|
+
auth: authClient
|
|
29
|
+
})).createSellerInstance({
|
|
29
30
|
project
|
|
30
31
|
});
|
|
31
|
-
const placeOrderService = await (await client.loadChevreTxn(
|
|
32
|
+
const placeOrderService = await (await client.loadChevreTxn({
|
|
32
33
|
endpoint: <string>process.env.CHEVRE_ENDPOINT,
|
|
33
|
-
auth: authClient
|
|
34
|
+
auth: authClient
|
|
35
|
+
})).createPlaceOrderTransactionInstance({
|
|
34
36
|
project,
|
|
35
37
|
seller: { id: '' }
|
|
36
38
|
});
|
package/lib/abstract/chevre.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* API Service Library for Javascript
|
|
3
|
-
*/
|
|
4
|
-
import type { IUnset as IUnsetOnService } from './service';
|
|
1
|
+
import { IAdditionalOptions, IOptions, IUnset as IUnsetOnService } from './service';
|
|
5
2
|
import type { PayAssetTransactionService } from './chevre/assetTransaction/pay';
|
|
6
3
|
import type { CategoryCodeService } from './chevre/categoryCode';
|
|
7
4
|
import type { CreativeWorkService } from './chevre/creativeWork';
|
|
@@ -25,56 +22,56 @@ export declare namespace service {
|
|
|
25
22
|
*/
|
|
26
23
|
type CategoryCode = CategoryCodeService;
|
|
27
24
|
namespace CategoryCode {
|
|
28
|
-
|
|
25
|
+
let svc: typeof CategoryCodeService | undefined;
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
31
28
|
* コンテンツサービス
|
|
32
29
|
*/
|
|
33
30
|
type CreativeWork = CreativeWorkService;
|
|
34
31
|
namespace CreativeWork {
|
|
35
|
-
|
|
32
|
+
let svc: typeof CreativeWorkService | undefined;
|
|
36
33
|
}
|
|
37
34
|
/**
|
|
38
35
|
* Eメールメッセージサービス
|
|
39
36
|
*/
|
|
40
37
|
type EmailMessage = EmailMessageService;
|
|
41
38
|
namespace EmailMessage {
|
|
42
|
-
|
|
39
|
+
let svc: typeof EmailMessageService | undefined;
|
|
43
40
|
}
|
|
44
41
|
/**
|
|
45
42
|
* イベントサービス
|
|
46
43
|
*/
|
|
47
44
|
type Event = EventService;
|
|
48
45
|
namespace Event {
|
|
49
|
-
|
|
46
|
+
let svc: typeof EventService | undefined;
|
|
50
47
|
}
|
|
51
48
|
/**
|
|
52
49
|
* 管理者サービス
|
|
53
50
|
*/
|
|
54
51
|
type Me = MeService;
|
|
55
52
|
namespace Me {
|
|
56
|
-
|
|
53
|
+
let svc: typeof MeService | undefined;
|
|
57
54
|
}
|
|
58
55
|
/**
|
|
59
56
|
* 注文サービス
|
|
60
57
|
*/
|
|
61
58
|
type Order = OrderService;
|
|
62
59
|
namespace Order {
|
|
63
|
-
|
|
60
|
+
let svc: typeof OrderService | undefined;
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
66
63
|
* 許可証サービス
|
|
67
64
|
*/
|
|
68
65
|
type Permit = PermitService;
|
|
69
66
|
namespace Permit {
|
|
70
|
-
|
|
67
|
+
let svc: typeof PermitService | undefined;
|
|
71
68
|
}
|
|
72
69
|
/**
|
|
73
70
|
* 会員サービス
|
|
74
71
|
*/
|
|
75
72
|
type Person = PersonService;
|
|
76
73
|
namespace Person {
|
|
77
|
-
|
|
74
|
+
let svc: typeof PersonService | undefined;
|
|
78
75
|
}
|
|
79
76
|
namespace person {
|
|
80
77
|
/**
|
|
@@ -82,7 +79,7 @@ export declare namespace service {
|
|
|
82
79
|
*/
|
|
83
80
|
type OwnershipInfo = PersonOwnershipInfoService;
|
|
84
81
|
namespace OwnershipInfo {
|
|
85
|
-
|
|
82
|
+
let svc: typeof PersonOwnershipInfoService | undefined;
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
85
|
/**
|
|
@@ -90,7 +87,7 @@ export declare namespace service {
|
|
|
90
87
|
*/
|
|
91
88
|
type Place = PlaceService;
|
|
92
89
|
namespace Place {
|
|
93
|
-
|
|
90
|
+
let svc: typeof PlaceService | undefined;
|
|
94
91
|
}
|
|
95
92
|
namespace place {
|
|
96
93
|
/**
|
|
@@ -98,7 +95,7 @@ export declare namespace service {
|
|
|
98
95
|
*/
|
|
99
96
|
type HasPOS = HasPOSService;
|
|
100
97
|
namespace HasPOS {
|
|
101
|
-
|
|
98
|
+
let svc: typeof HasPOSService | undefined;
|
|
102
99
|
}
|
|
103
100
|
}
|
|
104
101
|
/**
|
|
@@ -106,14 +103,14 @@ export declare namespace service {
|
|
|
106
103
|
*/
|
|
107
104
|
type Product = ProductService;
|
|
108
105
|
namespace Product {
|
|
109
|
-
|
|
106
|
+
let svc: typeof ProductService | undefined;
|
|
110
107
|
}
|
|
111
108
|
/**
|
|
112
109
|
* 販売者サービス
|
|
113
110
|
*/
|
|
114
111
|
type Seller = SellerService;
|
|
115
112
|
namespace Seller {
|
|
116
|
-
|
|
113
|
+
let svc: typeof SellerService | undefined;
|
|
117
114
|
}
|
|
118
115
|
namespace assetTransaction {
|
|
119
116
|
/**
|
|
@@ -121,7 +118,7 @@ export declare namespace service {
|
|
|
121
118
|
*/
|
|
122
119
|
type Pay = PayAssetTransactionService;
|
|
123
120
|
namespace Pay {
|
|
124
|
-
|
|
121
|
+
let svc: typeof PayAssetTransactionService | undefined;
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
124
|
/**
|
|
@@ -129,13 +126,36 @@ export declare namespace service {
|
|
|
129
126
|
*/
|
|
130
127
|
type Token = TokenService;
|
|
131
128
|
namespace Token {
|
|
132
|
-
|
|
129
|
+
let svc: typeof TokenService | undefined;
|
|
133
130
|
}
|
|
134
131
|
/**
|
|
135
132
|
* トリップサービス
|
|
136
133
|
*/
|
|
137
134
|
type Trip = TripService;
|
|
138
135
|
namespace Trip {
|
|
139
|
-
|
|
136
|
+
let svc: typeof TripService | undefined;
|
|
140
137
|
}
|
|
141
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* デフォルトサービス
|
|
141
|
+
*/
|
|
142
|
+
export declare class Chevre {
|
|
143
|
+
options: Pick<IOptions, 'auth' | 'endpoint'>;
|
|
144
|
+
constructor(options: Pick<IOptions, 'auth' | 'endpoint'>);
|
|
145
|
+
createCategoryCodeInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CategoryCodeService>;
|
|
146
|
+
createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
|
|
147
|
+
createEmailMessageInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EmailMessageService>;
|
|
148
|
+
createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
|
|
149
|
+
createMeInstance(): Promise<MeService>;
|
|
150
|
+
createOrderInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OrderService>;
|
|
151
|
+
createPersonInstance(params: Pick<IOptions, 'project'>): Promise<PersonService>;
|
|
152
|
+
createPermitInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PermitService>;
|
|
153
|
+
createPersonOwnershipInfoInstance(params: Pick<IOptions, 'project'>): Promise<PersonOwnershipInfoService>;
|
|
154
|
+
createPlaceInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PlaceService>;
|
|
155
|
+
createHasPOSInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<HasPOSService>;
|
|
156
|
+
createProductInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<ProductService>;
|
|
157
|
+
createSellerInstance(params: Pick<IOptions, 'project'>): Promise<SellerService>;
|
|
158
|
+
createPayAssetTransactionInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<PayAssetTransactionService>;
|
|
159
|
+
createTokenInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<TokenService>;
|
|
160
|
+
createTripInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<TripService>;
|
|
161
|
+
}
|