skapi-js 2.2.2 → 2.2.4

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/skapi.d.mts CHANGED
@@ -573,6 +573,7 @@ type RequestHistory = {
573
573
  created: number;
574
574
  updated: number;
575
575
  executed?: number;
576
+ responded?: number;
576
577
  request_body: any;
577
578
  expires?: number;
578
579
  status: 'pending' | 'running' | 'resolved' | 'failed';
@@ -1360,6 +1361,12 @@ declare class Skapi {
1360
1361
  /**
1361
1362
  * Queries unique ID records by unique_id or condition filters.
1362
1363
  *
1364
+ * With `condition` omitted the unique ID is matched exactly. `gte` / `>=`
1365
+ * is a prefix search ("unique IDs starting with x") and `lte` / `<=` is a
1366
+ * suffix search ("unique IDs ending with x"); `gt` / `>` and `lt` / `<`
1367
+ * are lexicographic. An 'ends with' search returns its matches in the
1368
+ * order of the unique ID read from its last character backwards.
1369
+ *
1363
1370
  * Refused to a signed out caller when the project's `require_login`
1364
1371
  * setting is on: REQUIRE_LOGIN from the SDK, INVALID_REQUEST from the
1365
1372
  * backend for a caller that skips it. A project that has never set the
@@ -1378,7 +1385,7 @@ declare class Skapi {
1378
1385
  getUniqueId(params?: Form<{
1379
1386
  /** Unique ID */
1380
1387
  unique_id?: string;
1381
- /** String query condition for the unique_id value. */
1388
+ /** String query condition for the unique_id value. Omitted: exact match. `gte` / `>=`: starts with. `lte` / `<=`: ends with. */
1382
1389
  condition?: Condition | 'ne' | '!=';
1383
1390
  }>, fetchOptions?: FetchOptions): Promise<DatabaseResponse<UniqueId>>;
1384
1391
  /**
@@ -2201,13 +2208,17 @@ declare class Skapi {
2201
2208
  * exactly. With `table` omitted entirely, every table is returned.
2202
2209
  * `gte` / `>=` is a prefix search ("table names starting with x"), while
2203
2210
  * `gt` / `>` is a lexicographic greater-than that spills past the prefix
2204
- * into every later table name.
2211
+ * into every later table name. `lte` / `<=` is a suffix search ("table
2212
+ * names ending with x"); its matches come back in the order of the name
2213
+ * read from its last character backwards.
2205
2214
  *
2206
2215
  * Every combination:
2207
2216
  * - `getTables({})`: every table in the project.
2208
2217
  * - `getTables({ table: 'x' })`: exact match on 'x'.
2209
2218
  * - `getTables({ table: 'x', condition: 'gte' })`: prefix, every table
2210
2219
  * name starting with 'x'.
2220
+ * - `getTables({ table: 'x', condition: 'lte' })`: suffix, every table
2221
+ * name ending with 'x'.
2211
2222
  * - `getTables({ table: '' })`: errors with '"table" should not be empty.'
2212
2223
  * - `getTables({ condition: 'gte' })` with no `table`: errors with
2213
2224
  * '"table" is required for condition.'
@@ -2250,7 +2261,7 @@ declare class Skapi {
2250
2261
  /** If omitted, fetches the full list of tables. */
2251
2262
  query?: {
2252
2263
  table?: string;
2253
- /** Condition operator of table name. Omitted: exact match on the given table name. `gte` / `>=`: prefix. */
2264
+ /** Condition operator of table name. Omitted: exact match on the given table name. `gte` / `>=`: starts with. `lte` / `<=`: ends with. */
2254
2265
  condition?: Condition;
2255
2266
  }, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Table>>;
