diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0b2009d1..d96d216b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,12 +2,12 @@ name: pull-request on: pull_request: - branches: [ main ] + branches: [main] permissions: pull-requests: write contents: write - + jobs: reuse-test: runs-on: ubuntu-20.04 @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16.3.0 + node-version: 20.5.1 - name: make nvm available run: | sudo cp ~/.nvm/nvm.sh /usr/local/bin/nvm diff --git a/Makefile b/Makefile index 33398d17..72d3a239 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ reuse-test: docker run --rm --volume $(PWD):/data fsfe/reuse:0.11.1 lint .PHONY: examples-test -examples-test: example-web-vms example-node-volumes +examples-test: example-web-vms example-node-volumes example-node-create-volumes @echo examples are OK .PHONY: example-web-vms @@ -76,10 +76,10 @@ example-web-vms: cd examples/web-vms; \ echo "nvm --version:"; \ nvm --version; \ - echo "installing nvm..."; \ - nvm install; \ - echo "using nvm..."; \ - nvm use; \ + echo "nvm install..."; \ + nvm install 20.5.1; \ + echo "nvm use..."; \ + nvm use 20.5.1; \ echo "npm version:"; \ npm version; \ echo "npm install..."; \ @@ -93,15 +93,15 @@ example-node-create-volumes: echo "nvm version:"; \ nvm --version; \ echo "nvm install..."; \ - nvm install; \ + nvm install 20.5.1; \ echo "nvm use..."; \ - nvm use; \ + nvm use 20.5.1; \ echo "npm version:"; \ npm version; \ echo "npm install..."; \ npm install --local --install-links; \ echo "running node example..."; \ - node --trace-warnings ./src/index.js + node --trace-warnings ./src/index.js > /dev/null .PHONY: example-node-volumes example-node-volumes: @@ -111,9 +111,9 @@ example-node-volumes: echo "nvm version:"; \ nvm --version; \ echo "nvm install..."; \ - nvm install; \ + nvm install 20.5.1; \ echo "nvm use..."; \ - nvm use; \ + nvm use 20.5.1; \ echo "npm version:"; \ npm version; \ echo "npm install..."; \ diff --git a/dist/cjs/models/Catalogs.d.ts b/dist/cjs/models/Catalogs.d.ts index 7b883010..9ae13aba 100644 --- a/dist/cjs/models/Catalogs.d.ts +++ b/dist/cjs/models/Catalogs.d.ts @@ -48,7 +48,7 @@ export declare const CatalogsStateEnum: { readonly Current: "CURRENT"; readonly Obsolete: "OBSOLETE"; }; -export declare type CatalogsStateEnum = typeof CatalogsStateEnum[keyof typeof CatalogsStateEnum]; +export type CatalogsStateEnum = typeof CatalogsStateEnum[keyof typeof CatalogsStateEnum]; export declare function CatalogsFromJSON(json: any): Catalogs; export declare function CatalogsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Catalogs; export declare function CatalogsToJSON(value?: Catalogs | null): any; diff --git a/dist/cjs/models/CreateVmGroupRequest.d.ts b/dist/cjs/models/CreateVmGroupRequest.d.ts index 5a0bf8f4..a88e5d29 100644 --- a/dist/cjs/models/CreateVmGroupRequest.d.ts +++ b/dist/cjs/models/CreateVmGroupRequest.d.ts @@ -79,7 +79,7 @@ export declare const CreateVmGroupRequestPositioningStrategyEnum: { readonly NoStrategy: "no-strategy"; readonly Repulse: "repulse"; }; -export declare type CreateVmGroupRequestPositioningStrategyEnum = typeof CreateVmGroupRequestPositioningStrategyEnum[keyof typeof CreateVmGroupRequestPositioningStrategyEnum]; +export type CreateVmGroupRequestPositioningStrategyEnum = typeof CreateVmGroupRequestPositioningStrategyEnum[keyof typeof CreateVmGroupRequestPositioningStrategyEnum]; export declare function CreateVmGroupRequestFromJSON(json: any): CreateVmGroupRequest; export declare function CreateVmGroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateVmGroupRequest; export declare function CreateVmGroupRequestToJSON(value?: CreateVmGroupRequest | null): any; diff --git a/dist/cjs/models/CreateVmTemplateRequest.d.ts b/dist/cjs/models/CreateVmTemplateRequest.d.ts index 908c8fac..9e439c0d 100644 --- a/dist/cjs/models/CreateVmTemplateRequest.d.ts +++ b/dist/cjs/models/CreateVmTemplateRequest.d.ts @@ -85,7 +85,7 @@ export declare const CreateVmTemplateRequestCpuPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type CreateVmTemplateRequestCpuPerformanceEnum = typeof CreateVmTemplateRequestCpuPerformanceEnum[keyof typeof CreateVmTemplateRequestCpuPerformanceEnum]; +export type CreateVmTemplateRequestCpuPerformanceEnum = typeof CreateVmTemplateRequestCpuPerformanceEnum[keyof typeof CreateVmTemplateRequestCpuPerformanceEnum]; export declare function CreateVmTemplateRequestFromJSON(json: any): CreateVmTemplateRequest; export declare function CreateVmTemplateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateVmTemplateRequest; export declare function CreateVmTemplateRequestToJSON(value?: CreateVmTemplateRequest | null): any; diff --git a/dist/cjs/models/CreateVmsRequest.d.ts b/dist/cjs/models/CreateVmsRequest.d.ts index 782af460..481f3966 100644 --- a/dist/cjs/models/CreateVmsRequest.d.ts +++ b/dist/cjs/models/CreateVmsRequest.d.ts @@ -154,7 +154,7 @@ export declare const CreateVmsRequestPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type CreateVmsRequestPerformanceEnum = typeof CreateVmsRequestPerformanceEnum[keyof typeof CreateVmsRequestPerformanceEnum]; +export type CreateVmsRequestPerformanceEnum = typeof CreateVmsRequestPerformanceEnum[keyof typeof CreateVmsRequestPerformanceEnum]; export declare function CreateVmsRequestFromJSON(json: any): CreateVmsRequest; export declare function CreateVmsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateVmsRequest; export declare function CreateVmsRequestToJSON(value?: CreateVmsRequest | null): any; diff --git a/dist/cjs/models/UpdateDirectLinkInterfaceRequest.d.ts b/dist/cjs/models/UpdateDirectLinkInterfaceRequest.d.ts index 0bf92327..affdffc2 100644 --- a/dist/cjs/models/UpdateDirectLinkInterfaceRequest.d.ts +++ b/dist/cjs/models/UpdateDirectLinkInterfaceRequest.d.ts @@ -40,7 +40,7 @@ export interface UpdateDirectLinkInterfaceRequest { export declare const UpdateDirectLinkInterfaceRequestMtuEnum: { readonly NUMBER_1500: 1500; }; -export declare type UpdateDirectLinkInterfaceRequestMtuEnum = typeof UpdateDirectLinkInterfaceRequestMtuEnum[keyof typeof UpdateDirectLinkInterfaceRequestMtuEnum]; +export type UpdateDirectLinkInterfaceRequestMtuEnum = typeof UpdateDirectLinkInterfaceRequestMtuEnum[keyof typeof UpdateDirectLinkInterfaceRequestMtuEnum]; export declare function UpdateDirectLinkInterfaceRequestFromJSON(json: any): UpdateDirectLinkInterfaceRequest; export declare function UpdateDirectLinkInterfaceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDirectLinkInterfaceRequest; export declare function UpdateDirectLinkInterfaceRequestToJSON(value?: UpdateDirectLinkInterfaceRequest | null): any; diff --git a/dist/cjs/models/UpdateVmRequest.d.ts b/dist/cjs/models/UpdateVmRequest.d.ts index e7a26125..b849a8bf 100644 --- a/dist/cjs/models/UpdateVmRequest.d.ts +++ b/dist/cjs/models/UpdateVmRequest.d.ts @@ -104,7 +104,7 @@ export declare const UpdateVmRequestPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type UpdateVmRequestPerformanceEnum = typeof UpdateVmRequestPerformanceEnum[keyof typeof UpdateVmRequestPerformanceEnum]; +export type UpdateVmRequestPerformanceEnum = typeof UpdateVmRequestPerformanceEnum[keyof typeof UpdateVmRequestPerformanceEnum]; export declare function UpdateVmRequestFromJSON(json: any): UpdateVmRequest; export declare function UpdateVmRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateVmRequest; export declare function UpdateVmRequestToJSON(value?: UpdateVmRequest | null): any; diff --git a/dist/cjs/models/VmGroup.d.ts b/dist/cjs/models/VmGroup.d.ts index e073013f..f2f27c36 100644 --- a/dist/cjs/models/VmGroup.d.ts +++ b/dist/cjs/models/VmGroup.d.ts @@ -97,7 +97,7 @@ export declare const VmGroupPositioningStrategyEnum: { readonly NoStrategy: "no-strategy"; readonly Repulse: "repulse"; }; -export declare type VmGroupPositioningStrategyEnum = typeof VmGroupPositioningStrategyEnum[keyof typeof VmGroupPositioningStrategyEnum]; +export type VmGroupPositioningStrategyEnum = typeof VmGroupPositioningStrategyEnum[keyof typeof VmGroupPositioningStrategyEnum]; /** * @export */ @@ -109,7 +109,7 @@ export declare const VmGroupStateEnum: { readonly ScalingDown: "scaling down"; readonly ScalingUp: "scaling up"; }; -export declare type VmGroupStateEnum = typeof VmGroupStateEnum[keyof typeof VmGroupStateEnum]; +export type VmGroupStateEnum = typeof VmGroupStateEnum[keyof typeof VmGroupStateEnum]; export declare function VmGroupFromJSON(json: any): VmGroup; export declare function VmGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): VmGroup; export declare function VmGroupToJSON(value?: VmGroup | null): any; diff --git a/dist/cjs/models/VmTemplate.d.ts b/dist/cjs/models/VmTemplate.d.ts index f11eb6bc..0fb6f4f7 100644 --- a/dist/cjs/models/VmTemplate.d.ts +++ b/dist/cjs/models/VmTemplate.d.ts @@ -91,7 +91,7 @@ export declare const VmTemplateCpuPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type VmTemplateCpuPerformanceEnum = typeof VmTemplateCpuPerformanceEnum[keyof typeof VmTemplateCpuPerformanceEnum]; +export type VmTemplateCpuPerformanceEnum = typeof VmTemplateCpuPerformanceEnum[keyof typeof VmTemplateCpuPerformanceEnum]; export declare function VmTemplateFromJSON(json: any): VmTemplate; export declare function VmTemplateFromJSONTyped(json: any, ignoreDiscriminator: boolean): VmTemplate; export declare function VmTemplateToJSON(value?: VmTemplate | null): any; diff --git a/dist/cjs/runtime.d.ts b/dist/cjs/runtime.d.ts index fabe9be1..d923db9e 100644 --- a/dist/cjs/runtime.d.ts +++ b/dist/cjs/runtime.d.ts @@ -89,24 +89,24 @@ export declare const COLLECTION_FORMATS: { tsv: string; pipes: string; }; -export declare type FetchAPI = WindowOrWorkerGlobalScope['fetch']; -export declare type Json = any; -export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; -export declare type HTTPHeaders = { +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string; }; -export declare type HTTPQuery = { +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery; }; -export declare type HTTPBody = Json | FormData | URLSearchParams; -export declare type HTTPRequestInit = { +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody; }; -export declare type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; -export declare type InitOverideFunction = (requestContext: { +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; +export type InitOverideFunction = (requestContext: { init: HTTPRequestInit; context: RequestOpts; }) => Promise; diff --git a/dist/esm/models/Catalogs.d.ts b/dist/esm/models/Catalogs.d.ts index 7b883010..9ae13aba 100644 --- a/dist/esm/models/Catalogs.d.ts +++ b/dist/esm/models/Catalogs.d.ts @@ -48,7 +48,7 @@ export declare const CatalogsStateEnum: { readonly Current: "CURRENT"; readonly Obsolete: "OBSOLETE"; }; -export declare type CatalogsStateEnum = typeof CatalogsStateEnum[keyof typeof CatalogsStateEnum]; +export type CatalogsStateEnum = typeof CatalogsStateEnum[keyof typeof CatalogsStateEnum]; export declare function CatalogsFromJSON(json: any): Catalogs; export declare function CatalogsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Catalogs; export declare function CatalogsToJSON(value?: Catalogs | null): any; diff --git a/dist/esm/models/CreateVmGroupRequest.d.ts b/dist/esm/models/CreateVmGroupRequest.d.ts index 5a0bf8f4..a88e5d29 100644 --- a/dist/esm/models/CreateVmGroupRequest.d.ts +++ b/dist/esm/models/CreateVmGroupRequest.d.ts @@ -79,7 +79,7 @@ export declare const CreateVmGroupRequestPositioningStrategyEnum: { readonly NoStrategy: "no-strategy"; readonly Repulse: "repulse"; }; -export declare type CreateVmGroupRequestPositioningStrategyEnum = typeof CreateVmGroupRequestPositioningStrategyEnum[keyof typeof CreateVmGroupRequestPositioningStrategyEnum]; +export type CreateVmGroupRequestPositioningStrategyEnum = typeof CreateVmGroupRequestPositioningStrategyEnum[keyof typeof CreateVmGroupRequestPositioningStrategyEnum]; export declare function CreateVmGroupRequestFromJSON(json: any): CreateVmGroupRequest; export declare function CreateVmGroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateVmGroupRequest; export declare function CreateVmGroupRequestToJSON(value?: CreateVmGroupRequest | null): any; diff --git a/dist/esm/models/CreateVmTemplateRequest.d.ts b/dist/esm/models/CreateVmTemplateRequest.d.ts index 908c8fac..9e439c0d 100644 --- a/dist/esm/models/CreateVmTemplateRequest.d.ts +++ b/dist/esm/models/CreateVmTemplateRequest.d.ts @@ -85,7 +85,7 @@ export declare const CreateVmTemplateRequestCpuPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type CreateVmTemplateRequestCpuPerformanceEnum = typeof CreateVmTemplateRequestCpuPerformanceEnum[keyof typeof CreateVmTemplateRequestCpuPerformanceEnum]; +export type CreateVmTemplateRequestCpuPerformanceEnum = typeof CreateVmTemplateRequestCpuPerformanceEnum[keyof typeof CreateVmTemplateRequestCpuPerformanceEnum]; export declare function CreateVmTemplateRequestFromJSON(json: any): CreateVmTemplateRequest; export declare function CreateVmTemplateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateVmTemplateRequest; export declare function CreateVmTemplateRequestToJSON(value?: CreateVmTemplateRequest | null): any; diff --git a/dist/esm/models/CreateVmsRequest.d.ts b/dist/esm/models/CreateVmsRequest.d.ts index 782af460..481f3966 100644 --- a/dist/esm/models/CreateVmsRequest.d.ts +++ b/dist/esm/models/CreateVmsRequest.d.ts @@ -154,7 +154,7 @@ export declare const CreateVmsRequestPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type CreateVmsRequestPerformanceEnum = typeof CreateVmsRequestPerformanceEnum[keyof typeof CreateVmsRequestPerformanceEnum]; +export type CreateVmsRequestPerformanceEnum = typeof CreateVmsRequestPerformanceEnum[keyof typeof CreateVmsRequestPerformanceEnum]; export declare function CreateVmsRequestFromJSON(json: any): CreateVmsRequest; export declare function CreateVmsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateVmsRequest; export declare function CreateVmsRequestToJSON(value?: CreateVmsRequest | null): any; diff --git a/dist/esm/models/UpdateDirectLinkInterfaceRequest.d.ts b/dist/esm/models/UpdateDirectLinkInterfaceRequest.d.ts index 0bf92327..affdffc2 100644 --- a/dist/esm/models/UpdateDirectLinkInterfaceRequest.d.ts +++ b/dist/esm/models/UpdateDirectLinkInterfaceRequest.d.ts @@ -40,7 +40,7 @@ export interface UpdateDirectLinkInterfaceRequest { export declare const UpdateDirectLinkInterfaceRequestMtuEnum: { readonly NUMBER_1500: 1500; }; -export declare type UpdateDirectLinkInterfaceRequestMtuEnum = typeof UpdateDirectLinkInterfaceRequestMtuEnum[keyof typeof UpdateDirectLinkInterfaceRequestMtuEnum]; +export type UpdateDirectLinkInterfaceRequestMtuEnum = typeof UpdateDirectLinkInterfaceRequestMtuEnum[keyof typeof UpdateDirectLinkInterfaceRequestMtuEnum]; export declare function UpdateDirectLinkInterfaceRequestFromJSON(json: any): UpdateDirectLinkInterfaceRequest; export declare function UpdateDirectLinkInterfaceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDirectLinkInterfaceRequest; export declare function UpdateDirectLinkInterfaceRequestToJSON(value?: UpdateDirectLinkInterfaceRequest | null): any; diff --git a/dist/esm/models/UpdateVmRequest.d.ts b/dist/esm/models/UpdateVmRequest.d.ts index e7a26125..b849a8bf 100644 --- a/dist/esm/models/UpdateVmRequest.d.ts +++ b/dist/esm/models/UpdateVmRequest.d.ts @@ -104,7 +104,7 @@ export declare const UpdateVmRequestPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type UpdateVmRequestPerformanceEnum = typeof UpdateVmRequestPerformanceEnum[keyof typeof UpdateVmRequestPerformanceEnum]; +export type UpdateVmRequestPerformanceEnum = typeof UpdateVmRequestPerformanceEnum[keyof typeof UpdateVmRequestPerformanceEnum]; export declare function UpdateVmRequestFromJSON(json: any): UpdateVmRequest; export declare function UpdateVmRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateVmRequest; export declare function UpdateVmRequestToJSON(value?: UpdateVmRequest | null): any; diff --git a/dist/esm/models/VmGroup.d.ts b/dist/esm/models/VmGroup.d.ts index e073013f..f2f27c36 100644 --- a/dist/esm/models/VmGroup.d.ts +++ b/dist/esm/models/VmGroup.d.ts @@ -97,7 +97,7 @@ export declare const VmGroupPositioningStrategyEnum: { readonly NoStrategy: "no-strategy"; readonly Repulse: "repulse"; }; -export declare type VmGroupPositioningStrategyEnum = typeof VmGroupPositioningStrategyEnum[keyof typeof VmGroupPositioningStrategyEnum]; +export type VmGroupPositioningStrategyEnum = typeof VmGroupPositioningStrategyEnum[keyof typeof VmGroupPositioningStrategyEnum]; /** * @export */ @@ -109,7 +109,7 @@ export declare const VmGroupStateEnum: { readonly ScalingDown: "scaling down"; readonly ScalingUp: "scaling up"; }; -export declare type VmGroupStateEnum = typeof VmGroupStateEnum[keyof typeof VmGroupStateEnum]; +export type VmGroupStateEnum = typeof VmGroupStateEnum[keyof typeof VmGroupStateEnum]; export declare function VmGroupFromJSON(json: any): VmGroup; export declare function VmGroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): VmGroup; export declare function VmGroupToJSON(value?: VmGroup | null): any; diff --git a/dist/esm/models/VmTemplate.d.ts b/dist/esm/models/VmTemplate.d.ts index f11eb6bc..0fb6f4f7 100644 --- a/dist/esm/models/VmTemplate.d.ts +++ b/dist/esm/models/VmTemplate.d.ts @@ -91,7 +91,7 @@ export declare const VmTemplateCpuPerformanceEnum: { readonly High: "high"; readonly Highest: "highest"; }; -export declare type VmTemplateCpuPerformanceEnum = typeof VmTemplateCpuPerformanceEnum[keyof typeof VmTemplateCpuPerformanceEnum]; +export type VmTemplateCpuPerformanceEnum = typeof VmTemplateCpuPerformanceEnum[keyof typeof VmTemplateCpuPerformanceEnum]; export declare function VmTemplateFromJSON(json: any): VmTemplate; export declare function VmTemplateFromJSONTyped(json: any, ignoreDiscriminator: boolean): VmTemplate; export declare function VmTemplateToJSON(value?: VmTemplate | null): any; diff --git a/dist/esm/runtime.d.ts b/dist/esm/runtime.d.ts index fabe9be1..d923db9e 100644 --- a/dist/esm/runtime.d.ts +++ b/dist/esm/runtime.d.ts @@ -89,24 +89,24 @@ export declare const COLLECTION_FORMATS: { tsv: string; pipes: string; }; -export declare type FetchAPI = WindowOrWorkerGlobalScope['fetch']; -export declare type Json = any; -export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; -export declare type HTTPHeaders = { +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string; }; -export declare type HTTPQuery = { +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery; }; -export declare type HTTPBody = Json | FormData | URLSearchParams; -export declare type HTTPRequestInit = { +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody; }; -export declare type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; -export declare type InitOverideFunction = (requestContext: { +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; +export type InitOverideFunction = (requestContext: { init: HTTPRequestInit; context: RequestOpts; }) => Promise; diff --git a/examples/node-create-volume/package-lock.json b/examples/node-create-volume/package-lock.json index d745c88b..09ee2777 100644 --- a/examples/node-create-volume/package-lock.json +++ b/examples/node-create-volume/package-lock.json @@ -1,34 +1,35 @@ { - "name": "osc-sdk-js-volume-node-create-example", + "name": "osc-sdk-js-volume-create-node-example", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "osc-sdk-js-volume-node-create-example", + "name": "osc-sdk-js-volume-create-node-example", "version": "0.1.0", "license": "BSD-3-Clause", "dependencies": { "outscale-api": "file:../.." }, "devDependencies": { - "@types/node": "^17.0.35" + "@types/node": "18.x" } }, "../..": { - "version": "0.4.0", + "name": "outscale-api", + "version": "0.10.0", "license": "BSD-3-Clause", "dependencies": { - "aws4fetch": "github:outscale-dev/aws4fetch" + "aws4fetch": "^1.0.13" }, "devDependencies": { - "typescript": "^4.7" + "typescript": "^5.2.2" } }, "node_modules/@types/node": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.35.tgz", - "integrity": "sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg==", + "version": "18.18.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.5.tgz", + "integrity": "sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==", "dev": true }, "node_modules/outscale-api": { @@ -38,16 +39,16 @@ }, "dependencies": { "@types/node": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.35.tgz", - "integrity": "sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg==", + "version": "18.18.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.5.tgz", + "integrity": "sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==", "dev": true }, "outscale-api": { "version": "file:../..", "requires": { - "aws4fetch": "github:outscale-dev/aws4fetch", - "typescript": "^4.7" + "aws4fetch": "^1.0.13", + "typescript": "^5.2.2" } } } diff --git a/examples/node-create-volume/package.json b/examples/node-create-volume/package.json index 9b9f5020..b844de26 100644 --- a/examples/node-create-volume/package.json +++ b/examples/node-create-volume/package.json @@ -15,6 +15,6 @@ "outscale-api": "file:../.." }, "devDependencies": { - "@types/node": "^17.0.35" + "@types/node": "18.x" } -} +} \ No newline at end of file diff --git a/examples/node-create-volume/src/index.ts b/examples/node-create-volume/src/index.ts index fa964da6..6d4ded90 100644 --- a/examples/node-create-volume/src/index.ts +++ b/examples/node-create-volume/src/index.ts @@ -1,8 +1,7 @@ -import * as workaroundCrypto from "crypto"; -global.crypto = workaroundCrypto.webcrypto; import * as osc from "outscale-api"; -async function createVolume(accessKey: string, secretKey: string, region: string, endpoint: string|undefined): Promise { + +async function createVolume(accessKey: string, secretKey: string, region: string, endpoint: string | undefined): Promise { let config = new osc.Configuration({ basePath: endpoint == undefined ? "https://api." + region + ".outscale.com/api/v1" : endpoint, awsV4SignParameters: { @@ -17,8 +16,11 @@ async function createVolume(accessKey: string, secretKey: string, region: string } }); - const createParameters : osc.CreateVolumeOperationRequest = { - createVolumeRequest: {subregionName: "eu-west-2a"} + const createParameters: osc.CreateVolumeOperationRequest = { + createVolumeRequest: { + subregionName: region + "a", + size: 4 + } }; const api = new osc.VolumeApi(config) @@ -30,8 +32,8 @@ async function createVolume(accessKey: string, secretKey: string, region: string if (typeof result === "string") { return result; } else if (result.volume == undefined) { - return "result.volume is undefined for undefined reasons"; - } + return "result.volume is undefined for undefined reasons"; + } return result.volume; }, (err_: any) => { return "bad credential or region?"; @@ -69,9 +71,9 @@ async function main() { const endpoint = process.env.OSC_ENDPOINT_API; const result = await createVolume(accessKey, secretKey, region, endpoint); -/* .catch((reason: any) => { - return "Promise error 2"; - });*/ + /* .catch((reason: any) => { + return "Promise error 2"; + });*/ if (typeof result === "string") { console.error("error: " + result); process.exit(1); diff --git a/examples/node-create-volume/src/types/index.d.ts b/examples/node-create-volume/src/types/index.d.ts deleted file mode 100644 index 139ae3d7..00000000 --- a/examples/node-create-volume/src/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Note: this should not be needed in a close future (2022/05) as this should be integrated in node types. -declare module "crypto" { - namespace webcrypto { - const subtle: SubtleCrypto; - function getRandomValues(array: T): T; - function randomUUID(): string; - } - } \ No newline at end of file diff --git a/examples/node-create-volume/tsconfig.json b/examples/node-create-volume/tsconfig.json index a04ecb20..9c564a6f 100644 --- a/examples/node-create-volume/tsconfig.json +++ b/examples/node-create-volume/tsconfig.json @@ -1,16 +1,22 @@ { "compilerOptions": { - "lib": ["es2022", "dom"], - "target": "es2022", - "module": "es2022", + "lib": [ + "es2020", + "dom" + ], + "target": "es2020", + "module": "ES2020", "moduleResolution": "node", "declaration": false, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, - "typeRoots": ["./node_modules/@types", "./src/types"] + "typeRoots": [ + "./node_modules/@types", + "./src/types" + ] }, "include": [ "./src" ] -} +} \ No newline at end of file diff --git a/examples/node-volumes/package-lock.json b/examples/node-volumes/package-lock.json index a8cd230a..ec727040 100644 --- a/examples/node-volumes/package-lock.json +++ b/examples/node-volumes/package-lock.json @@ -12,42 +12,45 @@ "outscale-api": "file:../.." }, "devDependencies": { - "@types/node": "^17.0.35" - } - }, - "../..": { - "version": "0.4.0", - "license": "BSD-3-Clause", - "dependencies": { - "aws4fetch": "github:outscale-dev/aws4fetch" - }, - "devDependencies": { - "typescript": "^4.7" + "@types/node": "18.x" } }, "node_modules/@types/node": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.35.tgz", - "integrity": "sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg==", + "version": "18.18.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.5.tgz", + "integrity": "sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==", "dev": true }, + "node_modules/aws4fetch": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.17.tgz", + "integrity": "sha512-4IbOvsxqxeOSxI4oA+8xEO8SzBMVlzbSTgGy/EF83rHnQ/aKtP6Sc6YV/k0oiW0mqrcxuThlbDosnvetGOuO+g==" + }, "node_modules/outscale-api": { - "resolved": "../..", - "link": true + "version": "0.10.0", + "resolved": "file:../..", + "license": "BSD-3-Clause", + "dependencies": { + "aws4fetch": "^1.0.13" + } } }, "dependencies": { "@types/node": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.35.tgz", - "integrity": "sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg==", + "version": "18.18.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.5.tgz", + "integrity": "sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A==", "dev": true }, + "aws4fetch": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.17.tgz", + "integrity": "sha512-4IbOvsxqxeOSxI4oA+8xEO8SzBMVlzbSTgGy/EF83rHnQ/aKtP6Sc6YV/k0oiW0mqrcxuThlbDosnvetGOuO+g==" + }, "outscale-api": { - "version": "file:../..", + "version": "0.10.0", "requires": { - "aws4fetch": "github:outscale-dev/aws4fetch", - "typescript": "^4.7" + "aws4fetch": "^1.0.13" } } } diff --git a/examples/node-volumes/package.json b/examples/node-volumes/package.json index 519f2b49..8a2f891c 100644 --- a/examples/node-volumes/package.json +++ b/examples/node-volumes/package.json @@ -15,6 +15,6 @@ "outscale-api": "file:../.." }, "devDependencies": { - "@types/node": "^17.0.35" + "@types/node": "18.x" } -} +} \ No newline at end of file diff --git a/examples/node-volumes/src/index.ts b/examples/node-volumes/src/index.ts index 63125384..03f9ff76 100644 --- a/examples/node-volumes/src/index.ts +++ b/examples/node-volumes/src/index.ts @@ -1,8 +1,6 @@ -import * as workaroundCrypto from "crypto"; -global.crypto = workaroundCrypto.webcrypto; import * as osc from "outscale-api"; -async function getVolumes(accessKey: string, secretKey: string, region: string, endpoint: string|undefined): Promise | string> { +async function getVolumes(accessKey: string, secretKey: string, region: string, endpoint: string | undefined): Promise | string> { let config = new osc.Configuration({ basePath: endpoint == undefined ? "https://api." + region + ".outscale.com/api/v1" : endpoint, awsV4SignParameters: { @@ -16,7 +14,7 @@ async function getVolumes(accessKey: string, secretKey: string, region: string, "User-Agent": "node-volumes" } }); - const readParameters : osc.ReadVolumesOperationRequest = { + const readParameters: osc.ReadVolumesOperationRequest = { readVolumesRequest: {} }; @@ -33,7 +31,7 @@ async function getVolumes(accessKey: string, secretKey: string, region: string, return "listing suceeded but it seems you have no volumes"; } return result.volumes; - }, (err_: any) => { + }, (err_: any) => { return "bad credential or region?"; }); } @@ -71,9 +69,9 @@ async function main() { const endpoint = process.env.OSC_ENDPOINT_API; const result = await getVolumes(accessKey, secretKey, region, endpoint); -/* .catch((reason: any) => { - return "Promise error 2"; - });*/ + /* .catch((reason: any) => { + return "Promise error 2"; + });*/ if (typeof result === "string") { console.error("error: " + result); process.exit(1); diff --git a/examples/node-volumes/src/types/index.d.ts b/examples/node-volumes/src/types/index.d.ts deleted file mode 100644 index 139ae3d7..00000000 --- a/examples/node-volumes/src/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Note: this should not be needed in a close future (2022/05) as this should be integrated in node types. -declare module "crypto" { - namespace webcrypto { - const subtle: SubtleCrypto; - function getRandomValues(array: T): T; - function randomUUID(): string; - } - } \ No newline at end of file diff --git a/examples/node-volumes/tsconfig.json b/examples/node-volumes/tsconfig.json index a04ecb20..9c564a6f 100644 --- a/examples/node-volumes/tsconfig.json +++ b/examples/node-volumes/tsconfig.json @@ -1,16 +1,22 @@ { "compilerOptions": { - "lib": ["es2022", "dom"], - "target": "es2022", - "module": "es2022", + "lib": [ + "es2020", + "dom" + ], + "target": "es2020", + "module": "ES2020", "moduleResolution": "node", "declaration": false, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, - "typeRoots": ["./node_modules/@types", "./src/types"] + "typeRoots": [ + "./node_modules/@types", + "./src/types" + ] }, "include": [ "./src" ] -} +} \ No newline at end of file diff --git a/examples/web-vms/package-lock.json b/examples/web-vms/package-lock.json index d4d34691..36757592 100644 --- a/examples/web-vms/package-lock.json +++ b/examples/web-vms/package-lock.json @@ -394,9 +394,9 @@ } }, "node_modules/aws4fetch": { - "version": "1.0.13", - "resolved": "git+ssh://git@github.com/outscale-dev/aws4fetch.git#dcd7e13ee42facf987272bf17b1cc8efaaf03d1d", - "license": "MIT" + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.17.tgz", + "integrity": "sha512-4IbOvsxqxeOSxI4oA+8xEO8SzBMVlzbSTgGy/EF83rHnQ/aKtP6Sc6YV/k0oiW0mqrcxuThlbDosnvetGOuO+g==" }, "node_modules/browserslist": { "version": "4.20.3", @@ -948,11 +948,11 @@ } }, "node_modules/outscale-api": { - "version": "0.2.1", + "version": "0.10.0", "resolved": "file:../..", "license": "BSD-3-Clause", "dependencies": { - "aws4fetch": "github:outscale-dev/aws4fetch" + "aws4fetch": "^1.0.13" } }, "node_modules/p-limit": { @@ -1837,8 +1837,9 @@ "requires": {} }, "aws4fetch": { - "version": "git+ssh://git@github.com/outscale-dev/aws4fetch.git#dcd7e13ee42facf987272bf17b1cc8efaaf03d1d", - "from": "aws4fetch@github:outscale-dev/aws4fetch" + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.17.tgz", + "integrity": "sha512-4IbOvsxqxeOSxI4oA+8xEO8SzBMVlzbSTgGy/EF83rHnQ/aKtP6Sc6YV/k0oiW0mqrcxuThlbDosnvetGOuO+g==" }, "browserslist": { "version": "4.20.3", @@ -2249,9 +2250,9 @@ } }, "outscale-api": { - "version": "0.2.1", + "version": "0.10.0", "requires": { - "aws4fetch": "github:outscale-dev/aws4fetch" + "aws4fetch": "^1.0.13" } }, "p-limit": { diff --git a/package-lock.json b/package-lock.json index b6a87d6b..c8396ccd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "outscale-api", "version": "0.10.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -9,21 +9,21 @@ "version": "0.10.0", "license": "BSD-3-Clause", "dependencies": { - "aws4fetch": "github:outscale-dev/aws4fetch" + "aws4fetch": "^1.0.13" }, "devDependencies": { "typescript": "^4.7" } }, "node_modules/aws4fetch": { - "version": "1.0.13", - "resolved": "git+ssh://git@github.com/outscale-dev/aws4fetch.git#dcd7e13ee42facf987272bf17b1cc8efaaf03d1d", - "license": "MIT" + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.17.tgz", + "integrity": "sha512-4IbOvsxqxeOSxI4oA+8xEO8SzBMVlzbSTgGy/EF83rHnQ/aKtP6Sc6YV/k0oiW0mqrcxuThlbDosnvetGOuO+g==" }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -33,17 +33,5 @@ "node": ">=4.2.0" } } - }, - "dependencies": { - "aws4fetch": { - "version": "git+ssh://git@github.com/outscale-dev/aws4fetch.git#dcd7e13ee42facf987272bf17b1cc8efaaf03d1d", - "from": "aws4fetch@github:outscale-dev/aws4fetch" - }, - "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true - } } } diff --git a/package.json b/package.json index 452711e0..ddf38630 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,6 @@ "typescript": "^4.7" }, "dependencies": { - "aws4fetch": "github:outscale-dev/aws4fetch" + "aws4fetch": "^1.0.13" } -} +} \ No newline at end of file