@cinerino/sdk 16.4.0-alpha.16 → 16.4.0-alpha.17

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.
@@ -1,6 +1,9 @@
1
1
  import { factory } from '../factory';
2
- import { ISearchResult, Service } from '../service';
2
+ import { Service } from '../service';
3
3
  export type IAction<T extends factory.actionType> = factory.action.IAction<factory.action.IAttributes<T, any, any>>;
4
+ type IFindParams = Pick<factory.action.ISearchConditions, 'about' | 'actionStatus' | 'actionStatusTypes' | 'agent' | 'id' | 'instrument' | 'limit' | 'location' | 'object' | 'page' | 'purpose' | 'result' | 'sameAs' | 'sort' | 'startFrom' | 'startThrough'> & {
5
+ typeOf?: Exclude<factory.actionType, factory.actionType.AddAction | factory.actionType.ReplaceAction | factory.actionType.UpdateAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction>;
6
+ };
4
7
  /**
5
8
  * アクションサービス
6
9
  */
@@ -8,16 +11,14 @@ export declare class ActionService extends Service {
8
11
  /**
9
12
  * アクション検索
10
13
  */
11
- findActions<T extends factory.actionType>(params: Omit<factory.action.ISearchConditions, 'typeOf'> & {
12
- typeOf?: Exclude<factory.actionType, factory.actionType.AddAction | factory.actionType.ReplaceAction | factory.actionType.UpdateAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction>;
13
- }): Promise<ISearchResult<IAction<T>[]>>;
14
- findById<T extends factory.actionType>(params: {
15
- id: string;
16
- typeOf: T;
17
- }): Promise<IAction<T>>;
18
- searchRecipes(params: {
14
+ adminFindAnyActions<T extends factory.actionType>(params: IFindParams): Promise<IAction<T>[]>;
15
+ /**
16
+ * アクションのレシピ参照
17
+ */
18
+ findRecipesByActionId(params: {
19
19
  recipeFor: {
20
20
  id: string;
21
21
  };
22
22
  }): Promise<Pick<factory.recipe.IRecipe, 'recipeCategory' | 'step'>[]>;
23
23
  }
24
+ export {};
@@ -10,29 +10,19 @@ class ActionService extends service_1.Service {
10
10
  /**
11
11
  * アクション検索
12
12
  */
13
- async findActions(params) {
13
+ async adminFindAnyActions(params) {
14
14
  return this.fetch({
15
15
  uri: '/actions',
16
16
  method: 'GET',
17
17
  qs: params,
18
18
  expectedStatusCodes: [http_status_1.status.OK]
19
- })
20
- .then(async (response) => {
21
- return {
22
- data: await response.json()
23
- };
24
- });
25
- }
26
- async findById(params) {
27
- return this.fetch({
28
- uri: `/actions/${encodeURIComponent(String(params.id))}`,
29
- method: 'GET',
30
- expectedStatusCodes: [http_status_1.status.OK],
31
- qs: { typeOf: params.typeOf }
32
19
  })
33
20
  .then(async (response) => response.json());
34
21
  }
35
- async searchRecipes(params) {
22
+ /**
23
+ * アクションのレシピ参照
24
+ */
25
+ async findRecipesByActionId(params) {
36
26
  return this.fetch({
37
27
  uri: `/actions/${encodeURIComponent(String(params.recipeFor.id))}/recipe`,
38
28
  method: 'GET',