@alicloud/dataworks-public20200518 4.4.9 → 4.4.11

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/client.d.ts CHANGED
@@ -1094,6 +1094,7 @@ export declare class CreateFileRequest extends $tea.Model {
1094
1094
  autoRerunTimes?: number;
1095
1095
  connectionName?: string;
1096
1096
  content?: string;
1097
+ createFolderIfNotExists?: boolean;
1097
1098
  cronExpress?: string;
1098
1099
  cycleType?: string;
1099
1100
  dependentNodeIdList?: string;
@@ -1789,6 +1790,81 @@ export declare class CreateRemindResponse extends $tea.Model {
1789
1790
  [key: string]: any;
1790
1791
  });
1791
1792
  }
1793
+ export declare class CreateResourceFileRequest extends $tea.Model {
1794
+ content?: string;
1795
+ fileDescription?: string;
1796
+ fileFolderPath?: string;
1797
+ fileName?: string;
1798
+ fileType?: number;
1799
+ originResourceName?: string;
1800
+ owner?: string;
1801
+ projectId?: number;
1802
+ registerToCalcEngine?: boolean;
1803
+ resourceFile?: string;
1804
+ storageURL?: string;
1805
+ uploadMode?: boolean;
1806
+ static names(): {
1807
+ [key: string]: string;
1808
+ };
1809
+ static types(): {
1810
+ [key: string]: any;
1811
+ };
1812
+ constructor(map?: {
1813
+ [key: string]: any;
1814
+ });
1815
+ }
1816
+ export declare class CreateResourceFileAdvanceRequest extends $tea.Model {
1817
+ content?: string;
1818
+ fileDescription?: string;
1819
+ fileFolderPath?: string;
1820
+ fileName?: string;
1821
+ fileType?: number;
1822
+ originResourceName?: string;
1823
+ owner?: string;
1824
+ projectId?: number;
1825
+ registerToCalcEngine?: boolean;
1826
+ resourceFileObject?: Readable;
1827
+ storageURL?: string;
1828
+ uploadMode?: boolean;
1829
+ static names(): {
1830
+ [key: string]: string;
1831
+ };
1832
+ static types(): {
1833
+ [key: string]: any;
1834
+ };
1835
+ constructor(map?: {
1836
+ [key: string]: any;
1837
+ });
1838
+ }
1839
+ export declare class CreateResourceFileResponseBody extends $tea.Model {
1840
+ data?: number;
1841
+ requestId?: string;
1842
+ static names(): {
1843
+ [key: string]: string;
1844
+ };
1845
+ static types(): {
1846
+ [key: string]: any;
1847
+ };
1848
+ constructor(map?: {
1849
+ [key: string]: any;
1850
+ });
1851
+ }
1852
+ export declare class CreateResourceFileResponse extends $tea.Model {
1853
+ headers: {
1854
+ [key: string]: string;
1855
+ };
1856
+ statusCode: number;
1857
+ body: CreateResourceFileResponseBody;
1858
+ static names(): {
1859
+ [key: string]: string;
1860
+ };
1861
+ static types(): {
1862
+ [key: string]: any;
1863
+ };
1864
+ constructor(map?: {
1865
+ [key: string]: any;
1866
+ });
1867
+ }
1792
1868
  export declare class CreateTableRequest extends $tea.Model {
1793
1869
  appGuid?: string;
1794
1870
  categoryId?: number;
@@ -1948,6 +2024,7 @@ export declare class CreateTableThemeResponse extends $tea.Model {
1948
2024
  export declare class CreateUdfFileRequest extends $tea.Model {
1949
2025
  className?: string;
1950
2026
  cmdDescription?: string;
2027
+ createFolderIfNotExists?: boolean;
1951
2028
  example?: string;
1952
2029
  fileFolderPath?: string;
1953
2030
  fileName?: string;
@@ -7699,9 +7776,13 @@ export declare class ListFileVersionsResponse extends $tea.Model {
7699
7776
  });
7700
7777
  }
7701
7778
  export declare class ListFilesRequest extends $tea.Model {
7779
+ exactFileName?: string;
7702
7780
  fileFolderPath?: string;
7781
+ fileIdIn?: string;
7703
7782
  fileTypes?: string;
7704
7783
  keyword?: string;
7784
+ needAbsoluteFolderPath?: boolean;
7785
+ needContent?: boolean;
7705
7786
  nodeId?: number;
7706
7787
  owner?: string;
7707
7788
  pageNumber?: number;
@@ -16513,6 +16594,7 @@ export declare class ListFileVersionsResponseBodyData extends $tea.Model {
16513
16594
  });
16514
16595
  }