2256
2267
  /**
@@ -2265,6 +2276,14 @@ declare class Skapi {
2265
2276
  * The only condition is `order.condition`, which requires `order.value`.
2266
2277
  * Omitting it matches `order.value` exactly.
2267
2278
  *
2279
+ * With `order.by: 'index_name'`, `order.value` is a piece of the name and
2280
+ * the condition searches the names: `>=` 'starts with', `<=` 'ends with',
2281
+ * `>` and `<` the names after and before it in order. 'Ends with' matches
2282
+ * the name segment right under `index` (or the first segment when `index`
2283
+ * is omitted), and returns what is nested under a match as well, the way
2284
+ * 'starts with' does: `index: 'Band.'` with `value: 'ers'` and `<=` finds
2285
+ * Band.Members, Band.Members.name and Band.Singers.
2286
+ *
2268
2287
  * Every combination (`table` is required, so there is no no-argument
2269
2288
  * form):
2270
2289
  * - `getIndexes({ table: 't' })`: every index of table 't'.
@@ -2274,6 +2293,12 @@ declare class Skapi {
2274
2293
  * the compound index, so Band.name, Band.year.
2275
2294
  * - `getIndexes({ table: 't', order: { by: 'index_name', value: 'B' } })`:
2276
2295
  * exact match against the value.
2296
+ * - `getIndexes({ table: 't', order: { by: 'index_name' } })`: every index
2297
+ * of the table, ordered by name.
2298
+ * - `getIndexes({ table: 't', order: { by: 'index_name', value: 'B', condition: '>=' } })`:
2299
+ * the index names that start with 'B'.
2300
+ * - `getIndexes({ table: 't', order: { by: 'index_name', value: 'e', condition: '<=' } })`:
2301
+ * the index names that end with 'e'.
2277
2302
  * - `getIndexes({ table: 't', order: { by: 'total_number' } })`: the whole
2278
2303
  * partition, ordered by that attribute.
2279
2304
  * - `order.condition` without `order.value`: errors.
@@ -2315,9 +2340,9 @@ declare class Skapi {
2315
2340
  order?: {
2316
2341
  /** Key name to order by. */
2317
2342
  by: 'average_number' | 'total_number' | 'number_count' | 'average_bool' | 'total_bool' | 'bool_count' | 'string_count' | 'index_name' | 'number_of_records';
2318
- /** Value to query. */
2343
+ /** Value to query. A string when "by" is 'index_name': a piece of the index name. */
2319
2344
  value?: number | boolean | string;
2320
- /** Requires "value". Omitted: exact match against "value". */
2345
+ /** Requires "value". Omitted: exact match against "value". With "by" 'index_name': `>=` starts with, `<=` ends with. */
2321
2346
  condition?: Condition;
2322
2347
  };
2323
2348
  }, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Index>>;
