@azure/ai-text-analytics 5.2.0-beta.2 → 6.0.0-alpha.20220516.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +375 -133
  3. package/dist/index.js +2797 -4176
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/azureKeyCredentialPolicy.js +2 -2
  6. package/dist-esm/src/azureKeyCredentialPolicy.js.map +1 -1
  7. package/dist-esm/src/constants.js +16 -0
  8. package/dist-esm/src/constants.js.map +1 -0
  9. package/dist-esm/src/generated/generatedClient.js +80 -334
  10. package/dist-esm/src/generated/generatedClient.js.map +1 -1
  11. package/dist-esm/src/generated/index.js +1 -1
  12. package/dist-esm/src/generated/index.js.map +1 -1
  13. package/dist-esm/src/generated/models/index.js +106 -35
  14. package/dist-esm/src/generated/models/index.js.map +1 -1
  15. package/dist-esm/src/generated/models/mappers.js +1625 -2101
  16. package/dist-esm/src/generated/models/mappers.js.map +1 -1
  17. package/dist-esm/src/generated/models/parameters.js +18 -105
  18. package/dist-esm/src/generated/models/parameters.js.map +1 -1
  19. package/dist-esm/src/generated/operations/analyzeText.js +105 -0
  20. package/dist-esm/src/generated/operations/analyzeText.js.map +1 -0
  21. package/dist-esm/src/generated/operations/index.js +9 -0
  22. package/dist-esm/src/generated/operations/index.js.map +1 -0
  23. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js +9 -0
  24. package/dist-esm/src/generated/operationsInterfaces/analyzeText.js.map +1 -0
  25. package/dist-esm/src/generated/operationsInterfaces/index.js +9 -0
  26. package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
  27. package/dist-esm/src/index.js +14 -5
  28. package/dist-esm/src/index.js.map +1 -1
  29. package/dist-esm/src/lro.js +195 -0
  30. package/dist-esm/src/lro.js.map +1 -0
  31. package/dist-esm/src/models.js +42 -0
  32. package/dist-esm/src/models.js.map +1 -0
  33. package/dist-esm/src/textAnalysisClient.js +197 -0
  34. package/dist-esm/src/textAnalysisClient.js.map +1 -0
  35. package/dist-esm/src/transforms.js +279 -0
  36. package/dist-esm/src/transforms.js.map +1 -0
  37. package/dist-esm/src/util.js +35 -141
  38. package/dist-esm/src/util.js.map +1 -1
  39. package/package.json +24 -32
  40. package/types/ai-text-analytics.d.ts +1402 -1421
  41. package/LICENSE +0 -21
  42. package/dist-esm/src/analyzeActionsResult.js +0 -205
  43. package/dist-esm/src/analyzeActionsResult.js.map +0 -1
  44. package/dist-esm/src/analyzeHealthcareEntitiesResult.js +0 -53
  45. package/dist-esm/src/analyzeHealthcareEntitiesResult.js.map +0 -1
  46. package/dist-esm/src/analyzeLro.js +0 -132
  47. package/dist-esm/src/analyzeLro.js.map +0 -1
  48. package/dist-esm/src/analyzeSentimentResult.js +0 -74
  49. package/dist-esm/src/analyzeSentimentResult.js.map +0 -1
  50. package/dist-esm/src/analyzeSentimentResultArray.js +0 -11
  51. package/dist-esm/src/analyzeSentimentResultArray.js.map +0 -1
  52. package/dist-esm/src/detectLanguageResult.js +0 -17
  53. package/dist-esm/src/detectLanguageResult.js.map +0 -1
  54. package/dist-esm/src/detectLanguageResultArray.js +0 -11
  55. package/dist-esm/src/detectLanguageResultArray.js.map +0 -1
  56. package/dist-esm/src/extractKeyPhrasesResult.js +0 -17
  57. package/dist-esm/src/extractKeyPhrasesResult.js.map +0 -1
  58. package/dist-esm/src/extractKeyPhrasesResultArray.js +0 -11
  59. package/dist-esm/src/extractKeyPhrasesResultArray.js.map +0 -1
  60. package/dist-esm/src/extractSummaryResult.js +0 -17
  61. package/dist-esm/src/extractSummaryResult.js.map +0 -1
  62. package/dist-esm/src/extractSummaryResultArray.js +0 -11
  63. package/dist-esm/src/extractSummaryResultArray.js.map +0 -1
  64. package/dist-esm/src/generated/generatedClientContext.js +0 -42
  65. package/dist-esm/src/generated/generatedClientContext.js.map +0 -1
  66. package/dist-esm/src/healthLro.js +0 -139
  67. package/dist-esm/src/healthLro.js.map +0 -1
  68. package/dist-esm/src/multiCategoryClassifyResult.js +0 -17
  69. package/dist-esm/src/multiCategoryClassifyResult.js.map +0 -1
  70. package/dist-esm/src/multiCategoryClassifyResultArray.js +0 -11
  71. package/dist-esm/src/multiCategoryClassifyResultArray.js.map +0 -1
  72. package/dist-esm/src/pollerModels.js +0 -4
  73. package/dist-esm/src/pollerModels.js.map +0 -1
  74. package/dist-esm/src/recognizeCategorizedEntitiesResult.js +0 -17
  75. package/dist-esm/src/recognizeCategorizedEntitiesResult.js.map +0 -1
  76. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js +0 -11
  77. package/dist-esm/src/recognizeCategorizedEntitiesResultArray.js.map +0 -1
  78. package/dist-esm/src/recognizeCustomEntitiesResult.js +0 -17
  79. package/dist-esm/src/recognizeCustomEntitiesResult.js.map +0 -1
  80. package/dist-esm/src/recognizeCustomEntitiesResultArray.js +0 -11
  81. package/dist-esm/src/recognizeCustomEntitiesResultArray.js.map +0 -1
  82. package/dist-esm/src/recognizeLinkedEntitiesResult.js +0 -17
  83. package/dist-esm/src/recognizeLinkedEntitiesResult.js.map +0 -1
  84. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js +0 -11
  85. package/dist-esm/src/recognizeLinkedEntitiesResultArray.js.map +0 -1
  86. package/dist-esm/src/recognizePiiEntitiesResult.js +0 -18
  87. package/dist-esm/src/recognizePiiEntitiesResult.js.map +0 -1
  88. package/dist-esm/src/recognizePiiEntitiesResultArray.js +0 -11
  89. package/dist-esm/src/recognizePiiEntitiesResultArray.js.map +0 -1
  90. package/dist-esm/src/singleCategoryClassifyResult.js +0 -17
  91. package/dist-esm/src/singleCategoryClassifyResult.js.map +0 -1
  92. package/dist-esm/src/singleCategoryClassifyResultArray.js +0 -11
  93. package/dist-esm/src/singleCategoryClassifyResultArray.js.map +0 -1
  94. package/dist-esm/src/textAnalyticsAction.js +0 -4
  95. package/dist-esm/src/textAnalyticsAction.js.map +0 -1
  96. package/dist-esm/src/textAnalyticsClient.js +0 -511
  97. package/dist-esm/src/textAnalyticsClient.js.map +0 -1
  98. package/dist-esm/src/textAnalyticsOperationOptions.js +0 -4
  99. package/dist-esm/src/textAnalyticsOperationOptions.js.map +0 -1
  100. package/dist-esm/src/textAnalyticsResult.js +0 -94
  101. package/dist-esm/src/textAnalyticsResult.js.map +0 -1
  102. package/dist-esm/src/tracing.js +0 -12
  103. package/dist-esm/src/tracing.js.map +0 -1
