@hautechai/sdk 0.0.15 → 0.0.16

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.
@@ -163,18 +163,37 @@ export declare const createSDK: (options: SDKOptions) => {
163
163
  }) => Promise<import("../types").OperationEntity>;
164
164
  };
165
165
  pipelines: {
166
+ constructTemplate: (consructPipeline: (pipeline: import("@hautechai/pipelines").Pipeline<{
167
+ collections: {
168
+ create: (params: import("../autogenerated").CreateCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
169
+ get: (params: import("../autogenerated").GetCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
170
+ };
171
+ stacks: {
172
+ create: (params: import("../autogenerated").CreateStackParamsDto) => Promise<import("../types").StackEntity>;
173
+ get: (params: import("../autogenerated").ListStacksParamsDto) => Promise<import("../types").StackEntity>;
174
+ };
175
+ }>) => import("@hautechai/pipelines").Pipeline<{
176
+ collections: {
177
+ create: (params: import("../autogenerated").CreateCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
178
+ get: (params: import("../autogenerated").GetCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
179
+ };
180
+ stacks: {
181
+ create: (params: import("../autogenerated").CreateStackParamsDto) => Promise<import("../types").StackEntity>;
182
+ get: (params: import("../autogenerated").ListStacksParamsDto) => Promise<import("../types").StackEntity>;
183
+ };
184
+ }>) => import("@hautechai/pipelines").Pipeline<{
185
+ collections: {
186
+ create: (params: import("../autogenerated").CreateCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
187
+ get: (params: import("../autogenerated").GetCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
188
+ };
189
+ stacks: {
190
+ create: (params: import("../autogenerated").CreateStackParamsDto) => Promise<import("../types").StackEntity>;
191
+ get: (params: import("../autogenerated").ListStacksParamsDto) => Promise<import("../types").StackEntity>;
192
+ };
193
+ }>;
166
194
  create: (props: {
167
195
  metadata?: any;
168
- tasks: (pipeline: ReturnType<() => import("@hautechai/pipelines").Pipeline<{
169
- collections: {
170
- create: (params: import("../autogenerated").CreateCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
171
- get: (params: import("../autogenerated").GetCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
172
- };
173
- stacks: {
174
- create: (params: import("../autogenerated").CreateStackParamsDto) => Promise<import("../types").StackEntity>;
175
- get: (params: import("../autogenerated").ListStacksParamsDto) => Promise<import("../types").StackEntity>;
176
- };
177
- }>>) => ReturnType<() => import("@hautechai/pipelines").Pipeline<{
196
+ template: import("@hautechai/pipelines").Pipeline<{
178
197
  collections: {
179
198
  create: (params: import("../autogenerated").CreateCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
180
199
  get: (params: import("../autogenerated").GetCollectionParamsDto) => Promise<import("../types").CollectionEntity>;
@@ -183,7 +202,7 @@ export declare const createSDK: (options: SDKOptions) => {
183
202
  create: (params: import("../autogenerated").CreateStackParamsDto) => Promise<import("../types").StackEntity>;
184
203
  get: (params: import("../autogenerated").ListStacksParamsDto) => Promise<import("../types").StackEntity>;
185
204
  };
186
- }>>;
205
+ }>;
187
206
  }) => Promise<import("../types").PipelineEntity>;
188
207
  get: (props: {
189
208
  id: string;
@@ -2,9 +2,37 @@ import { CollectionEntity, CreateCollectionParamsDto, CreateStackParamsDto, GetC
2
2
  import { SDKOptions } from '../../types';
3
3
  import { Pipeline } from '@hautechai/pipelines';
4
4
  declare const pipelines: (options: SDKOptions) => {
5
+ constructTemplate: (consructPipeline: (pipeline: Pipeline<{
6
+ collections: {
7
+ create: (params: CreateCollectionParamsDto) => Promise<CollectionEntity>;
8
+ get: (params: GetCollectionParamsDto) => Promise<CollectionEntity>;
9
+ };
10
+ stacks: {
11
+ create: (params: CreateStackParamsDto) => Promise<StackEntity>;
12
+ get: (params: ListStacksParamsDto) => Promise<StackEntity>;
13
+ };
14
+ }>) => Pipeline<{
15
+ collections: {
16
+ create: (params: CreateCollectionParamsDto) => Promise<CollectionEntity>;
17
+ get: (params: GetCollectionParamsDto) => Promise<CollectionEntity>;
18
+ };
19
+ stacks: {
20
+ create: (params: CreateStackParamsDto) => Promise<StackEntity>;
21
+ get: (params: ListStacksParamsDto) => Promise<StackEntity>;
22
+ };
23
+ }>) => Pipeline<{
24
+ collections: {
25
+ create: (params: CreateCollectionParamsDto) => Promise<CollectionEntity>;
26
+ get: (params: GetCollectionParamsDto) => Promise<CollectionEntity>;
27
+ };
28
+ stacks: {
29
+ create: (params: CreateStackParamsDto) => Promise<StackEntity>;
30
+ get: (params: ListStacksParamsDto) => Promise<StackEntity>;
31
+ };
32
+ }>;
5
33
  create: (props: {
6
34
  metadata?: any;
7
- tasks: (pipeline: ReturnType<() => Pipeline<{
35
+ template: Pipeline<{
8
36
  collections: {
9
37
  create: (params: CreateCollectionParamsDto) => Promise<CollectionEntity>;
10
38
  get: (params: GetCollectionParamsDto) => Promise<CollectionEntity>;
@@ -13,16 +41,7 @@ declare const pipelines: (options: SDKOptions) => {
13
41
  create: (params: CreateStackParamsDto) => Promise<StackEntity>;
14
42
  get: (params: ListStacksParamsDto) => Promise<StackEntity>;
15
43
  };
16
- }>>) => ReturnType<() => Pipeline<{
17
- collections: {
18
- create: (params: CreateCollectionParamsDto) => Promise<CollectionEntity>;
19
- get: (params: GetCollectionParamsDto) => Promise<CollectionEntity>;
20
- };
21
- stacks: {
22
- create: (params: CreateStackParamsDto) => Promise<StackEntity>;
23
- get: (params: ListStacksParamsDto) => Promise<StackEntity>;
24
- };
25
- }>>;
44
+ }>;
26
45
  }) => Promise<PipelineEntity>;
27
46
  get: (props: {
28
47
  id: string;
@@ -23,10 +23,11 @@ const pipelines = (options) => {
23
23
  },
24
24
  });
25
25
  return {
26
+ constructTemplate: (consructPipeline) => consructPipeline(createPipeline()),
26
27
  create: async (props) => api.call({
27
28
  run: (methods) => methods.pipelinesControllerCreatePipelineV1({
28
29
  metadata: props.metadata,
29
- tasks: props.tasks(createPipeline()).tasks,
30
+ tasks: props.template.tasks,
30
31
  }),
31
32
  }),
32
33
  get: async (props) => api.callWithReturningUndefinedOn404({
@@ -1,4 +1,4 @@
1
- import { defaultPermissions, defaultRootPermissions } from './permissions';
1
+ import { defaultPermissions } from './permissions';
2
2
  import * as jose from 'jose';
3
3
  const createPrivateKey = (key) => {
4
4
  const header = `-----BEGIN PRIVATE KEY-----\n`;
@@ -49,7 +49,7 @@ export const createTokenSigner = (options) => ({
49
49
  expiresInSeconds: props.expiresInSeconds ?? 3600,
50
50
  payload: {
51
51
  iss: options.appId,
52
- permissions: serializePermissions(defaultRootPermissions),
52
+ permissions: ['*'],
53
53
  },
54
54
  }),
55
55
  });
@@ -1,3 +1,2 @@
1
1
  import { MethodsPermissions } from '../autogenerated/permissions';
2
2
  export declare const defaultPermissions: MethodsPermissions;
3
- export declare const defaultRootPermissions: MethodsPermissions;
@@ -16,21 +16,3 @@ export const defaultPermissions = {
16
16
  stacks: { create: true, items: { add: true, remove: true }, read: true, metadata: { update: true } },
17
17
  storage: { create: true, delete: true, read: true, update: true },
18
18
  };
19
- export const defaultRootPermissions = {
20
- access: { add: true, read: true, remove: true },
21
- accounts: { create: true, read: true },
22
- balances: { read: true, self: { read: true, update: true }, update: true },
23
- collections: {
24
- create: true,
25
- items: { add: true, read: true, remove: true },
26
- read: true,
27
- update: true,
28
- },
29
- groups: { accounts: { add: true, read: true, remove: true }, create: true, delete: true, read: true },
30
- images: { create: true, read: true },
31
- operations: { create: true, read: true, metadata: { update: true } },
32
- pipelines: { create: true, read: true, update: true },
33
- poses: { create: true, read: true },
34
- stacks: { create: true, items: { add: true, remove: true }, read: true, metadata: { update: true } },
35
- storage: { create: true, delete: true, read: true, update: true },
36
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hautechai/sdk",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "license": "MIT",
5
5
  "keywords": [],
6
6
  "repository": {