@@ -2328,7 +2353,9 @@ declare class Skapi {
2328
2353
  * `table` and `tag` together match the tag exactly, `table` alone is a
2329
2354
  * prefix ('>=') that lists every tag in that table, and neither one
2330
2355
  * returns every tag in the project, ordered by record count, descending.
2331
- * `gte` / `>=` is a prefix search.
2356
+ * `gte` / `>=` is a prefix search and `lte` / `<=` is a suffix search:
2357
+ * with `table` it finds the tags of that table that end with `tag`, and
2358
+ * with `tag` alone the tags that end with it in every table.
2332
2359
  *
2333
2360
  * Every combination:
2334
2361
  * - `getTags({})`: every tag in the project, ordered by record count,
@@ -2340,6 +2367,10 @@ declare class Skapi {
2340
2367
  * tables.
2341
2368
  * - `getTags({ table: 't', tag: 'g', condition: 'gte' })`: prefix, every
2342
2369
  * tag in 't' starting with 'g'.
2370
+ * - `getTags({ table: 't', tag: 'g', condition: 'lte' })`: suffix, every
2371
+ * tag in 't' ending with 'g'.
2372
+ * - `getTags({ tag: 'g', condition: 'lte' })` with no `table`: every tag
2373
+ * ending with 'g', in every table.
2343
2374
  * - `getTags({ condition: 'gte' })` with neither `table` nor `tag`: errors
2344
2375
  * with '"table" or "tag" is required for condition.'
2345
2376
  *
@@ -2376,7 +2407,7 @@ declare class Skapi {
2376
2407
  table?: string;
2377
2408
  /** Tag name */
2378
2409
  tag?: string;
2379
- /** String query condition for tag name. Omitted: exact match when `table` and `tag` are both given, prefix when only `table` is given. */
2410
+ /** String query condition for tag name. Omitted: exact match when `table` and `tag` are both given, prefix when only `table` is given. `gte` / `>=`: starts with. `lte` / `<=`: ends with. */
2380
2411
  condition?: Condition;
2381
2412
  }, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Tag>>;
2382
2413
  /**
@@ -2779,11 +2810,16 @@ declare class Skapi {
2779
2810
  */
2780
2811
  signup_confirmation?: boolean | string;
2781
2812
  /**
2782
- * When true, user will be subscribed to Service Email (group 1) once they are signed up.
2783
- * User's signup confirmation is required for this parameter.
2813
+ * The newsletter the user is subscribed to once they confirm their e-mail, with no
2814
+ * newsletter confirmation e-mail of its own.
2815
+ * `0` or `'public'`: the public newsletter. `1` or `'authorized'`: Service Email.
2816
+ * The name of a named newsletter group: that group, which has to exist and whose
2817
+ * restriction the account has to meet. `true`: Service Email, as before.
2818
+ * User's signup confirmation is required for this parameter: a user whose e-mail is
2819
+ * never confirmed is never subscribed.
2784
2820
  * Default is false.
2785
2821
  */
2786
- email_subscription?: boolean;
2822
+ email_subscription?: boolean | number | string;
2787
2823
  /**
2788
2824
  * Automatically login to account after signup. Will not work if signup confirmation is required.
2789
2825
  */
package/dist/skapi.d.ts CHANGED
@@ -573,6 +573,7 @@ type RequestHistory = {
573
573
  created: number;
574
574
  updated: number;
575
575
  executed?: number;
576
+ responded?: number;
576
577
  request_body: any;
577
578
  expires?: number;
578
579
  status: 'pending' | 'running' | 'resolved' | 'failed';
@@ -1360,6 +1361,12 @@ declare class Skapi {
1360
1361
  /**
1361
1362
  * Queries unique ID records by unique_id or condition filters.
1362
1363
  *
1364
+ * With `condition` omitted the unique ID is matched exactly. `gte` / `>=`
1365
+ * is a prefix search ("unique IDs starting with x") and `lte` / `<=` is a
1366
+ * suffix search ("unique IDs ending with x"); `gt` / `>` and `lt` / `<`
1367
+ * are lexicographic. An 'ends with' search returns its matches in the
1368
+ * order of the unique ID read from its last character backwards.
1369
+ *
1363
1370
  * Refused to a signed out caller when the project's `require_login`
1364
1371
  * setting is on: REQUIRE_LOGIN from the SDK, INVALID_REQUEST from the
1365
1372
  * backend for a caller that skips it. A project that has never set the
@@ -1378,7 +1385,7 @@ declare class Skapi {
1378
1385
  getUniqueId(params?: Form<{
1379
1386
  /** Unique ID */
1380
1387
  unique_id?: string;
1381
- /** String query condition for the unique_id value. */
1388
+ /** String query condition for the unique_id value. Omitted: exact match. `gte` / `>=`: starts with. `lte` / `<=`: ends with. */
1382
1389
  condition?: Condition | 'ne' | '!=';
1383
1390
  }>, fetchOptions?: FetchOptions): Promise<DatabaseResponse<UniqueId>>;
1384
1391
  /**
@@ -2201,13 +2208,17 @@ declare class Skapi {
2201
2208
  * exactly. With `table` omitted entirely, every table is returned.
2202
2209
  * `gte` / `>=` is a prefix search ("table names starting with x"), while
2203
2210
  * `gt` / `>` is a lexicographic greater-than that spills past the prefix
2204
- * into every later table name.
2211
+ * into every later table name. `lte` / `<=` is a suffix search ("table
2212
+ * names ending with x"); its matches come back in the order of the name
2213
+ * read from its last character backwards.
2205
2214
  *
2206
2215
  * Every combination:
2207
2216
  * - `getTables({})`: every table in the project.
2208
2217
  * - `getTables({ table: 'x' })`: exact match on 'x'.
2209
2218
  * - `getTables({ table: 'x', condition: 'gte' })`: prefix, every table
2210
2219
  * name starting with 'x'.
2220
+ * - `getTables({ table: 'x', condition: 'lte' })`: suffix, every table
2221
+ * name ending with 'x'.
2211
2222
  * - `getTables({ table: '' })`: errors with '"table" should not be empty.'
2212
2223
  * - `getTables({ condition: 'gte' })` with no `table`: errors with
2213
2224
  * '"table" is required for condition.'
@@ -2250,7 +2261,7 @@ declare class Skapi {
2250
2261
  /** If omitted, fetches the full list of tables. */
2251
2262
  query?: {
2252
2263
  table?: string;
2253
- /** Condition operator of table name. Omitted: exact match on the given table name. `gte` / `>=`: prefix. */
2264
+ /** Condition operator of table name. Omitted: exact match on the given table name. `gte` / `>=`: starts with. `lte` / `<=`: ends with. */
2254
2265
  condition?: Condition;
2255
2266
  }, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Table>>;
2256
2267
  /**
@@ -2265,6 +2276,14 @@ declare class Skapi {
2265
2276
  * The only condition is `order.condition`, which requires `order.value`.
2266
2277
  * Omitting it matches `order.value` exactly.
2267
2278
  *
2279
+ * With `order.by: 'index_name'`, `order.value` is a piece of the name and
2280
+ * the condition searches the names: `>=` 'starts with', `<=` 'ends with',
2281
+ * `>` and `<` the names after and before it in order. 'Ends with' matches
2282
+ * the name segment right under `index` (or the first segment when `index`
2283
+ * is omitted), and returns what is nested under a match as well, the way
2284
+ * 'starts with' does: `index: 'Band.'` with `value: 'ers'` and `<=` finds
2285
+ * Band.Members, Band.Members.name and Band.Singers.
2286
+ *
2268
2287
  * Every combination (`table` is required, so there is no no-argument
2269
2288
  * form):
2270
2289
  * - `getIndexes({ table: 't' })`: every index of table 't'.
@@ -2274,6 +2293,12 @@ declare class Skapi {
2274
2293
  * the compound index, so Band.name, Band.year.
2275
2294
  * - `getIndexes({ table: 't', order: { by: 'index_name', value: 'B' } })`:
2276
2295
  * exact match against the value.
2296
+ * - `getIndexes({ table: 't', order: { by: 'index_name' } })`: every index
2297
+ * of the table, ordered by name.
2298
+ * - `getIndexes({ table: 't', order: { by: 'index_name', value: 'B', condition: '>=' } })`:
2299
+ * the index names that start with 'B'.
2300
+ * - `getIndexes({ table: 't', order: { by: 'index_name', value: 'e', condition: '<=' } })`:
2301
+ * the index names that end with 'e'.
2277
2302
  * - `getIndexes({ table: 't', order: { by: 'total_number' } })`: the whole
2278
2303
  * partition, ordered by that attribute.
2279
2304
  * - `order.condition` without `order.value`: errors.
@@ -2315,9 +2340,9 @@ declare class Skapi {
2315
2340
  order?: {
2316
2341
  /** Key name to order by. */
2317
2342
  by: 'average_number' | 'total_number' | 'number_count' | 'average_bool' | 'total_bool' | 'bool_count' | 'string_count' | 'index_name' | 'number_of_records';
2318
- /** Value to query. */
2343
+ /** Value to query. A string when "by" is 'index_name': a piece of the index name. */
2319
2344
  value?: number | boolean | string;
2320
- /** Requires "value". Omitted: exact match against "value". */
2345
+ /** Requires "value". Omitted: exact match against "value". With "by" 'index_name': `>=` starts with, `<=` ends with. */
2321
2346
  condition?: Condition;
2322
2347
  };
2323
2348
  }, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Index>>;