@@ -5,7 +5,7 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { AnalyzeBatchInput as AnalyzeBatchInputMapper, MultiLanguageBatchInput as MultiLanguageBatchInputMapper, LanguageBatchInput as LanguageBatchInputMapper } from "../models/mappers";
8
+ import { AnalyzeAction as AnalyzeActionMapper, AnalyzeTextJobsInput as AnalyzeTextJobsInputMapper } from "../models/mappers";
9
9
  export const contentType = {
10
10
  parameterPath: ["options", "contentType"],
11
11
  mapper: {
@@ -18,13 +18,13 @@ export const contentType = {
18
18
  }
19
19
  };
20
20
  export const body = {
21
- parameterPath: ["options", "body"],
22
- mapper: AnalyzeBatchInputMapper
21
+ parameterPath: "body",
22
+ mapper: AnalyzeActionMapper
23
23
  };
24
24
  export const accept = {
25
25
  parameterPath: "accept",
26
26
  mapper: {
27
- defaultValue: "application/json, text/json",
27
+ defaultValue: "application/json",
28
28
  isConstant: true,
29
29
  serializedName: "Accept",
30
30
  type: {
@@ -46,20 +46,9 @@ export const endpoint = {
46
46
  export const apiVersion = {
47
47
  parameterPath: "apiVersion",
48
48
  mapper: {
49
- defaultValue: "v3.2-preview.2",
49
+ defaultValue: "2022-04-01-preview",
50
50
  isConstant: true,
51
- serializedName: "ApiVersion",
52
- type: {
53
- name: "String"
54
- }
55
- },
56
- skipEncoding: true
57
- };
58
- export const jobId = {
59
- parameterPath: "jobId",
60
- mapper: {
61
- serializedName: "jobId",
62
- required: true,
51
+ serializedName: "api-version",
63
52
  type: {
64
53
  name: "String"
65
54
  }
@@ -74,34 +63,11 @@ export const includeStatistics = {
74
63
  }
75
64
  }
76
65
  };
77
- export const top = {
78
- parameterPath: ["options", "top"],
79
- mapper: {
80
- defaultValue: 20,
81
- constraints: {
82
- InclusiveMaximum: 50,
83
- InclusiveMinimum: 1
84
- },
85
- serializedName: "$top",
86
- type: {
87
- name: "Number"
88
- }
89
- }
66
+ export const body1 = {
67
+ parameterPath: "body",
68
+ mapper: AnalyzeTextJobsInputMapper
90
69
  };
91
- export const skip = {
92
- parameterPath: ["options", "skip"],
93
- mapper: {
94
- defaultValue: 0,
95
- constraints: {
96
- InclusiveMinimum: 0
97
- },
98
- serializedName: "$skip",
99
- type: {
100
- name: "Number"
101
- }
102
- }
103
- };
104
- export const jobId1 = {
70
+ export const jobId = {
105
71
  parameterPath: "jobId",
106
72
  mapper: {
107
73
  serializedName: "jobId",
@@ -111,74 +77,21 @@ export const jobId1 = {
111
77
  }
112
78
  }
113
79
  };
114
- export const input = {
115
- parameterPath: "input",
116
- mapper: MultiLanguageBatchInputMapper
117
- };
118
- export const modelVersion = {
119
- parameterPath: ["options", "modelVersion"],
120
- mapper: {
121
- serializedName: "model-version",
122
- type: {
123
- name: "String"
124
- }
125
- }
126
- };
127
- export const stringIndexType = {
128
- parameterPath: ["options", "stringIndexType"],
129
- mapper: {
130
- serializedName: "stringIndexType",
131
- type: {
132
- name: "String"
133
- }
134
- }
135
- };
136
- export const loggingOptOut = {
137
- parameterPath: ["options", "loggingOptOut"],
138
- mapper: {
139
- serializedName: "loggingOptOut",
140
- type: {
141
- name: "Boolean"
142
- }
143
- }
144
- };
145
- export const domain = {
146
- parameterPath: ["options", "domain"],
80
+ export const top = {
81
+ parameterPath: ["options", "top"],
147
82
  mapper: {
148
- serializedName: "domain",
83
+ serializedName: "top",
149
84
  type: {
150
- name: "String"
85
+ name: "Number"
151
86
  }
152
87
  }
153
88
  };
154
- export const piiCategories = {
155
- parameterPath: ["options", "piiCategories"],
156
- mapper: {
157
- constraints: {
158
- UniqueItems: true
159
- },
160
- serializedName: "piiCategories",
161
- type: {
162
- name: "Sequence",
163
- element: {
164
- type: {
165
- name: "String"
166
- }
167
- }
168
- }
169
- },
170
- collectionFormat: "CSV"
171
- };
172
- export const input1 = {
173
- parameterPath: "input",
174
- mapper: LanguageBatchInputMapper
175
- };
176
- export const opinionMining = {
177
- parameterPath: ["options", "opinionMining"],
89
+ export const skip = {
90
+ parameterPath: ["options", "skip"],
178
91
  mapper: {
179
- serializedName: "opinionMining",
92
+ serializedName: "skip",
180
93
  type: {
181
- name: "Boolean"
94
+ name: "Number"
182
95
  }
183
96
  }
184
97
  };
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/generated/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EACL,iBAAiB,IAAI,uBAAuB,EAC5C,uBAAuB,IAAI,6BAA6B,EACxD,kBAAkB,IAAI,wBAAwB,EAC/C,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAuB;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACzC,MAAM,EAAE;QACN,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,cAAc;QAC9B,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAuB;IACtC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,uBAAuB;CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,QAAQ;IACvB,MAAM,EAAE;QACN,YAAY,EAAE,6BAA6B;QAC3C,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,QAAQ;QACxB,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC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CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,aAAa,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;IAC3C,MAAM,EAAE;QACN,WAAW,EAAE;YACX,WAAW,EAAE,IAAI;SAClB;QACD,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,OAAO;IACtB,MAAM,EAAE,wBAAwB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,aAAa,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;IAC3C,MAAM,EAAE;QACN,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;SAChB;KACF;CACF,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n AnalyzeBatchInput as AnalyzeBatchInputMapper,\n MultiLanguageBatchInput as MultiLanguageBatchInputMapper,\n LanguageBatchInput as LanguageBatchInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: [\"options\", \"body\"],\n mapper: AnalyzeBatchInputMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json, text/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"Endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const apiVersion: OperationURLParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"v3.2-preview.2\",\n isConstant: true,\n serializedName: \"ApiVersion\",\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const jobId: OperationURLParameter = {\n parameterPath: \"jobId\",\n mapper: {\n serializedName: \"jobId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const includeStatistics: OperationQueryParameter = {\n parameterPath: [\"options\", \"includeStatistics\"],\n mapper: {\n serializedName: \"showStats\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const top: OperationQueryParameter = {\n parameterPath: [\"options\", \"top\"],\n mapper: {\n defaultValue: 20,\n constraints: {\n InclusiveMaximum: 50,\n InclusiveMinimum: 1\n },\n serializedName: \"$top\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const skip: OperationQueryParameter = {\n parameterPath: [\"options\", \"skip\"],\n mapper: {\n defaultValue: 0,\n constraints: {\n InclusiveMinimum: 0\n },\n serializedName: \"$skip\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const jobId1: OperationURLParameter = {\n parameterPath: \"jobId\",\n mapper: {\n serializedName: \"jobId\",\n required: true,\n type: {\n name: \"Uuid\"\n }\n }\n};\n\nexport const input: OperationParameter = {\n parameterPath: \"input\",\n mapper: MultiLanguageBatchInputMapper\n};\n\nexport const modelVersion: OperationQueryParameter = {\n parameterPath: [\"options\", \"modelVersion\"],\n mapper: {\n serializedName: \"model-version\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const stringIndexType: OperationQueryParameter = {\n parameterPath: [\"options\", \"stringIndexType\"],\n mapper: {\n serializedName: \"stringIndexType\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const loggingOptOut: OperationQueryParameter = {\n parameterPath: [\"options\", \"loggingOptOut\"],\n mapper: {\n serializedName: \"loggingOptOut\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const domain: OperationQueryParameter = {\n parameterPath: [\"options\", \"domain\"],\n mapper: {\n serializedName: \"domain\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const piiCategories: OperationQueryParameter = {\n parameterPath: [\"options\", \"piiCategories\"],\n mapper: {\n constraints: {\n UniqueItems: true\n },\n serializedName: \"piiCategories\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"CSV\"\n};\n\nexport const input1: OperationParameter = {\n parameterPath: \"input\",\n mapper: LanguageBatchInputMapper\n};\n\nexport const opinionMining: OperationQueryParameter = {\n parameterPath: [\"options\", \"opinionMining\"],\n mapper: {\n serializedName: \"opinionMining\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n"]}
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/generated/models/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EACL,aAAa,IAAI,mBAAmB,EACpC,oBAAoB,IAAI,0BAA0B,EACnD,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAuB;IAC7C,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;IACzC,MAAM,EAAE;QACN,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,cAAc;QAC9B,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAuB;IACtC,aAAa,EAAE,MAAM;IACrB,MAAM,EAAE,mBAAmB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAuB;IACxC,aAAa,EAAE,QAAQ;IACvB,MAAM,EA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AQ;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAA4B;IAC3C,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE;QACN,cAAc,EAAE,MAAM;QACtB,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n AnalyzeAction as AnalyzeActionMapper,\n AnalyzeTextJobsInput as AnalyzeTextJobsInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: AnalyzeActionMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const endpoint: OperationURLParameter = {\n parameterPath: \"endpoint\",\n mapper: {\n serializedName: \"Endpoint\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const apiVersion: OperationQueryParameter = {\n parameterPath: \"apiVersion\",\n mapper: {\n defaultValue: \"2022-04-01-preview\",\n isConstant: true,\n serializedName: \"api-version\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const includeStatistics: OperationQueryParameter = {\n parameterPath: [\"options\", \"includeStatistics\"],\n mapper: {\n serializedName: \"showStats\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: AnalyzeTextJobsInputMapper\n};\n\nexport const jobId: OperationURLParameter = {\n parameterPath: \"jobId\",\n mapper: {\n serializedName: \"jobId\",\n required: true,\n type: {\n name: \"Uuid\"\n }\n }\n};\n\nexport const top: OperationQueryParameter = {\n parameterPath: [\"options\", \"top\"],\n mapper: {\n serializedName: \"top\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const skip: OperationQueryParameter = {\n parameterPath: [\"options\", \"skip\"],\n mapper: {\n serializedName: \"skip\",\n type: {\n name: \"Number\"\n }\n }\n};\n"]}
@@ -0,0 +1,105 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ import * as coreClient from "@azure/core-client";
9
+ import * as Mappers from "../models/mappers";
10
+ import * as Parameters from "../models/parameters";
11
+ /** Class containing AnalyzeText operations. */
12
+ export class AnalyzeTextImpl {
13
+ /**
14
+ * Initialize a new instance of the class AnalyzeText class.
15
+ * @param client Reference to the service client
16
+ */
17
+ constructor(client) {
18
+ this.client = client;
19
+ }
20
+ /**
21
+ * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed
22
+ * as a long-running operation.
23
+ * @param body Collection of documents to analyze and one or more tasks to execute.
24
+ * @param options The options parameters.
25
+ */
26
+ submitJob(body, options) {
27
+ return this.client.sendOperationRequest({ body, options }, submitJobOperationSpec);
28
+ }
29
+ /**
30
+ * Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are
31
+ * succeeded, the job will transition to the succeeded state and results will be available for each
32
+ * task.
33
+ * @param jobId Job ID
34
+ * @param options The options parameters.
35
+ */
36
+ jobStatus(jobId, options) {
37
+ return this.client.sendOperationRequest({ jobId, options }, jobStatusOperationSpec);
38
+ }
39
+ /**
40
+ * Cancel a long-running Text Analysis job.
41
+ * @param jobId Job ID
42
+ * @param options The options parameters.
43
+ */
44
+ cancelJob(jobId, options) {
45
+ return this.client.sendOperationRequest({ jobId, options }, cancelJobOperationSpec);
46
+ }
47
+ }
48
+ // Operation Specifications
49
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
50
+ const submitJobOperationSpec = {
51
+ path: "/analyze-text/jobs",
52
+ httpMethod: "POST",
53
+ responses: {
54
+ 202: {
55
+ headersMapper: Mappers.AnalyzeTextSubmitJobHeaders
56
+ },
57
+ default: {
58
+ bodyMapper: Mappers.ErrorResponse
59
+ }
60
+ },
61
+ requestBody: Parameters.body1,
62
+ queryParameters: [Parameters.apiVersion],
63
+ urlParameters: [Parameters.endpoint],
64
+ headerParameters: [Parameters.contentType, Parameters.accept],
65
+ mediaType: "json",
66
+ serializer
67
+ };
68
+ const jobStatusOperationSpec = {
69
+ path: "/analyze-text/jobs/{jobId}",
70
+ httpMethod: "GET",
71
+ responses: {
72
+ 200: {
73
+ bodyMapper: Mappers.AnalyzeTextJobState
74
+ },
75
+ default: {
76
+ bodyMapper: Mappers.ErrorResponse
77
+ }
78
+ },
79
+ queryParameters: [
80
+ Parameters.apiVersion,
81
+ Parameters.includeStatistics,
82
+ Parameters.top,
83
+ Parameters.skip
84
+ ],
85
+ urlParameters: [Parameters.endpoint, Parameters.jobId],
86
+ headerParameters: [Parameters.accept],
87
+ serializer
88
+ };
89
+ const cancelJobOperationSpec = {
90
+ path: "/analyze-text/jobs/{jobId}:cancel",
91
+ httpMethod: "POST",
92
+ responses: {
93
+ 202: {
94
+ headersMapper: Mappers.AnalyzeTextCancelJobHeaders
95
+ },
96
+ default: {
97
+ bodyMapper: Mappers.ErrorResponse
98
+ }
99
+ },
100
+ queryParameters: [Parameters.apiVersion],
101
+ urlParameters: [Parameters.endpoint, Parameters.jobId],
102
+ headerParameters: [Parameters.accept],
103
+ serializer
104
+ };
105
+ //# sourceMappingURL=analyzeText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzeText.js","sourceRoot":"","sources":["../../../../src/generated/operations/analyz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;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,sBAAsB,GAA6B;IACvD,IAAI,EAAE,4BAA4B;IAClC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,iBAAiB;QAC5B,UAAU,CAAC,GAAG;QACd,UAAU,CAAC,IAAI;KAChB;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;IACtD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,sBAAsB,GAA6B;IACvD,IAAI,EAAE,mCAAmC;IACzC,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,aAAa,EAAE,OAAO,CAAC,2BAA2B;SACnD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;IACtD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { AnalyzeText } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { GeneratedClient } from \"../generatedClient\";\nimport {\n AnalyzeTextJobsInput,\n AnalyzeTextSubmitJobOptionalParams,\n AnalyzeTextSubmitJobResponse,\n AnalyzeTextJobStatusOptionalParams,\n AnalyzeTextJobStatusResponse,\n AnalyzeTextCancelJobOptionalParams,\n AnalyzeTextCancelJobResponse\n} from \"../models\";\n\n/** Class containing AnalyzeText operations. */\nexport class AnalyzeTextImpl implements AnalyzeText {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class AnalyzeText class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed\n * as a long-running operation.\n * @param body Collection of documents to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n submitJob(\n body: AnalyzeTextJobsInput,\n options?: AnalyzeTextSubmitJobOptionalParams\n ): Promise<AnalyzeTextSubmitJobResponse> {\n return this.client.sendOperationRequest(\n { body, options },\n submitJobOperationSpec\n );\n }\n\n /**\n * Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are\n * succeeded, the job will transition to the succeeded state and results will be available for each\n * task.\n * @param jobId Job ID\n * @param options The options parameters.\n */\n jobStatus(\n jobId: string,\n options?: AnalyzeTextJobStatusOptionalParams\n ): Promise<AnalyzeTextJobStatusResponse> {\n return this.client.sendOperationRequest(\n { jobId, options },\n jobStatusOperationSpec\n );\n }\n\n /**\n * Cancel a long-running Text Analysis job.\n * @param jobId Job ID\n * @param options The options parameters.\n */\n cancelJob(\n jobId: string,\n options?: AnalyzeTextCancelJobOptionalParams\n ): Promise<AnalyzeTextCancelJobResponse> {\n return this.client.sendOperationRequest(\n { jobId, options },\n cancelJobOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst submitJobOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-text/jobs\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.AnalyzeTextSubmitJobHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst jobStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-text/jobs/{jobId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeTextJobState\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.includeStatistics,\n Parameters.top,\n Parameters.skip\n ],\n urlParameters: [Parameters.endpoint, Parameters.jobId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst cancelJobOperationSpec: coreClient.OperationSpec = {\n path: \"/analyze-text/jobs/{jobId}:cancel\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.AnalyzeTextCancelJobHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.jobId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ export * from "./analyzeText";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,eAAe,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./analyzeText\";\n"]}
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=analyzeText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzeText.js","sourceRoot":"","sources":["../../../../src/generated/operationsInterfaces/analyzeText.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n AnalyzeTextJobsInput,\n AnalyzeTextSubmitJobOptionalParams,\n AnalyzeTextSubmitJobResponse,\n AnalyzeTextJobStatusOptionalParams,\n AnalyzeTextJobStatusResponse,\n AnalyzeTextCancelJobOptionalParams,\n AnalyzeTextCancelJobResponse\n} from \"../models\";\n\n/** Interface representing a AnalyzeText. */\nexport interface AnalyzeText {\n /**\n * Submit a collection of text documents for analysis. Specify one or more unique tasks to be executed\n * as a long-running operation.\n * @param body Collection of documents to analyze and one or more tasks to execute.\n * @param options The options parameters.\n */\n submitJob(\n body: AnalyzeTextJobsInput,\n options?: AnalyzeTextSubmitJobOptionalParams\n ): Promise<AnalyzeTextSubmitJobResponse>;\n /**\n * Get the status of an analysis job. A job may consist of one or more tasks. Once all tasks are\n * succeeded, the job will transition to the succeeded state and results will be available for each\n * task.\n * @param jobId Job ID\n * @param options The options parameters.\n */\n jobStatus(\n jobId: string,\n options?: AnalyzeTextJobStatusOptionalParams\n ): Promise<AnalyzeTextJobStatusResponse>;\n /**\n * Cancel a long-running Text Analysis job.\n * @param jobId Job ID\n * @param options The options parameters.\n */\n cancelJob(\n jobId: string,\n options?: AnalyzeTextCancelJobOptionalParams\n ): Promise<AnalyzeTextCancelJobResponse>;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+ export * from "./analyzeText";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/operationsInterfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,eAAe,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./analyzeText\";\n"]}
@@ -1,9 +1,18 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- /// <reference lib="esnext.asynciterable" />
4
- import "@azure/core-asynciterator-polyfill";
3
+ /**
4
+ * [Azure Cognitive Language Services](https://docs.microsoft.com/azure/cognitive-services/language-service/overview)
5
+ * is a suite of natural language processing (NLP) skills built with
6
+ * best-in-class Microsoft machine learning algorithms used to analyze
7
+ * unstructured text for actions such as sentiment analysis, key phrase
8
+ * extraction, and language detection.
9
+ *
10
+ * @packageDocumentation
11
+ */
5
12
  export { AzureKeyCredential } from "@azure/core-auth";
6
- export { TextAnalyticsClient, PiiEntityDomain } from "./textAnalyticsClient";
7
- // Models
8
- export { KnownInnerErrorCodeValue, KnownWarningCode, KnownHealthcareEntityCategory } from "./generated/models";
13
+ export { TextAnalysisClient } from "./textAnalysisClient";
14
+ export * from "./models";
15
+ export {
16
+ /** orphan exports */
17
+ KnownPiiDomain, KnownPiiCategory, KnownStringIndexType, KnownErrorCode, KnownInnerErrorCode, KnownExtractiveSummarizationOrderingCriteria, } from "./generated/models";
9
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,4CAA4C;AAE5C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,mBAAmB,EAQnB,eAAe,EAsBhB,MAAM,uBAAuB,CAAC;AA+H/B,SAAS;AACT,OAAO,EAYL,wBAAwB,EAExB,gBAAgB,EAchB,6BAA6B,EAG9B,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport \"@azure/core-asynciterator-polyfill\";\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport {\n TextAnalyticsClient,\n TextAnalyticsClientOptions,\n DetectLanguageOptions,\n RecognizeCategorizedEntitiesOptions,\n AnalyzeSentimentOptions,\n ExtractKeyPhrasesOptions,\n RecognizePiiEntitiesOptions,\n RecognizeLinkedEntitiesOptions,\n PiiEntityDomain,\n TextAnalyticsActions,\n RecognizeCategorizedEntitiesAction,\n RecognizePiiEntitiesAction,\n ExtractKeyPhrasesAction,\n BeginAnalyzeActionsOptions,\n AnalyzeActionsPollerLike,\n BeginAnalyzeHealthcareEntitiesOptions,\n AnalyzeHealthcareEntitiesPollerLike,\n AnalyzeActionsOperationState,\n AnalyzeHealthcareOperationState,\n AnalysisPollOperationState,\n OperationMetadata,\n AnalyzeActionsOperationMetadata,\n StringIndexType,\n RecognizeLinkedEntitiesAction,\n AnalyzeSentimentAction,\n ExtractSummaryAction,\n KnownSummarySentencesSortBy as KnownSummarySentencesOrderBy,\n RecognizeCustomEntitiesAction,\n SingleCategoryClassifyAction,\n MultiCategoryClassifyAction\n} from \"./textAnalyticsClient\";\nexport { TextAnalyticsOperationOptions } from \"./textAnalyticsOperationOptions\";\nexport {\n DetectLanguageResult,\n DetectLanguageErrorResult,\n DetectLanguageSuccessResult\n} from \"./detectLanguageResult\";\nexport { DetectLanguageResultArray } from \"./detectLanguageResultArray\";\nexport {\n CategorizedEntity,\n RecognizeCategorizedEntitiesResult,\n RecognizeCategorizedEntitiesErrorResult,\n RecognizeCategorizedEntitiesSuccessResult\n} from \"./recognizeCategorizedEntitiesResult\";\nexport {\n PiiEntity,\n RecognizePiiEntitiesResult,\n RecognizePiiEntitiesErrorResult,\n RecognizePiiEntitiesSuccessResult\n} from \"./recognizePiiEntitiesResult\";\nexport { RecognizePiiEntitiesResultArray } from \"./recognizePiiEntitiesResultArray\";\nexport { RecognizeCategorizedEntitiesResultArray } from \"./recognizeCategorizedEntitiesResultArray\";\nexport {\n AnalyzeSentimentResult,\n AnalyzeSentimentErrorResult,\n AnalyzeSentimentSuccessResult,\n SentenceSentiment,\n Opinion,\n TargetSentiment,\n AssessmentSentiment\n} from \"./analyzeSentimentResult\";\nexport { AnalyzeSentimentResultArray } from \"./analyzeSentimentResultArray\";\nexport {\n ExtractKeyPhrasesResult,\n ExtractKeyPhrasesErrorResult,\n ExtractKeyPhrasesSuccessResult\n} from \"./extractKeyPhrasesResult\";\nexport { ExtractKeyPhrasesResultArray } from \"./extractKeyPhrasesResultArray\";\nexport {\n ExtractSummaryResult,\n ExtractSummaryErrorResult,\n ExtractSummarySuccessResult,\n SummarySentence\n} from \"./extractSummaryResult\";\nexport { ExtractSummaryResultArray } from \"./extractSummaryResultArray\";\nexport {\n RecognizeCustomEntitiesErrorResult,\n RecognizeCustomEntitiesResult,\n RecognizeCustomEntitiesSuccessResult\n} from \"./recognizeCustomEntitiesResult\";\nexport { RecognizeCustomEntitiesResultArray } from \"./recognizeCustomEntitiesResultArray\";\nexport {\n SingleCategoryClassifyErrorResult,\n SingleCategoryClassifyResult,\n SingleCategoryClassifySuccessResult,\n ClassificationCategory\n} from \"./singleCategoryClassifyResult\";\nexport { SingleCategoryClassifyResultArray } from \"./singleCategoryClassifyResultArray\";\nexport {\n MultiCategoryClassifyErrorResult,\n MultiCategoryClassifyResult,\n MultiCategoryClassifySuccessResult\n} from \"./multiCategoryClassifyResult\";\nexport { MultiCategoryClassifyResultArray } from \"./multiCategoryClassifyResultArray\";\nexport {\n RecognizeLinkedEntitiesResult,\n RecognizeLinkedEntitiesErrorResult,\n RecognizeLinkedEntitiesSuccessResult\n} from \"./recognizeLinkedEntitiesResult\";\nexport { RecognizeLinkedEntitiesResultArray } from \"./recognizeLinkedEntitiesResultArray\";\nexport {\n PagedAnalyzeHealthcareEntitiesResult,\n PagedAsyncIterableAnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareEntitiesResultArray,\n AnalyzeHealthcareEntitiesResult,\n AnalyzeHealthcareEntitiesSuccessResult,\n AnalyzeHealthcareEntitiesErrorResult,\n HealthcareEntity,\n EntityDataSource,\n HealthcareEntityRelation,\n HealthcareEntityRelationRole,\n HealthcareEntityRelationRoleType\n} from \"./analyzeHealthcareEntitiesResult\";\nexport {\n PagedAnalyzeActionsResult,\n PagedAsyncIterableAnalyzeActionsResult,\n AnalyzeActionsResult,\n RecognizeCategorizedEntitiesActionResult,\n RecognizePiiEntitiesActionResult,\n ExtractKeyPhrasesActionResult,\n TextAnalyticsActionState,\n TextAnalyticsActionSuccessState,\n TextAnalyticsActionErrorResult,\n RecognizeCategorizedEntitiesActionErrorResult,\n RecognizeCategorizedEntitiesActionSuccessResult,\n RecognizePiiEntitiesActionErrorResult,\n RecognizePiiEntitiesActionSuccessResult,\n ExtractKeyPhrasesActionErrorResult,\n ExtractKeyPhrasesActionSuccessResult,\n RecognizeLinkedEntitiesActionResult,\n RecognizeLinkedEntitiesActionSuccessResult,\n RecognizeLinkedEntitiesActionErrorResult,\n AnalyzeSentimentActionErrorResult,\n AnalyzeSentimentActionResult,\n AnalyzeSentimentActionSuccessResult,\n ExtractSummaryActionResult,\n ExtractSummaryActionSuccessResult,\n ExtractSummaryActionErrorResult,\n RecognizeCustomEntitiesActionResult,\n RecongizeCustomEntitiesActionErrorResult,\n RecongizeCustomEntitiesActionSuccessResult,\n MultiCategoryClassifyActionErrorResult,\n MultiCategoryClassifyActionResult,\n MultiCategoryClassifyActionSuccessResult,\n SingleCategoryClassifyActionErrorResult,\n SingleCategoryClassifyActionResult,\n SingleCategoryClassifyActionSuccessResult\n} from \"./analyzeActionsResult\";\nexport {\n ErrorCode,\n TextAnalyticsError,\n TextAnalyticsErrorResult,\n TextAnalyticsSuccessResult\n} from \"./textAnalyticsResult\";\n\nexport { TextAnalyticsAction, CustomTextAnalyticsAction } from \"./textAnalyticsAction\";\n\n// Models\nexport {\n DetectedLanguage,\n TextDocumentStatistics,\n SentimentConfidenceScores,\n TextDocumentInput,\n DetectLanguageInput,\n TextDocumentBatchStatistics,\n Entity,\n DocumentSentimentLabel,\n SentenceSentimentLabel,\n ErrorCodeValue,\n InnerErrorCodeValue,\n KnownInnerErrorCodeValue,\n WarningCode,\n KnownWarningCode,\n LinkedEntity,\n Match,\n SentenceAssessment,\n TargetConfidenceScoreLabel,\n TokenSentimentValue,\n TextAnalyticsWarning,\n State as TextAnalyticsOperationStatus,\n HealthcareAssertion as EntityAssertion,\n PiiCategory as PiiEntityCategory,\n Association as EntityAssociation,\n Certainty as EntityCertainty,\n Conditionality as EntityConditionality,\n RelationType as HealthcareEntityRelationType,\n KnownHealthcareEntityCategory,\n HealthcareEntityCategory,\n ClassificationResult\n} from \"./generated/models\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,OAAO;AA6CL,qBAAqB;AACrB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,4CAA4C,GAE7C,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * [Azure Cognitive Language Services](https://docs.microsoft.com/azure/cognitive-services/language-service/overview)\n * is a suite of natural language processing (NLP) skills built with\n * best-in-class Microsoft machine learning algorithms used to analyze\n * unstructured text for actions such as sentiment analysis, key phrase\n * extraction, and language detection.\n *\n * @packageDocumentation\n */\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport { TextAnalysisClient } from \"./textAnalysisClient\";\nexport * from \"./models\";\nexport {\n AssessmentSentiment,\n SentimentAnalysisAction,\n EntityLinkingAction,\n EntityRecognitionAction,\n KeyPhraseExtractionAction,\n LanguageDetectionAction,\n PiiEntityRecognitionAction,\n StringIndexType,\n LinkedEntity,\n Entity,\n DetectedLanguage,\n PiiCategory,\n PiiDomain,\n SentimentConfidenceScores,\n SentenceSentimentLabel,\n DocumentSentimentLabel,\n TargetConfidenceScores,\n TokenSentimentLabel,\n LanguageDetectionInput,\n TextDocumentInput,\n TextDocumentStatistics,\n DocumentWarning,\n WarningCode,\n Match,\n ActionCommon,\n ActionPrebuilt,\n HealthcareAction,\n CustomEntityRecognitionAction,\n CustomSingleLabelClassificationAction,\n CustomMultiLabelClassificationAction,\n ExtractiveSummarizationAction,\n OperationStatus,\n ActionCustom,\n ClassificationCategory,\n HealthcareAssertion,\n HealthcareEntityCategory,\n ExtractiveSummarizationOrderingCriteria,\n SummarySentence,\n EntityDataSource,\n RelationType,\n Association,\n Certainty,\n Conditionality,\n FhirVersion,\n /** orphan exports */\n KnownPiiDomain,\n KnownPiiCategory,\n KnownStringIndexType,\n KnownErrorCode,\n KnownInnerErrorCode,\n KnownExtractiveSummarizationOrderingCriteria,\n TextDocumentBatchStatistics,\n} from \"./generated/models\";\n"]}
@@ -0,0 +1,195 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import * as Mappers from "./generated/models/mappers";
4
+ import * as Parameters from "./generated/models/parameters";
5
+ import { createSerializer, } from "@azure/core-client";
6
+ import { getPagedAsyncIterator } from "@azure/core-paging";
7
+ import { transformAnalyzeBatchResults, transformError } from "./transforms";
8
+ import { clientName } from "./constants";
9
+ import { logger } from "./logger";
10
+ const serializer = createSerializer(Mappers, /* isXml */ false);
11
+ const jobStatusOperationSpec = {
12
+ httpMethod: "GET",
13
+ responses: {
14
+ 200: {
15
+ bodyMapper: Mappers.AnalyzeTextJobState,
16
+ },
17
+ default: {
18
+ bodyMapper: Mappers.ErrorResponse,
19
+ },
20
+ },
21
+ headerParameters: [Parameters.accept],
22
+ queryParameters: [Parameters.top, Parameters.skip, Parameters.includeStatistics],
23
+ serializer,
24
+ };
25
+ async function getRawResponse(getResponse, options) {
26
+ const { onResponse } = options || {};
27
+ let rawResponse = undefined;
28
+ const flatResponse = await getResponse(Object.assign(Object.assign({}, options), { onResponse: (response, flatResponseParam) => {
29
+ rawResponse = response;
30
+ onResponse === null || onResponse === void 0 ? void 0 : onResponse(response, flatResponseParam);
31
+ } }));
32
+ return {
33
+ flatResponse,
34
+ rawResponse: {
35
+ statusCode: rawResponse.status,
36
+ headers: rawResponse.headers.toJSON(),
37
+ body: rawResponse.parsedBody,
38
+ },
39
+ };
40
+ }
41
+ async function sendRequest(settings) {
42
+ const { client, opOptions, path, spanStr, spec, tracing, httpMethod = "GET" } = settings;
43
+ return tracing.withSpan(spanStr, opOptions, async (finalOptions) => {
44
+ try {
45
+ const response = getRawResponse((options) => client.sendOperationRequest({ options }, Object.assign(Object.assign({}, spec), { path,
46
+ httpMethod })), finalOptions);
47
+ return response;
48
+ }
49
+ catch (e) {
50
+ throw transformError(e);
51
+ }
52
+ });
53
+ }
54
+ /**
55
+ * @internal
56
+ */
57
+ export function createSendPollRequest(settings) {
58
+ const { client, options, tracing, spanStr } = settings;
59
+ return async (path) => {
60
+ return throwTransformErrors(sendRequest({
61
+ client,
62
+ opOptions: options,
63
+ path,
64
+ spanStr,
65
+ spec: jobStatusOperationSpec,
66
+ tracing,
67
+ }));
68
+ };
69
+ }
70
+ /**
71
+ * @internal
72
+ */
73
+ export function createAnalyzeBatchLro(settings) {
74
+ const { client, commonOptions, documents, initialRequestOptions, pollRequestOptions, tasks, tracing, } = settings;
75
+ return {
76
+ requestMethod: "POST",
77
+ requestPath: "/analyze-text/jobs",
78
+ async sendInitialRequest() {
79
+ return tracing.withSpan(`${clientName}.beginAnalyzeBatch`, Object.assign(Object.assign({}, commonOptions), initialRequestOptions), async (finalOptions) => throwTransformErrors(getRawResponse((paramOptions) => client.analyzeText.submitJob({
80
+ tasks,
81
+ analysisInput: {
82
+ documents,
83
+ },
84
+ displayName: initialRequestOptions.displayName,
85
+ }, paramOptions), finalOptions)));
86
+ },
87
+ sendPollRequest: createSendPollRequest({
88
+ client,
89
+ options: Object.assign(Object.assign({}, commonOptions), pollRequestOptions),
90
+ spanStr: `${clientName}.beginAnalyzeBatch`,
91
+ tracing,
92
+ }),
93
+ };
94
+ }
95
+ /**
96
+ * @internal
97
+ */
98
+ export function getDocsFromState(serializedState) {
99
+ try {
100
+ const { documents } = JSON.parse(serializedState).state;
101
+ return documents;
102
+ }
103
+ catch (e) {
104
+ logger.error(`Documents are not found in the LRO's state. The results may not be ordered correctly.`);
105
+ return [];
106
+ }
107
+ }
108
+ /**
109
+ * @internal
110
+ */
111
+ export function createCreateAnalyzeBatchPollerLro(settings) {
112
+ const { client, options, tracing } = settings;
113
+ return {
114
+ requestMethod: "POST",
115
+ requestPath: "/analyze-text/jobs",
116
+ async sendInitialRequest() {
117
+ throw new Error(`The operation has already started`);
118
+ },
119
+ sendPollRequest: createSendPollRequest({
120
+ client,
121
+ options,
122
+ spanStr: `${clientName}.beginAnalyzeBatch`,
123
+ tracing,
124
+ }),
125
+ };
126
+ }
127
+ /**
128
+ * @internal
129
+ */
130
+ export function processAnalyzeResult(options) {
131
+ return (_result, state) => {
132
+ const { client, documents, opOptions, tracing, continuationToken } = options;
133
+ const pageURL = continuationToken !== null && continuationToken !== void 0 ? continuationToken : state.pollingURL;
134
+ const pagedResult = {
135
+ firstPageLink: pageURL,
136
+ getPage: async (pageLink, maxPageSize) => {
137
+ const response = await sendRequest({
138
+ client,
139
+ spec: jobStatusOperationSpec,
140
+ spanStr: `${clientName}.beginAnalyzeBatch`,
141
+ // if `top` is set to `undefined`, the default value will not be sent
142
+ // as part of the request.
143
+ opOptions: maxPageSize ? Object.assign(Object.assign({}, opOptions), { top: maxPageSize }) : opOptions,
144
+ path: pageLink,
145
+ tracing,
146
+ });
147
+ const flatResponse = response.flatResponse;
148
+ return {
149
+ page: transformAnalyzeBatchResults(documents, flatResponse.tasks.items),
150
+ nextPageLink: flatResponse.nextLink,
151
+ };
152
+ },
153
+ };
154
+ return getPagedAsyncIterator(pagedResult);
155
+ };
156
+ }
157
+ /**
158
+ * @internal
159
+ */
160
+ export function createUpdateAnalyzeState(documents) {
161
+ return (state, lastResponse) => {
162
+ const { createdOn, lastModifiedOn, operationId, status, displayName, expiresOn, tasks } = lastResponse.body;
163
+ const mutableState = state;
164
+ mutableState.createdOn = createdOn;
165
+ mutableState.lastModifiedOn = lastModifiedOn;
166
+ mutableState.expiresOn = expiresOn;
167
+ mutableState.displayName = displayName;
168
+ mutableState.operationId = operationId;
169
+ mutableState.status = status;
170
+ mutableState.actionSucceededCount = tasks.completed;
171
+ mutableState.actionFailedCount = tasks.failed;
172
+ mutableState.actionInProgressCount = tasks.inProgress;
173
+ if (mutableState.documents === undefined && documents !== undefined) {
174
+ mutableState.documents = documents;
175
+ }
176
+ };
177
+ }
178
+ async function throwTransformErrors(p) {
179
+ try {
180
+ return await p;
181
+ }
182
+ catch (e) {
183
+ throw transformError(e);
184
+ }
185
+ }
186
+ /**
187
+ * @internal
188
+ */
189
+ export function createCancelOperation(settings) {
190
+ return async ({ operationId }) => {
191
+ const { client, options, tracing } = settings;
192
+ await tracing.withSpan(`${clientName}.beginAnalyzeBatch`, options, async (finalOptions) => throwTransformErrors(getRawResponse((paramOptions) => client.analyzeText.cancelJob(operationId, paramOptions), finalOptions)));
193
+ };
194
+ }
195
+ //# sourceMappingURL=lro.js.map