definitions.h
Go to the documentation of this file.
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#define UPLINK_DISABLE_NAMESPACE_COMPAT NULL
#include <assert.h>
#include <node_api.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include "../uplink_definitions.h"
#include "../libuplinkc.h"
using std::string;
using std::swap;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkProject project_result;
char *bucketName;
UplinkObjectIterator *objectIterator;
UplinkListObjectsOptions list_object_options;
int listObjectSet;
} listObjectPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkDownload download_result;
UplinkObjectResult object_result;
} downloadInfoObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkDownload download_result;
UplinkError* error_result;
} downloadCloseObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
void *bufferPtr;
size_t bufferlength;
UplinkDownload download_result;
UplinkReadResult read_result;
} downloadReadObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
char* bucketname;
char* objectkey;
UplinkProject project;
UplinkDownloadResult download_result;
UplinkDownloadOptions downloadOption;
int downloadoptionSet;
} downloadObjectObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkUpload upload_result;
UplinkCustomMetadata customMetadata;
UplinkError* error_result;
} uploadSetMetaObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkUpload upload_result;
UplinkError* error_result;
} uploadAbortPromiseObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkUpload upload_result;
UplinkObjectResult object_result;
} uploadInfoObj;
//
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkUpload upload_result;
UplinkError* error_result;
} uploadCommitObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
void *bufferPtr;
size_t bytesread;
UplinkUpload upload_result;
UplinkWriteResult write_result;
} uploadWriteObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
char* bucketname;
char* objectkey;
UplinkProject project;
UplinkUploadResult upload_result;
UplinkUploadOptions uploadOptions;
int uploadoptionSet;
} uploadobjectObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
char* bucketname;
char* objectkey;
UplinkProject project;
UplinkObjectResult object_result;
} objectOperationObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
char* bucketname;
UplinkProject project;
UplinkBucketResult bucket_Result;
} bucketOperationObj;
typedef struct{
UplinkProject project_result;
UplinkListBucketsOptions listBucketsOptions;
UplinkBucketIterator *bucket_resultIterator;
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
int listBucketOptionSet;
} ListBucketsPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkProject project_result;
UplinkError* error_result;
} closeProjectPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccess access;
UplinkProjectResult project_Result;
UplinkConfig config;
} configOpenProjectPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccess access;
UplinkProjectResult project_Result;
} openProjectPromiseObj;
typedef struct {
char *accessString;
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccessResult access_Result;
} ParseAccessPromiseObj;
typedef struct {
char* satellite_address;
char* api_key;
char* passphrase;
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccessResult access_Result;
} RequestAccessPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccess access;
UplinkAccessResult access_Result;
int64_t SharePrefixSize;
UplinkSharePrefix* SharePrefixListPointer;
UplinkPermission permission;
} AccessSharePromiseObj;
typedef struct {
char* satellite_address;
char* api_key;
char* passphrase;
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccessResult access_Result;
UplinkConfig config;
} ConfigRequestAccessPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccess access;
UplinkStringResult string_result;
} accessSerializePromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccess access;
char* passphrase;
int64_t saltSize;
char* saltCharArrayPointer;
UplinkEncryptionKeyResult encryptionResult;
} deriveEncrpPromiseObj;
typedef struct {
int async_action_status;
napi_deferred deferred;
napi_async_work work;
napi_value result;
UplinkAccess access;
char* bucket;
char* prefix;
UplinkEncryptionKey encryptionKey;
UplinkError* error_result;
} accessOverRidePromiseObj;
#endif //DEFINITIONS_H
downloadObjectObj::deferred
napi_deferred deferred
Definition: definitions.h:65
RequestAccessPromiseObj::access_Result
UplinkAccessResult access_Result
Definition: definitions.h:218
uploadobjectObj::async_action_status
int async_action_status
Definition: definitions.h:129
ListBucketsPromiseObj::project_result
UplinkProject project_result
Definition: definitions.h:163
RequestAccessPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:215
deriveEncrpPromiseObj::saltSize
int64_t saltSize
Definition: definitions.h:261
deriveEncrpPromiseObj
Definition: definitions.h:254
listObjectPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:20
uploadSetMetaObj::work
napi_async_work work
Definition: definitions.h:80
configOpenProjectPromiseObj::access
UplinkAccess access
Definition: definitions.h:187
uploadSetMetaObj::async_action_status
int async_action_status
Definition: definitions.h:78
downloadReadObj
Definition: definitions.h:51
deriveEncrpPromiseObj::work
napi_async_work work
Definition: definitions.h:257
downloadObjectObj::work
napi_async_work work
Definition: definitions.h:66
ParseAccessPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:203
accessSerializePromiseObj::access
UplinkAccess access
Definition: definitions.h:250
downloadReadObj::async_action_status
int async_action_status
Definition: definitions.h:52
AccessSharePromiseObj::result
napi_value result
Definition: definitions.h:225
downloadReadObj::work
napi_async_work work
Definition: definitions.h:54
bucketOperationObj::work
napi_async_work work
Definition: definitions.h:155
accessOverRidePromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:268
accessSerializePromiseObj::result
napi_value result
Definition: definitions.h:249
uploadInfoObj::result
napi_value result
Definition: definitions.h:102
downloadInfoObj::download_result
UplinkDownload download_result
Definition: definitions.h:36
uploadWriteObj::deferred
napi_deferred deferred
Definition: definitions.h:119
downloadReadObj::bufferlength
size_t bufferlength
Definition: definitions.h:57
deriveEncrpPromiseObj::result
napi_value result
Definition: definitions.h:258
objectOperationObj::deferred
napi_deferred deferred
Definition: definitions.h:143
downloadObjectObj::result
napi_value result
Definition: definitions.h:67
ParseAccessPromiseObj::access_Result
UplinkAccessResult access_Result
Definition: definitions.h:207
uploadInfoObj::object_result
UplinkObjectResult object_result
Definition: definitions.h:104
AccessSharePromiseObj
Definition: definitions.h:221
ConfigRequestAccessPromiseObj::access_Result
UplinkAccessResult access_Result
Definition: definitions.h:241
ConfigRequestAccessPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:238
ConfigRequestAccessPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:237
ConfigRequestAccessPromiseObj::config
UplinkConfig config
Definition: definitions.h:242
uploadAbortPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:89
ParseAccessPromiseObj::accessString
char * accessString
Definition: definitions.h:202
uploadCommitObj::deferred
napi_deferred deferred
Definition: definitions.h:110
uploadCommitObj::error_result
UplinkError * error_result
Definition: definitions.h:114
listObjectPromiseObj::project_result
UplinkProject project_result
Definition: definitions.h:23
uploadAbortPromiseObj::upload_result
UplinkUpload upload_result
Definition: definitions.h:93
uploadCommitObj
Definition: definitions.h:108
ListBucketsPromiseObj::result
napi_value result
Definition: definitions.h:169
objectOperationObj::project
UplinkProject project
Definition: definitions.h:148
uploadWriteObj::bytesread
size_t bytesread
Definition: definitions.h:123
downloadObjectObj::objectkey
char * objectkey
Definition: definitions.h:69
ListBucketsPromiseObj::bucket_resultIterator
UplinkBucketIterator * bucket_resultIterator
Definition: definitions.h:165
listObjectPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:19
downloadObjectObj::downloadoptionSet
int downloadoptionSet
Definition: definitions.h:73
uploadCommitObj::upload_result
UplinkUpload upload_result
Definition: definitions.h:113
uploadobjectObj::deferred
napi_deferred deferred
Definition: definitions.h:130
uploadCommitObj::async_action_status
int async_action_status
Definition: definitions.h:109
uploadInfoObj::async_action_status
int async_action_status
Definition: definitions.h:99
downloadCloseObj::download_result
UplinkDownload download_result
Definition: definitions.h:46
downloadReadObj::read_result
UplinkReadResult read_result
Definition: definitions.h:59
RequestAccessPromiseObj
Definition: definitions.h:210
downloadObjectObj::download_result
UplinkDownloadResult download_result
Definition: definitions.h:71
closeProjectPromiseObj::result
napi_value result
Definition: definitions.h:177
configOpenProjectPromiseObj::project_Result
UplinkProjectResult project_Result
Definition: definitions.h:188
uploadobjectObj::work
napi_async_work work
Definition: definitions.h:131
configOpenProjectPromiseObj::result
napi_value result
Definition: definitions.h:186
RequestAccessPromiseObj::work
napi_async_work work
Definition: definitions.h:216
AccessSharePromiseObj::access_Result
UplinkAccessResult access_Result
Definition: definitions.h:227
accessOverRidePromiseObj::encryptionKey
UplinkEncryptionKey encryptionKey
Definition: definitions.h:274
AccessSharePromiseObj::SharePrefixListPointer
UplinkSharePrefix * SharePrefixListPointer
Definition: definitions.h:229
uploadobjectObj::uploadOptions
UplinkUploadOptions uploadOptions
Definition: definitions.h:137
objectOperationObj::objectkey
char * objectkey
Definition: definitions.h:147
listObjectPromiseObj::listObjectSet
int listObjectSet
Definition: definitions.h:27
accessOverRidePromiseObj::prefix
char * prefix
Definition: definitions.h:273
downloadReadObj::bufferPtr
void * bufferPtr
Definition: definitions.h:56
openProjectPromiseObj::access
UplinkAccess access
Definition: definitions.h:197
closeProjectPromiseObj::error_result
UplinkError * error_result
Definition: definitions.h:179
RequestAccessPromiseObj::passphrase
char * passphrase
Definition: definitions.h:213
uploadAbortPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:90
objectOperationObj::work
napi_async_work work
Definition: definitions.h:144
uploadAbortPromiseObj::result
napi_value result
Definition: definitions.h:92
listObjectPromiseObj::objectIterator
UplinkObjectIterator * objectIterator
Definition: definitions.h:25
openProjectPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:194
openProjectPromiseObj::result
napi_value result
Definition: definitions.h:196
ConfigRequestAccessPromiseObj
Definition: definitions.h:233
AccessSharePromiseObj::async_action_status
int async_action_status
Definition: definitions.h:222
AccessSharePromiseObj::work
napi_async_work work
Definition: definitions.h:224
downloadInfoObj
Definition: definitions.h:31
closeProjectPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:174
configOpenProjectPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:184
downloadInfoObj::result
napi_value result
Definition: definitions.h:35
accessOverRidePromiseObj::access
UplinkAccess access
Definition: definitions.h:271
listObjectPromiseObj::work
napi_async_work work
Definition: definitions.h:21
closeProjectPromiseObj::work
napi_async_work work
Definition: definitions.h:176
openProjectPromiseObj
Definition: definitions.h:192
bucketOperationObj::result
napi_value result
Definition: definitions.h:156
downloadCloseObj
Definition: definitions.h:41
bucketOperationObj::deferred
napi_deferred deferred
Definition: definitions.h:154
downloadInfoObj::async_action_status
int async_action_status
Definition: definitions.h:32
downloadInfoObj::deferred
napi_deferred deferred
Definition: definitions.h:33
downloadCloseObj::deferred
napi_deferred deferred
Definition: definitions.h:43
deriveEncrpPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:256
uploadSetMetaObj::customMetadata
UplinkCustomMetadata customMetadata
Definition: definitions.h:83
accessOverRidePromiseObj::work
napi_async_work work
Definition: definitions.h:269
openProjectPromiseObj::work
napi_async_work work
Definition: definitions.h:195
uploadWriteObj
Definition: definitions.h:117
accessSerializePromiseObj::async_action_status
int async_action_status
Definition: definitions.h:246
configOpenProjectPromiseObj::config
UplinkConfig config
Definition: definitions.h:189
bucketOperationObj
Definition: definitions.h:152
ListBucketsPromiseObj
Definition: definitions.h:162
accessOverRidePromiseObj::result
napi_value result
Definition: definitions.h:270
uploadWriteObj::bufferPtr
void * bufferPtr
Definition: definitions.h:122
uploadWriteObj::write_result
UplinkWriteResult write_result
Definition: definitions.h:125
AccessSharePromiseObj::access
UplinkAccess access
Definition: definitions.h:226
bucketOperationObj::bucket_Result
UplinkBucketResult bucket_Result
Definition: definitions.h:159
closeProjectPromiseObj
Definition: definitions.h:173
openProjectPromiseObj::project_Result
UplinkProjectResult project_Result
Definition: definitions.h:198
uploadInfoObj
Definition: definitions.h:98
downloadObjectObj::project
UplinkProject project
Definition: definitions.h:70
uploadWriteObj::upload_result
UplinkUpload upload_result
Definition: definitions.h:124
accessOverRidePromiseObj::bucket
char * bucket
Definition: definitions.h:272
openProjectPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:193
uploadobjectObj::bucketname
char * bucketname
Definition: definitions.h:133
AccessSharePromiseObj::SharePrefixSize
int64_t SharePrefixSize
Definition: definitions.h:228
ParseAccessPromiseObj::result
napi_value result
Definition: definitions.h:206
ParseAccessPromiseObj::work
napi_async_work work
Definition: definitions.h:205
uploadWriteObj::work
napi_async_work work
Definition: definitions.h:120
accessOverRidePromiseObj
Definition: definitions.h:266
uploadInfoObj::upload_result
UplinkUpload upload_result
Definition: definitions.h:103
uploadAbortPromiseObj::work
napi_async_work work
Definition: definitions.h:91
RequestAccessPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:214
ListBucketsPromiseObj::work
napi_async_work work
Definition: definitions.h:168
downloadObjectObj::async_action_status
int async_action_status
Definition: definitions.h:64
listObjectPromiseObj
Definition: definitions.h:18
deriveEncrpPromiseObj::access
UplinkAccess access
Definition: definitions.h:259
listObjectPromiseObj::result
napi_value result
Definition: definitions.h:22
downloadCloseObj::result
napi_value result
Definition: definitions.h:45
RequestAccessPromiseObj::result
napi_value result
Definition: definitions.h:217
uploadobjectObj::objectkey
char * objectkey
Definition: definitions.h:134
AccessSharePromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:223
ListBucketsPromiseObj::listBucketOptionSet
int listBucketOptionSet
Definition: definitions.h:170
AccessSharePromiseObj::permission
UplinkPermission permission
Definition: definitions.h:230
downloadObjectObj::downloadOption
UplinkDownloadOptions downloadOption
Definition: definitions.h:72
listObjectPromiseObj::bucketName
char * bucketName
Definition: definitions.h:24
uploadSetMetaObj::deferred
napi_deferred deferred
Definition: definitions.h:79
closeProjectPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:175
ListBucketsPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:167
downloadReadObj::deferred
napi_deferred deferred
Definition: definitions.h:53
RequestAccessPromiseObj::api_key
char * api_key
Definition: definitions.h:212
downloadCloseObj::work
napi_async_work work
Definition: definitions.h:44
uploadSetMetaObj::result
napi_value result
Definition: definitions.h:81
ParseAccessPromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:204
ConfigRequestAccessPromiseObj::result
napi_value result
Definition: definitions.h:240
bucketOperationObj::project
UplinkProject project
Definition: definitions.h:158
ConfigRequestAccessPromiseObj::passphrase
char * passphrase
Definition: definitions.h:236
deriveEncrpPromiseObj::passphrase
char * passphrase
Definition: definitions.h:260
objectOperationObj::result
napi_value result
Definition: definitions.h:145
ConfigRequestAccessPromiseObj::work
napi_async_work work
Definition: definitions.h:239
objectOperationObj
Definition: definitions.h:141
uploadobjectObj::uploadoptionSet
int uploadoptionSet
Definition: definitions.h:138
bucketOperationObj::bucketname
char * bucketname
Definition: definitions.h:157
RequestAccessPromiseObj::satellite_address
char * satellite_address
Definition: definitions.h:211
accessOverRidePromiseObj::async_action_status
int async_action_status
Definition: definitions.h:267
deriveEncrpPromiseObj::encryptionResult
UplinkEncryptionKeyResult encryptionResult
Definition: definitions.h:263
downloadObjectObj
Definition: definitions.h:63
configOpenProjectPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:183
ListBucketsPromiseObj::listBucketsOptions
UplinkListBucketsOptions listBucketsOptions
Definition: definitions.h:164
uploadAbortPromiseObj::error_result
UplinkError * error_result
Definition: definitions.h:94
uploadobjectObj::result
napi_value result
Definition: definitions.h:132
accessOverRidePromiseObj::error_result
UplinkError * error_result
Definition: definitions.h:275
objectOperationObj::async_action_status
int async_action_status
Definition: definitions.h:142
bucketOperationObj::async_action_status
int async_action_status
Definition: definitions.h:153
uploadSetMetaObj::error_result
UplinkError * error_result
Definition: definitions.h:84
accessSerializePromiseObj::string_result
UplinkStringResult string_result
Definition: definitions.h:251
ConfigRequestAccessPromiseObj::api_key
char * api_key
Definition: definitions.h:235
objectOperationObj::bucketname
char * bucketname
Definition: definitions.h:146
ParseAccessPromiseObj
Definition: definitions.h:201
ConfigRequestAccessPromiseObj::satellite_address
char * satellite_address
Definition: definitions.h:234
configOpenProjectPromiseObj
Definition: definitions.h:182
listObjectPromiseObj::list_object_options
UplinkListObjectsOptions list_object_options
Definition: definitions.h:26
uploadSetMetaObj::upload_result
UplinkUpload upload_result
Definition: definitions.h:82
deriveEncrpPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:255
uploadobjectObj
Definition: definitions.h:128
downloadReadObj::result
napi_value result
Definition: definitions.h:55
uploadWriteObj::result
napi_value result
Definition: definitions.h:121
accessSerializePromiseObj::work
napi_async_work work
Definition: definitions.h:248
uploadCommitObj::result
napi_value result
Definition: definitions.h:112
uploadInfoObj::deferred
napi_deferred deferred
Definition: definitions.h:100
downloadCloseObj::error_result
UplinkError * error_result
Definition: definitions.h:47
uploadAbortPromiseObj
Definition: definitions.h:88
uploadWriteObj::async_action_status
int async_action_status
Definition: definitions.h:118
uploadobjectObj::project
UplinkProject project
Definition: definitions.h:135
ListBucketsPromiseObj::async_action_status
int async_action_status
Definition: definitions.h:166
closeProjectPromiseObj::project_result
UplinkProject project_result
Definition: definitions.h:178
downloadCloseObj::async_action_status
int async_action_status
Definition: definitions.h:42
deriveEncrpPromiseObj::saltCharArrayPointer
char * saltCharArrayPointer
Definition: definitions.h:262
configOpenProjectPromiseObj::work
napi_async_work work
Definition: definitions.h:185
uploadobjectObj::upload_result
UplinkUploadResult upload_result
Definition: definitions.h:136
accessSerializePromiseObj::deferred
napi_deferred deferred
Definition: definitions.h:247
uploadSetMetaObj
Definition: definitions.h:77
downloadReadObj::download_result
UplinkDownload download_result
Definition: definitions.h:58
uploadInfoObj::work
napi_async_work work
Definition: definitions.h:101
downloadInfoObj::work
napi_async_work work
Definition: definitions.h:34
objectOperationObj::object_result
UplinkObjectResult object_result
Definition: definitions.h:149
downloadObjectObj::bucketname
char * bucketname
Definition: definitions.h:68
uploadCommitObj::work
napi_async_work work
Definition: definitions.h:111
downloadInfoObj::object_result
UplinkObjectResult object_result
Definition: definitions.h:37
accessSerializePromiseObj
Definition: definitions.h:245