@azure/data-tables 13.2.3-alpha.20240419.1 → 13.3.0-alpha.20240920.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 (105) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +62 -57
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/TableClient.js +6 -4
  5. package/dist-esm/src/TableClient.js.map +1 -1
  6. package/dist-esm/src/TablePolicies.js +1 -1
  7. package/dist-esm/src/TablePolicies.js.map +1 -1
  8. package/dist-esm/src/TableServiceClient.js +6 -3
  9. package/dist-esm/src/TableServiceClient.js.map +1 -1
  10. package/dist-esm/src/TableTransaction.js +1 -1
  11. package/dist-esm/src/TableTransaction.js.map +1 -1
  12. package/dist-esm/src/cosmosPathPolicy.js +1 -1
  13. package/dist-esm/src/cosmosPathPolicy.js.map +1 -1
  14. package/dist-esm/src/generated/generatedClientContext.js +1 -1
  15. package/dist-esm/src/generated/generatedClientContext.js.map +1 -1
  16. package/dist-esm/src/generatedModels.js +1 -1
  17. package/dist-esm/src/generatedModels.js.map +1 -1
  18. package/dist-esm/src/index.js +1 -1
  19. package/dist-esm/src/index.js.map +1 -1
  20. package/dist-esm/src/logger.js +1 -1
  21. package/dist-esm/src/logger.js.map +1 -1
  22. package/dist-esm/src/models.js +1 -1
  23. package/dist-esm/src/models.js.map +1 -1
  24. package/dist-esm/src/odata.js +1 -1
  25. package/dist-esm/src/odata.js.map +1 -1
  26. package/dist-esm/src/sas/accountSasPermissions.js +1 -1
  27. package/dist-esm/src/sas/accountSasPermissions.js.map +1 -1
  28. package/dist-esm/src/sas/accountSasResourceTypes.js +1 -1
  29. package/dist-esm/src/sas/accountSasResourceTypes.js.map +1 -1
  30. package/dist-esm/src/sas/accountSasServices.js +1 -1
  31. package/dist-esm/src/sas/accountSasServices.js.map +1 -1
  32. package/dist-esm/src/sas/accountSasSignatureValues.js +1 -1
  33. package/dist-esm/src/sas/accountSasSignatureValues.js.map +1 -1
  34. package/dist-esm/src/sas/generateAccountSas.js +1 -1
  35. package/dist-esm/src/sas/generateAccountSas.js.map +1 -1
  36. package/dist-esm/src/sas/generateTableSas.js +1 -1
  37. package/dist-esm/src/sas/generateTableSas.js.map +1 -1
  38. package/dist-esm/src/sas/index.js +1 -1
  39. package/dist-esm/src/sas/index.js.map +1 -1
  40. package/dist-esm/src/sas/models.js +1 -1
  41. package/dist-esm/src/sas/models.js.map +1 -1
  42. package/dist-esm/src/sas/sasIPRange.js +1 -1
  43. package/dist-esm/src/sas/sasIPRange.js.map +1 -1
  44. package/dist-esm/src/sas/sasQueryParameters.js +1 -1
  45. package/dist-esm/src/sas/sasQueryParameters.js.map +1 -1
  46. package/dist-esm/src/sas/tableSasPermisions.js +1 -1
  47. package/dist-esm/src/sas/tableSasPermisions.js.map +1 -1
  48. package/dist-esm/src/sas/tableSasSignatureValues.js +1 -1
  49. package/dist-esm/src/sas/tableSasSignatureValues.js.map +1 -1
  50. package/dist-esm/src/secondaryEndpointPolicy.js +1 -1
  51. package/dist-esm/src/secondaryEndpointPolicy.js.map +1 -1
  52. package/dist-esm/src/serialization.js +1 -1
  53. package/dist-esm/src/serialization.js.map +1 -1
  54. package/dist-esm/src/tablesNamedCredentialPolicy.browser.js +1 -1
  55. package/dist-esm/src/tablesNamedCredentialPolicy.browser.js.map +1 -1
  56. package/dist-esm/src/tablesNamedCredentialPolicy.js +1 -1
  57. package/dist-esm/src/tablesNamedCredentialPolicy.js.map +1 -1
  58. package/dist-esm/src/tablesSASTokenPolicy.js +1 -1
  59. package/dist-esm/src/tablesSASTokenPolicy.js.map +1 -1
  60. package/dist-esm/src/utils/accountConnectionString.browser.js +1 -1
  61. package/dist-esm/src/utils/accountConnectionString.browser.js.map +1 -1
  62. package/dist-esm/src/utils/accountConnectionString.js +1 -1
  63. package/dist-esm/src/utils/accountConnectionString.js.map +1 -1
  64. package/dist-esm/src/utils/apiVersionPolicy.js +1 -1
  65. package/dist-esm/src/utils/apiVersionPolicy.js.map +1 -1
  66. package/dist-esm/src/utils/baseTransactionHeaders.js +1 -1
  67. package/dist-esm/src/utils/baseTransactionHeaders.js.map +1 -1
  68. package/dist-esm/src/utils/bufferSerializer.browser.js +1 -1
  69. package/dist-esm/src/utils/bufferSerializer.browser.js.map +1 -1
  70. package/dist-esm/src/utils/bufferSerializer.js +1 -1
  71. package/dist-esm/src/utils/bufferSerializer.js.map +1 -1
  72. package/dist-esm/src/utils/challengeAuthenticationUtils.js +1 -1
  73. package/dist-esm/src/utils/challengeAuthenticationUtils.js.map +1 -1
  74. package/dist-esm/src/utils/computeHMACSHA256.browser.js +1 -1
  75. package/dist-esm/src/utils/computeHMACSHA256.browser.js.map +1 -1
  76. package/dist-esm/src/utils/computeHMACSHA256.js +1 -1
  77. package/dist-esm/src/utils/computeHMACSHA256.js.map +1 -1
  78. package/dist-esm/src/utils/connectionString.js +1 -1
  79. package/dist-esm/src/utils/connectionString.js.map +1 -1
  80. package/dist-esm/src/utils/constants.js +2 -1
  81. package/dist-esm/src/utils/constants.js.map +1 -1
  82. package/dist-esm/src/utils/continuationToken.js +1 -1
  83. package/dist-esm/src/utils/continuationToken.js.map +1 -1
  84. package/dist-esm/src/utils/errorHelpers.js +1 -1
  85. package/dist-esm/src/utils/errorHelpers.js.map +1 -1
  86. package/dist-esm/src/utils/internalModels.js +1 -1
  87. package/dist-esm/src/utils/internalModels.js.map +1 -1
  88. package/dist-esm/src/utils/isCosmosEndpoint.js +1 -1
  89. package/dist-esm/src/utils/isCosmosEndpoint.js.map +1 -1
  90. package/dist-esm/src/utils/isCredential.js +1 -1
  91. package/dist-esm/src/utils/isCredential.js.map +1 -1
  92. package/dist-esm/src/utils/tracing.js +2 -2
  93. package/dist-esm/src/utils/tracing.js.map +1 -1
  94. package/dist-esm/src/utils/transactionHeaders.browser.js +1 -1
  95. package/dist-esm/src/utils/transactionHeaders.browser.js.map +1 -1
  96. package/dist-esm/src/utils/transactionHeaders.js +1 -1
  97. package/dist-esm/src/utils/transactionHeaders.js.map +1 -1
  98. package/dist-esm/src/utils/transactionHelpers.js +1 -1
  99. package/dist-esm/src/utils/transactionHelpers.js.map +1 -1
  100. package/dist-esm/src/utils/truncateISO8061Date.js +1 -1
  101. package/dist-esm/src/utils/truncateISO8061Date.js.map +1 -1
  102. package/dist-esm/src/utils/uuid.js +1 -1
  103. package/dist-esm/src/utils/uuid.js.map +1 -1
  104. package/package.json +7 -7
  105. package/types/latest/tsdoc-metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAIjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;OAIG;IACH,YAAY,GAAW,EAAE,OAAuC;QAC9D,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,6BAA6B,CAAC;QACrD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,GACrC,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,0CAA0C;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC;IACjD,CAAC;CACF","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 * as coreClient from \"@azure/core-client\";\n\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n url: string;\n version: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param url The URL of the service account or table that is the target of the desired operation.\n * @param options The parameter options\n */\n constructor(url: string, options?: GeneratedClientOptionalParams) {\n if (url === undefined) {\n throw new Error(\"'url' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-data-tables/13.2.3`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{url}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.url = url;\n\n // Assigning values to Constant parameters\n this.version = options.version || \"2020-12-06\";\n }\n}\n"]}
