appwrite-cli 22.1.2 → 22.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -26710,7 +26710,7 @@ var require_sbcs = __commonJS({
26710
26710
  return mod && mod.__esModule ? mod : { "default": mod };
26711
26711
  };
26712
26712
  Object.defineProperty(exports2, "__esModule", { value: true });
26713
- exports2.KOI8_R = exports2.windows_1256 = exports2.windows_1251 = exports2.ISO_8859_9 = exports2.ISO_8859_8 = exports2.ISO_8859_7 = exports2.ISO_8859_6 = exports2.ISO_8859_5 = exports2.ISO_8859_2 = exports2.ISO_8859_1 = void 0;
26713
+ exports2.KOI8_R = exports2.windows_874 = exports2.windows_1258 = exports2.windows_1257 = exports2.windows_1256 = exports2.windows_1251 = exports2.ISO_8859_9 = exports2.ISO_8859_8 = exports2.ISO_8859_7 = exports2.ISO_8859_6 = exports2.ISO_8859_5 = exports2.ISO_8859_2 = exports2.ISO_8859_1 = void 0;
26714
26714
  var match_1 = __importDefault(require_match());
26715
26715
  var N_GRAM_MASK = 16777215;
26716
26716
  var NGramParser = class {
@@ -30713,6 +30713,443 @@ var require_sbcs = __commonJS({
30713
30713
  }
30714
30714
  };
30715
30715
  exports2.windows_1256 = windows_1256;
30716
+ var windows_1257 = class extends sbcs {
30717
+ match(det) {
30718
+ return det.inputBytes.some((byte) => byte >= 128) ? super.match(det) : null;
30719
+ }
30720
+ byteMap() {
30721
+ const byteMap = new Array(256).fill(32);
30722
+ byteMap[39] = 0;
30723
+ for (let i = 65; i <= 90; i++)
30724
+ byteMap[i] = i + 32;
30725
+ for (let i = 97; i <= 122; i++)
30726
+ byteMap[i] = i;
30727
+ byteMap[142] = 142;
30728
+ byteMap[168] = byteMap[184] = 184;
30729
+ byteMap[170] = byteMap[186] = 186;
30730
+ byteMap[175] = byteMap[191] = 191;
30731
+ byteMap[181] = 181;
30732
+ for (let i = 192; i <= 214; i++)
30733
+ byteMap[i] = i + 32;
30734
+ for (let i = 216; i <= 222; i++)
30735
+ byteMap[i] = i + 32;
30736
+ byteMap[223] = 223;
30737
+ for (let i = 224; i <= 246; i++)
30738
+ byteMap[i] = i;
30739
+ for (let i = 248; i <= 254; i++)
30740
+ byteMap[i] = i;
30741
+ return byteMap;
30742
+ }
30743
+ ngrams() {
30744
+ return [
30745
+ new NGramsPlusLang("et", [
30746
+ 2122090,
30747
+ 2122098,
30748
+ 2123109,
30749
+ 2124135,
30750
+ 2124385,
30751
+ 2124641,
30752
+ 2124645,
30753
+ 2124649,
30754
+ 2124655,
30755
+ 2124661,
30756
+ 2124897,
30757
+ 2125417,
30758
+ 2125678,
30759
+ 2126441,
30760
+ 2126693,
30761
+ 2126949,
30762
+ 6365281,
30763
+ 6365290,
30764
+ 6365291,
30765
+ 6365292,
30766
+ 6382112,
30767
+ 6382624,
30768
+ 6384499,
30769
+ 6386549,
30770
+ 6386785,
30771
+ 6387297,
30772
+ 6561908,
30773
+ 6578464,
30774
+ 6583667,
30775
+ 6627435,
30776
+ 6627443,
30777
+ 6645100,
30778
+ 6645107,
30779
+ 6646816,
30780
+ 6646885,
30781
+ 6646900,
30782
+ 6648608,
30783
+ 6648692,
30784
+ 6889579,
30785
+ 6906912,
30786
+ 6910570,
30787
+ 6910752,
30788
+ 6971680,
30789
+ 7037299,
30790
+ 7038309,
30791
+ 7039346,
30792
+ 7040879,
30793
+ 7041893,
30794
+ 7041908,
30795
+ 7104875,
30796
+ 7107616,
30797
+ 7544929,
30798
+ 7544939,
30799
+ 7562528,
30800
+ 7562604,
30801
+ 7566437,
30802
+ 7566441,
30803
+ 7566708,
30804
+ 7627115,
30805
+ 7627124,
30806
+ 7629088,
30807
+ 7697184,
30808
+ 7697253,
30809
+ 7697505
30810
+ ]),
30811
+ new NGramsPlusLang("lv", [
30812
+ 2122098,
30813
+ 2122601,
30814
+ 2122849,
30815
+ 2124146,
30816
+ 2124154,
30817
+ 2124897,
30818
+ 2125282,
30819
+ 2125921,
30820
+ 2125938,
30821
+ 2126433,
30822
+ 2126689,
30823
+ 2126699,
30824
+ 2126949,
30825
+ 2127214,
30826
+ 2127457,
30827
+ 6365289,
30828
+ 6365301,
30829
+ 6365302,
30830
+ 6382185,
30831
+ 6383904,
30832
+ 6384499,
30833
+ 6384751,
30834
+ 6385778,
30835
+ 6386293,
30836
+ 6386464,
30837
+ 6386806,
30838
+ 6449509,
30839
+ 6452512,
30840
+ 6515052,
30841
+ 6515060,
30842
+ 6578464,
30843
+ 6578546,
30844
+ 6583584,
30845
+ 6584864,
30846
+ 6644850,
30847
+ 6646123,
30848
+ 6646643,
30849
+ 6647393,
30850
+ 6648608,
30851
+ 6680693,
30852
+ 6889577,
30853
+ 6907236,
30854
+ 6907376,
30855
+ 6908642,
30856
+ 6909046,
30857
+ 7041908,
30858
+ 7102836,
30859
+ 7106404,
30860
+ 7233824,
30861
+ 7300193,
30862
+ 7496043,
30863
+ 7501166,
30864
+ 7544947,
30865
+ 7544949,
30866
+ 7544950,
30867
+ 7566453,
30868
+ 7566574,
30869
+ 7632160,
30870
+ 7632489,
30871
+ 7676022,
30872
+ 7695904,
30873
+ 7697184,
30874
+ 7758188,
30875
+ 14840608
30876
+ ]),
30877
+ new NGramsPlusLang("lt", [
30878
+ 2122089,
30879
+ 2122341,
30880
+ 2124146,
30881
+ 2124641,
30882
+ 2124905,
30883
+ 2125167,
30884
+ 2126433,
30885
+ 2126689,
30886
+ 2126699,
30887
+ 2126709,
30888
+ 2126945,
30889
+ 2126949,
30890
+ 2126965,
30891
+ 2127457,
30892
+ 2127465,
30893
+ 6365300,
30894
+ 6365424,
30895
+ 6383904,
30896
+ 6383988,
30897
+ 6384112,
30898
+ 6384738,
30899
+ 6384993,
30900
+ 6385268,
30901
+ 6386274,
30902
+ 6386292,
30903
+ 6386976,
30904
+ 6387050,
30905
+ 6418553,
30906
+ 6447392,
30907
+ 6448489,
30908
+ 6448494,
30909
+ 6647401,
30910
+ 6648949,
30911
+ 6889569,
30912
+ 6889577,
30913
+ 6889579,
30914
+ 6889581,
30915
+ 6906217,
30916
+ 6907246,
30917
+ 6907252,
30918
+ 6909543,
30919
+ 6910496,
30920
+ 6910752,
30921
+ 6942827,
30922
+ 6971757,
30923
+ 6972704,
30924
+ 7037289,
30925
+ 7037292,
30926
+ 7103073,
30927
+ 7104869,
30928
+ 7170419,
30929
+ 7171947,
30930
+ 7269152,
30931
+ 7301733,
30932
+ 7302009,
30933
+ 7303968,
30934
+ 7496176,
30935
+ 7544937,
30936
+ 7544939,
30937
+ 7544950,
30938
+ 7564129,
30939
+ 7629088,
30940
+ 7632246,
30941
+ 7957356
30942
+ ])
30943
+ ];
30944
+ }
30945
+ name() {
30946
+ return "windows-1257";
30947
+ }
30948
+ };
30949
+ exports2.windows_1257 = windows_1257;
30950
+ var windows_1258 = class extends sbcs {
30951
+ match(det) {
30952
+ return det.inputBytes.some((byte) => byte >= 128) ? super.match(det) : null;
30953
+ }
30954
+ byteMap() {
30955
+ const byteMap = new Array(256).fill(32);
30956
+ byteMap[39] = 0;
30957
+ for (let i = 65; i <= 90; i++)
30958
+ byteMap[i] = i + 32;
30959
+ for (let i = 97; i <= 122; i++)
30960
+ byteMap[i] = i;
30961
+ byteMap[131] = 131;
30962
+ byteMap[136] = 136;
30963
+ byteMap[140] = byteMap[156] = 156;
30964
+ byteMap[159] = 255;
30965
+ byteMap[170] = 170;
30966
+ byteMap[181] = 181;
30967
+ byteMap[186] = 186;
30968
+ for (let i = 192; i <= 203; i++)
30969
+ byteMap[i] = i + 32;
30970
+ byteMap[204] = 204;
30971
+ for (let i = 205; i <= 209; i++)
30972
+ byteMap[i] = i + 32;
30973
+ byteMap[210] = 210;
30974
+ for (let i = 211; i <= 214; i++)
30975
+ byteMap[i] = i + 32;
30976
+ for (let i = 216; i <= 221; i++)
30977
+ byteMap[i] = i + 32;
30978
+ byteMap[222] = 222;
30979
+ byteMap[223] = 223;
30980
+ for (let i = 224; i <= 246; i++)
30981
+ byteMap[i] = i;
30982
+ for (let i = 248; i <= 253; i++)
30983
+ byteMap[i] = i;
30984
+ byteMap[255] = 255;
30985
+ return byteMap;
30986
+ }
30987
+ ngrams() {
30988
+ return [
30989
+ 2122600,
30990
+ 2122721,
30991
+ 2123625,
30992
+ 2123887,
30993
+ 2125415,
30994
+ 2125928,
30995
+ 2126952,
30996
+ 2126953,
30997
+ 2126962,
30998
+ 2127465,
30999
+ 2127584,
31000
+ 6419060,
31001
+ 6496355,
31002
+ 6496374,
31003
+ 6514720,
31004
+ 6514925,
31005
+ 6545763,
31006
+ 6758504,
31007
+ 6758510,
31008
+ 6758516,
31009
+ 6758518,
31010
+ 6812782,
31011
+ 6815198,
31012
+ 6815221,
31013
+ 6824052,
31014
+ 6844402,
31015
+ 6876526,
31016
+ 6889582,
31017
+ 6889588,
31018
+ 6941394,
31019
+ 6941420,
31020
+ 6941426,
31021
+ 7217251,
31022
+ 7217262,
31023
+ 7217268,
31024
+ 7235360,
31025
+ 7235572,
31026
+ 7235581,
31027
+ 7235616,
31028
+ 7302759,
31029
+ 7336547,
31030
+ 7610483,
31031
+ 7629053,
31032
+ 7629290,
31033
+ 7631471,
31034
+ 7676020,
31035
+ 7760362,
31036
+ 7790624,
31037
+ 13396256,
31038
+ 13397607,
31039
+ 14557288,
31040
+ 14771048,
31041
+ 15395950,
31042
+ 15397492,
31043
+ 15494759,
31044
+ 15496224,
31045
+ 15560296,
31046
+ 15885088,
31047
+ 15886624,
31048
+ 15887904,
31049
+ 15889440,
31050
+ 16018976,
31051
+ 16108649,
31052
+ 16643532
31053
+ ];
31054
+ }
31055
+ name() {
31056
+ return "windows-1258";
31057
+ }
31058
+ language() {
31059
+ return "vi";
31060
+ }
31061
+ };
31062
+ exports2.windows_1258 = windows_1258;
31063
+ var windows_874 = class extends sbcs {
31064
+ byteMap() {
31065
+ const byteMap = new Array(256).fill(32);
31066
+ byteMap[39] = 0;
31067
+ for (let i = 65; i <= 90; i++)
31068
+ byteMap[i] = i + 32;
31069
+ for (let i = 97; i <= 122; i++)
31070
+ byteMap[i] = i;
31071
+ for (let i = 161; i <= 218; i++)
31072
+ byteMap[i] = i;
31073
+ for (let i = 223; i <= 251; i++)
31074
+ byteMap[i] = i;
31075
+ return byteMap;
31076
+ }
31077
+ ngrams() {
31078
+ return [
31079
+ 2138578,
31080
+ 2138856,
31081
+ 2146514,
31082
+ 2148291,
31083
+ 2154949,
31084
+ 10604985,
31085
+ 10605251,
31086
+ 10669479,
31087
+ 10671554,
31088
+ 10799058,
31089
+ 11064263,
31090
+ 11195847,
31091
+ 11200960,
31092
+ 11200995,
31093
+ 11910083,
31094
+ 12042976,
31095
+ 12042979,
31096
+ 12047848,
31097
+ 12132544,
31098
+ 12165586,
31099
+ 12173522,
31100
+ 12305360,
31101
+ 12314553,
31102
+ 12636873,
31103
+ 12828960,
31104
+ 12829619,
31105
+ 12829633,
31106
+ 12832936,
31107
+ 12832994,
31108
+ 12837026,
31109
+ 13091779,
31110
+ 13095353,
31111
+ 13095617,
31112
+ 13096117,
31113
+ 13226679,
31114
+ 13226724,
31115
+ 13293544,
31116
+ 13477063,
31117
+ 13674707,
31118
+ 13689538,
31119
+ 13744416,
31120
+ 13805473,
31121
+ 13812171,
31122
+ 13812452,
31123
+ 13812512,
31124
+ 13812704,
31125
+ 13814226,
31126
+ 13821111,
31127
+ 13879249,
31128
+ 13940155,
31129
+ 14009017,
31130
+ 14010324,
31131
+ 14149837,
31132
+ 14721749,
31133
+ 14728167,
31134
+ 14796240,
31135
+ 14860964,
31136
+ 14920425,
31137
+ 14924193,
31138
+ 14989250,
31139
+ 15258279,
31140
+ 15262634,
31141
+ 15319250,
31142
+ 15328185
31143
+ ];
31144
+ }
31145
+ name() {
31146
+ return "windows-874";
31147
+ }
31148
+ language() {
31149
+ return "th";
31150
+ }
31151
+ };
31152
+ exports2.windows_874 = windows_874;
30716
31153
  var KOI8_R = class extends sbcs {
30717
31154
  byteMap() {
30718
31155
  return [
@@ -31264,6 +31701,9 @@ var require_lib = __commonJS({
31264
31701
  new sbcs.ISO_8859_9(),
31265
31702
  new sbcs.windows_1251(),
31266
31703
  new sbcs.windows_1256(),
31704
+ new sbcs.windows_1257(),
31705
+ new sbcs.windows_1258(),
31706
+ new sbcs.windows_874(),
31267
31707
  new sbcs.KOI8_R(),
31268
31708
  new ascii_1.default()
31269
31709
  ];
@@ -86099,7 +86539,7 @@ var package_default = {
86099
86539
  type: "module",
86100
86540
  homepage: "https://appwrite.io/support",
86101
86541
  description: "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
86102
- version: "22.1.2",
86542
+ version: "22.2.0",
86103
86543
  license: "BSD-3-Clause",
86104
86544
  main: "dist/index.cjs",
86105
86545
  module: "dist/index.js",
@@ -86131,9 +86571,9 @@ var package_default = {
86131
86571
  "build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
86132
86572
  "build:runtime": "npm run build:lib:runtime && npm run build:cli",
86133
86573
  "build:lib:runtime": "npm run build:lib:esm && npm run build:lib:cjs",
86134
- "build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --external:terminal-image --outfile=dist/index.js",
86135
- "build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:terminal-image --outfile=dist/index.cjs",
86136
- "build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:fsevents --external:terminal-image --outfile=dist/cli.cjs",
86574
+ "build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --external:@napi-rs/keyring --external:terminal-image --outfile=dist/index.js",
86575
+ "build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:@napi-rs/keyring --external:terminal-image --outfile=dist/index.cjs",
86576
+ "build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:@napi-rs/keyring --external:fsevents --external:terminal-image --outfile=dist/cli.cjs",
86137
86577
  lint: "eslint .",
86138
86578
  format: 'prettier --write "**/*.{js,ts,json,md}"',
86139
86579
  generate: "tsx scripts/generate-commands.ts",
@@ -86147,7 +86587,8 @@ var package_default = {
86147
86587
  "windows-arm64": "bun build cli.ts --compile --minify --target=bun-windows-arm64 --outfile build/appwrite-cli-win-arm64.exe"
86148
86588
  },
86149
86589
  dependencies: {
86150
- "@appwrite.io/console": "^15.0.0",
86590
+ "@appwrite.io/console": "^15.1.1",
86591
+ "@napi-rs/keyring": "^1.3.0",
86151
86592
  chalk: "4.1.2",
86152
86593
  chokidar: "^3.6.0",
86153
86594
  "cli-progress": "^3.12.0",
@@ -100830,7 +101271,7 @@ var validateCrossDatabase = (data, ctx) => {
100830
101271
  // lib/constants.ts
100831
101272
  var SDK_TITLE = "Appwrite";
100832
101273
  var SDK_TITLE_LOWER = "appwrite";
100833
- var SDK_VERSION = "22.1.2";
101274
+ var SDK_VERSION = "22.2.0";
100834
101275
  var SDK_NAME = "Command Line";
100835
101276
  var SDK_PLATFORM = "console";
100836
101277
  var SDK_LANGUAGE = "cli";
@@ -101437,7 +101878,7 @@ var Client = class _Client {
101437
101878
  "x-sdk-name": "Console",
101438
101879
  "x-sdk-platform": "console",
101439
101880
  "x-sdk-language": "web",
101440
- "x-sdk-version": "15.0.0",
101881
+ "x-sdk-version": "15.1.1",
101441
101882
  "X-Appwrite-Response-Format": "1.9.5"
101442
101883
  };
101443
101884
  this.realtime = {
@@ -108967,15 +109408,21 @@ var Functions = class {
108967
109408
  };
108968
109409
  return this.client.call("get", uri, apiHeaders, payload);
108969
109410
  }
108970
- /**
108971
- * List allowed function specifications for this instance.
108972
- *
108973
- * @throws {AppwriteException}
108974
- * @returns {Promise<Models.SpecificationList>}
108975
- */
108976
- listSpecifications() {
109411
+ listSpecifications(paramsOrFirst) {
109412
+ let params;
109413
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109414
+ params = paramsOrFirst || {};
109415
+ } else {
109416
+ params = {
109417
+ type: paramsOrFirst
109418
+ };
109419
+ }
109420
+ const type = params.type;
108977
109421
  const apiPath = "/functions/specifications";
108978
109422
  const payload = {};
109423
+ if (typeof type !== "undefined") {
109424
+ payload["type"] = type;
109425
+ }
108979
109426
  const uri = new URL(this.client.config.endpoint + apiPath);
108980
109427
  const apiHeaders = {
108981
109428
  "X-Appwrite-Project": this.client.config.project,
@@ -110275,28 +110722,6 @@ var Health = class {
110275
110722
  };
110276
110723
  return this.client.call("get", uri, apiHeaders, payload);
110277
110724
  }
110278
- getQueuePriorityBuilds(paramsOrFirst) {
110279
- let params;
110280
- if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110281
- params = paramsOrFirst || {};
110282
- } else {
110283
- params = {
110284
- threshold: paramsOrFirst
110285
- };
110286
- }
110287
- const threshold = params.threshold;
110288
- const apiPath = "/health/queue/builds-priority";
110289
- const payload = {};
110290
- if (typeof threshold !== "undefined") {
110291
- payload["threshold"] = threshold;
110292
- }
110293
- const uri = new URL(this.client.config.endpoint + apiPath);
110294
- const apiHeaders = {
110295
- "X-Appwrite-Project": this.client.config.project,
110296
- "accept": "application/json"
110297
- };
110298
- return this.client.call("get", uri, apiHeaders, payload);
110299
- }
110300
110725
  getQueueCertificates(paramsOrFirst) {
110301
110726
  let params;
110302
110727
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -114673,7 +115098,8 @@ var Oauth2 = class {
114673
115098
  codeChallengeMethod: rest[6],
114674
115099
  prompt: rest[7],
114675
115100
  maxAge: rest[8],
114676
- authorizationDetails: rest[9]
115101
+ authorizationDetails: rest[9],
115102
+ resource: rest[10]
114677
115103
  };
114678
115104
  }
114679
115105
  const clientId = params.clientId;
@@ -114687,6 +115113,7 @@ var Oauth2 = class {
114687
115113
  const prompt = params.prompt;
114688
115114
  const maxAge = params.maxAge;
114689
115115
  const authorizationDetails = params.authorizationDetails;
115116
+ const resource = params.resource;
114690
115117
  if (typeof clientId === "undefined") {
114691
115118
  throw new AppwriteException('Missing required parameter: "clientId"');
114692
115119
  }
@@ -114734,6 +115161,9 @@ var Oauth2 = class {
114734
115161
  if (typeof authorizationDetails !== "undefined") {
114735
115162
  payload["authorization_details"] = authorizationDetails;
114736
115163
  }
115164
+ if (typeof resource !== "undefined") {
115165
+ payload["resource"] = resource;
115166
+ }
114737
115167
  const uri = new URL(this.client.config.endpoint + apiPath);
114738
115168
  const apiHeaders = {
114739
115169
  "accept": "application/json"
@@ -114748,12 +115178,14 @@ var Oauth2 = class {
114748
115178
  params = {
114749
115179
  clientId: paramsOrFirst,
114750
115180
  scope: rest[0],
114751
- authorizationDetails: rest[1]
115181
+ authorizationDetails: rest[1],
115182
+ resource: rest[2]
114752
115183
  };
114753
115184
  }
114754
115185
  const clientId = params.clientId;
114755
115186
  const scope = params.scope;
114756
115187
  const authorizationDetails = params.authorizationDetails;
115188
+ const resource = params.resource;
114757
115189
  const apiPath = "/oauth2/{project_id}/device_authorization".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
114758
115190
  const payload = {};
114759
115191
  if (typeof clientId !== "undefined") {
@@ -114765,6 +115197,9 @@ var Oauth2 = class {
114765
115197
  if (typeof authorizationDetails !== "undefined") {
114766
115198
  payload["authorization_details"] = authorizationDetails;
114767
115199
  }
115200
+ if (typeof resource !== "undefined") {
115201
+ payload["resource"] = resource;
115202
+ }
114768
115203
  const uri = new URL(this.client.config.endpoint + apiPath);
114769
115204
  const apiHeaders = {
114770
115205
  "content-type": "application/json",
@@ -114942,7 +115377,8 @@ var Oauth2 = class {
114942
115377
  clientId: rest[3],
114943
115378
  clientSecret: rest[4],
114944
115379
  codeVerifier: rest[5],
114945
- redirectUri: rest[6]
115380
+ redirectUri: rest[6],
115381
+ resource: rest[7]
114946
115382
  };
114947
115383
  }
114948
115384
  const grantType = params.grantType;
@@ -114953,6 +115389,7 @@ var Oauth2 = class {
114953
115389
  const clientSecret = params.clientSecret;
114954
115390
  const codeVerifier = params.codeVerifier;
114955
115391
  const redirectUri = params.redirectUri;
115392
+ const resource = params.resource;
114956
115393
  if (typeof grantType === "undefined") {
114957
115394
  throw new AppwriteException('Missing required parameter: "grantType"');
114958
115395
  }
@@ -114982,6 +115419,9 @@ var Oauth2 = class {
114982
115419
  if (typeof redirectUri !== "undefined") {
114983
115420
  payload["redirect_uri"] = redirectUri;
114984
115421
  }
115422
+ if (typeof resource !== "undefined") {
115423
+ payload["resource"] = resource;
115424
+ }
114985
115425
  const uri = new URL(this.client.config.endpoint + apiPath);
114986
115426
  const apiHeaders = {
114987
115427
  "content-type": "application/json",
@@ -121121,15 +121561,21 @@ var Sites = class {
121121
121561
  };
121122
121562
  return this.client.call("get", uri, apiHeaders, payload);
121123
121563
  }
121124
- /**
121125
- * List allowed site specifications for this instance.
121126
- *
121127
- * @throws {AppwriteException}
121128
- * @returns {Promise<Models.SpecificationList>}
121129
- */
121130
- listSpecifications() {
121564
+ listSpecifications(paramsOrFirst) {
121565
+ let params;
121566
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
121567
+ params = paramsOrFirst || {};
121568
+ } else {
121569
+ params = {
121570
+ type: paramsOrFirst
121571
+ };
121572
+ }
121573
+ const type = params.type;
121131
121574
  const apiPath = "/sites/specifications";
121132
121575
  const payload = {};
121576
+ if (typeof type !== "undefined") {
121577
+ payload["type"] = type;
121578
+ }
121133
121579
  const uri = new URL(this.client.config.endpoint + apiPath);
121134
121580
  const apiHeaders = {
121135
121581
  "X-Appwrite-Project": this.client.config.project,
@@ -131696,6 +132142,34 @@ function systemHasCommand(command) {
131696
132142
  }
131697
132143
  return true;
131698
132144
  }
132145
+ function openBrowser(url2) {
132146
+ let command;
132147
+ let args;
132148
+ switch (process.platform) {
132149
+ case "win32":
132150
+ command = "rundll32";
132151
+ args = ["url.dll,FileProtocolHandler", url2];
132152
+ break;
132153
+ case "darwin":
132154
+ command = "open";
132155
+ args = [url2];
132156
+ break;
132157
+ default:
132158
+ command = "xdg-open";
132159
+ args = [url2];
132160
+ break;
132161
+ }
132162
+ try {
132163
+ const child = import_child_process.default.spawn(command, args, {
132164
+ stdio: "ignore",
132165
+ detached: true
132166
+ });
132167
+ child.on("error", () => {
132168
+ });
132169
+ child.unref();
132170
+ } catch {
132171
+ }
132172
+ }
131699
132173
  var checkDeployConditions = (localConfig2) => {
131700
132174
  if (localConfig2.keys().length === 0) {
131701
132175
  throw new Error(
@@ -132862,6 +133336,9 @@ var Global = class _Global extends Config {
132862
133336
  setCookie(cookie) {
132863
133337
  this.setTo(_Global.PREFERENCE_COOKIE, cookie);
132864
133338
  }
133339
+ removeCookie() {
133340
+ this.deleteFrom(_Global.PREFERENCE_COOKIE);
133341
+ }
132865
133342
  getProject() {
132866
133343
  if (!this.hasFrom(_Global.PREFERENCE_PROJECT)) {
132867
133344
  return "";
@@ -132939,6 +133416,16 @@ var Global = class _Global extends Config {
132939
133416
  this.write();
132940
133417
  }
132941
133418
  }
133419
+ deleteFrom(key) {
133420
+ const current = this.getCurrentSession();
133421
+ if (current) {
133422
+ const config2 = this.get(current);
133423
+ if (config2 && config2[key] !== void 0) {
133424
+ delete config2[key];
133425
+ this.write();
133426
+ }
133427
+ }
133428
+ }
132942
133429
  };
132943
133430
  var localConfig = new Local();
132944
133431
  var globalConfig2 = new Global();
@@ -134581,14 +135068,75 @@ var import_chalk3 = __toESM(require_source(), 1);
134581
135068
 
134582
135069
  // lib/sdks.ts
134583
135070
  var import_os5 = __toESM(require("os"), 1);
135071
+
135072
+ // lib/auth/refresh-token.ts
135073
+ var import_keyring = require("@napi-rs/keyring");
135074
+ var REFRESH_TOKEN_SERVICE = `${EXECUTABLE_NAME}-oauth-refresh-token`;
135075
+ var keyringEntryFactory = (service, account2) => new import_keyring.Entry(service, account2);
135076
+ var getSessionData = (sessionId) => globalConfig2.get(sessionId);
135077
+ var setSessionData = (sessionId, data) => {
135078
+ globalConfig2.addSession(sessionId, data);
135079
+ };
135080
+ var setPrefsRefreshToken = (sessionId, refreshToken) => {
135081
+ const session = getSessionData(sessionId);
135082
+ if (!session) return;
135083
+ setSessionData(sessionId, {
135084
+ ...session,
135085
+ refreshToken
135086
+ });
135087
+ };
135088
+ var deletePrefsRefreshToken = (sessionId) => {
135089
+ const session = getSessionData(sessionId);
135090
+ if (!session?.refreshToken) return;
135091
+ const { refreshToken: _refreshToken, ...rest } = session;
135092
+ setSessionData(sessionId, rest);
135093
+ };
135094
+ var getStoredRefreshToken = (sessionId) => {
135095
+ try {
135096
+ const refreshToken = keyringEntryFactory(
135097
+ REFRESH_TOKEN_SERVICE,
135098
+ sessionId
135099
+ ).getPassword();
135100
+ if (refreshToken) {
135101
+ return refreshToken;
135102
+ }
135103
+ } catch (_error) {
135104
+ }
135105
+ return getSessionData(sessionId)?.refreshToken ?? "";
135106
+ };
135107
+ var hasStoredRefreshToken = (sessionId) => getStoredRefreshToken(sessionId) !== "";
135108
+ var setStoredRefreshToken = (sessionId, refreshToken) => {
135109
+ if (!refreshToken) {
135110
+ deleteStoredRefreshToken(sessionId);
135111
+ return;
135112
+ }
135113
+ try {
135114
+ keyringEntryFactory(REFRESH_TOKEN_SERVICE, sessionId).setPassword(
135115
+ refreshToken
135116
+ );
135117
+ deletePrefsRefreshToken(sessionId);
135118
+ } catch (_error) {
135119
+ setPrefsRefreshToken(sessionId, refreshToken);
135120
+ }
135121
+ };
135122
+ var deleteStoredRefreshToken = (sessionId) => {
135123
+ try {
135124
+ keyringEntryFactory(REFRESH_TOKEN_SERVICE, sessionId).deletePassword();
135125
+ } catch (_error) {
135126
+ }
135127
+ deletePrefsRefreshToken(sessionId);
135128
+ };
135129
+
135130
+ // lib/sdks.ts
134584
135131
  var getValidAccessToken = async (endpoint) => {
134585
135132
  const accessToken = globalConfig2.getAccessToken();
134586
- const refreshToken = globalConfig2.getRefreshToken();
134587
135133
  const tokenExpiry = globalConfig2.getTokenExpiry();
134588
135134
  const clientId = globalConfig2.getClientId() || OAUTH2_CLIENT_ID;
135135
+ const currentSession = globalConfig2.getCurrentSession();
134589
135136
  if (accessToken && tokenExpiry > Date.now() + 6e4) {
134590
135137
  return accessToken;
134591
135138
  }
135139
+ const refreshToken = currentSession ? getStoredRefreshToken(currentSession) : "";
134592
135140
  if (accessToken && tokenExpiry === 0 && !refreshToken) {
134593
135141
  return accessToken;
134594
135142
  }
@@ -134608,7 +135156,7 @@ var getValidAccessToken = async (endpoint) => {
134608
135156
  const newExpiry = Date.now() + token.expires_in * 1e3;
134609
135157
  globalConfig2.setAccessToken(token.access_token);
134610
135158
  if (token.refresh_token) {
134611
- globalConfig2.setRefreshToken(token.refresh_token);
135159
+ setStoredRefreshToken(currentSession, token.refresh_token);
134612
135160
  }
134613
135161
  globalConfig2.setTokenExpiry(newExpiry);
134614
135162
  return token.access_token;
@@ -135566,21 +136114,21 @@ var questionsLogout = [
135566
136114
  {
135567
136115
  type: "checkbox",
135568
136116
  name: "accounts",
135569
- message: "Select accounts to logout from",
136117
+ message: "Select accounts to log out",
135570
136118
  validate: (value) => validateRequired("account", value),
135571
136119
  choices() {
135572
136120
  const sessions = globalConfig2.getSessions();
135573
136121
  const current = globalConfig2.getCurrentSession();
135574
136122
  const data = [];
135575
- const longestEmail = sessions.reduce(
135576
- (prev, current2) => prev && (prev.email ?? "").length > (current2.email ?? "").length ? prev : current2
135577
- ).email.length;
135578
136123
  sessions.forEach((session) => {
135579
136124
  if (session.email) {
136125
+ const isCurrent = current === session.id;
136126
+ const currentLabel = isCurrent ? ` ${import_chalk3.default.green.bold("(current)")}` : "";
135580
136127
  data.push({
135581
- current: current === session.id,
136128
+ current: isCurrent,
135582
136129
  value: session.id,
135583
- name: `${session.email.padEnd(longestEmail)} ${current === session.id ? import_chalk3.default.green.bold("current") : " ".repeat(6)} ${session.endpoint}`
136130
+ name: `${session.email}${currentLabel} - ${session.endpoint}`,
136131
+ short: `${session.email}${isCurrent ? " (current)" : ""}`
135584
136132
  });
135585
136133
  }
135586
136134
  });
@@ -136241,6 +136789,7 @@ var Client3 = class _Client {
136241
136789
  );
136242
136790
  const current = globalConfig2.getCurrentSession();
136243
136791
  globalConfig2.setCurrentSession("");
136792
+ deleteStoredRefreshToken(current);
136244
136793
  globalConfig2.removeSession(current);
136245
136794
  }
136246
136795
  const isUnauthorized = json3.code === 401 && json3.type === "general_unauthorized_scope" && typeof json3.message === "string" && /role:\s*guests/i.test(json3.message);
@@ -136313,7 +136862,7 @@ var createLegacyConsoleClient = (endpoint, selfSigned = globalConfig2.getSelfSig
136313
136862
  var hasAuthSession = () => globalConfig2.getAccessToken() !== "" || globalConfig2.getCookie() !== "";
136314
136863
  var isLocalOnlySession = (sessionId) => {
136315
136864
  const session = getSession(sessionId);
136316
- return Boolean(session && !session.refreshToken && !session.cookie);
136865
+ return Boolean(session && !hasStoredRefreshToken(sessionId) && !session.cookie);
136317
136866
  };
136318
136867
  var isLegacySession = (sessionId) => {
136319
136868
  const session = getSession(sessionId);
@@ -136342,6 +136891,7 @@ var restoreCurrentSessionFallback = (preferredSessionId, fallbackSessionIds) =>
136342
136891
  var removeCurrentSession = () => {
136343
136892
  const current = globalConfig2.getCurrentSession();
136344
136893
  globalConfig2.setCurrentSession("");
136894
+ deleteStoredRefreshToken(current);
136345
136895
  globalConfig2.removeSession(current);
136346
136896
  };
136347
136897
  var deleteServerSession = async (sessionId) => {
@@ -136350,10 +136900,11 @@ var deleteServerSession = async (sessionId) => {
136350
136900
  return { deleted: false };
136351
136901
  }
136352
136902
  try {
136353
- if (session.refreshToken) {
136903
+ const refreshToken = getStoredRefreshToken(sessionId);
136904
+ if (refreshToken) {
136354
136905
  await revokeRefreshToken(
136355
136906
  session.endpoint,
136356
- session.refreshToken,
136907
+ refreshToken,
136357
136908
  session.clientId || OAUTH2_CLIENT_ID
136358
136909
  );
136359
136910
  return { deleted: true };
@@ -136383,12 +136934,14 @@ var logoutSessions = async (sessionIds) => {
136383
136934
  const errors = [];
136384
136935
  for (const sessionId of sessionIds) {
136385
136936
  if (isLocalOnlySession(sessionId)) {
136937
+ deleteStoredRefreshToken(sessionId);
136386
136938
  globalConfig2.removeSession(sessionId);
136387
136939
  continue;
136388
136940
  }
136389
136941
  globalConfig2.setCurrentSession(sessionId);
136390
136942
  const result = await deleteServerSession(sessionId);
136391
136943
  if (result.deleted) {
136944
+ deleteStoredRefreshToken(sessionId);
136392
136945
  globalConfig2.removeSession(sessionId);
136393
136946
  } else {
136394
136947
  failed++;
@@ -136409,6 +136962,7 @@ var removeLegacySessionsExcept = async (sessionIdToKeep) => {
136409
136962
  }
136410
136963
  const result = await deleteServerSession(sessionId);
136411
136964
  if (result.deleted) {
136965
+ deleteStoredRefreshToken(sessionId);
136412
136966
  globalConfig2.removeSession(sessionId);
136413
136967
  removed++;
136414
136968
  } else {
@@ -136461,6 +137015,40 @@ var startWaitingForApprovalSpinner = () => {
136461
137015
  process.stdout.write("\r\x1B[K");
136462
137016
  };
136463
137017
  };
137018
+ var listenForBrowserOpen = (url2, onCancel) => {
137019
+ const stdin = process.stdin;
137020
+ if (!stdin.isTTY) {
137021
+ return () => {
137022
+ };
137023
+ }
137024
+ const canSetRawMode = typeof stdin.setRawMode === "function";
137025
+ const shouldRestoreRawMode = canSetRawMode && stdin.isRaw !== true;
137026
+ if (shouldRestoreRawMode) {
137027
+ stdin.setRawMode?.(true);
137028
+ }
137029
+ stdin.resume();
137030
+ const cleanup = () => {
137031
+ stdin.off("data", onData);
137032
+ if (shouldRestoreRawMode) {
137033
+ stdin.setRawMode?.(false);
137034
+ }
137035
+ stdin.pause();
137036
+ };
137037
+ let opened = false;
137038
+ const onData = (data) => {
137039
+ if (data.includes(3) || data.includes(4)) {
137040
+ cleanup();
137041
+ onCancel();
137042
+ return;
137043
+ }
137044
+ if (!opened && (data.includes(13) || data.includes(10))) {
137045
+ opened = true;
137046
+ openBrowser(url2);
137047
+ }
137048
+ };
137049
+ stdin.on("data", onData);
137050
+ return cleanup;
137051
+ };
136464
137052
  var getCurrentAccount = async () => {
136465
137053
  if (globalConfig2.getEndpoint() === "" || !hasAuthSession()) {
136466
137054
  return null;
@@ -136638,10 +137226,20 @@ To sign in, confirm the code below in your browser:
136638
137226
  Code: ${deviceAuth.user_code}
136639
137227
  URL: ${verificationUri}
136640
137228
 
136641
- `
137229
+ ` + (process.stdin.isTTY ? "Press Enter to open this URL in your browser.\n\n" : "")
136642
137230
  );
136643
137231
  let token = null;
136644
137232
  const stopWaitingForApprovalSpinner = startWaitingForApprovalSpinner();
137233
+ const stopListeningForBrowserOpen = listenForBrowserOpen(
137234
+ verificationUri,
137235
+ () => {
137236
+ stopWaitingForApprovalSpinner();
137237
+ globalConfig2.removeSession(id);
137238
+ globalConfig2.setCurrentSession(oldCurrent);
137239
+ log("Login cancelled.");
137240
+ process.exit(130);
137241
+ }
137242
+ );
136645
137243
  try {
136646
137244
  token = await pollForDeviceToken(oauth22, deviceAuth, clientId);
136647
137245
  } catch (err) {
@@ -136650,6 +137248,7 @@ To sign in, confirm the code below in your browser:
136650
137248
  throw err;
136651
137249
  } finally {
136652
137250
  stopWaitingForApprovalSpinner();
137251
+ stopListeningForBrowserOpen();
136653
137252
  }
136654
137253
  if (!token || !token.access_token) {
136655
137254
  globalConfig2.removeSession(id);
@@ -136658,7 +137257,7 @@ To sign in, confirm the code below in your browser:
136658
137257
  }
136659
137258
  const tokenExpiry = Date.now() + token.expires_in * 1e3;
136660
137259
  globalConfig2.setAccessToken(token.access_token);
136661
- globalConfig2.setRefreshToken(token.refresh_token || "");
137260
+ setStoredRefreshToken(id, token.refresh_token || "");
136662
137261
  globalConfig2.setTokenExpiry(tokenExpiry);
136663
137262
  let tokenEmail = "";
136664
137263
  if (token.id_token) {
@@ -136680,6 +137279,7 @@ To sign in, confirm the code below in your browser:
136680
137279
  throw err;
136681
137280
  }
136682
137281
  globalConfig2.setEmail(account2.email);
137282
+ globalConfig2.removeCookie();
136683
137283
  const { removed: removedLegacySessions, failed: failedLegacySessions } = await removeLegacySessionsExcept(id);
136684
137284
  success2("Successfully signed in as " + globalConfig2.getEmail());
136685
137285
  if (removedLegacySessions > 0) {
@@ -151351,9 +151951,9 @@ var functionsListRuntimesCommand = functions.command(`list-runtimes`).descriptio
151351
151951
  async () => parse3(await (await getFunctionsClient()).listRuntimes())
151352
151952
  )
151353
151953
  );
151354
- var functionsListSpecificationsCommand = functions.command(`list-specifications`).description(`List allowed function specifications for this instance.`).action(
151954
+ var functionsListSpecificationsCommand = functions.command(`list-specifications`).description(`List allowed function specifications for this instance.`).option(`--type <type>`, `Specification type to list. Can be one of: runtimes, builds.`).action(
151355
151955
  actionRunner(
151356
- async () => parse3(await (await getFunctionsClient()).listSpecifications())
151956
+ async ({ type }) => parse3(await (await getFunctionsClient()).listSpecifications(type))
151357
151957
  )
151358
151958
  );
151359
151959
  var functionsListTemplatesCommand = functions.command(`list-templates`).description(`List available function templates. You can use template details in createFunction method.`).option(`--runtimes [runtimes...]`, `List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.`).option(`--use-cases [use-cases...]`, `List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.`).option(`--limit <limit>`, `Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.`, parseInteger).option(`--offset <offset>`, `Offset the list of returned templates. Maximum offset is 5000.`, parseInteger).option(
@@ -152371,14 +152971,14 @@ var oauth2ApproveCommand = oauth2.command(`approve`).description(`Approve an OAu
152371
152971
  async ({ grant_id, authorization_details }) => parse3(await (await getOauth2Client()).approve(grant_id, authorization_details))
152372
152972
  )
152373
152973
  );
152374
- var oauth2AuthorizeCommand = oauth2.command(`authorize`).description(`Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of \`application/json\` to receive a JSON response instead of a redirect.`).requiredOption(`--client-_id <client-_id>`, `OAuth2 client ID.`).requiredOption(`--redirect-_uri <redirect-_uri>`, `Redirect URI where visitor will be redirected after authorization, whether successful or not.`).requiredOption(`--response-_type <response-_type>`, `OAuth2 / OIDC response type. One of \`code\` (Authorization Code Flow), \`id_token\` (Implicit Flow, OIDC login only), or \`code id_token\` (Hybrid Flow).`).requiredOption(`--scope <scope>`, `Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: \`openid\`, \`email\`, \`profile\`.`).option(`--state <state>`, `OAuth2 state. You receive this back in the redirect URI.`).option(`--nonce <nonce>`, `OIDC nonce parameter to prevent replay attacks. Required when response_type includes \`id_token\`.`).option(`--code-_challenge <code-_challenge>`, `PKCE code challenge. Required when OAuth2 app is public.`).option(`--code-_challenge-_method <code-_challenge-_method>`, `PKCE code challenge method. Required when OAuth2 app is public.`).option(`--prompt <prompt>`, `OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.`).option(`--max-_age <max-_age>`, `OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required.`, parseInteger).option(`--authorization-_details <authorization-_details>`, `Rich authorization request. JSON array of objects, each with a \`type\` and project-defined fields`).action(
152974
+ var oauth2AuthorizeCommand = oauth2.command(`authorize`).description(`Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of \`application/json\` to receive a JSON response instead of a redirect.`).requiredOption(`--client-_id <client-_id>`, `OAuth2 client ID.`).requiredOption(`--redirect-_uri <redirect-_uri>`, `Redirect URI where visitor will be redirected after authorization, whether successful or not.`).requiredOption(`--response-_type <response-_type>`, `OAuth2 / OIDC response type. One of \`code\` (Authorization Code Flow), \`id_token\` (Implicit Flow, OIDC login only), or \`code id_token\` (Hybrid Flow).`).requiredOption(`--scope <scope>`, `Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: \`openid\`, \`email\`, \`profile\`.`).option(`--state <state>`, `OAuth2 state. You receive this back in the redirect URI.`).option(`--nonce <nonce>`, `OIDC nonce parameter to prevent replay attacks. Required when response_type includes \`id_token\`.`).option(`--code-_challenge <code-_challenge>`, `PKCE code challenge. Required when OAuth2 app is public.`).option(`--code-_challenge-_method <code-_challenge-_method>`, `PKCE code challenge method. Required when OAuth2 app is public.`).option(`--prompt <prompt>`, `OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account.`).option(`--max-_age <max-_age>`, `OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required.`, parseInteger).option(`--authorization-_details <authorization-_details>`, `Rich authorization request. JSON array of objects, each with a \`type\` and project-defined fields`).option(`--resource <resource>`, `RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.`).action(
152375
152975
  actionRunner(
152376
- async ({ client_id, redirect_uri, response_type, scope, state, nonce, code_challenge, code_challenge_method, prompt, max_age, authorization_details }) => parse3(await (await getOauth2Client()).authorize(client_id, redirect_uri, response_type, scope, state, nonce, code_challenge, code_challenge_method, prompt, max_age, authorization_details))
152976
+ async ({ client_id, redirect_uri, response_type, scope, state, nonce, code_challenge, code_challenge_method, prompt, max_age, authorization_details, resource }) => parse3(await (await getOauth2Client()).authorize(client_id, redirect_uri, response_type, scope, state, nonce, code_challenge, code_challenge_method, prompt, max_age, authorization_details, resource))
152377
152977
  )
152378
152978
  );
152379
- var oauth2CreateDeviceAuthorizationCommand = oauth2.command(`create-device-authorization`).description(`Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.`).option(`--client-_id <client-_id>`, `OAuth2 client ID.`).option(`--scope <scope>`, `Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: \`openid\`, \`email\`, \`profile\`.`).option(`--authorization-_details <authorization-_details>`, `Rich authorization request. JSON array of objects, each with a \`type\` and project-defined fields`).action(
152979
+ var oauth2CreateDeviceAuthorizationCommand = oauth2.command(`create-device-authorization`).description(`Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval.`).option(`--client-_id <client-_id>`, `OAuth2 client ID.`).option(`--scope <scope>`, `Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: \`openid\`, \`email\`, \`profile\`.`).option(`--authorization-_details <authorization-_details>`, `Rich authorization request. JSON array of objects, each with a \`type\` and project-defined fields`).option(`--resource <resource>`, `RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.`).action(
152380
152980
  actionRunner(
152381
- async ({ client_id, scope, authorization_details }) => parse3(await (await getOauth2Client()).createDeviceAuthorization(client_id, scope, authorization_details))
152981
+ async ({ client_id, scope, authorization_details, resource }) => parse3(await (await getOauth2Client()).createDeviceAuthorization(client_id, scope, authorization_details, resource))
152382
152982
  )
152383
152983
  );
152384
152984
  var oauth2CreateGrantCommand = oauth2.command(`create-grant`).description(`Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow.`).requiredOption(`--user-_code <user-_code>`, `User code displayed on the device.`).action(
@@ -152406,9 +153006,9 @@ var oauth2RevokeCommand = oauth2.command(`revoke`).description(`Revoke an OAuth2
152406
153006
  async ({ token, token_type_hint, client_id, client_secret }) => parse3(await (await getOauth2Client()).revoke(token, token_type_hint, client_id, client_secret))
152407
153007
  )
152408
153008
  );
152409
- var oauth2CreateTokenCommand = oauth2.command(`create-token`).description(`Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens.`).requiredOption(`--grant-_type <grant-_type>`, `OAuth2 grant type. Can be one of: \`authorization_code\`, \`refresh_token\`, \`urn:ietf:params:oauth:grant-type:device_code\`.`).option(`--code <code>`, `Authorization code to be exchanged for access and refresh tokens. Required for \`authorization_code\` grant type.`).option(`--refresh-_token <refresh-_token>`, `Refresh token to be exchanged for a new access and refresh tokens. Required for \`refresh_token\` grant type.`).option(`--device-_code <device-_code>`, `Device code obtained from the device authorization endpoint. Required for \`urn:ietf:params:oauth:grant-type:device_code\` grant type.`).option(`--client-_id <client-_id>`, `OAuth2 client ID.`).option(`--client-_secret <client-_secret>`, `OAuth2 client secret. Required for confidential apps.`).option(`--code-_verifier <code-_verifier>`, `PKCE code verifier. Required for public apps.`).option(`--redirect-_uri <redirect-_uri>`, `Redirect URI. Required for \`authorization_code\` grant type.`).action(
153009
+ var oauth2CreateTokenCommand = oauth2.command(`create-token`).description(`Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens.`).requiredOption(`--grant-_type <grant-_type>`, `OAuth2 grant type. Can be one of: \`authorization_code\`, \`refresh_token\`, \`urn:ietf:params:oauth:grant-type:device_code\`.`).option(`--code <code>`, `Authorization code to be exchanged for access and refresh tokens. Required for \`authorization_code\` grant type.`).option(`--refresh-_token <refresh-_token>`, `Refresh token to be exchanged for a new access and refresh tokens. Required for \`refresh_token\` grant type.`).option(`--device-_code <device-_code>`, `Device code obtained from the device authorization endpoint. Required for \`urn:ietf:params:oauth:grant-type:device_code\` grant type.`).option(`--client-_id <client-_id>`, `OAuth2 client ID.`).option(`--client-_secret <client-_secret>`, `OAuth2 client secret. Required for confidential apps.`).option(`--code-_verifier <code-_verifier>`, `PKCE code verifier. Required for public apps.`).option(`--redirect-_uri <redirect-_uri>`, `Redirect URI. Required for \`authorization_code\` grant type.`).option(`--resource <resource>`, `RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment.`).action(
152410
153010
  actionRunner(
152411
- async ({ grant_type, code, refresh_token, device_code, client_id, client_secret, code_verifier, redirect_uri }) => parse3(await (await getOauth2Client()).createToken(grant_type, code, refresh_token, device_code, client_id, client_secret, code_verifier, redirect_uri))
153011
+ async ({ grant_type, code, refresh_token, device_code, client_id, client_secret, code_verifier, redirect_uri, resource }) => parse3(await (await getOauth2Client()).createToken(grant_type, code, refresh_token, device_code, client_id, client_secret, code_verifier, redirect_uri, resource))
152412
153012
  )
152413
153013
  );
152414
153014
 
@@ -153739,9 +154339,9 @@ var sitesListFrameworksCommand = sites.command(`list-frameworks`).description(`G
153739
154339
  async () => parse3(await (await getSitesClient()).listFrameworks())
153740
154340
  )
153741
154341
  );
153742
- var sitesListSpecificationsCommand = sites.command(`list-specifications`).description(`List allowed site specifications for this instance.`).action(
154342
+ var sitesListSpecificationsCommand = sites.command(`list-specifications`).description(`List allowed site specifications for this instance.`).option(`--type <type>`, `Specification type to list. Can be one of: runtimes, builds.`).action(
153743
154343
  actionRunner(
153744
- async () => parse3(await (await getSitesClient()).listSpecifications())
154344
+ async ({ type }) => parse3(await (await getSitesClient()).listSpecifications(type))
153745
154345
  )
153746
154346
  );
153747
154347
  var sitesListTemplatesCommand = sites.command(`list-templates`).description(`List available site templates. You can use template details in createSite method.`).option(`--frameworks [frameworks...]`, `List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.`).option(`--use-cases [use-cases...]`, `List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.`).option(`--limit <limit>`, `Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.`, parseInteger).option(`--offset <offset>`, `Offset the list of returned templates. Maximum offset is 5000.`, parseInteger).action(