instill-sdk 0.0.2 → 0.0.3

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.
Files changed (96) hide show
  1. package/README.md +54 -34
  2. package/dist/chunk-375TLK3Q.mjs +0 -0
  3. package/dist/chunk-4BC7UGYC.mjs +114 -0
  4. package/dist/{chunk-JONZWFL5.mjs → chunk-4LUKB34H.mjs} +48 -52
  5. package/dist/chunk-5FTGMS4X.mjs +46 -0
  6. package/dist/chunk-6K6UDAWM.mjs +114 -0
  7. package/dist/{chunk-IPW3WQCQ.mjs → chunk-7VLTGUGU.mjs} +18 -1
  8. package/dist/chunk-DZXTDWWF.mjs +69 -0
  9. package/dist/{chunk-4VWYH26Q.mjs → chunk-EI3U4WOS.mjs} +1 -1
  10. package/dist/{chunk-KHFNAMT4.mjs → chunk-GEEYB6IX.mjs} +1 -1
  11. package/dist/{chunk-G5M7VUJT.mjs → chunk-GFLAFXAN.mjs} +1 -1
  12. package/dist/chunk-GX3ELROF.mjs +141 -0
  13. package/dist/{chunk-YK7RY2CG.mjs → chunk-I4VMGZBF.mjs} +104 -32
  14. package/dist/{chunk-YXNMG2RZ.mjs → chunk-JBSVFVPW.mjs} +1 -1
  15. package/dist/{chunk-NRP5M7FG.mjs → chunk-K7AV4FXF.mjs} +13 -11
  16. package/dist/{chunk-VIPORJ6H.mjs → chunk-KV3GJM6Q.mjs} +45 -3
  17. package/dist/{chunk-DIAPO2ML.mjs → chunk-L25EZQ5J.mjs} +16 -5
  18. package/dist/{chunk-EBWGEVUX.mjs → chunk-QG4SF5DT.mjs} +5 -1
  19. package/dist/{chunk-GPM5FDRS.mjs → chunk-SFKHRD33.mjs} +18 -18
  20. package/dist/chunk-UNJKVLJE.mjs +0 -0
  21. package/dist/{chunk-MS2EILMH.mjs → chunk-V2NMRJ2Y.mjs} +20 -16
  22. package/dist/connector/ConnectorClient.d.ts +32 -32
  23. package/dist/connector/ConnectorClient.js +90 -85
  24. package/dist/connector/ConnectorClient.mjs +5 -5
  25. package/dist/connector/action.d.ts +19 -9
  26. package/dist/connector/action.js +17 -17
  27. package/dist/connector/action.mjs +7 -7
  28. package/dist/connector/index.mjs +5 -5
  29. package/dist/connector/mutation.d.ts +13 -13
  30. package/dist/connector/mutation.js +35 -30
  31. package/dist/connector/mutation.mjs +9 -9
  32. package/dist/connector/queries.d.ts +11 -11
  33. package/dist/connector/queries.js +26 -22
  34. package/dist/connector/queries.mjs +10 -10
  35. package/dist/connector/types.d.ts +34 -48
  36. package/dist/helper/getQueryString.d.ts +3 -2
  37. package/dist/helper/getQueryString.js +5 -1
  38. package/dist/helper/getQueryString.mjs +1 -1
  39. package/dist/helper/getQueryString.test.js +5 -1
  40. package/dist/helper/getQueryString.test.mjs +1 -1
  41. package/dist/helper/index.js +5 -1
  42. package/dist/helper/index.mjs +1 -1
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.js +566 -136
  45. package/dist/index.mjs +54 -17
  46. package/dist/metric/MetricClient.js +5 -1
  47. package/dist/metric/MetricClient.mjs +3 -3
  48. package/dist/metric/pipeline/queries.js +5 -1
  49. package/dist/metric/pipeline/queries.mjs +2 -2
  50. package/dist/mgmt/AuthClient.d.ts +7 -1
  51. package/dist/mgmt/AuthClient.js +44 -4
  52. package/dist/mgmt/AuthClient.mjs +4 -4
  53. package/dist/mgmt/action.d.ts +4 -0
  54. package/dist/mgmt/action.js +20 -2
  55. package/dist/mgmt/action.mjs +5 -3
  56. package/dist/mgmt/index.mjs +4 -4
  57. package/dist/mgmt/queries.d.ts +11 -2
  58. package/dist/mgmt/queries.js +52 -4
  59. package/dist/mgmt/queries.mjs +8 -4
  60. package/dist/mgmt/types.d.ts +12 -0
  61. package/dist/model/ModelClient.js +5 -1
  62. package/dist/model/ModelClient.mjs +3 -3
  63. package/dist/model/index.mjs +3 -3
  64. package/dist/model/queries.js +5 -1
  65. package/dist/model/queries.mjs +2 -2
  66. package/dist/organization/OrganizationClient.d.ts +43 -0
  67. package/dist/organization/OrganizationClient.js +378 -0
  68. package/dist/organization/OrganizationClient.mjs +15 -0
  69. package/dist/organization/index.d.ts +3 -0
  70. package/dist/organization/index.js +310 -0
  71. package/dist/organization/index.mjs +41 -0
  72. package/dist/organization/mutations.d.ts +32 -0
  73. package/dist/organization/mutations.js +144 -0
  74. package/dist/organization/mutations.mjs +19 -0
  75. package/dist/organization/queries.d.ts +34 -0
  76. package/dist/organization/queries.js +191 -0
  77. package/dist/organization/queries.mjs +23 -0
  78. package/dist/organization/types.d.ts +81 -0
  79. package/dist/organization/types.js +18 -0
  80. package/dist/organization/types.mjs +1 -0
  81. package/dist/pipeline/PipelineClient.d.ts +7 -5
  82. package/dist/pipeline/PipelineClient.js +81 -47
  83. package/dist/pipeline/PipelineClient.mjs +4 -4
  84. package/dist/pipeline/action.d.ts +13 -12
  85. package/dist/pipeline/action.js +13 -11
  86. package/dist/pipeline/action.mjs +1 -1
  87. package/dist/pipeline/index.mjs +5 -5
  88. package/dist/pipeline/queries.d.ts +37 -18
  89. package/dist/pipeline/queries.js +110 -32
  90. package/dist/pipeline/queries.mjs +8 -4
  91. package/dist/pipeline/types.d.ts +88 -16
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/dist/types.d.ts +2 -2
  94. package/package.json +2 -2
  95. package/dist/chunk-6M57XUNI.mjs +0 -64
  96. package/dist/chunk-YT6ZGA4J.mjs +0 -46