@@ -2328,7 +2353,9 @@ declare class Skapi {
2328
2353
  * `table` and `tag` together match the tag exactly, `table` alone is a
2329
2354
  * prefix ('>=') that lists every tag in that table, and neither one
2330
2355
  * returns every tag in the project, ordered by record count, descending.
2331
- * `gte` / `>=` is a prefix search.
2356
+ * `gte` / `>=` is a prefix search and `lte` / `<=` is a suffix search:
2357
+ * with `table` it finds the tags of that table that end with `tag`, and
2358
+ * with `tag` alone the tags that end with it in every table.
2332
2359
  *
2333
2360
  * Every combination:
2334
2361
  * - `getTags({})`: every tag in the project, ordered by record count,
@@ -2340,6 +2367,10 @@ declare class Skapi {
2340
2367
  * tables.
2341
2368
  * - `getTags({ table: 't', tag: 'g', condition: 'gte' })`: prefix, every
2342
2369
  * tag in 't' starting with 'g'.
2370
+ * - `getTags({ table: 't', tag: 'g', condition: 'lte' })`: suffix, every
2371
+ * tag in 't' ending with 'g'.
2372
+ * - `getTags({ tag: 'g', condition: 'lte' })` with no `table`: every tag
2373
+ * ending with 'g', in every table.
2343
2374
  * - `getTags({ condition: 'gte' })` with neither `table` nor `tag`: errors
2344
2375
  * with '"table" or "tag" is required for condition.'
2345
2376
  *
@@ -2376,7 +2407,7 @@ declare class Skapi {
2376
2407
  table?: string;
2377
2408
  /** Tag name */
2378
2409
  tag?: string;
2379
- /** String query condition for tag name. Omitted: exact match when `table` and `tag` are both given, prefix when only `table` is given. */
2410
+ /** String query condition for tag name. Omitted: exact match when `table` and `tag` are both given, prefix when only `table` is given. `gte` / `>=`: starts with. `lte` / `<=`: ends with. */
2380
2411
  condition?: Condition;
2381
2412
  }, fetchOptions?: FetchOptions): Promise<DatabaseResponse<Tag>>;
2382
2413
  /**
@@ -2779,11 +2810,16 @@ declare class Skapi {
2779
2810
  */
2780
2811
  signup_confirmation?: boolean | string;
2781
2812
  /**
2782
- * When true, user will be subscribed to Service Email (group 1) once they are signed up.
2783
- * User's signup confirmation is required for this parameter.
2813
+ * The newsletter the user is subscribed to once they confirm their e-mail, with no
2814
+ * newsletter confirmation e-mail of its own.
2815
+ * `0` or `'public'`: the public newsletter. `1` or `'authorized'`: Service Email.
2816
+ * The name of a named newsletter group: that group, which has to exist and whose
2817
+ * restriction the account has to meet. `true`: Service Email, as before.
2818
+ * User's signup confirmation is required for this parameter: a user whose e-mail is
2819
+ * never confirmed is never subscribed.
2784
2820
  * Default is false.
2785
2821
  */
2786
- email_subscription?: boolean;
2822
+ email_subscription?: boolean | number | string;
2787
2823
  /**
2788
2824
  * Automatically login to account after signup. Will not work if signup confirmation is required.
2789
2825
  */