16515
16596
  export declare class ListFilesResponseBodyDataFiles extends $tea.Model {
16597
+ absoluteFolderPath?: string;
16516
16598
  autoParsing?: boolean;
16517
16599
  bizId?: number;
16518
16600
  businessId?: number;
@@ -18433,6 +18515,9 @@ export default class Client extends OpenApi {
18433
18515
  createQualityRule(request: CreateQualityRuleRequest): Promise<CreateQualityRuleResponse>;
18434
18516
  createRemindWithOptions(request: CreateRemindRequest, runtime: $Util.RuntimeOptions): Promise<CreateRemindResponse>;
18435
18517
  createRemind(request: CreateRemindRequest): Promise<CreateRemindResponse>;
18518
+ createResourceFileWithOptions(request: CreateResourceFileRequest, runtime: $Util.RuntimeOptions): Promise<CreateResourceFileResponse>;
18519
+ createResourceFile(request: CreateResourceFileRequest): Promise<CreateResourceFileResponse>;
18520
+ createResourceFileAdvance(request: CreateResourceFileAdvanceRequest, runtime: $Util.RuntimeOptions): Promise<CreateResourceFileResponse>;
18436
18521
  createTableWithOptions(request: CreateTableRequest, runtime: $Util.RuntimeOptions): Promise<CreateTableResponse>;
18437
18522
  createTable(request: CreateTableRequest): Promise<CreateTableResponse>;
18438
18523
  createTableLevelWithOptions(request: CreateTableLevelRequest, runtime: $Util.RuntimeOptions): Promise<CreateTableLevelResponse>;
package/dist/client.js CHANGED
@@ -1565,6 +1565,7 @@ class CreateFileRequest extends $tea.Model {
1565
1565
  autoRerunTimes: 'AutoRerunTimes',
1566
1566
  connectionName: 'ConnectionName',
1567
1567
  content: 'Content',
1568
+ createFolderIfNotExists: 'CreateFolderIfNotExists',
1568
1569
  cronExpress: 'CronExpress',
1569
1570
  cycleType: 'CycleType',
1570
1571
  dependentNodeIdList: 'DependentNodeIdList',
@@ -1599,6 +1600,7 @@ class CreateFileRequest extends $tea.Model {
1599
1600
  autoRerunTimes: 'number',
1600
1601
  connectionName: 'string',
1601
1602
  content: 'string',
1603
+ createFolderIfNotExists: 'boolean',
1602
1604
  cronExpress: 'string',
1603
1605
  cycleType: 'string',
1604
1606
  dependentNodeIdList: 'string',
@@ -2585,6 +2587,120 @@ class CreateRemindResponse extends $tea.Model {
2585
2587
  }
2586
2588
  }
2587
2589
  exports.CreateRemindResponse = CreateRemindResponse;
2590
+ class CreateResourceFileRequest extends $tea.Model {
2591
+ constructor(map) {
2592
+ super(map);
2593
+ }
2594
+ static names() {
2595
+ return {
2596
+ content: 'Content',
2597
+ fileDescription: 'FileDescription',
2598
+ fileFolderPath: 'FileFolderPath',
2599
+ fileName: 'FileName',
2600
+ fileType: 'FileType',
2601
+ originResourceName: 'OriginResourceName',
2602
+ owner: 'Owner',
2603
+ projectId: 'ProjectId',
2604
+ registerToCalcEngine: 'RegisterToCalcEngine',
2605
+ resourceFile: 'ResourceFile',
2606
+ storageURL: 'StorageURL',
2607
+ uploadMode: 'UploadMode',
2608
+ };
2609
+ }
2610
+ static types() {
2611
+ return {
2612
+ content: 'string',
2613
+ fileDescription: 'string',
2614
+ fileFolderPath: 'string',
2615
+ fileName: 'string',
2616
+ fileType: 'number',
2617
+ originResourceName: 'string',
2618
+ owner: 'string',
2619
+ projectId: 'number',
2620
+ registerToCalcEngine: 'boolean',
2621
+ resourceFile: 'string',
2622
+ storageURL: 'string',
2623
+ uploadMode: 'boolean',
2624
+ };
2625
+ }
2626
+ }
2627
+ exports.CreateResourceFileRequest = CreateResourceFileRequest;
2628
+ class CreateResourceFileAdvanceRequest extends $tea.Model {
2629
+ constructor(map) {
2630
+ super(map);
2631
+ }
2632
+ static names() {
2633
+ return {
2634
+ content: 'Content',
2635
+ fileDescription: 'FileDescription',
2636
+ fileFolderPath: 'FileFolderPath',
2637
+ fileName: 'FileName',
2638
+ fileType: 'FileType',
2639
+ originResourceName: 'OriginResourceName',
2640
+ owner: 'Owner',
2641
+ projectId: 'ProjectId',
2642
+ registerToCalcEngine: 'RegisterToCalcEngine',
2643
+ resourceFileObject: 'ResourceFile',
2644
+ storageURL: 'StorageURL',
2645
+ uploadMode: 'UploadMode',
2646
+ };
2647
+ }
2648
+ static types() {
2649
+ return {
2650
+ content: 'string',
2651
+ fileDescription: 'string',
2652
+ fileFolderPath: 'string',
2653
+ fileName: 'string',
2654
+ fileType: 'number',
2655
+ originResourceName: 'string',
2656
+ owner: 'string',
2657
+ projectId: 'number',
2658
+ registerToCalcEngine: 'boolean',
2659
+ resourceFileObject: 'Readable',
2660
+ storageURL: 'string',
2661
+ uploadMode: 'boolean',
2662
+ };
2663
+ }
2664
+ }
2665
+ exports.CreateResourceFileAdvanceRequest = CreateResourceFileAdvanceRequest;
2666
+ class CreateResourceFileResponseBody extends $tea.Model {
2667
+ constructor(map) {
2668
+ super(map);
2669
+ }
2670
+ static names() {
2671
+ return {
2672
+ data: 'Data',
2673
+ requestId: 'RequestId',
2674
+ };
2675
+ }
2676
+ static types() {
2677
+ return {
2678
+ data: 'number',
2679
+ requestId: 'string',
2680
+ };
2681
+ }
2682
+ }
2683
+ exports.CreateResourceFileResponseBody = CreateResourceFileResponseBody;
2684
+ class CreateResourceFileResponse extends $tea.Model {
2685
+ constructor(map) {
2686
+ super(map);
2687
+ }
2688
+ static names() {
2689
+ return {
2690
+ headers: 'headers',
2691
+ statusCode: 'statusCode',
2692
+ body: 'body',
2693
+ };
2694
+ }
2695
+ static types() {
2696
+ return {
2697
+ headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
2698
+ statusCode: 'number',
2699
+ body: CreateResourceFileResponseBody,
2700
+ };
2701
+ }
2702
+ }
2703
+ exports.CreateResourceFileResponse = CreateResourceFileResponse;
2588
2704
  class CreateTableRequest extends $tea.Model {
2589
2705
  constructor(map) {
2590
2706
  super(map);
@@ -2821,6 +2937,7 @@ class CreateUdfFileRequest extends $tea.Model {
2821
2937
  return {
2822
2938
  className: 'ClassName',
2823
2939
  cmdDescription: 'CmdDescription',
2940
+ createFolderIfNotExists: 'CreateFolderIfNotExists',
2824
2941
  example: 'Example',
2825
2942
  fileFolderPath: 'FileFolderPath',
2826
2943
  fileName: 'FileName',
@@ -2837,6 +2954,7 @@ class CreateUdfFileRequest extends $tea.Model {
2837
2954
  return {
2838
2955
  className: 'string',
2839
2956
  cmdDescription: 'string',
2957
+ createFolderIfNotExists: 'boolean',
2840
2958
  example: 'string',
2841
2959
  fileFolderPath: 'string',
2842
2960
  fileName: 'string',
@@ -10841,9 +10959,13 @@ class ListFilesRequest extends $tea.Model {
10841
10959
  }
10842
10960
  static names() {
10843
10961
  return {
10962
+ exactFileName: 'ExactFileName',
10844
10963
  fileFolderPath: 'FileFolderPath',
10964
+ fileIdIn: 'FileIdIn',
10845
10965
  fileTypes: 'FileTypes',
10846
10966
  keyword: 'Keyword',
10967
+ needAbsoluteFolderPath: 'NeedAbsoluteFolderPath',
10968
+ needContent: 'NeedContent',
10847
10969
  nodeId: 'NodeId',
10848
10970
  owner: 'Owner',
10849
10971
  pageNumber: 'PageNumber',
@@ -10855,9 +10977,13 @@ class ListFilesRequest extends $tea.Model {
10855
10977
  }
10856
10978
  static types() {
10857
10979
  return {
10980
+ exactFileName: 'string',
10858
10981
  fileFolderPath: 'string',
10982
+ fileIdIn: 'string',
10859
10983
  fileTypes: 'string',
10860
10984
  keyword: 'string',
10985
+ needAbsoluteFolderPath: 'boolean',
10986
+ needContent: 'boolean',
10861
10987
  nodeId: 'number',
10862
10988
  owner: 'string',
10863
10989
  pageNumber: 'number',
@@ -23849,6 +23975,7 @@ class ListFilesResponseBodyDataFiles extends $tea.Model {
23849
23975
  }
23850
23976
  static names() {
23851
23977
  return {
23978
+ absoluteFolderPath: 'AbsoluteFolderPath',
23852
23979
  autoParsing: 'AutoParsing',
23853
23980
  bizId: 'BizId',
23854
23981
  businessId: 'BusinessId',
@@ -23874,6 +24001,7 @@ class ListFilesResponseBodyDataFiles extends $tea.Model {
23874
24001
  }
23875
24002
  static types() {
23876
24003
  return {
24004
+ absoluteFolderPath: 'string',
23877
24005
  autoParsing: 'boolean',
23878
24006
  bizId: 'number',
23879
24007
  businessId: 'number',
@@ -27445,6 +27573,9 @@ class Client extends openapi_client_1.default {
27445
27573
  if (!tea_util_1.default.isUnset(request.content)) {
27446
27574
  body["Content"] = request.content;
27447
27575
  }
27576
+ if (!tea_util_1.default.isUnset(request.createFolderIfNotExists)) {
27577
+ body["CreateFolderIfNotExists"] = request.createFolderIfNotExists;
27578
+ }
27448
27579
  if (!tea_util_1.default.isUnset(request.cronExpress)) {
27449
27580
  body["CronExpress"] = request.cronExpress;
27450
27581
  }
@@ -28233,6 +28364,135 @@ class Client extends openapi_client_1.default {
28233
28364
  let runtime = new $Util.RuntimeOptions({});
28234
28365
  return await this.createRemindWithOptions(request, runtime);
28235
28366
  }
28367
+ async createResourceFileWithOptions(request, runtime) {
28368
+ tea_util_1.default.validateModel(request);
28369
+ let body = {};
28370
+ if (!tea_util_1.default.isUnset(request.content)) {
28371
+ body["Content"] = request.content;
28372
+ }
28373
+ if (!tea_util_1.default.isUnset(request.fileDescription)) {
28374
+ body["FileDescription"] = request.fileDescription;
28375
+ }
28376
+ if (!tea_util_1.default.isUnset(request.fileFolderPath)) {
28377
+ body["FileFolderPath"] = request.fileFolderPath;
28378
+ }
28379
+ if (!tea_util_1.default.isUnset(request.fileName)) {
28380
+ body["FileName"] = request.fileName;
28381
+ }
28382
+ if (!tea_util_1.default.isUnset(request.fileType)) {
28383
+ body["FileType"] = request.fileType;
28384
+ }
28385
+ if (!tea_util_1.default.isUnset(request.originResourceName)) {
28386
+ body["OriginResourceName"] = request.originResourceName;
28387
+ }
28388
+ if (!tea_util_1.default.isUnset(request.owner)) {
28389
+ body["Owner"] = request.owner;
28390
+ }
28391
+ if (!tea_util_1.default.isUnset(request.projectId)) {
28392
+ body["ProjectId"] = request.projectId;
28393
+ }
28394
+ if (!tea_util_1.default.isUnset(request.registerToCalcEngine)) {
28395
+ body["RegisterToCalcEngine"] = request.registerToCalcEngine;
28396
+ }
28397
+ if (!tea_util_1.default.isUnset(request.resourceFile)) {
28398
+ body["ResourceFile"] = request.resourceFile;
28399
+ }
28400
+ if (!tea_util_1.default.isUnset(request.storageURL)) {
28401
+ body["StorageURL"] = request.storageURL;
28402
+ }
28403
+ if (!tea_util_1.default.isUnset(request.uploadMode)) {
28404
+ body["UploadMode"] = request.uploadMode;
28405
+ }
28406
+ let req = new $OpenApi.OpenApiRequest({
28407
+ body: openapi_util_1.default.parseToMap(body),
28408
+ });
28409
+ let params = new $OpenApi.Params({
28410
+ action: "CreateResourceFile",
28411
+ version: "2020-05-18",
28412
+ protocol: "HTTPS",
28413
+ pathname: "/",
28414
+ method: "POST",
28415
+ authType: "AK",
28416
+ style: "RPC",
28417
+ reqBodyType: "formData",
28418
+ bodyType: "json",
28419
+ });
28420
+ return $tea.cast(await this.callApi(params, req, runtime), new CreateResourceFileResponse({}));
28421
+ }
28422
+ async createResourceFile(request) {
28423
+ let runtime = new $Util.RuntimeOptions({});
28424
+ return await this.createResourceFileWithOptions(request, runtime);
28425
+ }
28426
+ async createResourceFileAdvance(request, runtime) {
28427
+ // Step 0: init client
28428
+ let accessKeyId = await this._credential.getAccessKeyId();
28429
+ let accessKeySecret = await this._credential.getAccessKeySecret();
28430
+ let securityToken = await this._credential.getSecurityToken();
28431
+ let credentialType = this._credential.getType();
28432
+ let openPlatformEndpoint = this._openPlatformEndpoint;
28433
+ if (tea_util_1.default.isUnset(openPlatformEndpoint)) {
28434
+ openPlatformEndpoint = "openplatform.aliyuncs.com";
28435
+ }
28436
+ if (tea_util_1.default.isUnset(credentialType)) {
28437
+ credentialType = "access_key";
28438
+ }
28439
+ let authConfig = new $OpenApi.Config({
28440
+ accessKeyId: accessKeyId,
28441
+ accessKeySecret: accessKeySecret,
28442
+ securityToken: securityToken,
28443
+ type: credentialType,
28444
+ endpoint: openPlatformEndpoint,
28445
+ protocol: this._protocol,
28446
+ regionId: this._regionId,
28447
+ });
28448
+ let authClient = new openplatform20191219_1.default(authConfig);
28449
+ let authRequest = new $OpenPlatform.AuthorizeFileUploadRequest({
28450
+ product: "dataworks-public",
28451
+ regionId: this._regionId,
28452
+ });
28453
+ let authResponse = new $OpenPlatform.AuthorizeFileUploadResponse({});
28454
+ let ossConfig = new $OSS.Config({
28455
+ accessKeySecret: accessKeySecret,
28456
+ type: "access_key",
28457
+ protocol: this._protocol,
28458
+ regionId: this._regionId,
28459
+ });
28460
+ let ossClient = null;
28461
+ let fileObj = new $FileForm.FileField({});
28462
+ let ossHeader = new $OSS.PostObjectRequestHeader({});
28463
+ let uploadRequest = new $OSS.PostObjectRequest({});
28464
+ let ossRuntime = new $OSSUtil.RuntimeOptions({});
28465
+ openapi_util_1.default.convert(runtime, ossRuntime);
28466
+ let createResourceFileReq = new CreateResourceFileRequest({});
28467
+ openapi_util_1.default.convert(request, createResourceFileReq);
28468
+ if (!tea_util_1.default.isUnset(request.resourceFileObject)) {
28469
+ authResponse = await authClient.authorizeFileUploadWithOptions(authRequest, runtime);
28470
+ ossConfig.accessKeyId = authResponse.body.accessKeyId;
28471
+ ossConfig.endpoint = openapi_util_1.default.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, this._endpointType);
28472
+ ossClient = new oss_client_1.default(ossConfig);
28473
+ fileObj = new $FileForm.FileField({
28474
+ filename: authResponse.body.objectKey,
28475
+ content: request.resourceFileObject,
28476
+ contentType: "",
28477
+ });
28478
+ ossHeader = new $OSS.PostObjectRequestHeader({
28479
+ accessKeyId: authResponse.body.accessKeyId,
28480
+ policy: authResponse.body.encodedPolicy,
28481
+ signature: authResponse.body.signature,
28482
+ key: authResponse.body.objectKey,
28483
+ file: fileObj,
28484
+ successActionStatus: "201",
28485
+ });
28486
+ uploadRequest = new $OSS.PostObjectRequest({
28487
+ bucketName: authResponse.body.bucket,
28488
+ header: ossHeader,
28489
+ });
28490
+ await ossClient.postObject(uploadRequest, ossRuntime);
28491
+ createResourceFileReq.resourceFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
28492
+ }
28493
+ let createResourceFileResp = await this.createResourceFileWithOptions(createResourceFileReq, runtime);
28494
+ return createResourceFileResp;
28495
+ }
28236
28496
  async createTableWithOptions(request, runtime) {
28237
28497
  tea_util_1.default.validateModel(request);
28238
28498
  let query = {};
@@ -28397,6 +28657,9 @@ class Client extends openapi_client_1.default {
28397
28657
  if (!tea_util_1.default.isUnset(request.cmdDescription)) {
28398
28658
  body["CmdDescription"] = request.cmdDescription;
28399
28659
  }
28660
+ if (!tea_util_1.default.isUnset(request.createFolderIfNotExists)) {
28661
+ body["CreateFolderIfNotExists"] = request.createFolderIfNotExists;
28662
+ }
28400
28663
  if (!tea_util_1.default.isUnset(request.example)) {
28401
28664
  body["Example"] = request.example;
28402
28665
  }
@@ -32767,15 +33030,27 @@ class Client extends openapi_client_1.default {
32767
33030
  async listFilesWithOptions(request, runtime) {
32768
33031
  tea_util_1.default.validateModel(request);
32769
33032
  let body = {};
33033
+ if (!tea_util_1.default.isUnset(request.exactFileName)) {
33034
+ body["ExactFileName"] = request.exactFileName;
33035
+ }
32770
33036
  if (!tea_util_1.default.isUnset(request.fileFolderPath)) {
32771
33037
  body["FileFolderPath"] = request.fileFolderPath;
32772
33038
  }
33039
+ if (!tea_util_1.default.isUnset(request.fileIdIn)) {
33040
+ body["FileIdIn"] = request.fileIdIn;
33041
+ }
32773
33042
  if (!tea_util_1.default.isUnset(request.fileTypes)) {
32774
33043
  body["FileTypes"] = request.fileTypes;
32775
33044
  }
32776
33045
  if (!tea_util_1.default.isUnset(request.keyword)) {
32777
33046
  body["Keyword"] = request.keyword;
32778
33047
  }
33048
+ if (!tea_util_1.default.isUnset(request.needAbsoluteFolderPath)) {
33049
+ body["NeedAbsoluteFolderPath"] = request.needAbsoluteFolderPath;
33050
+ }
33051
+ if (!tea_util_1.default.isUnset(request.needContent)) {
33052
+ body["NeedContent"] = request.needContent;
33053
+ }
32779
33054
  if (!tea_util_1.default.isUnset(request.nodeId)) {
32780
33055
  body["NodeId"] = request.nodeId;
32781
33056
  }