@@ -1,8 +1,10 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
- import { ConnectorDefinition, ConnectorResource } from "../connector";
2
+ import { ConnectorDefinition, Connector } from "../connector";
3
3
  import { Spec, Visibility } from "../types";
4
- import { Nullable } from "../types";
4
+ import { JSONSchema7TypeName } from "json-schema";
5
+ import { GeneralRecord, Nullable } from "@instill-ai/toolkit";
5
6
  import { Operation } from "../operation";
7
+ import { AxiosInstance } from "axios";
6
8
  export type PipelineMode = "MODE_UNSPECIFIED" | "MODE_SYNC" | "MODE_ASYNC";
7
9
  export type PipelineReleaseState = "STATE_UNSPECIFIED" | "STATE_ACTIVE" | "STATE_INACTIVE" | "STATE_ERROR" | "STATE_DELETED";
8
10
  export type PipelineRecipe = {
@@ -25,17 +27,26 @@ export type PipelineReleaseWatchState = {
25
27
  };
26
28
  export type PipelineComponentType = "COMPONENT_TYPE_UNSPECIFIED" | "COMPONENT_TYPE_CONNECTOR_AI" | "COMPONENT_TYPE_CONNECTOR_DATA" | "COMPONENT_TYPE_CONNECTOR_BLOCKCHAIN" | "COMPONENT_TYPE_OPERATOR";
27
29
  export type PipelineReleasesWatchState = Record<string, PipelineReleaseWatchState>;
30
+ export type Permission = {
31
+ can_edit: boolean;
32
+ can_trigger: boolean;
33
+ };
28
34
  export type Pipeline = {
29
35
  name: string;
30
36
  uid: string;
31
37
  id: string;
32
38
  description: string;
33
- user: string;
39
+ readme: string;
34
40
  create_time: string;
35
41
  update_time: string;
36
42
  recipe: PipelineRecipe;
37
43
  openapi_schema: OpenAPIV3.Document;
38
- owner: string;
44
+ owner: Record<string, any>;
45
+ owner_name: string;
46
+ releases: PipelineRelease[];
47
+ sharing: PipelineSharing;
48
+ metadata: GeneralRecord;
49
+ permission: Permission;
39
50
  };
40
51
  export type OperatorDefinition = {
41
52
  name: string;
@@ -50,6 +61,21 @@ export type OperatorDefinition = {
50
61
  custom: boolean;
51
62
  icon_url: string;
52
63
  };
64
+ export type PipelineSharing = {
65
+ users: PipelineSharingUserRules;
66
+ share_code: Nullable<PipelineSharingCodeRule>;
67
+ };
68
+ export type PipelineSharingUserRules = Record<string, {
69
+ enabled: boolean;
70
+ role: PermissionRole;
71
+ } | undefined>;
72
+ export type PipelineSharingCodeRule = {
73
+ user: string;
74
+ code?: string;
75
+ enabled: boolean;
76
+ role: PermissionRole;
77
+ };
78
+ export type PermissionRole = "ROLE_UNSPECIFIED" | "ROLE_VIEWER" | "ROLE_EXECUTOR";
53
79
  export type PipelineRelease = {
54
80
  name: string;
55
81
  uid: string;
@@ -60,6 +86,7 @@ export type PipelineRelease = {
60
86
  update_time: string;
61
87
  visibility: Visibility;
62
88
  openapi_schema: OpenAPIV3.Document;
89
+ metadata: GeneralRecord;
63
90
  };
64
91
  export type PipelineTrace = {
65
92
  success: boolean;
@@ -73,39 +100,58 @@ export type PipelineTriggerMetadata = {
73
100
  };
74
101
  export type PipelineStartComponent = {
75
102
  id: "start";
76
- resource_name: string;
77
- resource: Nullable<ConnectorResource>;
103
+ resource_name: Nullable<string>;
104
+ resource: Nullable<Connector>;
78
105
  type: PipelineComponentType;
79
106
  definition_name: string;
80
107
  operator_definition: Nullable<OperatorDefinition>;
81
- configuration: Record<string, Record<string, StartOperatorInput>>;
108
+ configuration: {
109
+ metadata?: StartOperatorMetadata;
110
+ } & GeneralRecord;
111
+ };
112
+ export type PipelineOperatorComponent = {
113
+ id: string;
114
+ resource_name: Nullable<string>;
115
+ resource: Nullable<Connector>;
116
+ type: PipelineComponentType;
117
+ definition_name: string;
118
+ operator_definition: Nullable<OperatorDefinition>;
119
+ configuration: GeneralRecord;
82
120
  };
83
121
  export type PipelineEndComponent = {
84
122
  id: "end";
85
- resource_name: string;
86
- resource: Nullable<ConnectorResource>;
123
+ resource_name: Nullable<string>;
124
+ resource: Nullable<Connector>;
87
125
  type: PipelineComponentType;
88
126
  definition_name: string;
89
127
  operator_definition: Nullable<OperatorDefinition>;
90
- configuration: Record<string, Record<string, any>>;
128
+ configuration: Record<string, GeneralRecord>;
91
129
  };
92
130
  export type PipelineConnectorComponent = {
93
131
  id: string;
94
- resource_name: string;
95
- resource: Nullable<ConnectorResource>;
132
+ resource_name: Nullable<string>;
133
+ resource: Nullable<Connector>;
96
134
  type: PipelineComponentType;
97
135
  definition_name: string;
98
136
  connector_definition: Nullable<ConnectorDefinition>;
99
- configuration: Record<string, any>;
137
+ configuration: GeneralRecord;
100
138
  };
101
139
  export type PipelineComponent = PipelineStartComponent | PipelineEndComponent | PipelineConnectorComponent;
102
- export type StartOperatorBody = Record<string, StartOperatorInput>;
103
- export type StartOperatorInputBodyValue = Record<string, any>;
140
+ export type StartOperatorMetadata = Record<string, StartOperatorInput>;
104
141
  export type StartOperatorInput = {
105
142
  title: string;
106
143
  type: StartOperatorInputType;
144
+ instillFormat: string;
145
+ items?: {
146
+ type: string;
147
+ };
148
+ instillUiOrder?: number;
149
+ instillUIMultiline?: boolean;
150
+ description?: string;
107
151
  };
108
- export type StartOperatorInputType = StartOperatorInputSingularType | StartOperatorInputArrayType;
152
+ export type StartOperatorInputType = "audio/*" | "image/*" | "long_string" | "array:image/*" | "array:audio/*" | "array:string" | "*/*" | "array:*/*" | "semi-structured/object" | JSONSchema7TypeName;
153
+ export type StartOperatorBody = Record<string, StartOperatorInput>;
154
+ export type StartOperatorInputBodyValue = Record<string, any>;
109
155
  export type StartOperatorInputSingularType = "text" | "number" | "boolean" | "audio" | "image";
110
156
  export type StartOperatorInputArrayType = "text_array" | "number_array" | "boolean_array" | "audio_array" | "image_array";
111
157
  export type TriggerUserPipelinePayload = {
@@ -172,6 +218,12 @@ export type CreateUserPipelineReleaseResponse = {
172
218
  release: PipelineRelease;
173
219
  };
174
220
  export type UpdateUserPipelineReleasePayload = {
221
+ instillFormat: string;
222
+ items?: {
223
+ type: string;
224
+ };
225
+ instillUiOrder?: number;
226
+ instillUIMultiline?: boolean;
175
227
  description?: string;
176
228
  recipe: RawPipelineRecipe;
177
229
  };
@@ -202,3 +254,23 @@ export type GetUserPipelineReleaseResponse = {
202
254
  export type WatchUserPipelineReleaseResponse = {
203
255
  state: PipelineReleaseWatchState;
204
256
  };
257
+ export type listPipelinesQueryParams = {
258
+ pageSize: Nullable<number>;
259
+ nextPageToken: Nullable<string>;
260
+ axiosInstance: AxiosInstance;
261
+ visibility?: Visibility;
262
+ };
263
+ export type listUserPipelinesQueryProps = {
264
+ pageSize: Nullable<number>;
265
+ nextPageToken: Nullable<string>;
266
+ axiosInstance: AxiosInstance;
267
+ userName: string;
268
+ };
269
+ export type GetOperatorDefinitionResponse = {
270
+ operator_definition: OperatorDefinition;
271
+ };
272
+ export type ListOperatorDefinitionsResponse = {
273
+ operator_definitions: OperatorDefinition[];
274
+ next_page_token: string;
275
+ total_size: number;
276
+ };