1
+ {"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAIjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;OAIG;IACH,YAAY,GAAW,EAAE,OAAuC;QAC9D,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,6BAA6B,CAAC;QACrD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,GACrC,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,0CAA0C;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC;IACjD,CAAC;CACF","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 * as coreClient from \"@azure/core-client\";\n\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n url: string;\n version: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param url The URL of the service account or table that is the target of the desired operation.\n * @param options The parameter options\n */\n constructor(url: string, options?: GeneratedClientOptionalParams) {\n if (url === undefined) {\n throw new Error(\"'url' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-data-tables/13.3.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{url}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.url = url;\n\n // Assigning values to Constant parameters\n this.version = options.version || \"2020-12-06\";\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export { KnownGeoReplicationStatusType, } from "./generated/models";
4
4
  //# sourceMappingURL=generatedModels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generatedModels.js","sourceRoot":"","sources":["../../src/generatedModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAkBL,6BAA6B,GAW9B,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n ServiceGetStatisticsResponse as GetStatisticsResponse,\n ServiceGetPropertiesResponse as GetPropertiesResponse,\n ServiceSetPropertiesOptionalParams as SetPropertiesOptions,\n TableServiceProperties as ServiceProperties,\n ServiceSetPropertiesResponse as SetPropertiesResponse,\n TableDeleteEntityResponse as DeleteTableEntityResponse,\n TableUpdateEntityResponse as UpdateEntityResponse,\n TableMergeEntityResponse as UpsertEntityResponse,\n TableSetAccessPolicyResponse as SetAccessPolicyResponse,\n TableInsertEntityHeaders,\n TableCreateHeaders,\n TableDeleteEntityHeaders,\n TableDeleteHeaders,\n TableGetAccessPolicyHeaders,\n ServiceGetPropertiesHeaders,\n ServiceGetStatisticsHeaders,\n GeoReplicationStatusType,\n KnownGeoReplicationStatusType,\n GeoReplication,\n TableServiceStats,\n TableMergeEntityHeaders,\n CorsRule,\n Metrics,\n RetentionPolicy,\n Logging,\n TableSetAccessPolicyHeaders,\n ServiceSetPropertiesHeaders,\n TableUpdateEntityHeaders,\n} from \"./generated/models\";\n"]}
1
+ {"version":3,"file":"generatedModels.js","sourceRoot":"","sources":["../../src/generatedModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAkBL,6BAA6B,GAW9B,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n ServiceGetStatisticsResponse as GetStatisticsResponse,\n ServiceGetPropertiesResponse as GetPropertiesResponse,\n ServiceSetPropertiesOptionalParams as SetPropertiesOptions,\n TableServiceProperties as ServiceProperties,\n ServiceSetPropertiesResponse as SetPropertiesResponse,\n TableDeleteEntityResponse as DeleteTableEntityResponse,\n TableUpdateEntityResponse as UpdateEntityResponse,\n TableMergeEntityResponse as UpsertEntityResponse,\n TableSetAccessPolicyResponse as SetAccessPolicyResponse,\n TableInsertEntityHeaders,\n TableCreateHeaders,\n TableDeleteEntityHeaders,\n TableDeleteHeaders,\n TableGetAccessPolicyHeaders,\n ServiceGetPropertiesHeaders,\n ServiceGetStatisticsHeaders,\n GeoReplicationStatusType,\n KnownGeoReplicationStatusType,\n GeoReplication,\n TableServiceStats,\n TableMergeEntityHeaders,\n CorsRule,\n Metrics,\n RetentionPolicy,\n Logging,\n TableSetAccessPolicyHeaders,\n ServiceSetPropertiesHeaders,\n TableUpdateEntityHeaders,\n} from \"./generated/models\";\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export * from "./generatedModels";
4
4
  export * from "./models";
5
5
  export * from "./sas";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./generatedModels\";\nexport * from \"./models\";\nexport * from \"./sas\";\n\nexport { TableServiceClient } from \"./TableServiceClient\";\nexport { TableTransaction } from \"./TableTransaction\";\nexport { TableClient } from \"./TableClient\";\nexport { odata } from \"./odata\";\nexport { AzureNamedKeyCredential, AzureSASCredential, NamedKeyCredential } from \"@azure/core-auth\";\nexport { RestError } from \"@azure/core-rest-pipeline\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./generatedModels\";\nexport * from \"./models\";\nexport * from \"./sas\";\n\nexport { TableServiceClient } from \"./TableServiceClient\";\nexport { TableTransaction } from \"./TableTransaction\";\nexport { TableClient } from \"./TableClient\";\nexport { odata } from \"./odata\";\nexport { AzureNamedKeyCredential, AzureSASCredential, NamedKeyCredential } from \"@azure/core-auth\";\nexport { RestError } from \"@azure/core-rest-pipeline\";\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createClientLogger } from "@azure/logger";
4
4
  /**
5
5
  * The \@azure/logger configuration for this package.
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAe,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAgB,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzureLogger, createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n */\nexport const logger: AzureLogger = createClientLogger(\"data-tables\");\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAe,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAgB,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureLogger, createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n */\nexport const logger: AzureLogger = createClientLogger(\"data-tables\");\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport { TableGetAccessPolicyHeaders, TableInsertEntityHeaders } from \"./generated/models\";\n\n/**\n * Represents the Create or Delete Entity operation to be included in a Transaction request\n */\nexport type CreateDeleteEntityAction = [\"create\" | \"delete\", TableEntity];\n\n/**\n * Represents the Update or Upsert Entity operation to be included in a Transaction request\n */\nexport type UpdateEntityAction =\n | [\"update\" | \"upsert\", TableEntity]\n | [\"update\" | \"upsert\", TableEntity, \"Merge\" | \"Replace\"]\n | [\"update\" | \"upsert\", TableEntity, \"Merge\" | \"Replace\", UpdateTableEntityOptions | undefined];\n\n/**\n * Represents the union of all the available transactional actions\n */\nexport type TransactionAction = CreateDeleteEntityAction | UpdateEntityAction;\n\n/**\n * Client options used to configure Tables Api requests\n */\nexport type TableServiceClientOptions = CommonClientOptions & {\n endpoint?: string;\n version?: string;\n};\n\n/**\n * Contains response data for the createEntity operation.\n */\nexport type CreateTableEntityResponse = TableInsertEntityHeaders;\n\n/**\n * Contains response data for the listEntities operation.\n */\nexport type GetTableEntityResponse<T extends object> = TableEntityResult<T>;\n\n/**\n * Optional parameters for DeleteTableEntity operation\n */\nexport type DeleteTableEntityOptions = OperationOptions & {\n /**\n * UTC date/time value generated by the service that indicates the time at which the response was initiated\n */\n etag?: string;\n};\n\n/** The properties for the table item. */\nexport interface TableItem {\n /** The name of the table. */\n name?: string;\n}\n\n/**\n * OData Query options to limit the set of tables returned.\n */\nexport interface TableQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n}\n\n/**\n * OData Query options to limit the set of entities returned.\n */\nexport interface TableEntityQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n /**\n * A select expression limits the properties on each entity to just those requested.\n */\n select?: string[];\n}\n\n/**\n * List tables optional parameters.\n */\nexport type ListTableItemsOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableQueryOptions;\n};\n\n/**\n * Output type for query operations\n */\nexport type TableEntityResult<T> = T & {\n /**\n * etag property. Always returned by the service\n */\n etag: string;\n /**\n * Partition key property. Omitted if a select filter is set and this property is not requested\n */\n partitionKey?: string;\n /**\n * Row key property. Omitted if a select filter is set and this property is not requested\n */\n rowKey?: string;\n /**\n * Timestamp property. This property is assinged by the service on entity creation\n * Omitted if a select filter is set and this property is not requested\n */\n timestamp?: string;\n};\n\n/**\n * Output page type for query operations\n */\nexport type TableEntityResultPage<T> = Array<TableEntityResult<T>> & {\n /**\n * Continuation token to get the next page\n */\n continuationToken?: string;\n};\n\n/**\n * List entities optional parameters.\n */\nexport type ListTableEntitiesOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * GetEntity optional parameters.\n */\nexport type GetTableEntityOptions = OperationOptions & {\n /**\n * Parameter group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * Update entity optional parameters.\n */\nexport type UpdateTableEntityOptions = OperationOptions & {\n /**\n * Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a replace will be performed if an existing entity is found.\n */\n etag?: string;\n};\n\n/**\n * A set of key-value pairs representing the table entity.\n */\nexport type TableEntity<T extends object = Record<string, unknown>> = T & {\n /**\n * The PartitionKey property of the entity.\n */\n partitionKey: string;\n /**\n * The RowKey property of the entity.\n */\n rowKey: string;\n};\n\n/**\n * Supported EDM Types by Azure Tables.\n */\nexport type EdmTypes =\n | \"Binary\"\n | \"Boolean\"\n | \"DateTime\"\n | \"Double\"\n | \"Guid\"\n | \"Int32\"\n | \"Int64\"\n | \"String\";\n\n/**\n * Entity Data Model representation for an entity property.\n */\nexport interface Edm<T extends EdmTypes> {\n /**\n * The value of the entity property\n */\n value: T extends \"Binary\"\n ? string\n : T extends \"Boolean\"\n ? boolean\n : T extends \"Double\"\n ? number\n : T extends \"Int32\"\n ? number\n : string;\n /**\n * The type of the entity property\n */\n type: T;\n}\n\n/**\n * The different modes for Update and Upsert methods\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n */\nexport type UpdateMode = \"Merge\" | \"Replace\";\n\n/**\n * Represents the response of a Transaction operation\n */\nexport interface TableTransactionResponse {\n /**\n * Collection of sub responses\n */\n subResponses: TableTransactionEntityResponse[];\n /**\n * Main Transaction request status code\n */\n status: number;\n /**\n * Gets a specific response given a row key\n */\n getResponseForEntity: (rowKey: string) => TableTransactionEntityResponse | undefined;\n}\n\n/** The properties for the table query response. */\nexport interface TableQueryResponse {\n /** List of tables. */\n value?: TableItem[];\n}\n\n/**\n * Output page type for table query operations\n */\nexport interface TableItemResultPage extends Array<TableItem> {\n /**\n * Continuation token to get the next TableItem page\n */\n continuationToken?: string;\n}\n\n/**\n * Represents a sub-response of a Transaction operation\n */\nexport interface TableTransactionEntityResponse {\n /**\n * Entity's etag\n */\n etag?: string;\n /**\n * Entity's rowKey\n */\n rowKey?: string;\n /**\n * Sub-response status\n */\n status: number;\n}\n\n/** A signed identifier. */\nexport interface SignedIdentifier {\n /** A unique id. */\n id: string;\n /** The access policy. */\n accessPolicy?: AccessPolicy;\n}\n\n/** An Access policy. */\nexport interface AccessPolicy {\n /** The start datetime from which the policy is active. */\n start?: Date;\n /** The datetime that the policy expires. */\n expiry?: Date;\n /** The permissions for the acl policy. */\n permission?: string;\n}\n\n/** Contains response data for the getAccessPolicy operation. */\nexport type GetAccessPolicyResponse = TableGetAccessPolicyHeaders & SignedIdentifier[];\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport { TableGetAccessPolicyHeaders, TableInsertEntityHeaders } from \"./generated/models\";\n\n/**\n * Represents the Create or Delete Entity operation to be included in a Transaction request\n */\nexport type CreateDeleteEntityAction = [\"create\" | \"delete\", TableEntity];\n\n/**\n * Represents the Update or Upsert Entity operation to be included in a Transaction request\n */\nexport type UpdateEntityAction =\n | [\"update\" | \"upsert\", TableEntity]\n | [\"update\" | \"upsert\", TableEntity, \"Merge\" | \"Replace\"]\n | [\"update\" | \"upsert\", TableEntity, \"Merge\" | \"Replace\", UpdateTableEntityOptions | undefined];\n\n/**\n * Represents the union of all the available transactional actions\n */\nexport type TransactionAction = CreateDeleteEntityAction | UpdateEntityAction;\n\n/**\n * Client options used to configure Tables Api requests\n */\nexport type TableServiceClientOptions = CommonClientOptions & {\n endpoint?: string;\n version?: string;\n};\n\n/**\n * Contains response data for the createEntity operation.\n */\nexport type CreateTableEntityResponse = TableInsertEntityHeaders;\n\n/**\n * Contains response data for the listEntities operation.\n */\nexport type GetTableEntityResponse<T extends object> = TableEntityResult<T>;\n\n/**\n * Optional parameters for DeleteTableEntity operation\n */\nexport type DeleteTableEntityOptions = OperationOptions & {\n /**\n * UTC date/time value generated by the service that indicates the time at which the response was initiated\n */\n etag?: string;\n};\n\n/** The properties for the table item. */\nexport interface TableItem {\n /** The name of the table. */\n name?: string;\n}\n\n/**\n * OData Query options to limit the set of tables returned.\n */\nexport interface TableQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n}\n\n/**\n * OData Query options to limit the set of entities returned.\n */\nexport interface TableEntityQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n /**\n * A select expression limits the properties on each entity to just those requested.\n */\n select?: string[];\n}\n\n/**\n * List tables optional parameters.\n */\nexport type ListTableItemsOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableQueryOptions;\n};\n\n/**\n * Output type for query operations\n */\nexport type TableEntityResult<T> = T & {\n /**\n * etag property. Always returned by the service\n */\n etag: string;\n /**\n * Partition key property. Omitted if a select filter is set and this property is not requested\n */\n partitionKey?: string;\n /**\n * Row key property. Omitted if a select filter is set and this property is not requested\n */\n rowKey?: string;\n /**\n * Timestamp property. This property is assinged by the service on entity creation\n * Omitted if a select filter is set and this property is not requested\n */\n timestamp?: string;\n};\n\n/**\n * Output page type for query operations\n */\nexport type TableEntityResultPage<T> = Array<TableEntityResult<T>> & {\n /**\n * Continuation token to get the next page\n */\n continuationToken?: string;\n};\n\n/**\n * List entities optional parameters.\n */\nexport type ListTableEntitiesOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * GetEntity optional parameters.\n */\nexport type GetTableEntityOptions = OperationOptions & {\n /**\n * Parameter group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * Update entity optional parameters.\n */\nexport type UpdateTableEntityOptions = OperationOptions & {\n /**\n * Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a replace will be performed if an existing entity is found.\n */\n etag?: string;\n};\n\n/**\n * A set of key-value pairs representing the table entity.\n */\nexport type TableEntity<T extends object = Record<string, unknown>> = T & {\n /**\n * The PartitionKey property of the entity.\n */\n partitionKey: string;\n /**\n * The RowKey property of the entity.\n */\n rowKey: string;\n};\n\n/**\n * Supported EDM Types by Azure Tables.\n */\nexport type EdmTypes =\n | \"Binary\"\n | \"Boolean\"\n | \"DateTime\"\n | \"Double\"\n | \"Guid\"\n | \"Int32\"\n | \"Int64\"\n | \"String\";\n\n/**\n * Entity Data Model representation for an entity property.\n */\nexport interface Edm<T extends EdmTypes> {\n /**\n * The value of the entity property\n */\n value: T extends \"Binary\"\n ? string\n : T extends \"Boolean\"\n ? boolean\n : T extends \"Double\"\n ? number\n : T extends \"Int32\"\n ? number\n : string;\n /**\n * The type of the entity property\n */\n type: T;\n}\n\n/**\n * The different modes for Update and Upsert methods\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n */\nexport type UpdateMode = \"Merge\" | \"Replace\";\n\n/**\n * Represents the response of a Transaction operation\n */\nexport interface TableTransactionResponse {\n /**\n * Collection of sub responses\n */\n subResponses: TableTransactionEntityResponse[];\n /**\n * Main Transaction request status code\n */\n status: number;\n /**\n * Gets a specific response given a row key\n */\n getResponseForEntity: (rowKey: string) => TableTransactionEntityResponse | undefined;\n}\n\n/** The properties for the table query response. */\nexport interface TableQueryResponse {\n /** List of tables. */\n value?: TableItem[];\n}\n\n/**\n * Output page type for table query operations\n */\nexport interface TableItemResultPage extends Array<TableItem> {\n /**\n * Continuation token to get the next TableItem page\n */\n continuationToken?: string;\n}\n\n/**\n * Represents a sub-response of a Transaction operation\n */\nexport interface TableTransactionEntityResponse {\n /**\n * Entity's etag\n */\n etag?: string;\n /**\n * Entity's rowKey\n */\n rowKey?: string;\n /**\n * Sub-response status\n */\n status: number;\n}\n\n/** A signed identifier. */\nexport interface SignedIdentifier {\n /** A unique id. */\n id: string;\n /** The access policy. */\n accessPolicy?: AccessPolicy;\n}\n\n/** An Access policy. */\nexport interface AccessPolicy {\n /** The start datetime from which the policy is active. */\n start?: Date;\n /** The datetime that the policy expires. */\n expiry?: Date;\n /** The permissions for the acl policy. */\n permission?: string;\n}\n\n/** Contains response data for the getAccessPolicy operation. */\nexport type GetAccessPolicyResponse = TableGetAccessPolicyHeaders & SignedIdentifier[];\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  function escapeQuotesIfString(input, previous) {
4
4
  let result = input;
5
5
  if (typeof input === "string") {
@@ -1 +1 @@
1
- {"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/odata.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7B,0CAA0C;QAC1C,IAAI,QAAQ,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACtD,MAAM,GAAG,IAAI,MAAM,GAAG,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACvE,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,MAAc,EAAoB,EAAE;QACvE,OAAO,UAAU,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nfunction escapeQuotesIfString(input: unknown, previous: string): string | unknown {\n let result = input;\n\n if (typeof input === \"string\") {\n result = escapeQuotes(input);\n // check if we need to escape this literal\n if (previous !== \"\" && !previous.trim().endsWith(\"'\")) {\n result = `'${result}'`;\n }\n }\n return result;\n}\n\nexport function escapeQuotes(input: string): string {\n return input.replace(/'/g, \"''\");\n}\n\nfunction encodeDate(input: unknown): string | unknown {\n return input instanceof Date ? `datetime'${input.toISOString()}'` : input;\n}\n\n/**\n * Escapes an odata filter expression to avoid errors with quoting string literals.\n * Encodes Date objects.\n */\nexport function odata(strings: TemplateStringsArray, ...values: unknown[]): string {\n const fixEncoding = (value: unknown, string: string): string | unknown => {\n return encodeDate(escapeQuotesIfString(value, string));\n };\n const results = [];\n for (let i = 0; i < strings.length; i++) {\n results.push(strings[i]);\n if (i < values.length) {\n results.push(fixEncoding(values[i], strings[i]));\n }\n }\n return results.join(\"\");\n}\n"]}
1
+ {"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/odata.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7B,0CAA0C;QAC1C,IAAI,QAAQ,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACtD,MAAM,GAAG,IAAI,MAAM,GAAG,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACvE,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,MAAc,EAAoB,EAAE;QACvE,OAAO,UAAU,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nfunction escapeQuotesIfString(input: unknown, previous: string): string | unknown {\n let result = input;\n\n if (typeof input === \"string\") {\n result = escapeQuotes(input);\n // check if we need to escape this literal\n if (previous !== \"\" && !previous.trim().endsWith(\"'\")) {\n result = `'${result}'`;\n }\n }\n return result;\n}\n\nexport function escapeQuotes(input: string): string {\n return input.replace(/'/g, \"''\");\n}\n\nfunction encodeDate(input: unknown): string | unknown {\n return input instanceof Date ? `datetime'${input.toISOString()}'` : input;\n}\n\n/**\n * Escapes an odata filter expression to avoid errors with quoting string literals.\n * Encodes Date objects.\n */\nexport function odata(strings: TemplateStringsArray, ...values: unknown[]): string {\n const fixEncoding = (value: unknown, string: string): string | unknown => {\n return encodeDate(escapeQuotesIfString(value, string));\n };\n const results = [];\n for (let i = 0; i < strings.length; i++) {\n results.push(strings[i]);\n if (i < values.length) {\n results.push(fixEncoding(values[i], strings[i]));\n }\n }\n return results.join(\"\");\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Parse initializes the AccountSASPermissions fields from a string.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"accountSasPermissions.js","sourceRoot":"","sources":["../../../src/sas/accountSasPermissions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,WAAmB;IACjE,MAAM,qBAAqB,GAA0B,EAAE,CAAC;IAExD,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,QAAQ,CAAC,EAAE,CAAC;YACV,KAAK,GAAG;gBACN,qBAAqB,CAAC,KAAK,GAAG,IAAI,CAAC;gBACnC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,KAAK,GAAG,IAAI,CAAC;gBACnC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,MAAM,GAAG,IAAI,CAAC;gBACpC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,IAAI,GAAG,IAAI,CAAC;gBAClC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,GAAG,GAAG,IAAI,CAAC;gBACjC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,MAAM,GAAG,IAAI,CAAC;gBACpC,MAAM;YAER;gBACE,MAAM,IAAI,UAAU,CAAC,iCAAiC,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAkC;IAC9E,iFAAiF;IACjF,wFAAwF;IACxF,iFAAiF;IACjF,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;QACrB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC;QACpB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Parse initializes the AccountSASPermissions fields from a string.\n *\n * @param permissions -\n */\nexport function accountSasPermissionsFromString(permissions: string): AccountSasPermissions {\n const accountSasPermissions: AccountSasPermissions = {};\n\n for (const c of permissions) {\n switch (c) {\n case \"r\":\n accountSasPermissions.query = true;\n break;\n case \"w\":\n accountSasPermissions.write = true;\n break;\n case \"d\":\n accountSasPermissions.delete = true;\n break;\n case \"l\":\n accountSasPermissions.list = true;\n break;\n case \"a\":\n accountSasPermissions.add = true;\n break;\n case \"u\":\n accountSasPermissions.update = true;\n break;\n\n default:\n throw new RangeError(`Invalid permission character: ${c}`);\n }\n }\n\n return accountSasPermissions;\n}\n\n/**\n * Produces the SAS permissions string for an Azure Storage account.\n * Call this method to set AccountSASSignatureValues Permissions field.\n *\n * Using this method will guarantee the resource types are in\n * an order accepted by the service.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\nexport function accountSasPermissionsToString(permissions: AccountSasPermissions): string {\n // The order of the characters should be as specified here to ensure correctness:\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n // Use a string array instead of string concatenating += operator for performance\n const permissionString: string[] = [];\n if (permissions.query) {\n permissionString.push(\"r\");\n }\n if (permissions.write) {\n permissionString.push(\"w\");\n }\n if (permissions.delete) {\n permissionString.push(\"d\");\n }\n if (permissions.list) {\n permissionString.push(\"l\");\n }\n if (permissions.add) {\n permissionString.push(\"a\");\n }\n if (permissions.update) {\n permissionString.push(\"u\");\n }\n\n return permissionString.join(\"\");\n}\n\n/**\n * A type that looks like an account SAS permission.\n * Used in {@link AccountSasPermissions} to parse SAS permissions from raw objects.\n */\nexport interface AccountSasPermissions {\n /**\n * Grants permission to list entities.\n */\n query?: boolean;\n\n /**\n * Grants permission to create tables\n */\n write?: boolean;\n\n /**\n * Grants permission to delete tables and entities\n */\n delete?: boolean;\n\n /**\n * Grants permission to list tables\n */\n list?: boolean;\n\n /**\n * Grants permission to create entities\n */\n add?: boolean;\n\n /**\n * Permissions to update messages and table entities granted.\n */\n update?: boolean;\n}\n"]}
1
+ {"version":3,"file":"accountSasPermissions.js","sourceRoot":"","sources":["../../../src/sas/accountSasPermissions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,WAAmB;IACjE,MAAM,qBAAqB,GAA0B,EAAE,CAAC;IAExD,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,QAAQ,CAAC,EAAE,CAAC;YACV,KAAK,GAAG;gBACN,qBAAqB,CAAC,KAAK,GAAG,IAAI,CAAC;gBACnC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,KAAK,GAAG,IAAI,CAAC;gBACnC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,MAAM,GAAG,IAAI,CAAC;gBACpC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,IAAI,GAAG,IAAI,CAAC;gBAClC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,GAAG,GAAG,IAAI,CAAC;gBACjC,MAAM;YACR,KAAK,GAAG;gBACN,qBAAqB,CAAC,MAAM,GAAG,IAAI,CAAC;gBACpC,MAAM;YAER;gBACE,MAAM,IAAI,UAAU,CAAC,iCAAiC,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAkC;IAC9E,iFAAiF;IACjF,wFAAwF;IACxF,iFAAiF;IACjF,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;QACrB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC;QACpB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Parse initializes the AccountSASPermissions fields from a string.\n *\n * @param permissions -\n */\nexport function accountSasPermissionsFromString(permissions: string): AccountSasPermissions {\n const accountSasPermissions: AccountSasPermissions = {};\n\n for (const c of permissions) {\n switch (c) {\n case \"r\":\n accountSasPermissions.query = true;\n break;\n case \"w\":\n accountSasPermissions.write = true;\n break;\n case \"d\":\n accountSasPermissions.delete = true;\n break;\n case \"l\":\n accountSasPermissions.list = true;\n break;\n case \"a\":\n accountSasPermissions.add = true;\n break;\n case \"u\":\n accountSasPermissions.update = true;\n break;\n\n default:\n throw new RangeError(`Invalid permission character: ${c}`);\n }\n }\n\n return accountSasPermissions;\n}\n\n/**\n * Produces the SAS permissions string for an Azure Storage account.\n * Call this method to set AccountSASSignatureValues Permissions field.\n *\n * Using this method will guarantee the resource types are in\n * an order accepted by the service.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\nexport function accountSasPermissionsToString(permissions: AccountSasPermissions): string {\n // The order of the characters should be as specified here to ensure correctness:\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n // Use a string array instead of string concatenating += operator for performance\n const permissionString: string[] = [];\n if (permissions.query) {\n permissionString.push(\"r\");\n }\n if (permissions.write) {\n permissionString.push(\"w\");\n }\n if (permissions.delete) {\n permissionString.push(\"d\");\n }\n if (permissions.list) {\n permissionString.push(\"l\");\n }\n if (permissions.add) {\n permissionString.push(\"a\");\n }\n if (permissions.update) {\n permissionString.push(\"u\");\n }\n\n return permissionString.join(\"\");\n}\n\n/**\n * A type that looks like an account SAS permission.\n * Used in {@link AccountSasPermissions} to parse SAS permissions from raw objects.\n */\nexport interface AccountSasPermissions {\n /**\n * Grants permission to list entities.\n */\n query?: boolean;\n\n /**\n * Grants permission to create tables\n */\n write?: boolean;\n\n /**\n * Grants permission to delete tables and entities\n */\n delete?: boolean;\n\n /**\n * Grants permission to list tables\n */\n list?: boolean;\n\n /**\n * Grants permission to create entities\n */\n add?: boolean;\n\n /**\n * Permissions to update messages and table entities granted.\n */\n update?: boolean;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Creates an {@link accountSasResourceTypesFromString} from the specified resource types string. This method will throw an
5
5
  * Error if it encounters a character that does not correspond to a valid resource type.
@@ -1 +1 @@
1
- {"version":3,"file":"accountSasResourceTypes.js","sourceRoot":"","sources":["../../../src/sas/accountSasResourceTypes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,aAAqB;IACrE,MAAM,uBAAuB,GAA4B,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;QAC9B,QAAQ,CAAC,EAAE,CAAC;YACV,KAAK,GAAG;gBACN,uBAAuB,CAAC,OAAO,GAAG,IAAI,CAAC;gBACvC,MAAM;YACR,KAAK,GAAG;gBACN,uBAAuB,CAAC,SAAS,GAAG,IAAI,CAAC;gBACzC,MAAM;YACR,KAAK,GAAG;gBACN,uBAAuB,CAAC,MAAM,GAAG,IAAI,CAAC;gBACtC,MAAM;YACR;gBACE,MAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,aAAsC;IACpF,MAAM,mBAAmB,GAAa,EAAE,CAAC;IACzC,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1B,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAC5B,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Creates an {@link accountSasResourceTypesFromString} from the specified resource types string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid resource type.\n *\n * @param resourceTypes -\n */\nexport function accountSasResourceTypesFromString(resourceTypes: string): AccountSasResourceTypes {\n const accountSasResourceTypes: AccountSasResourceTypes = {};\n\n for (const c of resourceTypes) {\n switch (c) {\n case \"s\":\n accountSasResourceTypes.service = true;\n break;\n case \"c\":\n accountSasResourceTypes.container = true;\n break;\n case \"o\":\n accountSasResourceTypes.object = true;\n break;\n default:\n throw new RangeError(`Invalid resource type: ${c}`);\n }\n }\n\n return accountSasResourceTypes;\n}\n\n/**\n * Converts the given resource types to a string.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\nexport function accountSasResourceTypesToString(resourceTypes: AccountSasResourceTypes): string {\n const resourceTypesString: string[] = [];\n if (resourceTypes.service) {\n resourceTypesString.push(\"s\");\n }\n if (resourceTypes.container) {\n resourceTypesString.push(\"c\");\n }\n if (resourceTypes.object) {\n resourceTypesString.push(\"o\");\n }\n return resourceTypesString.join(\"\");\n}\n\n/**\n * Represents the Resources that are accessible by the SAS token\n */\nexport interface AccountSasResourceTypes {\n /**\n * Permission to access service level APIs granted.\n */\n service?: boolean;\n\n /**\n * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.\n */\n container?: boolean;\n\n /**\n * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.\n */\n object?: boolean;\n}\n"]}
1
+ {"version":3,"file":"accountSasResourceTypes.js","sourceRoot":"","sources":["../../../src/sas/accountSasResourceTypes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,aAAqB;IACrE,MAAM,uBAAuB,GAA4B,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;QAC9B,QAAQ,CAAC,EAAE,CAAC;YACV,KAAK,GAAG;gBACN,uBAAuB,CAAC,OAAO,GAAG,IAAI,CAAC;gBACvC,MAAM;YACR,KAAK,GAAG;gBACN,uBAAuB,CAAC,SAAS,GAAG,IAAI,CAAC;gBACzC,MAAM;YACR,KAAK,GAAG;gBACN,uBAAuB,CAAC,MAAM,GAAG,IAAI,CAAC;gBACtC,MAAM;YACR;gBACE,MAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,aAAsC;IACpF,MAAM,mBAAmB,GAAa,EAAE,CAAC;IACzC,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1B,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAC5B,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Creates an {@link accountSasResourceTypesFromString} from the specified resource types string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid resource type.\n *\n * @param resourceTypes -\n */\nexport function accountSasResourceTypesFromString(resourceTypes: string): AccountSasResourceTypes {\n const accountSasResourceTypes: AccountSasResourceTypes = {};\n\n for (const c of resourceTypes) {\n switch (c) {\n case \"s\":\n accountSasResourceTypes.service = true;\n break;\n case \"c\":\n accountSasResourceTypes.container = true;\n break;\n case \"o\":\n accountSasResourceTypes.object = true;\n break;\n default:\n throw new RangeError(`Invalid resource type: ${c}`);\n }\n }\n\n return accountSasResourceTypes;\n}\n\n/**\n * Converts the given resource types to a string.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\nexport function accountSasResourceTypesToString(resourceTypes: AccountSasResourceTypes): string {\n const resourceTypesString: string[] = [];\n if (resourceTypes.service) {\n resourceTypesString.push(\"s\");\n }\n if (resourceTypes.container) {\n resourceTypesString.push(\"c\");\n }\n if (resourceTypes.object) {\n resourceTypesString.push(\"o\");\n }\n return resourceTypesString.join(\"\");\n}\n\n/**\n * Represents the Resources that are accessible by the SAS token\n */\nexport interface AccountSasResourceTypes {\n /**\n * Permission to access service level APIs granted.\n */\n service?: boolean;\n\n /**\n * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.\n */\n container?: boolean;\n\n /**\n * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.\n */\n object?: boolean;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Creates an {@link AccountSasServices} from the specified services string. This method will throw an
5
5
  * Error if it encounters a character that does not correspond to a valid service.
@@ -1 +1 @@
1
- {"version":3,"file":"accountSasServices.js","sourceRoot":"","sources":["../../../src/sas/accountSasServices.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAgB;IAC3D,MAAM,kBAAkB,GAAuB,EAAE,CAAC;IAElD,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,QAAQ,CAAC,EAAE,CAAC;YACV,KAAK,GAAG;gBACN,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;gBAC/B,MAAM;YACR,KAAK,GAAG;gBACN,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;gBAC/B,MAAM;YACR,KAAK,GAAG;gBACN,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC;gBAChC,MAAM;YACR,KAAK,GAAG;gBACN,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC;gBAChC,MAAM;YACR;gBACE,MAAM,IAAI,UAAU,CAAC,8BAA8B,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,WAA+B,EAAE,KAAK,EAAE,IAAI,EAAE;IACvF,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Creates an {@link AccountSasServices} from the specified services string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid service.\n *\n * @param services -\n */\nexport function accountSasServicesFromString(services: string): AccountSasServices {\n const accountSasServices: AccountSasServices = {};\n\n for (const c of services) {\n switch (c) {\n case \"b\":\n accountSasServices.blob = true;\n break;\n case \"f\":\n accountSasServices.file = true;\n break;\n case \"q\":\n accountSasServices.queue = true;\n break;\n case \"t\":\n accountSasServices.table = true;\n break;\n default:\n throw new RangeError(`Invalid service character: ${c}`);\n }\n }\n\n return accountSasServices;\n}\n\n/**\n * Converts the given services to a string.\n *\n */\nexport function accountSasServicesToString(services: AccountSasServices = { table: true }): string {\n const servicesString: string[] = [];\n if (services.blob) {\n servicesString.push(\"b\");\n }\n if (services.table) {\n servicesString.push(\"t\");\n }\n if (services.queue) {\n servicesString.push(\"q\");\n }\n if (services.file) {\n servicesString.push(\"f\");\n }\n return servicesString.join(\"\");\n}\n/**\n * Services that the SAS token can access\n */\nexport interface AccountSasServices {\n /**\n * Permission to access blob resources granted.\n */\n blob?: boolean;\n\n /**\n * Permission to access file resources granted.\n */\n file?: boolean;\n\n /**\n * Permission to access queue resources granted.\n */\n\n queue?: boolean;\n /**\n * Permission to access table resources granted.\n */\n table?: boolean;\n}\n"]}
1
+ {"version":3,"file":"accountSasServices.js","sourceRoot":"","sources":["../../../src/sas/accountSasServices.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAgB;IAC3D,MAAM,kBAAkB,GAAuB,EAAE,CAAC;IAElD,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,QAAQ,CAAC,EAAE,CAAC;YACV,KAAK,GAAG;gBACN,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;gBAC/B,MAAM;YACR,KAAK,GAAG;gBACN,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC;gBAC/B,MAAM;YACR,KAAK,GAAG;gBACN,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC;gBAChC,MAAM;YACR,KAAK,GAAG;gBACN,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC;gBAChC,MAAM;YACR;gBACE,MAAM,IAAI,UAAU,CAAC,8BAA8B,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,WAA+B,EAAE,KAAK,EAAE,IAAI,EAAE;IACvF,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Creates an {@link AccountSasServices} from the specified services string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid service.\n *\n * @param services -\n */\nexport function accountSasServicesFromString(services: string): AccountSasServices {\n const accountSasServices: AccountSasServices = {};\n\n for (const c of services) {\n switch (c) {\n case \"b\":\n accountSasServices.blob = true;\n break;\n case \"f\":\n accountSasServices.file = true;\n break;\n case \"q\":\n accountSasServices.queue = true;\n break;\n case \"t\":\n accountSasServices.table = true;\n break;\n default:\n throw new RangeError(`Invalid service character: ${c}`);\n }\n }\n\n return accountSasServices;\n}\n\n/**\n * Converts the given services to a string.\n *\n */\nexport function accountSasServicesToString(services: AccountSasServices = { table: true }): string {\n const servicesString: string[] = [];\n if (services.blob) {\n servicesString.push(\"b\");\n }\n if (services.table) {\n servicesString.push(\"t\");\n }\n if (services.queue) {\n servicesString.push(\"q\");\n }\n if (services.file) {\n servicesString.push(\"f\");\n }\n return servicesString.join(\"\");\n}\n/**\n * Services that the SAS token can access\n */\nexport interface AccountSasServices {\n /**\n * Permission to access blob resources granted.\n */\n blob?: boolean;\n\n /**\n * Permission to access file resources granted.\n */\n file?: boolean;\n\n /**\n * Permission to access queue resources granted.\n */\n\n queue?: boolean;\n /**\n * Permission to access table resources granted.\n */\n table?: boolean;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { accountSasPermissionsToString } from "./accountSasPermissions";
4
4
  import { ipRangeToString } from "./sasIPRange";
5
5
  import { SasQueryParameters } from "./sasQueryParameters";
@@ -1 +1 @@
1
- {"version":3,"file":"accountSasSignatureValues.js","sourceRoot":"","sources":["../../../src/sas/accountSasSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAe,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EACL,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AA8DpE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iCAAiC,CAC/C,yBAAoD,EACpD,UAA8B;IAE9B,MAAM,OAAO,GAAG,yBAAyB,CAAC,OAAO;QAC/C,CAAC,CAAC,yBAAyB,CAAC,OAAO;QACnC,CAAC,CAAC,eAAe,CAAC;IAE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AC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccountSasPermissions, accountSasPermissionsToString } from \"./accountSasPermissions\";\nimport { SasIPRange, ipRangeToString } from \"./sasIPRange\";\nimport { SasProtocol, SasQueryParameters } from \"./sasQueryParameters\";\nimport {\n accountSasResourceTypesFromString,\n accountSasResourceTypesToString,\n} from \"./accountSasResourceTypes\";\nimport { accountSasServicesFromString, accountSasServicesToString } from \"./accountSasServices\";\nimport { NamedKeyCredential } from \"@azure/core-auth\";\nimport { SERVICE_VERSION } from \"../utils/constants\";\nimport { computeHMACSHA256 } from \"../utils/computeHMACSHA256\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once\n * all the values here are set appropriately, call {@link generateAccountSasQueryParameters} to obtain a representation\n * of the SAS which can actually be applied to table urls. Note: that both this class and {@link SasQueryParameters}\n * exist because the former is mutable and a logical representation while the latter is immutable and used to generate\n * actual REST requests.\n *\n * @see https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1\n * for more conceptual information on SAS\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas\n * for descriptions of the parameters, including which are required\n */\nexport interface AccountSasSignatureValues {\n /**\n * If not provided, this defaults to the service version targeted by this version of the library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SasProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * The time after which the SAS will no longer work.\n */\n expiresOn: Date;\n\n /**\n * Specifies which operations the SAS user may perform. Please refer to {@link AccountSasPermissions} for help\n * constructing the permissions string.\n */\n permissions: AccountSasPermissions;\n\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n\n /**\n * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSasServices} to\n * construct this value.\n */\n services: string;\n\n /**\n * The values that indicate the resource types accessible with this SAS. Please refer\n * to {@link AccountSasResourceTypes} to construct this value.\n */\n resourceTypes: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Generates a {@link SasQueryParameters} object which contains all SAS query parameters needed to make an actual\n * REST request.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n * @param accountSasSignatureValues -\n * @param sharedKeyCredential -\n */\nexport function generateAccountSasQueryParameters(\n accountSasSignatureValues: AccountSasSignatureValues,\n credential: NamedKeyCredential,\n): SasQueryParameters {\n const version = accountSasSignatureValues.version\n ? accountSasSignatureValues.version\n : SERVICE_VERSION;\n\n const parsedPermissions = accountSasPermissionsToString(accountSasSignatureValues.permissions);\n const parsedServices = accountSasServicesToString(\n accountSasServicesFromString(accountSasSignatureValues.services),\n );\n // to and from string to guarantee the correct order of resoruce types is generated\n const parsedResourceTypes = accountSasResourceTypesToString(\n accountSasResourceTypesFromString(accountSasSignatureValues.resourceTypes),\n );\n\n const stringToSign = [\n credential.name,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSasSignatureValues.startsOn\n ? truncatedISO8061Date(accountSasSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSasSignatureValues.expiresOn, false),\n accountSasSignatureValues.ipRange ? ipRangeToString(accountSasSignatureValues.ipRange) : \"\",\n accountSasSignatureValues.protocol ? accountSasSignatureValues.protocol : \"\",\n version,\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n\n const signature: string = computeHMACSHA256(stringToSign, credential.key);\n\n return new SasQueryParameters(version, signature, {\n permissions: parsedPermissions.toString(),\n services: parsedServices,\n resourceTypes: parsedResourceTypes,\n protocol: accountSasSignatureValues.protocol,\n startsOn: accountSasSignatureValues.startsOn,\n expiresOn: accountSasSignatureValues.expiresOn,\n ipRange: accountSasSignatureValues.ipRange,\n });\n}\n"]}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E,CAAC,CAAC,EAAE;QACN,oBAAoB,CAAC,yBAAyB,CAAC,SAAS,EAAE,KAAK,CAAC;QAChE,yBAAyB,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;QAC3F,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;QAC5E,OAAO;QACP,EAAE,EAAE,uDAAuD;KAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,SAAS,GAAW,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAE1E,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE;QAChD,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;QACzC,QAAQ,EAAE,cAAc;QACxB,aAAa,EAAE,mBAAmB;QAClC,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;QAC5C,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;QAC5C,SAAS,EAAE,yBAAyB,CAAC,SAAS;QAC9C,OAAO,EAAE,yBAAyB,CAAC,OAAO;KAC3C,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccountSasPermissions, accountSasPermissionsToString } from \"./accountSasPermissions\";\nimport { SasIPRange, ipRangeToString } from \"./sasIPRange\";\nimport { SasProtocol, SasQueryParameters } from \"./sasQueryParameters\";\nimport {\n accountSasResourceTypesFromString,\n accountSasResourceTypesToString,\n} from \"./accountSasResourceTypes\";\nimport { accountSasServicesFromString, accountSasServicesToString } from \"./accountSasServices\";\nimport { NamedKeyCredential } from \"@azure/core-auth\";\nimport { SERVICE_VERSION } from \"../utils/constants\";\nimport { computeHMACSHA256 } from \"../utils/computeHMACSHA256\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once\n * all the values here are set appropriately, call {@link generateAccountSasQueryParameters} to obtain a representation\n * of the SAS which can actually be applied to table urls. Note: that both this class and {@link SasQueryParameters}\n * exist because the former is mutable and a logical representation while the latter is immutable and used to generate\n * actual REST requests.\n *\n * @see https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1\n * for more conceptual information on SAS\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas\n * for descriptions of the parameters, including which are required\n */\nexport interface AccountSasSignatureValues {\n /**\n * If not provided, this defaults to the service version targeted by this version of the library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SasProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * The time after which the SAS will no longer work.\n */\n expiresOn: Date;\n\n /**\n * Specifies which operations the SAS user may perform. Please refer to {@link AccountSasPermissions} for help\n * constructing the permissions string.\n */\n permissions: AccountSasPermissions;\n\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n\n /**\n * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSasServices} to\n * construct this value.\n */\n services: string;\n\n /**\n * The values that indicate the resource types accessible with this SAS. Please refer\n * to {@link AccountSasResourceTypes} to construct this value.\n */\n resourceTypes: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Generates a {@link SasQueryParameters} object which contains all SAS query parameters needed to make an actual\n * REST request.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n * @param accountSasSignatureValues -\n * @param sharedKeyCredential -\n */\nexport function generateAccountSasQueryParameters(\n accountSasSignatureValues: AccountSasSignatureValues,\n credential: NamedKeyCredential,\n): SasQueryParameters {\n const version = accountSasSignatureValues.version\n ? accountSasSignatureValues.version\n : SERVICE_VERSION;\n\n const parsedPermissions = accountSasPermissionsToString(accountSasSignatureValues.permissions);\n const parsedServices = accountSasServicesToString(\n accountSasServicesFromString(accountSasSignatureValues.services),\n );\n // to and from string to guarantee the correct order of resoruce types is generated\n const parsedResourceTypes = accountSasResourceTypesToString(\n accountSasResourceTypesFromString(accountSasSignatureValues.resourceTypes),\n );\n\n const stringToSign = [\n credential.name,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSasSignatureValues.startsOn\n ? truncatedISO8061Date(accountSasSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSasSignatureValues.expiresOn, false),\n accountSasSignatureValues.ipRange ? ipRangeToString(accountSasSignatureValues.ipRange) : \"\",\n accountSasSignatureValues.protocol ? accountSasSignatureValues.protocol : \"\",\n version,\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n\n const signature: string = computeHMACSHA256(stringToSign, credential.key);\n\n return new SasQueryParameters(version, signature, {\n permissions: parsedPermissions.toString(),\n services: parsedServices,\n resourceTypes: parsedResourceTypes,\n protocol: accountSasSignatureValues.protocol,\n startsOn: accountSasSignatureValues.startsOn,\n expiresOn: accountSasSignatureValues.expiresOn,\n ipRange: accountSasSignatureValues.ipRange,\n });\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { __rest } from "tslib";
4
4
  import { accountSasPermissionsFromString } from "./accountSasPermissions";
5
5
  import { accountSasServicesFromString, accountSasServicesToString, } from "./accountSasServices";
@@ -1 +1 @@
1
- {"version":3,"file":"generateAccountSas.js","sourceRoot":"","sources":["../../../src/sas/generateAccountSas.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAyB,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAEL,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAsB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAEhF;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA8B,EAC9B,UAA6B,EAAE;IAE/B,MAAM,EACJ,SAAS,EACT,WAAW,GAAG,+BAA+B,CAAC,IAAI,CAAC,EACnD,aAAa,GAAG,KAAK,EACrB,QAAQ,GAAG,4BAA4B,CAAC,GAAG,CAAC,KAE1C,OAAO,EADN,IAAI,UACL,OAAO,EANL,yDAML,CAAU,CAAC;IACZ,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,GAAG,SAAS,CAAC;IAEvB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,GAAG,GAAG,iCAAiC,iBAEzC,WAAW,EACX,SAAS,EAAE,MAAM,EACjB,aAAa,EACb,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,CAAC,IAC3C,IAAI,GAET,UAAU,CACX,CAAC,QAAQ,EAAE,CAAC;IAEb,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccountSasPermissions, accountSasPermissionsFromString } from \"./accountSasPermissions\";\nimport {\n AccountSasServices,\n accountSasServicesFromString,\n accountSasServicesToString,\n} from \"./accountSasServices\";\nimport { NamedKeyCredential, isNamedKeyCredential } from \"@azure/core-auth\";\nimport { SasIPRange } from \"./sasIPRange\";\nimport { SasProtocol } from \"./sasQueryParameters\";\nimport { generateAccountSasQueryParameters } from \"./accountSasSignatureValues\";\n\n/**\n * Generates a Table Account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas\n *\n * @param options - Optional parameters.\n * @returns An account SAS token\n */\nexport function generateAccountSas(\n credential: NamedKeyCredential,\n options: AccountSasOptions = {},\n): string {\n const {\n expiresOn,\n permissions = accountSasPermissionsFromString(\"rl\"),\n resourceTypes = \"sco\",\n services = accountSasServicesFromString(\"t\"),\n ...rest\n } = options;\n if (!isNamedKeyCredential(credential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n let expiry = expiresOn;\n\n if (expiry === undefined) {\n const now = new Date();\n expiry = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSasQueryParameters(\n {\n permissions,\n expiresOn: expiry,\n resourceTypes,\n services: accountSasServicesToString(services),\n ...rest,\n },\n credential,\n ).toString();\n\n return sas;\n}\n\n/**\n * Options to configure {@link generateAccountSas} operation.\n */\nexport interface AccountSasOptions {\n /**\n * The time at which the shared access signature becomes invalid. Default to an hour later if not provided.\n */\n expiresOn?: Date;\n /**\n * Specifies the list of permissions to be associated with the SAS.\n */\n permissions?: AccountSasPermissions;\n /**\n * Specifies the resource types associated with the shared access signature.\n */\n resourceTypes?: string;\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * SAS protocols allowed.\n */\n protocol?: SasProtocol;\n\n /**\n * When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * IP range allowed.\n */\n ipRange?: SasIPRange;\n /**\n * Account services\n */\n services?: AccountSasServices;\n}\n"]}
1
+ {"version":3,"file":"generateAccountSas.js","sourceRoot":"","sources":["../../../src/sas/generateAccountSas.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAyB,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAEL,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAsB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAEhF;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA8B,EAC9B,UAA6B,EAAE;IAE/B,MAAM,EACJ,SAAS,EACT,WAAW,GAAG,+BAA+B,CAAC,IAAI,CAAC,EACnD,aAAa,GAAG,KAAK,EACrB,QAAQ,GAAG,4BAA4B,CAAC,GAAG,CAAC,KAE1C,OAAO,EADN,IAAI,UACL,OAAO,EANL,yDAML,CAAU,CAAC;IACZ,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,GAAG,SAAS,CAAC;IAEvB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,GAAG,GAAG,iCAAiC,iBAEzC,WAAW,EACX,SAAS,EAAE,MAAM,EACjB,aAAa,EACb,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,CAAC,IAC3C,IAAI,GAET,UAAU,CACX,CAAC,QAAQ,EAAE,CAAC;IAEb,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccountSasPermissions, accountSasPermissionsFromString } from \"./accountSasPermissions\";\nimport {\n AccountSasServices,\n accountSasServicesFromString,\n accountSasServicesToString,\n} from \"./accountSasServices\";\nimport { NamedKeyCredential, isNamedKeyCredential } from \"@azure/core-auth\";\nimport { SasIPRange } from \"./sasIPRange\";\nimport { SasProtocol } from \"./sasQueryParameters\";\nimport { generateAccountSasQueryParameters } from \"./accountSasSignatureValues\";\n\n/**\n * Generates a Table Account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas\n *\n * @param options - Optional parameters.\n * @returns An account SAS token\n */\nexport function generateAccountSas(\n credential: NamedKeyCredential,\n options: AccountSasOptions = {},\n): string {\n const {\n expiresOn,\n permissions = accountSasPermissionsFromString(\"rl\"),\n resourceTypes = \"sco\",\n services = accountSasServicesFromString(\"t\"),\n ...rest\n } = options;\n if (!isNamedKeyCredential(credential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n let expiry = expiresOn;\n\n if (expiry === undefined) {\n const now = new Date();\n expiry = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSasQueryParameters(\n {\n permissions,\n expiresOn: expiry,\n resourceTypes,\n services: accountSasServicesToString(services),\n ...rest,\n },\n credential,\n ).toString();\n\n return sas;\n}\n\n/**\n * Options to configure {@link generateAccountSas} operation.\n */\nexport interface AccountSasOptions {\n /**\n * The time at which the shared access signature becomes invalid. Default to an hour later if not provided.\n */\n expiresOn?: Date;\n /**\n * Specifies the list of permissions to be associated with the SAS.\n */\n permissions?: AccountSasPermissions;\n /**\n * Specifies the resource types associated with the shared access signature.\n */\n resourceTypes?: string;\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * SAS protocols allowed.\n */\n protocol?: SasProtocol;\n\n /**\n * When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * IP range allowed.\n */\n ipRange?: SasIPRange;\n /**\n * Account services\n */\n services?: AccountSasServices;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { isNamedKeyCredential } from "@azure/core-auth";
4
4
  import { generateTableSasQueryParameters, } from "./tableSasSignatureValues";
5
5
  import { tableSasPermissionsFromString } from "./tableSasPermisions";
@@ -1 +1 @@
1
- {"version":3,"file":"generateTableSas.js","sourceRoot":"","sources":["../../../src/sas/generateTableSas.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAsB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAEL,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,UAA8B,EAC9B,UAAmC,EAAE;IAErC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEzC,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,8DAA8D;IAC9D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,6BAA6B,CAAC,GAAG,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAM,GAAG,GAAG,+BAA+B,CAAC,SAAS,EAAE,UAAU,kCAC5D,OAAO,KACV,SAAS;QACT,WAAW,IACX,CAAC,QAAQ,EAAE,CAAC;IAEd,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { NamedKeyCredential, isNamedKeyCredential } from \"@azure/core-auth\";\nimport {\n TableSasSignatureValues,\n generateTableSasQueryParameters,\n} from \"./tableSasSignatureValues\";\nimport { tableSasPermissionsFromString } from \"./tableSasPermisions\";\n\n/**\n * Generates a Table Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\nexport function generateTableSas(\n tableName: string,\n credential: NamedKeyCredential,\n options: TableSasSignatureValues = {},\n): string {\n let { expiresOn, permissions } = options;\n\n if (!isNamedKeyCredential(credential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n // expiresOn and permissions are optional if an identifier is provided\n // set defaults when no identifier and no values were provided\n if (!options.identifier) {\n if (!permissions) {\n permissions = tableSasPermissionsFromString(\"r\");\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n }\n\n const sas = generateTableSasQueryParameters(tableName, credential, {\n ...options,\n expiresOn,\n permissions,\n }).toString();\n\n return sas;\n}\n"]}
1
+ {"version":3,"file":"generateTableSas.js","sourceRoot":"","sources":["../../../src/sas/generateTableSas.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAsB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAEL,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,UAA8B,EAC9B,UAAmC,EAAE;IAErC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEzC,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,8DAA8D;IAC9D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,6BAA6B,CAAC,GAAG,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAM,GAAG,GAAG,+BAA+B,CAAC,SAAS,EAAE,UAAU,kCAC5D,OAAO,KACV,SAAS;QACT,WAAW,IACX,CAAC,QAAQ,EAAE,CAAC;IAEd,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { NamedKeyCredential, isNamedKeyCredential } from \"@azure/core-auth\";\nimport {\n TableSasSignatureValues,\n generateTableSasQueryParameters,\n} from \"./tableSasSignatureValues\";\nimport { tableSasPermissionsFromString } from \"./tableSasPermisions\";\n\n/**\n * Generates a Table Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\nexport function generateTableSas(\n tableName: string,\n credential: NamedKeyCredential,\n options: TableSasSignatureValues = {},\n): string {\n let { expiresOn, permissions } = options;\n\n if (!isNamedKeyCredential(credential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n // expiresOn and permissions are optional if an identifier is provided\n // set defaults when no identifier and no values were provided\n if (!options.identifier) {\n if (!permissions) {\n permissions = tableSasPermissionsFromString(\"r\");\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n }\n\n const sas = generateTableSasQueryParameters(tableName, credential, {\n ...options,\n expiresOn,\n permissions,\n }).toString();\n\n return sas;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export { generateAccountSas } from "./generateAccountSas";
4
4
  export { generateTableSas } from "./generateTableSas";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sas/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { generateAccountSas, AccountSasOptions } from \"./generateAccountSas\";\nexport { generateTableSas } from \"./generateTableSas\";\nexport { TableSasSignatureValues } from \"./tableSasSignatureValues\";\nexport { SasIPRange } from \"./sasIPRange\";\nexport { TableSasPermissions } from \"./tableSasPermisions\";\nexport { AccountSasPermissions } from \"./accountSasPermissions\";\nexport { SasProtocol } from \"./sasQueryParameters\";\nexport { AccountSasServices } from \"./accountSasServices\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sas/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { generateAccountSas, AccountSasOptions } from \"./generateAccountSas\";\nexport { generateTableSas } from \"./generateTableSas\";\nexport { TableSasSignatureValues } from \"./tableSasSignatureValues\";\nexport { SasIPRange } from \"./sasIPRange\";\nexport { TableSasPermissions } from \"./tableSasPermisions\";\nexport { AccountSasPermissions } from \"./accountSasPermissions\";\nexport { SasProtocol } from \"./sasQueryParameters\";\nexport { AccountSasServices } from \"./accountSasServices\";\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/sas/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * A user delegation key.\n */\nexport interface UserDelegationKey {\n /**\n * The Azure Active Directory object ID in GUID format.\n */\n signedObjectId: string;\n /**\n * The Azure Active Directory tenant ID in GUID format.\n */\n signedTenantId: string;\n /**\n * The date-time the key is active.\n */\n signedStartsOn: Date;\n /**\n * The date-time the key expires.\n */\n signedExpiresOn: Date;\n /**\n * Abbreviation of the Azure Storage service that accepts the key.\n */\n signedService: string;\n /**\n * The service version that created the key.\n */\n signedVersion: string;\n /**\n * The key as a base64 string.\n */\n value: string;\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/sas/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * A user delegation key.\n */\nexport interface UserDelegationKey {\n /**\n * The Azure Active Directory object ID in GUID format.\n */\n signedObjectId: string;\n /**\n * The Azure Active Directory tenant ID in GUID format.\n */\n signedTenantId: string;\n /**\n * The date-time the key is active.\n */\n signedStartsOn: Date;\n /**\n * The date-time the key expires.\n */\n signedExpiresOn: Date;\n /**\n * Abbreviation of the Azure Storage service that accepts the key.\n */\n signedService: string;\n /**\n * The service version that created the key.\n */\n signedVersion: string;\n /**\n * The key as a base64 string.\n */\n value: string;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Generate SasIPRange format string. For example:
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sasIPRange.js","sourceRoot":"","sources":["../../../src/sas/sasIPRange.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AACzE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Allowed IP range for a SAS.\n */\nexport interface SasIPRange {\n /**\n * Starting IP address in the IP range.\n * If end IP doesn't provide, start IP will the only IP allowed.\n */\n start: string;\n /**\n * Optional. IP address that ends the IP range.\n * If not provided, start IP will the only IP allowed.\n */\n end?: string;\n}\n\n/**\n * Generate SasIPRange format string. For example:\n *\n * \"8.8.8.8\" or \"1.1.1.1-255.255.255.255\"\n *\n * @param ipRange -\n */\nexport function ipRangeToString(ipRange?: SasIPRange): string {\n if (!ipRange) {\n return \"\";\n }\n\n return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;\n}\n"]}
1
+ {"version":3,"file":"sasIPRange.js","sourceRoot":"","sources":["../../../src/sas/sasIPRange.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkBlC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AACzE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Allowed IP range for a SAS.\n */\nexport interface SasIPRange {\n /**\n * Starting IP address in the IP range.\n * If end IP doesn't provide, start IP will the only IP allowed.\n */\n start: string;\n /**\n * Optional. IP address that ends the IP range.\n * If not provided, start IP will the only IP allowed.\n */\n end?: string;\n}\n\n/**\n * Generate SasIPRange format string. For example:\n *\n * \"8.8.8.8\" or \"1.1.1.1-255.255.255.255\"\n *\n * @param ipRange -\n */\nexport function ipRangeToString(ipRange?: SasIPRange): string {\n if (!ipRange) {\n return \"\";\n }\n\n return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { ipRangeToString } from "./sasIPRange";
4
4
  import { truncatedISO8061Date } from "../utils/truncateISO8061Date";
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sasQueryParameters.js","sourceRoot":"","sources":["../../../src/sas/sasQueryParameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOpE;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAwI7B;;;;OAIG;IACH,I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,CAAC;QAC9B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { SasIPRange, ipRangeToString } from \"./sasIPRange\";\nimport { UserDelegationKey } from \"./models\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date\";\n\n/**\n * Protocols for generated SAS.\n */\nexport type SasProtocol = \"https\" | \"https,http\";\n\n/**\n * Represents the components that make up an Azure SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSasSignatureValues} and {@link TableSasSignatureValues}\n * types. Once generated, it can be encoded into a `string` and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SasQueryParameters {\n /**\n * The Tables API version.\n */\n public readonly version: string;\n\n /**\n * Optional. Table name to generate the SAS for\n */\n public readonly tableName?: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SasProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The table services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The table resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link TableSasSignatureValues}).\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * The Azure Active Directory object ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedOid?: string;\n\n /**\n * The Azure Active Directory tenant ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedTenantId?: string;\n\n /**\n * The date-time the key is active.\n * Property of user delegation key.\n */\n private readonly signedStartsOn?: Date;\n\n /**\n * The date-time the key expires.\n * Property of user delegation key.\n */\n private readonly signedExpiresOn?: Date;\n\n /**\n * Abbreviation of the Azure Table service that accepts the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedService?: string;\n\n /**\n * The service version that created the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedVersion?: string;\n\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This is only used for User Delegation SAS.\n */\n public readonly preauthorizedAgentObjectId?: string;\n\n /**\n * A GUID value that will be logged in the table diagnostic logs and can be used to correlate SAS generation with table resource access.\n * This is only used for User Delegation SAS.\n */\n public readonly correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endRowKey?: string;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the table service version\n * @param signature - Representing the signature for the SAS token\n * @param options - Optional. Options to construct the SASQueryParameters.\n */\n constructor(version: string, signature: string, options: SasQueryParametersOptions = {}) {\n this.version = version;\n this.signature = signature;\n\n this.permissions = options.permissions;\n this.services = options.services;\n this.resourceTypes = options.resourceTypes;\n this.protocol = options.protocol;\n this.startsOn = options.startsOn;\n this.expiresOn = options.expiresOn;\n this.ipRangeInner = options.ipRange;\n this.identifier = options.identifier;\n this.tableName = options.tableName;\n this.endPartitionKey = options.endPartitionKey;\n this.endRowKey = options.endRowKey;\n this.startPartitionKey = options.startPartitionKey;\n this.startRowKey = options.startRowKey;\n\n if (options.userDelegationKey) {\n this.signedOid = options.userDelegationKey.signedObjectId;\n this.signedTenantId = options.userDelegationKey.signedTenantId;\n this.signedStartsOn = options.userDelegationKey.signedStartsOn;\n this.signedExpiresOn = options.userDelegationKey.signedExpiresOn;\n this.signedService = options.userDelegationKey.signedService;\n this.signedVersion = options.userDelegationKey.signedVersion;\n\n this.preauthorizedAgentObjectId = options.preauthorizedAgentObjectId;\n this.correlationId = options.correlationId;\n }\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\", // SignedVersion\n \"ss\", // SignedServices\n \"srt\", // SignedResourceTypes\n \"spr\", // SignedProtocol\n \"st\", // SignedStart\n \"se\", // SignedExpiry\n \"sip\", // SignedIP\n \"si\", // SignedIdentifier\n \"skoid\", // Signed object ID\n \"sktid\", // Signed tenant ID\n \"skt\", // Signed key start time\n \"ske\", // Signed key expiry time\n \"sks\", // Signed key service\n \"skv\", // Signed key version\n \"sr\", // signedResource\n \"sp\", // SignedPermission\n \"sig\", // Signature\n \"rscc\", // Cache-Control\n \"rscd\", // Content-Disposition\n \"rsce\", // Content-Encoding\n \"rscl\", // Content-Language\n \"rsct\", // Content-Type\n \"saoid\", // signedAuthorizedObjectId\n \"scid\", // signedCorrelationId\n \"tn\", // TableName,\n \"srk\", // StartRowKey\n \"spk\", // StartPartitionKey\n \"epk\", // EndPartitionKey\n \"erk\", // EndRowKey\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"skoid\": // Signed object ID\n this.tryAppendQueryParameter(queries, param, this.signedOid);\n break;\n case \"sktid\": // Signed tenant ID\n this.tryAppendQueryParameter(queries, param, this.signedTenantId);\n break;\n case \"skt\": // Signed key start time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined,\n );\n break;\n case \"ske\": // Signed key expiry time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined,\n );\n break;\n case \"sks\": // Signed key service\n this.tryAppendQueryParameter(queries, param, this.signedService);\n break;\n case \"skv\": // Signed key version\n this.tryAppendQueryParameter(queries, param, this.signedVersion);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"saoid\":\n this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);\n break;\n case \"scid\":\n this.tryAppendQueryParameter(queries, param, this.correlationId);\n break;\n case \"tn\":\n this.tryAppendQueryParameter(queries, param, this.tableName);\n break;\n case \"spk\":\n this.tryAppendQueryParameter(queries, param, this.startPartitionKey);\n break;\n case \"srk\":\n this.tryAppendQueryParameter(queries, param, this.startRowKey);\n break;\n case \"epk\":\n this.tryAppendQueryParameter(queries, param, this.endPartitionKey);\n break;\n case \"erk\":\n this.tryAppendQueryParameter(queries, param, this.endRowKey);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n\n/**\n * Options to construct {@link SasQueryParameters}.\n */\nexport interface SasQueryParametersOptions {\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n permissions?: string;\n /**\n * Optional. Table name to generate the SAS for\n */\n tableName?: string;\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n services?: string;\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n resourceTypes?: string;\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n protocol?: SasProtocol;\n /**\n * Optional. The start time for this SAS token.\n */\n startsOn?: Date;\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n expiresOn?: Date;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n /**\n * Optional. The signed identifier for access policy\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n /**\n * Optional. Specifies which resources are accessible via the SAS (only for {@link AccountSasSignatureValues}).\n * @see https://docs.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only\n */\n resource?: string;\n /**\n * User delegation key properties.\n */\n userDelegationKey?: UserDelegationKey;\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This cannot be used in conjuction with {@link signedUnauthorizedUserObjectId}.\n * This is only used for User Delegation SAS.\n */\n preauthorizedAgentObjectId?: string;\n /**\n * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access.\n * This is only used for User Delegation SAS.\n */\n correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endRowKey?: string;\n}\n"]}
1
+ {"version":3,"file":"sasQueryParameters.js","sourceRoot":"","sources":["../../../src/sas/sasQueryParameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOpE;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAwI7B;;;;OAIG;IACH,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;gBAC1B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;aAC/B,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;OAMG;IACH,YAAY,OAAe,EAAE,SAAiB,EAAE,UAAqC,EAAE;QACrF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,OAAO,C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,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;oBACnE,MAAM;gBACR,KAAK,KAAK;oBACR,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;oBAC7D,MAAM;YACV,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACK,uBAAuB,CAAC,OAAiB,EAAE,GAAW,EAAE,KAAc;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QAED,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { SasIPRange, ipRangeToString } from \"./sasIPRange\";\nimport { UserDelegationKey } from \"./models\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date\";\n\n/**\n * Protocols for generated SAS.\n */\nexport type SasProtocol = \"https\" | \"https,http\";\n\n/**\n * Represents the components that make up an Azure SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSasSignatureValues} and {@link TableSasSignatureValues}\n * types. Once generated, it can be encoded into a `string` and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SasQueryParameters {\n /**\n * The Tables API version.\n */\n public readonly version: string;\n\n /**\n * Optional. Table name to generate the SAS for\n */\n public readonly tableName?: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SasProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The table services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The table resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link TableSasSignatureValues}).\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * The Azure Active Directory object ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedOid?: string;\n\n /**\n * The Azure Active Directory tenant ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedTenantId?: string;\n\n /**\n * The date-time the key is active.\n * Property of user delegation key.\n */\n private readonly signedStartsOn?: Date;\n\n /**\n * The date-time the key expires.\n * Property of user delegation key.\n */\n private readonly signedExpiresOn?: Date;\n\n /**\n * Abbreviation of the Azure Table service that accepts the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedService?: string;\n\n /**\n * The service version that created the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedVersion?: string;\n\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This is only used for User Delegation SAS.\n */\n public readonly preauthorizedAgentObjectId?: string;\n\n /**\n * A GUID value that will be logged in the table diagnostic logs and can be used to correlate SAS generation with table resource access.\n * This is only used for User Delegation SAS.\n */\n public readonly correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n public readonly startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n public readonly endRowKey?: string;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the table service version\n * @param signature - Representing the signature for the SAS token\n * @param options - Optional. Options to construct the SASQueryParameters.\n */\n constructor(version: string, signature: string, options: SasQueryParametersOptions = {}) {\n this.version = version;\n this.signature = signature;\n\n this.permissions = options.permissions;\n this.services = options.services;\n this.resourceTypes = options.resourceTypes;\n this.protocol = options.protocol;\n this.startsOn = options.startsOn;\n this.expiresOn = options.expiresOn;\n this.ipRangeInner = options.ipRange;\n this.identifier = options.identifier;\n this.tableName = options.tableName;\n this.endPartitionKey = options.endPartitionKey;\n this.endRowKey = options.endRowKey;\n this.startPartitionKey = options.startPartitionKey;\n this.startRowKey = options.startRowKey;\n\n if (options.userDelegationKey) {\n this.signedOid = options.userDelegationKey.signedObjectId;\n this.signedTenantId = options.userDelegationKey.signedTenantId;\n this.signedStartsOn = options.userDelegationKey.signedStartsOn;\n this.signedExpiresOn = options.userDelegationKey.signedExpiresOn;\n this.signedService = options.userDelegationKey.signedService;\n this.signedVersion = options.userDelegationKey.signedVersion;\n\n this.preauthorizedAgentObjectId = options.preauthorizedAgentObjectId;\n this.correlationId = options.correlationId;\n }\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\", // SignedVersion\n \"ss\", // SignedServices\n \"srt\", // SignedResourceTypes\n \"spr\", // SignedProtocol\n \"st\", // SignedStart\n \"se\", // SignedExpiry\n \"sip\", // SignedIP\n \"si\", // SignedIdentifier\n \"skoid\", // Signed object ID\n \"sktid\", // Signed tenant ID\n \"skt\", // Signed key start time\n \"ske\", // Signed key expiry time\n \"sks\", // Signed key service\n \"skv\", // Signed key version\n \"sr\", // signedResource\n \"sp\", // SignedPermission\n \"sig\", // Signature\n \"rscc\", // Cache-Control\n \"rscd\", // Content-Disposition\n \"rsce\", // Content-Encoding\n \"rscl\", // Content-Language\n \"rsct\", // Content-Type\n \"saoid\", // signedAuthorizedObjectId\n \"scid\", // signedCorrelationId\n \"tn\", // TableName,\n \"srk\", // StartRowKey\n \"spk\", // StartPartitionKey\n \"epk\", // EndPartitionKey\n \"erk\", // EndRowKey\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"skoid\": // Signed object ID\n this.tryAppendQueryParameter(queries, param, this.signedOid);\n break;\n case \"sktid\": // Signed tenant ID\n this.tryAppendQueryParameter(queries, param, this.signedTenantId);\n break;\n case \"skt\": // Signed key start time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined,\n );\n break;\n case \"ske\": // Signed key expiry time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined,\n );\n break;\n case \"sks\": // Signed key service\n this.tryAppendQueryParameter(queries, param, this.signedService);\n break;\n case \"skv\": // Signed key version\n this.tryAppendQueryParameter(queries, param, this.signedVersion);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"saoid\":\n this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);\n break;\n case \"scid\":\n this.tryAppendQueryParameter(queries, param, this.correlationId);\n break;\n case \"tn\":\n this.tryAppendQueryParameter(queries, param, this.tableName);\n break;\n case \"spk\":\n this.tryAppendQueryParameter(queries, param, this.startPartitionKey);\n break;\n case \"srk\":\n this.tryAppendQueryParameter(queries, param, this.startRowKey);\n break;\n case \"epk\":\n this.tryAppendQueryParameter(queries, param, this.endPartitionKey);\n break;\n case \"erk\":\n this.tryAppendQueryParameter(queries, param, this.endRowKey);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n\n/**\n * Options to construct {@link SasQueryParameters}.\n */\nexport interface SasQueryParametersOptions {\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSasPermissions}, or {@link TableSasPermissions} for\n * more details.\n */\n permissions?: string;\n /**\n * Optional. Table name to generate the SAS for\n */\n tableName?: string;\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSasServices}\n * for more details.\n */\n services?: string;\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSasResourceTypes} for more details.\n */\n resourceTypes?: string;\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n protocol?: SasProtocol;\n /**\n * Optional. The start time for this SAS token.\n */\n startsOn?: Date;\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n expiresOn?: Date;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n /**\n * Optional. The signed identifier for access policy\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n /**\n * Optional. Specifies which resources are accessible via the SAS (only for {@link AccountSasSignatureValues}).\n * @see https://docs.microsoft.com/rest/api/storageservices/create-service-sas#specifying-the-signed-resource-blob-service-only\n */\n resource?: string;\n /**\n * User delegation key properties.\n */\n userDelegationKey?: UserDelegationKey;\n /**\n * Authorized AAD Object ID in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key\n * to perform the action granted by the SAS. The Azure Table service will ensure that the owner of the user delegation key\n * has the required permissions before granting access but no additional permission check for the user specified in\n * this value will be performed. This cannot be used in conjuction with {@link signedUnauthorizedUserObjectId}.\n * This is only used for User Delegation SAS.\n */\n preauthorizedAgentObjectId?: string;\n /**\n * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access.\n * This is only used for User Delegation SAS.\n */\n correlationId?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startPartitionKey?: string;\n\n /**\n * Optional, but startPartitionKey must accompany startRowKey. The minimum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no lower bound on the table entities that can be accessed.\n */\n startRowKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endPartitionKey?: string;\n\n /**\n * Optional, but endPartitionKey must accompany endRowKey. The maximum partition and row keys that are accessible with this shared access signature.\n * Key values are inclusive. If they're omitted, there's no upper bound on the table entities that can be accessed.\n */\n endRowKey?: string;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * Creates a {@link TableSasPermissions} from the specified permissions string. This method will throw an
5
5
  * Error if it encounters a character that does not correspond to a valid permission.
@@ -1 +1 @@
1
- {"version":3,"file":"tableSasPermisions.js","sourceRoot":"","sources":["../../../src/sas/tableSasPermisions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAmB;IAC/D,MAAM,mBAAmB,GAAwB,EAAE,CAAC;IACpD,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;QAC/B,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,GAAG;gBACN,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC;gBACjC,MAAM;YACR,KAAK,GAAG;gBACN,mBAAmB,CAAC,GAAG,GAAG,IAAI,CAAC;gBAC/B,MAAM;YACR,KAAK,GAAG;gBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;gBAClC,MAAM;YACR,KAAK,GAAG;gBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;gBAClC,MAAM;YACR;gBACE,MAAM,IAAI,UAAU,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,WAAiC;IAC3E,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,iBAAiB,GAAa,EAAE,CAAC;IACvC,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC;QACpB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Creates a {@link TableSasPermissions} from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\nexport function tableSasPermissionsFromString(permissions: string): TableSasPermissions {\n const tableSasPermissions: TableSasPermissions = {};\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n tableSasPermissions.query = true;\n break;\n case \"a\":\n tableSasPermissions.add = true;\n break;\n case \"u\":\n tableSasPermissions.update = true;\n break;\n case \"d\":\n tableSasPermissions.delete = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n\n return tableSasPermissions;\n}\n\n/**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the TableSasPermissions\n */\nexport function tableSasPermissionsToString(permissions?: TableSasPermissions): string {\n if (!permissions) {\n return \"\";\n }\n\n const permissionsString: string[] = [];\n if (permissions.query) {\n permissionsString.push(\"r\");\n }\n if (permissions.add) {\n permissionsString.push(\"a\");\n }\n if (permissions.update) {\n permissionsString.push(\"u\");\n }\n\n if (permissions.delete) {\n permissionsString.push(\"d\");\n }\n return permissionsString.join(\"\");\n}\n\n/**\n * A type that looks like a Table SAS permission.\n * Used in {@link TableSasPermissions} to parse SAS permissions from raw objects.\n */\nexport interface TableSasPermissions {\n /**\n * Specifies Query access granted.\n */\n query?: boolean;\n\n /**\n * Specifies Add access granted.\n */\n add?: boolean;\n\n /**\n * Specifies Update access granted.\n */\n update?: boolean;\n\n /**\n * Specifies Delete access granted.\n */\n delete?: boolean;\n}\n"]}
1
+ {"version":3,"file":"tableSasPermisions.js","sourceRoot":"","sources":["../../../src/sas/tableSasPermisions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAmB;IAC/D,MAAM,mBAAmB,GAAwB,EAAE,CAAC;IACpD,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;QAC/B,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,GAAG;gBACN,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC;gBACjC,MAAM;YACR,KAAK,GAAG;gBACN,mBAAmB,CAAC,GAAG,GAAG,IAAI,CAAC;gBAC/B,MAAM;YACR,KAAK,GAAG;gBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;gBAClC,MAAM;YACR,KAAK,GAAG;gBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;gBAClC,MAAM;YACR;gBACE,MAAM,IAAI,UAAU,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,WAAiC;IAC3E,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,iBAAiB,GAAa,EAAE,CAAC;IACvC,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;QACtB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC;QACpB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Creates a {@link TableSasPermissions} from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\nexport function tableSasPermissionsFromString(permissions: string): TableSasPermissions {\n const tableSasPermissions: TableSasPermissions = {};\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n tableSasPermissions.query = true;\n break;\n case \"a\":\n tableSasPermissions.add = true;\n break;\n case \"u\":\n tableSasPermissions.update = true;\n break;\n case \"d\":\n tableSasPermissions.delete = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n\n return tableSasPermissions;\n}\n\n/**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the TableSasPermissions\n */\nexport function tableSasPermissionsToString(permissions?: TableSasPermissions): string {\n if (!permissions) {\n return \"\";\n }\n\n const permissionsString: string[] = [];\n if (permissions.query) {\n permissionsString.push(\"r\");\n }\n if (permissions.add) {\n permissionsString.push(\"a\");\n }\n if (permissions.update) {\n permissionsString.push(\"u\");\n }\n\n if (permissions.delete) {\n permissionsString.push(\"d\");\n }\n return permissionsString.join(\"\");\n}\n\n/**\n * A type that looks like a Table SAS permission.\n * Used in {@link TableSasPermissions} to parse SAS permissions from raw objects.\n */\nexport interface TableSasPermissions {\n /**\n * Specifies Query access granted.\n */\n query?: boolean;\n\n /**\n * Specifies Add access granted.\n */\n add?: boolean;\n\n /**\n * Specifies Update access granted.\n */\n update?: boolean;\n\n /**\n * Specifies Delete access granted.\n */\n delete?: boolean;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  /**
4
4
  * ONLY AVAILABLE IN NODE.JS RUNTIME.
5
5
  *